My MSc thesis

I’ve just uploaded to Github a copy of my MSc thesis on Computer Vision and Analysis of the Carotid Artery I hadn’t looked at my thesis for a while but I was thinking that it might be a nice idea to replicate it as a modern web application with the number crunching handed off to the most appropriate cloud service. Looking at what I did back then, re-implementing the algorithms in a different language and then recreating the 3D graphics will be quite a challenge…

October 15, 2022 · 1 min

AI mouse in a maze

The Not AI mouse in a maze project was very successful at getting the virtual mouse to navigate a randomly generated maze using a fairly simple set of rules. It could solve about 99% of them. However, there were some maze designs that it got stuck on and others where it was very slow to find the correct path. So, finally it was time to see how well my mouse could do at solving the maze using AI (the NEAT algorithm). A brief description of the code, how it works, and a video of the mouse is on Github ...

October 14, 2022 · 2 min

Not AI mouse in a maze

Building on the Not AI Car project, I started out trying to get the car to drive across a maze. I changed the car to a mouse, as the lines detecting the edge looked like whiskers. As I’d done with the track, the first thing to code was an algorithm to generate a random maze each time. The backtracking algorithm was well suited to this application and there were many implementations to choose from (see the code for links), so I just need to make a few modifications. ...

October 4, 2022 · 3 min

Not AI car

I’d been looking for a project to work on to learn Python and AI when I came across a video about Neural network racing cars around a track. Initially, I thought creating something like that would be too hard for a first project in Python, so I started work on it. Many of the comments on that video asked whether a trained car would do just as well on another track, so I decided to create the track dynamically with an algorithm that would produce a different track each time. Then, I added a car and calculated distances to the edge of the track and thought I should just check that it could drive by providing instructions for steering and acceleration. As I’d calculated the distances to the edge of the track, I divided those by the respective angles (positive and negative) and added them up to decide which way to steer and by how much. The distance straight ahead was ignored as it wouldn’t affect steering and would resulting in dividing by zero. The acceleration instruction was based on the distance straight ahead. As with a physical car, limits were place on the inputs (rate of change of steering and acceleration/deceleration) and the capabilities of the car (maximum steering angle and speed). ...

October 3, 2022 · 2 min

Migrating content to this site

I’d previously written blog posts in WordPress but this site uses Markdown instead. The migration process was simply a case of exporting the old posts from WordPress (there’s a button in WordPress to do this) and Google “WordPress XML export to markdown”, which resulted in me using this: https://github.com/lonekorean/wordpress-export-to-markdown There were various warning about deprecated dependencies but, running the script with npx, they weren’t installed. The blog posts were converted to markdown in a few seconds and then there was the process of tidying it up, especially embedded images/code and the FrontMatter. ...

September 22, 2022 · 1 min

Transcoding video files and preserving "Media created" meta data

VLC is a handy tool for transcoding video files - in my case, mostly from .MOV to .mp4 From the Media menu, select “Convert/Save…” Add some files Click “Convert/Save” button Choose a conversion profile or click the spanner icon to create your own, combining your preferences in video and audio codecs Choose a destination file (unless multiple files are being converted) Click “Start” Wait a while and hopefully all of your videos will have been transcoded Then you find that you’ve lost the “Media created” meta data for transcoded files has been set to the date/time of the transcoding, not the original date that the video was recorded, and that’s the one that you want to sort media by. ...

September 8, 2022 · 2 min

RewriteRules in .htaccess files that run after a set date/time

If you’re going to launch a website out of hours and want an old site that uses Apache to redirect to the new site, you can set a list of rewrite rules to run after a certain time. The trick is to write a condition that makes a rule run until the launch date and that rule skips the new rules. After the launch date, the rule doesn’t run, so the new rules aren’t skipped: ...

July 27, 2016 · 1 min

DataTables – automatic recognition of which table columns contain date/time information

I’ve used the JavaScript DataTables plug-in for jQuery a lot. It’s great for easily adding sorting to tables and lots more. It works nicely with Bootstrap too. The clunkiest thing I’ve found is trying to sort columns that contain date / time information. In the past, I used the datetables-date-sort.js plugin, which allows you to specify for each column what the data type is e.g. <script type="text/javascript"> $(document).ready(function () { $("#myTable").dataTable({ "aLengthMenu": \[\[10, 25, 50, -1\], \[10, 25, 50, "All"\]\], "iDisplayLength": -1, "aoColumnDefs": \[ { "bSortable": false, "aTargets": \[0\] }, { "asSorting": \["asc", "desc"\], "aTargets": \[1, 2, 3, 4, 5, 6, 7, 8, 9, 10\] }, { "sType": "uk-date-time", "aTargets": \[8,10\] } \] }); }); </script> That’s nice and flexible but you have to specify it for each table and, worse still, you have to (remember to) change it each time you add/remove/reorder columns. ...

November 24, 2015 · 2 min

A couple of articles on accessibility

http://a11ywins.tumblr.com/ lists user contributed sites that are good for accessibility or have made significant improvements. There’s usually a reasonable technical overview of the technologies used. It highlights the efforts that other companies/developers are making, which is useful to spur us on to do better and to help provide justifications to our business owners for why this is important. http://simplyaccessible.com/article/spangular-accessibility/ a really helpful demo site with explainations on how to make an angularjs application accessible. The code from the demo application would be a good starting point when creating your own angularjs application.

April 10, 2015 · 1 min

Avoiding monolithic applications

I spend a lot (perhaps too much?) time worrying about how applications can become too big and extend beyond their original scope. When asked to create a small application that is either stand-alone or only slightly linked to other systems, it’s too tempting to just add it as an exatra section of an existing application, rather copy/re-create the infrastructure needed for it to be in its own application. Visual Studio now provides a lot of the infrastructure, so with a few button clicks you can have an ASP.Net MVC application that’s all plumbed together but often the first thing you do is get rid of the that auto-generated stuff and it doesn’t include all of your own standard customisations. There are a few ways to implement those standard customisations: ...

April 10, 2015 · 3 min