Day 70, ten weeks already

Time flies. I can’t believe it is already ten weeks after the program starts. It seems like that the ten weeks is just a long working day to me….

The hiring day is coming up in ten days. Better get ready for it

Advertisements
Standard

Day 69, Nodejitsu and bower install

Sigh…

Wanted to deploy to Nodejitsu, but can’t get the bower install to work.

Basically, our app has two package management systems, npm and bower. While Nodejitsu supports npm, it doesn’t seem to support bower.

I tried to do this:

var bower = require('bower'),
path = require('path');

bower.commands
.install(['underscore'])
.on('end', function(installed) {
console.log(installed);
});

With this in my package.json:

  "scripts": {
    "predeploy": "echo Before deploying!",
    "postdeploy": "node ./bower_install.js",
    "start": "node ./start.js"
  }

Can’t get it to work. Following the advice from this url: http://stackoverflow.com/questions/16795677/nodejitsu-and-bower-install/16796998#16796998

Standard

Day 68, the curse of ORM

Tried to get mongoose to work and once again, faced the curse of ORM. The problem I had with ORM is that, it is hard to debug because it doesn’t tell you where the problem is.

The task was simple: create an instance method such that the document can go to another document, fetching _id for another document, and fetch the final document. Extremely easy task yet I kept getting empty result.

Then I realized that the schema for one of the document was changed. Because the schema didn’t match the actual database, mongoose returned nothing. Will be more careful next time. But the fundamental problem is, how am I supposed to debug this, especially when a complex query involves many tables(collections).

Standard

Day 67, Meteor workshop

Finally got a chance to go to the Meteor workshop. Amazing. Heard great talks and became to appreciate even more. Tuhin from our class actually went on to give a lighting talk. He was a natural public speaker and did a great job.

Standard

Day 65, promises

I have learned how to use promises in the client project and I spent some time teaching our current team members on how to use it today.

Basically, you create a deferred object, and return it(*). The promise or the contract is that, in the future, when the object changes its state from pending to resolved / rejected, the object will call its corresponding methods such as: object.then().

* means that the actual returned object is a sealed version of the object, meaning the receiver can observe, but can’t change its state by calling: object.resolve() or object.reject().

From my teaching experience, I feel like nobody gets the concept the first time, but everyone loves it once he finds out what is going on. I can’t imagine a world without promises…

Standard

Day 64, first demo for group project

We did our first demo of the group project.

It was amazing to see that most projects made significant progress over the last four days. My favorite ones are: the speaker – an web app to allow anyone to request the mic in a conference, and the SnapChat with geo-location.

Standard