线程同步1.基本的原子操作可借助Inerlocked类,无需锁定任何对象即可获取到正确结果,Inerlock提供了Increment、Decement和Add等基本数学操作的原子方法:Interlocked.Incement(ref _count)2.Mutex类同步两个单独的线程,Mutex是一种...
分类:
编程语言 时间:
2016-01-06 23:18:39
阅读次数:
207
import java.io.*;class MyBufferedInputStream{ private InputStream in; private byte[] buf = byte[1024*4]; private int pos = 0,count = 0;//...
分类:
其他好文 时间:
2016-01-06 17:25:55
阅读次数:
101
/***检测utf8字数,包括中文*@param$str*@returnint*/functionget_utf8_words_count($str){preg_match_all("/[\x01-\x7f]|[\xc2-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf]{2}|[\xf0-\xff][\x80-\xbf]{3}/",$str,$ar);returncount($ar[0]);}
分类:
Web程序 时间:
2016-01-06 12:16:39
阅读次数:
171
1) 需要的工具Redhat9.0、VMware虚拟机,选择用grub作loader2) 制作ramdisk A) cd /usr/local && mkdir initrd B) dd if=/dev/zero of=initrd.img bs=1024 count=4000 C) mke2fs....
分类:
其他好文 时间:
2016-01-06 11:35:58
阅读次数:
165
Having--对分组信息进行过滤,因为分组之后的信息和原来的表信息没有关系了,Having可以用的之后,出现在Group子句中的列,还有聚合函数 SELECT s_Age ,COUNT(s_ID)FROM dbo.Student GROUP BY s_Age--正确的 SELECT s_Age ,...
分类:
数据库 时间:
2016-01-06 00:17:51
阅读次数:
207
if分支语句>>> count=89>>> if count==89: print count89 #单分支>>>#coding:utf-8count=int(raw_input('请输入一个数字'))print countif count>80: print '比80大'else: if coun...
分类:
编程语言 时间:
2016-01-05 20:30:03
阅读次数:
191
[root@localhost /]# mkdir swap[root@localhost /]# cd swap[root@localhost swap]# dd if=/dev/zero of=swap1 bs=1024 count=524288记录了524288+0 的读入记录了524288+...
分类:
其他好文 时间:
2016-01-05 18:29:29
阅读次数:
164
#if($GoodsData.Count==0) #else #foreach($goods in $GoodsData) #end ...
Sub ChangeTable()Application.Browser.Target = wdBrowseTable For i = 1 To ActiveDocument.Tables.Count ActiveDocument.Tables.Item(i).Select ...
分类:
其他好文 时间:
2016-01-04 23:55:41
阅读次数:
179
集合概念:集合本质上是一个动态数组2.命令引用:using system.collections 2.1 Arratlist 属性(count) 数量 、属性2(capactity) 有几个位子 //集合里包括属性和方法2.2 arratlist list =new arraylist();...
分类:
其他好文 时间:
2016-01-04 19:47:55
阅读次数:
197