向毛泽东同志学习

最近一直在看中央一套的《红色摇篮》,深深的为毛泽东博大的胸怀,高瞻远瞩而不失实在战略目光所折服。突然让我对这个教书匠出人的人民领袖充满了敬仰和好奇,最近查阅了不少关于毛泽东遵义会议前后的史料,越是接触的文章多,那种敬佩就越发的由衷起来。

C实现配置文件(Ini文件)读取,跨平台

config.h

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifndef __CONFIG_H__
#define __CONFIG_H__
 
#include \"list.h\"
 
typedef struct config_node {
	char *section;
	char *name;
	char *value;
} config_node_t;
 
int config_node_add(list_t *list, char *section, char *name, char *value);
int config_load(list_t **list, const char *filepath);
char *config_get(list_t *list, const char *section, const char *name, const char *def);
void config_free(list_t *list);
 
#endif /* __CONFIG_H__ */

[......]

阅读全文

C实现的双向链表

源代码

list.h

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef __LIST_H__
#define __LIST_H__
 
typedef struct list_node
{
	struct list_node *prv;
	struct list_node *next;
	void *data;
} list_node_t;
 
typedef struct
{
	list_node_t *first;
	list_node_t *last;
	int size;
} list_t;
 
int list_init(list_t **list);
int list_add(list_t *list, void *data);
void *list_get(list_t *list, int index);
int list_remove(list_t *list, int index, void (*data_free) (void *));
void list_free(list_t *list, void (*data_free) (void *));
 
#endif /* __LIST_H__ */

[......]

阅读全文

命令行屏幕色彩显示脚本

命令行屏幕色彩样例

[......]

阅读全文

Bash下实现的一个ssh快速连接菜单的脚本

Bash下实现的一个GUI ssh快速连接菜单的脚本[......]

阅读全文

GTK 透明窗口实现

异形窗口利用蒙板(mask)实现,蒙板的数据从图片获得,每一点只有透明和不透明两种状态,不透明区域显示该窗口的背景,透明区域显示其后桌面或其它应用[......]

阅读全文

Linux 下无线网卡启动脚本

Linux 下无线网卡启动脚本
不使用dhcp

1
2
3
4
5
6
#!/bin/sh
ifconfig wlan0 up
iwconfig wlan0 ESSID MYESSID
iwconfig key s:PASSWORD
ifconfig wlan0 192.168.0.xxx
route add gw 192.168.0.1

[......]

阅读全文

履带循线机器人

我的履带机器人,循线测试(Line fllow robot)

UTF8[......]

阅读全文

一个Vim脚本建立文件时添加头

VIM创建文件时添加文件注释头,修改时更新最后修改时间和最小一位版本号。支持文件类型(.sh .py .pl .vim .java .c .h .cpp .cc .h .js)

C/C++ 风格注释文件头

1
2
3
4
5
6
7
8
/*
* C source file
*
* $id: test.c,v 1.0.0 2008/12/25 05:03:57 master Exp $
* Copyright (C) 2008 Yunlong Wen ([email protected])
*
* Last Modified: 2008/12/25 05:03:57
*/

[......]

阅读全文