There’s more than one way to do it

14 Aug
Last week, during the prac 2 of CS IB, we were asked to program in Java to build a simple client/server system in which the server takes “commands” from the client and executes them. Due to the time restriction, we were only asked to implement the server, and use telnet to act as client to transact with server. You can have a look here for details.
1 2 3 4 5 | ServerSocket server = new ServerSocket(6666); Socket s= server.accept(); // We now have a client on the end of the socket s BufferedReader in = new BufferedReader( new InputStreamReader( s.getInputStream())); PrintWriter out = new PrintWriter(s.getOutputStream()); |
It’s no more than the knowledge above. Maybe the simplest nextwork program in Java world.
The telnet on lab’s Mac just work well, but after I brought my program to home and run on my own computer, I met a really troublesome problem with the Microsoft’s telnet in Windows XP.
1. First, I started my server.
11 Aug
I found this in Google Earth today. It’s so beautiful! After I showed this to Pat, he replied immediately “i want to build my house there”. Indeed, that’s also my dream. Great pic, thx Roberto Garcia.
The Arenal Volcano is the only volcano in Costa Rica constantly active since it woke up after 400 years with the big 1968 eruption producing huge ash columns, explosions & glowing red lava almost every day. It is considered one of the ten most active volcanoes in the world. This country is about beaches, rainforest and the spectacular Arenal.
4 Aug
虽然每天都睡得很晚,但还是感觉时间不够用。在计算机科学浩瀚的海洋中,奋斗一个问题,花上我5-6个小时是很正常的事情。因此常常在想,到底是做事的效率太低,还是太高?第二学期开始已经两周了,Java已经把stream和网络讲完了,下周就要开始讲图形界面了;数学刚把微分方程讲完;网络编程刚进入PHP阶段;MIT的笔记刚抄到概率问题…但我还是稀里糊涂,像刚睡醒一样。原定计划,Perl应该在这周看完了,但是现在还只完成1/3不到,而且借的书已经被图书馆催着还回去了。看来还是效率太低了,导致时间的利用率一直保持在原始阶段。还记得上次跟Thin聊天,谈到他是如何学习计算机的,他说他的那些知识都是靠自学,上课的时候都是睡大觉(估计晚上熬夜了),然后毕业照片上终于睡醒了。其实,到目前为止,我的计算机知识99%都是靠自学的。那些最前沿的技术,你是不能够等着老师来教你的,老师教给你的只能是一些基础知识。所以Thin的做法何况不是我的做法呢?不过现在头疼的就是效率问题了。分析了前面一大段废话之后,拟定了以下计划,称之为Plan for sem 2 2007:
以上列表更新于2007-8-26
28 Jul
科学家们已经首次确凿的,在我们的太阳系外(异域),的一颗行星的大气层中发现了水蒸气的存在。
这幅艺术创作向我们展示了一个巨大的气体异域行星正飞过它的恒星表面。美国国家航空航天局的斯必泽太空望远镜对该系统进行的红外光谱分析,对此提供了突破口。
行星HD 189733b, 距狐狸星群(Vulpecula)约63光年。2005年,当它飞过它的父级恒星时被发现。
Image credit: NASA/ESA/C.Carreau
20 Jul
Very exciting, the 7th of Harry Potter was published this month. And I got a PDF one from my friend Thong. Thank him!
Due to the copyright reason, I can’t put the download link here. So if u want to get that one as well, please leave your email in the comments. Then, I will send u as soon as possible.
非常兴奋,哈利·波特7在这个月出版啦。本人刚刚从一个朋友那里拿到了PDF格式的英文原版。在这里要谢谢Thong啦:-)
由于版权原因,不能够在这里提供下载链接。如果你也想要的话,请在评论里留下你的邮箱地址。我会在第一时间发给你。
18 Jul
马上要开学了,为了抓紧时间在开学前把博客的所有内容弄好 ,又熬了一夜~ 彻底变成Fate Stay Night啦。 不过看着自己的成果,兴奋得好像刚睡醒一样。呵呵,好像找到点第一次接触电脑的感觉。那时,我是用Windows自带的画笔程序熬了一夜。当时那股兴奋劲就别提啦~
还有,这篇post是通过电子邮件发送,以作为测试服务器的cron job。
15 Jul
12 Jul
在加利福尼亚州着落的航天飞机是怎样搬到佛罗里达去准备下一次发射的呢?答案就是眼前的骑搭载哈。
美国国家航空航天局(NASA)拥有两架改造过的商用波音747客机,并利用它们将航天飞机固定于背部进行运送。作为NASA指定的航天飞机运输机(SCA),这两架波音747飞机被加固了整体骨架,水平尾翼和电子监视系统。上面的图片便是,1998年9月,航天飞机阿特兰提斯号正在被运送到佛罗里达州的肯尼迪航空航天中心的画面。
27 May
![]() |
![]() |
“Some questions are more easily asked than answered” Edward Sapir(?)
Possibly the most frequently asked and least frequently answered question is why does the definition of the standard deviation involve division by n-1, when n might seem the obvious choice. This is a question which perplexes introductory statistics students and calculator manufacturers alike. The explanations given in calculator manuals tend to range from obscure to fanciful, and both options are given on the keypad, usually labelled sn-1 and sn to add to the confusion. (The symbol s is reserved for the standard deviation of a random variable or a population/distribution, an entity which lecturers valiantly try but usually fail to keep distinct from its sample counterpart.) Australian students first meet the standard deviation in secondary school, where the definition given does indeed involve division by n. This definition is preferred to avoid the question about the n-1 being raised it would seem. Secondary school teachers have a hard enough life as it is. And it must be remembered that the difference between the two definitions is largely academic for all but the smallest of sample sizes (say, less than 10 observations). So, don’t get too agitated by the revamped definition. The truth can be told but the telling usually quells the desire to know. If the fire still burns in your belly, read on.
Read the rest of this entry »
Recent Comments