Design a website with nodejs, backbonejs, expressjs, and bootstrap

Here it’s my learning order of new technologies (nodejs, backbonehs, expressjs, and bootrap ) and use them to create a new website. I found this sequence is logical to me, and help me to learn step-by-step.

Recommended order to learn:

  1. Read the W3school for Javascript, CSS, html :http://www.w3schools.com/js/
  2. Under more about javascript (what is asynchronous programming?):
    1. http://stackoverflow.com/questions/16336367/what-is-the-difference-between-synchronous-and-asynchronous-programming-in-node
    2. https://www.youtube.com/watch?v=8aGhZQkoFbQ
    3. http://www.slideshare.net/piotrpelczar/asynchronous-programming-done-right-nodejs
  3. To begin with , please install nodejs and expressjs in your eclipse, i.e. noeclipse:
    1. http://www.nodeclipse.org/updates/
  4. Learn nodejs. Go through these documents:
    1. Nodejs introduction: https://www.udemy.com/blog/learn-node-js/
    2. What is Nodejs: http://stackoverflow.com/questions/1884724/what-is-node-js
    3. Nodejs event loop: http://blog.mixu.net/2011/02/01/understanding-the-node-js-event-loop/
    4. Follow this tutorial and get started on nodejs: http://www.hongkiat.com/blog/node-js-server-side-javascript/
    5. Now: follow codeschool tutorials on this website to go over learning modules for nodejs: http://campus.codeschool.com/courses/real-time-web-with-node-js/contents
    6. (optional): afterward, you have good enough idea of what is going on, so you can advances your level by reading this book (borrow from me): http://www.amazon.com/Sams-Teach-Yourself-Node-js-Hours/dp/0672335956
  5. You probably have seen expressjs a bit, you can further your knowledge by  reading this tutorials:
    1. http://stackoverflow.com/questions/5778245/expressjs-how-to-structure-an-application/7350875#7350875
    2. Example: http://shapeshed.com/creating-a-basic-site-with-node-and-express/
    3. Example: http://coenraets.org/blog/2012/10/nodecellar-sample-application-with-backbone-js-twitter-bootstrap-node-js-express-and-mongodb/
  6. Learn backbonejs now:
    1. Good tutorial : https://backbonetutorials.com/
    2. Go through one by one: http://arturadib.com/hello-backbonejs/
  7. Alright, this is the last piece, read through the boostrap document to know how to style a website:
    1. http://getbootstrap.com/

(Ubuntu14.04) How to install mipav7.2 and it’s plugins (e.g., TOADS-CRUISE) correctly (Ubuntu)

mipav is a powerful imaging tool developed by NIH (http://mipav.cit.nih.gov/), providing a lot of help in medical imaging analysis, such as registration, level set, segmentation, etc.

When I came across installing mipav(+plugins), I got a lot of problems. Installing mipav itself does not cause problem, the problem is that if you don’t install mipav correctly, you will get a lot of troubles in installing plugin (i.e., cannot install the plugin even though the plugin has no problems). Here it’s the brief flow.

1. Install mipav (from http://mipav.cit.nih.gov/).

sh ./installMIPAV.bin

NOTE: if you do sudo, your files will be installed in the root/ instead

2. Just follow ALL the default setting (i.e., where is the mipav/ folder is, where is the plugin folder is). If you choose the location, it’s fine for mipav running, but you will soon find out it cause problems in installing plugin. For example, the plugin folder will STILL placed in the ~/mipav/plugins. (For the shortcut, it’s fine)

3. Assume you are at ~. Open mipav and make sure there are no error messages. (WARNINGL mipav is very sensitive to if you are using sudo or not. If you don’t install with sudo, then you should just do ./MIPAV. Otherweise, the plugins folder will be automatically put into root, which is confusing)

>> ./MIPAV

4. Install JIST before TOADS-CRUISE). Follow this: https://masi.vuse.vanderbilt.edu/images/8/82/TR-MASI-10-01.pdf

HOWEVER, please note:

– After you download JIST in any folder and use mipav to install it, it will most likely show you error message: ” No plugins were installed, please select valid MIPAV plugin files”.  This error message is misleading. When you go to the mipav/plugins, you will find the the folder is not empty and in fact when you open mipav, you will see under “Plugins” in the menu, you plugin is installed.

(NOTE: Sometime, you will find nothing in the plugin folder. After trial and errors, I find the solution: PUT YOUR jar FILE INTO THE PLUGIN FOLDER INsIDE MIPAV/. And then install the plguin from there. I think the problem is that for some reasons mipav is not able to find the decompressed files during installation. )

5. Then install TOADS-CRUISE following this: https://masi.vuse.vanderbilt.edu/images/8/82/TR-MASI-10-01.pdf

6. You are good to go.

(Please contact me if you have any questions: johnny5550822@gmail.com) Good luck!


Notes about imaging tool FSL

FSL is a famous tool for medical imaging analysis. Here are some notes.

http://fsl.fmrib.ox.ac.uk/fsl/fslwiki/

(Note: Assume you are using ubuntu, and you use Debian repo to install fsl, which all the fsl softwares started with fsl5.0-“)

1. To open the FSL in terminal, type “fsl5.0-fsl”.

2. FSL only can view nii images, use dcm2nii to convert DICOM to nii.

(use software center to install dcm2nii)

3. Use FLIRT linear registration for image registration

4. 4D nii is a stack of 3D nii  files along time (time-series data).

5. fsl5.0-flirt for 3D registration (fsl5.0-mcflirt for 4D registration)

6. Do Skull removal before brain registration.

7. Choose image with higher resolution as reference


How to combine multiple commits (in a local repository) into a single one and push it to public repository

When you work on a team project, you don’t want to push multiple small commits in your local machine to the public shared one (cause your small commits maybe only relevant to the local repo.) What you want is a single major commit (summary of what you have done) so that you will not overflow the public commit history. For example, you have 1000 local commits to finish a task (let’s say you make a plus function in a calculator app <– oh well, this is impossible, but let’s assume this is the case), and you don’t want other to see ALL 100 commits, but simply a summary of what you have done, i.e., “Implement plus function”. Here it’s the step.

a. git branch xxx

(open a new branch)

b. git checkout xxx

(switch branch from master to xxx)

c. do whatever changes you have and keep committing. Once you believe you finish a major change and want to push to origin master, do next step

d. git checkout master

(check out master branch first)

e. git merge –squash master xxx

(merge)

f. git commit

(edit the commit content, remove all the current one. Type in new content and save and exit. NOTE: do not need to remove anything beyond #)

g. git pull origin master

(pull before commit)

h. git push origin master

(push it out)

DONE (can create a new branch and repeat the process again)


What is javascript asychronous programming and event loop?

Here are the notes about how I learn the concepts of javascript asynchronous programming and event loop from different online resources. Please note that the last resource is REALLY good.

_____________

http://2014.jsconf.eu/speakers/philip-roberts-what-the-heck-is-the-event-loop-anyway.html

– brower is powered by Google V8 engine
– have call stack basically recall where we are in the program
– single thread ( it can only do one thing at a time)

– if there are too many components on the stack, then what if one thing is slow?
– we just wait one thing to be done and then another thing?….but we are doing in browser, if then the user has to keep waiting.

How to handle this?
-asynchronous callbacks
Note: Stack is where your steps being processed. There a task queue to handle callback as well.

_______________________________________________________________-
http://blog.carbonfive.com/2013/10/27/the-javascript-event-loop-explained/

-In javascript, almost all I/O is non-blocking, meaning that the single thread of execution asks the runtim to perform an operation, providing a callbuck function and then moves on to do something else.
– WHen the operation has been completed, a message is enqueued along with the provided callback function. At some point in the future, the meesage is dequeued and the callback fired.

Read more: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/EventLoop

________________________________________________________
http://javascript.info/tutorial/events-and-timing-depth

– Most events in javascript are asynchronous
– WHen an asynchronous event occurs, it gets into the event queue.
– The browser has inner loop, called event loop, which checks the queue and processess events, executes function

__________________________________________________________
http://www.altitudelabs.com/blog/what-is-the-javascript-event-loop/

(Great explanation)

-WHen there is a callback, it will be placed in to event table and then later move to event queue (after it is completed) . There is a process constantly checking if the call stack is empty, if so then it will checks if the event queue has any functions waiting to be invoked, if it does, then the first function will be invoked and moved over to the call stack. <– this is event loop


Does pre-training step help in convolution neural network?

The answer is DEPENDS. When you have a lot of training data, it does not need to have pre-training step (unsupervised) because the weights eventually will converge to certain values. But if you don’t have much labeled data, then go ahead and do unsupervised pre-training.

 

See this: http://www.quora.com/When-does-unsupervised-pre-training-improve-classification-accuracy-for-a-deep-neural-network-When-does-it-not


How to set up nodejs, and expressjs in Eclipse (Ubuntu)?

1. Download Eclipse from official website.

2. Install npm (node package manager).

3. In eclipse, go to marketplace and download nodeclipse and all node-related packages.

4. Install express globally

$ npm install -g express-generator
$ npm install -g express

5. From eclipse, choose preferece --> nodeeclipse, make sure the path of node and express is correct, i.e.,

node: /usr/bin/node
express: /usr/bin/express

Reference: http://www.nodeclipse.org/updates/