Root · Test

TDD (1)

The most of TDD’s gain is from having to think about the implementation before youstart to type codes.  The steps to use tdd is like this: a. write down “real code” class and methods signatures based on the design b. write down some comments about the initial implementations. c. write down one unit test in… Continue reading TDD (1)

Root · Socket Programming

the things about endian

binary and value expression are different. Basically, be is the store format in memory while ve is the human-readable values that be represents. eg. short a = 128, its value expression is looking like this: 00000000 10000000 its binary expression is looking like this: little endian  10000000  00000000 big endian     00000000 10000000 the aim… Continue reading the things about endian

Programming Languages · Python · Root

understand twisted deferred (1)

Deferred is a type of object designed to do one thing only: encode the execution order as callback-based and separately from the normal order of the python source codes. It does not deal with threads, parallelism, signals or subprecesses.It does not no know anything about an event loop, greenlets or scheduling. All it knows is what order… Continue reading understand twisted deferred (1)

Root

Linux Bash Shell Script Pieces

use ~ (`) in your keyboard to enclose script #!/bin/bash user_id=`id -u $username` user_gid=`id -g $username` if [$user_id -eq $user_gid];then echo “good guy” else echo “bad guy” fi timestamp==`date +%s` let startday=$timestamp/86400 echo $startday #get user id and gid not using id if ! grep “^$user_name\>” /etc/passwd &> /dev/null;then echo “no such user” exit $?… Continue reading Linux Bash Shell Script Pieces

Root

Agile Unified Process

1.developers themselves should do OO design modeling, for themselves, not to create diagrams that are given to other programmers to implement, which is unagile water-fall-oriented practice. 2.Model in pairs. Better to rotate the pen sketching across the members so that all participate. 3.quality requirements have a strong impacts on the system architecture design. 4.high level… Continue reading Agile Unified Process

Encryption · Root

Encryption Client/Server Communication

1. Client pre-generats challenge then send connection request to server. +Header (1) ID_OPEN_CONNECTION_REQUEST_1 +OfflineMesageID (16) +ProtocolNumber (1) +Pad (toMTU) 2. Server generates cookie and then send it to client to answer. +Header (1) ID_OPEN_CONNECTION_REPLY_1 +OfflineMesageID (16) +Server GUID (8) +HasCookieOn (1) +Cookie (4, if HasCookieOn) protect syn-floods-attack with faked ip adress +Server Public Key (if… Continue reading Encryption Client/Server Communication