Friday, September 3, 2010

An old conversation with Douglas Crockford

---------- Forwarded message ----------
From: Douglas Crockford <douglas@crockford.com>
Date: Tue, Mar 6, 2007 at 9:30 AM
Subject: Re: Minor fix in json.js
To: Prathapnirmal <prathapnirmal@gmail.com>


Thanks.

Prathapnirmal wrote:

Hi Douglas,
 First of all thanks for the awsome JSON. Even a subset of javascript does excellent job.I am using json.js in one of my projects and came across a minor bug which requires a fix. It's in the filter walker function,

 if (typeof filter === 'function') {

                       function walk(k, v) {
                           if (v && typeof v === 'object') {
                               for (var i in v) {

                                   if (v.hasOwnProperty(i)) {
                                       v[i] = walk(i, v[i]);
                                   }
                               }
                           }

                           return filter(k, v);
                       }

                       j = walk('', j);

                   }
                   return j;

 The final result of the walker should be the return value, else the following example fails,

 var filter = function(k, v) {
   switch(v.type) {
      case type1:
         return type1();
              case type2
          ....
   }
 }
    var json_data = {type: "type1", collection: [{type: "type2", ...}]};
  var type1_obj = json_data.parseJSON(filter);
  In the above example I will be expecting a type1 object whereas what will  I actually get is a simple object. The actual reason is that the final object that is created in the filter function is lost.

Again thanks for such a good alternative to xml. Please let me know on what should I do to do this fix so that it becomes useful to everyone and not everyone spends time on debugging the same issue.

thanks
~
Prathap


Posted via email from spartan's posterous

Wednesday, August 18, 2010

Keep Life Simple

  • Follow your heart
  • Find a new perspective
  • Have a sense of wonder
  • Find people you love
  • Set goals
  • Help others
  • Dance
  • Pamper yourself
  • Face your fears
  • Go to a museum
  • Exercise
  • Limit Television
  • Get in touch with nature
  • Lighten up
  • Get a good nights sleep
  • Read books
  • Buy yourself flowers
  • Don't compare yourself with others
  • Be open to new ideas
  • Don't focus on negative thoughts
  • Focus on creating what you desire
  • Make time just to have fun
  • Keep the romance in your life
  • Make a gratitude list
  • Want what you have
  • Be true to yourself!

 

Keep life simple!! - http://www.facebook.com/video/video.php?v=446284490742

Posted via email from spartan's posterous

Monday, June 28, 2010

My Status Messages


  • RTFM - Read the _dash_ manual
  • People, most important asset for any company - invest in them, rest will follow
  • I make design decisions in my shower
  • Two wrongs is not right but three lefts are, both are bad in engineering

Wednesday, April 14, 2010

Mozilla Add-ons: Speed DNS 0.1 reviewed by Juan Manuel Rodriguez Alvarado

Just got my Speed DNS Addon approved on Mozilla! Check it out.

---------- Forwarded message ----------
From: Mozilla Add-ons <nobody@mozilla.org>
Date: Wed, Apr 14, 2010 at 10:37 PM
Subject: Mozilla Add-ons: Speed DNS 0.1 reviewed by Juan Manuel Rodriguez Alvarado
To: prathapnirmal@gmail.com


Congratulations! Your nominated add-on, Speed DNS, has been reviewed by a Mozilla Add-ons editor who approved your add-on to be public.

Your most recent version (0.1) has also been made public.

You can view your public add-on now at: http://addons.mozilla.org/addon/54648

Review Information:
Reviewer: Juan Manuel Rodriguez Alvarado
Comments: Congratulations, your add-on has been approved for public status. Due to caching and mirroring of AMO, it may take a couple of hours for your add-on to appear public, so please be patient.

Keep up the good work!

It is difficult to verify the performance gain as DNS resolution occurs very quickly, but apparently the code aims to help you save a few miliseconds :)

If you have questions about this review, please reply to this email or join #addons on irc.mozilla.org.

Mozilla Add-ons
http://addons.mozilla.org

Posted via email from spartan's posterous

Thursday, March 25, 2010

My meetings this week

I was wondering on how much meetings I had this week and was trying to write some thing to figure that out automatically. AppleScript came to help since I was using ical and it took me about 3 hours to start from basics to get what I have, the following code. Result is 18 meetings and the total time I spend on meetings is 16 hours.

global total_meeting_hours

global num_meetings

set total_meeting_hours to 0

set num_meetings to 0

tell application "iCal"

tell calendar "calendar"

set theEvents to every event

repeat with e in theEvents

set sd to start date of e

set sm to month of sd

set d to day of sd

if sm contains March and (d > 21 and d < 27) then

set ed to end date of e

set h to (ed - sd) / (60 * 60)

set m_summary to summary of e

set total_meeting_hours to total_meeting_hours + h

set num_meetings to num_meetings + 1

end if

end repeat

end tell

end tell

 

display dialog total_meeting_hours

display dialog num_meetings

Posted via web from spartan's posterous

Wednesday, March 3, 2010

Crockford's Talk

  • HTML was derived from SGML. SGML is something used internally at IBM and Tim adopted it for world wide web
  • The browser makers went into a competition on who could make the best sense of a very bad html document
  • Next is the end of all things!

Posted via web from spartan's posterous

Yahoo Maps

Its very inconvenient that I have to do an extra click on the text box to start typing in something. Why don't they auto focus?

Posted via web from spartan's posterous