Pixel City

You have got to watch the video to believe it. A night-time city-scape generated procedurally. If you don’t understand what that means, it means that the whole city is created using mathematical formulae. In typical games, environments like these would be laid out by hand. That is why, games look boring after a while because it is the same old thing ad nauseum. But if everything was generated with algorithms, merely tweaking some of the parameters and throwing some randomness into the mix will result in entirely different results. Granted, the present proof of concept is rather limited but it’s the concept that counts!

As for applications – both the XBOX360 and PS3 are fans of procedurally generated content. The PS3 certainly has enough computing power to create an entire city from scratch. So, it makes sense that gaming companies might want to take it up and create their own virtual cities on the fly. It would make the games interesting to even the developers themselves.

Kudos, Shamus!

Wesak Social Contract

one raceI’m copying ad-verbatim from Zubedy’s blog. I certainly think that it makes plenty of sense.

    We want a Social Contract that …

  1. Sees wrong as wrong and right as right, no matter who did it.
  2. No individual or community is left behind regardless of race or geography.
  3. We work towards zero poverty – it’s superfluous to have skyscrapers and state of the art structures when there are Malaysians who do not have a place to call home.
  4. Recognizes the Malay and indigenous customs form the core culture while the Chinese, Indian and other cultures play strong supportive roles to make our nation a unique and exciting brand.
  5. All Malaysian children receive a first rate education, every child is supported and encouraged to achieve his or her maximum potential.
  6. Encourages us to practice sustainable development without corruption.
  7. Allows us learn and appreciate our own religion while at the same time encourages us to understand the religions practiced by our fellow Malaysians.
  8. We help each other in business and transfer knowledge and skills from one community to another.
  9. Treats non-Malaysians serving in our nation, Bangladeshis or Europeans; with equality, respect and dignity.
  10. Does not introduce racism and division to our children at school or at home.
  11. We provide adequate health care for all.
  12. We look at our constitution as a whole and not pick and choose out of context to suit an argument.
  13. Do unto your Malaysian brothers and sisters as you would like them do unto you.
  14. Acknowledges that we are Many Colors, but One Race, Bangsa Malaysia

Purple Suit B

purplesuit

This is one of my purple suits. This is the blue-ish purple one, which is why I wore it with a blue shirt. I have another one that is a red-ish purple one with a slightly different cutting and design. In my opinion, the red-purple one has better workmanship and design than this one. But all in all, I think that I like both purple suits.

I wore this the other day, to attend a formal evening function with a strict dress-code. I noticed a few guys staring at my suit. I wonder if they were staring because of the colour or because of the design. Unfortunately, the ladies did not take notice in my direction. Hehe.

The reason that my face has been cropped out of the photo is because I am totally not photogenic. There is a reason why I am usually behind the camera, rather than in front. This is actually the first time this suit and I appeared in a photo.

In real life, it is not quite as purple. This photo looks a little more purple because of the camera flash. That is also the reason why the shirt looks terribly shiny. Under diffused lighting, it looks darker and more subdued. It was never my intention to stand out in a crowd.

And yes, this is supposed to be worn without the tie, which was the reason why I chose this design in the first place! I hate ties!

Going back to Linux

After spending the last month working on a Windows machine, I have decided to go back to using Linux in the office. If I have to use it under virtualisation, so be it. I have come to understand why trying to do development work on a Windows machine is a joke. Seriously, you won’t understand it until you have actually used Linux for real-world embedded development.

Let us just talk about this from an embedded developer perspective.

One word – Emacs. There are few integrated development environments that are as featured as Emacs. It has everything under the hood and more in its back pocket. Just like a woman, it takes a while to learn all the right moves but once that’s mastered, life will be good. Try comparing Eclipse or the piece-of-shit CodeWarrior that I have to use at work is laughable. While notepad++ shows some promise, it is but an infant compared to Emacs.

Two words – Code management. Windows does not come with any sort of code management system. Therefore, developers have developed a lot of bad habits over the years when it comes to working with code revisions such as the multiple-folder technique. Instead, Linux comes with a host of code management tools from the venerable RCS to the most modern Git. Once you have experienced the beauty that is distributed code management, it is difficult to go back to anything inferior.

Three words – Support Tools and Utilities. When you experience some trouble with some piece of code, you need to have a lot of support to solve it. Windows does not come with anything. For example, when you have some really cryptic C code that you need to understand, there’s always cdecl on Linux and nothing equivalent on Windows. Doxygen is truly a life-saver when it comes to the tedious work of generating mundane documentation, which every engineer hates to do.

Obviously, this just applies to a specific area. I’ve heard a lot of good things about Microsoft’s own developer tools. Unfortunately, those are not universal and are not suitable for use in embedded development. Maybe this is an area that Microsoft should take care of. However, they seem to have little incentive to do so as few embedded systems are bloated enough to run Windows.

Designing Power

i just liked the logoI mentioned to a friend of mine, the other day, that power is a system consideration. The traditional thinking in computer systems is that power is dependent on fabrication process, which is very true. However, it should not stop there. Hardware and software both play a role in optimising for low-power operation.

I can imagine some people going – what? While it makes sense that hardware affects power directly, it may not be so simple to imagine how software can affect power consumption until you realise that the operation of hardware is controlled by software. So, in order for hardware to optimise power usage, the software needs to be power aware.

Personally, I’m still waiting for the day when software compilers would be able to automagically compile software optimised for power. At present, they generally compile for either higher speed of execution or smaller memory footprint. It would be cool if there was a “-Op” compilation flag for GCC to tell it to power optimise the software.

Of course, the amount of power consumption used by modern microprocessors is often minimal, when compared against the power consumed by the entire system, including any analogue front-ends and display devices. However, if power budgets are tight, even saving a uA of current can help.

There are possibly more ways to do things but these are just off the top of my head. The ways in which software can apply power savings are several fold:

  1. It can choose to use substitute instructions with ones that consume less power. For example, a multiply can sometimes be substituted with a shift, which uses less power.
  2. It can optimise the use of memory so that less memory is needed and less memory transactions are performed. This goes beyond just optimising the use of cache memory.

Hopefully, someone will one day consider building a C compiler that is power aware. This may be a wonderful project for someone’s PhD. It would take a lot of experimentation to build up a profile of power consumption of each instruction. Then, it would take some thinking to find alternative algorithms to perform things with minimal power.

Borrowing from the Future

cash heaven

Although this is not a new phenomenon in the country, I have recently noticed some concerted effort at raising public funds through bonds. This only raises the hairs at the back of my neck. I have a gut feeling that tells me that this is not a good practice to keep up. Since I am not an economist, I casually asked an economist friend of mine about this last weekend.

I am of the opinion that our government is possibly having some cash flow problems, brought about by the stark drop in oil prices. Our last budget was planned on the basis that oil would stay at about $125 per barrel. However, it has dropped to less than half that value. Hence, it is very possible that our government is experiencing some cash issues.

So, the easiest solution out of this would be to issue bonds. Bonds are basically promises from the government to repay the money at a specific time in the future, with specific terms. Bonds are a good instrument for solving temporary cash flow problems as it is essentially what everyone does, borrow some cash to make more cash and then repay the loan with some interest.

But to me, this is borrowing against the future, to repay present debts. For some reason, my logic just cannot reconcile this positive feedback loop. If we are borrowing against the future, we are actually hedging that we will be able to repay those debts in the future. The trouble happens when we do not have enough cash to repay those debts, we will need to issue more bonds, to borrow even more money.

Somehow, I have a feeling that this is not sustainable and that the bubble will burst at some point. This is what our venerable TDM has described as ‘making money out of thin air’. Our government is literally ‘printing money out of thin air’. It is digging itself into debt with the rakyat. When it defaults, we are literally screwed because we have a vested interest in not letting it default.

Oh my, the picture just became even darker for me. I think that I should go run and hide away from all the Sukuk and Amanah Saham issues.

Living it Up

geeks shall inherit the earthWell, I’m never going to be able to live this down. My photo was broadcast to the entire company recently, during a company-wide gathering. Unfortunately, it was not the most complimentary photo. Honestly, I have never been very photogenic but this photo was down-right sad. This has been confirmed by all my co-workers.

One of my co-workers commented that I looked extremely depressed in the photo. Another one commented that I look extremely geeky. Overall, the consensus was that my saham jatuh (stock fell) in the company. Furthermore, I met a bunch of new people yesterday to discuss some stuff and one of the commented that he can visibly ‘see’ that I look very geeky.

So, I guess that the thing is that I just look very geeky. I’m pretty sure that it is not a bad thing. I look the way I feel, which is basically expressing myself truthfully. The pretenders will merely express ‘geek chic’ but would not actually be geeks. True geeks are very hard to find, particularly in a country like Malaysia. I hope to do something to change that at some point.

I have always been proud of being a geek. In fact, my master plan is to be the #1 geek in Malaysia. That is going to take a lot of hard work to achieve though. It is not very easy to be a true geek because a true geek isn’t about appearances. We can smell a fake one from a mile away. A true geek is about mastery of a specific area of serious study – in my case it is computers. The visual appearance is just an unintended side-effect.

Geeks are way cool!