- 博客(37)
- 资源 (24)
- 收藏
- 关注
原创 MySQL 5 中文
OS: XPDB: MySQL 5 为让MySQL 5支持中文字符. 创建表要指定字符集为gbk. 通用的做法是修改my.ini配置文件,default-character-set=gbk。或者通过程序组菜单,进入"MySQL Server Instance Config Wizard",配置数据库默认语言为gbk。注意必须是创建表之前,将字符集指定。对已经创建好的表,无效。
2007-09-18 15:22:00 299 1
原创 Exception
Exception handling allows developers to detect errors easily without writing special code to test return values. Even better, it lets us handle these errors in code that is nicely separated from the c
2007-09-05 13:48:00 236
原创 Java Operators
The instanceof opertor can be used only to test objects (or null) with class types that are in the same class hierarchy.The equality operators (== and != ) compare reference variables when used on o
2007-09-04 23:38:00 260
原创 Passing Variables into Method
When passing object arguments to a method, you must keep in mind it is a reference variable that is being passed, and not the actual object itself. A reference variable is a name that points to a loca
2007-09-04 23:30:00 218
原创 equals()
The equals() method is a special method contained in the Object class that compares properties between two objects. The properties that method tests are determined bye the type of object being tested.
2007-09-04 23:20:00 186
原创 Casting
Casting can be used on primitives or instances to convert the current type. There are two types of casts, implicit and explicit. An implicit cast is legal at runtime, becuase the subclass value is c
2007-09-04 23:10:00 318
原创 Legal Return Types
Return Primitive Typesboolean: the only type of value that can be returned is a boolean literal such as true or false. Java will not accept a boolean object, null, an integer value such as 0 or 1, o
2007-09-04 09:33:00 308
原创 Determining Access to Class Members
Determining Access to Class Members Visibility Public Protected Default Private
2007-09-03 15:13:00 201
原创 Keywords, Indentifiers, Reserved words
true, false, and null are reserved words but not key words. There is a difference in terminology. keywords and identifiers are special reserved words in Java that cannot be used as identifiers for c
2007-08-30 21:27:00 207
原创 Import Statements
The import statement is used to make the classes in a package available. A typical import statement appears after any package statement and before any class definitions. import java.uti
2007-08-30 21:19:00 184
原创 Java Unused Keywords
const Do not use to declare a constant; use public static final.goto Not implemented in the Java language.
2007-08-30 17:09:00 177
原创 Variable Keywords
super Reference variable referring to the immediate superclass.this Reference variable referring to the current instance of an object.void Indicates no return type for a method.
2007-08-30 17:07:00 158
原创 Primitives
boolean Boolean literals indicating ture or false.byte 8-bit integer.char Stores one Unicode character.double 64-bit floating-point number.float 32-bit floating-point number.int 32-bit integ
2007-08-30 17:04:00 242
原创 Package Control
import Statement to import packages or classes into code.package Specifies to which package all classes in a source file belong.
2007-08-30 17:01:00 167
原创 Error Handling
catch Declares the block of code used to handle an exception.finally Block of code usually following a tra-catch statement which is executed no matter what program flow occurs when dealing with an e
2007-08-30 16:54:00 179
原创 Java Class, Method, and Variable Modifiers
abstract A method or class that cannot be instantiated, and which may define methods to be overwritten. class Keyword used to specify a class.extends Used to indicate the superclass that a subclas
2007-08-30 16:40:00 365
原创 Java Access Modifiers
private Makes a method or a variable accessible only from within its own class.protected Makes a method or a variable accessible only to classes in the same package or subclasses of the class.pub
2007-08-30 15:35:00 238
原创 Java keywords
(1) abstract(3) boolean break byte(6) case catch char class const continue(3) default do double(2) else extends(4) final finally float for(1) goto(1) if(5) implements import instanceof
2007-08-30 15:30:00 264
原创 Package
Creating a Package such as com.syngress:1. Create a directory such as Myclasses. Edit your environment variable classpath to include the directory you just created. For UNIX: setenv
2007-08-30 13:21:00 238
原创 Identifiers
case-sensitive. identifiers can have letters and numbers, but a number may not begin the identifier name. $ and _ (underscore) symbols are allowed.
2007-08-30 11:35:00 170
原创 高楼抛珠
有一个100层高的大厦,你手中有两个相同的玻璃围棋子。从这个大厦的某一层扔下围棋子就会碎。用你手中的这两个玻璃围棋子,找出一个最优的策略,来得知那个临界层面。
2007-08-23 19:20:00 288
原创 蚂蚁过桥
有一根27厘米的细木杆,在第3厘米、7厘米、11厘米、17厘米、23厘米这5个位置上各有一只蚂蚁。木杆很细,不能同时通过两只蚂蚁。开始时,蚂蚁的头朝左还是朝右是任意的,它们只会朝前走或调头,但不会后退。当任意两只蚂蚁碰头时,两只蚂蚁会同时调头朝反方向走。假设蚂蚁们每秒钟可以走一厘米的距离。求所有蚂蚁都离开木杆的最小时间和最大时间,编写程序验证。 #define ANT_NUM 5#defi
2007-08-23 16:36:00 361
原创 装苹果
公司有1 000个苹果和10个箱子,事先将1 000个苹果分别装入10个箱子。问:怎样做才能在客户无论需要多少苹果时,都可以整箱整箱地提供给客户?
2007-08-23 16:17:00 203
原创 分裂时间
有一种小虫,每隔2秒钟分裂一次。分裂后的2只新的小虫经过2秒钟后又会分裂。如果最初某瓶中只有一只小虫,那么2秒后变2只,再过2秒后就变4只……2分钟后,正好满满一瓶小虫。假设这个瓶内最初放入2只这样的小虫。问:经过多少时间后,正巧也是满满的一瓶?
2007-08-23 16:09:00 239
原创 翻衣兜数硬币
3个孩子翻衣兜,他们把兜里所有的钱都掏出来,看看一共有多少钱。结果一共有320日元。其中有两枚硬币是100日元的,两枚是50日元的,两枚是10日元的。每一个孩子所带的硬币中没有相同的。而且,没带100日元硬币的孩子也没带10日元的硬币,没带50日元硬币的孩子也没带100日元的硬币。你能弄清楚这3个日本孩子原来各自带了什么硬币吗?
2007-08-23 16:03:00 237
原创 倒与不倒
父亲打电话给女儿,要她替自己买一些生活用品,同时告诉她,钱放在书桌上的一个信封里。女儿找到信封,看见上面写着98,以为信封内有98元,就把钱拿出来,数也没数放进书包里。在商店里,她买了90元的东西,付款时才发现,她不仅没有剩下8元,反而差了4元。回到家里,她把这事告诉了父亲,怀疑父亲把钱点错了。父亲笑着说,他并没有数错,错在女儿身上。
2007-08-23 15:53:00 206
原创 击鼠标
击鼠标比赛现在开始!参赛者有拉尔夫、威利和保罗。拉尔夫10秒钟能击10下鼠标,威利20秒钟能击20下鼠标,保罗5秒钟能击5下鼠标。以上各人所用的时间是这样计算的:从第一击开始,到最后一击结束。他们是否打平手?如果不是,谁最先击完40下鼠标?
2007-08-23 15:50:00 186
原创 文字游戏
3个朋友住进了一家宾馆。结账时,账单总计3 000美元。3个朋友每人分摊1 000美元,并把这3 000美元如数交给了服务员,委托他代到总台交账。但在交账时,正逢宾馆实施价格优惠,总台退还给服务员500美元,实收2 500美元。服务员从这500美元退款中扣下了200美元,只退还3个客人300美元。3个客人平分了这300美元,每人取回了100美元。这样,3个客人每人实际支付900美元,共支付2 70
2007-08-23 15:42:00 198
原创 coins game
Jeff and Diamond like playing game of coins.One day they designed a new set of rules:(1)Totally 10 coins.(2)One can take away 1,2 or 4 coins at one time by turns.(3)Who takes the last loses.Gi
2007-08-23 15:38:00 134
原创 解答思路
(1)排除法把一些无关的问题先予以排除,可以确定的问题先确定,尽可能缩小未知的范围,以便于问题的分析和解决。这种思维方式在我们的工作和生活中都是很有用处的。(2)递推法由已知条件层层向下分析,要确保每一步都能准确无误。可能会有几个分支,应本着先易后难的原则,先从简单的一支入手。(3)倒推法从问题最后的结果开始,一步一步往前推,直到求出问题的答案。有些问题用此法解起来很简单,如用
2007-08-23 15:36:00 215
原创 MYSQL C API 记录
一、环境与条件 MySQL AB 提供了C API,可以提供低等级界面,负责完成涉及SQL服务器交互的大多数常规任务:数据库连接 、查询、结果集处理和错误处置。C API通过两个组件实现: 头文件:mysql.h,包含结构和功能说明。 Mysql库:libmysqlclient(Unix) 或 mysqlclient.lib(Windows),
2007-08-23 15:21:00 1654
原创 放鞭炮
A、B、C三人同时开始放鞭炮,每人放21枚。其中,A每5秒放1枚,B每7秒放1枚,C每10秒放1枚。所以鞭炮均正常引爆,请问,当所有鞭炮放完后,共听到多少响?可以时间为主线,考察并发事件的交叠。void main(){ int i=0,c=0,x=5*21,y=7*21,z=10*21; do { if (i%5==0 && i c++; } while (++i pr
2007-08-22 11:27:00 495
原创 SQL 查询
一、表: employees(name varchar(30) not null, department varchar(30) not null, primary key(name));找出员工数>10 的部门。select department group by deprtment having count(name) > 10;二、一个是部门表: department(deptn
2007-08-15 22:54:00 210
原创 ARP 协议的工作原理与缺陷
在以太网中广泛使用的ARP协议,承担着地址转换的角色。在TCP/IP协议栈,ARP协议工作在三层和二层之间,提供网络地址到物理地址的转换。ARP协议的工作流程如下: 首先,假设局域网中存在主机A、主机B,以及局域网默认网管G。相应的,IP(A)、MAC(A),IP(B)、MAC(B),IP(G)、MAC(G)分别为这三台主机的IP地址和MAC地址。
2007-08-09 21:19:00 974
原创 Apache 上的 CGI 配置与测试
平台与工具: Windows XP, Apache 2.0.59, ActivePerl-5.6.1.628-MSWin32-x86-multi-thread.msi, VC++ 6.0, Turboc 2.0一、apache 的配置文件“http.conf ”与CGI相关的配置: ScriptAlias /cgi-bin/ "f:/php_code/cgi
2007-08-09 17:15:00 498
原创 KMP 匹配过程演示
#include #include #include #define KMP_NOTMATCH -1#define KMP_INVALIDPARA -2#define KMP_OUTOFMEMORY -3void get_next(char *str, int *next, int n){ int i=0, j=-1; if (n return; next[0] = -1;
2007-08-06 15:42:00 489
原创 average
#include /*algorithm explanationuse following formulas to calculate average value of n numbers(a1,a2,...,an):1. average(n)=(a1 + a2 + ... + an)/n;2. average(n)=a1/n + a2/n + ... + an/n;
2007-08-06 15:25:00 208
虎书书籍资料整理
2018-11-15
数据结构与算法分析——java语言描述(第二版) 习题答案
2018-11-14
Visual C++从入门到精通第三版.pdf
2018-11-13
ffdoc (FFMPEG的最完整教程)
2018-11-12
机器学习实战 高清完整版PDF
2018-11-11
RabbitMQ实战指南
2018-11-10
数据结构与算法分析(java语言描述)中文第二版以及习题答案
2018-11-09
MFC写的一款游戏——空中大战(SpaceWar)
2018-11-08
JSP项目开发案例全程实录源码共12个【精品】
2018-11-05
斯坦福大学吴恩达机器学习课程(学习笔记和原始讲义)高清完整版PPT
2018-11-04
《算法导论 第三版 》中文版 高清完整PDF版
2018-11-02
机器学习实战-中文版-pdf
2018-11-01
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人