packagecom.Thread;publicclassDeathSynchronized {publicstaticvoidmain(String[] args) {//资源Object g =newObject();Object m =newObject();//创建线程Test1 t1 =n...
分类:
其他好文 时间:
2015-04-03 14:53:26
阅读次数:
335
两种方式: 第一种: 先各自排序,然后通过临时表嵌套再合并结果,注意排序后面必须加入 limit,否则order by不起作用 SELECT * FROM (SELECT * FROM t1 WHERE id IN (1,3,6) ORDER BY utime DESC limit 5) AS a?...
分类:
数据库 时间:
2015-04-03 01:40:18
阅读次数:
182
第一步: 建表 create table t1(x int, y int); create table t2(x int, y int); go insert into t1(x,y) values(1,2),(2,3),(3,4),(4,5),(5,6); insert into t2...
分类:
数据库 时间:
2015-04-03 01:24:17
阅读次数:
167
// 创建集合对象 HashMap hm = new HashMap(); // 创建元素 Teacher t1 = new Teacher("小明", 19); Teacher t2 = new Teacher("小刚", 15); ...
分类:
其他好文 时间:
2015-04-02 14:41:25
阅读次数:
191
Thread子类的线程对象是不同的。
比如:
EasySelfThread thread = new EasySelfThread();
//同一个线程对象
Thread t1 = new Thread(thread, “t1”);
Thread t2 = new Thread(thread, “==t2”);//(3)
由...
分类:
编程语言 时间:
2015-04-02 09:08:08
阅读次数:
153
里氏替换原则,OCP作为OO的高层原则,主张使用“抽象(Abstraction)”和“多态(Polymorphism)”将设计中的静态结构改为动态结构,维持设计的封闭性。“抽象”是语言提供的功能。“多态”由继承语义实现。定义1:如果对每一个类型为T1的对象 o1,都有类型为 T2 的对象o2,使得以...
分类:
其他好文 时间:
2015-04-02 01:01:29
阅读次数:
227
program as;
type
t1 =record
x,y,h :longint;
end;
var
n,m,s,i:longint;
a :array[1..1000000] of t1;
f :array[0..1000000] of longint;
bool :array[1..1000,1..1000] of boolean;...
分类:
其他好文 时间:
2015-04-01 21:51:26
阅读次数:
128
SELECT * FROM res AS t1 JOIN (SELECT ROUND(RAND() * ((SELECT MAX(id) FROM res) - (SELECT MIN(id) FROM res)) + (SELECT MIN(id) FROM res)) AS id) AS t2 ...
分类:
数据库 时间:
2015-04-01 17:33:18
阅读次数:
183
1.索引作用在索引列上,除了上面提到的有序查找之外,数据库利用各种各样的快速定位技术,能够大大提高查询效率。特别是当数据量非常大,查询涉及多个表时,使用索引往往能使查询速度加快成千上万倍。例如,有3个未索引的表t1、t2、t3,分别只包含列c1、c2、c3,每个表分别含有1000行数据组成,指为1~...
分类:
数据库 时间:
2015-04-01 16:46:40
阅读次数:
200
1.判断两个string类型日期string BeginTime;string EndTime;if(DateTime.Parse(BeginTime)>DateTime.Parse(EndTime))2.两个日期相减得到天数DateTime t1 = Convert.ToDateTime("199...