How to Kill

7 Nov 2020


Let’s say I wrote a script to test a game to destruction and set it running multiple times on my laptop. And let’s say something went wrong, so the script stopped responding and I had to track down and kill multiple copies.

Read More

Beeminder

24 Oct 2020


tl;dr: I’ve been playing with beeminder.com to track commitments.

What is beeminder?

It’s habit-tracking app with teeth.

You set a habit, a goal, commitment, something you want to get done. It has to be measurable. It has to have many small steps. It has to be very simple.

For example: Take 10,000 steps a day. Study three hours a day. Mediate for ten minutes a day. Go jogging three times a week. Floss teeth every day. Clean the gerbil cage twice a week. Stop work after seven hours. Eat five portions of vegetables a day.

And you pledge cash money that you will do this thing. Then, if you miss cleaning the gerbil cage once too often, then $5 is deducted from your credit card. And the next time it’s $10. Maximum fine is up to you; it depends how much you & your gerbils care about clean sawdust. Yes, you can lie about how often you clean the gerbil cage. But (say the beeminder team) people tend not to; it spoils the tool for them and it isn’t fun any more.

Beeminder works very well for nerdy people; if you like excel sheets, graphs, if you like Fitbit, then this is a tool you might enjoy.

Does it work?

It does for me. The beeminder website talks about “goals” a lot; I prefer “habits”. It works for small things which I have to do and keep on doing.

I had a torn rotator cuff, and the physiotherapist gave me a set of (very boring) exercises to be done every day. I know what happens; I will do my exercises fervently for about four days and then I slack off. I will think about doing the exercises, I will feel guilty about not doing them, but just don’t get round to it. Beeminder helped. I set a goal of “Do physio exercises 6 days a week” and then I was getting (very annoying) email & phone reminders until they had been done.

I could track the days, I could see progress, and yes, it made a difference…

Flashback to the 1990s

2 Sep 2020

,


To my surprise, I have discovered that the website for the movie Space Jam (1996) is still up and running.

Somebody at Warner Brothers has decided to keep the site preserved in its original state for the past twenty-odd years. And I can only thank them from the very bottom of my heart.

This website is the very pinnacle of 1990s web design. And it is amazing.

Read More

Lets get explainy

24 Jul 2020


Some quick definitions with links – because I’m consistently having to explain this to people. (And next time I can just copy-and-paste.)

A hybrid app is one which runs on the phone/tablet and is written with web technologies (HTML5, CSS and JavaScript).

Hybrid apps run inside a native container, and use the device’s browser engine (but not the browser) to render the HTML and process the JavaScript locally.

The Ionic Framework is a powerful development framework which brings together HTML5, AngularJS and Cordova.   See http://ionicframework.com

AngularJS is another javascript framework which allows the programmer to extend HTML with directives, and use data-binding to handle the dynamic data from the webservices.  See https://angularjs.org/

Apache Cordova is a set of device libraries that allow a mobile app developer to access native device function such as the camera or accelerometer from JavaScript.  https://cordova.apache.org/

Using Jquery Formbuilder

2 Jul 2020

, ,


jQuery formBuilder is a lovely stylish formbuilding tool, with all the front-end features a developer could desire. But the documentation is a little short of examples for integration with a backend system + database, and the gitter chat is completely full of people struggling with the basics.

I’m writing down some integration notes to keep it clear for myself in my head.

I’ve tried to keep this code as simple and as framework agnostic as I can.

Example code = dirty code. Do not use in real-life.

Read More

The case of the 500-mile email

18 Jun 2020


http://www.ibiblio.org/harris/500milemail.html

I love this story. It’s from the early days of the interwebs, mid 1990s.

Many stories from the world of IT support will leave you feeling that “everyone who asks for help is a fool”. It’s a world where the Bastard Operator from Hell is still seen a positive role-model, and any assistance often comes with a hefty side-helping of contempt.

This one starts with the classic:

“We can’t send email more than 500 miles,” the chairman explained.

I’m reading this, and I’m braced for the traditional “Ha! Ha! These lesser mortals are such fools!”

But it goes on, and there is some investigation, and test emails are sent, and the user is entirely right. They can’t send email more than 500 miles.

It’s complicated; there are sendmail configuration files, and the speed of signals in a fiber backbone is relevant (this story has a FAQ page) but my main take-away is that.. wait for it…

THE USER WAS RIGHT

Nice.

Finite State Machines

4 Jun 2020

, ,


What is a finite state machine?

A finite-state machine (FSM) is a mathematical model of computation. It can change from one state to another in response to some inputs; the change from one state to another is called a transition. An FSM is defined by a list of its states, its initial state, and the inputs that trigger each transition.

Thank-you Wikipedia. That’s helpful.

Read More

New in PHP 7.3 – Flexible heredoc syntax

23 May 2020


Heredoc is a useful tool for larger strings, though they have an indentation quirk which always put me off.

To quote from the PHP Requests-for-Comments:

The heredoc and nowdoc syntaxes have very rigid requirements. This has caused them to be, in-part, eschewed by developers because their usage in code can look ugly and harm readability.

PHP 7.3 introduces two changes to the syntax for heredoc and nowdoc syntaxes:

Read More

Carbon Dating

16 May 2020

, ,


Over the years, I’ve built a whole library of helper functions for working with dates in php, but I think they’re all a thing of the past now. Because I’ve been playing with Carbon Date library by Brian Nesbitt. It’s best described as Php’s DateTime for humans.

Here follows a quick summary, but I’m just looking at the very tip of the iceberg. Lots more!

Read More

Using Bootstrap Modals with Laravel

9 May 2020

, ,


I use modal popups all over the place in my web applications. The most frequent use is to make the user confirm deletion, either by typing DELETE into a form or by giving a reason for deleting the item in question. And I want to make this work in Laravel.

Note: this is klunky.  I’ve been playing with Laravel for a few weeks and if I end up using it as an ongoing development platform, then yes, things will be rewritten.

Read More