陕西省妇幼预约系统分析

陕西省妇幼预约系统分析:
http://wsgh.sxmch.com/ZhuanJia_Add.asp?v_NDI0MTM3NzU=MTU4-MjAxMy02LTE3-MQ==
1. 固定URL http://wsgh.sxmch.com/ZhuanJia_Add.asp?v_NDI0MTM3NzU=
2. 专家编号的base64编码 MTU4 –> 158
3. 日期的base64编码 MjAxMy02LTE3-MQ= –> 2013-6-17
format is:

http://wsgh.sxmch.com/ZhuanJia_Add.asp?v_NDI0MTM3NzU={code}-{date + space}=

Note:本来的目的是想提前预约的,但是将将来的日期带入到上面的URL中,页面能打开,但是提交不了。所以未果。

design pattern tips

design pattern
In software engineering, a design pattern is a general reusable solution to a
commonly occurring problem within a given context in software design.
http://en.wikipedia.org/wiki/Software_design_pattern

设计模式就三个准则:1)中意于组合而不是继承,2)依赖于接口而不是实现,3)高内聚,低耦合。你看,这完全就是Unix的设计准则。
http://coolshell.cn/articles/8745.html

Design Patterns are best practices how to solve common know problems.
http://www.vogella.com/articles/DesignPatterns/article.html

面向对象编程注重的是:1)数据和其行为的打包封装,2)程序的接口和实现的解耦。
OOP的本质就是——对数据和与之关联的行为进行编程。即便就算是这样也不完全对,因为:
Sometimes data is just data and functions are just functions.
http://coolshell.cn/articles/8745.html

一些软件设计的原则
http://coolshell.cn/articles/4535.html

JDK里的设计模式
http://stackoverflow.com/questions/1673841/examples-of-gof-design-patterns
http://coolshell.cn/articles/3320.html

How to compile openjdk 7 in RHEL5

1. 为什么要编译openjdk的code?
因为从Eclipse调试JDK的代码时,方法中的局部变量不能显示,这样是因为编译JDK时,没有编译成debug版本。

2. RHEL5中自带的开发者JDK已经是debug版本了,所以可以直接使用。

例如:java-1.6.0-openjdk-devel-1.6.0.0-1.24.1.10.4.el5

3.
在Eclipse中如何使用其它版本的JDK,首先在preference中将编译好的JDK路径添加进去,然后修改工程中的JDK依赖关系,重新编译工程,debug到
JDK中,这时JDK代码中的局部变量就可以查看了

这里的方法是从 http://hg.openjdk.java.net/jdk7/build/raw-file/tip/README-
builds.html
来的。

下面开始具体的步骤:

1. 安装setuptools

install setuptools in windows/linux
1.1. download https://bitbucket.org/pypa/setuptools/raw/0.7.4/ez_setup.py
1.2. run it with python

2. 安装Mercurial

install Mercurial in linux:
2.1 easy_install -U mercurial

3. 下载openjdk的source

download open jdk 7 source

3.1 hg clone http://hg.openjdk.java.net/jdk7/jdk7 YourOpenJDK

3.2 cd YourOpenJDK

3.3 sh ./get_source.sh

4. 安装Ant和freetype

install ant 1.7
install freetype 2.3

4.1 从apache的网站上下载ant的zip包,解压到任意目录

4.2 从sourceforge上下载2.3版本的freetype的source包

使用下面的命令安装:

./configure && make && sudo -u root make install

5.设置环境变量

5.1 LANG和BOOTDIR

export LANG=C
export ALT_BOOTDIR=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64

5.2 Ant

export ANT_HOME=/tmp/ant/apache-ant-1.7.1
export PATH=/tmp/ant/apache-ant-1.7.1/bin:$PATH

5.3 Freetype(这里是默认的安装路径)

export ALT_FREETYPE_HEADERS_PATH=/usr/local/include/
export ALT_FREETYPE_LIB_PATH=/usr/local/lib/

6. 检查一切完好

gmake sanity ARCH_DATA_MODEL=64

7. 编译

gmake

#make debug version
gmake ALLOW_DOWNLOADS=true fastdebug_build
gmake ALLOW_DOWNLOADS=true debug_build

sikuli core: Finding GUI Patterns on the Screen

sikuli core: Finding GUI Patterns on the Screen
1. target pattern is small –> template matching based on normalized cross-
validation
Forsyth, D. and Ponce, J., Computer Vision: A Modern Approach, Prentice Hall,
USA, 2002.
2. target pattern is large –> SIFT
Lowe, D. G. Object recognition from local scale-invariant features.Proc.
International Conference on Computer Vision, 1150-1157, 1999.
http://en.wikipedia.org/wiki/Scale-invariant_feature_transform
http://www.aishack.in/2010/05/sift-scale-invariant-feature-transform/
http://opencv.org/
http://opencv.willowgarage.com/wiki/OpenCVBooks

什么是three-way merge

A, B and C means three-way. C是A和B的父亲,D是A和Bmerge之后的结果

The three-way merge uses the ancestor of the changed files to identify blocks
of content that have changed in neither, one, or both of the derived versions.

使用C的内容来标记A和B的内容有没有改变(1.A和B都没有变,2.A或者B变了;3.A和B都变了)

Blocks that have changed in neither are left as they are. 如果是1的话,不需要merge。

Blocks that have changed in only one derivative use that changed version.
如果是2的话,D的内容和改变了的A或B一样。

If a block is changed in both derivatives, the changed version is used if it
has the same content on both sides,

如果是3的话,有分为两种,A和B的改动一样,则D的内容和A或者B一样;

but if the changes differ, it is marked as a conflict situation and left for
the user to resolve.

但是如果A和B的改动不一样的话,这时就会进入冲突模式,需要人去手动的解决了。

下图就是在clearcase中出现冲突后使用xmerge解决冲突的截图(相关code我已经隐去)。

http://en.wikipedia.org/wiki/Three-way_merge
http://en.wikipedia.org/wiki/Diff3
kdiff3. sourceforge.net

python中的tuple不是immutable (tuple in python is not immutable)

There are lots of article to say that tuple in pyton in immutable, but after
my test, this is not true.

Please see the example:

Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on
win32

L = [1,2,3]

define a typle

dd = tuple(L)

print all methods of tuple

print dir(dd)
[‘add‘, ‘class‘, ‘contains‘, ‘delattr‘, ‘doc‘, ‘eq‘,

format
‘, ‘ge‘, ‘getattribute‘, ‘getitem‘, ‘getnewargs‘,
get
slice
‘, ‘gt‘, ‘hash‘, ‘init‘, ‘iter‘, ‘le‘, ‘len‘,

lt
‘, ‘mul‘, ‘ne‘, ‘new‘, ‘reduce‘, ‘reduce_ex‘,
repr
, ‘rmul‘, ‘setattr‘, ‘sizeof‘, ‘str‘, ‘subclasshook‘,
‘count
‘, ‘index’]
print dd
(1, 2, 3)
dd.add(“a”)
Traceback (most recent call last):
File ““, line 1, in
TypeError: can only concatenate tuple (not “str”) to tuple

# Note, tuple is changed.

dd.add(dd)
(1, 2, 3, 1, 2, 3)

refs: http://www.diveintopython.net/native_data_types/tuples.html