Thursday, December 31, 2009

Widgets over SDL

To support widgets over SDL, I found the SDL-Widgets library seems nice, at least based on the sample applications it provided.

Later on, I found its dependency on SDL_gfx and SDL_ttf. I will start to work on SDL_gfx tomorrow.

Now it's time to chess with Mr. Chou.

Wednesday, December 30, 2009

CodeBlocks Can Not Find SDL Library

I am using CodeBlocks 8.02 on Winodws XP. When I try to create a new project using SDL template, I met the problem that it can not recognize the SDL's installation path (unpacked only) properly. It seems there is a mismatch between SDL versions and Codeblocks versions. Luckily someone already solved this:


On the "New Project" page, right-click your mouse on SDL template, choose "Edit this script", then you can find the following code for patch.

Index: src/plugins/scriptedwizard/resources/sdl/wizard.script
===================================================================
--- src/plugins/scriptedwizard/resources/sdl/wizard.script (revision 5680)
+++ src/plugins/scriptedwizard/resources/sdl/wizard.script (working copy)
@@ -47,8 +47,15 @@
local dir_nomacro_inc = GetCompilerIncludeDir(dir, SDLPathDefault, SDLPathDefaultInc);
if (dir_nomacro_inc.IsEmpty())
return false;
- if (!VerifyFile(dir_nomacro_inc, _T("SDL.h"), _T("SDL's include")))
- return false;
+
+ if (!IO.FileExists(dir_nomacro_inc + wxFILE_SEP_PATH + _T("SDL.h")))
+ {
+ if (VerifyFile(dir_nomacro_inc, _T("SDL/SDL.h"), _T("SDL's include")))
+ SDLPathDefaultInc = SDLPathDefaultInc + _T("/SDL");
+ else
+ return false;
+ }
+

// verify library dependencies
local dir_nomacro_lib = GetCompilerLibDir(dir, SDLPathDefault, SDLPathDefaultLib);

Saturday, December 12, 2009

WiFi Radio Analyzer

Cisco Spectrum Expert can be used to analysis your radio spectrum status for debugging purpose. However, it does not capture packet trace. A H/W card is required to work with it. You can download this software from Cisco if you are authorized. Unfortunately I am not. :)
Image Quality Tuning Kit


Honestly, this is the first time I've had a chance to know anything about camera R&D. The website above sells kits for tuning.

Enjoy!

Thursday, December 10, 2009

Congratulations! Ubuntu is Popular Enough Now! Literally!

It is popular enough that someone decided to write some malware for it.

http://www.omgubuntu.co.uk/2009/12/malware-found-in-screensaver-for-ubuntu.html

Good thing is we know we should avoid install .deb files now.

Bad thing is you can not install any stuff if you can't use .deb.

The happiest one would be cloud computing service providers that
eventually we all suffer from malware, virus, and so on. Besides
cloud services.

But the really happiest one would be hackers who can hack into
cloud computing farm because they can have one stop shopping
experience. No more fighting against different versions of OS
and patches....

Wednesday, December 09, 2009

Enabling Ubuntu Remote X11 Desktop Access

I modified the following two lines in /etc/gdm/gdm.conf:

DisallowTCP=false

Enable=true (in [xdmcp] section.)

Restart the gdm by sudo /etc/init.d/gdm restart

Now I can use xming to connect to my desktop without a problem.

Is there a way I can disconnect and connect again without terminating the session?

Monday, November 23, 2009

Identifying Where The Illegal Instruction Is

I am debugging an application which generates illegal instruction error for unknown reason and under unknown conditions. Some one pointed me to a web page for root causing it. Here is how:

1. Enable CONFIG_DEBUG_USER feature in the kernel.
2. Set the kernel variable user_debug to 1 (only bit 0 matters in debugging this problem).
3. Do the test.

One thing not so important here, lxr seems to have trouble location user_debug in the kernel source tree it has cross-referenced. But it ought to.

Saturday, November 07, 2009

How to Force Subclipse to Use English

Subclipse detects the system locale and uses the language matching the system locale that I am not familiar with when I am working. I found this can be solved with this article, the solution I took was to add two lines at the begining of eclipse.ini:

-nl
en_us

which forces the locale to be English, United States. After restart, it works after refreshing the menus of subclipse.

Wednesday, September 02, 2009

TFTP Servers

They are something many RD uses daily. Just to list a few of them for tracking purpose only:

On Linux, this one is good to use and with security in mind:

TFTPgui - I found it at http://code.google.com/p/tftpgui/

On Windows, these two are good to use:

TFTPD32 - It is a legacy among many engineers I know.
Pumpkin - I knew about this one lately, it seems to be a good one, too.

None of them is perfectly I want. An ideal one to me should include:

1. multiple directories search capability.
2. warns properly for download / upload activities.
3. forwarding requests to another server.

I'd like to explain 3 a little bit more. It is typical that we have a dedicated build server. We typically connect the test net to our own computer's 2nd NIC to disconnect it from Intranet. When the target device needs to download, it can only talk to our computer, and the built code is one the primary NIC. So it would be optimal to forward the TFTP requests from our target device. Does it make sense?

Saturday, August 29, 2009

Open E-Book Format

I happend to found this today: http://en.wikipedia.org/wiki/Epub

It is pretty interesting to me that such a format exists. I do not have the money to buy an E-book reader such as Kindle. Before today, I thought the de facto format for E-books must be pdf.

I am not sure what is going to dominate the universe in the end. But a unified format definitely will help reform this publishing industry. Some would call it a thing that extincts publishing business. But hey, I don't think so. This E-book technology will face lift this industry. Not to extinct it but to make it circulate faster.

I can't stop to think about the current problem of newspapers in countries with widespread Internet. They got their business shrinking because they did not do good enough to become a portal site that attracts enough eyeballs. Without enough scale, their ad business is going out to companies that knows how to do this on the Internet.

With the evolution/revolution of Internet technology, many has to make a decision now. They can choose to create their own business model in Internet age. Or to close the door and turn themselves into some expensive watch makers that becomes something for rich people's exhibit.

Staying still is not the way out.

Thursday, August 13, 2009

A Special Crash Report

I've never seen something like this, but this one is really cute. (At least to me...)


'import site' failed; use -v for traceback
Sorry, command-not-found has crashed! Please file a bug report at:
https://bugs.launchpad.net/ubuntu/+source/command-not-found
Please include the following information with the report:
No module named CommandNotFound
Traceback (most recent call last):
File "/usr/lib/command-not-found", line 10, in
from CommandNotFound import CommandNotFound
ImportError: No module named CommandNotFound
Python version: 2.5.2 final 0

Monday, June 15, 2009

Windows XP Event ID 4191

I met this error today that states my NDISWANIP can not be accessed. The situation was weird that my network interface cards were actually brought up. But when I use IPCONFIG to view them, nothing was shown. I checked the event log and found event 4191.

I tried the solution provided by MS knowledge base but the problem persists. Then I cross compared the registry of a working computer with my non-functional one. I found a registry directory is missing on my non-functional computer, which I guess it went broken due to the enable/disable/setting of Virtual Box.

I was just about to give up but I found a way to solve it: uninstall the network devices and refresh the hardware manager. It starts to reinstall the driver and it is back to normal. I created the missing registry before I uninstall the drivers. I am not sure whether this will cause a difference, but I am happy for now and do not have plan to try it.

Product:Windows Operating System
Event ID:4191
Source:Tcpip
Version:5.0
Component:System Event Log
Symbolic Name:EVENT_TCPIP_ADAPTER_REG_FAILURE
Message:IP could not open the registry key for adapter %2. Interfaces on this adapter will not be initialized.

Friday, June 12, 2009

Good Luck, Google


I think Google is transferring from a do-no-evil (I believed it meant good-the-right-thing) company to a do-no-evil (I believe it is now: it is okay if it is not evil). It is the sign of going to its downturn.

At the very beginning, the founders wanted to create a real good search engine, that was what differs Google from its competitors. They could tell whether a feature is what user wants or not. But now it seems closer to what Google wants.

I am not sure how many people have seen the image above. But to me, it is the sign of collapse.

A big ad for Chrome on search engine homepage? A no brainer can tell Google is never google again. It is doing things against its principle. Even some internal Googler may claim this is also a test that can show the response of users, whether people feel annoyed, such as me, Google is still acrossing the line.

It is a pity that we shall start finding a good Internet service provider.

Thursday, May 28, 2009

How Autopsy Helps?

There is no new technology about pathology in this post, instead, it is about its usage.

United States Army is performing autopsies (and virtual autopsy, called CT)  on dead bodies from war to find out the cause of death. In the end, the results can help reduce the rate of death in future combats.

For example, a collapsed lung can kill one easily. The typical immediate response to it on the field is to stick a needle into the chest and relief the pressure. However, autopsies and following research showed the 5 centimeters needle with medics is not long enough for 50% of the army. So you are 50% likely to be killed if one of your lungs collapses. Replacing a longer needle can effectively save 99% lung collapses (if other injuries are not lethal). So did US Army.

Maybe I should autopsy each day of my life and help improve tomorrow, too.

The Trend of Emulation/Virtualization

The trend of virtualization is so non-stoppable that we are now surrounded by news with it and we are becoming numb with them. But this one is itchy (to me):  Ubuntu has a working prototype of running Android applications on Ubuntu platform.

Android is generally considered an ecosystem itself (it has its own JVM, API, and its own app store.) However, as it is a piece of software, we always can port its Dalvik JVM to other platforms. With the binder IPC been ported properly and its *compacted* system libraries been handled.

The porting of Android ecosystem to Ubuntu is an indicator of the virtual applications that you can buy easily or download freely.

I once wondered the difference to native Java applications, why would we need Android development environment? The answer lies in Java itself. Sun claimed it would develop a CPU for Java years ago and finally dropped the plan. I am not sure why it ended ungracefully: is it only a marketing thing or there is technical difficulties? But one thing for sure, Java is never fast enough for ubiquitous devices, even JavaME. Although it is possible to run Java applications on your cell phone, the loading time of them is always pain-in-the-ass.

Android successfully solved the issues by optimized many parts of the Java environment to its own design. Yet the nature of Java is kept: portable application binary.

I am wondering whether one day we will have our desktop environment replaced by Android? Can anyone tell me a reason that Android will not be able to make it?
Cisco settles with FSF after filching free software


I think. It is always our best option to be honest and face any problem we have on hand. Not escaping it because it does not work. Even it works, you need to worry about the backfire that may come to you at any moment.

Sunday, May 24, 2009

SVN -> GIT

Recently, I start to touch Linux kernel, as an integrator and developer. I am in need to learn some basics of its source management to keep myself up with the rapid development of Linux
kernel and development repositories spreaded everywhere on the Internet.

As an SVN user, I am comfortable with canonical type of SCM (source code management) and have no idea about the rest of the world of SCM.

Git is the SCM used by Linux kernel and getting more projects using it. I am totally clueless with it and need some help despite I've compiled git on some Linux box and cloned some repository before. I am doing some simple study and found the following web page written by git guys really useful to an SVN guy like me.


Enjoy if you are having same problems I have.

Sunday, May 03, 2009

Golden Week

Golden Week is a national holiday in Japan that lasts for one week. It sounds great, most of us will envy it a lot, but I never knew it actually has great impact to us.

I took a HSR train today to southern part of Taiwan today. When I was on the shuttle bus to the metro, I found there are three Japanese girls sitting nearby. After ten minutes, I realized that some one in Japan notified me they are having Golden Week since yesterday and he will not be able to reply emails.

Also, on the 2008-2009 calendar I brought back from MIT, Golden Week is listed on it, too!

I think Japan has successfully marketted its national holiday. And the best thing is, because it takes only 4 hours flight to reach Taiwan (roughly two movies), many Japanese visit here for sightseeing.

That helps our economy.

Maybe, I should learn Japanese, too.
Code Refactoring

We used to call it "code clean up", which is something rarely done in our company due to always "tight schedule" and "higher priority" tasks.

Despite the fact that after refactoring the maintainability is much improved, our managers typically do not want to give us a slice of time doing it. The reason behind probably would never be known.

I have a heuristic theory that they are not aware of the importance of software engineering. "Ya, I know that, but ..." is a typical scene you will see when a software engineering advocate proposes something about software engineering to higher ranked staff.

Another good reason is: most of our managers have hardware background instead of software. They wrote some 8051, hello world stuff in their colleages or universities and that is "the software" in their mind. The only difference is we are dealing with more lines of code.

I will stop pouring my complaint for now. This is the short definition of code refactoring:

Code refactoring is the process of changing a computer program's internal structure without modifying its external functional behavior or existing functionality, in order to improve internal non-functional properties of the software, for example to improve code readability, to simplify code structure, to change code to adhere to a given programming paradigm, to improve maintainability, or to improve extensibility.

Wednesday, March 04, 2009

A Nice Poem

I got this from Mrbig a few minutes ago. It makes perfect sense to me. Hope it does to you, too.

五言詠麻雀 曹興誠          

東南西北風 玩過人人瘋 方城無歲月 喧笑不知冬
峰迴出意表 拙能勝智巧 名利追逐苦 何如吃碰胡 
貪求把把贏 必然頻放銃 心快手要慢 盯張不可鬆
聽熟不聽生 聽邊不聽中 牌背要能守 牌順要敢衝 
贏時莫輕狂 輸時忌燥動 出牌要果敢 慢磨惹人煩
不可禁如廁 牌規應寬容 輸若贏友誼 似敗實成功 
有云玩喪志 我問志何用 人生如牌局 無欲更從容
世道多炎涼 幸有牌熱烘 局散何妨去 笑看月當空

Saturday, February 28, 2009

Femto Cell

Every now and then, new buzz occurs in technology world. Some of them are really excited, but some are simply buzz words. To see which type it is? Just Google it and find it on some amateur 3C forums. If only big companies and standard organizations are related. And it shows up only in news press, you can certainly tell the type.

Recently, Femto Cell is the hot spot of discussion in communication business. Many service providers plans to deplay it to its users' home. I am not optimistic about this technology due to several reasons:

1. Users won't pay for Internet surfing at home. Including extra equipment and 3G services. (Why shall I pay when you are using my Internet connection?)

2. The line between Internet service provider and communication provider is usually defined by govs and we all know govs are slow in responding things they do not want to accept.

3. 3G data rate is slow comparing to WiFi. It will be the bottleneck of speed. So why shall I use it?

4. If I really need to use such services with high data rate at home, why don't I just use my computer?

I did not mention some technical obstacles others have discussed on other websites and blogs.

To make femto cell success, I think those big bosses must rethink how they want Femto to happen. Such as:

1. Defining it as a replacement technology for WiFi and make laptops and netbooks supporting it.

2. Make it completely free or almost free when users are making calls at home using the Femto
 cell.

3. Add power estimation feature to Femto cell and refund the power consumed to users' phone bills.

I sincerely wish this is going to happen but do not expect it to happen. :)