Monday, December 11, 2017

iPad Pro Productivity Apps

Since buying an iPad Pro way back in 2015 I have come to rely on a few different apps for my day to day use at work and for my creative endeavors at home.
My Current Home Screen

Note Taking

I played around with a few note taking apps in the beginning, but settled on Good Notes 4 for a few different reasons.  First and foremost it has great Apple Pencil support and includes a neat feature that lets you lasso text and move it around, which is helpful if your writing style is a little messy and sparse.  My favorite feature is that you can import PDF files from a number of file providers like OneDrive, Google Drive, DropBox or in iOS 11 the Files app.  Once imported you can mark the documents up and then export them back to any provider you want.  The app has the concept of categories to keep you organized and has the concept of notebooks with all different types of paper to choose from.

Automation

iOS apps have always been sandboxed since day one and this limits the interactions you can do between apps.  In iOS 8 the concept of app extensions was introduced which let developers create extensions allowing one app to open content in a different app.  The Workflows app, which Apple bought within the last year, lets you do lots of different tasks across multiple apps.  You create a workflow and then using a building block interface construct a workflow that can get a distance from the Maps app and plug it into a prebuild text message for sending.  You can add data to the health kit app or do more complex things using web services.

FTP and SSH

Managing my web server from the iPad is done easily using Coda.  The app includes the ability to configure multiple FTP servers, with great text editing tools and an SSH client when you need to update something remotely.  The text editor supports lots of different syntax formats, which is useful when editing on your mobile device.

File Providers

I have my files spread across multiple file providers like DropBox, Google Drive, OneDrive and iCloud Drive. Once you install any of these apps the built in Files app will gain access to the files and you can quickly access them from any apps that properly integrate with Files.  

Miscellaneous Apps

Here are some other apps I use on a regular basis:
  • Ferrite - Podcast recording studio
  • Overcast - Podcast listening app
  • Microsoft Remote Desktop - Sometimes you need to access your Windows machine
  • Byword - Markdown editor
  • PCalc - A calculator because the iPad doesn't come with one, plus this developer has lots of easter eggs in it.
  • iMovie - Movie editor because my Macs are too old to edit 4K
  • Tweetbot 4 - My favorite Twitter client
  • Inbox by Gmail - Keeping the dream of inbox zero alive.

Monday, October 16, 2017

iCloud Photo Library Optimize Storage Issues

I was trying to use the Apple Clips app the other day to make a quick movie from some short ~10 second videos I had shot on my iPhone 6s an hour earlier.  I went to the Library tab, tapped on one of the videos and it popped up the "Downloading from iCloud..." progress bar.  It seemed odd that it had to go to the cloud to for such a recent video.  I was really curious so I went to the Photos app, went to a different video and tapped on the edit button to see if the video was stored locally, but it wasn't as I saw the little progress circle showing it downloading.

My iPhone has the "Optimize Storage" setting turned on for iCloud Photo Library and I have over 22GB of space available.  Is this a bug in iOS 11 or has something changed in how the "Optimize Storage" behavior?

Tuesday, October 10, 2017

World Mental Health Day: My Anxiety Story

Today is World Mental Health Day so I wanted to share my story about anxiety:

Four years ago, I went out to lunch like normal, but I started to feel nauseous and was unable to finish my meal.  Later in the day when I was in the office I felt dizzy and short of breath.  It was very strange since I had never felt this way before.  After this happening for a few more days I decided to go and see my doctor.  I was sent for a few blood tests and then wore a heart monitor for a day, but nothing turned up.  In my follow up appointment my doctor diagnosed me with anxiety and referred me to a therapist that specialized in the treatment of anxiety.

Prior to this I never thought of myself as somebody that would need to see a therapist, because I thought just being smart and strong would get me through any problem.  It was also surprising that somebody like me that is so outgoing and friendly would have anxiety.  However, at that moment in time I just wanted to get better and didn't think twice about it.  I contacted the therapist and after a brief phone screening had my first appointment.  The first few weekly appointments went as expected with lots of talk about my history, family and my current life.  It wasn't long though before the homework began and we started to tackle some of my anxiety issues.

My therapist follows the Cognitive and Behavioral Therapy (wikipedia.org) approach for treating anxiety and doesn't prescribe medication.  So my first job was to figure out situations that made me anxious, like going out to lunch or visiting a crowded place.  We would then list out those things and then I would have to go experience them and afterwards document how I felt while doing them.  I think my analytical mind really enjoyed this type of feedback loop and trying to correlate map activities to their outcome.  All of the documenting was done using Google docs so I can go back today and see all of the different tasks I had to complete and all of the improvements and sometimes setbacks I faced.

After about a month I started to make progress with eating out at lunch and started to feel much better in general.  However, it turns out this was just the tip of the iceberg for my anxiety, because once we started to talk it became clear that anxiety had affected me in many other ways throughout my life.  I started to recall panic attacks I had at different large public events, small fears I had about checking into hotels, migraines from the anxiety associated with air travel (thanks TSA), meeting new people and many others I won't bore you with today.

Slowly over the last four years I tackled one problem after another and started to recognize my anxieties and then how to best deal with the situations causing it.  It hasn't been easy and I have definitely gone into more than one exposure that pushed me to my limit, but today I am so much stronger and happier because of my treatment.  I feel there is such a stigma associated with going to therapy, but it has actually made me open about the fact that I do go and how much it has helped me.  It has really changed my life and if you have ever considered seeking help, but were worried about what people might think, just do it!

Special thanks to my therapist, my family and of course my amazing wife for supporting me through all of this.

Tuesday, September 19, 2017

iOS 11 for iPhone

Today is the annual update all your iOS devices day, thanks to the release of iOS 11, watchOS 4 and tvOS 11.  I have been running the public beta of iOS 11 on my iPad for over a month and on my iPhone for about 2 weeks.  Here is a quick review of the biggest changes in iOS 11 for iPhone, because the scale of the changes on the iPad is too big for anything quick.

Control Center

The most dramatic change for the iPhone is the new Control Center.  You may not know its name, but  if you have an iPhone it is likely that you swiped up from the bottom of the screen to reveal a set of controls for turning on airplane mode, or most likely to use the flashlight.  It is the same area where you may have seen music controls when you were trying to find the flashlight and only after trial and error realized you could swipe right to find the page with the flashlight.

In iOS 11 the multi page Control Center is being replaced with a single page that is now much larger and contains lots of buttons of different shapes and sizes.  
It takes a while getting used to all the new controls and what they do, but after a week or so it becomes second nature.  Simply tapping on the controls will perform the expected action, but if you long press or 3D Touch on some of they will reveal a more detailed control.  For example, long pressing on the flashlight will give you three options for brightness.  

Messages

Not a lot has changed in the Messages app, but since it is used by a lot of people I wanted to point them out.  In iOS 10, the introduction of apps in Messages was a tent pole feature and they invaded the Messages app.  One downside to this was you had to do an extra tap to attach or take a pictures.  I know it doesn't seem like much, but it really annoyed me.  In iOS 11 apps in Messages are featured differently and as a result the camera is now only a single tap away.
Now instead of using an arrow button to reveal the camera, the text input field is a little smaller and the icons for the camera and app store are always displayed.  A new row of apps is always displayed to help encourage their use, but in a nice and subtle way.  My only gripe about this new interface is once you type a certain number of characters the input field grows and it always "startles" me as the display changes.

Live Photos

One of my favorite features on my iPhone 6S is Live Photos.  I almost always forget to record video of different events and it is so nice to be able to see a brief snippet of video that I "accidentally" captures.  I generally leave Live Photos turned on, because why not.  In iOS 11, Live Photos is getting a couple upgrades.  My favorite is the new Live Photo Effects: Loop, Bounce or Long Exposure.  I know these already exist in apps like Instagram and Snapchat, but it is nice to be able to apply these effects after they are taken.  
To access the Effects just slide the Live Photo up to reveal a live running example of what it will look like.  There is a slight delay as the effects are applied so be patient, but once they have loaded you can tap on the effect you like and the photo will be updated.  The first option is Loop, which tries to create a looping video that repeats over and over again.  The second option is Bounce, which will play the video forward for a certain amount of time and then reverse it for the same amount of time.  The last one is Long Exposure, which will basically overlay all the different frames together as if you left the shutter on your camera open for a long exposure photo, this works best for things like waterfalls or night shots.

Other Random Changes

Above are the changes I found to be most notable on the iPhone, but here are some more quick things you may notice.
  • Taking a screenshot will now show a thumbnail in the bottom right corner of your screen for a few seconds.  You can tap on it to mark up the thumbnail and choose to share it, save to Photos or delete it.
  • Screen recording is a control that is available in the new Control Center.  It is not in Control Center by default, but you can add it in Settings.  Once it is on you can record what you are doing on the screen and it will be saved to Photos.
  • Swiping down from the top will show the lock screen.
  • iCloud Family Sharing of data!!!  Now you can share your iCloud storage data with your entire family, so just spend $2 a month for 200GB and everybody will have plenty of space.
  • The App Store is completely redesigned.
UPDATE: Forgot to include Do Not Disturb While Driving, which will automatically turn on whenever your iPhone detects you are driving.  Any messages you receive will auto reply with a message that you are driving and the ability for the sender to resend with the word URGENT to bypass it.

Friday, September 15, 2017

Installing Apache HTTP Server on Windows and Proxying to Tomcat

I have been working on Tomcat web applications and have always just accessed the pages directly on the port that Tomcat is serving.  Now I want to put an Apache HTTP server in front of Tomcat so I can access this page next to other pages that aren't served by Tomcat.  Here are the instructions.

Since the Apache site doesn't provide Windows binaries of the Apache HTTP server they must be downloaded from a third party site, I used Apache Haus HTTP Server Windows Binary Download page. After downloading the zip file I unzipped it and put it into a directory on my system.  The first thing you need to do is open up the conf/httpd.conf file to modify the configuration of the server.  The only required change is to update the SRVROOT definition, which basically is the pointer to where the unzipped folder is defined.  Make sure to use forward slashes instead of backslashes in the path.  Save the conf file and then run bin/httpd.exe.  If it started up correctly you can go to localhost:80 in your browser and an example page should load.

By default the server will look in the htdocs folder of the Apache Server installation for the pages in the site, but if you want to store them in a separate location for easy upgrade of the server then you can update the DocumentRoot and also the Directory elements of the httpd.conf file to point to any other folder on your system.

As for pointing to Tomcat you will need to do the following:
1. In the httpd.conf file make sure to include the load the proxy_module and the proxy_http_module.  They should be included in the file, but may be commented out.  Just uncomment them and they will load.
2. Next in the httpd.conf file add you need to add a ProxyPass and ProxyPassReverse, which will map specific web applications to the URL of the Tomcat applications. These will look like: ProxyPass /theApp http://localhost:8080/theApp
ProxyPassReverse /theApp http://localhost:8080/theApp
3. Update the Tomcat server.xml file so the connector element includes a proxyPort attribute specifying that requests from port 80 are proxied.

Start both servers up and you should be able to access your Tomcat web applications on port 80 now.

Wednesday, August 23, 2017

Getting Video into iMovie on the iPad without iCloud

A few months ago I wrote a post, My Kingdom for a Local iPad Data Store, talking about how I wanted to be able to use iMovie on the iPad to edit my drone videos. The problem was that in order to get the videos into iMovie they had to be in iCloud Photo Library or in iCloud Drive, but I didn’t want them to be uploaded and then maybe downloaded from the cloud because they are large files. Over the weekend I had an epiphany and figured out how to work around this by doing some offline file shuffling.
  1. Turn on Airplane mode to prevent any internet connection from occurring.
  2. Connect a Lightning to USB adapter with an attached SD card reader to the iPad. 
  3. Insert and SD card into the card reader or in my case a Micro SD card. 
  4. The Photos app will launch and prompt you to do an import. 
  5. Import any of the videos you want and then choose to keep or delete them on the card. 
  6. Unplug the Lightning to USB adapter. 
  7. In the Photos app go to the “Last Import” album. 
  8. Tap the Select button to enable selection mode and select all of the videos. 
  9. Tap on the “Share” button (the box with the arrow coming out of it). 
  10. In iOS 11 tap on the “Save to Files” action and in iOS 10 select the “Upload to iCloud Drive” action. This will copy the file to iCloud Drive. 
  11. In the Photos app tap the Select button again and select all the videos and this time delete them. 
  12. Go to the “Recently Deleted” album and delete all the videos from Photos (just in case these would get uploaded to iCloud Photo Library).
  13. Now open up iMovie. 
  14. Create a new movie and import all of your videos from iCloud Drive. 
  15. Click Done to go to the Summary screen just to make sure everything is “Saved”.
  16. If you are using iOS 11 open up the Files app and if you are using iOS 10 open up iCloud Drive. 
  17. Delete all of the videos from iCloud Drive. 
  18. Go to the Recently Deleted view and also delete them from there. 
  19. Finally open the Settings app. 
  20. Go into the settings for the current user, which should be the top option. 
  21. In the user menu select iCloud. 
  22. In the iCloud menu you can choose which apps will save their data to iCloud. 
  23. Turn this off for the iMovie app. 
  24. Now turn off Airplane mode and you are ready to work on your movie. 
The iCloud Drive/Files storage part seems a bit excessive, but was necessary because any videos imported to iMovie from the iCloud Photo Library stop working if you delete them.  Importing from iCloud Drive/Files on the other hand puts a copy in the iMovie app's local storage.

Wednesday, August 16, 2017

Remembering My Dad

Last week we had a private funeral service for my father and here is the eulogy I read:

Bill, my dad, was many things to many people.  He was a storyteller, lots of fun to be around, hard working, resilient, happy, kind and the list goes on and on.

One thing we all were familiar with was his ability to tell a story.  Some of the stories were adventurous like the time he was riding a bicycle built for two through the center of town and got pulled over by the police or the time he fired a cannon off in front of the police station and freaked all the officers out inside.  

Another type of story he loved to tell was the accomplishment type story like driving up and down Mt. Washington multiple times, or driving to Keegan, ME just to see what was there or racing a car with his drone and winning or how he had the fastest stock motorcycle in the world and he got it up to some ridiculously unsafe speed or having driven to every state in the continental US.  

The other type of story we seemed to hear more than any other involved the injustices he suffered, like being nailed to the roof by his brothers or how my mom had a new car every year they were married.  He had a lot less of those type of stories in recent years, because he was happy.  On the rare occasion he did have a new one it always made me laugh when Anne would call him out and set the story straight.  

Every once in a while you could get a life lesson from a story, well besides don’t drive 165 MPH on a motorcycle, one that changed me for the better was from a trip we took to Washington DC when I was a kid.  We were in line at this fancy hotel and the woman in front of us was complaining about something to the receptionist and my dad patiently waited his turn in line.  We finally got to the front of the line and my dad made a funny comment about the complainer to the receptionist.  She thanked him for his patience and upgraded us to an amazing room overlooking the city.  Sometimes being patient and funny pays off.  


The stories were almost always exaggerated in some way, but that is what made him a great story teller.  I am thankful to have picked up this skill from him and look forward to passing on these stories and many more.

Thursday, August 10, 2017

My Dad Passed Away

My dad passed away a couple weeks ago and the site with the obituary is crawling with ads so I wanted to also post it here.
William D. Sands, 67, of Kingston, NH and Viera, FL, and longtime resident of Amesbury, passed away in his home on Thursday as a result of cardiac issues.

Born in Amesbury on May 31, 1950, he was the son of Francis Sands and Simone Sands. He remained in Amesbury most of his life, and had various jobs that made use of his mechanical and technical skills and abilities, until his retirement from his career as a medical device technician. After retirement he moved his primary residence to Viera, Fl, where he enjoyed the sunny days, flying his drone, and the resident alligators.

Bill was known for his sense of humor, and could always be counted on for a story and a laugh. His love of travel brought him all over the United States. He loved to drive, and was always exploring, whether on a motorcycle, in an RV, or in his much-beloved Smart Car. Bill was an enthusiastic grandpa, and was known for his “Pepe hugs”.  He will be deeply missed by his family and friends.

He is survived by his loving wife, Anne Sands, his brothers David Sands and wife Sally, and Leonard Sands, and his children, Keegan Sands and wife Jennifer, Brendan Sands and wife Ilona, Mike Gonthier  and wife Ally, and Kelley Fitzpatrick and husband Kevin. He is also survived by his grandchildren, Kaleb, Camden, Connor and Jacob Sands, as well as nieces and nephews.

Tuesday, June 13, 2017

Wednesday, May 31, 2017

Flash Player Issue with Edge Browser in Windows 10 Anniversary Update

I recently spent a couple days debugging an issue with our Flash application in Microsoft's Edge browser.  Several developers were updated to the Anniversary update for Windows 10 and if you tried to load the page with our Flash application it wouldn't display and right clicking would show the "Movie not loaded" message.  Everything worked fined in Chrome, IE and Firefox.  I verified that Flash applications on the internet worked to eliminate that part of the problem.

Things go weird when I tried accessing the application from a different machine and it worked fine.  Further testing showed that the application would load fine on port 80, but not port 8080.  I was really narrowing it down and finally found that in the Anniversary update a new setting was added to the about:flags page called "Allow Adobe Flash Player localhost loopback".  After turning this on and restarting the browser the application loaded fine.  




Monday, May 29, 2017

Wednesday, May 24, 2017

Video: Dover Trees

Visited friends this weekend and flew around their yard which had a ton of trees.  It was good practice.

Sunday, May 14, 2017

Video: Woodsom Flying

I went out to find a new flying spot before the rain started and ran into some other FPV drone pilots.  Here is some video from my afternoon flights.

Monday, May 1, 2017

Video: Emery Freestylin'



I have been practicing flips and rolls in my neighborhood, but it can be a little cramped so I went out to a local park where I have more room to spread my wings.

Sunday, April 16, 2017

Video: Merrimack Sunrise

Beautiful flying at the mouth of the Merrimack river in Salisbury.

Video: Newbury Marsh Sunset

I found a new flying spot, which was made better by some amazing weather and light conditions.

Thursday, April 6, 2017

Video: Last Flight of the Shuriken 180

I have been flying the Holybro Shuriken 180 for the last few months and it has been a great little quadcopter.  Unfortunately I decided to fly in winter and crashed into the snow.  At first everything was fine, but a couple days later I went for another flight and it just fell out of the sky.

Monday, March 27, 2017

Video: Pipestave Hill Sledding

We went sledding with friends a couple weekends ago and I made sure to bring the GoPro and my drone along to capture the fun.  Here is the video I made:

Sunday, March 19, 2017

Intro to Smart Home Stuff

Last month I spent a few days at my dad’s house in Florida and was surprised by how much home automation he had in place. The front door would automatically lock after a couple minutes, the lights were on timers and the garage lights had motion sensors. I immediately felt like I was falling behind in the technology race with my own father. The good news for me was that most of his devices were programmable, but they couldn’t be controlled from another device like a phone or one of the “ladies in a cannister”. I knew once I got home it was time to start planning my first foray into the world of the “smart” home.

Since I am an Apple devotee I started by researching Apple HomeKit. It seems that support for HomeKit from various vendors has been very slow due to the hoops they have to jump through in order to get approved by Apple. On the surface this seems problematic, but I like to think the adoption is a bit slower because they have placed higher standards on the vendors to ensure a more secure smart home experience.

I also looked into Alexa because I knew it supported many more devices, but my impression was that there wasn’t a consistent platform for connecting devices. In some cases you have to use the Echo skills functionality for the specific device, and in other cases you have to leverage IFTTT to trigger devices. Apple on the other hand has created an additional layer on top of the individual device apps that helps give a consistent way of controlling all the different devices. Siri support helps provide a little more flexibility than you get with Alexa, as is outlined in this great article from CNET, Google Home vs Amazon Echo. It also seemed a safe bet was to get stuff that supported Apple HomeKit, because they would also support all the other platforms too.

Once I settled on HomeKit it was time to find a device to try out in my home. I started thinking about my daily routine and what parts of it would be made easier and bedtime stood out in my mind. After sitting in the living room each evening I usually shut a bunch of lights off downstairs, upstairs I switch on the light to the room so I can turn on my bedside light and then go back out to switch the bedroom light off. I focused on this scenario and started researching online.

I went to the Apple Store page and searched through the HomeKit accessories to get an idea about what products were available. My bedside table lamp is from IKEA so it has the small E14 bulbs, so I had to find a “smart” outlet for that part of my plan. I settled on the iHome iSP5 because it was on sale from Amazon and was shaped so you could still plug other stuff in above or below it. For the downstairs lights I went with a Hue Starter Kit because they were the most well known brand available right now. I went with this particular starter kit, because it included a remote switch so you didn’t need a device to turn on the lights.

The Hue Starter kit was the first thing I received so I quickly unboxed them and replaced the two “dumb” bulbs in the recessed light over the fireplace with the new bulbs. I plugged the Hue Hub into my router and downloaded the Hue app. The setup in the app was pretty easy and was happy to see that signing up for a Hue account was optional. Next I went to the app store to download the Home app because I had removed it from my iPhone. The home app set up was easy, I created a room and was able to group the two lights together so they would be controlled as a single accessory. Controlling the lights from the control center was great and the ability to dim them by using a 3D touch was a neat feature. The Home app was able to dim the bulbs, but unlike the Hue app I wasn’t able to change the shade of white for the bulbs. I am not sure if the API just doesn’t support this yet or if Philips just hasn’t implemented it. Sounds like a software thing so it can easily be corrected.

The last thing to set up was Family Sharing, which started out pretty well. I quickly added my wife and kids to our home and they received the notifications. At some point I received a notification that I needed to set up either an iPad or Apple TV in order to access HomeKit from outside of our home network. I followed the directions for setting it up on the Apple TV, but wasn’t able to see the correct setting show up. On my iPhone I looked for the Home setting that appears on the iPad and couldn’t find it so I tried logging out of iCloud and then logging back in, which caused meant my Photo library had to get reconciled. In the end there isn’t a Home setting on the iPhone and eventually my Home setup propagated to the Apple TV.

I am stilling waiting on the iHome plug, but in the meantime I have been able to play around with Scenes and set it up so I can say “Good Night” to Siri and the lights would turn off. It is taking a bit of getting used to, but so far I haven’t received any complaints from my family about not being able to use the regular switch.

To be continued…

Hue has three different types of standard “shaped” bulbs: Hue White, Hue White Ambiance, and Hue White and Color Ambience. Hue White, the cheapest of the bunch, costs about $15 each, and only supports a single shade of white. The Hue White Ambiance costs about $30 each and supports over 50 thousands shades of white. The Hue White and Color Ambience, costs about $50 each and supports 16 million colors.

Wednesday, February 15, 2017

My Kingdom for an iPad Local Data Store

Almost a year ago I purchased the 9.7" iPad Pro, because I wanted to start using an iPad for more than just consuming social media and videos. In that time I have used the iPad on a daily basis at work mostly as a notebook by using GoodNotes, OneDrive and the Apple Pencil. Personally I have started blogging more using the ByWord and an old Apple Magic Keyboard. I also pushed the bounds of the device by recording, editing and posting my podcast, Kilobyte, exclusively from my iPad. The latter involved the Apple USB adapter, Ferrite (for recording and editing), DropBox for hosting, Coda for updating the RSS feed and Workflow to join it all together. It has been amazing how much I can accomplish now that I have a basic understanding of importing, exporting and saving using iOS extensions.

One thing noticeably absent from that list is making and editing videos, which seems odd given how easy and natural it is to use the iMovie app for simple videos. It isn’t excluded because I haven’t been making videos, because since August I have posted a bunch of drone videos on my YouTube channel, but they were all made using a Mac. I have avoided using the iMovie for iPad for one reason, video file management difficulties.

My drone footage always ends up on a Micro SD card either from my GoPro camera or the DVR inside my FatShark googles. At this point I can chain together a few dongles (MicroSD adapter to SD Card Reader to Apple’s USB adapter) and get them into the Photos app on my iPad, which will automatically upload them to my iCloud Photo Library. The problem is I don’t want these raw video files in my iCloud Photo Library and more importantly I don’t want my iPad to spend battery or bandwidth uploading over 1GB of data to the internet. Yes internet connections are everywhere, but they aren’t all created equally and sometimes it isn’t polite to just destroy a coffee shop’s internet bandwidth.

All I want is a folder inside an app where I can copy files from the USB drive without having to go through my iCloud Photo Library. I am not asking for an OS level filesystem, just something in an app that won’t get synced to the cloud. My ideal iMovie workflow would let me create a new project, plugin a USB card, select the video files to import (regardless of folder structure) and pull those videos into the app so they are stored locally just like the projects are stored today. After editing the movie and uploading it to YouTube, I could then choose to delete the project file including the imported videos.

If there is ever hope of getting audio and video professionals to switch to the iPad for work it is requires support for enormous file sizes and external disks. The cloud based data providers like iCloud, DropBox and Google Drive just fall down when working on enormous media files. I really enjoying editing podcasts using the Apple Pencil and think it would be just as much fun to edit video, but right now it just doesn’t work for me.

Sunday, February 12, 2017

Angular Proof of Concept (Part One)

I recently went through the process of building a simple application using the Angular framework and wanted to document some of my experience to possibly help others considering the framework. My day job for the last ten years has mostly involved building Flash applications using the Apache Flex framework and as a result my experience with HTML, JavaScript and CSS has been limited. In September 2016, I attended the Angular Summit Boston 2016 and learned a lot about the framework and how I might use it. A few months later I finally found some time to give it a shot.

To TypeScript or Not To TypeScript

At the Angular Summit there were two almost equally divided camps when it came to language choice. The JavaScript people seemed skeptical of TypeScript and were very comfortable with JavaScript. The TypeScript people on the other hand preferred the simpler syntax and more strongly typed nature of TypeScript. I decided to start with JavaScript Since I had some knowledge of it and also like that the browser would be working with the actual files I created rather than some on the fly transpiled files.

Once the language decision was behind me I walked through the Angular JavaScript Quick Start and quickly had a sample application running on my local machine. I used the Microsoft Visual Studio Code application because it was free and easy to use. Once I had the sample application up and running I started to make changes based on my needs. It was pretty easy to figure out the patterns and I was able to create my own components pretty easily. I did have some trouble getting the syntax of the JavaScript correct because of the hoops you need to jump through in order to support the complex class structures required by Angular. Here is an example of a simple module class and all its curly brace and bracket fun.

(function(app) {
  app.AppModule =
    ng.core.NgModule({
      imports: [ ng.platformBrowser.BrowserModule ],
      declarations: [ app.AppComponent ],
      bootstrap: [ app.AppComponent ]
    })
    .Class({
      constructor: function() {}
    });
})(window.app || (window.app = {})); 

Struggles with Server Calls

After completing the screens I moved on to trying to set up some services that would make calls to a simple REST API set up on my server. I went searching for examples on the Angular site, but like most of the other portions of the tutorial there isn’t a JavaScript example yet only TypeScript. I looked around the web a little bit and scraped together some information, but in the end I was forced to look at the TypeScript examples and then in my head transpile them to JavaScript. After lots of trial and error I learned how to use Promises with JavaScript and made the http get call to one of my REST endpoints. The browser sent the request to the server, but the server wasn’t having any of that nonsense.

My lack of experience with standard web technologies now started to catch up with me at this point as I fumbled through the process of updating my Apache Tomcat server to accept cross domain requests from my Angular application on a different port. A few hours of tweaking CORS filters in my web.xml file and a couple tweaks to my http get call resulted in a successful retrieval of text from the server. The next endpoint was authenticated so I once again consulted the TypeScript tutorial and figured out how to pass the Authentication data in the http get call. The TypeScript example looked so much more straightforward because it used import statements to bring in special classes for the Header, while the JavaScript I built used plain old objects.

All Downhill

Once I made it over this last hurdle I was able to finish the proof of concept with relative ease. I found debugging using Google Chrome’s built in developer tools was straightforward and helped me around some simple issues. The error messages provided by Angular were much better than I remember from what were reported back in the fall, which helped me fix some random issues I would face when adding new components. Compared to compiling Apache Flex in Flash Builder the whole experience of quickly updating a file and being able to test the change within a few seconds was a breath of fresh air. I found the process of adding new components was pretty fast and the segregation of the templates (view) from the components (model) was great. Overall using Angular has been a great experience and meshes well with my Apache Flex experience.

Of course this isn’t the end of the story, because I had a few more things I wanted to learn about Angular. In the weeks that followed I worked on switching from JavaScript to TypeScript, integrated some third party JavaScript widgets and also switched to using the fantastic Angular CLI. I am happy to say things only got better!

Tuesday, January 31, 2017

My Road to FPV (Part Three)

Continuing on from my last post, I received my Hubsan X4 H107C from Amazon and immediately took out it out to the backyard for its maiden flight. Right away it was noticeably smaller and more dense than the Syma X5C. I inserted the batteries and upon turning the transmitter on it bound without incident. I then repeated the learning procedure I had done with the Syma and took it up about six feet before returning to the ground. Since it has brushless motors rather than a gear system it definitely was a bit more agile in the air and had better lift. I only had one battery at that time so after about 8 minutes of practice I had to retreat inside to charge the battery.


Hubsan X4 H107c with sandwich for scale
Hubsan X4 H107c with sandwich for scale

The next time I flew I wanted to test out the camera on it, but unlike the Syma this one only supports video and the switch to start and stop recording is on the quad itself. So you always end up recording your entire flight, it is also important to note that you have to make sure you stop the recording before unplugging the battery, or you will not get any movie files. At first the camera didn’t seem to work so I ordered a second one, but once the second one arrived and I confirmed that I was recording video right, the first one ended up working after all. The video wasn’t great and was very similar to the Syma, but I didn’t care because it was cool to get a bird’s eye view of the backyard.

Here is some video shot while flying
I ordered six more batteries and would fly every evening after work for about 45 minutes. I tend to be very cautious, which probably slowed down my progress, but also meant that I didn’t have any major crashes that required me to go out and by another drone. After a couple weeks I was flying all over the yard using just pitch and roll for movement and then started playing around with yaw. I then started working on banked turns, which took a lot of practice to get right, but once my brain locked in on it things quickly got more exciting. I could now fly in circles and even began the tricky practice of flying at myself.

The H107C is a great quad for learning the basics of flying for a relatively low price. It seemed to have good quality components, it came with a nice prop guard, which I didn’t use at first because it was attached on the underside of the packaging. One cool feature is each of the arms have a break away spot that will help prevent them from breaking in a crash, this happened a few times and I just had to snap it back in place and was ready to fly again (always be sure and check that they are all locked in place before you fly).

The only problem I have had with the Hubsan X4 (H107C & H107D) series is with the wire that connects the battery to the circuit board. After a few weeks of sliding the battery in and out, one of the wires disconnected and I was unable to use it anymore. Luckily for me I had the spare one so I just moved on and kept flying. Eventually I learned how to solder and brought my first one back to life, but for a beginner it probably isn’t an option.

At this point I had learned a little bit about flying and was starting to get comfortable flying in different places. I even took it on vacation with us and flew in a couple spots. It was time to take it to the next level and enter the world of FPV.

Go back and read My Road to FPV (Part Two)

Tuesday, January 17, 2017

Tech Transition

Between a Rock and New Tech

In October Apple released the new MacBook Pro with TouchBar and received a mixed reaction. Some complaints cited the configuration limit of 16GB of memory, decreased battery size due to increased thinness and the use of only Thunderbolt 3 ports. All of these complaints are valid for some users and I think Apple is acknowledging it by still selling the Mid–2015 MacBook Pro alongside the new Late–2016 models. They would certainly rather have a simple product matrix that didn’t include old models of the MacBook Pro and MacBook Air too, but they still need to hit all the price points to accommodate all different types of consumers. The good news is if you want all the ports and you want a bigger battery then go purchase the old device, with its Intel Haswell processor and slower SSD.

People had the same concerns about the MacBook Air when it was first introduced with its lack of ports and very high price, but now people love that computer. I think we are seeing a similar situation with the MacBook Pro they are creating a form factor they will be using for the next five years and initially the hardware that will fit into it is going to be constrained, but as time goes by the internals will get faster, cheaper and smaller all while the case is tweaked and refined to perfection. I would expect the next generation to include support for more memory and improved battery life because of the improvements of internals.

The new Thunderbolt 3 port situation is also a byproduct of this forward looking view from Apple. The new case might not fit a USB-A port without requiring an increase in the thickness of the case, all for a port that may be completely irrelevant in 3–4 years. It may seem backwards to design a case first and then figure out what can go inside it, but it makes more sense if you think about the case you want in five years. How small can we make the case given our predictions on how people will use computers in five years? Using this logic also may explain why the SD card slot was not included in the new MacBook Pro. A majority of the cameras I use take the Micro SD cards and I am always forced to use an adapter/dongle in order to get them on my computer. In 3–4 years will SD cards still be the standard or will more cameras switch over to Micro SD or some other standard.
Other complaints recently have been around the absence of any new desktop Macs in 2016. I think the MacBook Pro is the flagship Mac and not only got more attention, but also needs to introduce new features before they appear on the desktops. If we look back just a few years we saw the MacBook first get Retina displays and Force Touch trackpads. Similarly I think we will see new desktop Macs in 2017 that include Thunderbolt 3 ports, new SSD’s and some variation of the Touch Bar. I think from a development perspective it is probably much easier to build it for the MacBook Pro and then retrofit that to a desktop machine than it is build something for the desktop and try to squeeze it into the MacBook Pro.

2016 was not a fantastic year for the desktop Mac, but it saw some amazing new technologies come to the MacBook Pro. The features on the MacBook Pro might not satisfy people in 2016, but over the next couple of years as more and more electronics convert to using USB-C style connectors we will be glad that our MacBooks Pro have plenty of Thunderbolt 3 ports to go around. Now we just need the MacBook to get an upgrade to not one, but two Thunderbolt 3 ports. Transitioning to the future is hard, but no matter what we are all going to be there.