Thursday, August 12, 2010

Stopping Gnuplot from flashing a plot window and disappear

In Ubuntu/Debian, Gnuplot tends to use terminal 'X11' if no terminal has been defined before the 'plot' command. The reason for not specifying a terminal could be various (eg. being lazy and ignorant, subsequent use of 'replot' command using other terminal types in several other scripts)

In my case I had a loop of 5x5x5x5 times in my NS-2 script invoking Gnuplot 6 times with every run. The flashing window literally leaves the screen unusable as the Gnuplot X11 terminal window keeps popping up and out in a blink.

A temporary fix (which doesn't require rewriting my whole Gnuplot script set) is to use:
set terminal unknown
Doing this stops the flash with the first 'plot' command. The subsequent 'replot' commands can define their own terminals as needed.

Sunday, August 1, 2010

Suppressing page number in LaTeX

\thispagestyle{empty}
\pagestyle{empty}

Tuesday, July 27, 2010

Bash: simple wrapper script for java jar files

There could be thousands of other (probably better) ways of writing a wrapper bash script for executing jar files on command line (instead of having to do "java -jar tool.jar"). For whatever it is worth, here's what I came up in quick 2 minutes. One can optimize according to his/her needs inside the for loop:
    1 #!/bin/bash
2
3 path='/home/USERNAME/android-sdk-linux_86/tools'
4
5 args=''
6 for ((i=$#;i>0;i--))
7 do
8 args="${args} ${1}"
9 shift
10 done
11
12 java -jar $path/tool.jar "$args"
13
14

Friday, July 23, 2010

Windows 7: Windows Media Player 12 "Server Execution Failed" problem

I found the solution here: http://social.answers.microsoft.com/Forums/en-US/w7music/thread/ecc08c3b-d445-48c2-b07d-9df48500434f

The solution that worked for me:
  1. Unpin media player from taskbar.
  2. Pin it back.
lol, yes, that literally solved the problem for me.

Thursday, July 22, 2010

Android: Sliding/Rotating keyboard back 'n forth in android emulator

It may be obvious to many, but just as a record - to rotate the keyboard in android emulator, the keyboard short-cut is:
Ctrl + F11