Monday, March 01, 2010

Directing Attention

Its astonishing, how little control we exercise in directing our attention. We usually let it go where it wants to; attracted, demanded or manipulated by external sources.

Today, on my way to work, I chose to direct my attention to the shadows cast by the late afternoon sun. I noticed the beautiful silhouettes made by the shadows of trees, flags and the birds flying above. They were always there, but I had never seen them before.

Its scary the amount of detail our senses leave out.

Tuesday, February 23, 2010

The Art of Achieving

In a cafe mocha (from Barista of course) induced moment of clarity in the middle of the night this Monday (22 Feb, 2010) , I finally understood why, for a while now, I've had this nagging running-in-place-and-not-getting-anywhere feeling. With this new insight, I came up with a simple Personal Accomplishment System for myself. I'll be posting more on this soon, but first I need to check if it works for me.

Thursday, January 14, 2010

Setting up an offline dictionary on Ubuntu

Note: I'm running Ubuntu 9.10 (Karmic Koala)


There are two ways to do this that I know off:

Install Artha, an off-line thesaurus based on WordNet
sudo apt-get install artha


Or, you can configure Dictionary to use a local dictionary server

Install a local dictionary server and required dictionaries and thesaurus:
sudo apt-get install dictd dictzip dict-wn dict-foldoc dict-jargon dict-gcide dict-moby-thesaurus

Configure Dictionary to use the local dictionary:
Application > Office > Dictionary
Edit > Preferences
Add a new source using 127.0.0.1 as the Hostname and select it as your default source.


Hope that helps.

Monday, July 27, 2009

Renamed Swx to Bombay

Apparently people are using the word Swx to refer to the SWX format (an open-source subset of the SWF format) which has an associated application called SWX PHP that might lead to confusion if I continue calling my project Swx.

Coming up with an alternative name for Swx, for some reason, brought back memories of the time Bombay (the city I live in and a name I loved) was renamed to Mumbai. I was toying around with the idea of calling my project Bombay and liked it a lot, so I went with it.

Friday, July 24, 2009

Routing in Bombay (WIP)

Default routes


Here are some examples that illustrate the default routes I came up with:

Example Request handler function
---------------------------------------
GET / _home()
GET /foo _show()
GET /foo?baz=qux _query()
PUT /bar _save()
DELETE /bar _delete()
POST / _post()
POST /login _login()
GET /users/ users_home()
GET /users/1 users_show()
GET /users/1?baz=qux users_query()
PUT /users/2 users_save()
DELETE /users/2 users_delete()
POST /users/ users_post()
POST /users/poke users_poke()


I chose *_save because it captures both the CREATE and UPDATE semantics of PUT. The other option was *_write() requiring me to use *_read instead of *_show for symmetry but that didn't feel right.

*_query was chosen over *_search and *_filter because its asking semantics is generic enough to be used in many different situation than the locating and removing semantics of the alternatives.

Catchalls


If none of the above handler functions are found, mapper.lib will fall back on the catchall handler functions.

Request fall-back-1 fall-back-2
---------------------------------------------
* /users/1 users_catchall() _catchall()
* /foo _catchall()


Update July 27, 2009: Renamed Swx to Bombay

Thursday, July 23, 2009

Make your time framework, index.php are belong to me!

I've stopped active development on Inertia primarily because developing web applications in it did not feel very PHPish. It felt as if the web application was subservient to the framework instead of it being the other way round.

Inertia was an experiment in how a Resource-Oriented Programming (ROP) Platform would look like and it was an awesome learning experience, but its time to move on.

Sunday, July 05, 2009

Describing Writting your web application using Bombay (take 2)

Scratch that! Screw describing the web application. Just decide for me and tell me what I need to do.


index.php

<?php

require '/path/to/bombay.php';
requires ('mojo');

function _home()
{
echo "Hello World";
}

?>


Trade-off flexibility for minimal cognitive strain and busy work.

Update July 27, 2009: Renamed Swx to Bombay

The problem with ugly, large and slow code

Bjarne Stroustrup in Masterminds of Programming:
"Ugly" leaves places for bugs to hide, "large" ensures incomplete testing, and "slow" encourages the use of shortcuts and dirty tricks...