现在位置: 首页 > tomboy发表的所有文章
  • 08月
  • 03日
操作系统 ⁄ 共 1329字 评论关闭
经常使用的正则表达式举例 ^                                 行首 $                                 行尾 ^ [ t h e ]                      以t h e开头行 [ S s ] i g n a [ l L ]              匹配单词s i g n a l、s i g n a L、S i g n a l、S i g n a L [Ss]igna[lL]".                同上,但加一句点 [ m a y M A Y ]             包含m a y大写或小写字母的行 ^ U S E R $                  只包含U S E R的行 [tty]$                           以t t y结尾的行 " .                                带句点的行 ^......
阅读全文
  • 04月
  • 12日
综合 ⁄ 共 3486字 评论关闭
Message Passing Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 1187    Accepted Submission(s): 423 Problem Description There are n people numbered from 1 to n. Each people have a unique message. Some pairs of people can send messages directly to each other, and this relationship forms a structure of a tree. In one turn, exactly one person sends all messages s/he currently has to another person. What is the minimum number of tur......
阅读全文
  • 08月
  • 06日
综合 ⁄ 共 5138字 评论关闭
今天看见一段代码,有个%p,我当时就迷惑了,不知道代表什么意思。之后找了网络和帮助文档,最后知道是格式化指针。哈,把帮助文档原文复制如下: String Format Specifiers This article summarizes the format specifiers supported by string formatting methods and functions. Format Specifiers The format specifiers supported by the NSString formatting methods and CFString formatting functions follow the IEEE printf specification; the specifiers are summarized in Table 1. Note that you can also u......
阅读全文
  • 05月
  • 23日
综合 ⁄ 共 1942字 评论关闭
问题如下:1. 求从10到100中能被3或5整除的数的和 Java code ? 1 2 3 int sum = 0; for(int i = 10; i <= 100; i++) if( i % 3 == 0 || i % 5 == 0) sum += i; System.out.println(sum); 2. 将一个字符串逆序,不要使用反转函数 Java code ? 1 2 3 4 String message = "he saw a racecar"; StringBuilder rev = new StringBuilder(); for(int i = message.length()-1; i >= 0; i--) rev.append(message.charAt(i)); System.out.println(rev.toString()); 3. 反转一个栈......
阅读全文
  • 04月
  • 13日
综合 ⁄ 共 4866字 评论关闭
1.   Jerry Schwarz,iostream函数库建构师,曾为了让cin能够求得一个真假值,于是他为它定义了一个conversion运算符operator int()。但在语句cin << intVal中,其行为出乎意料:程序原本要的是cout而不是cin!但是编译器却找到一个正确的诠释:将cin转型为整型,现在left shift operator <<就可以工作了!这就是所谓的“Schwarz Error”。Jerry最后以operator void *()取代operator int()。   2.   引入关键词explicit的目的,就是为了提供程序员一种方法,使他们能够制止单一参数的constructor被当作一个con......
阅读全文
  • 04月
  • 05日
综合 ⁄ 共 1266字 评论关闭
static   void   Main(string[]   args)     {     byte[]   b   =   new   byte[128];     string   sTitle;     string   sSinger;     string   sAlbum;     string   sYear;     string   sComm;         FileStream   fs   =   new   FileStream(@"d:/mp3.mp3",   FileMode.Open);     fs.Seek(-128,   SeekOrigin.End);     fs.Read(b,   0,   128);     bool   isSet=false;     String   sFlag   =   System.Text.Encoding.Default.GetString(b,   0,   3);     if   (sFlag.CompareTo("TAG")==0)     {   ......
阅读全文
  • 04月
  • 04日
综合 ⁄ 共 1481字 评论关闭
//Date类 public class Date { private int month; private int day; private int year; public Date(int theMonth,int theDay,int theYear){ month = checkMonth(theMonth); year = theYear; day = checkDay(theDay); System.out.println("Data object constructor for date"+ toDateString()); } private int checkMonth(int testMonth){ if (testMonth > 0 && testMonth <= 12) return testMonth; else{ System.out.println("Invalid month("+ testMonth +")set to 1"); return 1; ......
阅读全文
  • 03月
  • 16日
综合 ⁄ 共 6422字 评论关闭
一个学习Linux设备驱动程序都会碰到的第一个例程: #include<linux/init.h>#include <linux/module.h> MODULE_LICENSE("Dual BSD/GPL"); static int hello_init(void){     printk(KERN_ALERT "Hello, Tekkaman Ninja !\n");     return 0;} static void hello_exit(void){     printk(KERN_ALERT "Goodbye, Tekkaman Ninja !\n Love Linux !Love ARM ! Love KeKe !\n");} module_init(hello_init); module_exit(hello_exit); 我将其复制到我的工作目录,并编写了一个简单的Makefile文件: KERNELDI......
阅读全文
  • 02月
  • 19日
综合 ⁄ 共 2209字 评论关闭
        查找功能是数据处理的一个基本功能。数据查找并不复杂,但是如何实现数据又快又好地查找呢?前人在实践中积累的一些方法,值得我们好好学些一下。我们假定查找的数据唯一存在,数组中没有重复的数据存在。 (1)顺序查找(普通的数据查找)                   设想有一个1M的数据,我们如何在里面找到我们想要的那个数据。此时数据本身没有特征,所以我们需要的那个数据可能出现在数组的各个位置,可能在数据的开头位置,也可能在数据的结束位置。这种性质要求我们必须对数据进行遍历之后才能获取到对应的数据。 int fin......
阅读全文
  • 02月
  • 04日
综合 ⁄ 共 233字 评论关闭
1.背景色的设置 编辑--》配色方案   第一个点击出来就会有个框可以方便配色 一般都使用 torte   2 .设置字体 编辑--》选择字体   一般使用courier New   3.怎么设置成默认的字体和背景颜色    3.1 在安装目录找到文件 C:/Program Files/Vim/_vimrc    3.2 添加下面两句         set guifont=Courier_New:h9:cANSI        colorscheme torte   4.说明   字体 可以在界面用set命令看到      
阅读全文
  • 11月
  • 15日
综合 ⁄ 共 46字 评论关闭
在自己学习的过程中,深刻感觉到共享和讨论的重要性。 今后将陆续把自己积累的文字更新到该博客上。
阅读全文
  • 11月
  • 15日
综合 ⁄ 共 1233字 评论关闭
  1.      Db2batch, 能够提供从准备到查询完成中各个阶段所花费地具体时间,CPU 时间,以及返回的记录,用法: db2batch -d zjbi2  -i complete-f 2.sql  -r 2.out 2.      几个有用但可能不常用的函数: locate('3','12145367')  查找第一次出现的位置 days(date('2001-06-05'))-days(date('2001-04-05'))   相差天数 dayofweek('2011-07-07') 该周的第几天 3.      查看表被哪些存储过程引用: select PROCNAME from SYSCAT.PROCEDURES where SPECIFICNAME in(selectdname from sysibm.sysdependencies where bname in ( select ......
阅读全文