Tuesday, December 20, 2005

Anti-matter

From the "I-wish-batteries-were-smaller" department. I've previously blogged about tritrium as an energy source.

Here's another alternative: Antimatter. This article on HowStuffWorks discusses the use of antimatter drives for space exploration.

A quote from the article:
"The amount of antimatter needed to supply the engine for a one-year trip to Mars could be as little as a millionth of a gram"

Now that's energy density!

Wednesday, November 09, 2005

Wind Turbines

I've always liked the idea of wind power generation. One day I'd like to have a turbine on the roof of my house contributing to my household energy requirements.

There are a couple of major issues with current, propeller type wind turbines. Most turbines put the blades in front (upwind) of the support pole. This requires that the blades are very stiff, so they don't flex and hit the pole. This adds to weight and therefore cost, while also reducing efficiency as there is more mass for the wind to move.

Well, why not put the blades behind (downwind from) the pole, you ask? Seems obvious, because you can have lighter and more flexible blades. Unfortunately there are issues due to the turbulence created by the pole. There is a kind of "dead spot" behind the pole which causes the blades to lose pressure and flex towards the pole. This can set up a rhythmic flexing and can destroy the blades depending on wind speed/strength and rotation frequency.

Here is an alternate design that uses a vertical axis and doesn't have any of these issues. I'm not sure how feasible it is, but hopefully it can result in more efficient wind power generation.

As always, more information is available from Wikipedia here.

Tuesday, November 08, 2005

Shrink wrapped software and Feature Prioritisation

Just read an interesting article written by Joel Spolsky. You can read it here.

It covers two important concepts in Software Development.

1. Developing shrink-wrapped sofware vs customised software. I've developed both kinds of software at various times.

I find that writing customised software really isn't a good business model. The process tends to go like this:
- Sales guy talks to the client
- Asks for a quote with some very vague, hand-wavy "requirements"
- BA/Architect comes up with an estimate based on gut feel
- Estimate is turned into a dollar figure, discounts are applied to ensure the deal is won
- Contract is signed

Later on, down the track, the consulting company decides what functionality can be crammed into the budget, negotiates with the customer and they come to some agreement.

The end result is that the customer doesn't really get what they want and the consulting company make a very small profit (or sometimes, large losses!) and that's it. No more chance to benefit from that work at all.

At least if you develop some software that can be resold (even with customisation) you've got an opportunity to leverage that work into future earnings.

2. Priorities
The other interesting concept discussed is prioritisation. I think this is so important, but lots of people just don't get it. If you set priorities and then develop components based on their importance, everybody wins!

Friday, October 28, 2005

Sleep Study

I had a sleep study last night. I slept at a hospital attached to various sensors to help diagnose why I'm not getting much value from my sleep.

The sensors attached to me included:
- 3 ECG sensors to monitor heart activity
- 4 EEG sensors to monitor brain activity. Maybe these weren't connected properly, because they said they weren't getting a signal. What? Did you think I was going to let this cheap shot get through to the comments??
- 2 sensors to monitor leg movement and check for Restless Leg Syndrome
- 3 sensors to monitor breathing. A plug for each nostril and a little plate that hangs over my mouth
- 2 straps around my chest and stomach to measure expansion/contraction
- 1 position sensoron my chest to measure whether I'm lying on my side, back or stomach
- 1 Blood O2 level monitor on my finger
- 3 Sensors on my forehead to measure eye movement (I guess to detect REM sleep)
- 1 Microphone strapped to my neck
- 1 Sensor on my chin that I suspect was monitoring teeth grinding??

For a grand total of 21 sensors and wires hanging off me.

So as you can imagine it wasn't easy to sleep with all this paraphernalia on digging into my head and body. Trying to roll over was a major engineering exercise to avoid tangling or detaching any wires. The only ones that were really uncomfortable were the finger one which caused my finger to throb after a while, and the tubes from the nose/mouth sensors that went behind my ears. When I tried to lie on my side they made my ears ache.

So anyway I've come out unscathed, if a little tired. I get the results in about 4 weeks so hopefully they've got some good information to work with. Kudos go to the nursing staff who have to stay there and actually be awake all night. I couldn't do that job.

Thursday, October 27, 2005

Modern Programming Languages/Systems

I just read an interesting and thought provoking article by Charles Petzold. Read it here.

While I don't claim to have the experience that Petzold has, I started my programming experience back on Windows 3.1, writing C++. I feel a similar disquiet towards .NET programming that he describes.

Back in the day, when I wrote a program, I wrote every line of code. I controlled everything about the program. When a window resized, the controls moved because I put in code that told it how to move. I had complete power over the behaviour of the program. The downside of having that power is that it takes a long time to write all that code.

Nowdays I can get a program up and running a lot faster. However the cost of this improved productivity is that a lot of code is hidden away from me and that makes me feel vaguely nervous. When I write a foreach loop to iterate an arraylist these days I have no idea what's actually happening under the covers. So I just have to shrug and hope it performs okay. Because the alternative is too onerous and most of the time it's just not necessary.

The biggest extreme in this direction I have experienced is working with Borland Builder. It took me a week to get two windows to communicate with each other because it was a 'non-standard' communication and builder hid so much of the implementation from me that I had to work around it in incredibly complicated ways.

Could I go back? It'd be very hard to have to worry about ensuring that I deallocate all my pointers again. But at the same time I really miss the mental stimulation and discipline that that imposes. I feel 'careless' as a programmer now. At the same time I'm sure I'm romanticising C++ programming. I haven't mentioned the endless frustration of spending 3 days tracking down that annoying memory allocation bug. But then I also haven't mentioned the incredible surge you get when you find it and fix it!

So for 90% of programs, the extra productivity that modern programming languages provide are well and truly worth it. But I'll always look back and miss the real challenges and satisfaction that C++ programming provided.

Wednesday, October 05, 2005

John Dies at the End

I've been debating whether to post this or not. I (obviously) decided I would, but not without reservation.

Here's a link to an online novel called "John Dies at the End" (or JDatE) that has been published in installments over the last number of years.

It's quite an odd story and has some quite disturbing/scary bits in it. I was almost having nightmares around the middle bit there. But at the same time, the storytelling style and plot twists are simply fantastic and this guy's got an amazing imagination.

For example, here's a quote:
I was wondering if I should warn the girl about John's coffee, which tasted like a cup of battery acid someone had pissed in and then cursed at for several hours.

Now that's just weird. But at the same time, I love the writing style. Maybe I'm weird. I mean, how can coffee taste worse just by having someone yell at it?

So, if you've got nothing better to do, go check it out. But don't come and complain to me that it's really weird.

Thursday, September 22, 2005

Space Elevator

Here's a (kind of) follow up to my earlier entry about Space Fountains.

Here's an article that contains a proposal to build a space elevator. It goes into quite a bit of depth about the construction of the cable and the elevator cars and even addresses failure scenarios. A great read.

Tuesday, September 20, 2005

Become a pastafarian

There's an amusing parody site here in response to the decision by the Kansas school board to teach Intelligent Design alongside evolution in schools.

I particularly like the graph of Pirates vs Global temperature :)

Tuesday, September 06, 2005

Stirling Engines

Stirling Engines are a wonderful technology to convert any heat (including waste heat from other processes) to power. They are completely sealed so there is no harmful exhaust and they're very efficient.

They've hit the press a bit lately and the latest news is that the world's largest solar array will use them to convert the gathered heat to power.

If you want to know more, click here for instructions on how to build your own.

Friday, September 02, 2005

Genetic Modification

I've often heard the theory that my generation is that last generation that will die. I've always thought that was a bit optimistic, but an article I read on The Australian yesterday has made me revise that opinion.

I've also long thought that my generation has missed the Genetic Modification (GM) boat because our genes are already set. Sure, future generations will be modified before they develop much, but I'm pretty much stuck with the genes I've got.

The Article talks about some scientists who have modified a mouse so that it can regenerate damaged legs, tails and even heart tissue. It can't regenerate the brain yet.

But the real kicker is that if they take liver cells from these GM mice and inject them into regular mice, the regular mice gain these regenerative abilities too.

Maybe there's hope for me yet...

Monday, August 29, 2005

CVT

All cars are an exercise in compromise. A major limitation of the internal combustion engine is that it has a fairly narrow rev range where it is efficient in terms of power output for fuel used. Anything outside that band and you start to lose efficiency. This is why electric cars, electric trains and boats are efficient transport. The engine spins at close to it's ideal rev range almost all of the time because they have flexibility built into the drivetrain.

Cars on the other hand, have to vary their speed significantly and often and have a rigid connection between the engine and the tyres on the road. So gears were added. These allow cars to keep their rev range somewhere around their most efficient level but still be able to vary their speed. This applies to both manual and automatic transmissions.

A new kind of transmission has been developed. CVTs (Continuously Variable Transmission) have a theoretically infinite number of gear ratios, allowing the engine to stay in it's most efficient rev range regardless of the road speed. It's a great technology.

You know how lots of automatics now have that 'semi-automatic' mode that allows you to change the gear up or down by moving the transmission selector to the side and moving it forwards or backwards? This always seemed odd to me, because why not get a manual and enjoy the improved efficiency.

So here's the funny part. Yet another example of marketers taking a great engineering idea and weirding it. Nissan has released a car with CVT and they've put in this 'manual' mode. They've taken a masterpiece of engineering that allows an infinite number of transmission ratios and they've deliberately hobbled it by forcing the transmission to stick at certain pre-defined ratios! It's like developing a new, propellent-free rocket, but NASA deciding that the big flames coming out of the space shuttle were more 'dramatic' and putting a rocket engine on the back to produce the flames.

Friday, August 12, 2005

A glimpse into the future

The guys at Pointless waste of time have done it again. There's a hilarious and well written prediction piece about how virtual reality will become the preferred place to live. Click here to read.

He raises some interesting questions. I don't know the answers, but I enjoyed pondering as I read.

Thursday, August 11, 2005

Gyroscopes

Check out the gyro car and the gyro train.

They are two wheeled vehicles like motorbikes that use gyroscopes and precession to stay upright, even when they're stationary. They work by having a reasonably sized gyroscope mounted in the vehicle. Tilt sensors detect the vehicle starting to tip over and apply a force to the spin axis of the gyroscope. Precession causes this force to be translated by 90 degrees, righting the vehicle.

More (and probably better) information is provided by HowStuffWorks.

Extra Value Pack!

I went shopping at coles today. I went to grab my normal-sized container of stuff when I noticed a larger "Extra Value Pack". I figured, cool, it has to be cheaper because it's "Extra Value".

But then I decided to check. Of course, the larger pack wasn't any logical multiple larger than the small one (that would have made it easy), so I had to use a calculator.

It turned out that the "Extra Value" pack actually cost more per gram than the regular size! Damn marketing lies!

"Extra Value" my ass.

Friday, July 15, 2005

The best a man can get?

I've got a pretty tough beard and find shaving uncomfortable. However, I just got a new razor, a Gillette M3 Power.

It's got a battery and vibrates as you shave. It's great! It's made shaving a breeze. I can't recommend it highly enough.

Friday, July 01, 2005

Headspins after drinking

You know how the room spins after you've been drinking? Well, have you ever noticed that after a while it stops spinning, then starts spinning the other way?? Ever wondered why?

Balance is handled by a small blob of jelly called the cupola. It is in a small chamber and is attached to the chamber walls by lots of tiny hairs. When you move your head, the ball of jelly moves a bit slower than the chamber which bends the tiny hairs and indicates to the brain that you've moved.

When you drink alcohol, because it's such a terrific solvent, it gets just about everywhere, including in the cupola. The shape of the cupola is distorted by the alcohol, bending the hairs. Your brain interprets this as a rotational force (ie: you're spinning around).

In time the alcohol diffuses out of the cupola. However, by then your brain has gotten used to the the fact that your head is spinning and adjusted it's interpretation of the signals coming from the cupola. So it interprets your normal signals as seeming to spin in the opposite direction!

Quasiturbine engine

We've all driven piston internal combustion engines, right?

I've driven a Mazda RX-4 with a less common engine type, a wankel rotary engine.

One of the things that prevents a standard piston engine from revving harder is that the pistons have to accelerate and decelerate with every stroke. The momentum of the pistons is a major limiting factor. A rotary engine removes this limit by having all moving parts spinning, no acceleration and deceleration required. I can tell you, those engines rev like mad! The main downside of a rotary is that it doesn't completely burn the fuel, so it's not as clean.

Also, each piston only produces a power stroke once for every 2 revolutions of the driveshaft.

Welcome to the next step in this evolution, the Quasiturbine engine. It is far more efficient (it produces 4 power strokes for every revolution of the driveshaft! 8 times more than piston combustion engines) and burns the fuel more completely.

Can't wait until this is in a car... it will be fun to drive.

Thursday, June 30, 2005

RSS Feed

For those of you who are using the feedburner RSS feed that I was initially recommending, I've changed my recommendation :)

I was looking through the blogspot options and one of them was an RSS feed! Already built in.

So I've updated the link on the right. The feed to use is:
http://glenmcg.blogspot.com/atom.xml

The other one will probably continue to work, but I'm not going to be checking that it's still alive.

O2 Xda II Mini Part III

My Xda died today. Well, to be more precise, I killed it!

I was trying to free up memory on the internal storage by moving files to the storage card. One of the files I wanted to move was an application that's run as a Today screen plug in. It was in use, so I removed it from the today screen then copied it across to the storage card.

Then I had a brain fart and re-added it to the today screen. Dumb, dumb, dumb. The device crashed, then rebooted. But as it came up, it tried to draw the today screen which caused it to crash and reboot! Shampoo, rinse, repeat.

So I had to hard-reboot it, which is like a re-install the OS in desktop land. End up with a totally blank device. Now to re-install and re-configure all my apps :(

Tuesday, June 21, 2005

Windows Mobile 5.0

Yesterday I attended a Microsoft Developer conference about Windows Mobile 5.0. It was basically presenting what we'll be able to do when (if?) Windows Mobile 5.0, Visual Studio 2005 and .NET Compact Framework v2 are released.

The features are great. I've been developing on my Xda and it's really hard to do some things that seem so obvious. For example, it's impossible to tell if the backlight is on! WM5.0 provides lots of really useful APIs and events to detect things like this. It'll allow for much better applications for mobile devices.

The biggest feature they've missed is that you can't write managed Today screen plug ins. When you go to Pocket PC software sites, the majority of applications are... you guessed it... Today screen plug ins, so it seems amazing that they've not included this.

So if anyone's looking to get a PDA or smart phone soon, try to hang off until you can get one with Windows Mobile 5.0.

Friday, June 10, 2005

The end of folders?

Slashdot has an article today about the death of folders.

The idea is that rather than placing a file in a folder, you add metadata about the file, describing it's characteristics. The advantage of this is that you can have multiple characteristics, so you can say that a file is related to "Family", "Photos" and "Funny" all at once. Then when you browse the disk, it shows these categories as virtual folders.

Gmail does this and I've heard lots of positive feedback. I think it sounds very promising.

Monday, June 06, 2005

Space fountain

A space fountain is a type of active structure. This means that it requires power to retain structural integrity (ie: Not fall down!)

It basically works by having a hollow core through which pellets are shot upwards. A device at the top of the building (most likely a magnetic diverter) will reverse the pellet's direction. Doing this will impart some of the kinetic energy in the pellet to the structure, providing lift.

Therefore some of the weight of the structure is supported by the pellet stream rather than the building, allowing for less bulky building techniques.

Space fountains can be used as a launch pad for spacecraft by reducing the amount of fuel needed to be carried.

A related technique is the space elevator.

Thursday, June 02, 2005

O2 Xda II Mini Part II

Last time I talked about my O2 XdaII Mini.

I'm pretty comfortable with my use of it. The 'Today' screen shows my upcoming appointments, any messages and my tasks. To display the tasks, I've installed a Today plugin called Task Plus. It shows tasks with more information than the standard task view. It also shows battery status.

I've also written some applications. One is a 'game' manager. I use it for playing Magic: The Gathering. It keeps track of the amount of damage I and my opponent has taken. It's a great app because I'm likely to have my phone with my and it saves having to write on paper or use beads.

The other is a budget. It keeps track of how much money I'm spending, which I find useful. It actually stores the data in a SQL database on the device!

The best app I've seen is one my friend Dave wrote. It's a scorecard for frisbee golf. Again, it saves having to carry a pen and paper around.

Batteries

Everyone hates batteries, right? They're heavy and bulky and they keep going flat at the most inopportune times. Mobile phones these days seem to be not much more than a case around a battery!

Enter Tritium, a radioactive isotope of hydrogen. When Tritium decays, it emits an electron. Sounds pretty darn good for a battery, right? Right? There are plans to make batteries that might last 10-12 years without recharging. See this Wikipedia article for a little more info.

There's an article with a lot of discussion about this on slashdot.

A summary of the posts in favor of these batteries seems to be:
  • Tritium batteries are already used in pacemakers

  • They are very easy to shield and give off almost no harmful radiation at all

  • Even if they're punctured, the results are less harmful than the contents of most chemical batteries


  • A summary of the posts against seem to be:
  • Ooohhhh... nukular... bad. Bad nukular!


  • And a word from the cynics:
  • Battery makers won't invest in this because they like making us buy lots and lots of disposable, short lived batteries


  • I say bring it on!

    Gaming

    Found this great article about gaming.

    It's great. It explains very clearly (not to mention verbosely!) my opinions about games in lots of areas.

    My favorite part? I hate wandering around lost in FPS's:
    <snip>
    Did you remember when you were a kid and you got bored on weekends, how you would go to a large building, a hotel or a hospital, then wander around for several hours looking for a certain room? While zombies attacked you? Neither do we. That's because, much to the surprise of FPS game makers everywhere, wandering around lost in hallways isn't fun.
    </snip>

    Other highlights? Creating 'difficulty' by giving you only 4 bullets in a clip, or making you talk to 10 different NPCs in the right order to be able to accomplish a task.

    Wednesday, May 25, 2005

    The Singularity

    Slashdot had an article yesterday about downloading your brain.

    It reminded me of an essay called Staring into the Singularity.

    The essay talks about what happens when we develop an AI that is capable of improving itself, by designing and implementing it's own software and hardware. Once this happens, thanks to ever-increasing hardware speed the work that the AI is capable of doing in a given timeframe rises asymptotically to infinity in a short period of time.

    At this point the essay proposes that one by one the neurons in your brain can be replaced by a wireless device that performs the actual processing. The physical neuron will not be shut down until the inputs and outputs are modelled exactly by the computer. This way, your conscious is shifted into a computer seamlessly, and there is never two copies of you running at any point (which is one of the major issues raised in the Slashdot article).

    It's a thought-provoking read.

    Tuesday, May 24, 2005

    Macro to attach to asp.net process

    You know how much of a pain it is to debug web apps in Visual Studio .Net? You either run the website (which takes forever) or have to attach to the aspnet_wp.exe by clicking [Alt]dp[Enter][Enter][Enter].

    Finally! A macro to attach to the process automatically! Thanks to Dan.


    Sub AttachToAspDotNet()
      Dim attached As Boolean = False
      Dim proc As EnvDTE.Process
      For Each proc In DTE.Debugger.LocalProcesses
        If (Right(proc.Name, 13) = "aspnet_wp.exe") Then
          proc.Attach()
          attached = True
          Exit For
        End If
      Next

      If attached = False Then
        MsgBox("aspnet_wp.exe is not running")
      End If
    End Sub

    Monday, May 23, 2005

    Plane reverse thrusters Part II

    I flew to Sydney on the weekend. On the way back, I was sitting just in front of the wing. As we were landing, I checked out the engine on the Boeing 737 and lo and behold, the back part of the engine slid back just as the loud windy noise started. It looked just like this (about half way down the page, under the heading "b) Reverse Thrust Configuration".

    So, this just goes to show, not all of the information on the internet is bullshit. Unless this post is also bullshit... hmmmm.

    Friday, May 20, 2005

    Plane reverse thrusters

    I just read about reverse thrusters for jet airplanes. You know when you touch down and then you hear a really loud sound from the engines and the plane slows down quite rapidly?

    I always assumed they somehow ran the engine in reverse or something. I knew that didn't make much sense, but I didn't really know how it would work.

    Well, it turns out they deploy these big diverters behind the engine that just redirects the jet exhaust!

    See this Wikipedia article for more info.

    O2 Xda II Mini

    I recently purchased an O2 XDA II mini. It's manufactured by HTC. It's also badged and sold as an iMate JAM.

    I love it. I'm all for convergence. Where I used to carry around:
    - A mobile phone (Nokia 6610)
    - A 256MB USB flash memory stick
    - A Palm Vx, which despite being old was still very capable.
    - A paper based diary
    - A flash based MP3 player

    I now have just one device. It covers all these functions, plus it provides:
    - A camera/video, albeit a really crap one
    - Voice recording
    - Masses of applications
    - Wikipedia on the device if I'm ever curious about just about anything.

    I also don't have to worry about synchronising people's contact details across my phone, palm and PCs. The Xda synchronises automatically with Outlook on my work and home computers.

    Pros:
    - Small form factor an ideal compromise between mobile phone and organiser with a useful screen
    - I can write my own programs for it! This is one of the most important points for me.

    Cons:
    - If I ever want to just carry a mobile, it's a bit bulkier than my old mobile.
    - Only 128MB RAM. I bought a 1GB expansion card, so that's okay :) I can't wait until they've got a multiGB hard disk built in.

    Next time I'll talk about how I tend to use it and the applications I've written for it.

    Wednesday, May 18, 2005

    Movie Physics

    Dammit! I just saw a trailer for the Fantastic Four movie. I was really looking forward to this one. The FF, Victor von Doom, what's not to love?

    Then I saw a scene where a truck is coming towards The Thing (the strong, orange, rocky one) and someone else who was lying on the ground. So The Thing jumps in front of the person, braces himself and hip and shoulders the truck.

    The truck crumples around him and stops dead (cool CGI, by the way, he's almost enclosed by the truck due to the crumpling).

    But get this... the truck stops. Excuse me for having a brain, but exactly how is he anchored to the road?? Fair enough he's not hurt. I guess he weighs a fair bit too, but not as much as a truck, I'd wager. What should have happened is that he puts a big dent in the truck and gets carried along. It's the whole conservation of momentum thing I'm talking about.

    This kind of thing just ruins the illusion for me. It rubs into my face that what I'm watching is not real. It sucks. And it's becoming rampant.

    Remember in The Hulk when he's standing on the roof of a building and jumps a few kilometers away? Well, if he applied that much force to the roof of a building, the only thing that would happen is that he blasts the roof out from under his feet and he falls down.

    At least let's get some semblance of an excuse for something vaguely resembling realism. Please?

    VB.NET vs C#.NET

    There's an interesting discussion happening at work at the moment about VB vs C# code. My thoughts:

    VB as a language was designed to abstract a lot of complex functionality so that the programmer didn't have to "bother" with it. This is great for small and simple applications. It provided a great platform for developing small applications quickly and efficiently.

    C++ however doesn't try to hide detail (although later libraries such as the STL started to edge in this direction). So you have more power and control, but also an increased level of complexity. So it took longer to produce a simple application but is more capable for a complex application.

    So from my point of view, the comparison is between ignoring complexity and knowing, at a deeper level, what was actually happening when you call a function with a reference parameter. Knowing how memory is managed and how pointers work. Coz this stuff is still important, no matter how much .NET tries to hide from you.

    I don't think there is any difference in VB or C# code. The only differences nowdays (.NET) is the syntax.

    However, there is a big difference in code written by someone how 'gets' how the low level operations work and someone who doesn't. This is, to me, the essence of the (unfair IMO) categorisation of VB programmers and C++/# programmers. The categorisation is based on where you came from. If you started working with C++ you probably understand this stuff, or you wouldn't have cut it as a C++ developer. If you started working with VB, you didn't have to do that. Mind you, that doesn't necessarily mean that you don't get it... there's no reason that a programmer starting with VB is any less capable of understanding what's going on under the hood.

    Joel on Software has an interesting article about Leaky Abstractions that also illustrates this issue. It's pretty long, but it's almost certainly written better than this (admittedly long-winded) post :)

    Steamships

    I was amazed to read that the QE2 was originally built with a steam turbine! It's maiden voyage was in 1969. I didn't realise that steam turbines were still in use at this late date. She was refitted with diesel engines in 1986.

    And thus it begins...

    Okay, so I got me one of these newfangled blog thingies. I expect that the world will now be a better place, with no more hunger, poverty or war. That's the way these things work, isn't it??