Hamlet Tricks

Mar 11 2011

Like Odysseus, Shakespeare’s Hamlet played the role of the trickster to fulfill his mission. “How now! a rat? Dead, for a ducat, dead!”, Hamlet yells, when he suspects a spy, putting his sword through the wall. How about the play within the play where the king is poisoned? Then there is the incidence where he writes off two of his best friends and joins a pirate ship.

As in the Eternal Sunshine of the Spotless Mind,  Hamlet has overwritten parts of his memory several times. Each time, things happen differently, and he forgets in order to remember the parts relevant at present. What is left, what I believe about the past, is it the present or the past?

What actually happens in Hamlet is a scene being played over and over again in the mind. Hamlet is attempting the perfect revenge.  Each time, more characters are erased from memory, until an underlying factor turns.

Here, thou incestuous, murderous, damned Dane,
Drink off this potion. Is thy union here?

Hamlet finally comes to peace of mind.  Seen in this light, every single event in the play had a totality, beyond good and evil.

No responses yet

From Reiser3 to Reiser4 and Uncertainty Beyond

Mar 10 2011

Reiser3 was the first Linux filesystem with journaling and received mass adoption in the period of 2001-2006. Reiser4 is designed with lessons learned from the mistakes in Reiser3. It is still the fastest Linux filesystem.  That is without filesystem compression. Reiser4 has been around since 2001, but it has never been accepted into the Linux kernel. It is a testament to the failure of a free society to recognize greatness. The Linux kernel maintainers are still human.

Before Namesys

Reiser was about 12 years old in high school when he was accepted into Berkeley. He studied on and off, working at companies like IBM, before earning a degree at middle age. The development of Reiser3 and Reiser4 can be traced to his senior thesis, in which he studied the difference between computer science and empirical sciences. As a result, Reiser3 and Reiser4 were exceptionally fast filesystems, because ideas conventionally regarded in computer science as junk were given a second chance.

To start Namesys, Reiser went to Russia in 1993 and hired a team of programmers. Russia had just come out of a huge failure. To summarize the period:

The Russians are just taking into their hands the ashes of incompetent industry, collectivized farming, Stalinist paranoia, military machoism, the Gulags, Leninist madness…

They turned out to be the best programmers that money could buy, full of bright ideas.

Reiser3 (ReiserFS)

When I used Windows 95/98, I remember those colorful screens and the long wait. It turned out the OS was checking the filesystem, because it didn’t shut down properly. So is there a way to make it start faster and not loose any data? Reiser3 was the first Linux filesystem to implement journaling, one method to solve both problems. With Reiser3, data centers did not have to worry about loosing power, even just for 1 second.

Major Linux distributions all offer Reiser3. SourceForge was hosted using  it, and Novell made it their default filesystem. Since then, there has been a decline due to kernel locks used extensively, resulting in non-concurrent operation on multi core systems. However, there are patches, because Reiser3 users still haven’t switched.

Reiser3 development was funded by DARPA and Linspire. Another source of funding when it was included with the kernel was database implementations.

Reiser4

Reiser4 is a non-continuous increment of Reiser3. A Reiser3 filesystem cannot be converted to a Reiser4 one. This decision in itself reflects how continuous innovations are adopted quicker. For example, C/C++ are almost synonymous compared to C# and Objective-C. Switching to Reiser4 means compiling a kernel with it, formatting another partition large enough, and copying all the data.

However, the benefits of being non-continuous outweighs the costs. Reiser4 is designed to support an on-disk database, within the filesystem. This is implemented by using two separate layers, graphs for relationships, and trees for efficient searching. Reiser4 also implements extents, mapping a section of a disk to a file, which makes fragmentation non-existent.

Another feature is the plugin system, where a userland SQL interface can be placed. Kernel developers argued for moving it to VFS, while Reiser insists on keeping it as part of the filesystem. There are many other reasons why Reiser4 was not accepted into the kernel. The plugin system allows compression and encryption of the entire on-disk structure. LZO compression increases filesystem performance by two times, placing Reiser4 head and shoulders above the rest.

Whereas Reiser3 became the standard journaling filesystem,  Reiser4 had no special feature associated with it. Being the best filesystem at the time, Reiser4 was never included in the kernel. Compared with ext3, which still used an H-tree and had a double write penalty for journals, Reiser4 was better technology-wise. If Reiser3 was adopted for data-loss protection, then Reiser4 needed a similar reason. An interesting application for the graph layer is a Baynesian network. It would have high scalability and performance due to its on-disk structure, and could be sold as an out-of-box solution, like Google Search for Enterprise. Such a product would have applications in real-time business analytics, data warehousing, and as a component of a CRM system.

The End

Now as Reiser4 has been forgotten for 4 years, you may wonder how the story ended. Sadly, the story ends with a telltale heart, which I saw as a play and now in real life. Reiser must have liked Lord of the Rings a lot, since he used metaphors in his talks. It’s usually popular with Dungeons and Dragons players, or Linux fans. The terminal is another way of seeing the world.

No responses yet

Ron Tite at UW

Mar 04 2011

Ron Tite’s talk last Tuesday was both educational and entertaining. Some key points he made were about how organizations work, the power each individual has in a digital society, and whole brain thinking.

Organizations are People Driven

Decisions within organizations are made on an individual level. Each day, hundreds of decisions are made. The successful organizations adapt and evolve. He gave examples using the most popular brands, of these brands:

  • IBM no longer sells computers
  • Microsoft is now focused on cloud computing and cloud services
  • McDonald now sells salads

Google is relatively new on the list. The people driven organizations are able to evolve, rather than sticking to the status quo and maintaining the bottom line.

Digital Requires Perfection

Because machines do exactly what they are programmed to do, humans must become more machine like in a digital world. No transaction (searching on Google, commenting on Facebook, sending an email) happens without being recorded forever. He told a story from personal experience. He lost his luggage when he got off the plane with Air Canada, so he posted on facebook and Twitter about it. After several phone calls to ask for the luggage and more posts, he gets 415 people on facebook saying, “Give Ron Tite His Bag Back“.  The story ended with the CEO of Air Canada sending a replacement (gift) bag for what he might have carried, a few minutes after getting his own bag back.

Brands Last, Technology Changes

According to him, the funniest line in stand-up comedy is in There’s Something About Mary.

Hitchhiker: You heard of this thing, the 8-Minute Abs?
Ted: Yeah, sure, 8-Minute Abs. Yeah, the excercise video.
Hitchhiker: Yeah, this is going to blow that right out of the water. Listen to this: 7… Minute… Abs.
Ted: Right. Yes. OK, all right. I see where you’re going.
Hitchhiker: Think about it. You walk into a video store, you see 8-Minute Abs sittin’ there, there’s 7-Minute Abs right beside it. Which one are you gonna pick, man?
Ted: I would go for the 7.
Hitchhiker: Bingo, man, bingo. 7-Minute Abs. And we guarantee just as good a workout as the 8-minute folk.
Ted: You guarantee it? That’s – how do you do that?
Hitchhiker: If you’re not happy with the first 7 minutes, we’re gonna send you the extra minute free. You see? That’s it. That’s our motto. That’s where we’re comin’ from. That’s from “A” to “B”.
Ted: That’s right. That’s – that’s good. That’s good. Unless, of course, somebody comes up with 6-Minute Abs. Then you’re in trouble, huh?
[Hitchhiker convulses]
Hitchhiker: No! No, no, not 6! I said 7. Nobody’s comin’ up with 6. Who works out in 6 minutes? You won’t even get your heart goin, not even a mouse on a wheel.
Ted: That – good point.
Hitchhiker: 7’s the key number here. Think about it. 7-Elevens. 7 dwarves. 7, man, that’s the number. 7 chipmunks twirlin’ on a branch, eatin’ lots of sunflowers on my uncle’s ranch. You know that old children’s tale from the sea. It’s like you’re dreamin’ about Gorgonzola cheese when it’s clearly Brie time, baby. Step into my office.
Ted: Why?
Hitchhiker: ‘Cause you’re fuckin’ fired!

So the Brick advertises blowout prices just after Boxing Day. Poor advertising consistent with worthless furniture. Successful advertising is in alignment with core values. He mentions being genuine among other ones, which seems to be a message from the same movie.

When New Coke came out, people took it for an poser.  Old Coke with the new formula is actually what is now on the market. He mentions paying tax for firefighting and some hesitation about actually getting rescued by a firefighter due to connotations with being womanly. In the end, what’s real and what’s not is vague. It just depends on what works. Organizations adapt to it.

He definitely had some points to make, as he did bring his notes. Overall, the talk was crazy. I mean it felt like taking a tour of a 3-year old’s playroom, but that craziness amounts to a lot of laughs.

No responses yet

Poetry in its Many Forms

Feb 28 2011

Zen Master – Koans

Singer/Songwriter –  Lyrics

Programmer – Haiku style code

Squirrels – Symphony of the crows

Birds – Personal twitter feeds

Spring – The sound of the stream

No responses yet

Canada Again

Feb 20 2011

During reading week, I was reading the Blue Ocean book, where Cirque du Soleil featured on the first page. Another day, reading the 2010 edition of Discover Canada, I came across some circus band with a group of uniform band members floating up into the air. Another guy featured in the center, dressed in a French flag, pointed his finger at the audience. That must be Canada, I thought. The caption: Cirque du Soleil. At that moment, all the facts matched up. Later, I found out it was the same group mentioned in the other group. It never occurred to me they would be Canadian. I always imagined traveling circuses as an American phenomenon.

No responses yet

The Enigma of Hitler – Salvador Dali

Feb 19 2011

As surreal art sells high on Google today, I’d like to share some some pipings about one.

dali16

The Enigma of Hitler by Salvador Dali

The wilted tree of life with branches cut off represents the material plane not being rooted in the life. This is emphasized by one end of the tree being cut off in the painting.
Hitler is represented as a torn photo. There are several peculiarities to note. Only this object has a recognizable face in the painting. It is an image within an image. Hitler is drawn in a style more real than the entire painting. The painting is in a surrealist style, while Hitler is drawn as in a photo.
The plate itself is surreal. It could represent an amphitheater, as a reference to where echoes make reality. Most people who have not seen Hitler have a common image conjured. He is in fact a dictator everyone has experienced in their personal life, whether in practicing self-control or in their desire for mastery.
Another way to look at this is as the metal plate behind a speaker. Either way, Hitler has a hypnotic influence on the crowd by the way he uses words.

The circular cycle

The bat aims at Hitler, which leads to the bean. The bean is reflected on the tree of life, representing moral decay. The bean is hung as a hat on the tree, from which a large drop of water, perhaps a tear, is about to drop onto the plate. The result is reflected outside the plate. We could say the result was already there before the plate appeared on the scene. If the plate is to represent Hitler’s ability to control minds, then the he speaks to something already within the surreal landscape of people’s minds.

The Figure and Umbrella

Who is the shadowy figure emerging out of the transparent umbrella? In the context of the painting, she would represent society. Around the time Hitler comes to power, unemployment skyrocketed. The primary purpose of society is to provide support, a way of life, for everyone. When this is not fulfilled, many plow deeper to look for black, furtive soil to plant seeds of hope. This comes in the form of a plate with Hitler on it.
Hitler had the answer to everyone’s problems, a typical answer. It’s commonly repeated in textbooks, “the Jews”. Just how did this insanity get out of hand? It’s a collective insanity, so common that if you did not agree with it, you could be killed. If everyone else believes in it, then it must be true.
This is the food backed with logic, brain food, which Germans at the time feed on. At this moment, the result has already happened in. Great Sorrow crystallizes as the raindrop. Seemingly out of nowhere.
The fact is that there is an umbrella and that the woman, representing society itself, could shield the drop of water from the plate. This reflects the fact that society is often able to shield the sorrow behind the collective illusion. A clear example can be seen in the case of communism. The idea behind communism is that a communal heaven emerges in the future by sacrificing the present. When an entire country believes in it, the country is under the rule of a dictator shielded by an umbrella.
they do not notice their own poverty.
They do not notice their own poverty. They lived in poverty, and did not know it.

. . . When you know yourselves, then you will . . . But if you do not know yourselves, then you live in poverty, and you are the poverty.

3 responses so far

How Different Programs View Computers

Jan 24 2011

comic

Point of views:
Engineering – nothing special here. Engineers know enough of science and chemistry to build a computer if civilization was destroyed. A common pitfall is not being able to control their thoughts. They rely on drinking to get a good night’s sleep, maybe due to too much responsibility and stress. Many of them carry this behavior into work life. To illustrate, the Engineers at Google drink on the job.
Computer Science – these guys run into more trouble with their computers than anybody else. Hence, the hammer is well deserved. The cutting edge of technology is more often the bleeding edge. It hurts.
Scientific – acids are the way to recycle computers. The guy must be an evil genius to come up with this method.
Religious – Note: the screen is glowing red. Use some water to put out the fire?
Drama – watch some movies, eat, or sleep? Can’t decide which.
Philosophical – perhaps the most beautiful of all. Given a computer, philosopher might ask, what is real? Might I not be interacting with a computer program? Is my entire life a simulation? What parts of the mind is real? What am I? If the ego is all I am, is it not easily replicated?

No responses yet

Course Explorer Refresh, with Inspiration

Dec 23 2010

Coursetree 1.5

screenshot.21

New Features:

  • Successor relationships
  • Textbooks by ISBN from the bookstore
  • Department requirements
  • 2 clicks at most to look up information on a course
  • Intelligent back button behavior
  • Links to Wikipedia
  • HTML5 semantic markup

Bugfixes:

  • All issues listed in the previous release notes
  • Phrase “one of” being missed by the scraper
  • Parser can handle phrases such as “taken prior to”
  • M(y)isunderstanding regarding commas corrected
    • CS 136 or 145, MATH 135
    • now becomes (CS 136 or 145) and MATH 135
    • should see more prerequisites listed as a result
  • Courses being overwritten by labs

Bugs:

  • A couple of quirks showing up as errors in the parser
    • EARTH 121, 121L or 122, 122L should be interpreted as EARTH 121/EARTH 122
    • CHEM 264 or 28/262 should be interpreted as CHEM 264/CHEM 282/CHEM262
  • Courses overlapping in the prerequisite graph

Waterloo Course Planner has been tested and works on IE8, Firefox 3.6, Chrome 9, Safari 5, and Opera 11.

No responses yet

ASAP Loading with LABjs

Dec 02 2010

Plan 1

Let’s start off with some dull code to introduce the subject:

//<![CDATA[
base_url = 'http://localhost/';
//]]>
function loadfile(filename, filetype){
    if (filetype=="js"){
        var fileref=document.createElement('script')
        fileref.setAttribute("type","text/javascript")
        fileref.setAttribute("src", base_url + 'js/' + filename + '.js')
    }
    else if (filetype=="css"){
        var fileref=document.createElement("link")
        fileref.setAttribute("rel", "stylesheet")
        fileref.setAttribute("type", "text/css")
        fileref.setAttribute("href", base_url + 'css/' + filename + '.css')
    }
    if (typeof fileref!="undefined")
        document.getElementsByTagName("head")[0].appendChild(fileref)
}

A typical base template for loading the CSS and JS files using Django:

<!-- CSS Files -->
<script type="text/javascript">
var css = {% block css %}{% endblock %};
for (i in css) {
    loadfile(css[i], 'css');
}
</script>

<!-- JS Files -->
<script type="text/javascript">
var js = {% block js %}{% endblock %};
if (navigator.userAgent.indexOf('MSIE') != -1){
    js.unshift('iespecial');
}
for (i in js) {
    loadfile(js[i], 'js');
}
</script>

The actual template for the page specifying the files only needs to be two lines long:

{% block css %}['glaze', 'fancy']{% endblock %}
{% block js %}['jquery', 'yui', 'dojo']{% endblock %}

As the bootstrapping code cannot use any libraries itself, this is definitely as manageable as it gets, unless you prefer to merge CSS and JS files into one array. That would acually add more bloat with the ‘.css’ and ‘.js’ extensions. Except there’s just one minor bug with the smaller files being loaded first, resulting in “Uncaught ReferenceError: $ is not defined” for JQuery’s document ready.

Plan Z

The problem with the above scheme is that the files are loaded asynchronously, all at the same time. The usual script tag loading ensures the files are loaded in order. So is there a way to load them asynchronously and still make sure dependencies are met?
The idea is to check document status for complete, then load files that depend on them. LABjs does just about everything I expected. Except it wouldn’t load itself. So to put it all together, I used a mini-loader for LABjs itself. The design decision here is to keep the code As Short As Possible. Code for generating script tags only fits into the template in the MTV pattern. Naturally, JavaScript turns out to be be the best way to load JS files, offering more features than traditional loading schemes with server generated headers. Now, this is all I have to manage with the dependencies:

{% block js %}
.script(get_abs_url('framework')).wait()
.script(get_abs_url('plugin.framework'))
.script(get_abs_url('myplugin.framework')).wait()
.script(get_abs_url('init'));
{% endblock %}

No responses yet

Course Explorer Released, Bugs Known

Nov 14 2010

Coursetree 1.0

screenshot.1

Features:

  • All of the courses in the course calendar, categorized by department
  • Displays course title and description
  • Color codes for the time of the year a course is offered
  • Less clicks to look up information on a course
  • Draws prerequisite diagram
  • Nodes can be toggled to show an alternative list of prerequisites

Bugs:

  • Some courses were rejected by the scraper
  • Some courses are missing prerequisites, possibly a parsing issue
  • Due to the above two bugs, some prerequisites won’t show
  • Some nodes at the bottom of the prerequisite tree appear to be transparent

Recommended browsers for Waterloo Course Planner: Firefox, Chrome, and Opera.

No responses yet

« Newer - Older »