Tuesday, December 30, 2008

联通手机邮箱实现Gmail邮件提醒

最开始只是想弄一个Gmail的邮件提醒功能,于是想到了邮件转发,如果Gmail邮件能够转发到联通,然后联通就可以发短信通知我,这还不是通常说的PushMail。PushMail强大多了。于是一阵google,发现联通有个手机邮箱,每个手机用户都可以免费申请一个,不用白不用。立马用手机号注册一个。注意不是所有的联通用户都可以免费的。只有Up新势力是初次使用免费。好了,有一个联通手机邮箱了,这个邮箱的功能之一,就是邮件到达短信提醒,that' exactly what I want.

接下来,就是在我的gmail邮箱上设置一个过滤器,把我比较关注的邮件转发到刚刚申请的联通手机邮箱。写了几个测试邮件,文本邮件和pdf附件都没问题,没试过发图片附件。有一个问题是,如果邮件正文有背景之类的,转发过来整个邮件正文就丢失了。虽然一般不会收到这种邮件,但万一碰上,后果还是很严重的。另外一个问题就是,push下来的email正文需要发N个短信指令才能读完,实在是烦不胜烦。

于是想到这样一个混合方案,用手机邮箱做短信提醒,收到提醒(对新势力用户完全免费的哦!),立马打开Gmail client查邮件。貌似可行。好了,就扯到这里。

终于搞定联通GPRS访问Gmail

以前好像没怎么玩过手机上网的东西,今天突然心血来潮,搞了个联通的GPRS套餐,开始捣鼓起来。我开通手机上网主要是在没电脑用的时候用来访问Gmail和MSN的,可能skype也会用一下。看新闻什么还是算了,太费劲了。好了,下面开始一天的艰苦旅程。

首先一阵google,让手机终于连上了网。这里有个简单的介绍,照葫芦画瓢就OK了,在此不详述。值得注意的是,这里使用的接入点是uniwap,提供wap浏览和彩信功能。

好了,第一个问题是怎么让手机访问Gmail? Gmail网站上有两种方式:一种是通过WAP访问,另一种是通过IMAP客户端访问。WAP访问貌似简单明了,不需要装任何东西,只要能上网就行。但我想用uniwap来访问却不行,提示“不能建立安全连接”或者“找不到服务器”,我起初怀疑是不是因为uniwap不支持对gmail的https访问呢,反正郁闷半天没敲出个所以然来。暂且先放一边,WAP访问看来不可行,猛然看到Gmail网站有个Gmail client,是个IMAP客户端,下载装上,打开,一样连接不上。我就纳闷这联通怎么就跟Gmail杠上了呢?于是有按照Gmail网站上的提示来设置我手机上内置的邮箱,步骤繁琐,毫不容易设完了,连接,不上。貌似没希望了。

Gmail先放一边,装个MSN再说吧,MSN还是很顺利,直接通过uniwap就能连接,而且界面很nice,不错。信心终于恢复了一点。好了,又一阵google,发现了两个重要情况:一个是有个叫mimo的软件号称可以通过uniwap访问MSN,QQ以及强大的push mail,我不由得想试一把;另一个是uninet,这个很少在成百上千的联通gprs上网设置的tutorial里找到,我也就在一个地方看到了这个东东。好了,接下来,要开始这两个试验了。当然了,uninet最简单了,重新设置一把接入点就行了。设完,再启动本机的内置Email连接,忽然看到哗哗的邮件标题在闪动,我想这把应该是成了。再重启前面装上的Gmail client,也是哗哗的一阵。然后找了个Opera Mini装上,访问Gmail首页,登陆,一切OK,不得不说Opera太Cool了!

好了,到这的时候,今天差不多快结束了,要知道中间为了让我手机跟PC连接起来,费了老半天劲。我下载的最新的Nokia PC Suite 7.1居然不能识别我手机配的USB数据线。试了半天老版的PC套件,终于连上PC。那个mimo的东西改天再玩吧,那么多人推崇,想必应该好使吧。还有一个东西得玩一下:GPRS手机+PC数据线+PC/笔记本通过手机的GPRS上网,其实也有好多人玩过,自己试验一下更有意思(PS: 好了,已经试验过了,速度在6KBS左右,那叫一个慢啊,还贵,不到紧急情况还是不用了)。

快写完了,突然发现,有个问题还没说,那个uninet就叫那个是个啥东东呢!一阵google,发现是联通移动数据业务的一个王牌,165拨号就是上的uninet网络,主要是访问Internet。uniwap功能比较弱,只支持wap网页浏览和彩信。哪个好使当然不用说了,不过联通的网站上确实没说通过GPRS连uninet。Anyway,哪个好用用那个了。

Thursday, December 25, 2008

notes about MOF and UML

I just read an old post(MOF 4 layers) about the mapping between UML and MOF. However, I'd like to post my idea about UML mapping to MOF 4 layers.

As a reminder, MOF 4 layers structure from that post is pasted here.
* Level M0: User Object Layer (Instances)
* Level M1: Model (Domain Specific Language)
* Level M2: Meta-Model (Schema description Language)
* Level M3: Meta-Meta-Model (The Schema of the Schema)
And here is an architecture image about MOF:



The basic thinking is think of each layer as instantiation of the layer above. So I think it works this way:

* Layer M0: specific instances of model diagrams, e.g. a book named "UML distilled"

* Layer M1: UML model diagrams we drawed when we do modeling, e.g. e-bookshop class diagrams and use case diagrams. Actually it is the equivalent of C source file.

* Layer M2: UML meta model, e.g. model element specified in UML, class, interface, association, generalization,property,method, component and so on. It is the equivalent of C syntax.

* Layer M3: UML meta meta model, maybe its basic model elements is entity and relationship. It is the equivalent of syntax definition specification like EBNF.

Wednesday, December 24, 2008

software reuse: how?

It is a short summary of great essay on software reuse by Schmidt(reuse lessons).

1. impediments
organizational
economic
administrative
political
psychological

2. prerequisites
competitive market
complex application domain
corporate culture and development process
reuse magnet: open source with short feedback loop
leadership and expertise of skilled architects and developers


3. what we can do?
adopt iterative development process to grow reusable assets incrementally
maintain a close feedback loop between component developers and application developers
buy middleware rather than build in house: don't reinvent the wheel
build on architecture rather than on specific technology: vendor neutral
one dimensional thinking never works
reward incentives for reuse
continuous learning
keep faith

Tuesday, December 23, 2008

DSL: How?

I just read a book about DSL(Domain Specific Language), a summary are written to get a general idea about DSL.

1. interpreter
write grammar using BNF or other grammar notations;
build or generate a parser of grammar(using tools like yacc, javacc, antlr)
script languages can be built in this way(template language like jsp,asp,freemarker,..)

2. embeded
build domain model by general purpose programming language
in a form of API specific to a domain
can be designed for considerable expression power within that domain(jMock)

3. XML
represent grammar by XML schema
processing XML is made easy by many API and tools
very popular in many domains:
definition of state transition in a state machine;
description of object relation mapping in OR Mapping tools
description of web page navigation flow
definition of business process(BPEL)

4. graphical DSL
represent domain model by constructing graph elements and their connections
more intuitive and impressive
graphical model can be transformed into software artifacts
XML is used for well integration with tools(XMI)

Thursday, December 11, 2008

the dilemma of obedience

From the very beginning, human is a highly socialized species. From tribes to cities and states, socialized organization become increasingly sophisticated. Like any socialized life like bees or wolves, human get an edge to survive on earth from this feature of highly socialization that is still driving the development of human civilization.

Human live by customs as socialized animals live by rules. A society always shows some kind of division of labor which is considered as the driving force of human evolution and also the foundation of classic economics. Apparently human benefit a lot from society by playing a role in it. However, sometimes human do enormous harm to others by doing the same thing. Numerous notorious genocides in human history are the most noticeable evidences for this case.

A few decades ago the famous Milgram experiment was conducted as an attempt to shed light on this sort of humanity disasters. It shows that a majority of people tend to inflict distress to any extent on others when they are forced to by an authority. It seems that the blind obedience of the majority to the authority is the culprit, because when people do something against his conscience, the blame can be shifted from the individual to the authority so that the individual feels less guilt than he should. And when the number of people getting involved reaches a threshold, herding mentality comes into play, which reinforce the power of authority. And finally a catastrophe is inevitable. This is a psychological explanation of why moral individuals constitute immoral society.

As long as the society exists, the authority, more or less exists. If the authority is doing the right thing, it is a fortune. Otherwise, the harm is beyond anyone's imagination. So what we can do to prevent it? Social psychology give us a special lens to peer into the human nature and give us some clue to figure out a preemptive solution. The key is to limit any forms of authority to develop rampantly. This is where check and balance comes in.

It seems ridiculous that we are battling against our innate nature. But it is the truth. We must employ our reason to won this battle. And there is no way to escape.

Wednesday, December 10, 2008

silver bullet for vocabulary building

Vocabulary building is one of the greatest obstacle for all English learners, especially for those who have a very different native language such as Chinese, Japanese. It is claimed that a vocabulary of 2,000 is enough for normal English communication. However, English, as one of the most popular languages, have accumulated a large vocabulary bank in its history. And now it is still inflating when our society is undergoing dramatic changes. One reason why English has developed a so big vocabulary is that when there is a need to express a new meaning, a totally new word is created, even sometimes the new word has only a subtle difference with similar words. Therefore, it is necessary to grasp as much words as possible to communicate more precisely.

I must say in the first place that there is no silver bullet to memorize words. But there are some methods you can have a try to build your vocabulary more efficiently. Actually some of them are well written in many places. I just list some of them I used and I felt effective.

1. word roots
Almost each English dictionary has an appendix of word roots. By word roots, new words can be created more easily and also more understandable. Many English word roots have a Greek or Latin origin. So, if you can grasp the meaning of these words root upon which a lot of words are built, you somehow grasp the key of the gigantic vocabulary bank.
some useful links:
Common Word Roots
Root Words and Word Origins
English roots chart

2. prefix and suffix
Like word roots, many words are built from prefix or suffix.
Please reference to the links in the first section "word roots".

3. association
It is always hard to remember many single words. But if you can find out some kind of relationship between these single words, you can piece them together like a jigsaw and eventually get a web of words instead of shining stars scattered in the dark sky. Relationship can help you remember words.
(1) synonym, antonym, homonym
Actually when we learn Chinese words we also did a lot of these kinds of exercises. Obviously it also applies well in learning English.
(2) analogy
If some words share a similar part in their structure, you can group them together. If some words share a similar meaning, you can group them together. If some words represent concepts of the same subject, you can group them together. For example, many words describe goodness or kindness, many words describe dislike, and so on. And also you can find out your own analogy as long as it make sense for you.

Common Word Relationships

4. use words as hard as possible to write something
If you manage to get a vague memory about some word but you still can't use it correctly, you can strengthen your memory of the word by using it. Otherwise, the vague meaning will vanish some day.

5. make a summary(in any form: oral or written) about what your heard or read and try to use different words
Sometimes, you can manage to understand something, but if you can't digest the content in your own way, your initial understanding is shaky and easy to fade away.

Some general links:
How to build a better vocabulary

Vocabulary book recommendation:
Webster Vocabulary Builder

Thursday, December 4, 2008

list of courtroom drama

Out of enormous curiosity about the legal and judicial system in the west, I find and see some courtroom drama movies and TV shows to try to get insights about how the legal and judicial system works in the west. Some of them are classic ones. I'd like to list their names.

movie

1. To Kill a Mocking Bird
an attorney fight for the accused black person's justice which was badly biased by the white majority, not only with his powerful words but also with his persevering acts

2. 12 Angry Men
12 ordinary persons of different social status, different education level, different occupation, acting as jurors, debating in a meeting room, showed how the jury system works.

3. Kramer vs. Kramer
a common civil case about the custody right of a boy. a happy ending with a bit suspense. the point is not how the father or mother has more legitimacy to live with child, but what is the best environment for the child to grow up in a single parent family.

4. Witness for The Prosecution
an murder case of much suspense in the ending. great playwriting

5. Judgment at Nuremberg
a famous international trial on Nazi German top officials. thought-provoking

6. Runaway Jury
Out of disappointment on the US judicial system to do justice for those impaired by guns, which proliferated through strong sales channel supported by gun manufacturers, a man managed to become a juror and influence other jurors to reach a verdict favorable to the striving prosecution and also striking to the defendant, and at the same time, extorting a large sum of money from the defendant, gun manufacturers. The weakness of the jury system is also unfolded.

7. JFK
Even now the truth of assassination of JFK is not yet known, so how could a film unravel what really happened at that time? The point is not reveal the truth, but enlighten the people not to be cheated by the misrepresented truth distorted by government for hidden purpose and never give up the rights to pursue the truth. The closing of the prosecutor is very powerful.

8. The Devil's Advocate
It is about the ethical conducts of lawyers? Maybe.

TV show

Out of many courtroom shows such as Law and Order, Shark, Boston Legal is my favorite one in the same class. Boston Legal perfectly blend humor, flirting and exciting court trial.

Wednesday, December 3, 2008

notes on judicial system

The distinctions of law in different countries are very conspicuous. So are the distinctions of judicial system. One of the most conspicuous distinction is the jury which is widely used in countries ruled by common law. The jury system is initially devised by the Greeks and ever adopted by Roman. And later most European countries adopted jury system. But for a variety of reasons some of them abolished jury system. The failure of jury system in these countries may be attributable to social customs, culture characteristics and political system.

Nowadays the most successful case of the jury system is in the United States. In fact, many Hollywood movies and courtroom dramas produced in the United States show some aspects of jury system. I'd like to list some timeless works I've ever seen in another blog. Now I just wanna jolt down my understanding about jury system.

Linda, a writer, ever write a book about American judicial system. In the book, Simpson's case is elaborated in very detail. And the author made a metaphor I think is very appropriate. He said, the judicial system in the US is like a football match. The defense attorney represents the accused person to cast reasonable doubts or overturn the evidence against the defendant. The district attorney represents the prosecution to provide as much evidence as possible to prove the defendant guilty. Cross examination is used by two sides of attorneys to clarify the scenario of the case. The judge controls the trial process. If any side asked irrelevant question or made irrelevant request, the judge can overrule or sustain the question or request. During the trial period, the jury is isolated from the outside and is supposed to make an objective verdict according to the evidence presented on the court. In most criminal cases all the jurors should reach an unanimous judgment to make a verdict. In some civil cases the rule of majority is used.

The democratic characteristic of the jury system is very evident. The essence is that the accused should and can be judged by those have the same social status with him in a just procedure. All jurors are randomly chosen from local registered electors and two sides of attorneys should reach a consensus about the list of the jury. It is no wonder that in some cases even when the defendant lost the case he still insisted that he was judged with justice.

Such a democratic system is not without problem. Actually we can clearly see the problem from Simpson's case. Until today most Americans believed that Simpson was guilty. However, the jury announced that Simpson was not guilty in the final verdict because the dream defendant attorneys brought forward some reasonable doubts which were partly caused by the prosecution side. So we can say, a notorious murder escaped justice under protection of the judicial system which most Americans are proud of. Maybe this system is too democratic. If there is no jury or the jury is not responsible for the final verdict, Simpson would definitely be announced guilty. The democratic system make it harder for the jury to reach consensus. This is the cost of democracy. But on the other hand, the democratic system make it harder for any force of authority to abuse power and lead to injustice. The founders of such system must have thought of this problem but they finally insisted on this system because they thought that preventing good men from injustice outweighed letting criminals at large.

Besides the problem of the democratic process of the jury, each juror, as key roles in the judicial system, is vulnerable to the influence of public opinion. Although each juror is supposed to make objective judgment according to what he saw and what he heard on the court, the infiltration of mass media, the argumentation of attorneys and the opinions of other jurors all may have an impact on one's judgment. The herding mentality inevitably takes effect in the jury. The movie Runaway Jury showed that how the jury is manipulative although the process may be a bit fictional but it is probable in reality.

In china, the reform of judicial system is on the agenda. And the civil juror is installed on court to participate in trial process. Most of them are selected from the middle class or the so-called elites. But the role of civil juror is more like assistants of the judge. They don't make the verdict independently. It is too early to say how these civil juror will influence the practice of justice in China and what's the next step to go. The same devise may appear in different way in different places. So let's just wait and see.

notes of legal system

From the very beginning of human civilization, people lived under the order of rules. Among them are social customs, moral codes and laws. Almost every modern state was ruled by law to some extent. Some countries have more complete and thorough judicial system than others. There are two most used legal system today, common law and civil law. Common law originated in England and thrived throughout all Britain common-wealth countries, some colonial countries of Britain and also the United States. Most of the rest countries adopted a kind of civil law system.

Common law is also called case law, because the main criteria of judgment is the cases which have been decided and can be used to determine similar cases happened later. Given the cases accumulated along the time is so enormous, it must be very difficult for the lawyers or judges to reference these cases. Therefore, there is no country completely ruled by common law. Many common rules have been generalized from these cases and written in separate codes as judging criteria. The most noticeable feature of common law is that the judges can largely participate in the process of legislation by making precedent cases. Maybe this feature partly accounts for the meaning of "common". The power comes from common people, not the elite legislation.

Civil law is probably the most used legal system in the world. One of the reasons is that continental law is enacted and enforced in a top-down manner. The legislation of a country passed laws and the judicial system ensured the obedience of law of the subjects. Obviously civil law system gives the judges less control or participation in the process of legislation, which make those countries which are not governed by an elected government tend to adopt civil law system in order to keep power in the control of the few.

The legal system plays a very crucial part in modern state governance. It even determines whether a country will prosper or perish. In short, the law system provides a rule of game in which each parties, government,individual or corporation, can make best of their capabilities to get as much benefits as possible.