Sunday 28 August 2011

Good comment with the author unknown

Theory is when you know everything  but nothing works.  Practice is when everything works but no one knows why. In our lab, theory and practice are combined: nothing works and no one knows why.

Saturday 27 August 2011

Another Display Not Detected???

Recently I used my apple ipad as the third monitor to my current dual display. Dell laptop is my primal screen, and another dell monitor is connected by display port, and ipad is connect by Air Display apps. Everything works well.
Multiple monitors

However, it still has three screens even though I disconnect my ipad, which means one of the screen exists there without seeing it. The screen print is shown as following.
Screen Print 
Note that the most left screen is actually not visible at all. I check the display resolution from control panel. It says another display is not detected but available display output on my Nvidia graphic card. First of all, I thought it might been my Nvidia graphic card driver issue, I reinstall the latest driver. But it does not go anywhere. Some people suggest turning off the graphic card from your motherboard. I did not try that. But when I go to device manager, I find there are couple of display drivers other than Nvidia driver under display adapters. The multiple monitors problem is fixed once I disable all Air Display drivers.  
snapshot of the device manager


Friday 26 August 2011

Visual Studio 2008 debugger is broken?

Recently, my colleague said his visual studio 2008 debugger is broken. When he tries to run debugging, the following error always comes out.  


An error occurred that usually indicates a corrupt installation (code 0x80004002).
If the problem persists, repair your Visual Studio installation via 'Add or Remove Programs' in Control Panel.



Through looking around on internet, it seems like the debug dll file can not be linked when you run visual studio debugging. Some people said installing VS2008 and VS2010 at the same machine or install some other software which includes higher version VS complier might change VS 2008 debug environment. 


One way can fix this issue is to register the dll manually.
regsvr32 "C:\Program Files\Common Files\Microsoft Shared\VS7Debug\msdbg2.dll"
if you are running X64 system, you might need to run the following line
regsvr32 "C:\Program Files(x86)\Common Files\Microsoft Shared\VS7Debug\msdbg2.dll"

Thursday 25 August 2011

Artificial robot can assist human, in particular disable people

I just watched a TV show which is about the way to communicate with disable people whose hearing and speaking sense are lost. To be honest, it is really hard to understand the gesture language by the normal people who have never learned this before. It will be great if the artificial robot serves as a translator.


Nowadays, speaking recognition can help blind people to communicate with some artificial machine, for example, if the blind people want to search something on internet, they just need to speak something and then the contents will be translated into keywords. Object recognition can assist the people with weak vision ability(refer to the LookTel product from IPPLEX), even more it can help normal people to learn new stuff which they never seen before. The similar question is how to help the dumb and deaf people whose vision ability is still ok. As human gesture detection and tracking is a active research field, I wish one day the robot can understand gesture language correctly and then translate them into human understood language and vice verse, which means the robot can be as the bridge between normal people and the disable people.


The possible way I can think is that the robot needs a comprehensive database which stores mapping relationship between gesture symbol and nature language, in addition, it still can learn new mapping information to enrich its capability, which is pretty much like dictionary. And then, image recognition and speaking parse technology should be improved as well.


Hopefully, I would see this kind of robot during my life.

Tips on debugging C++ codes when return "-1.#IND00", "1.#INF", "inf", "nan"


This page will answer the following questions.
  • My program just printed out 1.#IND or 1.#INF (on Windows) or nan or inf (on Linux). What happened?
  • How can I tell if a number is really a number and not a NaN or an infinity?
  • How can I find out more details at runtime about kinds of NaNs and infinities?
  • Do you have any sample code to show how this works?
  • Where can I learn more?
These questions have to do with floating point exceptions. If you get some strange non-numeric output where you're expecting a number, you've either exceeded the finite limits of floating point arithmetic or you've asked for some result that is undefined. To keep things simple, I'll stick to working with the double floating point type. Similar remarks hold for float types.
Debugging 1.#IND, 1.#INF, nan, and inf
If your operation would generate a larger positive number than could be stored in a double, the operation will return 1.#INF on Windows or inf on Linux. Similarly your code will return 11.#INF or -inf if the result would be a negative number too large to store in a double. Dividing a positive number by zero produces a positive infinity and dividing a negative number by zero produces a negative infinity. Example code at the end of this page will demonstrate some operations that produce infinities.
Some operations don't make mathematical sense, such as taking the square root of a negative number. (Yes, this operation makes sense in the context of complex numbers, but a double represents a real number and so there is no double to represent the result.) The same is true for logarithms of negative numbers. Both sqrt(-1.0) and log(-1.0) would return a NaN, the generic term for a "number" that is "not a number". Windows displays a NaN as -1.#IND ("IND" for "indeterminate") while Linux displays nan. Other operations that would return a NaN include 0/0, 0*∞, and ∞/∞. See the sample code below for examples.
In short, if you get 1.#INF or inf, look for overflow or division by zero. If you get 1.#IND or nan, look for illegal operations. Maybe you simply have a bug. If it's more subtle and you have something that is difficult to compute, see Avoiding Overflow, Underflow, and Loss of Precision. That article gives tricks for computing results that have intermediate steps overflow if computed directly.

Wednesday 24 August 2011

How to change current driver in windows command window?

In windows OS, you might need to use command window to run some DOS commands to speed up your efficiency.


The basic command is to change directory under which you are working. If you have several drivers in your machine, say, D:, E:, etc, other than System driver (C:), it might not work when you only run "cd E:\paths"


You should run "cd /D E:\paths" which can change the current driver in addition to changing the folder.

Can the legend of apple still go?

Today the biggest bomb news in technical area is no more than the god of apple, Steve Jobs, has stepped down from the CEO position. This guy, to be honest,  changed a lot of things in peoples' daily life. I can recall almost everyone just gets used to hold a iphone or ipad for information in the bus, in the public place, everywhere, everyday. Amazing ...

I just forwarded his resignation letter here.


To the Apple Board of Directors and the Apple Community: I have always said if there ever came a day when I could no longer meet my duties and expectations as Apple's CEO, I would be the first to let you know. Unfortunately, that day has come.
I hereby resign as CEO of Apple. I would like to serve, if the Board sees fit, as Chairman of the Board, director and Apple employee.
As far as my successor goes, I strongly recommend that we execute our succession plan and name Tim Cook as CEO of Apple.
I believe Apple's brightest and most innovative days are ahead of it. And I look forward to watching and contributing to its success in a new role.
I have made some of the best friends of my life at Apple, and I thank you all for the many years of being able to work alongside you.
Steve

How to use Bazaar under Dropbox?

If you are code monkey or programmer, you might would like working anywhere when you have some awesome ideas. It is useful to make sure the source codes on all devices that you are working on keep up to date. Of course, you can use some paid cloud servers or Dropbox (free for 2G), but it is not convenient to track the log of your modification. What if your latest codes do not work, but it works yesterday? You really like reverting to the working version.

OK. The simple way is to bind Bazaar and Dropbox. Bazaar is one of the free subversion control softwares, like svn, git. What you need to do is just following the steps below.

  1.  Create a folder in dropbox as your work branch
  2.  Use bazaar GUI or command line to initialize this folder which just created in dropbox
  3.  Create a local folder as your local working folder
  4.  In bazaar GUI, checkout the work branch in dropbox to your local working folder; or use command line


    mkdir local-working-folder
    cd local-working-folder
    bzr checkout #Dropbox/work-branch

Tuesday 23 August 2011

Which humanoid robot runs fastest in the world so far?

Here I just forwarded some interesting article relating to running humanoid robots, such as Toyota's humanoid robot, Honda's ASIMO. But today, researchers from the University of Michigan announced they make a fastest two-legged robot, MABEL, in the world.

It would appear that we have a new champion in the “what robot can run fastest race”. The two-legged robot MABEL under development for several years at the University of Michigan was recently revealed to reach a top running speed of 6.8 miles per hour or roughly 11 kilometers per hour. This means that MABEL is significantly faster than the previous record holder which was Toyota’s humanoid robot with a top speed of 7 kilometers per hour; Honda’s ASIMO is now in 3rd place with a top speed of 6 kilometers per hour.
Another technical achievement behind MABEL and above Toyota’s robot is that MABEL’s gate while walking and running much more closely resembles that of a human. In addition, MABEL jumps 3-4 inches above ground (both legs) when running whereas Toyota’s robot hardly does (it does enough to consider it’s fast walking gate running). One disadvantage is that MABEL is not a complete robot that includes an upper body with arms and a head compared to Toyota’s, Honda’s and other humanoid robots coming out of Korea and Japan.
The below video shows MABEL running including some explanation of the related technical achievement. Additional information on the project can be found at the project’s website here.

Honda ASIMO

Toyota humanoid robot


MABEL from UM



Monday 22 August 2011

[MSVS2008 Windows7 64bit] Property Pages is gone in Visual Studio 2008?

Recently I encountered a strange problem when I tried to debug codes with Microsoft Visual Studio 2008, namely, I can not open the property configuration window, which means I can not set the debugging command arguments at all.

Usually, you just need to right click the program in Solution Explorer and then click the properties item at the bottom of the just popup menu, alternatively, you can go to View at the top of menu bar and then select the property pages, then you can set command arguments in the shown property window.

I tried restore and reinstall Visual Studio 2008 from CD, however, the problem is still there. Even then, I tried to remove the visual studio elements completely from the software manager and register list, but it does not help out. Through google, it seems like something changed in the VS setting file which is needed by VS when it launches every time.

The following is the solution which works for me.

  1. Make sure the setting file is in your computer, by default, it should be under "C:\Users\Username\My Documents\Visual Studio 2008\Settings"
  2.  Go to "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE", if you are on 64bit system, the path should be like "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE", and then run "devenv.com" to restore to the initial setting environment.
  3.  Restart the visual studio and it should be work.

I am coming ~

This is my first time to come here to share my own daily experiences