Friday, August 31, 2012

The bus resistance of your #code

What is the bus resistance of your code? Read more here... http://www.nabinkm.com/2010/08/bus-resistance-of-code-or-program.html
% Long story short: comment your code!

Tuesday, May 1, 2012

Basic unix shell scripting tutorial revision

I wanted to revise shell scripting to my friend. Here are the list of commands that we used.

The kernel: agent
The shell: interface between the user and the kernel,
command line interpreter
bash
tcsh
etc
http://unixhelp.ed.ac.uk/shell/oview2.html

(show terminal)
You can scroll up and down with arrow key...

Tuesday, April 3, 2012

Assigning shortcut keys in Keynote: Mac

I needed to make a picture of neural network. The picture is too much work as it has a lot of connected blocks to be constructed.
So, in order to reduce the pain, I looked for shortcuts.

I wanted to assign shortcut keys to connect the blocks. So, I went to :

  • System preferences
  • Keyboard
  • Keyboard Shortcuts
  • Application Shortcuts
  • From there I had to browse the keynote and put the exact word. In this case "Connection Line", and assign the shortcut.
  • This method is true in general. So, if I wanted to assign any set of keyboard shortcut to any task, it should work. 
  • Profit!! :)



In order to connect the blocks, I would need to select two blocks, then press the shortcut key.
I wonder if there is a way to make connection between all selected blocks. (There seems to be none...)

Currently, If I have to connect two blocks, it is set to:
CMD+SHIFT+K

Tuesday, February 14, 2012

Screen Capture in Mac using Terminal

I figured, there should be some kind of terminal script out there which enables us to take the screen capture of the desktop. This will become real handy when we need to produce consistent screenshots for the Google Earth Images for my results. Furthermore, in order to crop it nicely, there is a code too!
http://usefulcodes.blogspot.com/2011/11/using-imagemagick-shell-command-to-crop.html
screencapture ~/Desktop/test.png


Friday, January 6, 2012

Do not Repeat the task

In one of my work, the funny thing happened. The matlab could not save some of the finished task. It might be memory issues or what not... I am not sure. So, I wanted to run the program in such a way that it would not repeat the finished task while still running the new work.
This script does it!
:)


% inDIR is the directory containing the save work
if exist([inDIR],'dir')>0

disp(['not doing ::: ', inDIR])

writeout = ['echo "not doing ::: ', inDIR, '">>notes.txt'];
system(writeout)

% do nothing
else

% do it command here!!
end