Just came across this story where Tina Seelig at Stanford gave her student to make as much money as possible with $5 and 2 hours. It was a great story. Think out of the box and you might be surprised
How to Use Windows 8 Family Safe For Computer Parental Control
It is impossible to keep kids away from computer and network these days. Actually, we should not attempt to do it anyways. They are born in this all digital world, internet is as natural as air and water for them.
Do You Need a VISA to Travel?
I came across this interesting website called: http://www.doyouneedvisa.com recently. Basically what it does is that you tell it where are you from and where you want to go, the website will tell you if you need a VISA for
How To Add Syntax Highlight for Code in WordPress
When I started my code snippet into my blog, I used <pre></pre> to make it as pre-formated text. However, it is ugly without syntax highlight. There are many WordPress plugins that can add the syntax highlight to various languages (just
How To Get The Script Path Name in CSH/TCSH
Here a C shell snippet get_script_path.csh to do the trick.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
#!/bin/tcsh -f set called=($_) if ( "$called" != "" ) then ### called by source echo "branch 1" set script_fn=`readlink -f $called[2]` else ### called by direct excution of the script echo "branch 2" set script_fn=`readlink -f $0` endif echo "A:$0" echo "B:$called" set script_dir=`dirname $script_fn` echo "script file name=$script_fn" echo "script dir=$script_dir" |
We have two ways to run the script, to illustrate why we need to handle differently, we print out the internal strings. 1. Source the script file
1 2 3 4 5 6 |
tps-VirtualBox:~/test> source ./get_script_dir.csh branch 1 A:tcsh B:source ./get_script_dir.csh script file name=/home/tps/test/get_script_dir.csh script dir=/home/tps/test |
2.