Monday, February 10, 2014

Using visual bloc to paste chunks of data

I was having trouble pasting text selected using vim's visual block into a new file.
The copy command is 'y'
The paste command is 'p'
the delete command is 'd' or 'x'
However, the delete command seems to leave behind empty lines. use ':g/^$/d' to remove empty lines from a file
 

Thursday, February 6, 2014

Setting Environment variables

<variable> = value
export <variable>

Creating an AMI using starcluster

These instructions are pretty straightforward to follow. I found it very difficult to create one directly from amazon's documentation.

http://star.mit.edu/cluster/docs/0.93.3/manual/create_new_ami.html

Tuesday, January 28, 2014

Things to remember when using parfor

This website from matlab:
http://www.mathworks.com/help/distcomp/programming-considerations.html

-- cannot use clear inside the loop


specifically:

=========
Similarly, you cannot clear variables from a worker's workspace by executing clear inside a parfor statement:
parfor ii= 1:4
    <statements...>
    clear('X')  % cannot clear: transparency violation
    <statements...>
end
As a workaround, you can free up most of the memory used by a variable by setting its value to empty, presumably when it is no longer needed in your parfor statement:
parfor ii= 1:4
    <statements...>
    X = [];
    <statements...>
end
 =============

Saturday, November 30, 2013

Sorting bar graphs in excel

If you have data like this
You can sort it in excel using these steps:
1) go to Data tab
2) click the sort button and select the colum by which you want to sort.(This is silly but if you don't know it, its a pain)

Tuesday, November 19, 2013

Searching and Replacing strings in vi

:%s/pattern/replace/

if you are searching for a special character( '.', '$' etc), precede it with '\'

Wednesday, October 9, 2013

using nohup

nohup matlab -nodisplay -nosplash -r Script1 > out.txt &

Edit
f you want to run a function  with variables, this is how to do it:

nohup matlab -nodisplay -nosplash -r "funcitonabcc(var1,var2,..,varn); exit; " > out.txt &

the text within the double quotes needs to be written just as you would call commands in matlab.