Reviews and links for July 2010

By Robert Ellison. Updated on Friday, February 24, 2017.

Imperial Bedrooms by Bret Easton Ellis

4/5

Returns to the characters of Less Than Zero twenty five years later. I don't think it's a plot spoiler to say that they're not happy and well adjusted people. I found Glamorama to be pretty tedious and Lunar Park only marginally better. It was a huge relief that Imperial Bedrooms just flows. It's a welcome return to his earlier narrative style. Dread and paranoia are visceral presences from the start and then layers of fear and horror build until it can't get any worse and then somehow does. Brilliant.

 

Blue Ocean Strategy: How to Create Uncontested Market Space and Make Competition Irrelevant by W. Chan Kim

2/5

Given its pedigree it's missing two segments - the yellow ocean (no competition, no customers) and the purple ocean (high competition, no customers). They must be saving those for a sequel. I read this because a few people had recommended it and if you think the ideal market to play in is one with no differentiation and high competition then it's a must read. Otherwise the only real value is being conversant with the buzz word. Evaluating past successes with 20/20 hindsight and talking about their 'blue ocean strategy' is a classic business book selection bias. If you learn anything from the case studies it should be that breakout innovation doesn't come from your ocean, hedgehog principle or current cheese location.

 

61 Hours (Jack Reacher Series, #14) by Lee Child

3/5

Well constructed if average plot. This is the Empire Strikes Back of Reacher novels and ends on a bit of a cliffhanger - the next in the series is out later this year and hopefully picks up the pace a bit.

 

Professional C# 4 and .NET 4 by Christian Nagel

4/5

I own the 2005 and 2008 flavors of this book as well. It's the best overall C# reference I've found and this 2010 version is a welcome update. As with the 2008 book it could use a better guide to new features, but still very highly recommended.

 

Ina May's Guide to Childbirth by Ina May Gaskin

3/5

It's a somewhat troublesome mix of advice and propaganda. The advice seems mostly solid, practical and grounded in a great deal of experience. The book ends with the most important - don't think that your body is a lemon, pregnancy isn't a disease, you can do it. Ina May's statistics from "The Farm" are compelling as well, but the birth stories are a bit far out. They typically sound like: 'Sunflower, hanging from the birthing gallows while member of the Farm suck her nipples and I bring her to repeated orgasm, didn't even notice that her baby had been born'. For most people there's probably a middle ground between technocratic doctors and hippie midwives. When the book veers into propaganda it seems there's no anecdotal story too weird to make the case for natural childbirth and no study rigorous enough to suggest that there might be nothing to this modern medicine fad. Some suggestions - like that obstetricians don't believe that nutrition has a role in healthy pregnancy - are just so ridiculous that they case doubt on the rest of the book. And yet, her statistics are so very good while US hospitals force you into a caesarean section to prevent lawsuits and not miss happy hour. I guess the only conclusion to reach is to give birth in The Netherlands and then move to Sweden to take advantage of their twenty year maternity leave...

 

Links

- Frogger from xkcd.com (don't miss the alt text).

- Say fat not obese, urges minister from BBC News - Home (also 'a bit poorly' rather than 'cancerous').

- MoD 'must not live beyond means' from BBC News - Home (Easy fix... bring troops home and send National Audit Office to scold Iraq and Afghanistan into submission.).

- Vatican mulls sex abuse of impaired adults from All Salon (Hint: if you don't know the number for your local police department 112 will work on most mobile phones.).

- Call for school rugby scrum ban from BBC News | News Front Page | World Edition (Where was Professor Pollock when I was at school?).

- Grandmothers link orcas to humans from BBC News | News Front Page | World Edition (Could it be that the mothers also have mothers? Like necessarily?).

Add your comment...

Related Posts

(All Reviews)

Time Zone Time Lapse

By Robert Ellison. Updated on Saturday, February 19, 2022.

The video below shows twenty-four hours from noon UTC to noon UTC on June 7, 2010 using webcams from the Catfood WebCamSaver database. It proves that I really will do anything to avoid finishing off the new Catfood web site.

You can probably figure out that the three blocks of cams are the US, Europe and Japan. The position doesn't reflect the latitude in this version, it's just a random selection of cams for the timezones represented in the database. As it's July and most of the cams are in the northern hemisphere you'll see long days and short nights. I'll try to remember to create an updated version around the autumnal equinox.

The program that generated the frames ended up being simpler than i thought. Because it's fetching images from a lot of different sources I had a timer creating and then saving a frame once a minute and lots of worker threads fetching the images. Each worker thread is assigned a frame number and once it's got the image it locks the main frame and tries to paints it's own area. If the frame number has moved on the image is abandoned. You can see some of the cams flickering on and off in the video — these went down while the frames were rendering or just took longer than a minute to respond.

Add your comment...

Related Posts

(More Timelapses)

(Published to the Fediverse as: Time Zone Time Lapse #timelapse #timezone #catfood #webcamsaver #video Time Zone time lapse showing twenty four hours around the world with webcam images from Catfood WebCamSaver. )

Reviews and links for June 2010

By Robert Ellison. Updated on Friday, February 24, 2017.

Tell-All by Chuck Palahniuk

2/5

A barely reheated Glamorama (celebrities and brands in bold face) about star-fucking in the form of a movie script. Enough Palahniukisms to make it worth finishing (for me), but only because it was mercifully short.

 

Links

- BP 'trusted partner' of Olympics from BBC News | News Front Page | World Edition (Appropriate given that much of the Olympic site is toxic sludge covered in a thin layer of plastic wrap...).

- Falls cost NHS millions each day from BBC News | News Front Page | World Edition (Are they falling on expensive scanners or something?).

- Should nuts be banned on commercial flights? from All Salon (Ban them? I can't remember the last time I was served anything as luxurious as a peanut on a US flight...).

- Call to regulate artificial life from BBC News | News Front Page | World Edition (Public should have studied harder at school then.).

- City of Smarty Pantses from Spots Unknown (Says more about cost of living maybe?).

- "A hundred mile oil lake at the bottom of the Gulf that's 500 feet deep." from jwz (Hopefully this guy doesn't know what he's talking about...).

- Dolphin uses iPad as way to communicate with humans from Boing Boing ("S_ l_*g *nd th*nks !or *ll the !ish" - but what can it mean?).

- Feds meet with film director Cameron on oil spill from SFGate: Top News Stories (They can get rid of it in post-production?).

Add your comment...

Related Posts

(All Reviews)

WPF commands with nested focus scope

By Robert Ellison. Updated on Sunday, September 30, 2018.

Here's a frustrating WPF scenario — you use the ApplicationCommands class to add Cut, Copy and Paste commands to toolbar and then put a TextBox on another toolbar. Click in the TextBox and the commands remain disabled. WTF, WPF?

The problem is with focus scopes. Your window is a focus scope and so are any menus or toolbars. This has the desirable property of allowing commands to target the control you were in immediately before invoking the command. You want paste to target the text box you're editing, not the menu item or button you clicked to request the paste.

So far so good. The problem is that the commanding system isn't smart enough to target the control with keyboard focus if it's in a nested focus scope. Remember that the window itself is a focus scope so our TextBox in a ToolBar (also a focus scope) is nested and immune to commands from our menu or toolbar.

Here's a simple window that demonstrates the problem:

Ignore the PreviewCanExecute handler for now. If you run this window and click in the main TextBox the paste button and menu item are enabled. Click in the toolbar TextBox and pasting isn't an option. Well, Ctrl-V still works and there's a context menu but you know what I mean.

The problem can be fixed by adding a command binding for ApplicationCommands.Paste and handling the PreviewCanExecute event:

When the window loads we're making note of the focus scopes for the toolbar and menu. Then when PreviewCanExecute fires we check to see if the element with the keyboard focus is in a different focus scope (and also that the window doesn't have keyboard focus). We then set the CommandTarget for the menu item and button to the element that has keyboard focus.

A handler isn't required for CanExecute as the command will take care of this with respect to the new CommandTarget.

Run the window again and you'll see that the paste button is enabled for both of the TextBox controls. When you click the button (or menu item) our PreviewCanExecute handler ignores the new keyboard focus and the command is sent to the desired control. 

One drawback of this approach is that keyboard focus isn't returned to the TextBox after the command executes. The CommandTarget remains in place so you can keep pasting and the command remains enabled but you lose the visual cue that lets you know where the target is. I haven't figured out a clean approach to this yet. When I do, I'll update this post. Better yet, if you've figured it out leave a comment.

Add your comment...

Related Posts

(All Code Posts)

(Published to the Fediverse as: WPF commands with nested focus scope #code #wpf #.net #c# #xaml How to persuade a WPF application to paste into a selected control when the control is in a different focus scope. )

Converting Blogger ATOM export to BlogML

By Robert Ellison. Updated on Thursday, December 26, 2019.

I'm slowly converting a number of blogs from Blogger to BlogEngine.NET. The least fun part is dealing with the Blogger export file. For this blog I used a Powershell script but had problems with comments not exporting correctly and it was quite painful to fix everything up. Blogger allows you to export a copy of your blog using ATOM, however BlogEngine.NET (and other tools) speak BlogML.

I've just released a command line tool that takes the ATOM format Blogger export and converts it to BlogML. You can download Blogger2BlogML from GitHub. The tool uses .NET 4.0 (client profile) so you'll need to install this if you don't already have it. If you give Blogger2BlogML a try let me know how you get on. 

Add your comment...

Related Posts

(All Code Posts)

(Published to the Fediverse as: Converting Blogger ATOM export to BlogML #code #blogger #blogml #codeplex #c# #.net Tool that converts Blogger ATOM blog export files to BlogML for importing to a different blog engines. )

ESRI Shapefile Library Update

By Robert Ellison. Updated on Sunday, May 23, 2021.

I've just released a small update for my ESRI Shapefile Reader project on GitHub. The only change is a patch from SolutionMania that fixes a problem when the shapefile name is also a reserved name in the metadata database. The patch escapes the name preventing an exception from being thrown.

Catfood.Shapefile.dll is a .NET 2.0 forward only parser for reading an ESRI Shapefile. Download 1.20 from GitHub.

Add your comment...

Related Posts

(All Code Posts)

Reviews and links for May 2010

By Robert Ellison. Updated on Friday, February 24, 2017.

Founders at Work: Stories of Startups' Early Days by Jessica Livingston

4/5

Over 30 interviews with tech company founders ranging from Ray Ozzie and Mitch Kapor to James Hong of "Hot or Not". The interview with Philip Greenspun of ArsDigital is very raw and very amusing. Joel Spolsky's advice is "So quit your day job. Have one other founder, at least. I'd sat that's the minimum bar to getting anywhere." - well, that plus have a hit blog read by developers and then sell tools for developers. Diverse, inconclusive but fascinating.

 

The Girl Who Played with Fire (Millennium, #2) by Stieg Larsson

4/5

Picks up the pace from the first book in the trilogy. Looking forward to the third, which comes out in the US in a couple of weeks.

 

Links

- Let’s Get Small from I, Cringely (Way to kick Zuckerberg while he's down...).

- Fewer women get mammograms after program cuts from SFGate: Top News Stories (Nice one CA. I bet treating undetected and uninsured breast cancer will be a bunch cheaper :().

- Church warns cell scientists not to play God from All Salon (Surprise surprise. Correction, so far we have Evolution and Venter...).

- Cordoba scandal from BBC News | News Front Page | World Edition (Really, shocked? Not been reading the news much then...).

- Toddlers who lie will do better, research suggests from BBC News | News Front Page | World Edition (Fair disclosure - the research was conducted by lying toddlers...).

- Calif sea lion shot in face has new home from SFGate: Top News Stories (Getting shot is bad enough... Six Flags is torture.).

- Fresh BA strike dates announced from BBC News | News Front Page | World Edition (Hopefully they'll correspond with large plumes of ash.).

- Fan updating David Lynch's "Dune" with modern FX from Boing Boing (You're making it worse. Stop.).

- Neanderthal genes 'survive in us' from BBC News | News Front Page | World Edition (Um, the surprise would be if this wasn't the case.).

- Terry Pratchett: Doctor Who isn't science fiction from Boing Boing (Shouldn't think of it as one show. It's more of a framework for different authors to create plot around - some are very hard SciFi and some are very silly.).

Add your comment...

Related Posts

(All Reviews)

Do useful things with the volume shadow copy service (VSS)

By Robert Ellison. Updated on Thursday, November 12, 2015.

The Volume Shadow Copy Service (VSS) takes a snapshot of an NTFS drive at a point in time. The clever thing about VSS is that it doesn't copy anything — it starts with the assumption that nothing has changed and then keeps track of every change to the snapshot so only changes need to be stored.

From Windows Vista on it's possible to mount a shadow copy as a drive letter or share. ShadowTask is a command line tool that creates a VSS copy, mounts it as a drive and then runs a program or batch file. For example:

ShadowTask C V dostuff.bat

Creates a copy of C:, mounts it as V: and then runs dostuff.bat.

Let's say you want to copy a locked file — maybe some outlook personal folders. Dostuff.bat could contain:

copy V:\Users\You\AppData\Local\Microsoft\Outlook.pst C:\Users\You\Desktop\OutlookBackup.pst

Bingo, you have a copy of your PST without shutting down Outlook.

Download: ShadowTask.zip (50.86 kb)

The ZIP contains both 32 and 64 bit versions of the tool. You must use the version that matches your platform. ShadowTask supports Windows Vista and 7. XP doesn't support mounting a shadow copy so ShadowCopy will fail if you try to use it on XP. ShadowCopy must run as admin (elevated).

Add your comment...

Related Posts

(All Code Posts)

(Published to the Fediverse as: Do useful things with the volume shadow copy service (VSS) #code #vss ShadowTask mounts a volume shadow copy to a drive letter using VSS and then lets you run a batch file (maybe to copy a locked file or backup the entire drive) )

Scanning multiple pages into a PDF file

By Robert Ellison. Updated on Wednesday, June 2, 2021.

PdfScan is a simple tool for scanning pages into a PDF file. You can scan single pages from a flatbed scanner or several pages from a document feeder. The page size applies to both the scan and the page(s) added to the PDF.

I wrote PdfScan because I know I'm going to be scanning a lot of documents over the next couple of weeks. Previously I used a tool called ScanToPDF from O Imaging but their licensing pissed me off so much that I'd rather waste time reinventing the wheel than pay them for another copy.

PdfScan - Scan pages to a PDF

This is a beta — it works with my scanner and my documents. There's no installer, so extract the ZIP file and run the EXE to use it. PdfScan requires the .NET 4.0 Framework. If you get an error when you run PdfScan.exe try installing .NET 4 and then run it again.

If enough people use this I'll make it a bit more friendly, add an installer and release it through Catfood. If you like it leave a comment below. If it doesn't work for you leave a comment or email me and I'll try to help.

(Update September 12, 2010: I've tided PdfScan up and released it through Catfood Software. Download from Catfood PdfScan.)

PdfScan uses PDFsharp from empira Software. Thanks chaps!

Add your comment...

Related Posts

(All Code Posts)

Scanning from the ADF using WIA in C#

By Robert Ellison. Updated on Wednesday, June 2, 2021.

Scanner ready for WIA image acquisition

I've been going nuts trying to scan from the document feeder on my Canon imageClass MF4150. Everything worked as expected from the flatbed, no dice trying to persuade the ADF to kick in. I found some sample code but it was oriented towards devices that can detect when a document is available in the feeder. Evidently my Canon doesn't expose this and so needs to be told the source to use.

The way to do this is to set the WIA_DPS_DOCUMENT_HANDLING_SELECT property to FEEDER. You then read WIA_DPS_DOCUMENT_HANDLING_STATUS to check that it's in the right mode and initiate the scan. This did not work for toffee.

After much experimentation I discovered a solution. I had been setting device properties and then setting item properties before requesting the scan. Switching the order - item then device - made everything work.

Here's the function to scan one page:

A few notes — XImage is a type from PDFSharp. I wrote this as part of a PDF scanner that I'll post next so the scanned images are saved and then loaded into an XImage for rendering to the PDF document. The magic numbers come from WiaDef.h in the Platform SDK. If the ADF is out of pages this method sets the return image to null and eats the exception. This is because the function is called repeatedly to scan in pages until the ADF is empty if _adf is true (otherwise it grabs one image from the flatbed). 

If you've been banging your head against a wall trying to get WIA to work with a document feeder I hope this helps.

Updated 2015-05-20: Full source code at https://github.com/abfo/pdfscan

Updates

Catfood: PdfScan 1.40

Catfood: PdfScan 1.40

Catfood PdfScan 1.40 is a small bug fix release. PdfScan converts documents to PDFs with the help of a flatbed or automatic document feeder (ADF) scanner.

Scanning multiple pages into a PDF file

PdfScan is a simple tool for scanning pages into a PDF file. You can scan single pages from a flatbed scanner or several pages from a document feeder. The page size applies to both the scan and the page(s) added to the PDF.

I wrote PdfScan because I know I'm going to be scanning a lot of documents over the next couple of weeks. Previously I used a tool called ScanToPDF from O Imaging but their licensing pissed me off so much that I'd rather waste time reinventing the wheel than pay them for another copy.

PdfScan - Scan pages to a PDF

This is a beta — it works with my scanner and my documents. There's no installer, so extract the ZIP file and run the EXE to use it. PdfScan requires the .NET 4.0 Framework. If you get an error when you run PdfScan.exe try installing .NET 4 and then run it again.

If enough people use this I'll make it a bit more friendly, add an installer and release it through Catfood. If you like it leave a comment below. If it doesn't work for you leave a comment or email me and I'll try to help.

(Update September 12, 2010: I've tided PdfScan up and released it through Catfood Software. Download from Catfood PdfScan.)

PdfScan uses PDFsharp from empira Software. Thanks chaps!

Add your comment...

Related Posts

(All Code Posts)

(Published to the Fediverse as: Scanning from the ADF using WIA in C# #code #pdf #scanning #wia #pdfscan #scan #scanner #scantopdf How to make a scanner use the document feeder (ADF) rather than the flatbed using WIA from C#. )