Jon Aquino's Mental Garden

Engineering beautiful software jon aquino labs | personal blog

Sunday, June 24, 2007

RSS Feeds for Audio for New Testament, Old Testament

For people who want to read the bible cover-to-cover but are having trouble doing so, I have created RSS feeds for the audiobooks read by Max McLean: New Testament, Old Testament. Perhaps the combination of RSS and audio will make it easier.

Saturday, June 23, 2007

Circles of friends in the digital age

Using Google Blog Search, you can instantly get a list of blog posts by people who share your niche interests. I can find people interested in Xootr scooters. I can find people interested in Kreeft's Prayer for Beginners. I can find people talking about Bjork's Vespertine album. I check out these blogs and they're by people I wouldn't mind hanging out with. It reminds me of high school, when you find a circle of people interested in the same things you're interested in, and you sit down with them at lunchtime and talk about those things. Except with blog searches, the people are dispersed over thousands of miles, and they don't know you, and you don't really know them.

How can we use the existing infrastructure - blogs, blog searches, RSS subscriptions, CoComment comment-thread tracking - to set up online flash mobs - fleeting circles of people sharing a common interest, even for a few days, a few hours, a few minutes - tied together or finding each other via blog-search keywords? This is a strange twist on the meaning of friends - in this scenario, friendships are transitory, interactions short-lived, discussions asynchronous.

And it could use the existing network of blogs. People continue to write in their blogs as usual - some of them just have this optional new layer of interactivity with people with shared interests. I dunno - maybe it takes the form of a browser extension that monitors new blog posts and blog comments that you write. After you write your blog post, you immediately see pictures of a couple of people who have posted on the same topic. So you write a reply right there (it posts a comment to their blogs automatically) to the first person's post and to the second person's post. Meanwhile a couple more faces pop up - responses to some replies you wrote earlier. So it is a rapid-fire conversation - composed, under the covers, of comments and replies on various blogs - arranged on the screen in some clever way that lets you maintain context (perhaps comments from different threads are clustered on different parts of the screen). It is a chat room powered by blog commenting, focused on very specific interests of yours, drawn from the pool of all people who write blogs. It is the 21st century's friendship evanescent.

Friday, June 22, 2007

ActionScript for JavaScript (and Java) Programmers

Tips for JavaScript programmers working on an ActionScript (Flash) project:
  • ActionScript is like JavaScript but adds Java-like classes, interfaces, and packages (namespaces).
  • Most of your code should live outside of the Flash IDE. The only things in the IDE should be graphics received from designers. Convert those graphics into MovieClips and link them to classes that live outside of the IDE.
  • See that timeline across the top? You don't need it - you're writing your code outside of the IDE.
  • MovieClip is a poor name - it should probably be called Panel or Graphic. Every graphic that can be manipulated by ActionScript is a MovieClip.
  • MovieClip objects can define an onEnterFrame() function that is called 12 times a second. Avoid using it - it can slow down your program.
  • Use createMovieClip and createTextField to create new graphics and text programmatically. Use attachMovieClip to grab a graphic from the .fla (i.e. a graphic from your designer).
  • To modify a graphic received from your designer (e.g. to set its instance-variable name), drag it from the Library to the Stage. Afterwards, you can delete it from the Stage - changes are always made to the "master" copy in the Library.
  • Use the Select Unused Items menu item to find graphics in the .fla that aren't being used. Delete them.
  • Use folders (in the "Library") to group related graphics. The IDE won't organize them for you - it doesn't show which graphics depend on which. Use folders to make up for this. For example, in my _PlayButton folder I have graphics named PlayButton, _Play, Button, Button (Hover), and PlayPauseIcon - all used for the Play button.
  • Since you are doing all your ActionScript programming outside of the IDE (right?), you can use your favorite text editor. I prefer jEdit; Flash-specific text editors include SePy and FlashDevelop.
  • Spend an evening skimming the solutions in ActionScript Cookbook. You can read this online at O'Reilly Safari.
  • Delegate and EventDispatcher are handy classes.
  • XRay is a kind of Firebug for Flash, letting you browse the Flash embed at runtime, even while it is running in a browser. Drag it into the IDE. It will add 30kb to your Flash embed. (You can remove it later).
  • You probably want to stick with ActionScript 2 for now, as ActionScript 3 requires Flash 9.
  • In the Flash IDE, open the Movie Explorer window to see what the .fla file contains
  • Use AsUnit to do unit testing.
  • Have two directories: src and lib. src contains your stuff: com/example/...; lib contains 3rd-party stuff: org/bigcrunch/ToolTip, etc. You'll need to add classpaths for these two directories.
  • Don't be surprised if you discover many annoying things about Flash, the Flash IDE, and ActionScript.

Thursday, June 14, 2007

Book: "Working Effectively with Legacy Code"

I'm on Chapter 7 of "Working Effectively with Legacy Code" (reading it online on O'Reilly Safari) and it seems like a useful (and entertaining) catalogue of techniques for working with ancient, untested, hard-to-understand code and making it unit-testable.

Check out these chapter titles and see if any sound relevant to what you are working on right now:

Chapter 16. I Don't Understand the Code Well Enough to Change It
Chapter 17. My Application Has No Structure
Chapter 20. This Class Is Too Big and I Don't Want It to Get Any Bigger
Chapter 21. I'm Changing the Same Code All Over the Place
Chapter 22. I Need to Change a Monster Method and I Can't Write Tests for It
Chapter 23. How Do I Know That I'm Not Breaking Anything?

Saturday, June 09, 2007

The slash as an alternative to the strikeout

If you're like me, when you write, your train of thought will constantly be interrupted by various thoughts – a great line for the title, an idea you need to remember to include, etc. Where do you put these ideas? Scribble them in the margins? Or on a piece of scrap paper (if you have one nearby)?

I've started to use slashes ("/"). If you need a place to put a thought, simply introduce a slash, write that thought down, then with another slash resume where you left off.

Slashes introduce temporary parallel universes in which you can / title: "The slash as an alternative to the strikeout" / store impinging thoughts. They are incisions in the space-time fabric – and you can create several of them if needed.

They are also useful for typos. Instead of striking out the type typo, which can look ugly, you simply /bannish/ banish it to a different universe with two slashes.

Yublin example: Compressing yesterday's blog post

Below is yesterday's blog post, written in Yublin. It brings the character count from 831 down to 618 – a 25% savings. I also found some cool Yublin compounds: xwing = writing, haxwing = handwriting.

Introducing Yublin (PDF cheatsheet), a cwha f t 600 ms qb ws in t English language. F use in journals, notekg, n xwing novels, j cwha system reduces t ms frequently bz ws to 1- and 2-et combinations ("cwcuts"). Cz convenient, cw fast, n cw fun!

(Kaed in generating Yublin cwcuts f yo language? Use t online fm).

How I generated t list. I started b a list of t 600 ms qb ws in English. I te proceeded to assign 1-et combinations to t ms frequent ws, lw by 2-et combinations f t rs. F t ms frequent ws, t algorithm tries to choose cwcuts h are similar (e.g., t for the, sh for sh, ng for ng). Cwcuts mt save at ls 2 ets, otwise k are discarded (thus th are no cwcuts f 1- n 2-et English ws).

Below are t Yublin cwcuts f t 100 ms qb ws. F t fu 600-wr list, see t cheatsheet (PDF).

Friday, June 08, 2007

Yublin shorthand for speed-writing

Introducing Yublin (PDF cheatsheet), a shorthand for the 600 most common words in the English language. For use in journals, notetaking, and writing novels, this shorthand system reduces the most frequently used words to 1- and 2-letter combinations ("shortcuts"). It's convenient, it's fast, and it's fun!

(Interested in generating Yublin shortcuts for your language? Use the online form).

How I generated the list. I started with a list of the 600 most common words in English. I then proceeded to assign 1-letter combinations to the most frequent words, followed by 2-letter combinations for the rest. For the most frequent words, the algorithm tries to choose shortcuts that are similar (e.g., t for the, sh for should, ng for nothing). Shortcuts must save at least 2 letters, otherwise they are discarded (thus there are no shortcuts for 1- and 2-letter English words).

Below are the Yublin shortcuts for the 100 most common words. For the full 600-word list, see the cheatsheet (PDF).

t - the
n - and
w - was
h - that
i - his
e - her
y - you
d - had
b - with
f - for
s - she
o - not
u - but
v - have
m - him
c - said
g - which
j - this
l - all
r - from
k - they
p - were
q - would
x - when
z - what
th - there
bn - been
co - could
ve - very
tm - them
mo - more
tr - their
yo - your
wi - will
li - little
tn - than
te - then
se - some
io - into
wl - well
mu - much
ab - about
ti - time
kn - know
sh - should
le - like
un - upon
su - such
ne - never
oy - only
gd - good
bf - before
ot - other
mt - must
ce - come
dn - down
af - after
tk - think
ma - made
mi - might
bg - being
ag - again
gr - great
ov - over
hr - here
ca - came
tt - thought
hf - himself
wh - where
fi - first
tu - though
wt - without
wn - went
aw - away
mk - make
ts - these
yg - young
ng - nothing
lo - long
sl - shall
ba - back
dt - don't
ho - house
ev - ever
ta - take
ey - every
ha - hand
ms - most
la - last
es - eyes
ss - miss
hg - having
ld - looked
en - even
hl - while
de - dear
lk - look
mn - many
lf - life
st - still

Wednesday, June 06, 2007

Cheatsheet for Speedwords shorthand system

An interesting lifehack I came across is Reginald Dutton's Speedwords shorthand system. It's based on Zipf's Law, which says that the most common words are relatively few. These are assigned 1- or 2-letter combinations, like the following:

b - but
p - can, be able to
v - you
z - as, than, compared to
zi - because
hab - ordinary
vo - willing

I've put together a 1-page cheatsheet of common Speedwords, as identifed in the delightful book Mind Performance Hacks.

Monday, June 04, 2007

Co-workers sought (programming)

The company I work for,, is looking to hire more programmers. If you, gentle reader, are a rockstar developer, a connoisseur of code, a poet of programming, I want to know. Because maybe, just maybe, you and I will be working together in the near future.

It is a burden to work with code suffering from convoluted logic, eating exceptions, and duplication; it is a joy to work with code that is clearly named and clearly designed. Take a look at the code I wrote for Ning Forums (PHP, JavaScript) and Ning Groups (PHP, JavaScript) – if it resonates with you, if on reading it you feel as one to a kindred spirit, do get in touch! And send me a pointer to some of your best work, either by email or in the comments.

Saturday, June 02, 2007

Software quote: "Complexity kills."

"Complexity kills. It sucks the life out of developers, it makes products difficult to plan, build and test, it introduces security challenges and it causes end-user and administrator frustration."

- Ray Ozzie

And of course, my favorite:

"Simplex sigillum veri (simplicity is the seal of truth)"

- George Polya

Askance: Email in a question, it emails you back an answer

I've created an experimental web service that lets you email in a question and it emails you back an answer. It's basically an email interface to the frighteningly accurate Brainboost search engine, which provides answers to natural-language queries.

Just put your question in the subject line and send an email to this address:

You will then receive an answer by email.

Why I made this.
I have a cell phone from Virgin Mobile Canada. It doesn't do SMS so I can't use Google SMS. And it supports email only. So I wanted a way to get answers from the web, on my cell phone, using email. A further limitation is that my cellphone displays only the first 100 characters of the message. So I wanted specific, 1-sentence answers. Brainboost was an obvious thing to try - and it works beautifully.

You can have a sort of conversation with Brainboost, over email. It's like a conversation with a long lost friend - or maybe a very smart professor - or at least someone who knows a lot of trivia:

How much horsepower in an Acura MDX?

Using a V - 6 engine, Acura has managed to boost the horsepower of the MDX from the 2006 models 253 to an impressive 300.

Why is Mars red?

Mars is red because its surface is largely composed of iron oxide (rust) and oxides of other minerals.

Who was the original voice of Mickey Mouse?

The original voice of Mickey Mouse was in fact Walt Disney himself.

Is there anything you don't know?

I dont know anything about MFC modal loops, but unlike some people, Im not afraid to find out.

Source Code: