码迷,mamicode.com
首页 >  
搜索关键字:for while until    ( 29426个结果
一些常用的宏定义(很有用,很有效噢)
// 安全释放 #define RELEASE_SAFELY(__Pointer) do{[__Pointer release],__Pointer = nil;} while(0) // 屏幕的物理高度 #define ScreenHeight [UIScreen mainScreen].bounds.size.height // 屏幕的物理宽度 #define ScreenWidth...
分类:其他好文   时间:2014-06-25 19:58:31    阅读次数:197
ubuntu下配置rails环境遇到的错误
1.Could not find gem 'sqlite3 (>= 0)' in any of the gem sources listed in you r Gemfile 2.ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions into the /usr/local/lib/ruby/gems/1.9.1 director.y 3.rails 3遇到 Could n...
分类:其他好文   时间:2014-06-24 22:18:45    阅读次数:316
C语言打乱一组数字顺序
#include<stdio.h> #include<stdlib.h> #include<math.h> #include<time.h> intmain() { inta[]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}; intn=16; inti,j,T=1000,tmp; srand(unsigned(time(NULL))); while(T--) { i=rand()%n; j=rand()%..
分类:编程语言   时间:2014-06-24 16:30:44    阅读次数:259
C语言中宏的使用(#,##,do…while(0)宏)
C语言中宏的使用(#,##,do…while(0)宏) 1.预定义宏的使用__FILE__,__FUNCTION__,__LINE__。 #include void fun(void) { char v1; short v2; int v3; long v4; printf("v1: %x\n",&v1); printf("v2: %x\n",&v2); print...
分类:编程语言   时间:2014-06-24 15:29:13    阅读次数:214
Seitokai no Ichizon
I won't forget Ki-kun until the day I forget Ki-kun — Mafuyu Shiina , Life is never too short to try again! — Kurimu Sakurano It's not that the world....
分类:其他好文   时间:2014-06-24 15:16:16    阅读次数:210
Clannad: After Story
If you feel like crying you shouldn’t hold back your tears. You should let it all out while you still can, because when you get bigger sometimes you ....
分类:其他好文   时间:2014-06-24 14:53:38    阅读次数:255
php折半查找(数组必须为有序)
$arr=array('1','7','9','11','20','23','33','44','50'); $len=count($arr); $low=0;$high=$len-1; while($low'; if($arr[$mid]>9) { $high=$mid-1; ...
分类:Web程序   时间:2014-06-24 14:08:25    阅读次数:223
一个日志按照小时的格式化输出脚本
#!/bin/bash#使用前请先创建一个路径文件夹/tmp/weblog#确定当前时间,即脚本执行日的0时time=`date "+%y%m%d:%H"`#定位日志时间格式为:20140624:00date1="20$time"#开启死循环,每小时筛选一次日志,并输出while :;do#获取当前...
分类:其他好文   时间:2014-06-24 12:03:56    阅读次数:251
Swift中文手册 -- Control Flow
控制流Swift提供了所有c类语言的控制流结构。包括for和while循环来执行一个任务多次;if和switch语句来执行确定的条件下不同的分支的代码;break和continue关键字能将运行流程转到你代码的另一个点上。除了C语言传统的for-condition-increment循环,Swift...
分类:其他好文   时间:2014-06-24 11:57:14    阅读次数:202
JS正则表达式获取分组内容实例
JS正则表达式获取分组内容。支持多次匹配的方式:var testStr = "now test001 test002"; var re = /test(\d+)/ig; var r = ""; while(r = re.exec(testStr)) { alert(r[0] + " " + r[1]...
分类:Web程序   时间:2014-06-24 11:27:32    阅读次数:220
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!