May 21, 2008

Humane Code Highlighting and js2-mode

One feature of many text editors that I’ve always been a little skeptical about from a user interface perspective has been syntax highlighting. It certainly looks pretty and serves to make the process of reading and writing code more satisfying, but I’ve had a hard time justifying to myself that it’s something that’s truly useful in a concrete way. The few examples that always come to mind are when syntax highlighting alerts me to the fact that I’m using the wrong syntax. ... Read more

May 18, 2008

More Firefox 3 Awesomeness: Smooth Image Scaling

I actually noticed another new Firefox 3 awesomeness yesterday while writing my post Firefox 3 is Awesome. Three of Deb’s images I used were too big for the width of my blog’s main column, which is 500 pixels. So instead of using HTML like this: <img src=“http://www.flickr.com/bigimage.jpg"> I used HTML like this: <img src=“http://www.flickr.com/bigimage.jpg" width=“500”> This basically tells the browser to try to proportionately resize the image so that it’s 500 pixels wide. ... Read more

May 17, 2008

Firefox 3 is Awesome

Mozilla has just released Firefox 3 Release Candidate 1 and the final release is just around the corner. I really think that this is an awesome product, and wanted to mention my two biggest reasons for why that is. Reason 1: The AwesomeBar Yes, it’s actually called the AwesomeBar. This is what the URL bar looks like in Firefox 2: and this is what it looks like in 3: The great thing about this interface is that it requires zero effort to find and take advantage of; everyone uses the URL bar, and will eventually discover the usefulness of this feature when the suggestion list gives them what they want before they’re done asking for it. ... Read more

April 24, 2008

Information Complexity and the Downfall of the Adventure Game

Back in 2005, I wrote a tentative article for The Game Chair titled Information Complexity and the Downfall of the Adventure Game, but due to some annoying legal issues, it never got published there. A little under a year ago, I contacted my favorite gaming magazine, The Escapist, to see if they’d be interested in publishing it, and they were. It was subsequently featured in issue 116 last September, but I just realized that I never mentioned it here. ... Read more

April 21, 2008

My Stuff, Open-Sourced

After hearing Chris McAvoy drunkenly wax poetic on how programmers should be more open with the stuff they write—McAvoy himself keeps a lot of his code in a public works repository on Google Code—I decided to work more openly too. So a month or two ago I set up a Mercurial repository at hg.toolness.com and have been regularly pushing a lot of my one-off projects to it. Most of the projects on there don’t mention anything about their license, though, and I’m not sure what to do about that. ... Read more

April 19, 2008

My First Mozilla Patch

Last week I decided to try my hand at contributing my first patch to the Mozilla source code repository, and I thought it might be useful to chronicle what went into it, as well as what I learned from the process. This particular contribution was actually motivated in part by a blog post by Mike Beltzner on the need for Mac-specific improvements to Firefox 3, and also by my own work on the Mac port of open-source Enso. ... Read more

April 14, 2008

PyOhio

I just found out that my hometown of Columbus, Ohio, is holding a Python conference. This is really cool. I encourage anyone in the area who is interested in computer programming or knows anyone who is to spread the word about this. Aside from being a really fun and easy language to learn and use—it’s simple enough to be taught to children—it’s also powerful enough to be widely used in the industry (for instance, it’s the flagship language of the recently-released Google App Engine). ... Read more

March 16, 2008

Python as a Platform

Something that recently occurred to me is that the only operating system that doesn’t come with Python pre-installed on it is Windows.

While Linux and OS X both view Python as essentially a first-class development platform–i.e., as something that shrink-wrap applications can be built on–Windows does not. Instead, it’s generally expected that a Python-based Windows application be “frozen”: bundled into a self-contained package that includes a copy of the Python interpreter and whatever libraries it uses, which are private to the particular application. While this ensures that the application will function as expected and not run into “dependency hell”, it also results in a relatively large download–distributing a simple “Hello World” program is at least a megabyte in size, and makes extending the program’s functionality more difficult.

During the summer of 2007, I made simple Python-based tool for some friends who played World of Warcraft; for those that played on the Mac, the situation was easy because their computers already had Python on them. For the Windows users, however, I was faced with the dilemma of either “freezing” the program into a fairly large download which would be difficult to test and update, or making my friends download the Python installer from python.org and running my Python script from source. Either solution seemed too cumbersome.

So instead, I opted for a different solution: I’d create a tiny executable that would first check for the existence of a Python installation on the end-user’s system. If Python was already installed, the executable would simply extract a Python script from itself and run it. That script was much like ez_setup.py; along with a few tricks, it essentially ensured that my friends would transparently auto-update to the latest version of the tool whenever they launched the program.

If there was no Python installation on the end-user’s system, however, the executable would simply transparently download the latest Python installer from python.org, silently install it on the end-user’s system without any prompting, and then proceed as outlined above.

So, in other words, a small executable file–only about 50k in size–was essentially responsible for “bootstrapping” my program by downloading and silently installing Python if necessary, and then downloading and running the latest version of my program’s source code. This ultimately meant that the user would be able to run a self-updating Python program from a tiny executable without having to click through any installation prompts or dialog boxes.

I’m glossing over a few details here and there are definitely some holes in my implementation–for instance, if the user uses a web proxy, they’re hosed–but I thought the general idea was interesting.

The source for the executable was compiled using the Nullsoft Scriptable Install System, along with its InetLoad plug-in. The source file is below for those interested.

... Read more

February 15, 2008

On The New York Times

I’ve decided that I’m not a big fan of New York Times, or of newspapers in general. It’s not that they’re fundamentally wrong or anything, but as a source of daily information, it’s complete and total overload for me. For instance, on the day after Super Tuesday, I wanted to read a bit about what happened, so I tried subscribing to a two-week trial of the online edition of the New York Times on my Kindle. ... Read more

January 18, 2008

A Simple Mozilla Build Script and Tutorial

Last Wednesday, I started working at Mozilla, the awesome company responsible for leading and coordinating the development of the Firefox browser. I’m now working for their labs team, exploring new ways of making the internet easier to use. Everyone I’ve met here so far is very friendly, intelligent, and motivated to make the web a better place; I’m really looking forward to working with them more.

One of the first tasks I’ve given myself here has been to get myself acquainted with the Mozilla build system, which is used to build Firefox, among other Mozilla projects. I’m most familiar with SCons, a Python-based tool we use at Humanized to develop Enso, and while I have some experience with Makefiles and the GNU Autotools, it’s been enlightening to see how the build system for a project as large as Firefox works.

While doing this, I spoke with Mike Meltzner, who passed me some gems of wisdom that were given to him by Vlad Vukicevic regarding a different way of setting up the build system than the one prescribed in the Mozilla Build Documentation.

I thought that the way Mike and Vlad did things was much more preferable than the one prescribed in the traditional build documentation, largely because it kept the CVS checkout 100% “pristine” and used a completely separate, parallel directory structure for everything else; aside from providing a really clean separation between what was under version control and what wasn’t, this gave me a much better idea of how the build system actually worked. Mike said that his way of doing things wasn’t documented anywhere, so I figured I’d write a simple script/tutorial that walks a reader through the setting up of the build system, the checking-out of Firefox from the source code repository, and the building of the application itself. It works on my OS X machine; I’m not sure if it works under cygwin or Linux, but I imagine it should.

Feedback is appreciated.

... Read more

© Atul Varma 2021