Tuesday, November 15, 2016

My Road to FPV (Part Two)

As per usual with anything that grabs my interest it was a very slippery slope for me into the world of multirotor aircraft. Not long after find the Mr. Steele videos it was my son’s half birthday and I decided it was the perfect excuse to get him a quadcopter. After spending a few hours going over a bunch of aircraft on Amazon, I eventually settled on the Syma X5C. Based on the reviews it seemed to be a good starter drone and it had a camera that let you take photos and video. It also didn’t hurt that it was priced at just under $50.

Once the order was placed I started searching online for tips on flying quadcopters and some basic tips for getting started. I found the MyFirstDrone.com website and found the How to Fly a Quadcopter tutorials very helpful. The most important thing I picked up from that page is to start out slowly and eventually expand your comfort zone. Another great resource is oscarliang.com. I may be overly cautious, but I feel like a lot of people take these things out of the box and immediately see how high they can go resulting in them losing control of the quadcopter and it getting stuck in a tree or even just losing it.

After my son opened the Syma X5C we took it out to the backyard for its maiden flight. I will admit I only glanced at the instructions ahead of time because I was excited to fly, everything turned out fine, but in hindsight it is always a good idea to read through the instructions. My first impression was it was much lighter than expected and the quality of the radio transmitter(the controller) was pretty good. The process of getting started was pretty simple, we just took it out of the box, installed the prop guards, put the battery in and bound it to the radio. Our backyard is long and narrow and surrounded by trees, which isn’t ideal for learning to fly, but it is wide enough that it was fine for learning the basics of hovering. I throttled up and practiced going up and down before then attempting to pitching forward and backward. I then brought it down and gave my son a shot at it and he quickly mimicked all the same maneuvers as me.
Kaleb Flying

We moved on to rolling to the left and right, which worked out fine. One nice thing about the Syma X5C is it has switches for controlling the camera right on the radio, so you can take a photo or start/stop recording video. The quality of the camera is about what I expected, although the lens is a little off center so all the videos and photos are slightly askew. Check out Drone over Merrimack (YouTube) for an example of the video quality. Here is an image from the camera taken in the early evening.

  Syma X5c Photo

We took turns until the battery ran outseven minutes later and went back inside to charge it.
At this point I had learned the following things about quadcopters:
  • The radio transmitter has two sticks that are used to control the quadcopter. The sticks are configured differently based on the mode of the transmitter. There are four different modes, but the most common are Mode 1 and Mode 2. See Oscar Liang’s RC Transmitter Modes for details on the modes. After much hemming and hawing I decided on Mode 2, but not for any particular reason.
  • There are many different flight modes available for quadcopters. The flight mode determines how it will behave in the air when it receives commands from the transmitter. The Syma X5C uses Self Level aka Horizon mode, this means that if you let go of the stick that controls the pitch and elevator it will automatically level off to be parallel to the ground. It doesn’t have elevation hold so if you let take your finger off the throttle it may stay in place, but will most likely move around a little bit.
  • The battery is small and doesn’t last a long time, but you can buy 5 or 6 more for the Syma X5C for about $15. Most if not all quads use LiPo (lithium polymer) batteries, which aren’t the same as the rechargeable AA batteries you may be used to. They require special care and shouldn’t just be left to charge if you aren’t around them. I strongly recommend reading Roger’s Hobby Center: A Guide to Understanding LiPo Batteries
At this point the Syma X5C was fine, but I wanted something of my own so I started researching more and found the perfect starter quad for me, the Hubsan X4 107C

Go back and check out My Road to FPV (Part One)
Continue reading My Road to FPV (Part Three)

Sunday, October 30, 2016

My Road to FPV (Part One)

Over the summer my nine year old kept asking us to buy him a “drone”. I didn’t know much about it besides the fact that my dad recently bought something called the DJI Phantom 4. Little did I know a couple months later I would be the one carrying on about drones, watching YouTube videos and making a plan for my new hobby. Here are the details about how I got interested in first person view (FPV) multi rotor aircraft and my initial plan for easing into the hobby.

During our summer vacation my son continued to bring up the drone thing and I realized it wasn’t just a passing interest. I decided to use it as a teaching experience and asked him to do some research about drones so he could pick out the best one for him. Since this gave him an excuse to search the internet he jumped at the opportunity and started making a basic spreadsheet with the different options. In order to properly help I also had to learn about them and began doing my own research. I quickly found there was a huge range of different options ranging from $20 to over $1,200. Most of the options we looked at had cameras, which seemed like a very interesting feature and a must have to keep his interest. Some of the drones had altitude hold, which let you take your hands off the throttle and it would just hover in place. I also found out the smaller less expensive ones had a battery life of around TEN minutes, which seemed really short. Once we finished the spreadsheet he quickly lost interest and all was forgotten for the time being.

A few weeks later I was using the Periscope app on my Apple TV and this guy Mr Steele was broadcasting live from a mall parking lot so I took a look. He never ended up flying but it seemed interesting so I did a quick YouTube search and found his channel. Over the next half an hour I probably watched 10 different videos and was hooked. The channel is a mix of footage shot from a GoPro mounted on his quadcopter, very short vlogs and some instructional videos.
Some of my favorite videos on Mr. Steele’s channel:

At this point I was extremely interested in the world of racing quadcopters and decided it was something I was going to look into doing, not the racing, but the flying of this type of aircraft. However rather than just diving in and spending a ton of money right away, I decided to come up with a plan for this new hobby and how I would work my way up the rungs of the ladder in the correct order. This is the first in a series of blog posts documenting my plan and the execution of that plan.
My Road to FPV (Part Two)

Tuesday, May 24, 2016

Disabled iTunes Playlist Tracks

The Problem
I recently upgraded to iTunes 12.4 on my work laptop (Windows 10) and noticed some weird behavior with some playlists and songs.  As you can see in the screenshot below some of the tracks are grayed out, but I can't figure out what it means.  If I double click on them they play fine, but the grayed out tracks are skipped when transitioning to the next song.  For example, double clicking on Adventure of a Lifetime will play it, but once it ends, the next track that plays is Good for You
I initially thought the difference was because my iCloud Music Library has a combination of purchased, iTunes Match and Apple Music tracks.  However, after looking at the Get Info pop up I found the grayed out tracks were all Apple Music sourced (Off to the Races, Everglow), but there were also Apple Music tracks that weren't grayed out (Hello, Paper Planes). There is also a mix of Loved and Not Loved tracks.  I tried downloading from iCloud for some of the tracks, but that didn't seem to help. 
At quick glance it is only happening to this playlist, but if I go to the Artist view and look up Coldplay or Lana Del Rey the albums with the grayed out tracks are also grayed out.  

The Fix
I did some searching online and was able to fix it by right clicking on the songs and choosing the "Check Selection".  Not sure what this feature is for, but it causes the tracks to not be included in continuous track playing.


Sunday, May 15, 2016

Adopting the iPad Lifestyle

I have been very interested in the ongoing discussion about the iPad-only lifestyle on all my favorite podcasts. It has made me think a lot about how I use my iPad and more importantly how I could be using my iPad for more tasks. A few weeks ago I bought a 9.7" iPad Pro with the intention of taking my iOS game to the next level. It has been an interesting experiment and has required me to rethink my usual workflow at both home and work.

The Dev Diary

The first thing to go was going to be my “Daily Dev Diary”. For the last few years I have been printing out a sheet of paper each day for keeping me on task and for keeping track of little things that happen during the day. Each morning I take my notes from the previous day, update the source document and then create the next day. The document has four sections to cover things I want to do over the long term, things I did yesterday, things I have to do today and random notes.

Migrating this process to include the iPad, was pretty easy once I settled on using Good Notes 4 as the primary note for note taking. I start by editing the master markdown document on my laptop and print the current day out to a PDF using Google Chrome. The PDF resides in OneDrive, which I use for all of my work file needs. I open up Good Notes 4 and import the document using the OneDrive integration. Once in the app I am able to use my Apple Pencil to markup the document as I had before. At the end of the day I export the document back to the OneDrive folder and voila it is ready for the next day. It was weird at first walking around with the iPad, but eventually it became natural and I don’t think I could go back to using the paper.

Secretary’s Day

One of my extracurricular activities involves being the secretary for the local youth baseball league, Merrimac Baseball. Due to my recent success with my dev diary, I thought it would be a piece of cake. I immediately ran into a problem with the first step in the process, duplicating an existing iCloud Drive document. I normally take the previous meeting minutes markdown file and make a copy, but there didn’t seem to be an easy way to do this in iOS. I opened up the iCloud Drive app, but it only provided me with a limited set of options. My markdown editor of choice, Byword recently added support for editing iCloud Drive documents, but I couldn’t figure out how to “Save As” or “Duplicate” the files. In the end I turned to Workflow for iOS and created a custom workflow that would let me select an iCloud Drive file and save it somewhere else. It took a few tries to get it right, but now I have it there to use whenever I need to copy a file. Once I duplicated the file it was all downhill from there, because I just used GoodNotes for my note taking.

After the meeting I had to transcribe my notes back into a markdown file, which I did using the new split screen feature in iOS 9. Byword had some problems displaying the full keyboard in split screen mode so that wasn’t great, but I did eventually figure it out. Finally after exporting the PDF to iCloud Drive I had to upload it to the baseball website. At first I wasn’t sure if it was possible, but once I clicked on the file chooser button on the web page in Safari, I was presented with my iCloud Drive directories and quickly found the PDF and added it to the site.

Learning the Ropes

So far the iPad lifestyle experiment has been successful for me because the device is so portable and I have found my original assumption about it being too much work to do things in iOS was flawed. There are definitely times when I have to put on my thinking cap and figure out the iOS way to do something, but in most cases it involves a simple solution, I will easily be able to apply in the future. I look forward to continuing this trend and expanding the amount of things I can do on this wonderful little device.

Monday, May 9, 2016

Introducing the Kilobyte Microcast


Last night I published the first episode of my new podcast, Kilobyte. It is a microcast where I will be talking about my thoughts on a wide range of my interests like technology, life as a software developer, the parenting and hopefully some funny anecdotes about my life. Initially I want to post 5–10 minute long episodes a couple times a week. Although I am looking forward to seeing how it evolves over time as I learn my voice and start to get better at audio editing.

Here are a few ways to subscribe:

Saturday, May 7, 2016

Heroku Database Problems

I have been using Heroku for over a year now and have learned quite a bit along the way. I have a very simple Java web application for my work softball team, TAP Softball. It uses a Postgres database and contains basic information like the teams, schedule and standings. The database connection is configured using Spring and Hibernate, with the database URL and credentials hard coded right into the Spring context file. Using Eclipse and the Tomcat plugin I can deploy the web application locally to test changes prior to deploying to the server. I also have a local database I use for testing database changes before pushing to the live database. In the Spring context file I have a commented out localhost datasource defined, which I swap in when testing locally.

Yesterday, I received an email from Heroku that my database was going to be upgraded with the latest Postgres changes. A few minutes later an email confirmed the upgrade finished successfully. I had seen these messages before and thought nothing of it until this morning when I tried to use the site and got a big fat stack trace.

It didn’t take long to see the database URL and credentials had changed, which as you probably figured out was problematic since I had them hard coded. I quickly scrambled to fix the issue because I didn’t have access to my MacBook. The Dropbox deployment method didn’t work so I installed the Heroku Toolbelt and was able to update the database connection information. The site was back online, so I took a breather and then emailed support to find out what was going on.

Support promptly responded to my message and explained that if an upgrade doesn’t go perfectly the database will move to a different address and reset the credentials. He also said I should be loading my database connection information from the environment variables, so it will start up correctly should the database move again. I did a little searching and found Connecting to Relational Databases on Heroku with Java. After scrolling down I quickly found that I had to add a new Spring bean that would instantiate a Java URI using the DATABASE_URL environment variable. I also had to update my existing dataSource bean to get the host, port, path, username and password from the URI bean. I pushed the change up to Heroku and it worked.

My next challenge was to get my development environment working again, because now Tomcat was getting a null pointer exception when trying to generate the URI bean. After some trial and error I figured out that I needed to modify the run configuration for the Tomcat server in Eclipse to have a new entry in the Environment tab for the DATABASE_URL. The value to use came from my app’s database page on the Heroku site, in the last item called URL. Making this change and starting the server loaded the homepage, but when I attempted to load a page that used the database I received an error about SSL.

I remembered having problems connecting to the database originally, and to fix it I added ?ssl=true&sslfactory=org.postgresql.ssl.NonValidatingFactory to the end of the path. Unfortunately just sticking that onto the end of my Run Configuration’s environment variable didn’t work. I also had to add + '?' + @dbUrl.getQuery() to the end of the url property in my datasource bean. In the URI the part after the question mark is called the query and by appending it to the end of the path it fixed my issue. I pushed the change up to the server and it still worked fine. The best part is now I can easily create separate run configurations for the remote and local databases rather than randomly updating one of my Spring configuration files.

Tuesday, April 26, 2016

Browser Zoom Factor

In the summer of 2015 I noticed our Flash application looked slightly different in the Chrome browser. Since it was very subtle and I usually develop using IE 11, it didn’t really pique my interest. Around the same time I had also heard some complaints about blurry images on some newer laptops.

Fast forward to February 2016…

While researching a bug related to a Flash Player change, see my post Flash Problems I uncovered a new feature that was slowly added to Flash Player over a few different versions called, Browser Zoom Factor. The feature will scale a Flash application using the browser’s scale setting. It was first introduced in Flash Player 18, but at that time it was always on for supported browsers and there was no way to shut it off. In the fall of 2015 in Flash Player 19 developers were given a parameter for disabling the zoom factor.

It turns out the weirdness I was seeing in Google Chrome was caused by the browser zoom factor. By default my installation was always zooming to 85%, which in turn zoomed the application to 85% making the logo a little less clear and making the view a little bit smaller than in IE 11. Of course my instinct was to turn this off, because I didn’t want somebody to unexpectedly see the application with blurry images, so I added the special parameter to shut browser zoom factor off.

Fast forward three weeks…

Our IT department started rolling out Microsoft SurfaceBook to a few employees for a trial and within a couple days I received a complaint that our application was “unusable” on a high resolution display. I ran over to see the situation, because I had never seen our application on a high resolution display. He was right the application was so small on the SurfaceBook and was extremely hard to use. At that point I realized I had forgotten about using the browser zoom factor in the other direction.

In the end I turned the browser zoom factor feature back on for our application so user can zoom in or out as needed. I know at some point a defect will be filed about the images looking terrible, but at least push it back and have the user not zoom in so much.

Tuesday, April 5, 2016

Windows 10 First Impressions

Yesterday I received a new laptop for work, which replaced my four and a half year old HP EliteBook. The old laptop ran Windows 7, had a 17" screen and could easily have been used as a boat anchor for the SS Minnow. My requests for a MacBook Pro fell on deaf ears and I received a new HP ZBook G3 with the new Intel SkyLake processor. As expected compiling our code base takes about 60% as long as it did before, so that is good. The biggest adjustment has been the switch to Windows 10, but so far it has not been to difficult to get used to it. Once I figured out how to hide the Cortana text box next to the Start button, it really felt like Windows 7, but in dark mode. I have had some trouble resizing and moving windows around, because they really want to get maximized or stuck to the edges. My workflow is slightly adapted because my favorite application launcher, Bayden SlickRun, can no longer be triggered using the Windows+Q key combination because it is now used for Cortana. Once I get past that hurdle it should be clear sailing.

Wednesday, March 30, 2016

Master of My Domain

Over the last few months I have been starting to spend a little more time blogging and have also been thinking about creating a short podcast.  It was easy to host the blog on blogger, but when it comes to serving up the podcast, I want to have a consistent location for the RSS feed.  Initially I will probably just host the podcast on Dropbox, but at some point might have to be moved to my own space, so keeping a consistent URL will make life easier.  The simple answer to this was to buy my own domain like a grown up and luckily I had heard a lot about Hover over the last six months while listening to podcasts.  So after a couple issues getting it set up because I put the state into the zip code field I was able to register keegsands.org.  At this point I have only hooked up this blog and the TAP Softball site, but will hopefully start working on the main page in the next couple weeks.  You can also expect episode 0 of a podcast to be released too.  Stay tuned!!

Saturday, March 26, 2016

Creative Opportunity Cost

On the last episode of Analog, #76 Well, I Drive a BMW , there was continuation of a previous discussion about creating a new fan community for Relay FM using Slack or some other tool for creating communities. Initially, I thought how much fun it would be seeing the various Relay FM hosts communicating with each other and also with fans. After listening to the entire discussion on the podcast and then thinking about it for a few days my opinion changed. A community would provide some new content and might allow me to interact with the hosts of the podcasts I listen to everday, but at what cost to those very podcasts and the hosts who have spread themselves out very thin across many different projects.

You have to look no further than Upgrade co-hosts, Myke Hurley and Jason Snell, to see an example of podcasting work horses with a lot on their plate. Mr. Hurley, co-founder of Relay FM, appears on at least 8 different podcasts and as far as I can tell handles the marketing and personnel for the network. Mr. Snell, founder and writer at Six Colors, runs The Incomparable podcast network and is a host on at least a half dozen podcasts across both networks. On top of all that work they are always replying to tweets, chatting on Slack and oh yeah, then having their regular lives too.

Asking them to also converse in special forums with fans will not only be more stuff on their plates, but it runs the risk of taking time away from projects which push the network and the medium forward. If given the choice I would much prefer Mr. Hurley work on another special series like Behind the App than see him rehash the same topic from a podcast in some chat room somewhere. The hosts only have a limited amount of time and creativity to work with and it shouldn’t be squandered.

My other concern is how the podcasts themselves may suffer if the hosts spend time disussing topics in a community forum. As soon as podcasts start referencing these online discussions during the podcast it is going to alienate any listeners who haven’t been following along online. Right now any tweets or feedback from listeners is always shared during the podcast and everybody is kept in the loop. I would also be concerned about the hosts getting burnt out on a topic from discussing in a community forum off air. Keeping these discussions mostly limited to podcasts helps keep them fresh.

It would be great to hear my favorite podcast hosts chatting away in some community forum, but not if it prevents them from working on new creative projects or improving their existing ventures. I would rather them focus on what they are great at and keep moving the podcast brain ball down the field.

Tuesday, March 1, 2016

A Mouse Free Lifestyle

Peripherals

Mice have always been my peripheral of choice at work, mostly because I generally enjoyed using them and the alternatives never really appealed to me, e.g. track balls, joysticks, etc… My mousing style generally involves me lightly holding my hand over the mouse and using my thumb or ring finger on the outside edges to move it around. At home I use the Magic Trackpad because I do love the gestures, but ergonomically it causes discomfort for any extended sessions. In the area of keyboards I have used a Microsoft natural ergonomic keyboard for as long as I can remember. It is a beast with way more functionality than I will ever use, but it is so very comfortable once you get used to it. I especially appreciate it when I have to use a normal keyboard and my wrists are all bent and twisted, it usually gets painful after just a few minutes.

RSI: Portsmouth

Over the last few months I have started to feel some soreness in my right wrist (the mouse one). Several things have changed over the past year that could be contributing to this. I started doing yoga about a year ago and maybe all the planks and downward dogs are weakening my wrists. My company moved into some new office space with desks that can raise and lower, so I have been doing the standing desk thing for the last seven months. Also since I am an anxious person it is very possible that listening to some of my favorite podcasters talk about Repetitive Strain Injury (RSI) planted the seed in my brain. Regardless I was concerned and wanted to get ahead of it, before it became a problem.

Wacom Tablets

A few months ago I was listening to Cortex episode 11 where Myke and CGP Grey talked a little bit about Wacom tablets and how important they can be in helping you vary your input devices to prevent RSI. At the time I logged the discussion in my brain and kept living the mouse lifestyle. Given my recent soreness I revisited this podcast and started looking into Wacom tablets. I mostly did my research on wacom.com. The first step in choosing was to decide between a pen display and a pen tablet. Since I am just using it as a mouse alternative I don’t need the display and so I focused on the various pen tablets. Wacom seems to have simplified their branding over the last couple years and now use the Intuos brand name for all the pen tablets. The Intuos tablets are then cleanly split between a basic line and the the larger and more feature rich Pro line. I focused on the basic line since this is my first Wacom and I didn’t want to spend too much money. At first glance the basic line was a bit tougher to navigate because they have four different models: Draw, Art, Photo, and Comic. After much searching I learned that the Draw is only a pen tablet, while the other three support both pen and touch input. The only difference between Art, Photo and Comic is the software bundled with each one. Once I figured that out it didn’t really matter which of the three I chose because I wasn’t planning on using it for any of those particular uses. I ended up choosing the Intuos Photo because it seemed like the most likely software I might use.



First Impressions

I received the tablet in the mail a couple days later thanks to Amazon Prime. I followed the simple instructions and had it up and running in just a few minutes. The guys on the podcast strongly recommended using the default pen setting which directly maps a location on the tablet to a specific location on your display, so clicking in the top right corner on the tablet will cause the cursor to jump to the to right corner of the display. Moving to the opposite corner just requires a quick tap on the bottom left corner of the tablet. For the most part my brain was able to quickly adapt to this mapping and I understood why it was the preferred setting. One problem I did have with simple navigation was when attempting to move the cursor to the bottom of the screen, it was awkward because rather than resting your hand on the tablet it has to be on the desk making for a somewhat awkward positioning of the hand.

Besides basic navigation the stylus has a rocker switch/button that is used for right click and scrolling. If you hold the button closest to the nib and drag it is the same as a dragging a finger on a touch screen. To right click you hover the cursor over the thing you want to right click and press to other button. The right click was harder to get used to because just the action of clicking the button would sometimes move the cursor causing an unexpected shortcut menu for something else.

I did struggle with some things that I hadn’t anticipated, which were interesting. I was very disappointed by the touch functionality of the tablet. I found the Wacom tablet isn’t nearly as smooth as the Magic Trackpad so my fingers didn’t slide across it as nicely. I also had some trouble with the multi touch gestures registering incorrectly. For example, whenever I tried to scroll up and down a web page using the two finger drag, the tablet would trigger a zoom action, because my fingers naturally come together as I drag up and down. I tried to shut off the zoom feature, but for some reason it didn’t make a difference.

The other unanticipated problem was the difficulty when transitioning from stylus to keyboard and back. I could easily put the stylus down, well except for when it started rolling toward the edge of my desk. The more difficult task was picking it back up and getting it positioned correctly in my hand. Half the time I would pick it up upside down and if I did manage to grab it nib down then I would spend a few seconds trying to get the rocker switch/button lined up underneath my index finger. Since I am coding I go back and forth between pointing device and keyboard very often, so one can imagine how frustrating this can be over the course of an 8 hour day.

A Week In

It has now been over a week since I started using the tablet and most of my previous observations still are the same, although my accuracy with the right click has improved quite a bit and navigating to the bottom of the screen has become easier. I still struggle with picking it up and wonder if this type of input is ill suited for my type of work or if I need to invest in some sort of stylus holder that ensures the stylus is always pointing in the same direction.

One regret I have is converting over to the tablet completely for the first week without using the mouse at all except for a brief occasion when I was working on a critical issue. Towards the end of the first week I felt my hand cramping up a little bit and think it was because I tried to do too much too soon. Since then I have alternated between the tablet and mouse over the course of the day to give my hand a nice variety. So far so good.

Saturday, February 27, 2016

Flash Player Trusted Files

Trust Me Flash Player

I was attempting to build the new Apache Flex JavaScript project and ran into a problem when attempting to run the unit tests. The tests run on a standalone version of Flash Player and were definitely attempting to run, but I was receiving a Security Error #2017 “Only trusted local files may cause the Flash Player to exit.” I could dismiss the error, but there were lots of tests and each test would pop up the same pop up. I vaguely knew that Flash Player has security limitations when it comes to running swf applications on the local file system, but since I usually run Flex unit tests via the FlexMojos maven plugin I had never seen this before.

Tough Search

I search and searched the internet and eventually found the answer to the problem buried in an Adobe help page . Hopefully my page will be a little easier to find.

The Solution

Just in case the Adobe page disappears I will also post the fix here. Flash Player allows you to configure a set of trusted directories for swf files, once you define them they will open without the Security Error.
  1. First you have to find the Flash Player #Security directory for your OS
    1. Windows Documents and Settings\username\Application Data\MacroMedia\Flash Player#Security
    2. Mac OS X /Users/username/Library/Preferences/Macromedia/Flash Player/#Security/
  2. Create a folder called FlashPlayerTrust inside the #Security folder.
  3. Create a new file in the FlashPlayerTrust directory using a text editor, and save it as myTrustFiles.cfg.
  4. You can use any unique name for your configuration file.
  5. Locate the directory where you test Flash applications.
  6. Type or paste each directory path (any directory path on your hard disk) on a new line in the file. You can paste multiple directory paths on separate lines. When you finish, your file looks similar to the following example: /Users/myuser/Development/source/swfs
  7. Save your changes to myTrustFiles.cfg

Sunday, February 21, 2016

Surface Book First Impression

I was over my brother’s house the other day and he plopped his shiny new Microsoft Surface Book down in front of me, pressed the power button and said, “Check this out.” I was very excited to see the hybrid tablet/laptop thing in person ever since the Apple podcast circuit started talking about the viability of living an iPad Pro only lifestyle. People have started taking sides and it has been interesting to see the many different perspectives on the situation. I am still not sure where I stand on the issue, because I split activities across iOS and Mac OS X. Using the Surface Book will give me a chance to see if I might just be better off with a single device that is both (well sort of) or if Apple’s stance on keeping iOS and Mac OS X separate is better.

Bad Start

Right away I was impressed by the screen on the Surface Book, probably because I have never had the pleasure of using a high resolution display on a PC or Mac for that matter. Windows seemed to be taking a really long time to load, so I asked my brother if this thing had an SSD or not. Eventually the Windows splash screen disappeared only to be followed by a Blue Screen of Death, which really looks nice on the display ;-) I held down the power button as I have often done on my work PC and gave Windows another try. It started right up this time and quickly loaded the login screen.

Keyboard Testing

The keyboard was attached so I immediately opened up a web browser and searched for my favorite typing speed test page. I opened up IE and did a search for typing test and just checked out one of the first results. The keyboard felt fine to me and I was able to type at about the same as normal. Most of the time I type on a Microsoft Ergonomic keyboard so any “regular” keyboard hurts my wrists after about a half an hour of typing.

Tablet Mode

I was most excited to try out the stylus and see how that felt on the Surface Book in tablet mode. Based on other reviews I knew there was some sort of software mechanism for detaching the screen so I asked my brother to show me how to do it. Sure enough down in the system tray is an icon for disconnecting the screen. The latch disengaged and I picked the tablet up, it didn’t seem any heavier than an iPad Pro to me. Once in tablet mode the top seemed to be slightly thinner than the bottom, which instinctually made me flip it over and to the lean forward to trigger the accelerometer to flip the display. Nothing happened. I tilted it forward again, because that is an old iOS trick when changing orientation. I shrugged it off and put it down on the table so it was slanted away from me. (Later on I fumbled throught the settings and found the orientation had been locked)

Full Windows in Tablet Mode

Once in tablet mode I had to find OneNote so I could do some drawing using the stylus. I tapped on the start menu and tapped until I found not one, but two OneNote applications. I tapped the first one and it asked me to log in with a Microsoft account, so I closed the window and opened the other one. In the process of navigating around it hit me that something didn’t feel right. I really didn’t like complex desktop type navigation on a tablet. I think the iPad’s giant sized iPhone home screen layout of apps could be improved (not sure how), but it is just so much more natural than drilling down into the Start Menu to look for an app. Yes I could have used search as I often do on my iPad, but this seemed clunky to me. I guess my brain has just been trained to expect a cleaner interface on a tablet device thanks to iOS. Either way it was an interesting moment for me.

The Stylus

Once I opened the correct OneNote I grabbed the stylus and started drawing. The lag when drawing wasn’t noticeable to me and the palm rejection was great. I drew some pictures and practiced zooming and rotating to see what things looked like. Overall it was a great experience. I handed the stylus over to my 9 year old son and he started drawing. He has used a stylus on my iPad Air for drawing before and was being very careful not to touch his palm to the screen. I told him how with this display he could put his hand down and it wouldn’t cause problems, which made him happy. He spent a few minutes drawing and intuitively changed colors, zoomed, panned and erased.

Final Thoughts

Despite the technical difficulties on start up, the SurfaceBook worked pretty well. The computer itself has a nice modern design and the keyboard was fine for me. Using the stylus was great and put to shame the stylus I currently use with my iPad Air. The process of detaching and attaching the tablet to the keyboard was kind of weird, but I guess since the GPU lives in the main body you probably don’t want to just pull it apart. My biggest take away from the whole experience was my dislike for the desktop interface when in tablet mode. It just didn’t feel right and seemed like way too much overhead for when you are just doing something as simple as tapping on the screen with your finger. The iPad home screen needs work, but in its current state beats using the Start menu every time. Of course I only used the tablet for about 15 minutes, so I am sure there are things that become natural over time, but I do use Windows almost 8 hours every day so its not totally foreign to me. I will consider to ponder the viability of the iPad lifestyle, but for now the only thing I know for sure is that keeping iOS and Mac OS X separate seems like a good long term bet, if only so the simple iOS interface doesn't become polluted with the sins of our desktop past.

Friday, February 19, 2016

Downgrade Flash Player in Google Chrome

Time to Downgrade

In a post earlier this week, Flash Problems, I talked about an issue I ran into with a recent Flash Player update that caused problems in the application I work on. After tracking down the problematic code I was able to fix it to get around the problem so going forward things should be fine. However, since it is an enterprise application that is installed and maintained by the user I can’t just push a patch out to a web server and move on to the next fire. The bug will only affect users with the latest version of Flash Player, 20.0.0.306, in the past that may not be a big deal because most users wouldn’t install every update that was released, but since Flash has had so many security vulnerabilities it is more likely people will have the latest version.

Google Chrome and Flash Player

In the case of Google Chrome though the user being up to date is almost a certainty, because not only does it ship with its own Flash Player, but there is no way via settings to disable Flash Player updates or switch to a different Flash Player version. Don’t get me wrong I think this is great, users should have the most up to date version with all the latest security vulnerabilities patched. If Flash Player didn’t have so many problems it probably wouldn’t have found itself so tightly constrained. Over the last couple years Chrome has slowly removed support for NPAPI plugins in favor of PPAPI, because the latter sandboxes the plugin and makes it more secure. It had been possible to install an NPAPI Flash Player from Adobe onto a system and then disable the built in Chrome Flash Player for purposes of testing or downgrading, you could even enable and disable the different versions of Flash Player from the plugins settings page. However, with the removal of NPAPI support this is no longer an option, which I found out yesterday. The Adobe instructions for installing an alternate version of Flash Player are outdated and still reference the old way. One thing that has changed over the last year is that Adobe now ships a PPAPI version of Flash Player for Chromium browsers, this was the key to solving my problem. I knew that the developers of Chrome may not want other developers to install an NPAPI Flash Player, but they would definitely allow the installation of an older version of a PPAPI Flash Player. They know we gotta debug issues in old versions of Flash Player somehow. Here are those instructions

Downgrade Steps

Download Installer

First you will need to download the installer for the old version of Flash Player you want to use.
  1. All previous version of Flash Player can be found at Flash Player Old Versions Download site
  2. You can find the zip files for the versions in the Flash Player Archives section
  3. Download the version you want to your desktop

Uninstall Flash Player

In order to downgrade Flash Player you must first uninstall any newer versions.
  1. Close any web browsers open on your system
  2. Extract the contents of the zip file.
  3. In the extracted folder, navigate to the folder that doesn’t have “debug” in the name it will contain all the installers and the uninstaller.
  4. Double-click the uninstaller that ends with win.exe. You will be prompte to uninstall the current version of Flash Player for all browsers.
  5. Click Start in the pop up
  6. When it is complete click Done to dismiss the pop up

Install Flash Player for Google Chrome

After Flash Player has been uninstalled, you will need to install the Pepper (PPAPI) Flash Player.
  1. Navigate to the folder where you ran the uninstaller
  2. Run the Pepper installer which is the one that ends with WinPep.exe to install Flash Player for Google Chrome. Flash Player will be installed at the operating system level and will be separate from the version installed with Google Chrome.
  3. Accept the license agreement
  4. Click Install to start the installation
  5. After the installation is done select the Never Check for Updates options and click Done to close the installer

Disable the Chrome Flash Player

Now that you have installed the PPAPI Flash Player into Windows you have to disable the Flash Player that is included in Google Chrome. This is done via a command line argument when launching Google Chrome
  1. Right click on the icon used to launch Google Chrome
  2. Select the Properties option to view the properties for the Shortcut
  3. Go to the Shortcut tab in the properties view
  4. In the Target field add –disable-bundled-ppapi-flash after the closing double quote that wraps the path to chrome.exe. The new value for the target field should be something like this “C:\Program Files (x86)\Google\Chrome\Application\chrome.exe” -disable-bundled-ppapi-flash
  5. Click OK to save the changes

Verify Installed version

Repeat the initial instructions to verify that the version of Flash Player is now correct in your browser
  1. Open up Google Chrome using the shortcut
  2. Go to chrome://plugins
  3. Expand the Details link at the top right corner to see the details of all the plugins
  4. Look at the Flash Player version it should now have a location that points to the Windows Flash Player rather than a Flash Player inside the Google Chrome installation directory.

Monday, February 15, 2016

Flash Problems

Works for Me

Last week I received an email from a QA resource who was getting an error in the Flash Player debugger when performing a very basic action in our Flash application. I quickly looked at the stack trace he provided and tried to reproduce the issue without much luck. I didn’t think anything of it since sometimes QA environments have been known to be suspect.

Fast forward a week and I was pulled into an urgent customer issue, where they were seeing the application become unresponsive when performing some very basic tasks. I logged into the system, where the error was occurring, using IE 11 which has a debugger version of Flash Player and everything worked fine. I then tried it out with Chrome and was easily able to reproduce the issue, same thing with Firefox. I then tried the same thing on a local developer build and got the same results, at first glance there seemed to be a problem with the debugger version of Flash Player. It seemed odd, but they are slightly different versions of Flash Player and it wouldn’t be unheard of.

I spent the next several hours trying pinpoint the issue using Flash Builder and Google Chrome. I was able to comment out some code to make the issue go away, but it wasn’t immediately obvious where things were going wrong. I then remembered that my debugger version of Flash Player was several versions older than the auto updated version in Chrome, version 17 vs version 20. I upgraded the Flash version in IE up to the last release from February 9th, not coincidentally this was the day before the customer saw the issue. To my surprise I was able to reproduce the error and since I was using the debugger version of Flash was shown a stack trace which led me directly to the problem.

The Error

ArgumentError: Error #1508: The value specified for argument RectangleObject is invalid.
                at flash.display::DisplayObject/set scrollRect()
                at spark.components.supportClasses::GroupBase/set scrollRect()
                at spark.components::Group/set scrollRect()
                at spark.layouts.supportClasses::LayoutBase/updateScrollRect()
                at spark.layouts.supportClasses::LayoutBase/scrollPositionChanged()
                at spark.layouts.supportClasses::LayoutBase/set horizontalScrollPosition()
                at spark.layouts.supportClasses::LayoutBase/set horizontalScrollPosition()
                at spark.components.supportClasses::GroupBase/set horizontalScrollPosition()
                at spark.components.supportClasses::GroupBase/set horizontalScrollPosition()

The error was occurring when we were setting the horizontalScrollPosition on a scroller to a very large number (int.MAX_VALUE to be exact). Now I know using this value is not a good idea and should be a red flag, but Flash Player had been okay with it up until the latest version. I installed the version from late January and didn’t have a problem, so it was tied directly to version 20.0.0.306. I looked at the release notes from Adobe, but nothing jumped out at me. It looks like for some reason they added some new validation for the Rectangle object that is passed into DisplayObject.scrollRect() to now throw an error. Of course since Flash Player is closed software I will never know what the limits are for the horizontal scroll position.

The Fix

Since I knew what was going on I was quickly able to commit a fix, which now sets the scroll position to the width of the viewport rather than the maximum integer value. However, the code fix wasn’t going to help the version of the software that had already been released. Since Flash has had so many security problems most browsers now will automatically update, which is why this happened in the first place. The workaround is to uninstall the current version and downgrade to the previous version and shut off automatic updates. In the case of Chrome it is not possible to shut off automatic updates for the Flash Player included with the browser, instead you have to install a separate install of Flash Player, disable the default and enable the new install.

Thursday, February 4, 2016

Functional Decomposition for Kids

My 8 year old is starting to learn coding and was working on a program that would use the graphics turtle to draw a happy face.  It was pretty simple and had a square face, square eyes and a square nose.  I showed him how to copy and paste the code for the first eye to simplify drawing the second eye.  Later he told me how he had to copy the code and paste again to draw the nose.  I recognized an opportunity to teach him about creating functions so I walked him through creating a function to draw a square with a parameter for the length of each side.  We replaced the existing 8 or 9 lines of code with the single call to the function and successfully tested the new function.  

He then turned to me and said, "If I press undo lots of times can I get back to the code without the function?"

I replied, "Yes you can do that, but why would you want to do that?"

He responded, "Because it looks like I did more work this way."

Saturday, January 16, 2016

Apple Product Naming Over the Last 10 Years

Over the last ten years Apple has released four new product categories: iPhone, iPad, Apple Watch and Apple TV. In each of these categories they have had various naming conventions for the products. The name of the initial offering for each category was usually straightforward, well with the exception of the Apple Watch and its various editions. As the products started to branch out the names got slightly more inconsistent.

iPhone

The original iPhone was followed by the iPhone 3G, because of support for 3G cellular networks, which interestingly also has caused some people to refer to the original iPhone as the iPhone 2G. After that was the iPhone 3GS, followed by the fourth release, the iPhone 4. It was the third form factor, but fourth phone model. Since then the pattern of incrementing the number for each new form factor and adding an S for the intermediate years. In 2013, the newest phone was named iPhone 5S, but another new C designation was added for the new colorful iPhone 5C, which had all of the internals of the iPhone 5, but had a polycarbonate case. It isn't clear why the new phone was released, perhaps to differentiate it more from the S model or maybe to try and add more demand for the year old model by making it seem "new". In 2014, a new form factor was introduced with the expected increment in the number, however a new larger screen became available adding the new + identifier, for the iPhone 6+. Most recently in 2015 the introduction of the iPhone 6S and iPhone 6S+ continued the tradition of using the S identifier for the second year of the same form factor. However, unlike last time a new C model was not introduced along side the S model and instead the iPhone 6 remained available.
GenerationMarketing NameAlt. Names
1iPhoneiPhone 2G
2iPhone 3G
3iPhone 3G S
4iPhone 4
5iPhone 4 S
6iPhone 5
7iPhone 5 S
8iPhone 6
9iPhone 6 S

iPad

The original iPad was followed by the iPad 2 in March 2011. So far so good, right? The following year a new iPad was announced with the same form factor, but a new retina display. Apple referred to this model as "new iPad", however most people refer to it as the iPad 3 or 3rd generation using the old iPod naming convention. A short seven months later Apple announced the next iteration of the iPad, which was marketed as "iPad with Retina Display". The form factor remained the same as its predecessor, this version was also referred to as iPad 4 or 4th generation. At the same event Apple also announced a new smaller iPad called the iPad Mini, similar to the branding used on the first smaller iPod Mini. In 2013, a new thinner form factor with a smaller bezel was introduced with a new name, the iPad Air. The Air name had been used for the ultra portable line of MacBooks first introduced in 2008, which were much smaller than the existing MacBook and MacBook Pro models. The overall size of the device was noticeably smaller compared to the previous models, which may be the reason for the new naming convention. At the same event in 2013 the new "iPad Mini with Retina Display" was announced as the successor to the iPad Mini. The following year the iPad Air 2 and iPad Mini 3 were announced, while the form factors were the same as the previous generation the internals were upgraded. At this time the previous generation iPad Mini with Retina Display"" was given a new designation of iPad Mini 2. In September 2014, Apple announced the highly anticipated iPad Pro with a new 12" screen. At this point Apple seems to have settled on using Mini, Air and Pro as the names for the different screen sizes, they then just stick a number on the end based on which generation of the current name.
GenerationMarketing NameAlt. Names
1iPad
2iPad 2
3new iPadiPad 3, 3rd Generation
4iPad with Retina DisplayiPad 4, 4th Generation
5iPad Air
6iPad Air 2

MacBook

I could go over the many various names for Apple laptops over the years, PowerBooks, iBooks and MacBooks, but this will focus on the MacBook. The first MacBook was the MacBook Pro announced in January of 2006. The polycarbonate MacBook was announced the following May. These two were updated once or twice a year until January 2008 when the new thinner MacBook Air was announced. 

Going forward the three different lines have been maintained with the MacBook Air being the smallest model, the MacBook Pro being larget more performing model and the MacBook being the same size as the MacBook Pro, but cheaper and less powerful. In 2012, things changed a little with the introduction of the Retina Display on the MacBook Pro, as these were rolled out there was a choice between the MacBook Pro and the MacBook Pro with Retina Display. At some point the MacBook disappeared and the MacBook Pro 13" was added. Most recently in 2015, the new MacBook with Retina Display, was released, which is actually smaller than the MacBook Air. Unlike iPhones and iPads the various MacBooks of the same line are differentiated using the date they were initially released.

The Apple Devices

The other devices I will mention are the Apple TV and Apple Watch. Both of these start with Apple, well technically there name starts with the Apple logo. The Apple TV was originally introduced as iTV, but was changed before it shipped. It has had a few different iterations, but generally it is just referred to using an understood "generation" nomenclature. The Apple Watch is still on the first generation, so whether it gets the numbered system like the iPhone and iPad or if it just gets the generally accepted "generation" nomenclature hasn't been determined yet.

In Conclusion

It is often confusing and not logical the way these various products have been named, but I think it is bound to happen in an industry where it is difficult to foresee how a product category may change. It is also hard to judge some of these names without knowing what products are to come. I think some of the naming has to do with the target consumer and market. The phones are much more mainstream and they need a clear naming convention so the average consumer can figure out the difference between the various models.

As for the use of Apple in the front of Apple Watch, I think this is the new direction and if they could go back in time I think the iPhone would have been named Apple Phone. The i naming thing seems so dated and has also opened up a pandora's box for third party companies naming their stuff with the i prefix. Using the Apple prefix also prevents any trademark issues like they experienced with the iPhone.

Finally, I am really interested to see when they decide to drop the numbering scheme from the iPhone and iPad names. It will sound completely ridiculous when they release the iPhone 11 or iPad Mini 14. I wonder if by then the products will be so mature that it will be released in a similar to manner as the MacBook, with random releases every year having only minor performance improvements with major form factor changes every 4-5 years.

UPDATE: After more consideration I wonder if the numbering scheme is also a result of how the specs of the mobile devices are somewhat obfuscated from consumers.  If you try to buy a MacBook Pro they don't break them down into different numbers even when there are a couple generations available, instead we can rely on the old processor speed, storage, memory and display quality properties to pick the device that is right for you. Perhaps it is just another side effect of the simplification of computing devices, if the operating system is going to be easier to use than it only makes sense that buying one should be less confusing too.

Friday, January 8, 2016

Bad Default Program for CMD and Bat Files

This week I received a .cmd file from my boss and when I downloaded it to my Windows 7 laptop and tried to double click on it in Windows Explorer, it just opened up in a text editor.  I am assuming at some point I must have changed the default program for .cmd files to be the text editor, probably because we typically just use .bat files for that type of action.  It turns out if you change the file association for one of the standard "executable" types of files it is a little tricky to get it correct.  I initially tried updating the file association in the Default Programs control panel, which didn't work.  I then attempted to manually edit the registry to remove the file association as recommended by some sites, which also didn't work.  I continued researching the issue and the general consensus was that you had to make several registry edits to get things straightened out, but I am not a huge fan of just randomly running registry edits from random sites on the internet.  Eventually I found this page on the Microsoft forums, Can't execute bat or cmd files opens Notepad. It mentioned bat_fix_w7.reg, but it wasn't available on the page, so after a little more searching I found winhelponline's File Association Fixes for Window 7, from here I was able to download a registry editor files that would correct my issue.  I quickly read through the file in a text editor and it appeared to be mostly updating the HKEY_CLASSES_ROOT\.cmd and  HKEY_CLASSES_ROOT\cmdfile to put in new values for cmd files.  It also removed any existing file association for the .cmd extension.  With some hesitation I ran the command and I was able to successfully run my .cmd files from Windows Explorer again.