码迷,mamicode.com
首页 >  
搜索关键字:str    ( 67828个结果
C语言获取当前系统时间
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# 逆转数组元素的排序
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
Linux内核中获取时间并转换成本地时区时间
下面的函数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
Zepto源码分析之二~三个API
由于时间关系:本次只对这三个API($.camelCase、$.contains、$.each)方法进行分析 第一个方法变量转驼峰:$.camelCase('hello-world-welcome'); 源码: var camelize; /**  * 字符串替换  * 使用replace第二个参数带回调  */ camelize = function(str) {   ...
分类:Windows程序   时间:2014-11-02 18:16:22    阅读次数:332
Php socket数据编码
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
mysql字符串函数
字符串第一个位置下标为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多线程
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
Python入门之AB猜数字游戏
用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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!