Wednesday, December 17, 2014

Show Hidden Files in Mac

The long way...
1. In Terminal:
defaults write com.apple.finder AppleShowAllFiles YES
2. Press return
3. Holt alt key on keyboard, right click, relaunch
4. To hide:
defaults write com.apple.finder AppleShowAllFiles NO

Making aliases for show and hide hidden files
1. In Terminal:
sudo nano ~/.bash_profile
2. Enter your root password, and hit return
3. Paste the following in open .bash_profile file:
alias showFiles='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app'hit return
4. Paste the following:
alias hideFiles='defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app'hit return
5. Ctrl+O and hit return to save file
6. Ctrl+X to exit


So the next time, you can just use the aliases in Terminal, showFiles to show hidden files, and hideFiles to hide them.

Thursday, December 11, 2014

Traffic Flow and Modelling with CA

Quick references:

  1. http://sjsu.rudyrucker.com/~han.jiang/paper/#_Toc40035685
  2. http://publish.uwo.ca/~jmalczew/gida_5/Pursula/Pursula.html

Enable select text in Quick Look Mac OS X

Quick Look in Mac OS X is very useful if you just want to have a glance at certain file without launching the needed application. You can do so by just hit the space bar. Quick look can be even better if we can select the text without launching its application. It can be done and reversible as follow:


1. Launch Terminal
2. Type the following command
defaults write com.apple.finder QLEnableTextSelection -boolean YES;
killall Finder


3. Want to put it back the way it was?
defaults write com.apple.finder QLEnableTextSelection -boolean NO;
killall Finder

Tuesday, December 9, 2014

Mac Must-Know Keyboard Shortcuts

For my own reference
Collection of Mac keyboard shortcut. The list will go on...

Cmd+C - Copy
Cmd+Opt+V - Paste
Shift+Cmd+4 - Print Screen and save to desktop
Shift+Ctrl+Cmd+4 - Print Screen and save to clipboard (no image will save to your desktop)
Hold cmd+RightClick Trash - Securely empty trash

Cellular Automata 101

Disclaimer - This is my collection of personal quick reference, that I learned from blogs, books, articles, papers, journals. I'm by no means an expert/professional, my opinions/understanding at the specific time of writing may not be accurate. So don't take my words and apply to your homework/assignment, however I'll try to quote the reference link below.

I don't take responsibility for much more than waking myself up in the morning =)

The term cellular automata is plural, if a code is simulate just one cell - it's a cellular automaton (singular),

A cellular automaton is a model of a system of a cell objects. Its characteristics:
  1. Cells live on a grid
  2. Each cell has a state (1 or 0, on or off, alive or dead)
  3. Each cell has a neighbourhood
Analogy - think of filling in some square on a piece of graph paper. Consider a set of simple rules 
that would allow that pattern to create copies of itself on that grid.

A most important detail of how CA work - time, for CA to live over a period of time (a.k.a generation/frame count/iteration)




References:
http://natureofcode.com/book/chapter-7-cellular-automata/

Monday, December 8, 2014

Terminal Must-Know Commands (Mac)


Commands:
  1. clear - clear the screen
  2. pwd - present working directory
  3. ls - list all files
  4. cd - change directory
  5. cd folder_name&&ls - change directory and list all the files inside
  6. mkdir -p Dir_Name/{subDir1,subDir2} - make directory and subdirectories
  7. rm -rf file_path  - delete file permanently (not goin to trash)


Keyboard:
  1. ctrl+c or ctrl+z - to stop process in terminal

Adding multiple ports to scope in Matlab Simulink

1. Click the scope
2. Select setting
3. On the general tab, change the number of axes









You may also use the 'mux' block to display multiple inputs.

Tuesday, December 2, 2014

Editing Text in GUI-Matlab

On command windows,
>> guide(charGUI2.fig)

can edit the text by:

  1. double click on text
  2. Look for 'String' and click the 'left alignment'