Dear QuickBooks:

Dear Intuit/QuickBooks:

When importing an IIF (Intuit Interchange Format) file, you might report “The NAME field in this file is too long” as something other than “Error on line X – You can’t change the type of a name or a add a duplicate name.” (You may recall, this is the same problem that remains unfixed from QuickBooks ’99.)

—A Customer

P.S.: Thank you for removing my online banking support, unless I choose to upgrade for several hundred dollars.

ux_fail

Pagination Control While Printing in Flex: Unwrap mx.printing.FlexPrintJob’s Private flash.printing.PrintJob Variable

I’ve worked with Adobe’s Flex platform now for several years, beginning with my Star Trek transporter simulator, a project I wrote for a Boston University course.

Now, my job at Transparent Language involves mostly FFA (Flash/Flex/AIR) development, and I enjoy the challenges of working in this fairly cutting-edge environment. This week, though, I was shocked by an apparent limitation in the mx.printing.FlexPrintJob class: It doesn’t return the operating system’s print dialog information to the Flex application. So, if I want to print, say, the first five pages of a document, it cannot normally be done. It’s all or nothing, regardless of what I specify in the OS print dialog.

Windows XP operating system print dialog.

The FlexPrintJob class wraps an older class, PrintJob. The primary difference is that PrintJob, designed for Flash, takes a Sprite as passed parameter to its addPage() function, whereas FlexPrintJob’s equivalent addObject() takes a UIObject. Fair enough.

But, what’s weird, is that the FlexPrintJob class contains a private PrintJob object, but it doesn’t expose any of the useful properties of that PrintJob object, except pageHeight and pageWidth. Want the printer name? The first and last pages in the page range the user has entered? The paper size? The orientation? Forget it! None of them are accessible.

Granted, most of these properties are AIR-only, but I’m working on an AIR project, and it would be darned useful for my users to be able to control their output, which can often run to many tens of pages, so I really need access to the properties of the “hidden” PrintJob object.

Thankfully, there’s a relatively easy solution. I can du plicate the FlexPrintJob class, and add accessors (getters) that will allow me to read the variables I need. Normally, I’d extend the class, but because the object and properties I need are private, I can’t even do that. I have to essentially clone the class, and add what I need to it. Thankfully, FlexPrintJob is part of Adobe’s code that has been open-sourced, so I can do this with impunity, and even distribute it.

So, I open the FlexPrintJob code, copy it to an empty class, rename it to FlexPrintJobExtended, and remove the reference to import Version.as, and add the following:

//--------------------------------------------------------------------------
//
//  Additional accessors for PrintJob object
//
//--------------------------------------------------------------------------

public function get copies():int {
    return printJob.copies;
}

public function get firstPage():int {
    return printJob.firstPage;
}

public function get isColor():Boolean {
    return printJob.isColor;
}

public function get jobName():String {
    return printJob.jobName;
}

public function get lastPage():int {
    return printJob.lastPage;
}

public function get maxPixelsPerInch():Number {
    return printJob.maxPixelsPerInch;
}

public function get orientation():String {
    return printJob.orientation;
}

public function get paperArea():Rectangle {
    return printJob.paperArea;
}

public function get paperHeight():int {
    return printJob.paperHeight;
}

public function get paperWidth():int {
    return printJob.paperWidth;
}

public function get printableArea():Rectangle {
    return printJob.printableArea;
}

public function get printer():String {
    return printJob.printer;
}

Then, wherever I needed the FlexPrintJob class, I can then use my FlexPrintJobExtended class instead, and get access to all the glorious properties on the now-much-friendlier printJob object. Note that I’ve kept the properties read-only, by only writing getters. I did not envision any need to change the values: I only wanted to know what the user told the operating system.

The next obstacle is in the sample code provided for printing multipage documents. Begin by consulting the published examples for Printing with multipage PrintDataGrid controls. I’m not going to elaborate too much on this, merely illustrate how to get to the next step, printing multiple pages using the pages the user specified.

Looking at the section of the sample code marked with // The function to print the output, there are only a few things we need to change.

First, we need to change the FlexPrintJob instance created to use our new class:

// Create a FlexPrintJobExtended instance.
var printJob:FlexPrintJobExtended = new FlexPrintJobExtended();

The user might not have chosen to start on page one, so we need to advance to the first page the user has chosen.

// Jump to the first specified page, not necessarily page 1.
while (errorPrintView.pageNumber < printJob.firstPage && errorPrintView.printGrid.validNextPage) {
	thePrintView.printGrid.nextPage();
	thePrintView.pageNumber++;
}

Then we modify the

while(true)

so that it won't go further than the number of pages the user has specified.

// Loop through the following code until all pages are queued.
// If the user has chosen to print all pages, printJob.lastPage will be zero.
while(printJob.lastPage == 0 || thePrintView.pageNumber <= printJob.lastPage)

Voila!

Feel free to download the code cited in this post: FlexPrintJobCode.zip.

If you find this to be useful, or find a better way to do it, let me know, by e-mailing "doug" at this domain. Cheers!

What to Do When Comcast’s Norton Security Suite Breaks Your Shared Resources

Comcast has recently switched its provided-for-free antivirus vendor from McAfee to Norton Security Suite, from Symantec. The subscriptions to McAfee Security Suite are due to expire in May. (Norton is named after Peter Norton, a true god of early personal computing utilities back when DOS was king and before all the cool things Peter wrote got licensed by Microsoft for use within their operating systems.

Overall, this is probably a good move, as Symantec’s 2010 offering seems to have recovered its lagging performance, and surged ahead of McAfee in the ratings.

A month ago, I installed Norton on our mostly-gaming-and-homework computer to see how it would run. I hadn’t had any real problem with Norton, and it does seem to be less intrusive than McAfee was, doing most of its scanning during idle times. I also switched our church’s media computer over to use it, and had only one minor problem that a reboot fixed.

(I should interject that “the cloud” has allowed me to radically de-task my specific-machine-focused life, so that, for most of the things that were so critical before, it now doesn’t matter which computer I use. Our wilcoxfamily.net e-mail and calendar are hooked to Google Apps; my notes are in Evernote, frequently accessed files are in DropBox, and even remote access tasks can be handled through LogMeIn.)

Last night I decided to switch from McAfee to Norton on the computer that gets the most use at home. This is the one that hosts our shared printer. I ran the installer from Comcast for Norton, which automatically uninstalls McAfee, lets you reboot, and installs Norton. There didn’t appear to be any problems … until Isaac tried to print from the other machine, and got an error.

I checked the cables, successfully printed from the host machine, but nothing I did would fix the printing. I also discovered that trying to get to my host machine’s C drive from the network wouldn’t work (usually we do \{machinename}c$ to open it as a network share), although the D drive would open. I tried disabling the Norton firewall and anitvirus temporarily, but the network resources still wouldn’t connect.

I fired up a chat session with a Symantec representative named Srini, and he checked my spooler settings. Ultimately Srini wasn’t able to help. While this fairly slow support was going on, I hit the Web, searching for one of the error messages I received while trying to open the C drive, “Not enough server storage is available to process this command.” Among other results indicating the same problem, I found a KnowledgeBase article at Microsoft that describes the symptoms and a possible fix. I also discovered a number of posts suggesting that this was a relatively common problem with Symantec products, although other products or networking configurations can produce the same symptoms.

So, having nothing to lose, I took a stab at fixing the IRPStackSize property in my registry. In my case, the key didn’t exist, so I added it by using RegEdit to navigate to the HKEY_LOCAL_MACHINESystemCurrentControlSetServicesLanmanServerParameters key, and then added a new DWORD named IRPStackSize (the capitalization is important). I right-clicked on the new key, and edited the decimal value to 18 (hexadecimal 12). Then I restarted the computer, which is necessary for the change to work.

Setting the IRPStackSize parameter in the registry editor.
Yep, there's your problem right here: Setting the IRPStackSize parameter in the registry editor.

Upon restart, my network resources were accessible again, and printing to the shared printer worked perfectly. Tonight I’ll try to contact the Symantec representative again and let him know how this was fixed.

Jurassic Park Reality: Extinct Ibex Resurrected by Cloning

From an article in The Daily Telegraph:

Using DNA taken from … skin samples [preserved in liquid nitrogen], the scientists were able to replace the genetic material in eggs from domestic goats, to clone a female Pyrenean ibex, or bucardo as they are known. It is the first time an extinct animal has been cloned.

Young Spanish ibex (Capra pyrenaica), Sierra de Gredos, Spain  Photo: Jose Luis GOMEZ de FRANCISCO/naturepl.com
Young Spanish ibex (Capra pyrenaica), Sierra de Gredos, Spain Photo: Jose Luis GOMEZ de FRANCISCO/naturepl.com

Just seven of the embryos resulted in pregnancies and only one of the goats finally gave birth to a female bucardo, which died a seven minutes later due to breathing difficulties, perhaps due to flaws in the DNA used to create the clone.

Space: Video

In 2029, the 900-foot asteroid Apophis, will miss Earth by only about 18,000 miles. To put that in contrast, the moon is an average of 238,857 miles away, center-to-center, or about 234,000 miles surface-to-surface. (The moon, of course, has a slightly elliptical orbit, so that’s just an average.) If that doesn’t set up the right mental image, take a look at the animation below, from an article on Wired Science.

Below you’ll see some beautiful video compiled from the STS-129 mission launch. (STS stands for space transportation system, and is the designation for NASA’s own Space Shuttle.

STS-129 Ascent Video Highlights from mike interbartolo on Vimeo.

STS-129 video highlights as compiled by the SE&I imagery team here at JSC from all of the ground, air, ET and SRB assets.

Not Far Off: Amazing Future Visions

Ten years from now, this is where we very well may be. Click through to see these jaw-dropping videos. We’re already starting to see application of this technology. Ten years to make it commonplace sounds reasonable.

Future Vision Montage
Future Vision Montage

Health Future Vision
Health Future Vision

Productivity Future Vision
Productivity Future Vision

See more at Microsoft Office Labs.

These remind me of the A&T “You Will” ads from 1993, which have proven to be quite accurate:

My yaar Aashay Joshi pointed me to the Microsoft videos.

Just the Facts

The other day I was talking to someone who said he had heard on the radio that the US Federal government was going to give free digital television converts to welfare recipients, and that they were spending $100,000 each on plasma TVs in prisons. This came from what was described as “the most trustworthy radio news source in the area.”

Frankly, I couldn’t believe it. There was a coupon program to buy converters at a discount, but the program used up all its money, and had been discontinued. (Recently, it has been given more money by the federal bailout, and is operating again.) However, these coupons are available to anyone who desires them, so it’s hardly being targeted to those receiving government assistance.

But I wondered what the origin of these stories had been, so I hit the internet.

It turned out that millions of households on welfare might be given free digital television converters—in Japan sometime before their digital switchover in 2011. The prison story was a little closer to what’s real—the state of Florida’s department of corrections is spending $100,000 total, approximately $1 per inmate, out of its $2.3 billion dollar budget to convert existing television to digital.

Our opinions are often based on incorrect facts. Part of this is described in basic psychology—it’s called confirmation bias—how we filter evidence that strengthens our preconceptions.

But also our incorrect knowledge of history, various sciences, and current events allows us to hold on to incorrect opinions.

This is especially true in “popular knowledge”—think about all those e-mail forwards you receive that 15 seconds at about.com or Snopes could easily refute. Think about all the people who believe wearing a magnet on their wrist will make them healthy. Or all the “Christians” who espouse the heresy of the Prosperity Gospel and can even quote Scripture out of context to support it. Or that rubber tires protect vehicle occupants from lighting strikes. Or that a metal vehicle acts as a Faraday cage. (It doesn’t.)

At any rate, I have been thinking much of late that we should all do more analysis before we speak.

I wish we could all just be smarter.

I wish I could just be smarter.