I don’t mind if I’m incomprehensible

Cloning Windows 7 onto yer SSD (Yet Another Method Of)

with 4 comments

I bought a SSD (the Intel X-25M) for my computer, partly because I read on the interwebz that running a virtual machine on a separate physical drive would greatly improve its performance. I also read on the interwebz that it’s possible to clone an install of Windows 7 from a HDD onto the SSD.

Well, it’s all gravy until things don’t work. And they sure it didn’t for me. I tried various tools in many different combinations over two long night. The steps below are what worked for me. YMMV (but probably not).

First, if you are reading this on the Windows 7 instance you want to clone, resize the OS partition to a size smaller or equal to the size of your SDD minus 100MB. It is easier to just make it slightly smaller. A perfect match in sizes is not necessary. You can do this with Windows 7’s Disk Management tool, which you can find by typing “partition” into the start menu search. Now download and install DriveImage XML. It’s free (as in beer).

Now shutdown your computer, disconnect your HDD, and start installing Windows onto the SSD. The install process will reboot the computer at some point. When that happens, interrupt it by going into the BIOS or something, and then shut the computer down. You don’t not need to finish the install.

Next, plug your HDD back in and change the BIOS to boot from it. Once you are back in Windows 7, you can see in Disk Management that there are two partitions on your SSD. One system reserved 100MB partition and the rest of the disk in a second partition. Neither of these have a drive letter assigned.

Fire up DriveImage XML. Select Drive to Drive copy. While selecting the source partition, check the “Raw Mode” option for some hardcore sector by sector cloning action. Then select the unfinished Windows 7 partition on your SSD as the destination.

Once DriveImage XML finished copying the partition, reboot the computer. Go into the BIOS and change the settings to boot from the SSD.

It should boot. You will see a screen saying that Windows was not properly shutdown. That’s because it was cloned while it was running. It’s cool. And you’re done. (And you know what, you’re welcome.)


Written by Barry

July 9, 2010 at 3:34 pm

Posted in Nerdy

Tagged with ,

Installing and Using Google V8’s sample shell

leave a comment »

The sample shell that comes with Google’s V8 javascript engine is pretty nice for playing with naked, DOM-free javascript.  Here are some notes to augment Google’s download and build documentation.

If you are building on a Mac, download and install Xcode with the the Unix development tools option selected.  This will take care of the compiler and libraries required for the build.

I symlinked the shell to /usr/local/bin/v8 for easy access.  v8 below refers to that, not the project name or the project source directory.

Naturally, typing in v8 starts the interactive shell. v8 --shell does the same thing.

v8 -e followed by a string of javascript allows you to execute that piece of code.

v8 followed by one or more file paths tells the shell to load and run the javascript files in the given order. Now if you add the aforementioned --shell, the sample shell will load and execute the file(s) and then starts the interactive shell.

You could also load files while in the shell by calling the load function. For example, load('hello-world.js'); will load and execute the file hello-world.js from the current working directory. Since the sample shell provides the load function, you could also use it in your javascript code. So instead of typing in v8 followed by over 9000 file paths, you could specify a file that in turn loads the other necessary files.

Another function the sample shell provides is print. That one’s self-explanatory.

There is also a read function, which reads a file into a javascript string.

If you know of a more advanced V8 shell, please leave a comment.

Written by Barry

April 3, 2010 at 8:12 pm

Posted in Nerdy

Tagged with , ,

JavaScript Closures (a fairly simple explanation of)

with 3 comments

I had a job interview recently.  I started the day by missing a flight, and then it was mostly downhill from there.  However, I did pretty much nailed a JavaScript question where the solution involved using closures.  The interviewer sounded surprised that I gave the solution; I was surprised at his reaction because I thought higher order programming, anonymous functions, and closures are common knowledge in JavaScript programming.

Below is my attempt at an explanation of what was used in the solution.  Hopefully it will help someone in an interview.

In JavaScript, you could define an anonymous function and immediately execute it:

(function(){ alert('zombies!'); }())

The wrapping parentheses are necessary here to turn that piece of code into an expression.  Otherwise you’d have a function declaration without a function name, and the JavaScript console will say something about a syntax error.  Alternatively, you could also write

(function(){ alert('zombies!'); })()


var testo = function(){ alert('zombies!'); }();

In the last example, we could leave out the parentheses because the code is in an assignment expression.

Of course, a function can accept arguments, so now let us do

(function(thing){ alert(thing); })('zombies!');

Same thing, but more work.

JavaScript functions can also create and return functions.  That means we can rock

(function(thing){ return function(){alert(thing);} })('zombies!')();

That’s even more work, with more parentheses.  In the above example, we create a function and called it with the string ‘zombie!’ as the argument.  That (outer) function then creates a function and return it, then we immediately call it with that last pair of parentheses.

To make it (slightly) more readable

var testo = function(thing){ return function(){alert(thing);} })('zombies!');

testo is the function returned by the outer function. And it always alerts about zombies. That’s the closure bit. The string “zombies!” has been closed over in the returned function.

One instance where this is useful is when you need the value of a variable that’s being updated, let’s say, in a loop. For example

var things = ['ghosts!', 'ghouls!', 'vampires!', 'zombies!'];
var alerts = {};
for (var i in things) {
    alerts[things[i]] = function(thing) { return function(){ alert(thing); }; }(things[i]);


There we go, closures.

Written by Barry

March 13, 2010 at 4:52 pm

Posted in Nerdy

Tagged with ,

(Small) Profit!!!1

leave a comment »

Hey, sexy readers, I’m in the process of selling my domain, so I’ve moved my blog to  Everything will be automatically redirected until the domain is actually sold and transferred.  But you should update the feed url on your fancy blog reader.

Written by Barry

October 26, 2009 at 9:03 pm

Posted in General

Tagged with


with one comment

It has been more than six months since my surgery.  Here’s an update, with photos and grammatical errors.

Six weeks post-op.

Pretty much everything I read before the surgery said that I will be able to eat after six weeks.  Naturally I was pretty excited when I reached six weeks post-op, and then I was equally disappointed.  I tried but I couldn’t really eat.  My mouth didn’t open very wide, I couldn’t move the food once I got some in my mouth, and I couldn’t feel what the hell my teeth were doing.  Oh well!

Three months post-op.

Not that different from the photo above.  Although it was nice to kind of have my chin back.  (That’s my “good side” of course!)

My forehead and the tip of my nose always have been fairly oily, but during the healing process my entire face became extremely oily–something about healing nerves.  I considered applying for an OPEC membership.

Also, using a sonicare toothbrush on a mouth full of healing nerves is the most ticklish thing ever.  Srsly.

Six months post-op.

Ok, I don’t know what’s with the this picture. I look like I was high or been hypnotized or something.

Six months post-op. My less-good side.

(Thanks to Joe for taking these photos.)

Ok, X-rays…

That’s a month before the surgery, after about two years of braces, of which you can see in the picture.

That’s after, without the braces.  That shiny stuff are my fillings.  Notice all that stuff holding my upper jaw.  The effect is slightly exaggerated compared to the before picture because I was looking down a little more in the after picture.

You can see the screws for lower jaw better here.

As for the results, I don’t have an underbite anymore, but my bite still isn’t great.  My molar aren’t touching when I bite together, so while I can bite I can’t grind my food.  My orthodontist said I should wait a year before I should do anything about that because my bite could still change.

My lips still feel numb and a little stiff, especially the upper.  Occasionally I still get muscle spasms, which make my teeth clank together.  Not particularly painful, but annoying nonetheless.  I had a burger yesterday and I was just barely able to open my mouth wide enough for it.

Anyway, enough bawwwing.  The healing process could take up to a year.  I’ll post some before-and-after pictures then.

Written by Barry

May 10, 2009 at 11:41 pm

Posted in General

Tagged with ,

Do I?!?

leave a comment »

I have a fake date o’ birth on Facebook, because that’s just how I roll.  Combine that with my relationship status of “Single” –since Awesomely Free wasn’t an option– it means that 99% of the ads I get are “LOL U R OLD AND SINGLE MEET OLDER SINGLE WIMMINZ”.  These ads are usually accompanined with photos of college aged women.  Ridiculous.

(I use Google Chrome on mah super old PC at home –sorry Mike and Wil!– so I don’t get the AdBlock goodness.  And my hosts file can only do so much.)

And earlier tonight I saw this:

If I’m not mistaken, and I certainly am not, that is Elisha Cuthbert, who is famous for being hot.  C’mon now, if you gonna do that, put up a picture of Salma Hayek, who is actually over 40.

The last time I saw Elisha Cuthbert’s image misused without permission was on one of those cards “they” hand out on The Strip in Vegas.

Written by Barry

February 2, 2009 at 2:14 am

Posted in General

Tagged with

Post-op Photos

with 3 comments

I peeked at my files while I was waiting during a post-op appointment; the surgeon’s plan was to move my upper jaw forward roughly 3mm and down 2mm (apparently my upper teeth had a bit of an angle) and my lower jaw back roughly 3mm.

one day post-op
One day post-op.

A few people asked me about being in pain. There wasn’t much pain. The post-op experience is more pain in the ass than painful.

Imagine all the things you can do with your facial muscles. Well, now you can’t. You basically have no control of anything on your face below your eyes. (It would be totally fucked up if you lost control of your eyelids no?) Can’t smile. (It hurts to watch The Daily Show and Colbert Report.) Can’t spit. (You’ll miss this very much when you cough up stuff behind your banded teeth and after rinsing your mouth with stuff.) Can’t suck. (Some people brought up drinking through a straw when they learn of my surgery. I wish; milkshakes would’ve been very nice.) And so on. Oh, your face is also the size of Jupiter. And for about a week you’re constantly drooling, which is extremely inconvenient. And for a day you can’t breathe through your nose at all.

So there you are, standing over the sink, drooling out of the front of your mouth, sucking air through the back of it, and then you’d try to drink your meds and food without losing a quarter of it to the sink.

There’s more, but of course everything improved gradually. Very gradually. (Parentheses!)

Four days post-op.

Note the yellow bruising on my face and neck.  It didn’t stop there…

Six days post-op MySpace foto 5tyle.

It got even wider and moved slightly lower after that picture was taken. I still have a couple of spots on my chest after almost four weeks.

One week post-op.

12 days post-op.

Two weeks post-op.

Finally told my sister that we want to see the changes on my face, not the wall or my torso. In other words: zoom in plz.

When Joe and Sam got their kittens, I put up a picture of them with me. Now that they’ve got a child…

Barry: 20 days post-op. Penelope: 0 day post-birth.

Lil’ Penny: Uncle Barry, what the hell was wrong with your face?
Barry: Where the hell did you learn to talk like that? I know your parents don’t speak like that.

At any rate, when I score the x-rays, I’ll put them up.

Written by Barry

November 24, 2008 at 10:54 pm