This post is part 37 of 37 in the series Programming by Stealth

In this instalment we take a break from what we’ve been doing to take an in-depth look at code documentation. I’ve regularly included documentation generated with JSDoc as one of the inputs to the challenges, and I’ve done so with the implicit assumption that those docs would be intuitively meaningful to you all. Talking with Allison two things became clear to me – firstly, that I had made this implicit assumption, and secondly, that it was completely wrong! Code documentation is a lot like man pages on the terminal – the structure of how the words are presented often carry as much meaning as the words themselves. With decades of experience this is obvious, but it’s not intuitively obvious to novices.

To remedy this I thought it would be useful to go through the entire cycle of documenting one function, and that the appropriate format for that was a screencast. When I sat down to record the screencast I couldn’t help but use the opportunity to share my toolkit with you all, so the screencast starts with a little demo of the development tools I’m currently using to develop the Cellular Automaton API we’re working on as part of this series.

Below you’ll find the screencast embedded, and, links to the various tools mentioned. Myself and Allison have also recorded a podcast for this instalment. I share my screen with Allison, and we walk through all the same steps as I do in the screencast, but with Allison stopping me and asking all the questions you probably are as you watch the screencast. When published, that podcast will be linked into this post.

Read more

Tagged with:

This post is part 36 of 37 in the series Programming by Stealth

In the previous instalment we took at first look at text input in HTML, and we made a start on a new project – building a set of JavaScript prototypes for creating cellular automata so we can implement Conway’s Game of Life. In this instalment we’ll continue down both of those paths. Later in the project the two paths will finally merge when we use web forms to build a UI around our game of life.

We’ll start on the HTML track where we move on from generic text input with single and multi-line basic text boxes to some more specific types of text input, including some nice new input types that HTML 5 brought to the table. This will set up up to learn about HTML 5 form validation in the next instalment.

When we switch to the JavaScript track we’ll start by having a quick look at my sample solution to the previous instalment. Then, we’ll make a start on a JavaScript prototype to represent a Cellular Automaton together, which will set up the next assignment.

I’ve zipped up my solution to the previous assignment, a sample file that accompanies this instalment, and the starting point for the next assignment which you can download here.

Read more

Tagged with:

Screenshot of progress graph in My Fitness PalI few days ago I got an email from iTunes to let me know that my annual subscription to the pro version of My Fitness Pal had just renewed. That means it’s been a year since I got really serious about taking control of my health, so it seems like a good time to reflect on how things are going. Last July, a few months in, I blogged about how tech was helping me on my quest. This is partly a followup, and partly a more general reflection.

I won’t keep you in suspense – the TL;DR version is that with the help of tech, I’ve gone from being officially morbidly obese in January 2016 to being in the lower half of the healthy BMI range today. I had to squeeze into a 38″ waist, now, I have three fingers to spare on a 32″ waist. If you’re hoping I’ll give you a magic formula, think again, there is no shortcut – it really is as mundane as eating better and exercising more. I did the work, and I had to have the will-power, but I found tech extremely helpful in getting onto the right track in the first place, and then in staying there. The tech can’t do this for you, it can only help you do it for yourself.

Read more

This post is more than a little meta, but bear with me. This is basically a blog post to let you know that things are going to be a little chaotic around here as I transform this site from a blog into a true website, and that transformation is gonna happen while the site remains live, or at least mostly live most of the time. There will be an entirely new theme, but the real changes will be happening much deeper down as I transition from using WordPress as a blogging platform to using it as a true content management system (CMS).

The TL;DR version is that things may look a bit weird here from time to time over the next few weeks, and entire features may go AWOL for a few days.

Those of you who are curious about how the sausage gets made can read on, but really, the reason for this post is to let you know not to panic if you land here some day and everything looks weird.

So, what am I up to?

Well, firstly, I’m building out a bespoke WordPress plugin which will define the data architecture for this site. In WordPress jargon, that plugin is registering a number of custom taxonomies and custom post types, and adding a bunch of custom meta boxes (custom form fields) into various parts of the admin interface to allow me to associate metadata with the various pieces of content that will be hosted on the site. The plugin is coming along well, and I’m really happy with the structure it’s allowing me to put on things.

Now that the data architecture is coming together, I’ve also started work on a bespoke theme that will make use of the new data architecture to present the content in the way I want. I’ve given up on the idea of transforming someone else’s theme into what I want, and started with a completely blank page – yes, that’s right, I’m building my own custom theme from scratch. I always find blank pages scary, but this was a particularly big and particularly scary blank page. I’m making progress though, and it’s a real joy to get to build a WordPress site with all my favourite web tools – the structure of the pages is based on Bootstrap 4, the dynamic elements are being provided with jQuery, and I’m making heavy use of Font Awesome to add iconography through the design.

At the moment the design is basically monochrome because I’m focusing on getting the structure and layout right, and making sure everything is nice and easy to read. Once that’s done I’ll finish the site off with a custom Bootstrap theme to inject a little colour for personality, but not much, I want the site to remain elegantly spartan. The final piece is this big project is a new logo I’ve been working on, or more honestly procrastinating over, for the past few months. When I commit to a logo, that will give me the colour pallet and the font-styles that I’ll use to inject some personality into the theme.

I have to say I’m learning a lot, but this is still a really big job that’s gonna take me quite some time, so bear with me, and wish me luck!

This post is part 37 of 37 in the series Taming the Terminal

Since we covered SSH in parts 29 & 30, Apple have changed how their desktop OS deals with the passphrases protecting SSH identities (key pairs). This provides us a good opportunity to have a look at the SSH Agent in general, and, how things have changed on the Mac in particular.

The good news is that while things have changed on the Mac, with a small amount of effort, you can get back all the convenience and security you had before.

Read more

Tagged with:

This post is part 35 of 37 in the series Programming by Stealth

We’ll start this instalment by rounding out our look at QUnit – first, by taking a quick look at my sample solution to the challenge from the previous instalment, and then by introducing a simple little feature that will make this instalment’s challenge more manageable.

Next, we’ll make a start on text input in HTML forms. This time we’ll focus purely on free-form text, and then in the next instalment we’ll move on to formatted sub-sets of text like numbers, email addresses and so on.

Finally, we’ll make a start on what will be an on-going project. The idea is to combine our understanding of HTML, CSS, JavaScript, jQuery, and QUnit to implement a zero-player with a really cool computer science back-story.

As usual, I’ve created a ZIP file with the files for this instalment, including a sample HTML page that demonstrates text input in action, and the files that make up the starting point for this instalment’s challenge which you can download here.

Read more

Tagged with:

You may have noticed that on this site, links that open in a new tab get a nice icon to indicate that fact, and, links to domains outside of this site automatically open in a new tab and get that icon. This is achieved using a collection of JavaScript code that I have released as open source under the name bartificer.linkToolkit.js, and published on GitHub.

The code was inspired by some examples in the Programming by Stealth series, and, that same series provided the impetus to give the project some final fit and finish before releasing version 1.0 today.

Tagged with:

I promised a colleague in work that I’d send him on a list of the science podcasts I recommend, but as I was composing the email I realised this might be of value to others, so I’ve compiled my list as a blog post instead. These are all podcasts I listen to religiously, and in most cases, podcasts I have been listening to for many years.

Astronomy Cast
The show’s tagline is “not just what we know, but how we know what we know”, and what could be more scientific than that? The show doesn’t just aspire to that tag line, it lives up to it, and that’s the main reason I’ve been a happy subscriber for many years. The episodes are about 30 minutes long on average, and come out about once a week. Details at www.astronomycast.com.
Big Picture Science
This show is produced by the SETI institute, but it’s a general science show, not a show focused only on SETI or even astronomy. This show is syndicated across many radio stations in the US, so it’s no surprise that what you get is a professionally scripted, presented, and edited show with amazing guests. The fact that the hosts are friendly and have a good report with each other is the icing on the cake. Details at radio.seti.org.
Gastropod
This is not a pure science show, but there’s a lot of science in it, and it’s definitely a show that does its best to separate fact from fiction. The show’s tag-line is “Food with a side of science and history”, and that sums things up pretty well. This is not a show where you go to learn how to cook, or to pick up interesting recipes. Instead, it’s the kind of show where you learn things like how you can turn the same basic ingredient, milk, into so many and such varied cheeses. This is a professionally scripted and produced show, and it’s released in seasons, so you often have to wait a while for new episodes to come out. I’ve always found it to be worth the wait though! Details at gastropod.com.
The Jodcast
This is a hard-core astronomy show produced by postgraduate students at the University of Manchester and the Jodrell Bank radio telescope. They do a main monthly show, and most months, you also get a bonus extra show about half way through the month. If you’re into Astronomy I think you’ll love the Jodcast, but if you’re not, this show is probably not for you. Details at www.jodcast.net.
The Naked Scientists
A professionally produced weekly podcast covering general science. The show is produced in the UK, and its original incarnation was as a BBC radio show. The show is about an hour long, and always very well researched and paced. One of the things I love about the show is that they put a big focus on interviewing the actual scientists who wrote the papers that are making the scientific news the show covers. Press releases and news reports can’t describe the context and significance of a result nearly as well as the people who actually did the work! Details at www.thenakedscientists.com.
Naked Astronomy
This is an astronomy-focused spin-off from The Naked Scientists. Episodes tend to be about half an hour long, and are obviously completely astronomy focused. If you enjoy the style of The Naked Scientists, and you like Astronomy, then you should enjoy Naked Astronomy. Details at www.thenakedscientists.com/podcasts/astronomy.
Science Vs
I only discovered this show recently, but it’s so good I listened to every show in the archive within the first week of discovering it. The idea is very simple – each episode the show takes on a controversial topic, and looks at it from a purely scientific perspective. Does immigration drive up crime? Do specific gun controls actually reduce deaths? Does removing guns from a society increase crime rates? Does having an abortion increase a woman’s chances of getting breast cancer? The show doesn’t shy away from any of today’s hot topics, but it’s totally apolitical – it’s about the science of these topics, not the politics, and I find that very refreshing. While the show has no problem tackling the big issues, there are also more light-hearted episodes like one which asks the vitally important question – are wine and chocolate good for us or not? Details at gimletmedia.com/science-vs.
Star Talk Radio
This is astrophysicist Neil deGrasse Tyson’s ever-growing network of shows. While there’s often an astronomical focus, these are definitely general science shows, and they tend to be a nice mix of informative and fun. The format always involves a mix of scientists and comedians, which might sound odd, but it really works – it keeps you laughing and learning. The comedians play the role of the everyman perfectly, asking all the “dumb” (no such thing) questions you’re probably shouting at your phone as you listen. Details at www.startalkradio.net.

Tagged with:

I’ve just published a release of backup.pl, my simple perl-based generic backup script. You can download the release, and get full documentation on the project’s GitHub page.

Tagged with:

This post is part 34 of 37 in the series Programming by Stealth

In the previous instalment we had our first look at QUnit, an open source Unit testing framework for JavaScript by the jQuery project. In this instalment we’ll finish our exploration of QUnit with a look at a few more advanced QUnit features. We’ll be making regular use of QUnit in future JavaScript challenges.

Wrapping up our brief detour into testing a QUnit leaves us free to move back to HTML forms and more JavaScript practice in the next instalment. The aim is to slowly bring those two streams back together through a new multi-instalment project. Over the next few instalments we’ll be building up a web app that makes use of both web forms and JavaScript prototypes.

As usual, I’ve collected the code referenced in this instalment into a ZIP file which you can download here.

Read more

Tagged with:

older posts »