Recover Broken Word 2007 Documents by Hacking the XML

0 Comments

I like Word 2007 but like all Microsoft products, it comes with the affliction of complication. Word (and the Office Open XML format) is so complicated that there are a zillion possible things that could go wrong. Chances are one of them is going to happen at some point. The moral of the story is, observe the motto of “Save Early. Save Often.” and you might avoid such a catastrophe. But if you’re lazy like me and forget to back up, this might happen.

Word is being funny, you are messing around with equations that aren’t behaving right. You try to save and it won’t let you save for some reason. You think “Oh I’ll just restart to make Word all better again.” You restart and your effing document won’t open with an error something like:

The Office Open XML file FileName.docx cannot be opened because there are problems with the contents.

WTF!? This was your only copy of the document! OMG! After you have taken a vallium, do the following:

Click Details on the error dialog and note down the location of the error (e.g. /word/document.xml, Line: 2, Column: 65946).

Rename your faulty document to FileName.docx.zip and extract it into some folder.

Open up the XML file listed in the error message and locate the offending column. For this you might want to download XML Copy Editor or any other editor that has the features we need. You can see the column number in the status bar.

The offending error will probably be an XML tag. In my case column 65946 was at the * below (* has been added)

... </w:t></m:r><m:ctrlPr*><w:rPr><w:rFonts w:ascii="Cambria Math" ...

So the error is in the <m:ctrlPr> tag. Now you need to add a fake attribute to the tag called a="aaaaa" or something easily identifiable that won’t occur naturally in the Office XML. Your tag should look like this.

<m:ctrlPr a="aaaaa">

By default, the XML is all on one line to save on space, but we need to fix that to delete this tag.

In XML Copy Editor, select Pretty print from the XML menu. Now search for “aaaaa” or whatever you called your fake attribute. You should now be able to visually see the entire tag.

<m:ctrlPr a="aaaaa">
  <w:rPr>
    <w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/>
    <w:i/>
    <w:lang w:val="en-AU"/>
  </w:rPr>
</m:ctrlPr>

Now just delete the whole <m:ctrlPr> tag and save the document. You can leave it in Pretty Print, it will still be valid XML.

Re-ZIP the contents of the folder you extracted to and rename document back to FileName.docx.

Try to open in Office 2007. If it works, Hooray! If it doesn’t, and you get another error, repeat this process. Else retype your 10,000 word document!

Tags: , , , , , ,
Categories: Unsorted

Clouds from ICT

0 Comments


Clouds from ICT

Originally uploaded by frostnova

Taken with my iPhone from the Melbourne Uni ICT building and colour enhanced using iPhoto (its not cheating, just allowing the sky to achieve its full potential)

Tags:
Categories: Unsorted

Google Wave

0 Comments

Yes, it’s finally happening! Recall in my previous post about feeds, I mentioned that feeds were great for abstracting website content but we didn’t have anything like that for discussion. The trimmed quote:

“The web is a dynamic medium, and one example of this is the discussion features provided by websites. It’s functionality like this that will see readers tearing themselves away from the purity of their feeds. You can’t post a comment without visiting the actual website… yet. It won’t be long before we have … an open standard for abstracting website discussions into the feed reader, possibly eliminating the need for a website altogether.”

This is essentially Google Wave. The demo contained no specific example of abstracting blog comments into the wave client but I’m certain someone will write an extension; after all it’s open source.

I am really excited that Google have decided to push the web in this direction. If you’ve got a spare hour and 20 mins, go watch the demo. You WILL be impressed.

Tags: , , ,
Categories: Uncategorized

Lawrence Leung’s Script Your Own Adventure

1 Comment

I *really* wanted to love Lawrence Leung’s satirical TV series, which recently screened on ABC. His Rubick’s-loving, MacGyver-worshipping nerdy persona has great potential to be a real cult hero. Leung could have excelled as a no-holds-barred ubergeek on a heroic quest in the name of all geekdom, but instead he dawdles through nine weeks of unfulfilment in denial; on quests for mediocre pursuits.

The show has some funny moments, and is not lacking in casual entertainment value. Its nostalgia almost sucked me in completely, but it just wasn’t believable enough. Really top notch satire exhibits such a sharp truth that leaves the viewer roaring with laughter at the uncanny accuracy, take The Hollowmen for example.

In an effort to amplify his own self-perceived lameness for the purposes of comedy, Leung’s “adventures” turn into overwritten, overacted stereotypes, most of which have a predictable outcome.  Perhaps the show sits too precariously on the fence between reality TV and transparently scripted comedy.

To illustrate, think of how Flight of The Conchords makes no attempt to masquerade as a factual documentary. The whole series is so obviously scripted, so it fits nicely into the category of “sitcom” and the audience is comfortable. Summer Heights High is the same. Despite its opening title claiming authenticity, the supporting characters treat Lilley’s creations just as they are written; instead of reacting to their mildly unsettling surreality, as we do as the audience. It has long been said that great humour comes from truth, but that’s what’s lacking here.

With one foot in the reality camp, Leung encourages the audience to see his character as a real person. Maybe that’s what he wants, but its not him, its the “made for TV” version of him, who has been artificially altered. I’m sure a lot of the script draws factual inspiration from Leung’s childhood, but its the interactions with other characters that most lack authenticity. While the Chaser-style stunts have some initial shock value, we know that in reality, premeditation is required if you want to achieve the desired follow-through.

For example, you don’t rock up to a stranger’s house and start waxing his floors and car Karate Kid style. You approach him and sell him the show’s agenda, give him a few lines and then start filming. This ensures the quality of “drama” matches your preconceived ideal. However, one stunt I could not accept was rocking up to the front gate of MacGyver creator Lee David Zlotoff’s home for an “impromptu” interview. Seriously, he would just call the cops or tell you to fuck off.

We also see evidence in the school teacher reunion scene of the discontinuity inherent in these stunts. You can just about pinpoint the exact edit. The scene starts off with Leung being the sweet genuine guy with an innocent agenda. It rapidly switches to the reality induced by an off-camera explanation and script run-through.

So they set it all up beforehand. That’s fine and dandy. What grates here is the slimy attempt at presenting obviously prearranged sequences as reality. The result is that we see through their veil and the humour simply drains away.

Rush out of the bushes with all the urgency in the world, shake those cameras as hard and convincingly as you can. Blur that man’s face so we think he’s actually a real person. Sorry mate, I’m just not buying it.

Tags:
Categories: Uncategorized

Microwaved mobile phone

0 Comments

In the spirit of Gruen, I found this great vid. Its cooler than you think.

Tags: , , , ,
Categories: Uncategorized

Paddock Bashing

0 Comments

This has been sitting in my draft for months so I thought I might as well post! Cue nostalgia.

That segment on Episode 3 of Top Gear Australia totally took me back to my childhood. We thrashed around in “The Bomb” as we called it, and with the utmost of respect I can assure you. It was a white Datsun 1000 that Dad picked up for a few hundred dollars at a clearing sale. Bargain! Even more so since the boot was filled with over $400 worth of junk the owners had forgotten about since it didn’t open. Ski gear, some powertools, etc.

At first, it didn’t actually have a knob for the gear stick. When we found an old spare, the diagram didn’t actually match up to where the gears were, which was cause for much grinding. “Can’t find em? Grind em!” as our bus driver would say. We always felt so elite explaining the gears to newbies, cousins and such - anyone who had never driven it before.

To open the boot you had to stick your thumb into a precarious, potentially spider-filled hole in the boot lid and flick the internal lever just the right way while gently nudging the boot lid downwards. Only then would it pop open. I must admit, I had it down pat and still have the muscle memory.

We must have used the boot for something as I remember opening it so many times. I suspect it was mostly used to courier cubby supplies and possibly the occasional unsuspecting family pet. For some reason I also remember there being a tin of pink pumpkin seeds in the boot. I don’t think they were the eatin’ kind. Someone will know what that pink stuff was.

Paddock bashing is all fine and dandy, but when your farm has a 900m airstrip, that changes everything. I would love to boast about the epic drag races we had, but having only one paddock basher put a dampener on that idea. Our intolerably controlling parents (at the time) instigated a rule that we never exceed third gear in the old wreck. This resulted in an effective speed limit of about 60 km/h. And Dad, the smart alec father that he was could tell by listening if we ever broke the rule. But that was no problem. You just had to drive far enough away so Dad couldn’t hear ;-). Hang on a sec while I change into my speed racer outfit.

But simple rebellion for the sake of it, whilst not lacking in thrills, became somewhat of an adolescent cliche. And the threat of a sans-Bomb lifestyle always loomed. So we decided to get creative. We mapped out a race circuit around the house, over to the shed, around that tree with all the machinery under it, over past the tip then back to the house. We’d each set our time in the Bomb then the other would try and beat it. Then when that got boring, we’d try and beat our Bomb times on the four-wheeler. Oh what shenanigans!

The Bomb was destined for a fate not uncommon to paddock bashers. Gradually, it began to idle higher and higher until one day it just overheated and blew up in a furious and spectacularly dangerous explosion… OK so maybe it just stopped going. Dad gave it away to someone a couple of years ago so hopefully it will see some kind of rebirth or at least facilitate some vulture’s DIY as a source of parts.

Anyways, R.I.P. Bomb. Thanks for the memories. I should dig up a picture of you one of these days…

Tags:
Categories: Adventures

Greasemonkey and Stylish as time management devices

0 Comments

I must reiterate my undying love for Greasemonkey and its styletastic cousin Stylish, two indispensable Firefox Addons. They have both saved me countless milliseconds over the years and it all ads up! Basically they take that haphazard version of the web you’re faced with due to poor design or lack of functionality and kick it up a notch… BAM!

One such innovation dramatically improves eBay searches. Usually, they look something like this: you have items with a picture icon but the seller hasn’t paid for “Gallery Picture” so no thumbnail for you.

The script adds eBay thumbnail images to searches by fetching the image from the item page. The result is:

Neat huh? Now I regularly find myself thinking “I wonder if there’s a Greasemonkey script for that” and usually there is.

Other scripts I use:

  • Super Linkfier (Greasemonkey) - No more browsing forum and being forced to copy and paste URIs. This makes EVERY URI a link, including email addresses.
  • YouTube Automatic fmt=18 Adder (Greasemonkey) - Hack that forces ALL videos to display in high quality.
  • Big fonts on wikipedia main content (Stylish) - This one’s self-explanatory.
  • Block Facebook Ads (Stylish) - due to constant changes and slew of choice I suggest you search for this.
  • Block Gmail adds (Stylish) - ditto.
  • Google Image Relinker (Greasemonkey) - Search results link straight to the image, not that annoying frame page.
Tags: ,
Categories: Uncategorized

Flickr has feeds

0 Comments

I just realised Flickr has feeds for photostreams. Awesome. You can subscribe to mine here.

Tags:
Categories: Uncategorized