4月27日工作心情感想

工作记事

今天Project进展看来不错,暂时没大error出现,明天将继续开发剩余的部分,也是很有挑战性。

我公司的新电脑来了,Window 7 Professional 的,等有空再架设开发软件。会尽快处理。

私人记事

几个星期前提交了 PTPTN Pengecualian Bayaran Form 暂时还没下文,希望可以尽快处理,希望各位相关部门的朋友可以帮忙通告下。

时事记事

今天温家宝总理访问马来亚大学,欢迎他的到来。

现在,新加坡到处都可以看到行动党的党旗。要大选了。路上也有一丁点的讨论。新加坡人对大选还是比较冷感,我想。但是,反正,政府都做得很好。

招揽人才

Engineer Wanted. 谁对 Server, Software, 特别是 Telephony Communication 有兴趣的,可以到 www.jjsea.com drop your resume。欢迎加入我们的大家庭哦!!!

还有,对做 part time 有兴趣的,我有个朋友有个 plan,最好是在籍大学生,会 web development,可以联络我我介绍他的联络方式给你 (email 我 fyhao1@gmail.com)。而我呢,没想做 part time 的意思。虽然,和这个朋友很久之前合作过创业,但现在暂时没创业激情。

科技记事

WOW, ipad2 出了,1000++ 新币,但听说 ipad3 也会很快到。观望中。。。

关于大马开源软件峰会 (Malaysian Open Source Software Conference) 将在7月3日假槟城某个地方举行,还以为在KL,很远勒。不用紧,我爸妈的出生的地方就在那边,有亲戚。需要先研究研究。目前有2个朋友准备一起去了,谁还要去可以联络我 (email 我 fyhao1@gmail.com)?

回顾星期一(4月25日)立下的目标

目前第二个目标即将达成,希望明天可以完成。但是我想不可能会有完整的没有Bugs的,但最好还是能把目前明显的 bugs 和 feature 写好;第三个目标,今天暂时不研究 Nodejs。第四个目标,哈哈,太强了,一天不超过三句,难以突破。第一个目标,在积累勇气中,还是很紧张+害羞。

最后,wish you all the best,继续努力!

4月26日工作心情感想

工作上,今天主要在对Project进行攻击测试,希望可以爆出更多error。这些error都很奇怪,在继续努力中。

另外,在需要设计图片的时候,没安装 Photoshop 的软件,但使用了一个很好用的线上版绘图软件 Pixlr (fyhao 推荐使用)。WOW, yeah!!!

回到家,玩 Node.js 吧,但是发现 Windows 难以玩 Node.js,需要用 Linux server 来玩。要,就在本机装 Virtualbox 再装 Linux OS,或第二方法,在 Amazon EC2 虚拟一个 Linux Server 来玩,无奈 (用第二个方法还比较快和实际, for me only……)。这玩意儿真的很棒,看好他可以发展。

最近在 Iphone 下载了一个电子书,内容是说如何在 35 岁之前取得成功,他说的东西,蛮不错的,再阅读着,等读完后再发读后感吧。不错不错!有一句很重要:成功,就是爬起来比跌倒多一次而已!所以,今天呢,我跌倒了,还是要爬起来,继续走,不要怕!

我的一个同事,Sherie (我没有她的 facebook,找不到,谁能帮忙下?send 去 fyhao1@gmail.com 吧,可以的话,先谢谢了,祝你好运) 生了一个男宝宝,恭喜恭喜!这宝宝超可爱的,看到照片了。哈哈哈哈哈哈。。。想到就高兴。我也该向宝宝虚心学习啊,应该乐观面对面前的人事物,应该要多笑嘛!

 

各位朋友,大家继续努力吧!

振作,不要消极,相信自己一定能,向前看!加油吧!

我以清心精神宣誓,我相信,我可以。

也希望,妳,过得开心。

4月25日工作心情感想

最近工作的范围主要是在后期的修改,以及美化工作。今天也出现一个难以解决的技术问题,明天得继续研究。

这几天,突然对 Nodejs 产生了兴趣。很久之前已看过,它是一个 server side Javascript 实现,是一种 event driven 的程序语言。它是单线程 (single threaded),同时允许 parallel task,及 event driven 调用的程序语言。我刚完成了我的第一个 Nodejs Hello World,并且是运行在 Amazon EC2 云计算服务上的,有兴趣的读者可以点击这里阅读我编写的 Step By Step 教程

这几天,读NUS的妹妹最近在考试,所以,看有空的话,过去Kajau一下吧。

这个星期我也设定了几个目标,一定要达到:
1. 迈出第一步 (40分)
2. 解决Project所有未知问题 (30分)
3. 设计一个简单的 iphone web apps, 使用 ajax / comet 技术,nodejs,架设在 Amazon EC2 上,并发布原始码。(15分)
4. 讲15句话。(15 分)

Hello world to Node.js on Amazon EC2

This post is all about my first hello world to Node.js runs on Amazon EC2. I will note down the steps on how to get through Amazon EC2, start an instance, and how to download and build Node.js on Amazon EC2, and runs a Hello World Example!

This post includes nearly complete steps from how to setup Amazon EC2 and setup Node.js, it is recommended for all level of readers who don’t know Node.js and Amazon EC2, but at least you need to know how to use Linux and have basic programming skills.

First of all, you need a credit card to apply Amazon EC2, assume you are using Windows, you need a Putty to access Amazon EC2 Linux Server instance, and Puttygen, to generate your private key files.

Next, navigate to https://console.aws.amazon.com, login with your Amazon EC2 account, sign in to AWS Management Console, and navigate to EC2 Tab.

Steps:

1. To launch an Amazon EC2 instance.

Click on “Launch Instance” on the top left just under My Instances panel.

image

Then select “Community AMIs”, type “nodejs” on the keyword box, an AMI with ID ami-a8ca37c1 is shown, and click “Select”.

image

Then for “Instance type”, choose “Micro” for free tier (not need to pay for 1 year), or you can use Small instance (1 hour $0.087), I chose Small instance.

image

Click “Continue” at the bottom to navigate to next steps. For “Advanced Instance Options”, we not need to choose, just click “Continue” again. And then you will come to a screen with key – value pairs. Normally we not need to bother also, but for convenience you can type key (name) value (nodejs) to help you organize, browse your created instances, like a Tag.

Click “Continue” you will come to screen to create keypair. OK, choose “Create a new Key Pair” if there is no existing key pairs created before. As shown below, you can enter a easy-remembered name for your key pair, for example, I write “fyhaokey2”, and then click “Create & Download your Key Pair”, you should get a “.pem” file. Save it at some convenient location.

image

Now, open your Puttygen, click on Load, remember to choose (All File Types), and then select your “.pem” file. And then, click “Save private key”, you will get your “.ppk” file. “.ppk” file will be used with Putty later which used in authentication when you log in to Amazon EC2.

image

Back to your AWS browser, click on “Continue”, you will come to the screen to configure a firewall. You can select “default” OR, to ensure port 22 and port 80 is enabled, and then click “Continue” further to finish the process create the instance.

Once back to the main screen, you will see your instance’s status is in pending mode, wait a minute, it will become running mode.

Next step, we need to apply for “Elastic IPs”, click on “Elastic IPs” at the bottom left of the screen.

image

Let’s allocate a new address, and associated with your just created EC2 instance. Once done, back to main screen by click on “Instances” on the left menu bar. Click on your instance, see below, you will got something like this:

image

Let’s ping your elastic IP see whether it is on or not. By the time you reading this post, my elastic IP (50.19.125.189) had been released, so that this IP address is disabled, you may try your own.

2. To use Putty to access our EC2 instance.

image

At host name, write your elastic IP address, port remained 22.

Then, click on left side under “Category”, click “SSH” and expand and click “Auth”. Then, at right side, for “Private key file for authentication”, you browse your “.ppk” file, and then click “Open” to open the session.

image

And then, login as “ec2-user”, then “sudo bash” to execute command on behalf of “ec2-user”.

image

3. To install Nodejs setup.

Then, come to this link: https://gist.github.com/579814, see the first sh command file.

node-and-npm-in-30-seconds.sh (As below)

echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc

. ~/.bashrc

mkdir ~/local

mkdir ~/node-latest-install

cd ~/node-latest-install

curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1

./configure --prefix=~/local

make install # ok, fine, this step probably takes more than 30 seconds...

curl http://npmjs.org/install.sh | sh

Copy the contents, and execute it on your putty.

Wait for about 10 to 20 minutes, the nodejs will be installed completely.

4. To test our Hello World Nodejs !!!

OK, now we create a file called hello.js, with the content:

var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World Nodejs run on Amazon EC2 by fyhao\n');
}).listen(80);
console.log('Server running on Amazon EC2');

and then,

we execute this, by type:

node hello.js

Then, you should see the Putty console with the text “Server running on Amazon EC2”.

OK, last step, open your favorite browser (for me Google Chrome), navigate to your created Elastic IP address, you should see the plain text you have made in hello.js !!!

image

image

WOW, finally, we done the first hello world job.

Have a nice try!

Facebook Iphone Apps News Feed Not Responding

Recently my Facebook Iphone Apps news Feed is not responding, it always show “No Internet Connection” while I am in Internet Conection. I can use Facebook Messages, Place, Chat, Friends, but can’t use news feed feature.
I just found the workarounds by blog.dk.sg, the method is simple:

1) Go to Facebook app’s main page
2) Go to Account on the top left corner
3) Select Help Center
4) Login to your account (Remember to check “Keep me logged in”)

4月20日工作心情感想

In this post, I will write what technical stuff, work related I experienced, and my in-heart feeling throughout today. Today I will use English to touch about work related, but use Chinese to express my thoughts.

WOW, first hour in this morning I had implemented an interesting stuff, that is to build a simple cache manager in front of Dao (Dao Access Object) class. It is an in-memory model, the data will be kept in the server’s memory. Every cached data will have expired time, it will be automatically refreshed when the time is expired, moreover, when the insert / update / delete operation of specific Dao class is executed, the cache data associated with it will be refreshed automatically. The best thing is in current system framework can easily migrate to use this cache manager without having a big changes. The next step I should do is to create custom configuration setting for cache manager, or by using Annotation to realize auto configuration. OK, the benefits of Cache Manager is, the system is able to not query database everytime when need it but read from the cache directly, it should be able to increase application performance since database operation always eat up more resources. I just have make cache for certain parts of system that need cache, and any other places is not affected. I should continually to test it to know the real performance had brought by this changes.

At the time I feel boring in front of computer, I had researched Asynchronous Servlet 3.0 Proposal, it added some additional methods to existing Servlet 2.5 to handle asynchronous use cases, such as Ajax, or Comet (Reverse Ajax), or Streaming. I also thought if current system framework is able to integrate with this feature, and I need more research in order to make conclusion. In our company we use Tomcat, and I know Tomcat 6 had its own Comet Servlet implementation, but I am not sure if it is a standard or not, the better for us is following standard in order our system can be migrated to any type of web server. Now, Java EE 6 had supported Asynchronous Servlet 3.0 and had been released last year, and the best supporting web server is Glassfish, by using Glassfish you can easily deploy Java EE 6 and EJB 3.1 applications, furthermore, it supports what "modern browser" had supported, HTML5 WebSocket (bi-directional socket connection between server and browser client). Let’s try it if you interested.

Additional Links:

Introducing Java EE 6 Platform
Hello World(): EJB3 by NetBeans 6.8 and GlassFish v3 (Java EE 6)

For information, I had also briefly introduced cloud computing service I had used to my colleagues. But I am sorry I have no convey clear information when I am introducing. Now, here, to all readers, why cloud is your better choice?

I had used Google Appengine and Amazon Web Service before, even in my final year project during degree study, these two are the leading cloud computing service provider in the world. If you don’t know what is cloud computing, many information online had told you what this is. Many advantages brought from cloud, to enterprise and to individuals. In simple, the main advantage is to cut cost, pay on what you use; easy to scale up to more server instances in short time when your application needs it, and scale down when your application don’t need it; more secure (somebody may not agreed this, but theoritically to hack cloud is very hard in this stage).

In short, Google Appengine provides full stack infrastructure framework includes everything what you needs such as Google Datastore (a BigTable key-value data store implementation) that you can used to store data (like database) using JPA or JDO that you familiar or low-level API if you want to. It also provides Memcache, Image Service, Task Scheduling Service, Queue, Channel API (to make Comet Application). It provides free to use at first, you don’t need to pay single cent to run your first Hello World Google Appengine application, and only the time your application had brought in more bandwidth, meant that is the time you start to earn money, then you have to pay, just pay on what you use.

Amazon Web Service is another cloud computing service provider besides from Google Appengine. AWS provides many types of cloud service, such as Amazon EC2, Amazon Simple Storage Service, Amazon RDS, and many more. It provides lower level cloud infrastructure, therefore you need more knowledge to operate on.

By using Amazon EC2, it virtualizes a blank server for you, and you are able to install anything you want, just like a normal server you get from data centre. Second, it is pay on what you use, one hour just 0.085 US Dollar. You can run it in, say 3 hours, and closed it when you don’t want. Sometimes I want to test my web application, I just click click click in the user interface (or you can also use window command prompt) to access a Linux server instance and upload my applications and test, from my home, very convenient. I really not need to buy a Linux server keep in my home, waste my money, when I don’t want it, I can close it and return back, it will not charge me afterwards. EC2 has also provides an important feature called AMI (Amazon Machine Image). Meant, when you had headache to build up your web server, your database, and your applications, you can store the current setting into AMI, and then you close the EC2 server instance, AMI will be stored on Amazon S3. When you need it, you can just restart your application based on AMI you have made last time, you don’t need even to have another headache time to rebuild up your web server and cumbersome database. Some people had also created some setup and saves as public AMI and you can directly use their AMI to continue your own setup. You can also sell your created AMI in marketplace, or make it private, use by yourself. WOW… Additional information, EC2 provides full stack of real time monitoring feature, you can always easily know the performance or health of every part of your server.

EC2 is for computation, it cannot keep data last long. You should use Amazon S3, to store your static files. You are able to upload any static files, video, images, create folders on Amazon S3, and it provides a public URL for your friend to download. You can set different access permission to different folders, files, you had created. Same, pay based on what you use. Currently, I had used Amazon S3 for more than 700MB, and charged me 10 cents US Dollar each month. WOW, amazingly, so cheap. I used it to backup my company program code (I had backup in many places in case any accidents occurred) every days. I used it for private usage, and it should not be able for publicly viewed.

Who use Amazon Web Services? The fact is that part of the Facebook Photos using Amazon S3 to store their photos because Amazon S3 provides more stable and easy to use feature. Secondly, Second Life used Amazon EC2 to run their virtual 3D world instance. They can just focus on development of application logic but leaves the lower infrastructure to Amazon EC2.

Maybe our company should try cloud computing service (or maybe had already tried), but I am not sure if it is suitable, still need more research to make conclusion. Because I know the manager should have many problems regarding this: is it safe? is it really cut cost? is it suitable for us and customers and I can’t answer it clearly at this time.

Additional Links:

How to getting started with amazon EC2

完成了技术记录,接下来将是我的内心心情记录。我想,英文比较适合来写技术相关的感想,而中文则能比较好的表达我的内心心情。

今天偶然的被其他部门的同事询问了一个技术的解决方式,基本上,我对实现方法的可行性还没有可以接受的答案,将继续去研究。

今天前4个小时比较有上进心,因为实现了一个可以说有一点点成就感的东西。而后面4个小时则有点无聊,因为暂时找不到可以修改的东西,只能东看看西看看(检查code)。

之后,偶然的就和大伙们一起去吃饭。我还是踏不出那一步,打个招呼很难。天气很冷,一直发抖。我的发抖也不是因为冷的关系,而是和她同桌吃饭。当时我很紧张,当她降临的时候,我也只能,”东看看西看看”(抒发紧张感)。她对我应该没意思吧,我想,但我却对她有好感,只是不善于表达。这显得,我和其他人比起来很懦弱,是的,我的人际交流需要改进,在慢慢改进。尝试吧,fyhao,没什么好怕的(说得容易,做得难)。

加油吧!