This post is part 35 of 35 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 35 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:

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

I had intended to continue running parallel JavaScript and HTML streams for this instalment, but when preparing the notes for the JavaScript stream it became obvious I’d need the dedicate the entire instalment to JavaScript.

What we’ll be doing in this instalment is taking a first look at the concept of software testing. Testing is a vital tool in a software developer’s toolbox. In particular we’ll be looking at two useful concepts, and a tool to help us build and run our test suites. We’ll be looking at the concepts of Test Driven Development (TDD), and Unit Testing (UT). We won’t be religiously adhering to either – instead, I want to encourage you to pick and choose the aspects of these things that work for you.

The tool we’ll be looking at to implement our JavaScript test suites is QUnit. This is a Unit Testing framework developed by the jQuery project, and used by them for jQuery’s test suite.

All code files used in this instalment are contained in a single ZIP file which you can download here.

Read more

Tagged with:

Earlier this week I posted a review of the Mac window tiling app Magnet which is currently on sale in the Mac App Store for €0.99. @DriesDeRoeck replied on Twitter to point me nice free and open source alternative – Spectacle.

Read more

Tagged with:

Magnet App IconMagnet is the first Mac app I discovered organically on the front page of the Mac App Store. I wasn’t looking for anything, I just opened the Mac App Store app to run some updates, and there, on the front page, Apple were featuring Magnet, and it caught my eye and then my interest enough to hand over €0.99 to there an then!

What does Magnet do? It’s a macOS app that allows you to quickly and easily re-size and re-position windows to a number of useful presets so you can easily lay out your windows. You can instantly adjust any given window so it takes up the left half of the screen, the bottom-right quarter, and so on. The app is clearly inspired by the built-in feature that has shipped with the last few versions of Microsoft Windows that allows you to snap windows into a few pre-defined arrangements by bouncing them off one of the edges of the screen, but Magnet takes that idea farther than Microsoft have, and it does so in a very Mac-friendly way.

Read more

Tagged with:

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

In this instalment we’ll continue our twin-track approach of mixing a little JavaScript revision with learning some new HTML. In this case, we’ll revise JavaScript’s error handling mechanism (throw, try & catch), and learn how to use the HTML <select> tag to create dropdown menus and multiple-selection lists.

We won’t be updating our date and time prototypes, but we will be using them in example HTML pages, so in this instalment our two tracks come into direct contact with each other for the first time. We’ll use an HTML page with multiple dropdowns to allow users to select a date, and then render that date in many formats using our pbs.Date prototype. We’ll also use JavaScript’s error handling features to respond appropriately when a user attempts to render an impossible date like the 31st of February 2010.

Finally, the challenge set at the end of this instalment will also combine our prototypes with HTML forms, and JavaScript error handling.

You can download my solution to the challenge set in the previous instalment, and all the code samples for this instalment in a single ZIP file here.

Read more

Tagged with:

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

We’re going to continue our twin-track approach in this instalment – first some JavaScript, then some HTML Forms. We’ll start with my sample solution to the challenge set in the previous instalment, then we’ll look at one final new concept related to JavaScript prototypes – static functions. We’ll wrap up our revision and deeper dive into JavaScript prototypes with a final, finished, version of our algorithm for generating prototypes.

Switching our focus on HTML forms, we’ll look at some important form-specific ARIA roles, we’ll introduce two useful tags for enclosing forms, or parts of forms <fieldset> & <legend>, and we’ll introduce the concept of form data. With those foundations laid, we’ll look at how to add checkboxes and radio buttons to web forms, and how to interact with them through jQuery.

You can download a ZIP file containing the code files for this instalment here.

Read more

Tagged with:

older posts »