Skip to content

Instantly share code, notes, and snippets.

#include <signal.h>
#include <stdio.h>
#include <time.h>
static void sig_alrm(int); /* one handler for both signals */
time_t start,stop;
int main(void)
{
signal(SIGALRM,sig_alrm);
start = time(NULL);
#!/bin/sh
SHORTCUT="[Desktop Entry]
Name=Sublime Text 2
Comment=Edit text files
Exec=/usr/local/sublime-text-2/sublime_text
Icon=/usr/local/sublime-text-2/Icon/128x128/sublime_text.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Utility;TextEditor;"

Sublime Text 2 – Useful Shortcuts (Windows)

General

Ctrl+KB toggle side bar
Ctrl+Shift+P command prompt
Ctrl+` python console
Ctrl+N new file

Editing

@ustbgaofan
ustbgaofan / Makefile
Created June 3, 2013 13:53
字符设备驱动程序的创建实例
obj-m:=call_dev.o
KDIR :=/lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:
rm -rf *.ko
rm -rf *.mod.*
@ustbgaofan
ustbgaofan / point.c
Created June 4, 2013 06:39
指针 1)指针在本质上也是一个变量 2) 指针需要占用一定的内存空间 3) 指针用于保存内存地址的值 4)不同类型的指针占用的内存空间大小相同
#include <stdio.h>
int main()
{
int i;
int* pI;
char* pC;
float* pF;
pI=&i;
@ustbgaofan
ustbgaofan / const_or_variable_point.c
Last active December 18, 2015 01:29
常量指针和变量指针
cosnt int* p; //p可变,p指向的内容不可变
int const* p;//p可变,p指向的内容不可变
int* const p;//p不可变,p指向的内容可变
const int* const p;//p和p指向的内容都不可变
口诀:左数右指
当const出现在*的左边时,指针指向的数据为常量
当const出现在*的右边时,指针本身为常量
char * strcpy(char *str1,const char *str2)
{
assert( (str1!=NULL)&& (str2 != NULL));//判断指针的合法性
char *address = str1;//记录目标指针所指向的地址
while( (*str1++=*str2++) !='\0');//拷贝知道str2结束
return address;//返回目标地址
}
# -*- coding: utf8 -*-
# 下载速度很慢,
import urllib2, urllib
import sys
import os
import socket
import re
import socks
@ustbgaofan
ustbgaofan / daughter_son_older_than_mother.c
Created September 19, 2013 15:27
daughter_son_older_than_mother
#include <stdio.h>
int main()
{
int s=8,d=10,m=35;
int u=0;
for(;u<20;u++)
{
#include <stdio.h>
int main()
{
int s,temp,i,j,a[20];
printf("Enter total no. of elements:");
scanf("%d",&s);
printf("Enter %d elements:",s);
for(i=0;i<s;i++)