Archive for the ‘Articles’ Category

The perception of “Inception”

Sunday, July 18th, 2010

It’s no secret that I primarily use this space to talk about programming and the web at large. It’s a huge part of who I am, but it’s not all that I am. Sometimes I see something so incredibly cool and inspiring that I just feel the need to talk about it; such is the case with the movie “Inception”.

Please note: the following is full of spoilers if you haven’t seen the movie yet!
Believe me when I say that this is a movie that you should avoid having spoiled at all costs, because it’s just such an incredibly fun ride. This post will also make little sense unless you’ve actually seen the movie. Seriously, go see the movie if you haven’t already, then come on back, this post isn’t going anywhere.

What really happened in this movie?

I’ll start by making sure this is noted right off the bat: I believe that the Wikipedia explanation of the ending of the movie is completely wrong. The article states that, in the end of the movie, everyone wakes up on the plane just fine. The genius part about this movie is that Christopher Nolan, the director, rarely strayed towards one ending; everything throughout the movie is meant to spark discussion about the final ending scene, where the top may or may not have fallen.

Throughout the film, Nolan obviously took great care to make the audience aware of the mathematics surrounding the way the levels relate to one another. The idea with this is that, in the end, even though Cobb is left underwater in the van, the time that he spent in the sublevels beyond could be as little as a few minutes there, giving enough space where he could’ve magically gotten back up through the levels.

That’s all nothing but a ploy, though. Here’s the thing – in the ending, I believe Cobb never actually woke up. Let’s look at the film this way…

Cobb and his children

First off, the kids and the shot at the end. Did anybody else notice anything strange about it? The kids never aged!. Cobb goes back to his place and it’s as if he never left. We’re purposely never given a timeline as to when Cobb and Mal had their little incident with Mal having a bad case of PMS and jumping out a window. I’d say it’s safe to assume that this has to have been at least a few months to a year, though; we’re shown shots of Cobb talking to various psychiatrists, attempting to persuade people that he did not, in fact, kill Mal. If this is in relation to court proceedings of some kind… well, we all know how long those acts can take.

That said, we really don’t even need to consider that, it’s just a nice piece to note. What we should really be looking at is that, throughout the film, every time Cobb sees his kids in a dream, they’re the same (just like in the end of the film). It’s his last memory of his kids; in some way, they’re his inception.

Keep this in mind, because the rabbit hole goes a bit deeper.

Cobb and Saito: honoring the agreement

When the team is in the first sublevel, Saito takes a bullet to the chest. There’s a scene where he specifically states that no matter what happens, he’ll be sure to honor their agreement. Of course, at that point in time, we all have reason to believe that Saito is going to make it out alright, Cobb will be able to get back into the US, and everyone will go on their merry way.

As the film continues, though, Saito’s condition worsens, and he eventually passes away in the third sublevel. This is a huge fact: Saito is now in limbo. Cobb, after finally killing Mal, stays behind in limbo to find Saito to make sure he honors the agreement.

See a pattern here? In this case, there’s more than one way to honor their agreement. Cobb eventually does find Saito, when Saito is much, much older. They speak of honoring their agreement, which is why Cobb came, and Saito reaches for the gun. This is the most notable piece of their entire level of interaction throughout the movie – if dying in a sublevel when you’re that far under puts you in limbo, what happens when you die in limbo?

Of course, we’re never directly told. Tricky, tricky Nolan, but we’ll pin this down yet.

On Heaven, Hell, and Unicorns

Mal’s dead, no? What’s funny about Mal inside Cobb’s subconscious is that she’s located in the basement of his mind, an eternal hell that Cobb can’t seem to get rid of, as if he was condemned to that fate for his action against Mal (trying inception on her first). Eventually, when they make it down to limbo, Cobb finally kills the idea of Mal – this is his redemption.

Cobb is essentially painted as a fallen angel throughout the movie, barred from heaven. By atoning for his sins, he’s allowed back in and everything is supposedly great. That said…

What was really Cobb’s Heaven? Real life, where he got back to see his kids? His one goal was to go home, to be with his family, but it’s made apparent to us, the viewers, that when you’re in limbo it’s difficult (or almost impossible) to get out.

Bringing it all together

As I said before, Cobb never actually woke up. Saito reaching for the gun is meant to imply that he kills Cobb, setting him free – not in the sense of waking him up, but allowing Cobb to dream that which he’s wanted for ages, to be back with his family (hence why, when he goes back to his kids, they’re exactly the same as in every other shot).

Nolan again takes great care to make sure this is difficult to prove – specifically, the scene where Cobb and Mal allow themselves to be run over by a damn train. This is supposed to imply that simply dying in limbo allows you to truly wake up. That said, unless Saito kills himself and Cobb (which seems a little odd – Saito knew the rules of the game, why wouldn’t he just kill himself prior to Cobb finding him?), the final scene really does seems like Cobb is dreaming forever.

See, Saito supposedly woke up just fine, made the call, everything’s great. However, what guarantee is there that either of them woke up normally from limbo, the level that seriously messed up Mal? None.

This all brings us to the final scene with the spinning top: it was a great move on Nolan’s part to end it right as the thing supposedly topples, essentially forcing the entire discussion this article was even written about. Sure, we could assume that it signifies Cobb is alive and well, not dreaming.

However, a friend of mine offered this suggestion, which I think really ties it all together: she proposed that the top falling was Cobb giving in to his dreams, accepting that reality as reality itself. This is utterly genius, and makes an insane amount of sense.

The other theory that comes to mind is that it was Mal’s totem originally, and she’s now, for all intents and purposes, finally gone, a demon purged from his mind, allowing him to dream peacefully forever.

This movie was an incredible mental trip, and one I definitely intend to watch again. What do you think? Feel free to leave comments below; they’ll be moderated to deal with spam and trolls, but healthy discussion on this film is highly encouraged.

Open source programming languages for kids

Friday, December 19th, 2008
Note: This article was originally published on December 19, 2008 (2:00:00 PM) over at Linux.com. A still-breathing version of the article (broken links intact) can be found at Linux.com.

Scratch

The past couple of years have seen an explosion of open source programming languages and utilities that are geared toward children. Many of these efforts are based around the idea that, since the days of BASIC, programming environments have become far too complex for untrained minds to wrap themselves around. Some toolkits aim to create entirely new ways of envisioning and creating projects that appeal to younger minds, such as games and animations, while others aim to recreate the “basic”-ness of BASIC in a modern language and environment.

Developed by the Lifelong Kindergarten group at MIT, Scratch is a graphical programming environment implemented in Squeak that works in a very Lego-like fashion. The basic premise is that you build programs by snapping together colorful blocks of code. Scratch’s custom interface allows a programmer to bring in graphics and sounds and create basic animations. All the basic programming constructs, such as loops and if statements, are supported, and grouped into different block categories, such as Motion, Sensing, and Sound.

Scratch has implementations available under Microsoft Windows and Mac OS X, but as of yet there’s no (official) native Linux version to run. It is possible to run Scratch through Wine, though in my tests most audio-related Scratch programs ended up failing. There is a Linux-runnable version of Scratch, though it’s not actively developed by the folks at MIT. The one problem with using this version is that presentation mode, where your Scratch program can take over the whole screen, doesn’t work. This isn’t really a show-stopper, as there are a few different ways to view a Scratch program, but it’s easy to see how it could be a desired feature.

One useful prospect that Scratch offers is the ability to upload your programs to the Scratch Web site, where you can create an account, get support, and browse programs that other Scratch users have uploaded. All uploaded programs are open source, in the sense that you can download and modify the source of any Scratch program that’s been uploaded. Scratch programs are also viewable from within a Web browser, for the most part, through use of a Java applet called the Scratch Player. Scratch itself is released under its own Scratch License, and all uploaded programs exist under a Creative Commons Share Alike license.

One issue I came across with Scratch was that the source code for a program could become quite large when the program involved many graphics or, more specifically, music. One program, a simple music player, reached a strikingly large 93MB in size. Typically Scratch would choke on loading any program greater than 60MB in size, usually erroring out. The large size of a file may have something to do with how old the source code is; repeated instances of saving and re-opening the same file seemed to grow the size exponentially.

Alice

Scratch deals well with 2-D graphics, text, and other somewhat “flat” programming concepts. By contrast, Alice teaches programming fundamentals in the form of 3-D movies and games. Alice is developed in Java, and is somewhat like Scratch in that you build things in a drag and drop interface.

Alice, developed by a group of researchers at Carnegie Mellon University, has releases for Linux, Mac OS X, and Windows, and is released under an aptly titled Alice License. The environment is open source in the sense that you can download and examine the source code, but the creators prefer to work exclusively in-team, and don’t take outside contributions. Alice has been around since 1999, making it one of the oldest and most developed environments for teaching children how to program. It is because of this that it’s used in schools all over the world.

Shoes

Originally created by a developer who goes by “why the lucky stiff,” now furthered by a large development community, and based on the already user-friendly Ruby programming language, Shoes is an open source toolkit that’s a bit more in line with traditional programming methods. All that’s required to make a program in Shoes, besides its runtime environment, is a basic text editor. On the project’s Web site you can find a free PDF guidebook that contains tutorials and examples for Shoes. You can also order the guidebook in paperback form for $5.57. Shoes 2 comes with an extensive built-in manual that users can access via key commands.

Shoes has similar syntax to Ruby, and has easy methods for creating graphics and buttons, as well as displaying colors and text. It is supported across multiple platforms, including Linux, Mac OS X, and Windows. The toolkit works well across platforms, in that windows, buttons, and dialogs look native to their environment, and do so regardless of which platform the application was initially created on. A benefit of Shoes being in Ruby is that it’s given access to the many different RubyGems packages that exist. Shoes 2 even includes support for automatically installing a Gem on a user’s system if it’s not already present.

Shoes has a fan-supported Web site that showcases a gallery of applications created with Shoes. As with Scratch, all the applications that are uploaded can be downloaded, modified, and remixed. Shoes itself is released under an MIT License, and is open to outside patching and development.

A multitude of other programming languages and environments exist to teach children, such as Greenfoot, Phogram, and Microsoft’s Small Basic, though many of them exist as proprietary implementations. Scratch, Alice, and Shoes are all open source, include support channels such as forums or chatrooms, and have large, thriving communities. These three environments are possibly the most open, mature, and easily accessible environments that are geared toward teaching programming concepts to young minds.

Supercharge Firebug

Monday, September 15th, 2008
Note: This article was originally published on September 15, 2008 (9:00:00 AM) over at the Linux.com. A still-breathing version of the article can be found at Linux.com.

Yslow

While you can use Firebug to monitor network activity, you can take that to the next level by adding YSlow, which checks your Web site against Yahoo’s best practices for a high performance Web site. Besides checking your performance, YSlow can also show you graphs and charts that let you inspect things such as expires headers, ETags, and the total amount of HTTP requests — all useful for optimization.

Jiffy

Jiffy is a Firebug extension developed at Netflix that checks and captures time measurements for JavaScript that loads on the page (via jiffyweb, an open source Web site measurement suite), and provides a graphical representation of the data, which is ideal for comparing and reducing the effects on page load that are brought on by various JavaScript libraries.

FirePHP

If you’re debugging HTML, CSS, or JavaScript, Firebug fits your needs, but what if you want to go further? FirePHP is a Firebug extension that lets you work with PHP5 and up as your server-side language of choice. FirePHP requires that a PHP library be installed in order to function, but once that’s installed FirePHP can make use of special “X-FirePHP-Data” headers to bring debugging into the Firebug pane. The debugging data that’s sent from the server to the client-side does not interfere with the content of the page you’re debugging in any way. For more information, including a quick tutorial, check out the FirePHP Homepage.

Firecookie

The Firecookie Firebug extension allows you to view all the cookies currently being used on a page or search for a specific cookie, monitor any existing cookies on the page, and add or delete cookies at will. With Firecookie you can check out information on any cookie, such as the name, value, domain, expire date, or path. You can also use the extension to change your settings for accepting or denying cookies straight from within Firebug.

Pixel Perfect

Firebug can provide more than just developer functionality. If you’re a designer, check out Pixel Perfect, a Firebug extension that allows you to overlay a semi-transparent image, or mockup, of your page design. Tou can then use Firebug to line up every element on your page with the overlay. Pixel Perfect is still an experimental add-on, but in my tests I found it to be perfectly stable.

If you like the features of Pixel Perfect and would like to use it in a cross-browser setting, check out OverlayComp, an open source script that accomplishes much of the same functionality, albeit with lesser convenience.

Rainbow for Firebug

Firebug’s default script panel can feel somewhat like working in a plain text file at points. To get around this, check out another experimental add-on. Rainbow for Firebug adds syntax highlighting to the script panel, displaying intuitive, color-coded text for variables, objects, functions, and more. There are alternatives to the default highlighting colors — to see more coloring options, or possibly create your own, check out the Rainbow for Firebug homepage.

Rainbow utilizes the parser from CodeMirror.

All the aforementioned extensions work best with Firefox 3 and some form of Firebug 1.2. Rainbow in particular requires Firebug 1.2 — if it’s installed alongside an older version of Firebug, that version will cease to function.

Firebug by itself is an immense asset to any Web developer, but if you extend it with any of these add-ons, you’ll have a tool that can reduce the time it takes you to implement and debug your sites.

Easy blogging with Pivot

Tuesday, September 18th, 2007
Note: This article was originally published on September 18, 2007 (9:00:00 AM) over at the Linux.com. A still-breathing version of the article can be found at Linux.com.

The GPL-licensed Pivot blogging software stands out among blogging applications because it requires no database, no extra libraries, and minimal installation effort. While it’s still in an early stage of development, its flexibilty and the ease with which it can be set up make it ideal for those new to maintaining their own blogging Web sites.

To use Pivot, you need a server that’s running PHP 4.1.0 or higher. Unlike WordPress or Movable Type, Pivot requires no MySQL database; it stores most of its data within XML files. Pivot also strives to use no extra libraries so as to be available and usable by as many people as possible.

The simplest way to install Pivot is by using Pivot Setup. Download the setup zip file, unzip it, and open the resulting pivot-setup.php script in a text editor. Set your password and save the file — nothing else is needed. Upload the script to your blog directory, which must have permission (chmod) settings of 777. Open the direct link to the script in a browser. If your server is ill-equipped, or needs something changed, Pivot should alert you first thing, as it checks before anything in the script is run. If you’re good to go, just follow the instructions for an easy and successful installation. Pivot should automatically pull the files it needs from SourceForge.net and set itself up for you.

If for some reason you can’t get the aforementioned method to work, you can set up Pivot manually by downloading the entire package (1.40.3 Dreadwind is the latest version as of this article), uploading it to a Web server, and configuring it to your needs. The project provides a pretty well-written guide to the manual installation process.

Pivot has many of the features you’ll find in other blog systems. Users can register and log in to an account, reply to a blog post, or reply to another commenter through use of a threaded comment system. Pinging and trackback capabilities are included, as well as a simple search that indexes all blog posts. Since it’s still young, Pivot lacks the number of free templates that WordPress and Movable Type have, but there is a growing archive at PivotStyles.

Pivot supplies RSS feeds without any extra work, though you can only get a feed for all posts, not just, say, one category. RSS feeds can be made available in either RSS or Atom format.

You can find a few plugins and extensions for Pivot, but as with some of the documentation, they can be hard to locate. A good list of the basic ones can be found in the Pivot Documentation.

Drawbacks

Pivot is, of course, still young and in development, and with that there are bound to be a few drawbacks. There’s currently no support for any form of a static page, which restricts users to just writing the blog — any other pages must be created by hand. Some users within the community, however, seem to have found ways around the issue. Getting technical support can be difficult at times, as there’s really no designated support portion of the project. There is an active community, as well as a recently started Pivot Documentation Project that helps to alleviate some of the problems.

Another issue is that recently Pivot’s servers seem to have gone through long bouts of downtime, which makes getting any support virtually impossible.

If you’re looking for a lightweight blog application, Pivot may just fit your bill. It has by far the easiest installation I have encountered for a piece of blogging software, and it offers much of the functionality and usability that most other blogging applications have. If you’re running a high-traffic site, you probably want to look instead at a more traditional blog that uses a database back end, as using XML files to store data in that situation may put too much of a load on your server. For a smaller site, though, Pivot’s definitely worth a look at.

Keep users informed with PHPList

Tuesday, July 31st, 2007
Note: This article was originally published on July 31, 2007 (9:00:00 AM) over at the Linux.com. A still-breathing version of the article can be found at Linux.com.

If you’ve ever considered throwing together a mailing list to keep the members of your group, project, or organization informed, you’d be hard-pressed to find a better application for that purpose than PHPList, a free and open source newsletter manager.

PHPList is a Web-based application written in PHP, and relies on MySQL databases for storing information. If you’re leery of setting up PHP, MySQL, and a Web server, you can opt to pay for a hosting package with a service that offers PHPList preinstalled and configured, such as Host Color or SiteGround.

However, setting up PHPList isn’t that difficult. You can download the software as either a ZIP or a tarball, depending on your needs, and basic documentation is included within the downloadable PHPList package. If that doesn’t cover your needs, there are other places to turn, such as the more extensive online documentation or the PHPList forums. Make sure you have a Web server and PHP installed, and a MySQL database to throw all your data in. Depending on how your site is hosted, you may have a basic database already set up — check with your provider to make sure.

Once the prerequisites are in place, simply download and unpackage the contents of the archive. Edit the PHPList config.php file and make sure all the variables –username, password, database ID, and default language — are set. The configuration file is pretty well documented with comments concerning what each option is. Save the file, then open the PHPList installation page (www.siteaddress.com/lists/admin/) in a browser. The installation procedure asks for some general configuration settings, such as whether to offer RSS feeds with your lists.

Once the software is installed, you can tailor your signup page to your needs. PHPList offers many different options for obtaining information from users at signup, which can then be used in the mailing process. For instance, you can ask for users’ country of origin, and then down the road, if you’d like to send a newsletter to all users from a particular country, it’s a snap — that data is already stored.

Integrating PHPList signup and address management pages into a Web site’s existing design is simple, since PHPList templates are fully customizable. You can even apply different templates to different messages and signup pages.

Using the Free PDF Library, PHPList can automatically create and attach messages as PDF files to ensure that formatting and graphics are kept intact.

PHPList lets you track the messages you send, so you can tell how many of your users actually opened a message. You can also specify a certain time or date for a newsletter to be sent, and PHPList will wait until that moment to send it.

The software includes some email bouncing tools that try to prune unused and nonexistent email addresses. In my time using the program, it managed to kick out 95% of the fake addresses I tossed in there. There are options for some advanced bounce handling tools, which help distinguish between situations such as “this email address has never existed” and “this email address may be experiencing some slight downtime.”

Users too can control PHPList’s behavior. For example, at any time a user can choose to opt out of receiving a newsletter. Users choose to receive messages in full HTML or text-only mode. They can also change almost all of their information on record — name, location, interests, even their email addresses.

I’ve found very few disadvantages with PHPList. Some could make the argument that users should be able to reply to any of the newsletters, but then you’re getting more into the territory of Mailman, which is an actual email discussion application, somewhat different from PHPList. I found the bounce handling a bit confusing at first, but looking at the different documentation resources proved to be a help. There’s a slew of FAQs and documentation, as well as an entire community of people to ask for support. After exhausting those resources, you can resort to the paid support from tincan, the product’s sponsor.

All in all, PHPList is a versatile and easy-to-use application for managing newsletters and mailing lists.

Simple polling with LimeSurvey

Tuesday, June 5th, 2007
Note: This article was originally published on June 05, 2007 (8:00:00 AM) over at the Linux.com. A still-breathing version of the article can be found at Linux.com.

Setting up a survey on your Web site can be a simple task with LimeSurvey, a flexible and easy to set up tool for conducting a survey.

The LimeSurvey project began in 2003 as PHPSurveyor. Last month the project was renamed LimeSurvey in order to make licensing easier by not including PHP in the title.

You can try a demo of LimeSurvey or download the full application.

A typical LimeSurvey installation requires a server with PHP installed, as well as a MySQL database to store the data in. If you’re wary of going setting it up yourself on a server, many hosting companies offer LimeSurvey installations, such as Hummingbird Hosting or UCHosting. Both of these hosting services allow users to set up a survey script with minimal work.

To manually set up LimeSurvey, you must have a server that has PHP 4.2 or later installed, along with the mbstring (Multibyte String Functions) library, and a MySQL (4.1 or later) database for LimeSurvey to store data in. To take advantage of LimeSurvey’s token system, you need to have the LDAP Library installed in PHP. The script itself takes up about 10MB of disk space.

Installing LimeSurvey just requires uploading the survey software to a directory of your choice, editing the project’s config.php file and making sure all the necessary fields — such as database name, location, and email settings — are filled in. Once they’re set, run a simple installation script by navigating to it with your Web browser.

If you’re familiar with HTML, you can easily create custom templates to give your surveys a similar look and feel to the rest of your site. If you’re not, there is a template editor function built in to LimeSurvey that allows you to create a custom template for your surveys.

LimeSurvey’s flexibility is its main driving point. The software is offered in a total of 19 different languages. With LimeSurvey, you can have out an unlimited number of surveys at any time. You can set different surveys to be public or private, and allow users to take a survey multiple times or only once via a “post once” token. LimeSurvey supports many different question types, ranging from the simple Yes or No variety to choices such as 10-point scales, open-ended answers, or dropdown choices.

With most of the question selections, you can opt to include a field for users to describe why they chose the answer they did. You can branch a survey out by setting certain choices and questions to appear in response to earlier decisions. There is no limit to the number of questions you can include in a survey, and the program also offers ways to automatically email, notify, or invite users to a survey, or to remind them to take it if they’ve not already done so.

You can view your data and results from within LimeSurvey, or you can back up the data by exporting it to simple text, CSV, or Excel files. Exporting to an XML format is not yet available, though it is listed on the road map for LimeSurvey version 2.

Users can choose to stop the survey and continue at a later time, keeping their data intact and ready upon their return.

My testing didn’t uncover any large faults in the software, but if you need it, you can get support in a number of ways. The project provides an online documentation wiki. You can visit the project’s online forum to ask a question, where most likely a developer or knowledgeable user can help you out. You can also visit IRC channel #limesurvey on irc.freenode.net, which many users frequent, and many are willing to help out. If your need for support is more pressing, you can email a member of the project, but if you do this they ask that you donate a small sum to the project.

If you’re in the market for a survey tool, LimeSurvey is one of the best choices around. It has excellent usability and support, and when you take into consideration that some hosting companies offer packages with it pre-installed, as well as it’s large list of features, it becomes apparent that LimeSurvey is quite possibly the most flexible, easy to use choice to make.