Posts

Showing posts from December, 2012

My Reading Lists

I had some time over Christmas and decided to organize my reading lists. Interesting how some time away from daily work allows one to raise up your head   Uncle Bob on Principles of OOd See also book: Agile Principles, Patterns, and Practices in C# Available on Safari Books online. Algorithms in a Nutshell Nine   Algorithms   That Changed   the Future Programming Pearls book: http://www.cs.bell-labs.com/cm/cs/pearls/toc.html 97 Things Every Programmer Should Know Seven L a nguages http://pragprog.com/book/btlang/seven-languages-in-seven-weeks Codys book : http://www.domenlightenment.com/ Principles of OO programming: http://www.nczonline.net/blog/2012/12/18/now-available-principles-of-object-oriented-programming-in-javascript-beta/ Object Oriented programming with Stefan Stoy... Chrome V8 : http://code.google.com/p/v8/ https://developers.google.com/v8/ https://developers.google.com/v8/design - read this Mozilla Javascript page Javasc ript Memory

Styling Fixed nav bar; Left nav collapse/expand (simple),

Nav bar which becomes fixed Nav bar starts lower down, when user scrolls it scrolls up and then locks in a fixed position. If user scrolls down then it unlocks and scrolls. Note: on iPad the scroll event does not happen until the user releases so the nav bar will not scroll progressively as on desktop browser but only once the user releases. But I think that's an ok experience. Left nav which collapses and expands Often seen on basic Help pages. One way to implement is as nested ul sublists which are initially hidden, then when user clicks one can use query click handler to slide/slideToggle to expand and collapse. The trick is that the onclick page request is submitted to the browser so there must be code server side to attach a class to show the appropriate section expanded whent he page returns.

Want to understand more about programmers?...then read this

Great article from the guy who helped bring us Y Combinator Read this too , from a great javascript guy and person to boot!

Using node.io for screen scraping

I built a node.js prototype, which used node.io, for an idea we had to get some useful data.I knocked this out Sunday night and early Monday. Besides learning node.io, a challenge was how to handle nested getHtml() calls in node.io since each is threaded. After 2 initial versions I found a useful post and the approach to use. node.io is a powerful node.js package to support data manipulations (file io, db access, screen scraping etc.) in an async manner. It has strong support for screen scraping which I used it for, I like the jquery like dom selector support, very cool. But I would definitely use it for file processing too. In node.io you create jobs which are then run. You can define inputs and outputs. Lots of good material on the wiki. The multi threading makes it a bit tricky especially for nested tasks. Here's the git repo for the app I built. A nod to my muse for this work, the "jean genie" maestro himself.

Node.js convert reviews app to use express web framework

In my previous posts I build a simple node.js app without the use of a web framework. Its a good learning exercise but now I want to use a web framework. I choose Express for node because from what I read its proven, well documented and has support for what I wish to build. I can also use dust templates server side with express (I used consolidate.js to facilitate). So here's what I did to convert to using Express. For "my next trick" I'm going to convert the reviews app to use the express web framework and have it reuse the dust templates I'm already using with backbone.js - install express globally - create app scaffolding with express:    express expreviews - that creates a new folder "expreviews" with a folder structure which express proscribes     expreviews        /public    (the apps public folder includes /javascript, /images and /stylesheets subfolders)        /routes    (express route mappings/definitions)        /views     (view template fi