Wednesday, May 15, 2013

There should be a Blue Rhino for Electric Cars

What if the car companies came together and come up with a standard for replaceable electric car batteries?  It takes hours to charge an electric car battery.  That just pretty much limits the use of an all electric car to local use for small amounts of time. It also limits the number of vehicles that could be charged at any time.

I’m starting to see charging stations around here where you can let your car charge up during the day.  But it doesn’t help if you do errands all day and you are not parked in any single location.  At some point, you’ll have to call it day and head home to your own charging station.

What if you could get around the charging period by using swappable batteries? You could go a gas station and they would swap out your depleted battery with one with a full charge.  It would be like the “Blue Rhino” model for swapping gas grill tanks.  That’s where you bring your propane tank in the hardware store, the grocery store, etc.  And they give you a different one already filled.  You are in and out in a few minutes and the store can service many more customers at peak times.  The Blue Rhino people come in and swap the tanks with fresh ones.  It’s a good model and works pretty well.

For electric car batteries, this is not a trivial problem to solve.  The biggest one is that every car has a different layout for their batteries and they are not designed to be swappable.  This would require major design changes for the car companies.  Plus you would have to have the infrastructure to support a network of batteries.  There would have to be away to easily remove the exiting battery pack and attach the new one.  The filling stations could recharge the batteries overnight when the rates are lower. 

If the car companies could come to a standard for the charging port (which avoided the betamaxing of the electric car market), they could come up with a standard battery pack. You could have a mix of replaceable batteries, plus a fixed set that was optimized for that car. You don’t need to have a full set of batteries to be swapped, just one large enough to go 50 miles or so. That would make it easier for car designers. They can design a rack that provides easy access via the trunk or a car, but have the rest of the car to place the other batteries.

There should be a smart network for locating battery packs.  When your battery is low, the car could check for the closest filling station or car dealership that had full batteries in stock.  This would take some of the fear out of running out of battery power while you are out and about.  You have a smart phone app or web page show the closest station, or just add a 3G/4G radio to the car.

Someone should design a smart rack for the battery packs.  This rack could charge all the battery packs, eliminating the need for someone to swap charging cables.  It could also report it’s status and location to the smart battery network in real time.  When your car told you that fresh batteries where at the Mobil station 2 miles down the road, that information would be current and accurate.  You could also bring fresh smart racks to locations that were running low during a busy day.

This also helps with another issue that electric car owners deal with: rechargeable battery packs have a finite life span. Lithium Ion batteries typically last 3 years. By swapping batteries out, you are not stuck with a battery that’s at the end of it’s life cycle. You can have government subsidize the cost of replacement batteries or factor it in as part of the cost when you swap the batteries. Either way, you avoid financial hit at the 3 year mark.

If we could do this, I think we would see more electric cars on the road.

Monday, May 13, 2013

I git it now

Sharing code across OS X and Windows was a bit more challenging than what I had expected. We have our own TFS servers, but Xamarin Studio on the Mac really can't do much with them. XS does support git, so I have been using a local repository on the Macbook to version control the source code.  I needed to have that source backed up in a sane mannor.

Local TFS servers do not support git (yet). So to get the git repo into TFS, I need a transfer station of sorts. My other work development box is a Windows 7 machine with access to our TFS server. The fun part is getting the code from OS X to Windows without having to do a bulk copy each time.

The first thing I looked at was gitstack. Gitstack is git server that you can use to push your local repo up to. I spent a few hours, but I could not get the Macbook to push the repo up to it. I'm sure it works somehow, but my basic ignorance of how git works is probably a factor. I don't want to have to think to use version control. Tools should not get in the way of the development process.

While local TFS doesn't support git, TFS in the cloud does. I went in and created an account. I then created a new project by clicking the "New Team Project +Git" button. This will bring up a dialog that will let you create a new tem project and specify git as the version control.

By default TFS uses a Windows Live account for credentials. You can add a secondary set of credentials so that you can pass in a user name/ password to authenticate. I found it non-intuitive to find that option a second time. Follow these steps to create (or edit) a second set of credentials for your account

  1. Login into your TFS account.
  2. In the upper right corner of the screen, you will see a gear icon. Click that gear to go to the control panel
  3. In the upper right corner of the screen, you will see your name or email address and a drop down chevron. Click the chevron and select "My Profile" when the dialog opens up.
  4. The "User Profile" dialog will appear. You can change your avatar and display name here.
  5. Click on the link labeled "CREDENTIALS". This will switch to the Alternate Credentials tab on the dialog.
  6. Now you can enter in the secondary credentials. The user name must be alpha numeric only, you can't use an email address.
  7. Click "Save Changes" to save the new credentials.

Now you can use those new credentials when pushing or pulling changes from git. On the Mac, you store those credentials in the OSX keychain so that you will not be prompted each time. I found that the osxkeychain helper that was installed with the OSX version of git to be completely broken. I manually installed a newer copy based on the instructions posted here.

On the OS X side, I had installed git and it was on the search path. I opened up Terminal and in my source code folder, I used git to clone the TFS repo using the following syntax:

git clone https://myteamname.visualstudio.com/DefaultCollection/_git/myproject

This created the folder for the project with all of the git bindings. From within Xamarin Studio, I was able to perform local commits and that worked just fine. I tried to do a push from within Xamarin, but it failed because I had different local git credentials than I did for TFS. I could not find anyway from with Xamarin Studio to specify the git credentials. I've posted a question about that in the Xamarin forums, I'm hoping it's something simple.

But I can push and fetch from the command line, so I just created a bash script file and I run that to synch with the remote report. There are some OS X GUI clients for git, Harry Wolff reviewed some of them here. Right now, I'm going to stick to the command line until I grok git. At the end of the day, I have what I wanted: a local git repo on the dev boxes, with a master repo in the cloud.

Thursday, May 09, 2013

Getting Hyper-V to work on a HP Envy23


I finally got Hyper-V working on our HP Envy 23.  For Christmas, I had bought a new PC for our family.  We have a shared PC in a our family room that everyone uses for email, browsing, etc.  At the time I was working on a Windows Phone 8 project and I needed a machine that could handle that development.  My own PC was running Windows 7 and you need Windows 8 or better for Windows Phone development.

Actually, you need better than Windows 8 for effective Windows Phone development.  To run the Windows Phone 8 emulator, you need to have Hyper-V installed, which requires Windows 8 Professional and a machine with the virtualization enabled in the chipset.

We wanted an all-in-one PC.  It’s in a shared family space and a AIO will take up less room and generally look nicer.  Dell had some interesting models, but you couldn’t get one with Windows 8 Pro, just Windows 8.

With HP, you could get a machine with Windows 8 Pro.  So I ordered an Envy 23 with an i5, 6GB of RAM, and Windows 8 Pro.  It is a nice machine with a good 23” touchscreen.  We went from a huge mess of power cables, USB cables, and assorted wires, down to just a power cable and an Ethernet cable.

HP Envy 23

As a side note, while this machine has decent WiFi built in.  I prefer that ancient Ethernet technology.  Our house has so many devices using WiFi, anything networkable that's not mobile goes on Ethernet.  I had a few rooms wired for CAT-5e years ago and I use Powerline adapters where the cables don't reach.

As typical of a new PC designed for home use, hardware virtualization was not enabled out of the box. I had to go into the BIOS screen and after a bit of searching, I found the virtualization setting under "Security".  I don't know why they put it there, but that's where it was.  So I turned it on and booted up into Windows.  Since Hyper-V is not typically installed on a new machine, I had to install it.  Pretty easy to do and took less time than trying to find the virtualization setting in the BIOS.

I rebooted the PC and it hung on the loading Windows screen.  Turned off the virtualization setting and it rebooted just fine.  Tried uninstalling and reinstalling Hyper-V, didn't fix it.  After trying multiple combinations, it was obvious that virtualization and Hyper-V didn't work.  I called HP support and they said that Hyper-V was supported on this hardware and that either I had installed something that conflicted with Hyper-V or I had a hardware fault.

I didn't agree with either assessment, but I had to follow along with HP's support.  When I bought the machine, I had bought 3 years of priority support.  I usually don't bother with extended support, but it was the cheapest way to buy this machine.  They shipped out a new machine and a week later it arrived.  Fired up the new machine and enabled Hyper-V and virtualization.  Same problem.  That both ruled out a machine specific hardware fault and ruled out the installation of another app being the root cause.

At this point, I just wrote off the problem and sent back the new machine.  Other than the Hyper-V problem, the rest of my family was very happy with the Envy 23.  I ended up building a new machine from scratch that happily runs Hyper-V, so I no longer had the pressing need for Hyper-V on the this machine.

But not being able to run Hyper-V on a machine with the CPU and OS that clearly support virtualization bugged me.  Last night, I did a quick search on "Envy23" and "Hyper-V" and saw a few hits.  I was not the only one with this problem.  The first match was on "Enabling Hyper-V and restarting results in a hung system...".  It was posted by another developer with a similar Envy 23 machine and was seeing the same problem.

Someone had responded to that message that he had fixed the same problem on his HP laptop by updating the Bluetooth adapter's driver.  He had included a link to another message thread in a HP forum with details about the version and where to get the file.

The problem seemed to be with the Ralink Bluetooth 4.0 Adapter.  Various people had version 9.2.10.6 of the driver installed.  When they installed to version 9.2.10.10, the problem went away.  That sounded like an option worth pursuing.

So I decided to roll the polyhedral dice and try installing that driver.  Now normally, I'm not a fan of installing hardware drivers unless I know that they are specifically for the hardware that I own.  It's a commodity part and most likely uses a driver for a family of related parts. Also, I back up my machines to a Windows Home Server box.  The worst thing that happens is that I hose the machine and have to do a bare metal restore.

I downloaded the driver and starting installing it. As part of the install, it uninstalled the previous version and I had an "uh oh" moment.  My mouse and keyboard connect over Bluetooth, updating the driver could affect them.  Fortunately, they worked through the process.  After installing the update, I rebooted the PC and everything seemed to work just fine.  The mouse and keyboard still did mouse and keyboardy things, so I knew that Bluetooth was still operational.

I rebooted one more time and enabled virtualization in the BIOS and booted up the machine.  This was the moment of truth.  The PC booted up normally and I was able to verify that Hyper-V was installed and functioning normally.

So, that brings us back to why it failed with the original driver installed.  I don't know why a Bluetooth driver would hose the operating system when Hyper-V was enabled.  That is so random, it's not something that I would have considered as a the root cause.  From reading the messages on the HP forum, it looks like someone had reinstalled the OS and had needed to download the Bluetooth driver.  When they installed the latest version available, they were able to boot with Hyper-V and made the connection that the Ralink driver was the root cause.

Monday, May 06, 2013

My journey into the Center of Gravity

Last Friday I was given a tour of the Center of Gravity (COG).  What exactly (and where exactly) is the Center of Gravity?  It’s full name is the Tech Valley Center of Gravity and it is a community of technical and artistic creators, makers if you will.  They have a permanent makerspace in downtown Troy, NY and their grand opening is today.

I was lucky enough to get a tour on Friday from one of directors of board at COG, Laban Coblentz.  While their location is new, they have managed to collect a fair of equipment already. There is a lot equipment that can be used now.  From old time drill presses to laser cutters, from soldering stations to a bio lab. They are off to a good start.

 

You can sign up for free as an associate member, that will get you a membership card and the opportunity to purchase day passes to access the equipment in their makerspace.  If you plan on doing a lot of building and tinkering, then you’ll want to step up a full membership at $60/month) or “Super User” at $100/month.  The paid membership gives you full access to the makerspace and includes safety training.

If you need to fabricate some one off parts for a project, they have a couple of 3D printers.  In a couple of years, you’ll be able to buy one a Walmart, but right now it’s hard to get access to one around here.  When I did my robotics project last fall, I could have used a 3D printer to make the mounting pieces.

For additional pictures of the COG, the All Over Albany blog posted a large set on their site.

Tuesday, April 23, 2013

Notes on attending Xamarin Evolve 2013

Last week I attended the Xamarin Evolve 2013 conference in Austin. It was, hands down, the best conference that I have ever attended. It was divided up into two days of training, plus two more days of conference sessions. I attended all four days and the training days alone were worth the price of admission.

I’ve been using Xamarin.iOS for about 5 weeks now. I’m working on an iPad prototype for a companion app for one of our existing desktop apps. I’ve been amazed over how well the Xamarin tools worked and I’ve been able to get a nice app up and running. I had just enough exposure to Xamarin to be able to appreciate the training that I received.

They broke the training into two tracks, Fundamentals and Advanced. I had enough entry level experience with Xamarin.iOS that I wanted to mix and match the sessions, but the training rooms filled up to capacity so I stayed in the Fundamental track. The session instructors were top notch and they had Xamarin TA’s floating around the room to keep everyone on track. Of the code examples, there was less typing of code and more uncommenting out of blocks, but that was OK. On the track that I was on, this was new ground for many people and have of the experience was learning how the tools worked and how iOS design patterns worked.

One smart thing that Xamarin did was to send out the course material a week before the conference. The sessions made extensive use of the sample projects and it saved a lot of time to have that preinstalled. Instead of including the slide deck from the session, they included what looked like chapters from a training manual. hat is much more useful than a slide deck.

During the conference keynote, Xamarin CEO (and co-founder) Nat Friedman had two surprises for us. The first one was a Xamarin native iOS designer. This will free us from the horror of Interface Builder. It only works with storyboards, but has the ability to work with custom components and saves us from the general head scratching weirdness of Interface Builder.

The other surprise was big. Xamarin Test Cloud is a cloud based testing platform that lets you test your apps on hundreds of mobile devices. With 1500+ devices, the Android platform has become increasingly fragmented. You have to deal with multiple carriers, multiple screen resolutions, and multiple versions of Android. Test Cloud will let you upload your app to their site and select which mobile devices to test it on. 

It has a UI scripting language so that you can test your app the way a user would do it. You will get a report of which devices passed and which ones failed. You get screen shots of each step, that allows you to visually verify that the correct results would be on the device. 

In addition to testing UI interactions, you get machine profiling as well. You can see memory usage, CPU usage, and response time. This is a game changer, no one else has this on the market. If I were still doing Android coding on the native java tools, I would switch to Xamarin just for the Test Cloud usage. No one knew how much this will cost, but Sourcegear’s Eric Sink summed it up best (and I am paraphrasing): “It’s going to cheaper than what I would pay a QA guy to do all of that manually.”

The hardest part of the conference days was picking which session to attend. I’m a big fan on Jon Dick’s ZXing.Net.Mobile scanning library, but his session was scheduled at the same time as Nic Wise’s MonoTouch Dialog session. I needed help with MT.D more, so it was off to that session. Xamarin filmed all of the sessions, so at some point I’ll be able to see the sessions I missed.

Another great session was Stuart Lodge’s session on MvvmCross. The MvvmCross library provides XAML-like binding to Android and iOS, and allows you to create cross platform apps using the MVVM design pattern. If you are supporting iOS, Androids, and Windows 8/Windows Phone, you really want to look at this library.

Wally McClure did a session on mapping that I liked.  I like the way he does his presentation. He went around meeting the session attendees before he started, that was a nice personal touch.

I did miss the comedy show on Tuesday, Xamarin had set up a mini-hackathon and I lost track of the time while doing that.

Tuesday night, Xamarin rented the park across the street from the hotel and had a series of food trucks providing the best that Austin had to offer. The giant sized Jenga was pretty popular.

I got to meet and talk with Miguel de Icaza.  He was funny and very bright.  He asked what I was working on and what I thought of the training.

Wednesday had a great UI session by Josh Clark.  Called “Buttons are a Hack”, it was about how to use touch interfaces to design beautiful apps that anyone could use by just picking up the device and exploring.  Any session that starts out with a clip from “This is Spinal Tap” is a winner.

One of the cooler things that Xamarin did was to provide 30 minute sessions with one of their engineers.  That time was available for questions and code review.  I set up my session a week before the conference and one of their support reps had me sent in some screenshots and a list of questions.

When it was time for my session, I was able to get all of my questions answered and I was able to verify that I was using some of the iOS internal objects correctly.  I was pretty sure I had it right, but it was nice to have the code validated.

Since we were in Austin, a bunch of us went out one evening to see the bats at the Congress Avenue bridge.  About a million bats nest under this bridge and they all leave at dusk to go feeding.  It was incredible to watch them all fly out.  There were so many, that from a distance they looked like a cloud,

Evolve 2013 was a great experience.  I learned a lot and made some new friends.  I’m looking forward to Evolve 2014.

postscript:
More Congress Ave Bat pictures can be found here.

Sunday, March 17, 2013

Why was microphone button on the iPad virtual keyboard disabled?

After demoing some voice dictation with an iPad app that I am working, the microphone button stopped working.  It was fine for one demo, disabled for the next one.  I could not figure out what had changed.  I kept seeing numerous references for setting the dictation option and making sure that the iPad had a network connection.  Stuff like this forum posting on discussions.apple.com:

It should be in Settings > General > Keyboard > Dictation, and will only then appear on the keyboard (to the left of the spacebar) if you are onlines - is that where you are looking in Settings ?

I had a good WiFi connection and I didn’t have a Settings > General > Keyboard > Dictation option.  I tried rebooting the iPad, no change.  The strange thing was that it working at 2pm and not at 5pm and no changes had been made to the iPad.  We have a pool of iPads that we sign out for testing, this one is the 3rd generation iPad and I have removed all of the apps that other people had installed.  The iPad has iOS 6.1.2 installed.

I saw the Bluetooth icon on the status bar.  It was not lit up, so it wasn’t connected to any devices.  So I went into the Bluetooth settings and saw this:

image

I don’t have ZAGG Keyboard, but someone else must have paired this iPad to one.  In between the demos, I had borrowed another iPad that was in a ZAGG keyboard case.  It must have been in close enough proximity to the one that I was using so that my iPad picked up the other keyboard.  I turned off Bluetooth and the microphone button was back on the iPad keyboard.

That makes no sense.  The iPad was not connected to the ZAGG Keyboard, but it still disabled the microphone button on the onscreen keyboard.  I could not reproduce this with another iPad running iOS5 and a Logitech keyboard.  The microphone button stayed enabled with the keyboard on and off.  One thing comes to mind.  Apple and the keyboard manufactures need to come up with a keyboard button definition for the microphone.  If you are using an external keyboard, it’s annoying to have to bring up the onscreen keyboard to voice dictation.

Sunday, February 10, 2013

Today I learned that my daughter has never seen a 3.5” disk

I was watching my 10 year old daughter work on a story in MS Word 2007. To save the document, she was going into the Word menu to select save. I asked her why she just didn’t click the save button. She said “What save button?”. I pointed out the save button that is just above the Home tab.

Word 2007 Save

She thought that was the print button. She had no idea that the save button glyph represented a 3.5” disk. She’s never seen one. I have some around, but it’s been years since I have actually used one of those guys.

I dug out an old 3.5 disk and gave it to my daughter. She had no idea what is was.  And was not impressed when I explained to her what it was.

blue floppy

The 3.5” disk had a good run, but it’s been 15 years since Apple came out with the first iMac without a floppy drive. It took a few years for the rest of the industry to catch up, but now the 3.5” disk is deader than a dot matrix printer. Which is another piece of computer technology that my daughter has never seen. 

For the last 20+ years, it has been common place to use a disk icon for the save button on toolbars and menus. I don’t think twice about it being obsolete technology, I just “know” that a disk image on a button means save. But for a 10 year old, she doesn’t have that frame of reference to identify the functio.  From her viewpoint, the closest match is a printer, their icons can look a bit like the disk icon.

The problem is that we really don’t have anything now to replace that image. What other object represents saving a file, and can be drawn in a 16x16 matrix? We’ll be carrying around that image for years after the last disk falls part. 

We carry around other baggage like that. It’s like dialing up someone on your cell phone. I can’t remember the last time I used a phone that had a dial on it. But the terminology is so well established, we just associate dialing with the act of placing a call.  It’s time to come up with some new visual metaphors.