Creating Add-ons, Plugins, and Tools for the PowerShell ISE

We frequently get questions asking if the PowerShell ISE supports a feature that it doesn’t. For example, variable watch windows, function browsers, or “find all matches in the current document”.

Or as another example, many of you are very familiar with Visual Studio and naturally wish for Visual Studio feature <x>. That <x> is usually different for each person :) The Visual Studio team is many times larger than the PowerShell team, and they’ve had a 15-year head start.

When preparing for PowerShell V3, we realized that the appetite for new functionality in the ISE would far outstrip our ability to create it, so we designed one of the most (until now) un-heralded features in the PowerShell ISE: the ability to create custom tool windows:

image

See the “Find All” pane on the right-hand side? That didn’t come with the ISE.

Creating a PowerShell ISE Add-In / Plugin is very straight-forward. Jason gives a great overview in his blog: http://blog.codeassassin.com/2012/01/16/create-a-powershell-v3-ise-add-on-tool/.

The design center of ISE plugins are that they are really just WPF UserControls. In addition, they implement the IAddOnToolHostObject interface.

When you call the .Add() method on either $psISE.CurrentPowerShellTab.VerticalAddOnTools or $psISE.CurrentPowerShellTab.HorizontalAddOnTools, the ISE will create your UserControl, set the HostObject property to an object that represents the ISE’s object model (almost identical to the $psISE object model variable you may be used to from within the ISE), and then add your control to the appropriate pane.

After that, the control is all yours.

You have full access to WPF, XAML, C#, and anything else you can imagine or would expect from a WPF control. For example, here is the simplistic XAML used to create the control in the ‘Find All’ window shown above:

image

And for an example of some “meaty” code – the actual search algorithm itself:

           // The user had typed new text in the search box
        private void SearchText_TextChanged(object sender, TextChangedEventArgs e)
        {
            // Clear the previous results
            this.SearchResults.Items.Clear();

            // Break the file into its lines
            string[] lineBreakers = new string[] { "\r\n" };
            string[] fileText = HostObject.CurrentPowerShellTab.Files.SelectedFile.Editor.Text.Split(
                lineBreakers, StringSplitOptions.None);

            // Try to see if their search text represents a Regular Expression
            Regex searchRegex = null;
            try
            {
                searchRegex = new Regex(this.SearchText.Text, RegexOptions.IgnoreCase);
            }
            catch (ArgumentException)
            {
                // Ignore the ArgumentException that we get if the regular expression is
                // not valid.
            }

            // Go through all of the lines in the file
            for (int lineNumber = 0; lineNumber < fileText.Length; lineNumber++)
            {
                // See if the line matches the regex or literal text
                if (
                    ((searchRegex != null) && (searchRegex.IsMatch(fileText[lineNumber]))) ||
                    (fileText[lineNumber].IndexOf(this.SearchText.Text,
                        StringComparison.CurrentCultureIgnoreCase) >= 0))
                {
                    // If so, add it to the search results box.
                    SearchResult result = new SearchResult() {
                        Line = lineNumber + 1, Content = fileText[lineNumber]
                    };
                    this.SearchResults.Items.Add(result);
                }
            }
        }

All-in-all, a very easy development experience.

Once you’ve compiled a DLL, adding it to the ISE is as easy as:

Add-Type -Path ‘d:\documents\Visual Studio Projects\FindAll\bin\Release\FindAll.dll’

$psISE.CurrentPowerShellTab.VerticalAddOnTools.Add(‘Find All’, [FindAll.FindAllWindow], $true)

Want to play?

I’ve shared out the sample project (that implements the “Find All”) window here: http://www.leeholmes.com/projects/findall/FindAll.zip. If you want just the DLL, that’s here: http://www.leeholmes.com/projects/findall/FindAll.dll.

Enjoy!

Hacking Pi with PowerShell

A Facebook friend recently posted a cool picture from the Pi chain that California Institute of Technology created on Pi Day, 2013:

image

After seeing that, you might wonder – “Where in Pi is that?” And, “What number does each colour represent?”

PowerShell can help here – its support for regular expressions let you find all kinds of stuff in text. But where do you find the text of Pi? Bing, of course. After copy + pasting the first 100,000 digits of Pi from into a text file, you now have some text to work with.

If you want to see some of the things you can do with Regular Expressions, check out this quick reference in the PowerShell Cookbook: http://www.powershellcookbook.com/recipe/qAxK/appendix-b-regular-expression-reference.

If you assume that the chain links are 4 inches wide, 100,000 digits will go for almost 7 miles. It’s doubtful that they made a chain longer than that, so using 100,000 digits is pretty safe.

PS C:\Users\Lee> $page = iwr http://www.geom.uiuc.edu/~huberty/math5337/groupe/digits.html
PS C:\Users\Lee> $null = "$page" -match ‘(\d|\.|\n){5,}’
PS C:\Users\Lee> $digits = $matches[0] -replace "\s",""
PS C:\Users\Lee> -join $digits[0..100]
3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342117067

Now, since we know that each colour represents a different number, and those colours appear in a certain pattern, we can look in $digits for that pattern.

What we see – 15 colours:

Yellow, Yellow, Blue, (Orange?) Green, Blue, Yellow, (Red?), Purple, Purple, Orange, Pink, Red, Yellow, Yellow

Now, here’s the regular expression to match 15 different characters (15 dots):

$digits –match “…………….”

It does, of course (I hear Pi goes on for a while), so let’s get more specific.

Regular expressions let you group characters by surrounding them in parenthesis:

$digits –match “(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)”

And also give them names. Let’s name the first group:

$digits –match “(?<Yellow>.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)”

And rather than using the “dot” to match a specific character, you can refer to a previous group – by either name or number. Here’s the chunk that names the first character “Yellow”, and then says that the second character must be the same as the first:

$regex = "(?<Yellow>.)(\k<Yellow>)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)"
$digits | Select-String $regex -AllMatches | % { $_.Matches.Value } | Select -First 1
33832795028841

This is how we’ll “crack the code” – find patterns where the digits are the same at the same place the colours are the same. Since most of the colours aren’t repeated, they don’t help us much and we can ignore them for now. Let’s expand our example:

$regex = "(?<Yellow>.)(\k<Yellow>)" +
    "(?<Blue>.)(?<Orangey>.)(<?Green>.)(\k<Blue>)(\k<Yellow>)" +
    "(?<Pinkish>.)(?<Purple>.)(\k<Purple>)(?<Orange>.)(?<Pink>.)" +
    "(?<Red>.)(\k<Yellow>)(\k<Yellow>)"
$digits | Select-String $regex -AllMatches | % { $_.Matches.Value } | sort

PS >

Hrrm. No results.

Let’s relax some constraints. Maybe some colours we thought matched really didn’t? With my man eyes to the rescue, those blues look subtly different.

$regex = "(?<Yellow>.)(\k<Yellow>)" +
    "(?<Blue>.)(?<Orangey>.)(<?Green>.)(?<Blue2>.)(\k<Yellow>)" +
    "(?<Pinkish>.)(?<Purple>.)(\k<Purple>)(?<Orange>.)(?<Pink>.)" +
    "(?<Red>.)(\k<Yellow>)(\k<Yellow>)"
$digits | Select-String $regex -AllMatches | % { $_.Matches.Value } | sort
PS >

Grr! No results again.

Maybe the yellows are different? There are three groups. The first group of two is certainly the same colour. The last group of two is certainly the same colour. But maybe those groups are different yellows. Lets see – call the other ones Yellow2 and Yellow3:

$regex = "(?<Yellow>.)(\k<Yellow>)" +
    "(?<Blue>.)(?<Orangey>.)(<?Green>.)(?<Blue2>.)(?<Yellow2>.)" +
    "(?<Pinkish>.)(?<Purple>.)(\k<Purple>)(?<Orange>.)(?<Pink>.)" +
    "(?<Red>.)(?<Yellow3>.)(\k<Yellow3>)"
$digits | Select-String $regex -AllMatches | % { $_.Matches.Value } | sort

PS >

Hmm. This doesn’t seem to be working out so well.

image

Brain flash. Oh wait, this is just a picture. What if it was taken from the other side? The colours would be reversed. Maybe we’re looking at the digits of Pi in the wrong order?

Let’s rewrite the regex since we might actually be looking at:

Yellow, Yellow, Red, Pink, Orange, Purple, Purple, (Red?), Yellow, Blue, (Orange?) Green, Blue, Yellow,Yellow

$regex = "(?<Yellow3>.)(\k<Yellow3>)" +
    "(?<Red>.)(?<Pink>.)(?<Orange>.)(?<Purple>.)(\k<Purple>)" +
    "(?<Pinkish>.)(?<Yellow2>.)(?<Blue2>.)(?<Green>.)(?<Orangey>.)" +
    "(?<Blue>.)(?<Yellow>.)(\k<Yellow>)"
$digits | Select-String $regex -AllMatches | % { $_.Matches.Value } | sort

000139962344455
004489917210022
006079992795411
006447771837022
006734420647477
006758838043211
008368842671022
009318804549333
112821107094422

(…)

Bingo!

That’s a lot of options, so let’s add back in some things that we are more sure of – specifically, those yellows:

$regex = "(?<Yellow3>.)(\k<Yellow3>)" +
    "(?<Red>.)(?<Pink>.)(?<Orange>.)(?<Purple>.)(\k<Purple>)" +
    "(?<Pinkish>.)(?<Yellow3>.)(?<Blue2>.)(?<Green>.)(?<Orangey>.)" +
    "(?<Blue>.)(?<Yellow2>.)(\k<Yellow2>)"
$digits | Select-String $regex -AllMatches | % { $_.Matches.Value } | sort

000139962344455
004489917210022
006079992795411
006447771837022
006734420647477
006758838043211
008368842671022
009318804549333
112821107094422
113829928776911

(…)

But that first yellow has a zero. Maybe that’s a hint?

$regex = "(?<Yellow3>0)(\k<Yellow3>)" +
    "(?<Red>.)(?<Pink>.)(?<Orange>.)(?<Purple>.)(\k<Purple>)" +
    "(?<Pinkish>.)(?<Yellow3>.)(?<Blue2>.)(?<Green>.)(?<Orangey>.)" +
    "(?<Blue>.)(?<Yellow2>.)(\k<Yellow2>)"
$digits | Select-String $regex -AllMatches | % { $_.Matches.Value } | sort

000139962344455
004489917210022
006079992795411
006447771837022
006734420647477
006758838043211
008368842671022
009318804549333

Not very many, so we’re getting closer. Let’s take a look at the patterns and rule out the ones that don’t make sense:

000139962344455    # No, triple start digit
004489917210022    # No, second digits doubled
006079992795411    # No, has another zero ("Yellow") on the fourth digit
006447771837022    # No, has another doubling right after the red
006734420647477    # No, has colour four of colour #4, four of colour #7
006758838043211    # No, 8 means purple, and has another purple in the middle
008368842671022    # No, has another zero ("Yellow") where we thought Blue was
009318804549333    # No, has a tripled final colour

Well, evidently none of them make sense. This is truly confusing. Maybe the numbers happen after 100,000 digits of Pi?

Taking a different approach, it turns out that the original California Institute of Technology page shows a few pictures where there are numbers drawn on the links. Could we use those for a key?

 

Let’s try this again from the start. The pictures tell us:

0 = Yellow

1 = Pink

2 = Goldenrod

3 = Green

4 = ?

5 = Light Blue

6 = Orange

7 = Purple

8 = ?

9 = Dark Blue

Wait. There’s a Goldenrod?

This might help. Let’s do this match against the left-to-right version:

Yellow, Yellow, Blue, (Orange?) Green, Blue, Yellow, (Red?), Purple, Purple, Orange, Pink, Red, Yellow, Yellow

We can now substitute some numbers into the regex. Yellow and Goldenrod are pretty close, so let’s use Regex Alteration (a|b) to let it select either. The light blue is pretty clear, so let’s call that out specifically:

$regex = "(0|2)(0|2)5..5…….(0|2)(0|2)"
$digits | Select-String $regex -AllMatches | % { $_.Matches.Value } | sort

225695968815920

Wow! It seems like we have a match!

Godenrod, Goldenrod, Light Blue, Orange, Dark Blue, Blue, Dark Blue, …

But there are two problems:

  • It implies that either 9 is Green, or that the picture showing Green is actually Dark Blue
  • It says that the colour before the second blue is the same as the colour after it. That’s not the case.
  • Maybe they messed up assigning colours? If you follow the colour chart through further, there are almost a dozen more mistakes. Let’s go back to the big brain flash, and reverse the regex.

    $regex = "………5..5(0|2)(0|2)"
    $digits | Select-String $regex -AllMatches | % { $_.Matches.Value } | sort

    005476022525520
    008169980536520
    020695124539500
    036407573587502
    048466277504500
    068006422512520
    090988702550520
    101024365553522

    (…)

    Tons of matches again. Let’s get more specific with those yellows:

    $regex = "(0|2)(0|2)……(0|2)5..5(0|2)(0|2)"
    $digits | Select-String $regex -AllMatches | % { $_.Matches.Value } | sort

    005476022525520
    008169980536520

    Much better. Apply the process of elimination again:

    005476022525520    ## Says that the red is colour 5, but also that orange and light blue are too.
    008169980536520    ## Seems legit

    One was way off, the other one seemed legit. If we apply our colour key, we get:

    Yellow, Yellow, ?, Pink, Orange, Dark Blue, Dark Blue, Red, Yellow, Light Blue, Green, Orange, Light Blue, Goldenrod, Yellow

    That seems very reasonable. The unknown colour (8) is evidently red. The two that we thought were purple were either actually dark blue, or the assembly person made a mistake. “Pinkish” was red in the sunlight. The last two yellows were actually not two yellows – they were one Goldenrod, and then one Yellow. Or the person putting them together made a mistake.

    Now, we can get smart. How far along were they on the chain?

    $digits.IndexOf("008169980536520")

    12309

    Going back to our 4-inch estimate (3 of those in a foot), that’s 4103 feet:

What went wrong in the pattern-based regex?

If you take a look at the final regex we played with, we assumed that the last two were the same colour:

$regex = "(?<Yellow3>0)(\k<Yellow3>)" +
    "(?<Red>.)(?<Pink>.)(?<Orange>.)(?<Purple>.)(\k<Purple>)" +
    "(?<Pinkish>.)(?<Yellow3>.)(?<Blue2>.)(?<Green>.)(?<Orangey>.)" +
    "(?<Blue>.)(?<Yellow2>.)(\k<Yellow2>)"
$digits | Select-String $regex -AllMatches | % { $_.Matches.Value } | sort

If we assume that “Orangey” is actually “Orange”, and say that the final two digits are either Yellow or Goldenrod, then we get the proper result after the process of elimination:

$regex = "(?<Yellow3>0)(\k<Yellow3>)" +
    "(?<Red>.)(?<Pink>.)(?<Orange>.)(?<Purple>.)(\k<Purple>)" +
    "(?<Pinkish>.)(?<Yellow3>.)(?<Blue2>.)(?<Green>.)(\k<Orange>)" +
    "(?<Blue>.)(?<Yellow2>.)(\k<Yellow2>|\k<Yellow3>)"
$digits | Select-String $regex -AllMatches | % { $_.Matches.Value } | sort

001502298330798
008169980536520
009743300884990

Why do I care?

Why not spend some time messing around in Pi?

ScanSnap ix500 Scanning into Excel

Following up on my previous post about the ScanSnap ix500, one thing I couldn’t find when searching for information about it was how well it did scanning information into Excel.

So, here’s a quick video that demonstrates it:

 

ScanSnap ix500 Scanning Speed and Document Processing Workflow

If you’ve ever played with the Getting Things Done system, you may have heard David Allen’s excited advice for getting your paperwork organized: a filing system, and automatic labeler.

One of the hardest parts of a paperwork filing system is the nomenclature. If you just have files that are labeled “A-Z”, you can never remember – did you put your car insurance information under “C” for Car? “I” for insurance? “G” for Geico?

Figuring that out is an annoying process. It means manually skimming through (at least) each of those folders.

So, the Getting Things Done approach is simpler – label a new folder with “Geico Car Insurance”. As you skim through your folder tabs, you’ll see that and not have to dig in other folders.

That’s a great philosophy, and I stuck with it for a while. However, I declared “paperwork filing bankruptcy” a few years ago. Taking my filing box out, filing paperwork, creating new labels – it doesn’t sound painful, but it was enough that I instead adopted the “sedimentation approach”. In a filing cabinet drawer, old bills are on the bottom, new bills are on the top. When you need to find a bill or document, you spend an annoyingly large amount of time digging through it.

You organize the REALLY important stuff, but most other stuff just goes in the pile.

In any case, this approach isn’t exactly optimal. Even with the clearly labeled system, I am well and truly in trouble if I want to find the little receipt from some electronics store that I forget from 2 years ago that had the purchase information about several things – only one of which I care about.

This is becoming an increasingly common sense of dissatisfaction, and the “home paperless office” has recently started becoming a viable answer.

The idea behind the “paperless office” is that you scan in all of your documents / paperwork, have them digitized, and software automatically recognizes the text in those documents through OCR (optical character recognition). Nowadays, most software stores your documents in searchable PDFs – the kind of PDF that lets you select text, but also shows the original document in full fidelity.

Once you’ve gone through this process, you can use software that acts like a virtual filing cabinet to search through your paperwork, or use the built-in search capabilities of Windows.

To get a feel for the “paperless office” approach, I first downloaded a trial of Abbyy Fine Reader. I used my current flatbed scanner, scanned in a few bills (flipping each page so I get both sides, pushing “Scan” each time), and watched the PDFs get generated and recognized into Windows. From there, the power is amazing – you can search for nearly any text in the document. You know that huge 50 page car insurance policy? The software has absolutely no problem finding a random word from page 38.

I was completely sold on this being the way to manage my paperwork. But the scanning. Oh, the horrible scanning.

Fortunately, there’s an answer to that unbelievable pain. Document scanners have arrived for that purpose. Unlike your multi-function printer / flatbed scanner combo, these things are designed for one thing: scanning documents. Quickly, efficiently, and no fuss.

In this world, there’s a clear line of champions – the Fujitsu ScanSnap line of document scanners. They scan 50 pages per minute, double sided, and have great text recognition capabilities.

When looking around for reviews, I couldn’t believe the amount of love customers had for a freaking document scanner.

image

As I roamed the web for reviews of their newest model – the ScanSnap IX500 – I continually stumbled on blogs that said things like this:

I’ve been using the previous model, the ScanSnap S1500 for almost 4 years now. I liked it so much that I bought a second one. To me, it completely transformed the concept of going paperless: from painful and time consuming to fun and even cool. (…)

That said, I bought the iX500 as soon as I learned it was available on Amazon.

Reviews of the IX500 are even more polarized:

image

Without further ado, I got the ScanSnap ix500 document scanner the other day in an attempt to tame the vast piles of paperwork sedimentation. And no surprise, this thing is fast. I’ve spent the last few nights scanning in paperwork, and have been averaging about 100 documents per hour. Most of the time is spent unfolding paper.

One thing I couldn’t find a good example of when researching the ScanSnap iX500 was its scanning speed and document processing workflow. So, I recorded a quick two minute example last night, and uploaded it. Enjoy!

 

 

I’ve also blogged an example of the ScanSnap scanning paper and bringing tabular data into Excel here: http://www.leeholmes.com/blog/2013/03/09/scansnap-ix500-scanning-into-excel/

Announcing PowerShell Cookbook Online Access

With the third edition of the Windows PowerShell Cookbook, O’Reilly and I are embarking on an experiment to expand the boundaries of traditional publishing even further – full, online, searchable access to the Windows PowerShell Cookbook.

cookbook_search

There’s been a huge shift in the way that people like to get their content in the past few years. The raw unwashed internet is a popular first choice, but usually involves a difficult ordeal of sifting through bad content to find just the right forum response, blog post, or documentation page. Curation. That’s the difficult part.

Above all else, that’s exactly the business the book publishing industry is in in. Content curation: finding great authors, great content, and great topics. After that, get it to readers in the way they want it.

Printed books have long been the preferred answer. You can skim them easily, feel them in your hands, and bookmark them. They have limitations, though. When it comes to the print edition of the PowerShell Cookbook, version three has grown to over 1,000 pages. It’s over two inches thick, weights more than most current laptops (3 pounds), and has over 30 pages in the index alone. Finding a topic by going to the index can easily take over a minute. Through the table of contents, even longer.

This size isn’t for lack of trying. With each edition of the Cookbook, I’ve ruthlessly cut recipes, replaced recipes with new PowerShell features that accomplish the task more efficiently, and done everything I can to make it smaller. PowerShell is just a huge topic, and every recipe offers crucial insight.

O’Reilly has been expanding the envelope of the traditional publishing industry for years – leading the way in eBook publishing, online digital betas, and offering DRM-free electronic versions of everything in the catalog. E-books are extremely portable, and offer basic search functionality. Despite their portability, though, they still don’t offer the ubiquity and ease of access that the raw unwashed internet does.

To push this boundary even further, O’Reilly and I are experimenting with a new site: http://www.powershellcookbook.com. The carefully curated content of the PowerShell Cookbook, with the ease-of-use and ubiquity of an internet search engine.

Using the Site

When you visit the site, you are simply asked to prove you own the book by entering a word from one of the chapters. The site remembers you by default, so you shouldn’t have to do this very often.

Searching

Once you’ve logged in, you can search for recipes with the ease of any regular search engine:

cookbook_search_result

Each search result links to a recipe, which you can use to read and copy code samples from:

cookbook_recipe

Sharing

See that big green button? Share It. That’s a key feature of the site. Gone are the days of you having to tell people on StackOverflow or a forum – "This is covered in the PowerShell Cookbook. It says, ….". Instead, simply link to the recipe and let them read the answer for themselves! Try it: http://www.powershellcookbook.com/recipe/XmJd/manage-large-conditional-statements-with-switches. If they are not logged on, they’ll get the recipe as you see it – but with the bar on the right letting them know that the recipe comes from the PowerShell Cookbook and where to buy it.

Free Trial

To kick off this experiment, we’re offering a free trial of the PowerShell Cookbook’s online access until February 8th. Visit the home page, use "free_trial" as the password, and let us know what you think!

PowerShell Cookbook V3 Now Available

On Friday, Amazon began shipping the PowerShell Cookbook, V3!

cookbook_trio

You can buy it in both print and digital formats from Amazon, O’Reilly, and any of your other favourite book sellers.

If you or your company subscribes to Safari, it’s there too.

It’s almost 1100 pages now, despite my continuing efforts to keep it svelte :) Since every edition of the book is about filling “missing pieces” from the last, and we filled tons of “missing pieces” from V2, much of the new content directly replaced recipes that existed in the V3 book.

If you want a free eBook of the first chapter, O’Reilly has made it available: “The Windows PowerShell Interactive Shell.”

What’s new in this edition?

My previous post delved into this in tons of detail.

Workflow, being the biggest new addition to PowerShell in version three, represents the largest change to the cookbook in this edition. It gets an entire chapter of coverage – including some great guidance on when to write a workflow, and when not to!

Scheduled tasks get explained in detail, as do web and internet scripting techniques that we’ve now vastly simplified through Invoke-WebRequest, Invoke-RestMethod, and related cmdlets.

PowerShell version three also begins a large shift in the Windows Management world: from WMI to CIM. The Windows Server Blog talks about this shift in great detail, and the PowerShell Cookbook has been completely updated to incorporate this change.

And of course there’s the “little stuff”. The vast sea of changes we made to improve your life little-by-little: default parameters, customizing the updated tab expansion engine, mapping drives, creating restricted remoting endpoints with configuration files, updating help, working with alternate data streams – the list seemingly goes on forever.

If you liked the first or second versions of the PowerShell Cookbook, you’ll like this one even more :)

Resolving Adobe Reader Error 1328–“Updated by Other Means”

<Just putting this on the internet, in case it helps some poor soul. There are a lot of forum posts with the issue, none with the solution.>

 

I was recently trying to install Adobe Reader, and had an unfortunate blue screen right near the end. When trying to install again, I got this error:

Error 1328. Error applying patch to file C:\Config.Msi\PTxx.tmp. It has probably been updated by other means and can no longer be modified by this patch.  For more information contact your patch vendor.

Apparently, Adobe Reader 11.1 is distributed internally as two MSIs: "Adobe Reader 11”, plus a patch to bring 11.0 to 11.1.

After turning on MSI logging, I could see that the temporary installer files were going to C:\ProgramData\Adobe\Setup\{GUID}.

The solution, in my case, was to go to that location, run AcroRead.msi manually, run AdbeRdrUpd11001.msp manually (which failed), and then go to the control panel to uninstall Adobe Reader.

After that, running the official setup program (from http://get.adobe.com/reader/) worked.

 

Additional things I did along the way that may have helped, but I don’t think were required:

  • Manually deleted files left behind in ‘C:\Program Files (x86)\Adobe\Reader 11.0’. To do this, I had to take ownership of the files, and manually give myself permission to delete them.
  • Manually deleted a bunch of .tmp files from ‘C:\Config.msi\…’ that were time stamped from around the time I was doing this installation.
  • Manually deleted a few MSIs from ‘C:\Windows\Installer"’ that were time stamped from around the time I was doing this installation.

Online Backups–Now Cheap and Easy

If you’ve been feeling guilty about not regularly (or ever!) backing up your computer, peace of mind is close at hand. The backup industry has been changing recently, making online backups cheaper and easier than ever. If you have moderate backup needs and some technical ability, you can now back up your data for around 25 CENTS per month.

If you’ve been investigating backups, you’ve probably seen and considered a handful of options, from easy to complex:

 

image

SkyDrive / DropBox

Once in a while, you drag and drop files to your SkyDrive / DropBox.

Ease: Medium

Cost: Free ($0 / yr.)

Reliability: High

Recovery Speed: Low

Limitations: Storage extremely limited. Easy to forget to back up your stuff. Hard to keep track of what’s backed up and what isn’t.

 

image

CDs / DVDs

Once in a while, you drag and drop files to your CD / DVD burner, and then burn the files you care about to disk.

Ease: Low

Cost: Very cheap ($10 – $20 / yr.)

Reliability: Medium

Recovery Speed: Medium

Limitations: Storage fairly limited. Easy to forget to back up your stuff. Hard to keep track of what’s backed up and what isn’t. Physical catastrophes (burglary, fire, floods, etc.) that impact your computer will likely impact your backups, too.

 

image

Removable Hard Drive

Once in a while, you drag and drop files to your removable hard drive.

Ease: Medium

Cost: Low (One time $100 + $100 per hard drive replacement)

Reliability: Low

Recovery Speed: High

Limitations: Storage fairly limited. Easy to forget to back up your stuff. Hard to keep track of what’s backed up and what isn’t. Physical catastrophes (burglary, fire, floods, etc.) that impact your computer will likely impact your backups, too. Hard drive failures hard to discover, often only being discovered when you attempt to restore from a crash.

 

image

Network Attached Storage (“NAS”) / Backup Device

Buy a NAS or other backup hardware (such as a Windows Home Server). Included software automatically backs up your data, and can help automate the recovery process.

Ease: High

Cost: High (One time $300 / $400, + $100 per hard drive replacement)

Reliability: Medium

Recovery Speed: High

Limitations: Cost is usually prohibitive, or at least enables procrastination. Physical catastrophes (burglary, fire, floods, etc.) that impact your computer will likely impact your backups, too. Hard drive failures hard to discover, often only when attempting to restore.

 

image

Online Backups

Subscribe to an online backup service. Included software automatically backs up your data, and can help automate the recovery process.

Ease: High

Cost: High ($100 – $200 / yr.)

Reliability: High

Recovery Speed: Low

Limitations: Cost is usually prohibitive, or at least enables procrastination. Initial backup takes a long time, as does recovery.

 

If you’re reading this post, it’s likely that none of these solutions have hit the sweet spot for you. However, we’re at the cusp of a pretty large change in the online backup industry.

Much of the monthly cost of online backup services comes from the cost of securely storing your data. For example, Mozy online backup costs $10/mo. for 125 GB. Carbonite is about $100 per year per computer for unlimited data. Given these costs, consider Amazon S3 and Windows Azure Storage. These are both popular commercial bulk storage services that have the razor-focused goal of providing robust low-cost online storage. They cost about $9.50 per 100GB per month. As you can see, there’s not much room between the cost of raw online storage and the price that online backup services charge. In that gap, these online backup services still need to pay for their customer support staff, development of the actual backup software (raw online storage isn’t the same as real backups), and everything else associated with being a backup service.

Now, in this world of online backup companies, there’s a very interesting niche composed of a few companies: CloudBerry, JungleDisk, and a few others.

Rather than charge you a full service fee of something like $10 or $15 per month, they charge you a little bit for their service (CloudBerry: $30 one time, JungleDisk: $3 per month) and then you buy and connect a raw storage service (i.e.: Amazon S3) yourself.

JungleDisk supports two online storage services: Amazon S3, and RackSpace Cloud Files. CloudBerry supports those, plus a handful more: Windows Azure Storage, USB drives, network drives, and 10 or so more.

Now what’s this "fundamental change in the industry", and why does it matter?

Most of these bulk commercial online storage services (Amazon S3, Rackspace Cloud Files, etc.) are designed to let software easily upload and download files whenever you want. For example, Netflix uses Amazon S3 storage to hold all of its movies and stream them to you. However, keeping your data fresh and available has a pretty high cost to it, which is represented in what you have to pay these storage providers.

Your backup data is not Netflix, though. Backups really don’t need to be accessed that often, or that quickly. You send files as they change, but you don’t need quick access to a file that you backed up 6 months ago.

Realizing how different backups and archives were from regular Netflix-style bulk storage, Amazon introduced a new storage model called "Amazon Glacier" in August of 2012. Amazon has optimized Glacier for backup and archive scenarios – where storing new data must be fast, but delays of a few hours to retrieve data from storage is acceptable.

Rather than costing $9.50 per 100GB per month, Amazon charges about one tenth of that: $1 per 100GB per month.

What does this mean for you?

Given that cost of most of these online backup services is driven primarily by their bill from the bulk storage providers, many of them now have the opportunity to reduce their cost by $8 or $9 per month. After they’ve had the chance to update their systems to work with Amazon Glacier, online backup services should be able to offer packages for $2 or $3 per month. This won’t happen overnight, but is definitely on the horizon.

Except for one class of backup service, that is.

Remember that interesting niche of backup companies that provide the backup software, but ask you to buy the bulk storage yourself? These providers should be able to react much more quickly to support Amazon Glacier. In fact, one provider already has – CloudBerry Backup.

 

image

You know that pile of scrap quarters, dimes, and nickels you have in your dresser drawer? You could be looking at a year’s worth of secure online backup.

I’ve been using CloudBerry Backup for a few months now, and definitely plan to stick with it. I’ve been using a Windows Home Server for a few years, but have had more problems with it than I feel safe with. I’ll continue to use it for a backup device, but not as my main or most trusted one.

Cost-wise, here are my most recent bills from Amazon:

  • September: $2.93 (initial upload of 25 GB)
  • October: $0.27 (27 cents! for 25 GB backed up, plus 2 cents for usage charges from the CloudBerry software uploading new data, checking existing data, etc.)
  • November: $0.25 (25 cents! No usage charges, since I had temporarily disabled CloudBerry Backup.)
  • Disclaimer: CloudBerry offers their software for free if you review it (which this post does), so I did not pay for the software itself.

      What I like the most about CloudBerry is that it lets you back up your data to multiple destinations. If you have a USB drive, back up your data to the drive AND Amazon Glacier. If you need to quickly retrieve some files you lost, get them from the hard drive. If that’s failed, get them from the secure online storage.

    Now, is CloudBerry the right answer for you?

    At this point, it’s mostly a question of how comfortable you are with clicking through setup wizards. The process isn’t terribly technical, but requires at least a willingness to brave computer jargon.
    If those look reasonable, then yes – CloudBerry is the right answer for you :) At 25 cents per month for storage (with a free 2-week trial), it’s hard to go wrong.

Lenovo IdeaPad Yoga Review – Three Weeks In

I got a Lenovo IdeaPad Yoga just under three weeks ago. Now that I’ve had some time to put it through its paces, I thought it would make sense to post a quick update on how it’s going. In short: it’s going great, and I would buy it again if it were to disappear today :)

Hardware / Guts

If you’ve been drooling over the Yoga on the online store, the version you get at Best Buy isn’t any of the three you see on the Lenovo site. It’s like the base level one, but upgraded to an Core i5 instead of an i3.

To save power (on a Balanced power plan), Windows automatically scales the CPU to the task at hand. When you’re not using CPU-intensive applications, the processors get tuned down to about 0.85 GHz. I never thought I’d use the word “MHz” when referring to CPU speed again, but it’s true. 1 core running at 850 MHZ at rest or with mild use (like editing this blog post). At high load, you get the full 2 cores at 1.7 GHZ working for you.

image

As a result of these power-saving measures, battery life is stated at about 7 hours. While I haven’t measured it exactly, this seems about right for casual usage.

It comes with 4GB of RAM, which is user-replaceable – for $33, you can switch the installed 4GB to 8GB.

The wireless adapter is the “new standard” B/G/N. It doesn’t seem to be able to fully leverage dual-band routers, but then again nothing much can at this point.

Physically, the Yoga is pretty nice, but not awe-inducing. The palm rest / keyboard casing is a nice stippled kind of rubbery plastic. Online sites are calling it “leather”, but it’s definitely not. It came with a few stickers below the arrow keys and on the bottom side of the laptop. Most of them came off easily with no sticky mess or residue, but one Windows sticker had some bits I had to use my nails to scrape off a little bit.

I’ve got the silver Yoga – the forthcoming orange ones might look a bit snappier.

Hardware – as a convertible / tablet

The convertible hardware is the primary reason I got the IdeaPad Yoga. I wanted something that I could use like a laptop, but that still offered an experience where I could get the keyboard out of the way. I’ve seen people wrestle with devices where the keyboard detaches completely as the means of “getting out of the way”, and you end up feeling like you’re always carrying around crappy extra pieces of hardware. This desire for a laptop / tablet middle-ground is common, hence the new category of “hybrid” laptops that the Yoga plays so delightfully in.

The screen’s unique 360 degree folding feature is much better than I thought it would be. Folded completely around, it’s a neat “tablet-like” experience. It works great for fully immersive apps, and apps where you’re actively poking / swiping at things. In this tablet mode, though, it’s absolutely not in the category of a Surface or iPad. For example, I find my iPad too heavy to be a comfortable e-reader device. Holding it with one hand for an extended amount of time just stops being comfortable. The Yoga is heavier still, making it only reasonable for situations or apps where it can be supported by a lap, arm, two hands, etc.

When it’s in tablet mode, the first thing you notice is that you can feel the keys pressing and moving on the back side when you hold it. I don’t worry that it will cause any damage, bit it’s a little distracting at first. Then you get over it and move on with your life.

That said, open the screen / keyboard by 30-40 degrees while it’s on your lap, and you’ve got a situation even better than a tablet: stand mode.

image

Perfectly oriented at your face, and no-handed operation. Casual games feel so much more casual when you don’t need to hold the screen to a certain viewing angle. Web browsing feels so much more care free and relaxing when you only need to touch the Yoga to navigate or scroll.

Open it another couple of degrees, and it becomes a great viewing platform for movies, YouTube, XBox SmartGlass, etc. It’s amazing how much psychological distance a keyboard adds when it’s between you and the viewing screen. When the Yoga is in this stand mode, that psychological distance disappears.

I use the “tent mode” once in a while when horizontal space is at a premium (i.e.: for showing a recipe in the kitchen), but stand mode really takes the cake for me.

Hardware – as a laptop

As a laptop, the Yoga itself feels very thin and light. Not crazy razor thin and light, but it’s the kind of thing that you can pick up with one hand, hold by a corner, and not worry about dropping. My MacBook Pro now feels like an overweight monster in comparison. You don’t really notice it when it’s on your lap, and CPU-intensive apps don’t result in a third-degree burn to your legs.

image

 

The fan is extremely quiet when it is on, which is rarely.

The keys are laid out pretty well. The home / end /page-up / page-down buttons are a little awkward (they are in a column on the right hand side), but I suspect I’ll get used to them.

Given that it’s a Windows 8 laptop, its support for touch really changes the way you interact with computers. If you’ve only used Windows 8 with a keyboard and mouse, a whole new world of surprising efficiency awaits. And it’s delicious. Of course, the Yoga supports (and requires) touch in its other three modes (tablet, tent, stand), but it’s a huge unexpected improvement to a traditional touchless laptop.

Rough Points

The Yoga comes with crapware, but not much. It comes with a few useless modern applications, and a few useless desktop applications. For example, a lame PDF reader that tries to get you to upgrade to a pro version, and the option to install anti-virus. Nothing was difficult to uninstall, and it didn’t take much effort to get the laptop “clean” again.

The biggest surprise / problem with the Yoga initially came from its (poorly-performing) touch response. After fixing that, there have been no issues. 

Competition

As for its competition, here were the other ones I looked at (and some thoughts about them):

  • Lenovo Twist. This looks like the clunky old laptops that have been around forever, so I decided against it purely based on aesthetics.
  • Dell XPS12. This was my runner up. I decided against it because its screen resolution isn’t as good, it’s more expensive, and isn’t yet available. After spending some time with the Yoga’s convertible features (which are offered, but with different mechanics), I’m doubly-glad I didn’t pick this.
  • Asus Taichi. More expensive, not shipping, and only appears to work in touch-screen mode when you’ve got it fully in “tablet mode”.

Fixing Touch Screen Delays / Lost Input on a Lenovo IdeaPad Yoga

I got a Lenovo IdeaPad Yoga this weekend (loving it!) but noticed an annoying quirk – the different Windows 8 edge swipe actions seemed to require two swipes. A few reviews have run into this as well, such as this one from ZDNet.

Once you got it reacting to your swipes, though, everything was instantaneous. After experimentation, it turns out that not touching the screen for about 4 seconds was enough to put it into this double-swipe mode – which is evidence of some sort of sleep mode.

It turns out that this doesn’t just cause edge swipes to go missing – it causes a general feel of sluggishness and lack of reaction. You click a button, and it doesn’t register. You click again, and it finally does.

After a bunch of digging and unrelated searches, it turns out that it is indeed a sleep mode issue – the driver for the touch screen has the option enabled to let Windows put it to sleep.

The solution is simple:

  1. Open Device Manager
  2. Go to “Human Interface Devices”
  3. Go to the last USB Input Device (my Yoga has two), then “Properties”
  4. Open “Power Management”
  5. Unselect “Allow the computer to turn off this device to save power”.

If that doesn’t resolve the issue, then select the box again and try it on the other USB Input Device(s).