自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(32)
  • 收藏
  • 关注

原创 测试&开发 谁坑了谁?

测试与开放本来都是软件工程中必不可少的常见工作, 个人认为并没有严格的界限来划分测试与开发。 虽然在全球大分工工作环境下,流水线式生产几乎随处可见,然而Agile式开发的兴起恰恰反驳了所谓的大分工协作。 流水线式生产的优点在于利用重复劳动提高劳动回报率, 降低对人员素质的要求。 然而弊端也是显而易见的, 应变需求能力弱(一有改动整条流水线都要跟着应变), 信息沟通困难(上下分层太多,职能过于分散,

2012-02-06 11:28:51 1050

原创 RSA算法研究与PYTHON实现

RSA算法是一种非对称密码算法,所谓非对称,就是指该算法需要一对密钥,使用其中一个加密,则需要用另一个才能解密。RSA的算法涉及三个参数,n、e1、e2。其中,n是两个大质数p、q的积,n的二进制表示时所占用的位数,就是所谓的密钥长度。e1和e2是一对相关的值,e1可以任意取,但要求e1与(p-1)*(q-1)互质;再选择e2,要求(e2*e1)mod((p-1)*(q-1

2013-02-22 14:27:08 1418

原创 斐波拉切数列研究

斐波拉契(Fibonacci)数列来源于兔子问题,它有一个递推关系,  f(1)=1   f(2)=1   f(n)=f(n-1)+f(n-2),其中n>=2   {f(n)}即为斐波拉契数列。  ■斐波拉契数列的公式  它的通项公式为:{[(1+√5)/2]^n - [(1-√5)/2]^n }/√5 (注:√5表示根号5)

2013-02-22 14:12:26 2112

原创 【大数算法】( 十进制整数四则运算) 十进制运算与二进制比较与思考

序  这两天心血来潮, 想熟悉下Eclipse。 偶是写Python的, 一般都在Ubuntu上用VIM做编辑器, PDB做调试工具, 自带的python2.7解释器, git做版本控制。 用着挺爽, 也就没有搞啥IDE, 但是最近发现要做大项目或工程的话, IDE啥的还是很有必要的。  几乎把所有支持Py的IDE都尝试过了, eric用着特别扭(还是比较习惯VIM的便捷操作),  要Py

2012-02-23 14:32:54 2713

原创 Trouble shooting during upgrade ubuntu 10.04 to 10.10

n unresolvable problem occurred while calculating the upgrade: Can not mark 'ubuntu-desktop' for upgrade This can be caused by: * Upgrading to a pre-release version of Ubuntu * Running the current

2012-02-13 14:26:30 840

转载 cx_Freeze

from cx_Freeze import setup, Executablesetup( name = "hello", version = "0.1", description = "Sample cx_Freeze script", executables = [Executable("hello.py")])

2012-02-13 14:25:12 911

转载 Apach directory configure

#DirectoryIndex index.cgi # make sure the homepage is index.cgi Options +ExecCGI +FollowSymLinks +Indexes +MultiViews AddHandler cgi-script .cgi AllowOverride None Order allow,deny

2012-02-13 14:24:19 673

原创 Build Git service on Linux and setup Git client on Windows

1. Build Git repository on Linux# apt-get install git gitweb# git --bare init --shared2. Setup Tortoisegit on Windows Install msysGitInstall TortoisegitChose openssh client during the setup

2012-02-07 11:49:25 700

原创 The method of parameters given in Python

def fun(self, a, b, c=None): The default value can be given, but must be given all in the rightestdef fun(self,a,b, *c): The group of parameters can be given, but only one of the default parameters

2012-02-07 11:48:33 601

原创 py2exe

For windows application: #mysetup.pyfrom distutils.core import setupimport py2exesetup(windows=[{"script":"app.py"}], options={"py2exe":{"includes":["sip"]}})

2012-02-07 11:48:01 642

原创 sqlite3 modify the column

BEGIN TRANSACTION; CREATE TEMPORARY TABLE temp_table(a); INSERT INTO temp_table SELECT a FROM 表; DROP TABLE 表; CREATE TABLE 表(a); INSERT INTO 表 SELECT a FROM temp_table;DROP TABLE temp_table; COMM

2012-02-07 11:47:12 971

转载 Python child, parent, super CLASS

Python中对象方法的定义很怪异,第一个参数一般都命名为self(相当于其它语言的this),用于传递对象本身,而在调用的时候则不必显式传递,系统会自动传递。举一个很常见的例子:>>> class Foo: def bar(self, message): print(message)>>> Foo().bar("Hello, World.")Hello, W

2012-02-07 11:46:30 2786

原创 Sqlite3

import sqlite3conn = sqlite3.connect(dbpath)c = conn.cursor()c.execute('''INSERT INTO `wine` (`inde`, `name`, `repos`) VALUES ('%s' , '%s', '%s'); ''' % (inde, name, num)conn.commit()c.close()

2012-02-07 11:45:35 599

原创 Pyqt4

Qt Designer: Signal pyuic4 qt.ui > qt.python Connect the signal with method: QtCore.Qobject.connect(object, signal, method)

2012-02-07 11:44:50 641

原创 Ruby yield and block and Iterators

The key word 'yield' is the core of Iterators, So I use a Iterators to clarify the 'yield'class Sequence include Enumerable def initialize(from, to, by) @from, @to,

2012-02-07 11:43:54 618

转载 MySQL engines MyISAM and InnoDB

The MySQL database has different types of storage engines. The most common are the MyISAM and the InnoDB engines. The MyISAM is the default one. There is a trade-off between data security and database

2012-02-07 11:40:48 643

原创 Create desktop entry for ubuntu

[Desktop Entry]Encoding=UTF-8Name=Wis twikiType=LinkURL=http://twiki.wiszhou.infoIcon=gnome-fs-bookmarkName[en_US]=twiki

2012-02-07 11:38:43 1213

原创 Cookie

he Cookie info would be placed in the HTTP headerSet-Cookie: name = VALUE;expires = DATE;path = PATH;domain = DOMAIN_NAME; In Python, we can use the Cookie lib:Set a simple cookie easily:

2012-02-07 10:42:07 571

原创 My shell environment variable

~/.bashrc invoke when user logging in/etc/bash.bashrc invoke when OS bootupping/etc/rc.local invoke when local shell openingdeveloper: vim, ctags, mysql-server, phpmyadmin, chromiumSystem: ssh-se

2012-02-07 10:40:38 742

原创 Ruby mysql lib compare with Python mysql lib

#Lib include:#Ruby:require "mysql"#Python:import MySQLdb as mdb#Connect db#Ruby:dbh = Mysql.real_connect("localhost", "test", "test", "rubydb")#Python:conn = mdb.connect('localhost', 'testus

2012-02-07 10:26:26 748

原创 Ubuntu Network_manager trouble

Download network-manager.deb and network-manager-GNOME.deb : apt-get install network-manager network-manager-GNOME --reinstall --download-only (The deb package can be found in/var/cache/apt/archives

2012-02-07 10:24:40 690

原创 The way to resolve 'dpkg: error processing python-xxx-xxxx (--configure): (But always install incomp

ls /var/lib/dpkg/info | grep python-xxx-xxxx to list the info file of the package in dpkgrm or mv the relevant one (python-xxx-xxxx.postinst probably) dpkg -C to check the dpkg Do the operatin fol

2012-02-07 10:23:00 1158

转载 Add sudo privilege for normal user in Ubuntu

sudo vim /etc/sudoers Add follow line UserName ALL=(ALL) ALL under root ALL=(ALL) ALL

2012-02-07 10:22:13 638

转载 Revert Ubuntu control panel (还原Ubuntu 控制栏)

gconftool --recursive-unset /apps/panelrm -rf ~/.gconf/apps/panelRestart the Ubuntu

2012-02-06 11:16:17 719

原创 This installation of RMagick was configured with ImageMagick 6.5.5 but ImageMagick 6.5.7-8 is in use

Set follow as global variable RMAGICK_BYPASS_VERSION_TEST = trueexport RMAGICK_BYPASS_VERSION_TEST = true

2012-02-06 11:13:18 955

原创 Ruby CGI lib compare with Python CGI lib: Get form value

This is the Ruby require 'cgi'dcgi=CGI.newdcgi["name"]==dcgi.params["name"][0]This is the Pythonimport 'cgi'form = cgi.FieldStorage()form["name"].valueBut recommend use follow way

2012-02-06 11:06:58 692

原创 Run shell application in ruby

exec 'echo "hello $HOSTNAME"'system 'echo "hello $HOSTNAME"'today = `date`可以用以上三种方式在ruby脚本中执行shell程序,ruby确实很灵动啊。。

2012-02-06 10:59:10 541

原创 Read file line by line (Bash shell script, sed usage)

#!/bin/shfilename=aaanum=`cat $filename |wc -l`echo $numi=1while [ $i -le $num ] ; do line=`sed -n "$i,$i p" $filename` echo $line i=$(($i+1))done

2012-02-06 10:57:18 1102

原创 SSH session key (证书认证方式SSH登录配置)

Create the authorized_keys on client ssh-keygen -t rsaCopy the public key to the hostAdd public key info into authorized_keys file (On the host)cat id_rsa.pub >> /home/[user]/.ssh/authorized

2012-02-06 10:55:49 1075

原创 开启Ubuntu的NAT网络共享(封包转发方式局域网内共享上网)

We need open the ipv4 forwarding on the host sysctl -w net.ipv4.ip_forward = 1Add follow lines into /etc/rc.locat to set NAT tableiptables -Fiptables -P INPUT ACCEPTiptables -P FORWARD A

2012-02-06 10:52:55 1166

原创 Mount the windows ftp server to linux

mount -t cifs -o username=xxx,password=xxx,uid=1000,gid=1000,iocharset=utf8 //ftp/folder /mnt/mntpointNote: The mount point folder would have existence注释: mout 指令不用多说了。-t mout 类型, cifs 对应着

2012-02-06 10:49:13 820

原创 The symble '-' in Linux

This is a wonderful symble in the linux.It can change the data stream which would go to a file to the stdout.It can import the data stream which would come from a file from the stdin.So, if we u

2012-02-06 10:40:10 651

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除