Gallina

What a wonderful idea. Takes your GMail e-mail messages and turns them into Blog entries. The product is called: Gallina. Any message that’s starred (starring is a concept introduced in GMail that allows you to start certain important messages) becomes published and non-starred messages are just treated as draft! Wonderful.

Not sure how comments work though?

Line Tracker

I have a project due in few weeks. The idea of the project is that the LEGO mindstorm has to follow a black line on the floor.

So I started thinking about this problem and my initial approach was the following: I assume my robot starts ON the black line. So it starts traveling forward and continues until it finds white (which is the floor). At this point it has to turn but which way? To the left or to the right? Perhaps it picks either one of those in random (LEFT or RIGHT) and tries to find black, if it can’t find black it turns again and hopes to find black in the opposite direction (otherwise it’s completely lost).

This process seems overly complicated and extremely un-reliable. More importantly if [this is not required in my project] mindstorm had to go the finishing line in the earliest possible time then the above approach would certainly fail because it would have to search the black line as opposed to follow the black line.

So I had to think of a different approach and I came up with the following: Follow one of the edges of the black line (rather than the whole black line). Even before starting to think about this problem I started to see some of the program’s benefits. So let’s say I choose to follow the right edge, then the robot should look to the left for white and right for black.

Very elegant. The robot would either to make a right or a left. If after turning a little (let’s say 5 radians) it finds black it continues to turn in that direction until it finds the edge and then continues in that direction.

I am currently working on the latter algorithm and will soon post the C code (actually NQC code) for you guys.

GMail

Here’s some more GMail activation links:

1. http://gmail.google.com/gmail/a-b4369876e-68b7b7af88-12f886b03c
2. http://gmail.google.com/gmail/a-b4369876e-59168dabbd-46368783e1
3. http://gmail.google.com/gmail/a-b4369876e-1b4f259e42-2f84613679
4. http://gmail.google.com/gmail/a-b4369876e-60ac981e98-5a26f0072e
5. http://gmail.google.com/gmail/a-b4369876e-187a4f577a-b8d47e8990
6. http://gmail.google.com/gmail/a-b4369876e-f9d076226e-4453fd3ab5
7. http://gmail.google.com/gmail/a-b4369876e-e89a7725cf-bce8955f73
8. http://gmail.google.com/gmail/a-b4369876e-8fd53901fc-d428ad859a

Change my personal information with yours and you are ready to go!
Enjoy.

Old New Thing

The Old New Thing by Raymond Chen (from Microsoft) is one of the best blogs I have ever seen. Usually I am not addicted to blogs; but I can’t help myself going there everyday and learning something new everyday. He has worked on several of the Microsoft Windows OS and specializes in graphics programming.

Hope you enjoy it.

Hyper Threading in Windows

As this relatively new technology starts getting used more widely there are certain things we should be aware of.

Windows 95, 98 and ME are NOT hyper threaded aware processors. Actually these operating systems are not multi-processor systems and therefore enabling hyper threading (or even adding more than one physical processor) will not make any difference.

For Windows NT and 2000 it’s a different story. These operating systems actually cannot distinguish between multiple physical processors and hyper threaded processors. This is NOT good. Consider this scenario, if you have two physical processors with hyper threading enabled: A1, A2 and B1, B2 (A and B are the two physical processors). Then to a Windows NT/2000 machine the system will appear to have 4 physical processors. Now lets say you issue a processor intensive task, as far as the Windows NT/2000 scheduler is concerned all four processors are equal and doesn’t really matter which one it uses. If you are unlucky then the scheduler will pick A1 and A2 — forcing the other physical processor to stay ideal. Clearly a better option is to pick A1 and B1 because they are separate processors and have separate cache, data bus and so on.. Due to this in some cases it’s better to DISABLE hyper threading on Windows NT and 2000 machines because the performance degrades.

Windows XP and Windows 2003 is able to distinguish between physical processors and virtual (or hyper threaded) processors. And given the above scenario the scheduler will always pick one of A’s and one of B’s.

Finally, just because the operating system is hyper threading aware (Windows XP/2003) it could still result in a net loss. The details of why this is so is a little tricky if you are interested you can e-mail me.

For more information see the Windows Support for Hyper-Threading Technology white paper.

Movable Type styles

The styles you see used in this page comes from the following web-site: www.movablestyle.com. Lloyd (the author of the site) is in no way affiliated with Movable Type but he continues to make/convert wonderful styles for Movable Type 3.x and 2.x.

Lego Mindstorm

For my project this semester we have to program a LEGO Mindstorm robot to travel a certain “pre-defined” path. As I work on the project I will be posting details about how the system works and hopefully that will help someone. Here’s a picture of a typical Mindstorm robot:

LEGO Mindstorm robot

The Mindstorm comes with a Hitachi H8 microprocessor — which can understand the language NQC (or not-quite C). The syntax (the lexical grammar) for NQC is exactly same as C but NQC has some limitations like:

  • Max 32 bytes of variables. Which means either at most 32 variables OR an array of 32 elements (integers are 1 byte also, there is no float type)
  • One stack level. Meaning only one level of function call can be made. For instance, if function a calls function b, then function b can no longer call any other function(s) because of one stack frame.
  • Functions cannot return any value (that’s because there is no stack frame to return the value to); although does support pass by reference.

Incorporating MTSecurityCode within MT 3.1

THIS METHOD WAS TESTED ON 3.1 and 3.15

As it turns out in movable type 3.1 all comment fields were replaced with

<mtcommentfields>

Making it rather difficult to add additioanl text-boxes. Since I had installed MTSCode (on version 3.0D) I had to add another text-box to verify the security code (on 3.1 once I upgraded). There is no easy way to do this, so this hack will let you do just that.

(more…)

GMail Account

Get your GMail account here:
http://gmail.google.com/gmail/a-8ee882b397-….

Drop a comment if you need more !