Friday, May 27, 2011

How to project the screen of iPad or iPhone to the projector

I have investigated this issue for several months, and finally come to a good solution.

1. The first simple solution without paying any money is to do it on the programming level: you can capture the screen image of the iPhone inside your app, so this is the clue that you can use to first take the screen shot and send it via TCP network connection to a remote computer which can show the screen image. You can use the following code to capture the screen and convert the image to jpeg format. Of course you should use asynchronize TCP connection to send the image data, otherwise the user interface of your app will stop working for some time while sending the image. On the remote computer, you also need to build an application which first listens to a port of the computer, and then receives an image and displays it.
// Capture Screenshot
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *screenshotImage = UIGraphicsGetImageFromCurrentImageContext();
NSData *data=UIImageJPEGRepresentation(screenshotImage,self.jpegCompressionRate);
NSUInteger len=[data length];

2. another solution is to use the Apple VGA cable:
, together with the TVOutManager as described on the following web page:
The steps of using this TVOutManager are quite clear and simple.

I first used the TVOutManager in my app on iPhone, and it works really very well.
I then used it in my app on iPad, and unfortunately it slowed down my app.
I guess the reason is that the TVOutManager needs lots of computing power to show the screen.
After investigating for a long time, I finally found the way: in the source file TVOutManager.m, you can find two lines:
// CGImageRef UIGetScreenImage();
, and you just need to let the two lines work. As a result, your app will work much faster.

3. in fact the Apple VGA cable can directly project the real-time screen output of iPad 2 to the projector, but can only show the video and pictures for the iPhone 4 or iPad 1. If you have iPad 2, then you just need to buy the cable to project anything to the projector.

Wednesday, May 18, 2011



哈工大的发展令人瞩目,秉持“规格严格,功夫到家”的校训,哈工大人在世界各地踏实努力地工作。在新加坡,留学、工作的校友数以千计,成立校友会迫在眉 睫。校友会的正式成立有利于我们与母校保持联系,及时了解哈工大的发展动态,并为母校献计献策;通过校友会,我们也可加强相互之间的联系,有利于事业发 展,又可为社会做出更大贡献。校友会将举办各种活动,丰富我们的社交生活,并提供各种支援和帮助。当然,我们也会与世界各地的哈工大校友会及其它高校的校 友会保持联系。

1. 校友信息登记
2. 如果您有任何建议或愿义务参与校友会的筹备工作,请发邮件至以下邮箱



Saturday, May 14, 2011

新加坡 哈尔滨工业大学(哈工大)校友召集 ( HIT alumni association in singapore )

Hi 大家好,

我们正在联合在新加坡的哈工大校友,准备组建哈工大新加坡校友会,HITAAS(HIT Alumni Association in Singapore),我们已经建立了一个Google group,,希望大家可以加入,有什么关于建立校友会的信息也会在这个google group里面发布。加入这个group后,所有的信息就会直接发到你的email帐户。谢谢大家支持!





Wednesday, May 4, 2011

Latex: how to control the column width of a table

Latex will automatically adjust the width of a cell in a table, but it will not consider the width of the page, so sometimes parts of the table are out of the page. If you want to control the column width of a table, you may want to use p option instead of l, c or r for left, center or right alignment.

For example:

a & bb & c\\

Good luck!