Android 笔记: 布局管理

三月 26th, 2012, posted in Android

正文之前: This is the notes of book “深入浅出 Google Android” 八咖 -_-|| 2009年出版的书,显老了点儿,先翻翻… 正文: (1)线性布局 => LinearLayout fill_parent => 表示填满父控件的空白 wrap_content => 表示大小刚好足够显示当前控件里的内容 vertical => 垂直 horzontal => 水平 layout_width="fill_parent" => 宽度占满整个屏幕 layout_height="wrap_content" => 高度适应子控件 gravity="right" 如果是无子控件的V...

极小化极大值算法-井字棋Ruby实现

三月 15th, 2012, posted in Ruby

来自wiki百科的描述如下: Minimax算法又名极小化极大算法,是一种找出失败的最大可能性中的最小值的算法。 概述: Minimax算法常用于棋类等由两方较量的游戏和程序。该算法是一个零总和算法,即一方要在可选的选项中选择将其优势最大化的选择,另一方则选择令对手优势最小化的方法。而开始的时候总和为0。很多棋类游戏可以采取此算法,例如tic-tac-toe。 例如tic-tac-toe,简单点讲,就是在己方落子的时候,使自己的优势最大化,在考虑未来几步的对方落子的时候,假象对方走对已最不利的位...

ubuntu 安装jdk7.0

二月 23rd, 2012, posted in 其他

转载自:Ubuntu 安装JDK7.0 1. Download the following file: http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-i586.tar.gz (32-bit) http://download.oracle.com/otn-pub/java/jdk/7u1-b08/jdk-7u1-linux-x64.tar.gz (64-bit) 2. Decompress the .tar.gz file. 3. Move the JDK files to /usr/lib/jvm/jdk1.7.0 or elsewhere you like. 4. $sudo gvim /etc/environment You will see PATH=”/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/game...

vim configure on windows

十一月 10th, 2011, posted in Linux, vi/vim

vim config on windows

Perl Script used for test sysbench.

九月 20th, 2011, posted in Perl

ae4dee610d32dbdac48142e045dce002006 sysbench 测试中Err1062 Duplicate entry的解决办法: http://dbablog.journalspace.com/?p=3 Write the script to test the added reconnect function on sysbench-0.4.8. Update… ae4dee610d32dbdac48142e045dce002007

perl Expect模块

九月 15th, 2011, posted in Perl

参考:http://www.php-oa.com/2009/09/16/perl-expect.html sudo perl -MCPAN -e "install Net::SSH::Expect"; sudo perl -MCPAN -e "install IO::Stty"; Then I write a small ssh autologin script with perl. Belows: ae4dee610d32dbdac48142e045dce002008 Auto reconnect, haven’t work it out yet. Next time…  

centos vim7.3

九月 14th, 2011, posted in vi/vim

http://download.pchome.net/utility/file/editor/redirectsrv-10199-5.html http://linuxtoy.org/archives/wget-tips.html http://blog.csdn.net/zhanglyung/article/details/6204574 http://liuyujack.me/?p=46 http://disyulei.blog.163.com/blog/static/92614271200931443737153/                     

MySQL ERROR:This function has none of DETERMINISTIC, NO SQL

九月 13th, 2011, posted in 其他

http://shanchao7932297.blog.163.com/blog/static/1363624201010863043981/ DBD::mysql::st execute failed: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable) at ddl_test/run_ddl.pl line 426. ALERT: failed to execute mysql_stmt_execute(): Err1442 Can’t update table ‘sbtest’ in stored fun...

Sed简介

九月 7th, 2011, posted in 其他

Sed简 介

梦境的虚幻

八月 21st, 2011, posted in 生活

  梦...醒时分,若留有残存的记忆碎片,万幸也。。。 人醒之后,梦境的记忆便虽时间推移而慢慢淡去,到最后只剩下: 啊,我刚刚做了个梦,至于内容,已忘却大半。。。 或取就仅仅记得做了个梦而已,忘却的速度好比鱼的短暂记忆,好比张无忌练太极。。。 刚醒时分,记忆是最清晰的,然而也仅仅是碎片,将碎片编译链接后,也许还得加上造梦者醒后不自觉的 主观意造,梦境才能被不清晰的运行,至于有些细节,究竟是梦境还是意造,随着时间,造...