Hacking Brains

The power of our brain to just get it.

Bobby McFerrin demonstrates the power of the pentatonic scale, using audience participation, at the event “Notes & Neurons: In Search of the Common Chorus”, from the 2009 World Science Festival, June 12, 2009.

Low Power Software

I am a climate change skeptic.Seems like I am not alone in thinking that power-efficiency is a system issue that includes both hardware and software. A recent article at ACM shows that other leading processor architects are also thinking along the same lines. So, I ask myself what am I going to do about it. Due to recent events, I now find myself with a bit of free time. Therefore, I think that I will put my free time to some work by trying to do some interesting things.

Firstly, I will rework my existing processor into a more power friendly design. What I mean by this is not that I will make it lower in power, but I will try to make some changes to it so that the processor’s power distribution and consumption can be intelligently controlled by software. At the barest minimum, this would mean adding a programmable power and clock manager into the core. It could also potentially include lower power but slower computational units that can be used for less critical operations.

Secondly, I will try to modify Icarus Verilog to output some power information. It would not be possible to output accurate power results because power is highly dependent on manufacturing technology. However, regardless of technology, it could possibly output relative power information. So, I could possibly use it to test out different code paths that produce the same results in a similar time period but with different power profiles.

Thirdly, if I have the resources, I will try to make changes to LLVM to facilitate power information. This will probably take a bit of doing as the LLVM compiler is a pretty complicated piece of software. Using the information garnered from the simulator, I could possibly output relative power measures for different types of code. This will be a good first step towards generating power efficient code. Of course, the ultimate aim would be to have a -Op power-optimised flag that will automagically trade-off speed for lower power.

Fourthly, now this is stretching it, I will try to write a nano-kernel that is power optimised. This may just be as simple as automatically putting the processor to low power mode when the running task is idle and waiting on user input. It may also be as complicated distributing tasks over a bunch of heterogeneous cores taking power considerations into account such as sending less critical tasks to cores running at lower power configurations.

Now, if anyone thinks that this indicates that I have succumbed to being an eco-mentalist – you’re absolutely wrong. I still belong squarely in the skeptic camp. However, I do believe that efficiency is important – actually any engineer can tell you that the whole purpose of engineering is to increase production efficiency. I do believe in being more efficient, not for the purpose of saving the planet, but for the purpose of engineering elegance.

So, let me start this today.

Mildly Autistic?

http://video.ted.com/assets/player/swf/EmbedPlayer.swf

I just watched this video description of autism. Then it struck me that I do think in some of the ways that she mentioned. For example, when I design a microprocessor, I simulate the entire functioning of the processor inside my head throughout the process – from the pre-design stage through to the debugging stage. I only rely on the software simulation tools to verify that my design works the way that I thought that it would. I don’t use it to find out how my design works.

I noticed the small ‘S’ first before noticing the larger letters. My colleagues at work sometimes say that I go crazy over the details. I notice detail and I pay attention to them. I cannot stand wrinkles and I just need to smoothen them out. That is the reason why I pick on so many little things. My colleagues just consider me a perfectionist.

Also, I have some real social problems – I consider myself thoroughly socially inept. Faux pas aplenty. Maybe not so mild then.

Crossing Hurdles

Yatta!I am rarely wrong and I hate being wrong. However, I am only human and I do get things wrong sometimes. I will also accept criticism with an open heart and open mind, if and when I am wrong. When I have done something wrong, I will usually try my best to correct it. It may take me a while to get things right, but I will endeavour to make the necessary changes. It makes me extremely happy when my corrections are acknowledged and found to be satisfactory.

One stage of my life is coming to an end while another stage is just beginning. Things could have gone very bad for me but I am glad that they have turned out fairly well. While I do not regret the path the I have chosen, this journey has been an arduous and long one. I will never recommend it for anyone else, unless they are brave or dumb enough to plunge headlong into the unknown without regards for consequence. Paths are opening up where there were none before.

I have had to make some sacrifices along the way and lost some people in the process. However, I do hope that it will all be worth it when things are finally cut, weighed and measured. I am getting a bit too long winded now. Let me end this by wishing Cecilia all the best and good luck!

PS: I must do something to celebrate – like maybe buy myself a new 50″ television.

HP are Liars Slow

I called up HP today to find out why my Streamyx connection has not yet been upgraded and was told by them that I had to call up Streamyx myself to upgrade my line. What kind of nonsense is this? When I registered and was explained the entire process, I was told that HP would handle everything. Last week when I called up HP to check, they said that it will take a few days to upgrade and I should wait a bit and call up again if it is still not done by this week. And today HP tells me that I need to handle it myself.

WTF?!

I gave the customer service agent a piece of my mind. I do not want to have to pay HP for my Streamyx next month and pay TMNet for my Streamyx as well when I only get 512k! That is making a double payment for a non-service. If that happens, I will need to call up my bank and find out how I can cancel/delay payment for my HP purchase. They have failed to deliver the 1Mbit line that I am supposed to enjoy. They have openly advertised the 1Mbps streamyx package and if they fail to deliver, I am well within my rights to do something about it.

I’m just pissed off today. I hate idiots.

UPDATE@2010-02-24: After chasing them a couple of times today, my speed seems to be up tonight. It’s a bit sporadic but I am consistently getting 1M speeds on speed-test. That is good.

I might have been a bit too harsh calling them idiots. Maybe they were just slow or maybe it’s part of our culture to need to push to get things done.

Adventures in XenServer

Over the weekend, I began to move my home cloud system over from OpenVZ to XenServer. I thought that I should chronicle a few lessons learned here. Some of this information is just not available on the Internet and some of it are my personal opinions about the pros and cons of the two different virtualisation platforms.

Initial Installation
The initial installation for both OpenVZ and XenServer was pretty straight-forward. For XenServer, both the base ISO and Linux additional ISO were needed during installation. Fortunately, they can both be burned on the same CD-RW, one at a time and used one after the other. So, there is no need to use two blank CDs to install it.

However, the two platforms could not be more different when it came to configuring the systems. I was totally lost in XenServer because it is quite different from using a regular Linux system. There were a lot of very new concepts that I had to quickly pick-up. For example, everything needed to be identified by UUID because there is no other easy way to do it. Xen abstracts everything away so that it can be managed automatically without too much user intervention.

Lost in Lenny
I needed to run Debian Lenny as the guest OS for all my cloud servers. In OpenVZ, all that was needed was to download the Lenny template and generate a new server with it. However, the Lenny template on XenServer does not produce a running system but instead, runs a net-install.

At first, I tried to follow the instructions given on the Xen website to download and build a Lenny installation ISO to be used to install Xen. However, it turns out that it is much faster to just do a basic net-install over the Internet than to download and use an installation DVD. So, that was the path I took instead. Since I have a local apt-mirror running, it was a breeze to install and generate a number of different templates.

I do not understand why Xen did not ship with a bunch of Debian templates. It ships with a whole bunch of other templates. I managed to generate three templates corresponding to the popular VPS packages offered online – 64MB, 128MB and 256MB. I will try to share my pre-generated templates once I figure out how to get that done.

Size is Relative
I learned that 64MB is not actually 64MB in both OpenVZ and XenServer. Due to the way that these technologies emulate memory, they perform very differently under different circumstances. This is very obvious in low memory configurations. I could barely run any services on a 64MB OpenVZ server but I could run a whole bunch of services on a 64MB Xen server.

After doing some reading, it all comes down to how memory is allocated and committed by each technology. I might be wrong but it turns out that when an application asks for memory on OpenVZ, that memory is reserved for it. However, on Xen that memory is only reserved when the application uses the memory.

Toy Cloud
After my initial toying around, I would have to say that Xen seems more like an enterprise product while OpenVZ is not so much. In the year that I have been using OpenVZ, I managed the guest servers as if they were parts of the host server. However, in Xen, I am forced to treat each guest server as its own server. In fact, technically, the Dom0 and DomU Xen domains are technically peers.

Overall, I am quite happy to say that I have a very good impression of Xen and I will continue to use it for all my future cloud needs.

Penetrating Evidence

Seems that our Malaysian judges are once again at the fore-front of setting dangerous precedents. According to the article in TheStar, proof of penetration is no longer required for charging someone with the act of unnatural sex in Malaysia. That is like saying that penetration is unnecessary to charge someone with rape. All that is needed is witness testimony and forensic evidence that semen was found.

Personally, I think that it is a dangerous precedent to set. There are all manner of ways in which semen samples can be found on a person and none of them require any form of copulation, natural or otherwise. However, I think that the law is quite specific about what it considers as unnatural sex.

377 – Bestiality
Voluntary carnal intercourse with an animal. Penetration is sufficient to constitute the carnal intercourse necessary to the offence described in this section. (Maximum penalty: 20 years imprisonment, liable to fine and whipping)

377A – Carnal intercourse against the order of nature
Sexual connection with another person by the introduction of the penis into the anus or mouth of the other person is said to commit carnal intercourse against the order of nature. Penetration is to be sufficient to constitute the sexual connection necessary to the offence described in this section.

377B – Committing carnal intercourse against the order of nature
Whoever voluntarily commits carnal intercourse against the order of nature shall be subjected to punishment. (Maximum penalty: 20 years imprisonment, liable to fine and whipping)

377C – Committing carnal intercourse against the order of nature without consent
Carnal intercourse against the order of nature on another person without the consent, or against the will, of the other person, or by putting the other person in fear of death or hurt to the person or any other person. (Maximum penalty: 20 years imprisonment, liable to whipping, minimum sentence of 5 years imprisonment)

377CA – Sexual connection by object
Sexual connection with another person by the introduction of any object into the vagina or anus of the other person without the other person’s consent. However, this section does not extend to where the introduction of any object into the vagina or anus of any person if carried out for medical or law enforcement purposes. (Maximum penalty: 20 years imprisonment, liable to whipping and fine)

377D – Gross indecency
Any person who, in public or private, commits, or abets the commission of, or procures or attempts to procure the commission by any person of, any act of gross indecency with another person, shall be punished with imprisonment for a term which may extend to two years. (Maximum penalty: 2 years imprisonment)

377E – Inciting a child to an act of gross indecency
Any person who incites a child under the age of 14 years to any act of gross indecency with him or another person. (Maximum penalty: 5 years imprisonment, liable to whipping)

Seems like the words penetration appeared a lot of times in the penal code. In fact, the law seems to clearly spell out what it means by unnatural sex – putting ones penis into the anus or mouth of another person. Now, unless I am mistaken, there is no way to prove that carnal intercourse happened if medical evidence of penetration is discounted. I am so confused but IANAL.

I think that Anwar has just gotten a figurative one up his arse from the judges.

PS: Turns out that the only people legally allowed to shove things up your ass are people in the medical and law enforcement fields (now, one wonders why cops should be allowed to shove things up your ass). Also, turns out that video evidence of the act is insufficient to take action against known offenders such as Chua Soi Lek who definitely had his penis inside a woman’s mouth at one point.