Tuesday 17 December 2013

Un-tab in VIM


Control D to untab, Control T to tab


Other keywords: shift tab

source: http://stackoverflow.com/questions/2874415/what-is-the-un-tab-sequence-in-gvim

Thursday 28 November 2013

Accessing webcam via MATLAB

imaqhwinfo
"Image Acquisition Hardware Info" tells you what cameras you have available.

vid = videoinput('macvideo', 1, 'YCbCr422_1280x720')
Specify the video channel and the output format.

preview(vid)
Display the video stream.

Sunday 24 November 2013

Version Control On Google Drive

To upload a new version of an existing file:

Right click on the file name
Select Manage Revisions … from the menu
Click on Upload New Revision

source: http://cumulusglobal.com/cms/tuesday-take-away-version-control-with-google-drive

Sunday 10 November 2013

Restrictions on Double Indexing in MATLAB

You can follow {} referencing by () referencing, {}(), but you cannot use ()() or (){} or ().{} or ().(), and you cannot use function(){} or function()() or function().field

source: http://www.mathworks.com/matlabcentral/answers/25890

Friday 8 November 2013

Adding code blocks to blogger


To put a “code” block in any of your blogger blog posts, you have to first modify your template a bit.
1. Login to your blogger account
2. Go to Layout > Edit HTML
3. Find ]]></b:skin>
and just ABOVE it, add this line of code:
code {background:#EEEEEE; font-family: Trebuchet MS; display:block; border:1px solid #999999; padding:10px;}


source: http://atoz2u.blogspot.com/2011/03/how-to-add-code-and-blockquote-blocks.html

Screen Capture in OSX

Launch Terminal and use the following syntax:
defaults write com.apple.screencapture location /path/
For example, if I want to have the screenshots appear in my Pictures folder, I would use:
defaults write com.apple.screencapture location ~/Pictures/
To have the changes take effect, you then must type and restart.
killall SystemUIServer


source: http://osxdaily.com/2011/01/26/change-the-screenshot-save-file-location-in-mac-os-x/

Wednesday 6 November 2013

Assigning Default Applications to a File Type on OSX

For Mac OSX 10.6:

1. Open a New Finder Window and browse to a file of the type you'd like to change the extension. 

2. Click on the file. Go to File in the top left and select "Get Info".

3. Go to "Open With" and expand that section.

4. Click on the drop down and select the program you'd like this file type to be associated to. 

5. Click on the "Change All" button and "Continue"

source: http://www.mathworks.com/support/solutions/en/data/1-18ELZ/index.html

Default Types in MATLAB

Changing the default format of types in MATLAB [to long]:
'format long'

To return to doubles:
'format'

Tuesday 5 November 2013

Diet



11/5/13

  • Putting Butter in Coffee
    • MCT oil, a common supplement that claims to be all-naturally from compressed oils of palms and coconut. Just like butter, it touts itself as being fuel that helps energize your body and jumpstart your metabolism. 
  • Paleo Diet
    • Based on foods are ancestors would have thrived on.

References:
http://thepaleodiet.com/
www.reddit.com/r/nutrition/

Changing the Default Style in Google Docs


11/5/13
After making changes to the style in your google doc, click on the drop down menu that specifies the font type (typically this has the default field 'Normal text'). Under the Options gear, you will be able to select "save as my default style".

Source: http://www.googlegooru.com/change-the-default-font-in-google-docs/

Adding Virtual Desktops in OSX

Hit F3. Hover to the left/right of where you see the other desktops and you will be given the option to add another desktop.

Source: http://www.macworld.com/article/1165649/how_to_add_additional_desktop_spaces.html

Multiple Plots in One Scope in Simulink

Open the scope.

Open Scope Properties.

Change number of axes (allows multiple input ports).

Rerun simulation.

Suppressing Warnings in MATLAB

warning on verbose

Displays the command that can be used to turn the warning off.


Source: http://www.mathworks.com/support/solutions/en/data/1-QESD6/

Tuesday 22 October 2013

Image Processing: Why You Should Normalize Your Images


1. Normalizing Homographies
A homography represents a transformation between coordinates. But the actual values that go into this homography can be arbitrarily large and small. The reason to normalize here is to more accurately represent large numbers or numbers close to 0, due to computer system limitations on floats and propagation of precision errors.


2. Normalize Images
Normalizing images from their byte representations to a value between 0 and 1 is for convenience, in order to get a better estimate of the pixel intensity. We have better intuition towards a value that can be represented as a percentage (0 to 1) vs. a pixel value (0 to 255).


Source: Karanhaar

Monday 21 October 2013

Writing: Understanding the Importance of Thesis Statements

The thesis statement is important - when readers don't have much time, they'll only read the first line of a paragraph, or even the paper, before deciding whether the rest of it is worth their time (harsh but true reality, you probably do it too). So lead with something strong. At the same time, the second most important location is the end of the paragraph. So end strong as well.

During my fellowship essay review, I kept getting asked "what is the most important part of this paragraph?" and laughed to myself as each time it was embedded somewhere within the paragraph. Julia would tell me to listen as she read the paragraph and tell me to stop her when I got to my main point. Embarassingly enough, it was never at the beginning. If teachers back in middle/high school revised my essay like this, I think it would have been better ingrained in my head how to structure my essays. Although maybe embarrassment isn't the best strategy.

Depends on the audience of course, for something like this, an anecdote, I don't need to pay attention to such rules.


Source: Dr. Julia Deems

Sunday 20 October 2013

Programming: Debugging Tips


  • Visualize concepts when possible. 
    • Helps to understand where the information is going and what is happening
  • Modular code to easily understand the separate parts. 
    • Break things into smaller functions, assign a single task to each function.
  • Clear variable names, especially loop variables. 
    • Example: Instead of i,j for a matrix, use iRow, jCol
    • Now you at least have some sort of idea what each loop variable is.
  • Unit Testing
    • Modular code allows you to test each code component separately in order to ensure that the behavior of each function is what you expect.

For more tips like these, see 'Clean Code'. 
http://it-ebooks.info/book/1441/

Book recommendation and discussion via Karanhaar.