Category Archives: Programming

RIP Dennis Ritchie (DMR), 1941 — 2011

Dennis Ritchie - Creator of C programming-language, and co-inventor of UNIX(Image Courtesy: WikiMedia)

Dennis Ritchie passed away couple of days back (on October 8, 2011).

As Tim Bray has written summerised, this world would have been different, if Dennis Ritchie had not created ‘C’ and helped inventing UNIX.

I don’t know, if I would be what I am today without ‘C’ programming-language — the first programming language I learnt, used to solve problems, and wrote programs.

These days, I don’t write pure’C’ code except when I am debugging something or in need to write some utility executables. But UNIX (in some-form) is part of my day to day life.

Thanks to you, Dennis Ritchie Sir. May your soul rest in peace.

I regret for not thanking you when you were alive. Why we don’t do that when people are alive?

Installing Riak on Mac OSX

I am evaluating various nosql solutions for our existing/new projects. Bluesmoon recommended about Riak which is an awesome nosql datastore/database (and lot more).  I couldn’t wait to check it out.

As usual, I relied on Homebrew – the best package manage for OSX – to install applications/libraries. While installing, I got an error:

$ brew install riak
$ ...
$ Error: Failed executing: make all rel

After searching for a while, I figured out that there are known issues. With the help of Adam‘s comment on github, I was able to install Riak finally.

We make brew ignore Riak’s dependencies while building it.

Following commands should build and install Riak:

$ brew update
$ brew install erlang
$ brew install --HEAD --ignore-dependencies riak -v

Amazon S3 RequestTimeTooSkewed Error

Recently, we have started noticing “RequestTimeTooSkewed” erro while making requests to Amazon S3. The official FAQs suggests following:

Amazon S3 requires all machines making requests be within 15 minutes of an Amazon S3 webserver’s clock

Reading documentation and various blog posts made me believe, this is problem with the date/time settings on machine (which makes request). However, in our case, it turned out to be something else.

We use boto (Python library) for AWS stuff. Boto caches the connection objects (for S3, EC2, SQS, etc.), and tries to reuse those in later calls.

Imagine a simple use-case:

  1. Read data from S3
  2. Process data on EC2-instance/your-server
  3. Store processed-data on S3

In our case, #2 takes longer than 15 minutes (allowed limit by S3) sometimes, hence,  we were noticing ‘RequestTimeTooSkewed’ error.

Anyway, we fixed it by explicitly creating a different/fresh S3(http) connection before sending request to S3. This might sound inefficient, perhaps it is.

This is how we do now, a stripped down version of code from our class:

s3_connection = boto.connect_s3(aws_access_key_id="aws_access_key_id",aws_secret_access_key="aws_secret_access_key")
output_bucket = s3_connection.get_bucket("output_bucket")
key = output_bucket.new_key(key_name)
key.set_contents_from_filename(file_path, file_headers, True, None, 10, file_policy)

I am Python and boto noob; I am sure there would be a better way of doing this, so please share if you know one.

A Developer’s Open Letter to RIM

Jamie Murai has written an open letter to RIM, the company behind Blackberry and Playbook. Jamie talks about his experience of setting up development environment for Playbook application development.

It seems, RIM has failed to attract developers, the credit goes to broken development process and tool-chain. One has to spend good amount of time (and money?) setting up development environment, building application and deploying the same to marketplaces.

Why would developers bother looking at Playbook development, when they have better options (iOS and Google Android), where  development, deployment and monetization is relatively very-very simpler.

Developer usability is very important. Any company that relies on developer community/ecosystem for their growth, should take some lessons from Jamie Murai’s open-letter, which enlists some important points/issues.

Read Jamie Murai’s Open Letter To RIM’s Developer Relations.

CalDAV and SyncML Resources

One of our projects requires a calendar application with bi-directional synchronization with any other calendar applications/services such as Microsoft Outlook, Mozilla Thunderbird, Google Calendar, Yahoo! Calendar, iPhone, Nokia or others.

We can export iCalendar file, that would be readonly i.e. client applications can not write back to source calendar

I started looking at CalDAV, which is an extension to WebDAV, and SyncML, which is gaining traction because most of the mobile devices use it for synchronization of data. I yet to find where CalDAV fits when it comes to mobile devices.

I found out some interesting links, which I am still going through. I thought, it would be nice to share these links:

Don’t live with broken windows

Most of us have heard about “Don’t live with broken windows” or “Broken Window Theory” in software world, through books (Pragmatic Programmers by Andy Hunt and Dave Thomas, The Tipping Point by Malcolm Gladwell) and other sources (wikipedia, blogs, articles, etc).

Like many others, I have also experienced that Broken Window Theory applies to many business and personal-life (and many others) other than software-development.

Over the time I have read books and articles, as listed below to learn more and apply in day to day life. You might following links useful.

Another Common Early Start-up Mistake

In most common early start-up mistakes, Mark Suster talks about very interesting and insightful points. However, I feel like adding one more point, quite known but often taken granted, more specific to software or web start-ups.

If you are a software or web start-up, it’s really important to use the experience of founders (if they are come from technical background) or your core team to have following in order, as soon as possible.

Guidelines and best-practices: code, documentation (wiki), version-control (branching/tagging – when and how?), bug-tracking, testing (unit-tests, functional-tests), deployment, performance objectives and related stuff.

I would not go crazy (get distracted too much) about these initially but have these in place and encourage(mandatory – certain cases) everyone to contribute, follow, discuss and document. It’s lot easier to adapt things at an earlier stage rather than later.

I strongally recommend you to read Martin Fowler‘s article Technical Debt to learn more about the importance of having things in order.

Available for consultancy, training and development

I am available for consultancy, training and development services. Following is the rough list of things, I can provide consultancy, training or development services for:-

  • ActionScript 1.0, 2.0, 3.0
  • Adobe Flash/Flex
  • Adobe Integrated Runtime (AIR)
  • Training on Adobe RIA technologies
  • Architecture for RIA
  • Web Application Development
  • Design and Architecture
  • Development for LAMP
  • Integration Services for Flex/AIR with existing Web Apps
  • Development Setup for small teams
    • Subversion Version Control
    • Bug Tracking System (Trac, Wiki)
    • Training on Development Life Cycle
    • Backup Strategies
    • Development Sandbox Setup for RIA development

    JFYI! You can check out my linkedin profile to know more about me. I am based in India and have around ten (10) years of experience, during this period I have worked for Macromedia/Adobe, Yahoo!, Mixercast and TIS and worked as independent-consultant, freelancer, trainer and co-founder. I have been working on various technologies/platforms (some listed above).

    I am a programmer who enjoys solving users’ problems whatever it takes (technology is no constrain). Having said that, I am passionate about ActionScript/Flash/Flex/AIR and Web (in general) which happen to be my core competencies.

    PS: Do you think, this is a shameless sales pitch :-)

    Technorati tags: , , , , , , , , , ,,

    Don’t go dark – share your code as often as you can

    I found some interesting reads via Hacker News.

    I thought to put some sentences, which I understood from these posts:-

    • You are not your code.
    • Share your code for reviews, as often as you can
    • Accept code reviews/suggestions positively
    • Give positive and constructive criticism to your peers

    Doing all of these would increase collaboration, better quality of code and understanding of requirements. All these things are good, so why not do it?
    We all go through whatever has been said in those posts, where we feel like finishing/cleaning-up something before we could share, but soon or later we realize the importance of code-reviews.
    For last many years, wherever I have worked, I have subscribed to all notifications lists for repositories (SVN, Perforce, etc) as well as development lists. This way, I could see what my peers are doing, which allowed me to learn more about the projects/products and also made me offer my two-cents wherever I could. I also expected to get reviews on my work, which I got a lot of times, and believe me it always helped me write better code resulting in better product.
    In the end, a quote from the post (the first link above): You are not your code.