Booked my flight for the MVP Summit in November

I finally got around to booking my flights to the MVP Summit in November. Getting a rental car this time, one of my co-workers will be the same flight and we can skip the taxi/shuttle/uber rides and do possibly see a little more of Seattle this time around.

Just got a nice bump in speed from Verizon FiOS

This morning I received an email from Verizon FiOS informing me that my upload speeds are now as fast as my download speeds.  I currently have the 50 Mbps download, 25 Mbps upload package.  I just checked with Ookla’s speedtest.net and my current speed is now 58/63.

Current Internet speed from my home
Current Internet speed from my home

For once, my upload speed is actually faster than the download speed.  One thing about FiOS, my connection speeds are almost always higher than what I am rated for.  I was a loyal Time Warner customer for years, but my upload speed was awful and the download/upload speeds approached, but never reached the speeds that I was paying for.

My Hallway Conversations interview is out

Hallway Conversations Podcast
Hallway Conversations Podcast

A couple of weeks ago I was interviewed for the Hallway Conversations podcast. That interview is now on their site and can be downloaded by your favorite podcast app. I talked with Phil Japikse, Stephen Bohlen, and Lee Brandt. I had met Lee a few years back, when he did a presentation for TVUG about using Kendo UI. We talked about the business case for using Xamarin for developing native mobile applications.

We had a good conversation about the merits for using Xamarin and who the target audience is for those tools. I talked about how and why I ended up using Xamarin for our first native app and what hurdles I had to overcome to get that app done. And we talked about the costs of the Xamarin product and how that really wasn’t a factor in why our company decided to go that route.

I had a lot of fun doing the podcast.  If you are considering using Xamarin to write native apps for Android and iOS, it’s worth listening to this podcast episode and an earlier one with Xamarin’s Jon Dick,

Using Powershell to concatenate files and strip off the headers

We had a request from a client to merge some files for an import process that we have.  As part of one of our applications, we can import delimited (comma, tab, etc)  ASCII files.   The client was generating the files from 5 different processes.  Each exported file has a single line header row, and the files were from OS X.  That meant that the files were Unicode encoded and ended each line with only a carriage return.

Our import process can only handle a single ASCII file with DOS style line endings (carriage return + line feed).  It’s a legacy system and it can’t be touched.  What we can do to concatenate the multiple files into a single file and strip out the header rows for every file after the first one.  And change the encoding to ASCII and use the CR+LF combination that DOS loves so much.

I’ve been doing a lot of Powershell lately, so it made sense with me to continue with that Swiss Army knife of scripting languages.  I ended up with the following script:

[CmdletBinding()]
param(
  [parameter(Mandatory=$TRUE,Position=0)]
    [String] $Pattern, # input pattern to match, including path. Example: c:\export\*.txt
  [parameter(Mandatory=$TRUE,Position=1)]
    [String] $Destination # Destination file to write
)

begin {
    $FileCount = 0

    # Get all of the files that match the wildcard pattern

    Get-ChildItem -path $Pattern | ForEach-Object {
        Write-Verbose "$FileCount $_.FullName"

        if ($FileCount -eq 0) {
            # For the file, just write it out as ASCII
            Get-Content $_.FullName | out-file -FilePath $Destination -Encoding ascii
        }
        else {
            # For each additional file, skip the header line and append as ASCII to the destination
            Get-Content $_.FullName | select -skip 1 | out-file -FilePath $Destination -Append -Encoding ascii
        }

        $FileCount++
    }

    Write-Verbose "$FileCount file(s) processed"
}

The first five lines take care of the parameter binding. This script only needed two parameters. $Pattern is the path to the input files, including wildcards. $Destination is the full path to the file to concatenate the source files into. The optional “-verbose” parameter is supporting for displaying some text as the files are being processed. This is a standard Powershell parameter, that’s why it’s not included in the parameter list for this command.

    Get-ChildItem -path $Pattern | ForEach-Object {

We are using Get-ChildItem to get all of the files that match $Pattern and then call ForEach-Object to iterate through that list.

        if ($FileCount -eq 0) {
            # For the file, just write it out as ASCII
            Get-Content $_.FullName | out-file -FilePath $Destination -Encoding ascii
        }

For the first file, we just need to read it in and output it back out to the destination files. Powershell will handle the line endings and we will force it to ASCII. The $_ variable is a placeholder variable. When you are using a Foreach-Object loop, the $_ represents the current item of the loop. When you get use Get-ChildItem for a file or folder, .FileName is a property of the item or array of items being returned.

        else {
            # For each additional file, skip the header line and append as ASCII to the destination
            Get-Content $_.FullName | select -skip 1 | out-file -FilePath $Destination -Append -Encoding ascii
        }

For each additional file, we read the file in, select every line after the first line, and finally append it as ASCII to the destination file.

The “Write-Verbose” lines will only execute when the -verbose parameter is used. So if that script had been saved as c:\scripts\convert-files.psi, you would execute it like this:

c:\scripts\convert-files.ps1 -pattern c:\export\*.csv -destination c:\import\all.csv

c:\scripts\convert-files.ps1 -pattern c:\export\*.csv -destination c:\import\all.csv -verbose

That would concatenate all files that end with “.csv” in the c:\export folder and write a single file named c:\import\all.csv. If you add the “-verbose” parameter, you will see the names of the files as they are being processed.

Comcast did WHAT in Houston? You are now a public hotspot.

Yesterday, Comcast flicked the switch that turns the home routers for 50,000 of their Houston subscribers into public Wi-Fi hotspots. It’s been covered in a few newspaper articles, I came across it on this SeatlePI article and this followup by Dwight Silverman.  Dwight writes for the Houston Chronicle, but I saw the syndicated copy on the SeattePI site.

If you live in Houston and have a XFinity Router, then you may already be a public Wi-Fi hotspot.  The router serves up the public Wi-Fi access on a separate wireless network from your home network.  But it’s using your bandwidth and the possibly the same IP address.

If you do a search of Wi-Fi networks and you see one or more named “xfinitywifi”, then your or your neighbor is now a public hotspot.  This is an opt-out policy.  Unless you request not to be a public hotspot, Comcast is going to enable it on your router.  Comcast had sent out letters to their customers, but how many of them read those letters?

The idea sounds good on the surface.  If you are a Comcast customer, you will have Wi-Fi access whenever you are close to another Comcast customer.  You would be able to connect your tablet or laptop in more places.

One problem with this is that you are sharing the bandwidth available to that home subscriber.  Comcast is making more bandwidth available to the home, but they can’t create more Wi-Fi bandwidth.  You can only carry so much network traffic over Wi-Fi.  If you live in busy neighborhood or close to a shopping area, other Comcast customers connected to your router could use enough bandwidth to make it difficult for you to connect to your own router.  Comcast can alleviate that with Quality Of Service (QOS) rules in the router, but that wouldn’t eliminate the problem.

Then you have the security issues.  Unless Comcast has modified the routers to get two outside IP addresses, anyone who connects to the public hotspot from your router will provide the same IP address to the rest of the world that you provide  This is the external IP address that shows up when you are connected to a website, not the internal IP address that your device thinks it has.    That means if someone was using BitTorrent to download and share copyrighted material like music or movies, it would be your IP address that would be tracked.

When Comcast gets the subpoena from the MPAA asking for the identity of the person using your IP address because that IP was sharing copies of “Frozen”, will Comcast be able to determine that the offending activity was done over the public hotspot as opposed to your internal network?  If they have the same IP address, then you are going to be facing the legal battle to prove your innocence.

If the public Wi-fi can be traced separated from your use of the same router, then Comcast has just made it easy for people to run Bittorrent sharing sites or perform other nefarious activity anonymously.  Just connect a Hotspot named “xfinitywifi”.  It can from your router or your neighbor’s.  It doesn’t matter, it’s not traceable back to you.  Comcast can block ports used by Bittorrent clients, but it will be hard for them to block everything.

You can opt out after the fact.  SeattlePI’s Dwight Silverman posted the following instructions here.

  • Log into your Comcast account page at customer.comcast.com.
  •  Click on Users & Preferences.  
  • Look for a heading on the page for “Service Address.” Below your address, click the link that reads “Manage Xfinity WiFi.”  
  • Click the button for “Disable Xfinity Wifi Home Hotspot.”  
  • Click Save.

With the Comcast/Time Warner Cable merger currently in FCC review, this could affect more than Comcast customers,  If you are a Time Warner Cable customer, it’s possible that after the merger that public Wi-Fi program could be rolled out to TWC customers.  This is just one of those ideas that sounds good on people, but make me uneasy when they are actually implemented.

Been reading “iOS Development with Xamarin Cookbook”

iOS Development with Xamarin Cookbook
iOS Development with Xamarin Cookbook

A new Xamarin iOS book has just come out and if you’re programming for the iPhone on the Xamarin platform you will want it on your bookshelf.  It’s titled “iOS Development with Xamarin Cookbook” and is written by Xamarin MVP Dimitris Tavlikos.

This book will take you from the first steps in writing and compiling an iOS application with Xamarin to working with advanced topics like writing multi-touch gestures and working with iCloud.  The intended audience for this book are .NET developers new to iOS development and Objective-C developers who want to be able to use the Xamarin tools.

This is not a cross-platform guide.  While a few topics have corresponding features with Xamarin.Android, this is an iOS only book.  For example, chapter 12, “Multitasking”, covers the iOS specific APIs for running code in the background and how to respond to events raised by the background code.

The advantage of writing a guide for one platform is that Dimitris can go deep on specific features and APIs.  Each chapter has a set of “recipes” that explain how to do a task.  Each recipe is independent from the others.  You don’t have to build the first four recipes in a chapter in order to try out the code for the fifth.

Each recipe follows a pattern.

  1. Recipe Name: First Dimitris describes what the recipe will do
  2. Getting Ready:  What has to be done before the recipe code is written.
  3. How to do it:  A series of steps that describe the code to write
  4. How it works: An in-depth description of what that code does
  5. There’s more: Addition information about this feature
  6. See Also: A list of other recipes that are related to this one

For me, the book was worth it just for chapter 14, Deploying.  I don’t have to submit apps to App Store that often, it’s useful to have all of the steps required, all in one spot.

This one is for your grandparents (aka “I’m calling you from Windows and you a have virus”

Only you can save Grampy and Oma
Only you can save Grampy and Oma

OK people, this one is for your parents and your grandparents.  There is an annoying scam that has been going around where they get called from someone claiming to be from Windows and the weasels have detected a virus on their PC.  And then the weasels extort hundreds of dollars from the nice people who gave you money for every report card.  And you can protect your people. You are their only hope.

The weasels employ some cheap tricks to convince you that your machine has a virus and then get you to install a remote access app to let them hijack your PC.  With control over your PC, they can install pretty much anything they want.  Then you find out that you need to pay them lots of money to get control of your PC back.  Or they’ll lock it up so you can’t use it all.

This is what you need tell Grandma.  When the weasel calls from Windows, just hang up.  Don’t say anything once you hear them say they are from Windows or are from “Tech Support”, just hang up. They may call right back, or perhaps the next day.  Just hang up.

This scam has been going around for a few years and it’s classic social engineering.  They will walk you through launching the Windows event viewer and have you scroll through the list until you see an error message.  You’ll always see an error message, something is always complaining about something under the hood.  It’s more or less business as usual in Windows.

There's always an error, you can ignore most of them
There’s always an error, you can ignore most of them

But the weasel is going to tell you that it’s a virus and they will fix it for you.  he tell you that he needs to access your PC to verify what the problem is. He’ll have you run “a diagnostic tool”, that’s how the weasels install their malware.  Once their software is installed, they basically own the machine.  If you don’t pay up, that machine is basically under their control.

This scam has been going around for a few years.  Why?  Because it works.  Enough people are fooled to where this can make some money to people who are clearly deficient in the moral compass department.

This is on you to be the first line of defense for your family and friends.  If Mom and Dad (or Grandma and Pop-pop) have a PC and are not IT skilled, then make sure their important stuff is backed up somehow.

Here’s  a short list that easy to do:

  1. Have a copy of all of their email accounts and passwords.  If their machine gets compromised, you should be able to go online and change all of their passwords for them.
  2. Ditto for their Facebook and other social media accounts.
  3. Make sure that if they do any online banking, they use unique passwords for each account.  And have them write that stuff down.  They may not want you to have the keys to your future inheritance, but you need to be able to help them lock down the access to those account.
  4. Write down the product keys for anything that needs to be reinstalled.  That includes Windows.  There are free tools like Belarc Advisor or Magic Jelly Bean that will look this information for you.  If you need to reinstall Windows, this will savea  lot of time.
  5. The sky is the limit for backups, at the very least get portable hard drive and just backup their important files on a regular basis.  I would use two drives and swap them out.  Go on the assumption that the drives will fail after year.  It’s OK, Staples will have them on sale again.   In addition to protecting their files from someone locking up their PC, you get the backup protection in case the hard drive goes on the PC.

The first four steps, you just need to once and update when their accounts are changed.  The backup you just have to get them in the habit of doing.  Or you just do it for them.

Just remember the cardinal rule: hang up the phone.  If Grandpa doesn’t want to hang up in the case that it’s valid call, then let the call go to the answering machine.  If it’s a real call, they’ll leave a message and a call back number.  A weasel is not going to leave a number where you can call them back.

A great suggestion came in after I originally posted this.  When the weasels call, tell them that you work for Microsoft.  They’ll hang up and not call you again.  Different weasels will call, but not ones that called you before.

Photo from SalFalko’s photostream on Flickr, used under CC license.

Using the Windows Phone 8.1 Start Background to personalize your phone

A great way to personalize your Windows Phone 8.1 device is a custom start background.  You are no longer limited to using the 20 or so accent colors as the default tile color.  You can now select an image file to use as the background.

When you select an image, it becomes a fixed background.  When you scroll the start page, the location of the image stays fixed,   Most of the bundled apps will use a transparent background when a background image has been select, allowing the background image to show through.

This allows you to personalize your phone even more to your tastes.  You can use any image that is on your phone or accessible through OneDrive.  I have found that using darker, muted colors worked well, providing a good contrast with the foreground tile color.

You can select the image under “start+theme”, in the settings app. You should see something like this:

start+theme, under settings

When you click choose photo, you get the standard image picker and you can select an image that is on your phone or in your OneDrive account.

The image that I used here is from the DeviantART web site.  I did a search on “grunge” and selected a couple of images that I liked.  This image is named Hazard Grunge and is from the user named WheelOfFish.

After selecting the picture, you will then select which area of the picture to use as the background.  Since the image will mostly likely not match the aspect ratio of your phone, you select which part to use.

Clip the image

With the final result, you get a much cooler looking start page.  And it looks more like your phone than just another Windows Phone.

My Phone

Resolving the “The ‘CctSharedPackage’ package did not load correctly.” error message

"'a' stands for headache" by Eduardo Ortiz

After launching an Azure project in Visual Studio 2013, I was handed a “The ‘CctSharedPackage’ package did not load correctly.” error message.

The 'CctSharedPackage' package did not load correctly.

I was unfamiliar with that one, and a quick check of the forums showed that a few people had reported this happening after installing the latest Windows 8.1 update. An update that I had installed two nights ago.

If you check the Visual Studio activity log in %APPDATA%\Microsoft\VisualStudio\12.0\ActivityLog.xml, you’ll see something like this

<entry>
  <record>1638</record>
  <time>2014/04/14 02:36:02.772</time>
  <type>Information</type>
  <source>VisualStudio</source>
  <description>Begin package load [CctSharedPackage]  </description>
  <guid>{77A5A151-6A9B-4D08-BC38-340AB29566E2}</guid>
</entry>
<entry>
  <record>1639</record>
  <time>2014/04/14 02:36:02.773</time>
  <type>Error</type>
  <source>VisualStudio</source>
  <description>SetSite failed for package [CctSharedPackage]  </description>
  <guid>{77A5A151-6A9B-4D08-BC38-340AB29566E2}</guid>
  <hr>80070002</hr>
  <errorinfo>Could not load file or assembly 'Microsoft.VisualStudio.WindowsAzure.Diagnostics, Version=2.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.</errorinfo>
</entry>

Something in the Windows 8.1 April Update blew out at least one assembly that Visual Studio needed. This has an easy work around. Shut down any instances of Visual Studio that you may have running. Go to “Programs and Features” in the “Control Panel” and look for an item that starts with “Windows Azure Tools for Visual Studio 2013″.

Double-click that item to bring up the modify setup dialog. On that dialog select “Repair”.

Azure Tools Modify Setup dialog

That will churn for a minute or two. After that completes, you should be back in business. If you are using the Azure Tools with other versions of Visual Studio, you may may to repair them as well.

An alternative means of fixing this is by re-installing the missing assembly into the GAC as described on Stefan Camilleri’s blog.

<code>C:\Program Files (x86)\Windows Azure Tools\Visual Studio 11.0&gt;gacutil /i .\Microsoft.VisualStudio.WindowsAzure.Diagnostics.dll</code>

I chose the self repair option of the Azure Tools installer, because I had no idea if anything else was broken.  That’s the why Windows Installer technology has the repair option.  It will fix the stuff under the hood that you can’t easily see.

Once I got that straightened out, I checked to see if there was a later version. I was at v2.2 and v2.3 was released during //Build. So I grabbed that and installed. I probably could have just upgraded straight from 2.2 to 2.3 without repairing the v2.3, but I did this way with out any problems.

*The “a” is for headache image is from Eduardo Ortiz’s collection on Flickr

Best single source for dealing with iOS battery drain

If you or anyone you care about has been dealing excessive battery drain on the iPhone, a former Apple Genius Bar staffer has written the single best resource.  Scotty Loveless posted The Ultimate Guide to Solving iOS Battery Drain on his blog.  Bookmark it, print it, Instapaper it, just keep a copy of it somewhere.

His article was aimed towards iPhone users, a few of the tips are applicable to all smart phones.

A work in progress

%d bloggers like this: