titanlab.org

The problem is in reality; the solution is in my attitude.

Hacking the Code

Writing source code is not an easy task, especially in C.

The C source code below shows an example of taking user’s input into an array.

It will show “You Win” if i=1 or “You Lose” for i=0.

Source code.

Since i is initialized to zero, intuitively we know we will always get “You Lose” for this source code.

Well. Not really.

Read more…

Good Bye, Osaka

Had 3 months (October to Jan 2012) research attachment in Imase Lab of Faculty of Information Science and Technology, Osaka University.

It’s time to say good bye.

Thanks for all the guidance and care. I will miss you all >_< ……………

A memorial.

p/s: 残念desu, I have yet to visit any MEIDO CAFE.

ChromiumOS/Chromebook

I must say, I like the idea of  ChromiumOS (or Chromebook).

My girl spends most of her leisure time on movies and Internet – surfing the web, chatting in Facebook, watching movies, etc. And Chromebook just happens to suit her lifestyle.

The Chrombook does a little thing more than just a browser-machine. Besides surfing the net with Chrome, you can play music and video in Chromebook without connected to Internet. There is a “file manager” in Chrome that allows you to browse the files inside the solid-state harddisk or the external SD card.

So, why Chromebook? Well, it has 8-second boot-up time, hassle-free user experience, no annoying viruses or patches, thousands of web-apps and games. They are installation-free. You just need to sign-in and used.  Unfortunately, the sales of Chromebook is not doing well in US (2011). However, believe me or not, Chromebook will be a big thing after html5 is mature, perhaps after 2015.

#

The following are the snapshot of ChromiumOS that running in VirtualBox.

ChromiumOS - login screen

ChromiumOS - Webstore

Uniqueness of Mathematics

A very meaningful sentence from Introduction to Proofs and Real Analysis, written by Richard C. Penney:

“There is a fundamental difference between mathematics and other sciences. In most sciences, one does experiments to determine laws. A “law” will remain a law, only so long as it is not contradicted by experimental evidence. Newtonian physics was accepted as valid until it was contradicted by experiment, resulting in the discovery of the theory of relativity.

Mathematics, on the other hand, is based on absolute certainty. A mathematician may feel that some mathematical law is true on the basis of, say, a thousand experiments. He/she will not accept it as true, however, until it is absolutely certain that it can never fail. Achieving this kind of certainty requires constructing a logical argument showing the law’s validity–i.e. constructing a proof.”

Something in My Mind

Let A and B be two events of an experiment.

Given a statement:
A implies B but B does not imply A (or simply A implies B).

e.g.
A: Otaku.
B: Watch Anime.
That is: Otaku watches Animes. But those who watch Anime may not be an Otaku.

In Set Theory, we may say A is inside B but B is not inside A. Or A \subset B.

To put them into conditional probability:

\Pr(B|A)=\frac{\Pr(B \cap A)}{\Pr(A)}=\frac{\Pr(A)}{\Pr(A)}=1

\Pr(A|B)=\frac{\Pr(A \cap B)}{\Pr(B)}=\frac{\Pr(A)}{\Pr(B)}\leq 1

 

Thus, the statement: “A implies B but B does not imply A” may be written as:

\Pr(B|A)=1 and \Pr(A|B) \leq 1.

 

 

###

Gaia disagree with my misuse of Mathematics notation.

Don’t Teach!

I was reading some PhD guidelines and happened to come across a very meaningful remark. I felt exciting and decided to copy the inspiring paragraph here.

 

Don’t teach!

. . . more than you have to. For many, teaching is attached to a stipend or is otherwise economically unavoidable. In this case, do what you must! Moreover, there are some real intellectual and practical advantages from doing a couple of terms of TA work. Explaining the concepts to others is very useful in consolidating them in yourself. But beyond this, the returns become strongly negative. Your job is research – and anything that distracts you from this is a heavy cost. The first cost, which may seem remote at the time that you are deciding on the teaching, is that it could delay completion of the thesis by a year or more. An even larger cost is if it crowds out time to write a really great thesis. As a PhD student, your time is very valuable; treat it that way.

Ph.D. Thesis Research: Where do I Start? (PDF) 

Script: Gotosleep

Sometimes we need to suspend the machine when certain job is completed. Following is my gotosleep script to suspend my Ubuntu.

# ---- filename: gotosleep ----
#!/bin/bash
# This script will suspend this machine to sleep mode.
gnome-screensaver-command --lock
sleep 1
dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:0
# ------------------------------

#

Ubuntu 11.04 requires HAL to provide abstract view on hardware. Thus,

sudo apt-get install hal

PDF Annotator (w32) for Linux

The best PDF annotator for Ubuntu — PDF-Exchange Viewer.

It runs on Win32 machine. But  with wine, it is flies in Linux platform as well.

#

To integrate it seamlessly  with Ubuntu, I downloaded the Portable Zip version of PDF-Exchange viewer and extract it to a folder.

Then, I created a bash file as follow:

#------ filename: pdfviewer.run ----------
#!/bin/bash
filename=z:$( echo $1 | sed  "s/\//\\\/g")
w32bin="/home/chong/w32bin/PDFX_Vwr_Port/PDFXCview.exe"
wine "$w32bin" "$filename"
# ----------------------------------------

and put it to the same folder as PDF-Exchange viewer.

Right click the PDFXCview.exe –> Permission –> Check “Allow Executing file as program”.

Then, pick a pdf file and right click again  and choose “Open With Other Application”. Then, select “Use a custom command” and point it to the bash file that we create just now (pdfviewer.run).

Try to open the pdf file again and you will see it will open it with PDF Viewer.

#

Ubuntu Tips

Add User in An Encrypted Home Folder at Different Harddisk

sudo apt-get install ecryptfs-utils  #You may need this packet
mkdir  /home2
chmod 777 /home2
sudo adduser --encrypt-home username --home /home2/username

Display Skype (and others) Icon in the Unity Dashbar

gsettings set com.canonical.Unity.Panel systray-whitelist “['JavaEmbeddedFrame', 'Wine', 'Skype', 'Dropbox', 'Cryptkeeper']“

setsid unity

Quoted from http://www.webupd8.org/2011/04/things-to-tweak-fix-after-installing.html

LyX: Support IEEE format.

Install texlive-publishers. Then Lyx->Tools->Reconfigure.

My First App in Android

First app in Android.

Post Navigation

Follow

Get every new post delivered to your Inbox.