void getTime(){
//获取当前系统时间
time_t tTime;//距1900年1月1日的秒数
char str[80];
struct tm* stTim;//时间结构
time(&tTime);
stTim = localtime(&tTime);
strftime(str,sizeof(str),"%Y%m%d%T",stTim);//格式化时间
printf...
分类:
编程语言 时间:
2014-11-03 11:30:29
阅读次数:
155
//扩展方法,,是一种特殊的静态方法(不能修改源代码的类,扩展方法)(Dynamic不支持扩展方法) 静态类和静态方法//Demo1public static class A{ public static string Add(this string str,int a,int b) { retu....
分类:
其他好文 时间:
2014-11-03 11:25:11
阅读次数:
131
c#中逆转数组元素的排序实例代码如下:privatestring[]G_str_array;//定义字符串数组字段privatevoidFrm_Main_Load(objectsender,EventArgse){G_str_array=newstring[]{"C#-1","C#-2","C#-3","C#-4","C#-5"};//为字符串数组字段赋值foreach(stringstrinG_str_array)//遍历字符串..
分类:
编程语言 时间:
2014-11-03 01:37:39
阅读次数:
243
下面的函数get_time_str实现了在内核中获取本地时间的功能。
他首先获取utc时间,然后根据系统的时区timezone转换成本地时间,
最后将时间以“2014-11-02 21:14:08”的字符串的形式输出到output缓冲区中。
函数的返回值,是输出的字符串的长度。
#include
#include
#include
int get_time_str(...
分类:
系统相关 时间:
2014-11-02 22:37:54
阅读次数:
1106
由于时间关系:本次只对这三个API($.camelCase、$.contains、$.each)方法进行分析
第一个方法变量转驼峰:$.camelCase('hello-world-welcome');
源码:
var camelize;
/**
* 字符串替换
* 使用replace第二个参数带回调
*/
camelize = function(str) {
...
bytes.php 字节编码类
/**
* byte数组与字符串转化类
* @author
* created on 2011-7-15
*/
class bytes {
/**
* 转换一个string字符串为byte数组
* @param $str 需要转换的字符串
* @param $bytes 目标byte数组
...
分类:
Web程序 时间:
2014-11-02 16:33:24
阅读次数:
193
字符串第一个位置下标为1ASCII(str): 返回最左边字符的ASCII代码值CONV(N, from_base, to_base): 在不同基数之间转化数字,返回数字N的字符串数字,如果任何参数为NULL则返回NULL。如果to_base是一个负数,则被认为是一个有符号数。mysql> sele...
分类:
数据库 时间:
2014-11-02 16:28:33
阅读次数:
281
一. 什么是委托通俗的讲,就是一个能存放符合某种格式(方法签名)的方法的指针的容器。二.委托入门程序示例: 1 //声明委托类(必须指定返回值类型和方法参数列表) 2 public delegate void DGSayHi(string str); 3 4 public part...
分类:
其他好文 时间:
2014-11-02 16:18:17
阅读次数:
281
ping多线程 #!/bin/env?python2.7
import?multiprocessing,subprocess
import?os,time
result?=?[]?#定义空列表
a=time.time()
def?run(i):
????IP=‘192.168.1.‘+str(i)
????#num?=?os.system(‘...
分类:
编程语言 时间:
2014-11-02 00:51:00
阅读次数:
188
用Python2随便写的,py3自行替换 #coding=utf8
import?random
max_try?=?5
c?=?3
allow_number_set?=?set(‘1234567890‘)
goal_str?=?‘‘.join(random.sample(allow_number_set,c))
print?goal_str
try_...
分类:
编程语言 时间:
2014-11-01 23:20:42
阅读次数:
937