extras

Welcome!

Julian's photo Hi there! I'm Julian M Bucknall, a programmer by trade, an actor by ambition, and an algorithms guy by osmosis. I chat here about pretty much everything but those occupations. Unless you're really lucky...

Most recently this is what I've come up with:

Another chapter from the “Don’t be clever” coding style

A short and quick example of some baffling coding today. It so happens this past weekend I was updating some HTML and CSS and JavaScript on this site. One of the JavaScript source files (luckily not written by me) had this:

function $$(id) {
    if (id.substring(1, 0) != "#")
        id = "#" + id;

    return $(id)[0];
}

Start Well Your Day - Whut?So, in other words, it takes an element id, makes sure it starts with a ‘#’, calls jQuery to return the elements with that id (of which there should be one only, of course), and then returns the DOM element for the first item in the jQuery object array. Not so bad, except…

1. ‘$$’ is a crap name for a function, sorry. Yes, I get that it calls jQuery, er, safely, but it just looks weird. And unlike $(), it returns a DOM element and not a jQuery object. This caught me out elsewhere and is the topic of another post.

2. It uses ‘!=’ and not ‘!==’, something that rubs me up the wrong way in a Lint sense.

3. What the heck are those two parameters to substring()? Yeah, I get that it’s getting the first character in the string, but that call just looks wrong.

That latter one actually got me to go to Mozilla Developer Network and look up the damn function. Look, there are two substring-type functions in JavaScript: substring() and substr(). The first gets a substring from a string given the starting index and the ending index (the character for which is not included in the returned substring), and the second gets a substring given the starting index and the number of characters. Already, we have to try and remember the calling syntax for two extremely similar functions, and also the edge cases for them both. For example, if the starting index for the first is less than 0, it’s assumed to mean 0; whereas if the starting index is less than 0 for the second, it’s assumed to count from the end of the string. See what I mean?

It turns out that substring() has the nice behavior that if the ending index is less than the starting index, the function will swap them over before using them. Fine, I’d completely forgotten that fact, if I ever knew it anyway. But, why the hell the writer of this function didn’t call id.substring(0, 1), which I would have just understood implicitly (either as starting at 0 up to index 1, or, “wrongly”, as starting at zero for one character), I’ll never know. The parameters are hard-coded after all, and in a way to make the code maintainer stop and doubt his experience or sanity.

Bah.

Album cover for The SinglesNow playing:
Pretenders - Don't Get Me Wrong
(from The Singles)

Installing Yosemite like a pro

Way back when, I bought a black MacBook and an iPod Touch. I was – har, har – going to learn how to write Objective-C and earn millions selling apps. You know the kind of thing:

  1. Learn Objective-C
  2. PROFIT!!!!

Amsterdam canal bridgeExcept Objective-C is a right royal pain in the neck – and this is coming from someone who loves JavaScript. Anyway, after a year or so, I had a better plan: use a Mac as my main laptop and get used to the Mac way. I bought a unibody 13-inch MacBook Pro, mid-2010 version, speediest CPU at the time, upgraded it to 8GB and a hybrid 500GB drive from Seagate, and used it as my main machine for about 8 months, trying to love the Mac ecosystem. I sold the BlackBook a little later.

Via some time using VMWare Fusion, I ended up with a Bootcamp partition and used mainly Windows 7. But I found the Mac keyboard to be not ideal (plus some other niggles) and so in mid-2011 I bought a Dell XPS 15z instead. The MacBook Pro was sidelined, with me booting it every now and then to update it and back it up. Still in the back of my mind was the thought of writing iOS apps and so I didn’t get rid of it completely.

Fast forward to now.

I have a Xamarin license from work. It’s time to play around writing iOS apps but with C# instead. Much better. However, carting around a 4.5 lb MacBook Pro as well as my Dell XPS 12 when I travel doesn’t tempt me. Since the Mac side of things is only for compiling and uploading to an iOS device (aka, my phone or my iPad), it makes sense to get the smallest lightest Mac I can find, viz the MacBook Air 11. And that’s what I did: I bought a second-hand machine off of eBay (it hasn’t changed substantially since the mid-2013 release and that’s what I bought) and to offset the cost it’s time to sell the MacBook Pro.

Of course:

  1. I’m going to wipe and install Yosemite on the second-hand MacBook Air 11 – I trust no one when it comes to OSes and malware.
  2. I’m going to wipe and install Yosemite on my MacBook Pro before selling it – you ain’t getting my data, albeit 3-year-old data.

Hmm. It behooves me to optimize here, perhaps.

After backing up my MacBook Pro, I rebooted into the Disk Utility (press ⌘ and R while the machine boots). Here I erased the whole drive – select “Mac OS Extended (Journaled)” for the disk format and give the disk a name – and then selected the option to Install OS X. (Note: you will have to be connected to a network since the install process has to download the OS installer – WiFi is fine.) It then installed Mavericks. Nooooo! That’s not what I want!

It turns out that in order to install Yosemite (that is, OS X 10.10) at the moment as a fresh install (and not as an upgrade), you have to do something different: you have to create a bootable drive with the Yosemite installer on it. Generally this is a USB drive; 8GB will do just fine. So, go find one of those freebie USB drives you have stashed away in a drawer.

I went through the new install process on Mavericks (basically which country, which language, etc) and then downloaded the install for Yosemite. And now the easy fun part: there is a way to type in a bunch of commands into a terminal to create a bootable USB drive and then copy the Yosemite install on it, but fooey to that. I downloaded DiskMaker X and it did everything for me. At the end of 10 minutes or so, it had reformatted my USB drive and had copied the relevant parts of the Yosemite install onto it. And the best bit? It went and found the install program itself, I didn’t have to browse and point to a particular folder. So now I had a bootable USB drive with the Yosemite installer on it.

Now it was even easier: reboot the Pro with the USB drive plugged in. This time, just press the Option/Alt key when you reboot. It’ll show the bootable drives, so select the USB drive and boot from that. Select Disk Utility, erase the main drive again (same parameters), and then install Yosemite. Bingo. After about 15 minutes I had a MacBook Pro with a Yosemite clean install and waiting at the registration details prompt. All ready for the lucky person who will be buying this machine from me on eBay.

Now to do the same on my new MacBook Air. The USB drive I’ve just created will work just fine there as well: no need for all the shenanigans above again. After that, it’s time to install Xamarin and go play.

Album cover for AffectionNow playing:
Stansfield, Lisa - My Apple Heart
(from Affection)

The Talented Mr Steve

So this happened…

Gently photoshopped building ('BLDG') signThe phone rings. The caller id says “STS” from 949-203-0674. I know who it is; I track scam phone numbers: it’s a hobby when you work from home. I answer.

“Hi, this is Julian.”

Clicks, buzzes, then: “Hello, this is Steve from <some fake company name>’s Tech Support Department.”

“Oh, yes?”

“We’ve noticed that something is wrong with your computer. My error report says it is no longer updating.”

“Interesting. Which one?”

“Pardon?”

“I have three I use regularly. Which one?”

A worried silence.

“Look, all my computers have unique names. Surely your error report gives the computer name.”

“No.” Furious thinking, almost a hum on the line. “The guys in the server room don’t release that information to us.”

Ooh, nice comeback.

“Maybe it’s not my computer. What’s the IP address for the error report? Surely, it gives you that? Otherwise how do you match up the computer to my phone number?”

He’s getting a little more worried now. Glibness pays off again.

“They don’t give us that. Besides which all your computers are using the same IP address.”

Clever! Avoiding the question, but I’m starting to like this scam artist. I’m actually doing some development using a couple of machines at this moment, but before I say anything, he comes back with:

“It’s for the Windows System. It is no longer updating.”

Neat answer: coincidentally I’m running a Windows laptop and a MacBook Pro. The fun of Xamarin, dont’cha know. I play him along a little bit more.

“Oh dear. Which version of Windows are you talking about?”

“Windows 7.”

“Oh, good. I’m running Windows 8.1.”

“It’s for that one.”

Major overreach. Time to smack him a little more.

“In fact I just pulled up Windows Update, and as I thought Tuesday was Windows Update day for October and I updated everything. The screen also tells me that it checked for updates this morning as well and there were none.”

“This has happened since then. I’ll show you.”

At this point I was done. His script would then have gone like this: start a Command Prompt, type such-and-such command into it, which starts up Event Viewer, point out all the scary events in it (all of which are pretty boring and mundane, but catalogued like Warning and Error), persuade me to download an app that’ll allow him to take over my machine, when he installs malware and convinces me to pony up $300 for something to remove it. Bzzzt, got better things to do with my life.

“So, to recap. Your error report says that a Windows computer here is no longer updating properly. Yet you cannot say which computer it is, or even what my IP address is such that it would lead you to believe that one of my computers is at fault. You can’t even get the Windows version right. You can’t even say how you’ve married up this rogue computer of mine with my telephone number leading you to phone me in the first place. In short, you are lying to me and I think you’d better go find another sucker to defraud. Bye.”

“Thank you and goodbye.” Click.

At least he was polite to the end.

Seriously – and I’m not talking to my tech readers here who already know this – if someone phones you up out of the blue saying there’s something wrong with your computer, stop and think: how have they matched up your computer with your phone number? Not possible, my friends. It’s a scam, pure and simple. But once they have persuaded you to install something you know nothing about on your PC, they own it. Period. You’ll be fleeced to get it back. So don’t let them.

Album cover for The Royal ScamNow playing:
Steely Dan - The Royal Scam
(from The Royal Scam)


Cloud, cloud, everywhere

So I got an iPhone 6 the other day. Bully for me, I can hear you say, but this isn’t about that. It’s about the fact that Apple, in preparation for iOS 8, changed the limits and functionality on their cloud storage offering, iCloud. With all the iOS devices in the house, a while back I had to pay for extra storage to enable backups for them all. That storage was just upgraded at no extra cost to 20GB. Time, I thought to myself, to check on all the cloud storage subscriptions I actually have and, presumably, use.

iCloud

Flying debris aheadLet’s start off with this one, since I just mentioned it. I now have 20GB, costing $10.99 a year. Essentially this is for backing up our Apple iPhones and iPads and now for things like storing photos and documents from any iOS apps we use. Two-factor authentication has been enabled, duh.

Dropbox

This is the cloud storage I’ve been using for a few years.  I have 1TB, costing $99 a year. This is what I use for documents that I want to share with others or that I want to access from any of my PCs. I have also enabled the photos auto-upload from our iOS devices using this storage too. Two-step verification enabled.

OneDrive

Weird one this. I don’t really use it, but we both get 1TB as part of our Office365 Home subscription. Office365 Home costs $9.99 per month (or $99 a year) for the usual Office installs (Word, Excel, PowerPoint, Outlook, OneNote, etc), the tablet versions, Office Online, and also OneDrive. For up to 5 PCs or Macs (we’ve used four already, yikes) and up to 5 tablets. Two-step verification enabled. As I said I don’t really use OneDrive for much: some work documents mainly.

Google Drive

An even weirder one. I haven’t really used this recently at all (in fact the documents I have there are from well over a year ago or earlier – some are even from a project I did in 2009, for instance). In essence, you get 15GB for free. Good for Google docs, including the ability for several people to update a document at once, but if you don’t use Google docs, meh. We used to use this at work but have essentially moved completely to OneDrive now. Two-factor authentication enabled.

Amazon Cloud Drive

This is part of Amazon Music. A while back I “uploaded” my entire music collection to Amazon. When I say “uploaded”, it’s a little cleverer than that: for those tracks and albums that Amazon Music recognizes, it makes available the 256-bit version it has in its library instead of actually uploading the 96- or 128-bit version I originally ripped from CD. You can also, if you want, download the full-width version of tracks to your computer to replace those you originally made. All in all, I found it a good proposition. For up to 250,000 tracks (way more than I own), you pay $25 a year and also get 50GB of Amazon’s Cloud Drive. Do I use Amazon Cloud Drive? No, apart from the option that gets various documents sent to my Kindles.

Adobe Creative Cloud

I subscribe to Adobe’s Creative Cloud (CC) so that I have access to Lightroom, Photoshop, Illustrator, and InDesign. As part of the Complete level ($49.99 per month for one PC), you get 20GB of online file storage, so that you can access your CC project files from your PC and tablets. I don’t use it because I only use CC on one PC; I’ll admit though I haven’t tried the mobile apps yet.

Amazon S3

In the old days, I used Jungle Disk to back up my main PC and it would back up to a folder on Amazon S3. After a weird bug, I removed Jungle Disk and switched to CrashPlan for my backups. Nowadays, I only use Amazon S3 for large files linked from my main blog here and also for a few small websites. The cost depends on not only the amount of storage used, but also on the amount of downloads/uploads (it was the latter that cost me dearly during the JungleDisk débâcle). Nowadays it costs me maybe $2 a month.

CrashPlan

I use CrashPlan to backup my main PC (well, OK, a secondary backup of certain folders like photos and documents; I use a local NAS for the complete backup) to the cloud. You pay to use CrashPlan – it’s a service rather than a big online drive – and the storage comes for free. Currently I pay $59.99 per year for the service and am using 200GB or so for my backups.

Summary and next steps

OK, way too much online storage, documents all over the place, all those drivers installed on my PCs, paying for more than I need. Time to clean up.

First up, bye bye Google Drive: I’ve now moved everything off this cloud drive and have uninstalled Google Drive from my PC.

Second, and this was a more difficult decision: dropping Dropbox. After all, I liked it enough to pay for it in the past, but ever since Microsoft upped the storage for OneDrive, using it doesn’t make any sense any more. Yes, I know that Dropbox now has support for keeping a version history of files, but this is an extra cost option, and so far I’ve not needed this kind of functionality for my non-work files. So, I have moved everything off of Dropbox and moved it to OneDrive. This is a little more painful in that it was only just over a month ago that I renewed…

(I will however state that the OneDrive app for iOS is a bit flaky: for some reason it decided to only upload 46 of my hundreds of photos on my iPhone – those taken in the last month. Why? I don’t know. Others have run into the same problem as a quick Google search will show. In the end, I had to manually upload all the others.)

The rest of them I shall leave as is. This means I’m paying $60 per month for a couple of services (that admittedly are more about software than storage), and $96 per year for the rest. All told, $816 per year.

Album cover for Dream Into ActionNow playing:
Jones, Howard - Is There A Difference?
(from Dream Into Action)

Saying goodbye to Eurydice

A couple of weeks ago, just before we disappeared off on vacation, Eury crashed. Before you start imagining car wrecks and the like, let me explain that Eury was our oldest cat. He was 18 years and 4 months old, which, for a cat, is way up there in terms of age. And by crashed I mean that, finally, all of his ailments – and let me tell you this cat had them all, pretty much – caught up with him and there was nothing more we could do. Eury was one of the original two kittens we bought...

Read more »

Restoring old negatives: the bad and the not quite so bad.

As hinted a couple of blog posts ago ( From ‘57 to 57 ), I’ve been resurrecting a stash of old film negatives from those halcyon days when I first started learning about photography after I’d bought an SLR. And by “resurrecting” I mean separating them from the stuck-together block some of them had become. A couple of people have asked me what I did, so a quick post is in order. In essence, the film processing service I used back in the day (30-35 years ago, note) put...

Read more »

Amsterdam canal houses

Back in April this year, we went and stayed in Amsterdam for a few days. We were at the Hotel Pulitzer on Prinsengracht – although our room overlooked Keizersgracht at the rear of the hotel – and one of our pastimes was to look at the canal houses, which ones we liked, which ones not so much. On the last day we were there, I suddenly decided that I should photograph a whole bunch of them as we walked around, and create a collage of the best houses. Of course, it was that day it decided...

Read more »

From ’57 to 57

A couple of months ago I celebrated my birthday; it happens every year. This is not about that event particularly, but more about changes over time and how I’ve almost become inured to the wonder embodied in those changes. To take a quick example: I was born in the same year that the Space Age started. In October of that year, the Russians launched Sputnik 1 (Спу́тник-1). These days, although truth be told I hardly think about it, I use several effects of that momentous launch daily. No, I’m...

Read more »

The rise and fall of my Jungle Disk

Quite a while ago (I was surprised when I looked it up: 2008) I subscribed to a backup app called Jungle Disk. The interesting thing about it was (a) it used Amazon S3 (then relatively new) as a backup store, and (b) you subscribed to it at a rate of a mere $1 per month. So, in essence, it’s an online backup program and it allowed me to keep documents and photos – about 6 folder trees in all – somewhere else than a local backup drive. It was the “house burns down” option...

Read more »

Upgrading the SSD in the Dell XPS 12 – what not to do

So, in the previous installment in this upgrade game I was crowing about how I knew how to boot from a USB drive on the Dell XPS 12 and therefore upgrading the SSD in it was going to be a piece of cake. Well, it turned out to be a piece of the heaviest, densest, fruit cake you’ve ever seen. Dropping it onto a wood floor would have dented the floor. To recap, I decided to purchase a new Crucial M500 480GB mSata SSD to replace the 240GB unit I’d initially installed a year ago in my Dell...

Read more »

Extras

Search

About Me

I'm Julian M Bucknall, an ex-pat Brit living in Colorado, an atheist, a microbrew enthusiast, a Volvo 1800S owner, a Pet Shop Boys fanboy, a slide rule and HP calculator collector, an amateur photographer, a Altoids muncher.

DevExpress

I'm Chief Technology Officer at Developer Express, a software company that writes some great controls and tools for .NET and Delphi. I'm responsible for the technology oversight and vision of the company.

Validation

Validate markup as HTML5 (beta)     Validate CSS

Bottom swirl