Monday, March 10, 2008

Making your own arff file( Weka Data Mining)

sample:
%Comments
%
%

@RELATION name
%@relation


%@attribute

@ATTRIBUTE AAA NUMERIC
@ATTRIBUTE "BBB" REAL
@ATTRIBUTE CCC NUMERIC
@ATTRIBUTE DDD NUMERIC
@ATTRIBUTE class { type1, type2, type3 }


@DATA
2, 3.20, 4, 5, type1
1, 2.13, 3, 4, type3

you need to make sure that
  • nothing is case sensitive
  • the header section is prefaced by @RELATION
  • each attribute is indicated by @ATTRIBUTE, attribute's name should be one word
  • the data section is prefaced by @DATA
  • the data is comma separated or use spaces, with the class as the last attribute
  • everything should be separated spaces except, no tab is allowed. Or you will get a error when you import the arff file
  • lines that begin with a% are comments.

Sunday, March 9, 2008

常用句总结

Much appreciated. We'll be sure to give that a try.

Wednesday, March 5, 2008

PHOTOSHOP 格式存储问题

当参数不对的时候,另存时PHOTOSHOP将不显示JPEG等格式,这时要将模式改为 RGB颜色,8位/通道。

Thursday, February 28, 2008

javascript 中 radio button 的判断

HTML 页面;

<(form method="post" action="https://××××××××" name="application">
<(input value="M" name="gender" type="radio">Male
<(input value="F" name="gender" type="radio">Female

<(input name="submit" value="Submit" onclick="return validator(application)"type="submit")>

JAVASCRIPT 中
function validator(theForm)
{
if (!theForm.gender[0].checked &&!theForm.gender[1].checked)
{ alert("Select your gender, please!");theForm.gender[0].focus();return false; }


最主要的radio button 是采用数组形式存储的。

Tuesday, February 26, 2008

Oracle date problem

init文件中: NLS_DATE_FORMAT设定为YYYY-MM-DD
在client端也可以,修改注册表或者环境变量就可以|

name:NLS_DATE_FORMAT
values:yyyy-mm-dd
本文来自:http://www.87717.com

客 户 端 的 显 示 依 据 客 户 端 NLS_DATE_FORMAT 环 境 变 量 的 设 置 值 , 如 果 没 有 设 置其 值 , 则 系 统 按 server 端 的 设 定 来 显 示 。 所 以 你 要 在 客 户 端 设 定 需 要 的 格 式 , 也可 以 在 session 中 临 时 设 定 。
alter session set nls_date_format='YYYY"-"MM"-"DD';

windows下,在注册表中 HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE下增加一字符串:NLS_DATE_FORMAT,把其值设成:YYYY-MM-DD
2、Unix下,在用户的.profile文件中增加以下内容:
NLS_DATE_FORMAT=YYYY-MM-DD
export NLS_DATE_FORMAT

如果你是NT,修改注册表:NLS_DATE_FORMAT变成你自己喜欢的格式
加上:HKEY_local_machine\software\oracle\homex\,加字符串上键名:NLS_DATE_FORMAT,键值:yyyy-mm-dd hh24:mi:ss
如果是UNIX,在.profile中将上面的参数set并export

如果你不想做上面的工作,你还可以在SQL_PATH的目录下定义login.sql,在里面写上一句:
alter session set nls_date_format='你喜欢的格式';

Sunday, February 17, 2008

Spyware.Cyberlog-X removal

1.下载杀毒软件SMITFRAUDFIX (由S!Ri编写)
位置:http://siri.urz.free.fr/Fix/SmitfraudFix.zip

2。安装该软件到电脑。
3。运行程序文件 SMITFRAUDFIX.CMB
根据提示选择: 1-SEARCH (搜索),然后回车
这时,会有一段文字出现,为搜索到的已经被感染的文件清单.该资料自动保存到C:\RAPPORT.TXT

注意,运行该程序时,有可能被你现有的杀毒软件检测为"非法程序",请忽略.

4.请关机重启,到"安全模式".
5.运行程序文件 SMITFRAUDFIX.CMB
根据提示选择: 2-CLEAN (清除),然后回车
这时,电脑进行清楚已被感染的文件和程序.

6.病毒被清除完毕,又有提问"Do you want to clean the registry?" (需要清理注册吗?)
回答"是",即打Y,然后回车

7.全部完成后,重启电脑.烦人的病毒提示没有了.
说明病毒SPYWARE CYBERBLOG-X已经被彻底清除.

Thursday, February 14, 2008

ASP Including Files

普通方法


include parent file 方法
"ASP出错解决方法
http://support.microsoft.com/?id=332117
href="/XXX/XXX/XXX/XXX/index.asp">XXXX "(正确)
href="index.asp">XXXX "(错误)
对于include parent directory 的 link 文件,其中的href 应该为除HOMEPAGE 的全部DIRECTORY,否则会自动加上其所在目录的directory name.

Wednesday, February 6, 2008

JAVA中indexOf 和 lastIndexOf 的使用


int indexOf(char ch)
int lastIndexOf(char ch)
int indexOf(char ch, int startIndex)
int lastIndexOf(char ch, int endIndex)
int indexOf(String str)
int lastIndexOf(String str)

int indexOf(String str, int startIndex)
int lastIndexOf(String str, int endIndex)

Wednesday, January 16, 2008

解决Access错误 Selected collating sequence not supported by the operating system

这种问题都是由于生成的Access 文件是在支持中文的系统创建的然后用在英文的服务器上造成的。

微软的技术解释请参见
http://support.microsoft.com/kb/141306/EN-US/
解决方法:
1)打开我的 Microsoft Access ,Open 任意一个文件,然后点"tools",选中 Options,再选 General 项。注意在右下方有 New Database Sort Order下拉框,选中 General。然后关掉该文件。(注意,Options只有在有文件打开的状况下才能使用)
2)然后"File" --> "New..." 创建一个空白数据文件,然后"file" --> "Get External Data" -- "Import",打开我的老数据库文件将所有的 tables 全部传到新文件来,然后保存新文件。我要做这步是因为我的论坛里已经有许多的数据在里面,我不愿从头再来。如果你在新建论坛,或新建系统时遇到此类问题,大可新建 table,或用 SQL query 写入初始数据。
3)保存此新文件,然后上传到服务器。

Windows快捷键大全(转)

快捷键
单独按Windows:显示或隐藏 “开始”功能表
  Windows+BREAK:显示“系统属性” 对话框
  Windows+D:显示桌面
  Windows+M:最小化所有窗口
  Windows+Shift+M:还原最小化的窗口
  Windows+E:开启“资源管理器”
  Windows+F:查找文件或文件夹
  Windows+CTRL+ F:查找电脑
  Windows+F1:显示 Windows “帮助”
  Windows+R:开启“运行” 对话框
  Windows+U:开启 “公用程序管理器”
  Windows+L:切换使用者(Windows XP新功能)

Ctrl快捷键
Ctrl+S 保存
Ctrl+W 关闭程序
Ctrl+N 新建
Ctrl+O 打开
Ctrl+Z 撤销
Ctrl+F 查找
Ctrl+X 剪切
Ctrl+C 复制
Ctrl+V 粘贴
Ctrl+A 全选
Ctrl+[ 缩小文字
Ctrl+] 放大文字
Ctrl+B 粗体
Ctrl+I 斜体
Ctrl+U 下划线
Ctrl+Shift 输入法切换
Ctrl+空格 中英文切换
Ctrl+回车 QQ号中发送信息
Ctrl+Home 光标快速移到文件头
Ctrl+End 光标快速移到文件尾
Ctrl+Esc 显示开始菜单
Ctrl+Shift+< 快速缩小文字
Ctrl+Shift+> 快速放大文字
Ctrl+F5 在IE中强行刷新
Ctrl+拖动文件 复制文件
Ctrl+Backspace 启动\关闭输入法
拖动文件时按住Ctrl+Shift 创建快捷方式

★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
Alt快捷键


Alt+F4 关闭当前程序
Alt+空格+C 关闭窗口
Alt+空格+N 最小化当前窗口
Alt+空格+R 恢复最小化窗口
Alt+空格+X 最大化当前窗口
Alt+空格+M 移动窗口
Alt+空格+S 改变窗口大小
Alt+Tab 两个程序交换
Alt+255 QQ号中输入无名人
Alt+F 打开文件菜单
Alt+V 打开视图菜单
Alt+E 打开编辑菜单
Alt+I 打开插入菜单
Alt+O 打开格式菜单
Alt+T 打开工具菜单
Alt+A 打开表格菜单
Alt+W 打开窗口菜单
Alt+H 打开帮助菜单
Alt+回车 查看文件属性
Alt+双击文件 查看文件属性
Alt+X 关闭C语言
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★

Shift快捷键

Shift+空格 半\全角切换
Shift+右击 右菜单打开方式
Shift+F10 选中文件的右菜单
Shift+多级文件 全部关闭
Shift+Del 直接删除文件
Shift+^ 处在中文标点符号半角在智能ABC中省曰号
Shift+\ 处在中文标点符号半角在智能ABC中顿号


★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★

快捷键


常规键盘快捷键

Ctrl + C 复制。
Ctrl + X 剪切。
Ctrl + V 粘贴。
Ctrl + Z 撤消。
Delete 删除。
Shift + Delete 永久删除所选项,而不将它放到“回收站”中。
拖动某一项时按 CTRL 复制所选项。
拖动某一项时按 CTRL + SHIFT 创建所选项目的快捷键。
F2 重新命名所选项目。
CTRL + 向右键 将插入点移动到下一个单词的起始处。
CTRL + 向左键 将插入点移动到前一个单词的起始处。
CTRL + 向下键 将插入点移动到下一段落的起始处。
CTRL + 向上键 将插入点移动到前一段落的起始处。
CTRL + SHIFT + 任何箭头键 突出显示一块文本。
SHIFT + 任何箭头键 在窗口或桌面上选择多项,或者选中文档中的文本。
Ctrl + A 选中全部内容。
F3 搜索文件或文件夹。
Alt + Enter 查看所选项目的属性。
Alt + F4 关闭当前项目或者退出当前程序。
ALT + Enter 显示所选对象的属性。
Alt + 空格键 为当前窗口打开快捷菜单。
Ctrl + F4 在允许同时打开多个文档的程序中关闭当前文档。
Alt + Tab 在打开的项目之间切换。
Alt + Esc 以项目打开的顺序循环切换。
F6 在窗口或桌面上循环切换屏幕元素。
F4 显示“我的电脑”和“Windows 资源管理器”中的“地址”栏列表。
Shift + F10 显示所选项的快捷菜单。
Alt + 空格键 显示当前窗口的“系统”菜单。
Ctrl + Esc 显示“开始”菜单。
ALT + 菜单名中带下划线的字母 显示相应的菜单。
在打开的菜单上显示的命令名称中带有下划线的字母 执行相应的命令。
F10 激活当前程序中的菜单条。
右箭头键 打开右边的下一菜单或者打开子菜单。
左箭头键 打开左边的下一菜单或者关闭子菜单。
F5 刷新当前窗口。
BackSpace 在“我的电脑”或“Windows 资源管理器”中查看上一层文件夹。
Esc 取消当前任务。
将光盘插入到 CD-ROM 驱动器时按 SHIFT 键 阻止光盘自动播放。
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
对话框快捷键

Ctrl + Tab 在选项卡之间向前移动。
Ctrl + Shift +Tab 在选项卡之间向后移动。
Tab 在选项之间向前移动。
Shift + Tab 在选项之间向后移动。
ALT + 带下划线的字母 执行相应的命令或选中相应的选项。
Enter 执行活选项动或按钮所对应的命令。
空格键 如果活选项动是复选框,则选中或清除该复选框。
箭头键 活选项动是一组选项按钮时,请选中某个按钮。
F1 显示帮助。
F4 显示当前列表中的项目。
BackSpace 如果在“另存为”或“打开”对话框中选中了某个文件夹,则打开上一级文件夹。
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
自然键盘快捷键

在“Microsoft 自然键盘”或包含 Windows 徽标键() 和“应用程序”键() 的其他兼容键盘中,您可以使用以下快捷键。

请按 目的
显示或隐藏“开始”菜单。
win+ BREAK 显示“系统属性”对话框。
+ D 显示桌面。
+ M 最小化所有窗口。
+ Shift + M 还原最小化的窗口。
+ E 打开“我的电脑”。
+ F 搜索文件或文件夹。
CTRL+ + F 搜索计算机。
+ F1 显示 Windows 帮助。
+ L 如果连接到网络域,则锁定您的计算机,或者如果没有连接到网络域,则切换用户。
+ R 打开“运行”对话框。
显示所选项的快捷菜单。
+ U 打开“工具管理器”。

★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
辅助键盘快捷键

请按 目的
右侧 SHIFT 键八秒钟 切换“筛选键”的开和关。
左边的 ALT + 左边的 SHIFT + PRINT SCREEN 切换“高对比度”的开和关。
左边的 ALT + 左边的 SHIFT + NUM LOCK 切换“鼠标键”的开和关。
Shift 键五次 切换“粘滞键”的开和关。
Num Lock 键五秒钟 切换“切换键”的开和关。
+ U 打开“工具管理器”。
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★
“Windows 资源管理器”键盘快捷键

请按 目的
END 显示当前窗口的底端。
主页 显示当前窗口的顶端。
NUM LOCK + 数字键盘的星号 (*) 显示所选文件夹的所有子文件夹。
NUM LOCK + 数字键盘的加号 (+) 显示所选文件夹的内容。
NUM LOCK + 数字键盘的减号 (-) 折叠所选的文件夹。
左箭头键 当前所选项
处于展开状态时折叠该项,或选定其父文件夹。
右箭头键 当前所选项处于折叠状态时展开该项,或选定第一个子文件夹

IE的快捷键
Ctrl+A 选择全部网页
Ctrl+B或Ctrl+I 快速打开收藏夹,整理收藏夹
Ctrl+C 复制当前网页内容
Ctrl+D 将当前页添加到收藏夹
Ctrl+E或Ctrl+F3 搜索有键入内容的网页
Ctrl+F 在当前页中查找
Ctrl+H 查看历史记录
Ctrl+L 键入网址进入你想去的网页
Ctrl+N 以当前页打开,它可以快速打开新的网页窗口
Ctrl+P 打印所选的文字
Ctrl+R或F5 刷新当前页
Ctrl+S 保存当前页
Ctrl+W 快速关闭当前窗口
ALT+←/→ 前返/后退一页
ALT+D 光标快速移入地址栏
F4 打开地址栏
F11 切换到全屏幕或常规窗口

Thursday, November 15, 2007

Buffer Overflow Problem(转)

Buffer Overflow Problem: Consider the following code:
Harry Hochheiser, hhochheiser@towson.edu 
// buffer overflow demo
#include <>
using namespace std;

int main() {
int importantData = 1;
int buffer[10];

cout << "importantData = " << importantData << endl;
cout << "buffer overflow " << endl;v

for (int i = 0; i < ??; i++)
buffer[i] = 7;
cout << "importantData = " << importantData << endl;
return 0;
}
  1. Type in the above program. What value should replace the ?? Compile and Run with this value.
  2. Replace the ?? with 20 this time. What happens? Why?

The following security checklist is a tool used to find potential security vulnerabilities in your programs. Read the checklist, apply it (as best you can) to the problem given above, and answer these questions:

  1. Describe the buffer overflow problem.
  2. Give three real life examples of buffer overflow attacks (research on the web, and indicate your sources).
  3. What can result from a buffer overflow?
  4. List three ways you could potentially overflow a buffer in your program.
  5. How could you prevent a buffer overflow from occurring in your program?

Some of the elements in the checklist may refer to material that we have not seen this semester. If so, please disregard them.

Please submit the program with appropriate marking (in color or alternate font) and your answers to these questions

Security checklist
Vulnerability Buffer Overflow
Description A buffer overflow occurs when data is written beyond the boundaries of a fixed length buffer overwriting adjacent memory locations which may include other buffers, variables and program flow data.
Risk Writing outside the bounds of a block of allocated memory can corrupt data, crash the program, or cause the execution of malicious code.WARNING: over 80% of security problems result from buffer overflows!
Real World Exaple The earliest known exploitation of a buffer overflow was the Morris worm in 1988. In 2001, the Code Red wormexploited a buffer overflow in Microsoft's Internet Information Services and in 2003 the SQLSlammer worm compromised machines running Microsoft SQL Server 2000.
Task: Check your code YesNoUnsure
1. Check each array assignment that could result in an overflow (indices >= ARR_SIZE ) EX: arr[ARR_SIZE] = 0;
2.Check loop boundaries >= ARR_SIZE EX: for (i = 0; i <= ARR_SIZE; i++) array[i] = x;//off-by-one!
3. Check all indices that are input. EX: cin >> i; array[i] = x;
4. Are all string functions within range? (hint: do not use: gets, strcpy, sprintf)
5.Are arrays close to pointers? (Hint: remember the return address of a function is a pointer)
Shaded area indicated this is a high security risk!

Monday, November 12, 2007

生活用品英语(不定期更新)

被子 quilt [kwilt] 
手巾架towel holder

Sunday, November 11, 2007

Eclipse 中正确显示中文字符

Window->Preferences->General->Workspace ->Text file encodeing
change Default(Cp1252) to UTF-8

Thursday, November 8, 2007

KartRider (跑跑卡丁车)Nexon 连喷方法


上右
上右 + shift
左上
右 + shift (快)
左上 ( 喷)
右 + shift (快)
左上 ( 喷)

上+ ctrl

KartRider (跑跑卡丁车)Nexon 快捷键

人物表情:
CTRL+1笑  lol CTRL+2怕怕
CTRL+3哭 CTRL+4怒 >।< CTRL+5打招呼 CTRL+6喜欢 CTRL+7- -! CTRL+8睡觉


CTRL:道具
R:复位键
←↑↓→/WASD:上下左右
ESC:计时赛
F4:截图
F5:准备/开始
F7,F8:游戏音乐 开/关
F11:窗口/全屏



按ctrl+e 可以直接跑计时赛

按ctrl+r 可以直接进入回放

按alt+F4 关闭游戏

按shift+F4 穿水,穿香蕉,穿人

按alt+F6 卡自爆,穿人,穿水,穿香

Wednesday, November 7, 2007

Game BLOXORZ passcode



Game Bloxorz ( click here (CHINA) or (USA)to open or download )
The aim of the game is to get the block to fall into the square hole at the end of the stage.
I finished all the stages today. It's fine and some of the stages are really need time to try again and again.



PASSCODE:
stage 11 : 291709 (*)
stage 12 :958640
stage 14 : 000241
stage 16 : 683596

stage 19 : 119785
stage 20 : 543019
stage 21 : 728724
stage 22: 987319
stage 23: 293486
stage 24 : 088198
stage 25: 250453
stage 26: 426329
stage 27 : 660141
stage 28: 769721
stage 29: 691859
stage 30: 280351
stage 31: 138620
stage 32: 879021
stage 33: 614955

Sieve of Eratosthenes Algorithm

The Sieve of Eratosthenes is an alternative method for finding prime numbers by progressively filtering multiples of primes.


/*Sieve of Eratosthenes
1.Write a list of numbers from 2 to the largest number you want to test for primality.
Call this List A. (This is the list of squares on the left-hand-side of the picture.)
2.Write the number 2, the first prime number, in another list for primes found.
Call this List B. (This is the list on the right-hand-side of the picture.)
3.Strike off 2 and all multiples of 2 from List A.
4.The first remaining number in the list is a prime number.
Write this number into List B.
5.Strike off this number and all multiples of this number from List A.
The crossing-off of multiples can be started at the square of the number, as lower multiples have already been crossed out in previous steps.
6.Repeat steps 4 and 5 until no more numbers are left in List A.
*/
#include
#include
using namespace std;
const int SIZE = 1000;
int main ()
{
int arr[SIZE];
int i;
for ( i= 0 ; i < SIZE; i ++ )
{
arr [i] = 1;
}

int p = 2; //first prime number

while ( p*p < SIZE)
{
for ( i=2 ; i*p < SIZE; i++ )
{
arr[p*i] = 0;
//cout << p*i << endl;

}

for ( i= p ; i < SIZE; i ++ )
{// find prime
if (arr[i] == 1 && i > p) // find the next prime number
{
p = i;
//cout << i << endl;
break;
}
}
}

int line=0;
for ( i= 2 ; i < SIZE; i ++ )
{

if(arr [i] == 1)
{
line ++;
cout << setw (4)< if (line % 10 == 0)
cout << endl;
}
}
cout << endl;

return 0;
}

Tuesday, October 23, 2007

transfer money to your account

1. international .
need: 1. swift code like BOF BOFAUS3N.
2. your account number.

2. inside USA.
need: 1.routing # like BOF 052001633.
2. your account number.
3. in the same bank .
need: just your account number.

Tuesday, October 9, 2007

似曾相识 Déjàvu (我一直有的感觉)

似曾相识 (对我来讲,平时老会有这样的感觉, 就是哪天有一刻突然感觉到当时的场景,人物,所说的话,做的事都在哪发生过,而且特别真切,看来有很多人有跟我一样的感受)

Déjàvu源于法文,是在美国颇为流行的法语词,其意思相当于中文当中的“似曾相识”,指的是人们在经历过一段场景之后,会突然觉得自己曾经在某个地方、某个时段经历过相同的场景,而且印象深刻;或者明明是第一次到某地,却觉得自己好像已经到过这个地方、感觉非常熟悉等等,这是一种很多人都会遇到过的心理现象。对于Déjàvu,人们给出了不同的解释:有人说是梦境的再现,也有人说就是所谓的"第六感"。还有科学界对此作出的解释是人脑中负责控制情感的部分同控制逻辑的部分的速度出现了暂时的不一致,控制情感的部分比控制逻辑的部分速度快,就会造成这种情况。尽管解释很多,但此现象的原因与本性至今还是一个谜。

JAVA 类与函数的access

java








































Access Levels
ModifierClassPackageSubclassWorld
publicYYYY
protectedYYYN
no modifierYYNN
privateYNNN