There’s more than one way to do it

19 Aug
Gui Guan’s Laboratory
There’s more than one way to do it

发现Bluehost的服务器环境非常适合在学校和家里来测试PHP脚本,呵呵。同时为了更好的学习Internet Computing,弄了一个自己的实验室,有点Google’s Lab的感觉,但是差远老:P lol
当你点击进入之后,便是我完成的IC的第二次作业啦(默认用户名:user 密码:password)。以下是这次作业的一些要点:
(待续…)
15 Aug
1. Q: Does importing all classes in a package make my object file (.class or .jar) larger?
A: No, import only tells the compiler where to look for symbols.
2. Q: Is it less efficient to import all classes than only the classes I need?
A: No. The search for names is very efficient so there is no effective difference.
3. Q: Doesn’t it provide better documentation to import each class explicitly? Read the rest of this entry »
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
Recent Comments