Super Mario

August 29th, 2009

Super Mario

Super Lego Bros.

August 18th, 2009

Super Lego Bros.

Click for larger view.

I decided to create something very simple, but very cool, with Lego bricks.  One pixel is one Lego brick wide.

Mario would look more authentic if I used brown instead of blue, but I don’t have enough brown bricks.

In Memorium

July 5th, 2009

Over the past couple weeks, the world has been shattered by the loss of several notable individuals.  Continuing the Grim Reaper’s soul spree, I had a personal loss today.  In fact, this is the third personal death in such a short amount of time.  It is very, very sad.

XBOX 360 #3: March 9, 2008 – July 5, 2009 (16 months) – No Video Output

XBOX 360 #2: June 30, 2007 – March 9, 2008 (9 months) – Red Ring of Death

XBOX 360 #1: May 23, 2006 – June 30, 2007 (13 months) – Red Ring of Death

They will be missed.

Xbox 360 120 GB Hard Drive Hack

June 19th, 2009

Even though I don’t care for the Playstation 3 all that much, Sony did do one thing right: you can plug in a wide-variety of 3.5″ hard disks.

Microsoft, in their endless, dirty pursuit of money by introducing hoops for consumers to crawl through, decided to create a proprietary interface for the Xbox 360 hard drive.  The result?  The Xbox 360 120GB hard drive retails for $159.99 (though you can find it for $119.99 and less elsewhere), whereas the same 2.5″ hard drive is $49.99 on Newegg.

Even if you open up the Xbox 360 hard drive enclosure, the Xbox 360 will only communicate with a hard drive with specific firmware.

Thankfully, intelligent hackers have created tools to update said firmware on several Western Digital hard drives.  We’re still stuck with 120 GB (Microsoft doesn’t support larger hard drives), but at least we can get it cheaper.

Everything you need to perform this upgrade is written about amongst the internets, but (not surprisingly), the information is often scattered and incomplete.  Here are the complete steps I took to update my hard drive.

Physical Requirements

  • Compatible hard drive.
    I used the WD1200BEVS ($49.99 from Newegg)
  • T5 and T10 Torx screwdriver ends.
    I bought the Husky 36-Piece Precision Screwdriver Set ($4.99 from Home Depot).
  • USB Flash Drive
  • Computer with SATA ports and ability to boot from USB Flash Drive.
  • Xbox 360 Hard Drive Enclosure.

Software Requirements

Create USB Flash Drive DOS Boot Disk

  1. Run Virtual Floppy Drive, install and start the drive.
  2. Load the DOS 6.22 Boot Image into the fake floppy drive.
  3. Plug in your USB Flash Drive (backup any files you wish to save).
  4. Run HP USB Disk Storage Format Tool
  5. Create a DOS Startup Disk using DOS System Files located at the fake floppy drive (click Start).
  6. Twiddle your thumbs for a bit.
  7. Copy the contents of the fake floppy drive to the flash drive.
  8. Copy hddss.bin to the flash drive.
  9. Copy hddhackr to the flash drive.
  10. Reboot the PC with the flash drive plugged in, and see if it boots into DOS (you may have to fiddle with the BIOS startup order).
  11. If you see a DOS prompt, congratulations.  Don’t do anything yet!

Disassemble Xbox 360 Hard Drive Enclosure

  1. Use T5 Torx to remove 4 external screws.  Remember the one under the security label… I forgot about it, and almost tore the enclosure apart.
  2. Use T10 Torx to remove aluminum hard drive shield.
  3. Disconnect cables by holding them with your thumb while sliding drive forward.
  4. ‘Bend’ the plastic bit at the end so you can get the drive out.  It is attached loosely to the rest of the enclosure, and can tilt easily.

Backup 20 GB Hard Drive

If you have a memory card, copy your profile and any save games to it (you can always download things again later).  I forgot to do this, and I’ll have to swap the 20 GB drive back in later.

Flash Xbox 360 Firmware

  1. Shut down your computer.
  2. Disconnect all SATA drives (so the software has no chance of screwing up).
  3. Connect your new 120 GB hard drive.
  4. Plug in the USB Flash Drive.
  5. Start the computer.
  6. Enter BIOS.  If there is an option for ‘Extended’ or ‘Enhanced’ SATA configuration, you’ll want to choose ‘Compatible’ instead.  I got stuck on this point, with my ASUS P5B Deluxe motherboard.
  7. Boot into DOS.
  8. Enter the command: hddhackr -f
  9. hddhackr should display your Western Digital hard drive in a list.  If it does not, try another SATA port, or double-check your SATA configuration in your BIOS.
  10. Enter the number associated with your hard drive, and follow the prompts.
  11. Shut down your computer for 10 seconds.
  12. Start up, boot into DOS.
  13. Enter the command: hddhackr -f
  14. hddhackr will display something a different hard drive name, something with ‘Hitachi’ in it, if successful.
  15. Shut down the computer.
  16. Disconnect your new Xbox 360 120GB drive.
  17. Re-connect your old drives.
  18. Unplug the USB Flash Drive.

Final Steps

Re-assemble the hard drive enclosure.  This is pretty simple, just plug the new drive in, screw things together, re-assemble the latch mechanism, and you should be all set.

Startup your 360 with the new hard drive.  Once you’re booted up, go to System Settings, and your hard drive should be listed as ‘Unformatted’.  Select it, and select Format.

Tada!

Avoiding Gmail’s Spamblocker

June 2nd, 2009
From: Marmo
Subject: Brighten up your life with a bra that lights upp
Content: (None)
Attachment: securings.rts

Contents of securings.rtf:
http://blahblahblah.cn - buy viagra, cialis, levitra and other meds

Darn. And here I was, genuinely curious about the ‘bra that lights upp’… such as, how? Green, light-absorbing glow-in-the-dark fabric? LEDs? Incandescent bulbs?

Creating Immutable Data Classes in C#… Quickly

May 26th, 2009

Of late, I’ve been tempted by F#.  In reading articles and familiarizing myself with the language, there seems to be something truly interesting there, but I just don’t grok functional programming yet.

One item in particular that I’ve seen is the Record data expression.  This allows you to create an immutable data structure, like so:

type Data = { Count : int; Name : string }
let data1 = { Count = 3; Name = "Hello"; }

Then, if at a later time you wish to change Count but keep Name the same, that’s absurdly simple.

let newData = data1 with Count = 4;

C#… does not have anything like this.  To create a similar immutable data structure (including equality checking), you’d have to do something like this:

using System;
using System.Collections.Generic;

public class Data : IEquatable<Data>
{
    private readonly int mCount;
    public int Count
    {
        get { return mCount; }
    }

    private readonly string mName;
    public string Name
    {
        get { return mName; }
    }

    public Data( int aCount, string aName )
    {
        mCount = aCount;
        mName = aName;
        return;
    }


    public Data ChangeCount( int aCount )
    {
        return new Data( aCount, mName );
    }

    public Data ChangeName( string aName )
    {
        return new Data( mCount, aName );
    }

    public bool Equals( Data aOther )
    {
        bool lResult = false;
        if ( aOther != null )
        {
            lResult = ( this.Count == aOther.Count &&
                        this.Name == aOther.Name );
        }
        return lResult;
    }

    public override bool Equals( object aOther )
    {
        bool lResult = false;
        if ( aOther is Data )
        {
            lResult = Equals( aOther as Data );
        }
        return lResult;
    }

    public override int GetHashCode()
    {
        return Name.GetHashCode();
    }

    public static bool operator ==( Data aLeft, Data aRight )
    {
        return EqualityComparer<Data>.Default.Equals( aLeft, aRight );
    }

    public static bool operator !=( Data aLeft, Data aRight )
    {
        return !EqualityComparer<Data>.Default.Equals( aLeft, aRight );
    }
}

That’s a lot of work! In F#, what takes a single line takes 70 in C#. And a lot of that is nasty, crufty copy-paste code. And its easy to forget to change some things, like the Equals method.

Well, let me correct myself. That would be a lot of work… if I wrote that. But I didn’t. I just wrote this:

<#
this.Namespace = "Example";
this.ClassName = "Data";
this.ClassScope = "public";
this.ImplementINotifyProperty = false;
this.HashCodeVariable = "Name";
this.Variables = new List<Variable>()
{
    new Variable( "Count", "int", Options.Immutable | Options.ChangeMethod ),
    new Variable( "Name", "string", Options.Immutable | Options.ChangeMethod ),
};
#>
<#@ include file="DataClass.tt" #>

What is this mysterious mumbo-jumbo? That, sir (or madam), is T4: Microsoft’s Text Template Transformation Toolkit (aka a code generator). It is included in Visual Studio 2008, but it isn’t widely advertised.

My DataClass.tt file is a horribly messy template that takes in the values I listed above, and translates them into the real source code example I pasted above. Besides immutable data structures, it also supports mutable members, including support for INotifyPropertyChanged and [Member]Changed events.

I’m rather liking this so far. If it turns out that this code generation is a horrible idea, I can simply delete my .tt files and use my auto-generated .cs files from then-on with little loss.

Note that the following source code is not well documented, and is not very error tolerant. If you do something silly, chances are you’ll get an obtuse compilation error. I recommend modifying it to suit your own needs.

Data Class Code Generator Source Code (11 KB, requires Visual Studio 2008)

Fallout 3: The Lone Wanderer Fights for Decency

May 11th, 2009

The Lone Wanderer killed everything in the Satellite Facility.  They deserved it, after all.  With Liberty Prime… well, let’s just say Broken Steel, the Enclave deserved every laser and plasma blast.

In fact, he was in such a zeal for death and destruction that many of the crates and shelves were simply skipped past.  Upon downloading the encrypted transmission, the Lone Wanderer back-tracked and hunted for any spare ammo and other goodies.

However, fate had something different in mind.

Lo!  As the Lone Wanderer imagined himself falling down the stairwell to his death (it felt like deja vu), the Enclave had him surrounded!  He turned on V.A.T.S. and noticed… they weren’t wearing… clothes.  Well, sure, t-shirts and shorts, but their armor was missing.

Now, in addition to killing just about every good person in sight, the Enclave had now declared a war on Decency.  This could not stand.

Dude, wear some pants

Never mind me...

Let's see what kind of loot these indecent mongrels have

They... have power armor... but they're not wearing it?

What Is Up With The Feet?

April 20th, 2009

Spotted at this Burger King at Northland Dr and Cannonsburg Rd on Sunday, April 19th:

What is up with the feet?

Also spotted at this Independent Bank the same day, but I didn’t take a picture.

Something strange is happening.

I Need To Do Dishes More Often

April 18th, 2009

The following pictures document what I found in my sink’s garbage disposal just minutes ago.  I am not kidding.

Ahh, a little leaf thing

I don't remember eating anything like this...

Whaaaaaaaat the!?

Duuuuuude!

It's a freaking ecosystem!

As near as I can tell, this is what you get when you throw cantalope seeds down the drain, but you forget to turn the garbage disposal on.

Backup Adventures

April 12th, 2009

I’ve been having rather lucky tragedies with my hard drives lately.

1) Lost a hard drive last year (thankfully, it was RAID 1).

2) Two weeks ago, my computer decided to pretend that a hard drive no longer appeared.  I opened up the case, confirmed the cables were connected, and long-story-short my boot record on a secondary drive had vanished.  I was able to recover it, after some difficulty.

After last year’s near-miss, I had signed up for XDrive, but the upload speeds were atrocious, and it stopped working one day.  I didn’t really mind.

Now, though, I’ve signed up for an account with Mozy Home, and I’ve been pleased thus far.  It basically just runs in the background, and uploads any new documents or other files for you automatically.  And it’s fast.  You can also define which files to upload (say, ignore pdb files, but include cs files).  And its free for 2 GB, and only $5 a month for unlimited.

I expect that Mozy will stop working one day, and the cycle will repeat.

P.S. I learned some new googlefu:

<Tech Term> site:lifehacker.com

There’s so much absurd spam and crap in normal google searches, it can be really difficult to find things that actually work.  Thankfully, lifehacker seems to have documented at least some of the tools that work, and is a quick way to find gold.