Re-implementing an old web site in a modern style (Part 1)

So a few weeks ago I found out that my contract was going to be ending early due to a loss of funding. This is a great shame, not least because it gave me the opportunity to learn a bunch of new technologies, and also because I’ve really enjoyed working from home with minimal supervision. It’s been really helpful to my kayaking training to be able to go out and train during the afternoon and work in the evening after it gets too dark to paddle. It’s unfortunate timing because my contract ends at the end of April, and we’d already booked our cruise for two weeks towards the end of May.

But I’ve discovered a bunch of things since I’ve started looking for work:

  • Getting remote work is hard, even if you have 7 years of remote work.
  • Lots of potential employers want to see your work and your code, or worse, they want to see your GitHub profile. The problem with that is that most of my code is written for employers who don’t allow me to share the code I’ve written for them, and the websites I’ve worked on have been internal rather than facing the internet, so I can’t show them. Even worse, the only thing I’ve got on GitHub is a WordPress plugin that I forked for a project I did for the local kayak shop in exchange for a new boat. I used to contribute more to open source projects, but that was before the days of GitHub and mostly it involved emailed patch files. That was back in the days when I didn’t have so many hobbies and obligations.
  • While I’ve been doing a lot of JavaScript over the last 7 years, I haven’t used any of the cool frameworks. We’d actually made the decision to transition our project at my soon-to-be-ex job to Angular, but we never got around to it.
  • A whole bunch of companies are embracing coding exercises as an evaluation process. I don’t blame them – I’ve given interviews and I’ve received them, and they are an utterly shit way of evaluating people’s technical ability. But it is time-consuming if you have to do this for every company you apply to.

So I thought it would be useful if I could do a bit of a project that I could show to people, and put the code on GitHub, just like all the cool kids. And it should obviously use a JavaScript framework. And you’d think that I’d choose Angular, but there is a particular job here in Rochester that is currently top of my want list, and they use React, so I thought I’d use React.

So having made a decision on the front end technology, what I needed to do was pick a project. And the obvious candidate is my navaid.com website. While I keep the data updated loading FAA and Eurocontrol data every 56 days, I haven’t updated the UI in many years, and it shows. I’ve got several data generators there, but most of them are for Palm Pilot programs, so they’re probably not worth updating. But the GPX generator at http://navaid.com/GPX/ is still viable. So I’ll only reimplement that one.

The first step is to make a mockup of the new site. Actually, the first step was to watch a bunch of tutorial videos for React. Which start off teaching you about WebPack and ES6, and then React, and then React-Redux. I wasn’t 100% sure if I needed Redux, but it seemed like a good way to separate the data state code from the render code. But after watching the videos, it was time to write the mockup.

Obviously, since I have been using Bootstrap for the last several years, it would be easiest to make something modern and presentable using it. I just had to find a nice theme with a CDN. I settled on the “Paper” theme from Bootswatch, which has a nice simple clean look.

The obvious thing was to replace the multiple pages of the original GPX interface with a single page. The existing interface saves your last set of parameters in the database linked to a cookie and re-uses them next time you come back, and I’ve heard from users that they often just click through to the end and hit the action button without changing any of those parameters, so I thought it would be good to be able to display what they’ve loaded so they review to make sure that they don’t need to change anything and click the “Start Generating” button. So I decided on an accordion panel where the header for each type of filter shows what’s selected for that type and if you click on the header, you can modify it. Hard to describe, hopefully, easy to see in action.

So it took a few days, but the mockup is here. The code is the first commit on this project on GitHub.

After playing with it a bit, the first thing that leaps out at me is that the accordion panels should open when you click anywhere on the title bar, not just on the text. Also, Vicki suggested that the color of the accordion panel is a little blah and I should make it a nice light blue. You’ll see that in generation 2.

Update On thing I forgot to mention: While Bootstrap has support for responsive design, I made no attempt to make it work on mobile devices because generating and downloading large files isn’t something you’re likely to do on a phone or tablet. Probably the only change I’d have to make for mobile would be to use <div class=”row”> and <div class=”col-xs-12 col-md-4″> instead of tables, and possibly some tweaking of the padding or margin around checkboxes because they appear to overlap the label text a bit in Chrome and Safari on my iPad (although they don’t overlap in Chrome on my desktop when I choose “iPad mode”).

Also, as per a comment below, I’m also going to look at increasing the text size if I can do it without messing out up the look. The default font is 13px, which I’ve always thought was plenty big, but the Roboto font is a bit “thin”. I like it because it looks elegant, but maybe it doesn’t work at 13px? Bootswatch has some other clean themes, maybe I’ll have a look at some of them instead.

Update: You can read Part 2 and Part 3.

Paddling the GoPro

With the GoPro mounted on my lovely Jim Smith bow mount, I took it out on the Genessee River to see how it looks. And I have to say, I think it looks awesome (ok, as I write this it’s only a few minutes after I uploaded it to YouTube and YouTube is only showing it in 360p, but trust me when I say it looks great in 4K). The GoPro doesn’t have image stabilization in 4K, but on a flat water trip like this, it doesn’t need it. And I love the position – the Jim Smith mount puts it just at about the right height, and it feels firm.

GoPro Hero 5 Black battery tests

I’m going to update this table as I do further tests. These are “bench tests” done with the camera mostly stationary in my office or in my work-out room. The idea was just to get a basic idea of whether I’m going to be able to record long kayak races with the camera as-is, or if I’m going to have to figure out how to attach an external battery to it without compromising the waterproofness.

Resolution/
Frame Rate
Wifi/
Bluetooth/
Voice
GPS Image
Stabilization
External Battery Battery Life
4K/30 On Off NA No 92 min
4K/30 Off Off NA No 97 min
4K/30 On Off NA Yes 142 min overheat
98 min
2.7K/60 On Off On No 85 min
2.7K/60 On Off On Yes 290 min
– card filled up
1080p/60 On Off On No 110 min
1080p/60 On Off On Yes 272 min

One additional test: I wanted to see whether being in “standby” mode using a remote consumed a lot of battery power, because if not I could perhaps cover a long race by turning it off and on as action warranted. However, in 4K mode (where I got 92 minutes video in continuous shooting), going 30 minutes on then repeating 15 minutes off and 15 minutes on, I only got a total of 111 minutes total between shooting (66 minutes) and standby (45 minutes). That’s not what I was hoping – basically 45 minutes in standby was equivalent to 26 minutes running.

Note: The “External Battery” in the table is a Novobeam NBP3000 Waterproof USB battery. I’m trying to figure out how to attach it to the camera without compromising the waterproofness of the camera, possibly by covering the USB and HDMI port hatch with Sugru or something similar.

First results with the GoPro Hero 5 Black

First thing I did was turn off gps but leave all the other stuff on (wifi, Bluetooth, voice recognition) and see how long it would record a 4K video before overheating or running out of battery. On the “bench test” i accidentally shut it down at 82 minutes because I didn’t realize that it would keep recording when it had a low battery warning on the screen. But no overheating problem. With the same setup I went paddling in mid to high 40s Fahrenheit and got 92 minutes before the battery completely died and it shut off. That bodes well. I plan to post the paddling video later after I give it the VIRB Edit treatment.

In order to see if it would work if I plumbed in an external battery, I repeated the bench test with a USB battery hooked up. It over heated and shut down after just over two hours. That’s not encouraging. The battery indicator was indicating a nearly full battery though. I let it cool down for 15 minutes or so and started it up, and it’s currently 75 minutes into that test and the battery indicator is saying 19% remaining, which makes me wonder if the first video before it shut down was just the external battery and after is just the internal. I’ve discovered from testing on other cameras that removing the internal battery entirely when you’re using an external battery can solve some overheating – that might be worth a test with a higher capacity external.

For my next test I want to reduce the resolution to 2.7K, increase the frame rate to 60fps and turn on image stabilization and turn off the other features and see how long the battery lasts both with and without external battery. If I could get a three hours or more with the external I might have exactly what I was looking for.

On the other side of the coin, I tried editing the kayaking video using that fancy video editor daVinci Resolver and it was slow as molasses so I gave up. So then I tried in iMovie and it was slow but bearable. I had to shut down just about everything else on the computer though to prevent it from stuttering and dropping frames. Maybe I do need that new MacBook Pro after all.

An actual conversation in YouTube comments

After my great disappointment with the Sony camera, I stumbled across a YouTube video of somebody reviewing some action cameras, some I’d heard of, some I hadn’t, and the Sony. I watched it, and they tested the cameras by going outside in freezing cold weather (it was filmed fairly recently somewhere in Southern Ontario, as far as I can tell). There was snow on the ground, they were dressed in winter clothing. For some odd reason they did all the comparison shooting in nearly dark conditions, which is an odd choice.

For the benefit of others who watched this video, I posted about my overheating problems with the Sony in the waterproof case while shooting 4K. And had to endure the following conversation in the comment section, roughly paraphrased:

  • Commenter 1: What sort of idiot uses a waterproof case in an office? Is your office under water?
  • Me: I’m trying to determine if it will work in the summer on my kayak. I have two choices: try it at room temperature in my office, or fly a few thousand miles south where it’s as warm.
  • Commenter 2: But the conditions outdoors are completely different than indoors – you’re not taking into account heat dissipation due to wind.
  • Me: I’m not taking into effect the effect of bright sunshine or the fact that summer is often much warmer than 20C either. It’s a fair test.
  • Video maker: We didn’t have overheating issues, but we didn’t use the waterproof case. Plus you didn’t take into account splashing.
  • Me: Well no, you wouldn’t have overheating issues without the case – I didn’t either. Neither did I have overheating issues shooting at lower res. But that’s not why I bought the camera. Counting on “splashes” keeping it cool is a $500 gamble I’m not willing to take.

One thing I didn’t mention is that I have another camera that I’ve done a similar bench test in my office and gotten 3+ hours recording (at 1080p), but I tried it several times on my kayak this summer and it has overheated and died after less than an hour. So not only is the bench test a reasonable test for overheating, it actually under-stresses the hardware.