Rough Book

random musings of just another computer nerd

Category: Science

Sci-Fi Fever Dreams

Yesterday when I finally fell asleep, I was running a fever of 102.5 (it broke last night and I feel much better today – I think I’m over whatever I got). I then had a dream I was in a TV show – something like Stranger Things. At least that’s how it started out. Something weird was going on at some house where there was a hole to a parallel dimension and a team of investigators had shown up to check it out. I was part of this team. For whatever reason I had a sweet pair of polarized sunglasses with me. Don’t know where I got them from, but they looked really cool and they most definitely didn’t belong in the 80’s. Everyone kept talking about how cool my shades were and I agreed; they were cool.

We were looking at the lawn where there was a burn mark due to the paranormal occurrences at this house, when I noticed that I would see a strange pattern on the lawn only when I wore the shades. No one else could see it. I lent my sunglasses to the other investigators and then they could see the pattern too. When they wondered why, I said “Well, my glasses are from 2016” (as if that would explain everything). They laughed because it was only 1986. I think at that point I realized that I had somehow time-traveled to 1986 and ended up as part of this team. Anyway, I then realized that the pattern I was seeing on the lawn was basically a series of gears; kind of like what you would see in a clock. Furthermore, the gears were moving. That’s when I realized that what I was looking at was time itself! The glasses helped me view the entire dimension of time using this metaphor. But not just view it…

I decided to say “Go back 10 seconds” while wearing the glasses, and I went back 10 seconds in time! So apparently that was how I had arrived in 1986, but I had forgotten that critical piece of information. I don’t recall what else I did with my new-found power but I vaguely remember time-traveling to 1991 and ending up in my old house in Darsait, Muscat as my younger self. So it appeared that the glasses had a sort of Quantum Leap-esque power too. Unfortunately at this point I either woke up or the dream transitioned into something else because I don’t remember what happened next.

Akṣi: Handwritten-digit-recognizing neural-network

I’ve always been interested in Neural Networks (ever since I first found out about them around 10 years ago). However, I never got a chance to learn about them or write one of my own; this is something I’ve wanted to do for some time. I got the opportunity this semester when my professor in my advanced data-structures class told us that we could pick any topic we liked, for a semester project. I thought that this would be the perfect time for me to learn about neural networks and create one of my own.

The end result was Akṣi, a neural network that recognizes hand-written digits. I’ve hosted it using Google’s App Engine. Please check it out!

Navy Railgun and Shuttle Ascent video

I came across a cool video of the Navy’s Mach 8 Railgun. That’s right. Mach 8. The railgun uses 33Mj; the aim is to get it to 64Mj. The previous record (by the same lab) was 2 years ago at 10.64Mj. There are still a few issues to work out, namely power consumption and heat dissipation. A railgun has no moving parts and simply uses electromagnetic energy to shoot a projectile. They can also be powered by the ship’s batteries. The Navy is expecting to deploy these to ships by 2020 or 2025.


The other video I came across is one explaining all aspects of the launch of a space shuttle (what the engineers look for, etc.). The video is 45 minutes long, but it is extremely informative and well worth it to watch.



Rooting the G2

As some of you may already be aware, it appears that the G2 has some sort of “magic restore” (it’s not a rootkit) function that causes all changes to /system to be reverted. This means that you cannot remove any bundled bloatware. Even more troubling, it looks like the phone will perform the restore while it is running (i.e, you don’t need a reset). I haven’t turned on my G2, so this is what I’ve heard from people at XDA Developers. You can get temporary root on the devices, but after a little while (some people say minutes, others say hours; experiences seem to vary) root is lost. So it is possible that something is performing the restore while the phone is running.

Helpful folks on XDA Developers have posted the datasheet to the eMMC and another kind soul (damnoregonian) was able to get the value of the CSD register (the register that seems to control the behavior of the MMC): d00f00320f5903fffffffdff924040c8.

WP_GRP_SIZE[36:32] and WP_GRP_ENABLE[31:31] seem to be the bits that control the write-protect (per the datasheet). Currently these seem to be set to the default values per the data sheet (11111b and 1b). Clearing the bits should (theoretically) turn off the write protection. The value to do that would be d00f00320f5903fffffffde0124040c8. The CSD node is R/O and so you cannot echo to it directly. The only way to do it would be to write a kernel module/driver that writes to the register. Apparently the kernel exports a function called mmc_send_csd, and so one should be able to write to this register.

I’m tempted to write a kernel module that does just that. But since working at Intel I haven’t written any kernel drivers. Also while I did write drivers at Intel, I pretty much made modifications to what others before me had written, and so I never wrote one from scratch. I’m going to see if I can start on something this weekend… wish I was still in college… I had a lot more time then!

If this works (and that’s a big if), there’s still the issue of restores being done while the phone is in operation. That could cause a lot of inconsistency. So this might be a partial solution.

Either way, I’m sure someone will come up with a way to root the phone. But if there’s nothing by next Friday, I’m going to return the phone.

UPDATE

Someone posted updated specs. It looks like those bits are read-only. Bummer. Also, this from T-Mobile’s website:

Bellevue, Wash. — Oct. 7, 2010

As pioneers in Android-powered mobile devices, T-Mobile and HTC strive to support innovation. The T-Mobile G2 is a powerful and highly customizable Android-powered smartphone, which customers can personalize and make their own, from the look of their home screen to adding their favorite applications and more.

The HTC software implementation on the G2 stores some components in read-only memory as a security measure to prevent key operating system software from becoming corrupted and rendering the device inoperable. There is a small subset of highly technical users who may want to modify and re-engineer their devices at the code level, known as “rooting,” but a side effect of HTC’s security measure is that these modifications are temporary and cannot be saved to permanent memory. As a result the original code is restored.

Well, T-Mobile. How about you provide us technical users a way to root our devices? What you’re doing is stupid. You’re going against everything Android stands for. If I can’t root it, I think I will return my phone and get a Vibrant instead. I would have expected this from Apple or Verizon. But not from you. Very disappointing.

Unboxing my new T-Mobile G2 Android Phone

My wife called me at work today and told me that my new phone just came in the mail :). It’s the new G2 by HTC, which is supposed to be the successor to the G1. The specs on this phone are:

  • 3.7 inch WVGA capacitive touch screen
  • 5 megapixel camera with auto-focus and flash
  • Qualcomm MSM7230 800MHz processor
  • 4GB ROM
  • 512MB RAM
  • GPS/aGPS
  • WiFi
  • Bluetooth
  • Android 2.2
  • Runs on T-Mobile’s 4G/HSPA+ network
  • Slide-out keyboard

Read the rest of this entry »

The Sun’s not going to blow up

In any science fiction story I’ve read (or science fiction movie or TV show that I’ve seen) that talks about death of the Sun. I’ve always heard references to Earth’s sun “going nova”. I’ve read about this even in Asimov’s stories. In most cases, they’re talking about a supernova. But here’s the thing. The Sun is not going to blow up. Even if the writers were talking about an actual nova, they’re still wrong. Here’s why:

Our Sun is a yellow dwarf star (more precisely known as a G-type main-sequence star), and doesn’t have enough mass to undergo a supernova explosion (type IIa). You need a star that’s at least nine times the Sun’s mass for a supernova explosion. If we’re simply looking at a nova (type Ia), then the Sun doesn’t have a companion to draw matter from when it turns into a white dwarf. So no matter which way you look at it, the Sun is not going to blow up. It’s just going to be really, big and red and will eat the Earth. Unless the Earth moves outward due to the Sun losing mass. Finally the Sun with eject its outer layers and turn into a white dwarf. See? No blowing up. I don’t know why some science fiction authors still talk about the Sun “going nova”. Maybe it’s because it sounds more dramatic.

If anyone has read a science fiction story (or seen a science fiction movie or TV show) that talked about the death of the Sun/Earth and did so realistically, then let me know.

Artificial Life – some preliminary findings

I fnished my artificial life simulator over the weekend, and I have been running simulations on it. There were a few bugs initially that I quickly fixed. My initial simulations gave me some inexplicable “population explosion”. For example, in one cycle I would have 31 creatures and in the next cycle I would suddenly have around 9,000. It didn’t make very much sense until I analyzed the log files.

If any of you remember, I mentioned earlier that my “creatures” are nothing more than assembly programs. Each of these instructions (and parameters) translate into a bit pattern. Changes in the bit patterns lead to changes in the behaviour of the creature.

One of the instructions is a “reproduce instruction”. This prompts the creature to create a copy of itself, with possible mutations. The instruction has a parameter that tells the creature how many copies to create. During the course of the simulation, certain creatures evolved with the reproduce instruction as their first instruction.

My supervisor program (God program) runs one instruction of every creature during one cycle (sort of like an pre-emptive multitasking operating system). If a creature happens to reproduce during the current cycle, then the supervisor program will execute the child’s instructions as well in that current cycle. This led to an interesting situation. When the mutant that had the reproduce instruction as the first instruction reproduced, its child (if it didn’t have a mutation that changed the instruction) also had the reproduce instruction as the first instruction. So the supervisor program would run the child, and the child would reproduce with a similar offspring. This went on until a mutant that did not have a “reproduce instruction” as the first instruction, evolved. As you can see, this is what led to the population explosion. I corrected this problem by adding “sexual maturity” and “reproductive energy threshold” parameters to the creatures. Basically, a creature can reproduce only if it has been in existence for a certain number of cycles, and if its current energy is above its reproductive energy threshold. This got rid of the population explosion problem.

My simulations gave me some other interesting results. One of the instructions that I have is a MOV instruction. This instruction moves a creature from one cell in the two-dimensional array to another cell. There is a variant of this instruction, known as the MOVA instruction. In the MOV instruction, if the creature tries to move to an occupied cell, it will retreat to its original position. However, in the MOVA instruction the creature will try to kill (and subsequently eat) the occupant if the destination cell is occupied. I had created a creature that simply ate, reproduced, and moved to different cells. I noted that after many generations, this creature had evolved into an aggressive one, that would eat, reproduce, and move aggressively (MOVA) into other cells. That was rather interesting!

I also saw natural selection at work. When I corrected my population explosion problem, I made it so that the reproductive threshold of a creature was higher than its initial (starting) energy. Over the course of many cycles, I saw that the creatures evolved such that the initial energy would be very high, and that their reproductive threshold would be very low. In additon, their reproductive age was lowered. I thought that my creatures were having it too easy, so I modified my code to make reproduction a costly instruction. After running my simulation, I noticed the opposite! Now the creatures evolved such that the reproductive energy threshold would be much higher than their initial energy. It would seem that the creatures wanted to build up enough energy to where they would be able to reproduce successfuly.

There is also one very interesting behaviour that I noticed. I provide branch instructions in my instruction set. A creature can branch to any part of its code. In addition, I also have a Decrement and Branch instruction that is useful for iterative loops. One of my creatures evolved a clever strategy. It would decrement and branch into the middle of the branch instruction. When I analyzed the code, I noticed in doing so, the creature was performing a MOVA instruction in fewer bytes than writing an explicit MOVA instruction. It also had the added benefit of performing the MOVA instruction in an iterative fashion so that it could travel around the two-dimensional array. There was a reason for this kind of behaviour though. A creature consumes energy when it performs an instruction, and the energy consumption is proportional to its code size, so it is amazing, but not surprising that such behaviour could arise.

There is still more work that I need to do. I am thinking of giving my creatures some “memory” in the form of stack and RAM. They will have some Store, Load, Push and Pop instructions whereby they can write to and read from memory. Also, I am thinking of adding some more “registers”. Right now, the creatures have two count registers for performing iterative loops. My reason for adding more is this – I want the creatures to be able to act on the data in memory. For example, I can provide instructions that allow the creature to check the status of a particular cell, like if it is occupied, how much food it has, and so on. The creature can load data into the registers, and then use these registers as arguments for the cell checking instructions. This way I am hoping that my creatures will be able to evolve some rudimentary form of “intelligence”, or “intelligent” behavior. This will also increase my instruction set. Right now, if a mutation results in an invalid instruction, the creature dies when it tries to execute it. Actually, that reminds me – I had creatures that evolved with invalid instructions, but they had also evolved branch instructions that would jump over the invalid section of code!

Most of these complex behaviours aren’t that surprising when you consider natural selection… it is only err… natural that such behaviour should arise!

Well I guess that’s all I have for now. I might make a separate page for this project where I can describe this project in more detail. I’ll post more updates here after I run more simulations.

Intel and Artificial Life

This is my fourth day at Intel. I think I will enjoy working here. I haven’t done much yet though, and I still don’t know exactly what it is I am supposed to be doing. I tested some 140 chips yesterday, but that wasn’t too much work. My supervisor is out until Tuesday, so until then I am doing some odd jobs and reading up some documentation about the platforms and tools we use. I am excited to be working here. It looks like it’s going to be hard work, but I think it will also be fun.

Now about the Artificial Life. I have written up some specs on an Artificial Life program. This is different from earlier ones. I am implementing the “creatures” like assembly programs. This code is their “DNA”. It describes how they behave. A “God Program” executes one instruction of each “creature” and moves on to the next. Sort of like a pre-emptive multitasking operating system. The creatures all live in a two-dimensional area of memory. They can reproduce, and there is chance of error during reproduction.

I think I was going about it the wrong way earlier. I was trying to describe behaviour through variables and through discrete quantities. Now, I represent each creature as a bit-pattern – exactly like an assembly program. I have instructions for moving, eating, moving and attacking, reproducing, and sleeping. In addition, I have some very basic branches and loops. So based on the bit pattern, the creature has a certain behaviour. Also, changes in the bit-pattern can cause changes in behaviour. They can be subtle, or drastic. At least, that is what I believe. I need to actually implement my idea before I can find out! My God program is essentially an operating system, and the “creatures” are tasks. There’s a little more to all of this, but I can’t write it all here. If and when I finish the program, I will make a separate page for it and describe it in detail.

I am thinking of calling this program “Eden”. Anyway, that’s all for now!

Wisdom Teeth

I have been living on Tylenol for the past two days. My wisdom teeth have started to emerge from my lower jaw. The upper ones have been no trouble. The lower left one was no trouble either. However, the lower right one refuses to behave like his brothers. It is an eruption of pain. Day before yesterday I woke up with this throbbing pain in my lower jaw. I took some Tylenol and the pain went away. Next morning, I woke up with ever more terrible pain. It felt like someone had stuck a javelin through my lower jaw. I lay moaning in bed for about 15 minutes before I staggered to the bathroom and got myself more Tylenol from the medicine cabinet. This morning it seems to be slightly better. Here you go, Creationists. Try and explain this one. Why did you oh-so-perfect Creator create us with useless wisdom teeth? He didn’t even give us a jaw big enough to hold it. Pretty near-sighted, if you ask me.

I have a better idea. They are remnants of our plant eating past. When we evolved from being strictly herbivores to becoming omnivores, we didn’t need to grind plant matter so much. This weakened jaw muscles. Jaw muscles are anchored to the skull and since they were weakened, this let the skull grow even more since the jaw muscles aren’t squeezing it. Ergo, bigger brain. However, we still have the legacy code (excuse the programming analogy) for the wisdom teeth in our DNA. The code obviously doesn’t care that we have a smaller jaw, so it decides to express itself anyway.

I hear that some people get a healthy set. I think I might. It is only the lower right one that is causing me trouble now. In other people, they come up in horrible ways. Sideways, backward, sideways and backward… Horrifying thought.

Columbia

Being a complete nerd, this tragedy hits me really hard. I’m an avid space enthusiast and every shuttle mission fills me with hope and pride. Each of those missions is a mission for humanity as a whole. I can only imagine what the families and friends of those seven heroes are going through. I am also concerned about the impact this will have on the future of the space program. For those who say that we shouldn’t send anymore manned missions since it seems to be dangerous, they should realize that they are saying that these seven died in vain. The universe is there for us to explore. We can only dream about the day when we sail among the stars with ease. All that will be because of the brave men and women of today… Who take tremendous risks to reach for the heavens.

All original content on these pages is fingerprinted and certified by Digiprove
%d bloggers like this: