Prajwal Tuladhar’s Blog
 
programming, life and some random thoughts

Jun 19 2011

Quote from JavaScript – The Good Parts

Published by under JavaScript

The best thing about JavaScript is its implementation of functions. It got almost everything right. But, as you should expect with JavaScript, it didn’t get everything right.

~ Chapter 4. Functions, Douglas Crockford’s most read, JavaScript – The Good Parts


Comments Off

Jun 04 2011

CoffeeScript === Awesome

Published by under JavaScript

It’s been couple of weeks I have started using CoffeeScript (I know it has awesome integration with Ruby on Rails and particularly Node based projects) and I have fallen in love with it.

It’s not like that I don’t like JavaScript but JavaScript is a hard language. I think JavaScript is one of the language that most programmers have used in some ratio and most will say claim they know that language and most of the time it may be kind of wrong assumption.

For those who haven’t used CoffeScript, its a Ruby inspired language (or micro framework) that compiles into JavaScript.

Go and check the site if you haven’t! http://jashkenas.github.com/coffee-script/

I’ve been using CoffeeScript for couple of projects now. JavaScript source (http://cdn.sailthru.com/horizon/v1.js ) for Horizon, Sailthru‘s behavioral tracking product is generated using CoffeeScript and another one is work in progress, Node.js client for Sailthru API.

Not to forget that CoffeeScript makes using Node more fun!

Here’s dead simple Node server using CoffeeScript:

server = require('http').createServer (request, response) ->
    response.writeHead 200, {'Content=Type': 'text/plain'}
    response.end 'Hello World'
server.listen 9999
console.log 'Sever running at http://0.0.0.0:9999'

And generated source code:

(function() {
  var server;
  server = require('http').createServer(function(request, response) {
    response.writeHead(200, {
      'Content=Type': 'text/plain'
    });
    return response.end('Hello World');
  });
  server.listen(9999);
  console.log('Sever running at http://0.0.0.0:9999');
}).call(this);

I like the fact that CoffeeScript makes you hard to have global variable because everything is wrapped inside an anonymous function. And of course you can always use global variable in the form of attaching to window object in JavaScript and attaching to exports object for Node systems.


Comments Off

Dec 21 2010

Response from Pandora

Published by under iSpeak

So, I emailed Pandora after their Twitter account suggested me to do so regarding my query about recent WSJ series: What They Know – Mobile

I think I am pretty satisfied with their response and clarity.

Since we are still in the early stage of mobile computing, no one knows what type of regulation and guidelines are to be followed from the context of both users, app developers and Ad Companies. I’m optimistic that  all these debates regarding user privacy and the scope of data tracking in the web and smart-phone world will produce some clarity in the future.


Comments Off

Dec 21 2010

Introducing MongoNormolica

Published by under MongoDB,PHP

MongoNormolica is a MongoDB Master-Slave Replication Library for PHP.

Basically, it manages read slaves and write master connections.

You can select / use slave in number of ways:

  • Radnom Slave Selector
  • Round Robin or in sequential way
  • Most Recently Used Slave

The code is hosted on Github

You can look at the tests folder for implementation for now as, I still need to add more examples.


Comments Off

Sep 05 2010

Fuck Ruby!

Published by under Uncategorized

OMG! This video is also hilarious. This is from the same guy who published MongoDB web scale video and it was all over the web.


Comments Off

Next »

RSS Feed
Subscribe by email
Follow me @ Twitter