- 浏览: 215361 次
- 性别:
- 来自: 长沙
-
最新评论
-
liveimain001:
写的挺好的,thx
Tuxedo ubbconfig配置详解 -
liwanfeng:
问题已经解决了正确的参数应该是 -DproxySet=true ...
Eclipse -
liwanfeng:
真不好意思问一下,我的怎么不行啊?
Eclipse -
cuixiping:
不大实用。只要有 dateAdd, dateDiff 差不多就 ...
日期处理通用函数 -
snoopy3384:
谢谢分享!
PL/SQL 基本函数
文章列表
/* 假定这个链表只有奇数个节点 */
List *list_middle(List *l)
{
List *fast;
List *slow;
fast = slow = l;
while (fast != NULL) {
if (fast->next)
fast = fast->next->next;
else
return slow;
slow = slow->next;
}
retur ...
/* 编程打印出如下图形 */
*
*.*.
*..*..*..
*...*...*...*...
*....*....*....*....*....
*.....*.....*.....*.....*.....*.....
*......*......*......*......*......*......*......
*.......*.......*.......*.......*.......*.......*.......*.......
void broom(int n)
{
int i, j, k;
for (i = 1; ...
ifconfig | grep -A 1 'eth0' | grep 'inet addr:' | \
sed 's/.*inet addr://g' | sed 's/[[:blank:]]*Bcast.*//g'
#!/bin/sh
#
# Line Counter
#
# Usage: lcnt dir suffix1, suffix2, suffix3 ...
#
v_dir="$1"
v_linenum=0
if [ $# = 0 ]; then
echo "============================================="
echo "Usage: lcnt dir suffix1 suffix2 suffix3 ... "
echo " ...
#!/bin/sh
#
# Name: add_del_mod.sh configure file operation script.
#
# Version: 1.0.0 05-Dec-2008
# Author : tcaosmail@gmail.com
#
# Description:
# add, delete and modify specified record in a
# configure file according to parameters.
#
# Synopsis: add_del_mod FILE [ADD|DEL|MOD] ...
例如:
str1为 "asdfsa123fasdf123452345fasfasdf182734891624389sadfaklsjfklj"
str2为 "0123456789"
删除后
str1为 "asdfsafasdffasfasdfsadfaklsjfklj"
void del_chars(char *str, char *chars)
{
char ascii_buff[256] = {0};
char buf[strlen(str)];
char *ps1;
char *ps ...
- 2008-12-10 18:00
- 浏览 3193
- 评论(0)
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char **argv)
{
if (argc != 2) {
printf("Usage: ./a.out <num>\n");
exit(EXIT_FAILURE);
}
int n = atoi(argv[1]);
int arr[n + 1];
// init ...
//config.h
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#define MAXLEN 256
struct PNode {
char *key;
char *value;
struct PNode *next;
};
typedef struct {
char *file;
struct PNode *first;
} Co ...
- 2008-10-13 16:43
- 浏览 1942
- 评论(0)
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define IN 1
#define OUT 0
int main(int argc, char **argv)
{
int count = 0;
int status = OUT;
char c;
while ( (c = getchar()) != EOF) {
if (c != ' ' && c != '\t' && ...
- 2008-10-07 14:03
- 浏览 1086
- 评论(0)
有一整型一维数组,要求在时间复杂度为O(N)的情况下,把小于零的数置于数组的前面,大于零的数放置于数组后面。
void holandflag_sort(int a[], int size)
{
int i, j, k;
i = 0;
j = 0;
k = size - 1;
while (j < k)
switch (a[j]) {
case RED:
swap(a, i, j);
i++;
j++;
...
- 2008-10-06 15:26
- 浏览 1264
- 评论(0)
/* 非递归实现 */
void reverse(char *s)
{
char *head;
char *tail;
char tmp;
head = s;
tail = head + strlen(s) - 1;
while (head < tail) {
tmp = *head;
*head = *tail;
*tail = tmp;
head++;
tail--;
}
}
/* 递归实现 * ...
- 2008-10-06 10:07
- 浏览 1195
- 评论(0)
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char **argv)
{
char start;
char end;
char cur;
start = end = '\0';
while ((cur = getchar()) != EOF) {
if (cur == '/' && start == '/') {
wh ...
- 2008-09-28 17:29
- 浏览 1293
- 评论(0)
/**
* if has loop return 1 else return 0
*/
static int has_loop(List *list)
{
List *pFast;
List *pSlow;
pFast = pSlow = list;
if (pFast != NULL && pFast->next != NULL) {
pFast = pFast->next->next;
} else {
return 0;
}
...
- 2008-09-28 15:27
- 浏览 1347
- 评论(0)
/*
* if list_a and list_b has cross point return the addrss of cross-point.
* else return NULL
*/
static List *has_cross(List *list_a, List *list_b)
{
List *pa;
List *pb;
int len_a, len_b;
int i;
len_a = len_b = 0;
pa = list_a; /* 遍历链表a,并记录下此链 ...
- 2008-09-28 15:05
- 浏览 2120
- 评论(0)
// 比如边长为7时:
1 1 1 1 1 1 1
1 2 2 2 2 2 1
1 2 3 3 3 2 1
1 2 3 4 3 2 1
1 2 3 3 3 2 1
1 2 2 2 2 2 1
1 1 1 1 1 1 1
include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char **argv)
{
if (argc != 2) {
printf("usag ...
- 2008-09-28 11:51
- 浏览 1668
- 评论(0)