RSSAmplifier

Blog

GreenAsh

All-natural web development, poignant wit, and hippie ramblings since 2004

greenash.net.auRSS feed ↗169 posts

Latest posts

Getting MapLibre working for both native and web in Expo

I've been dabbling of late in building a mobile app with React Native + Expo . One of the things that attracted me most to Expo, is that – on top of the "write once, run on iOS and Android " claim of React Native – Expo claims to also let an app run seamlessly on the web . Anyway, as it turns out (surprise surprise – not!), neither of those claims are particularly aligned with…

Sea level rise is gonna get a whole lot realer

I was alarmed to recently learn that plenty of folks out there on the interwebz don't believe that the seas have risen, at all, for several centuries. Although, in hindsight, I shouldn't be surprised: after all, there's no shortage of climate change deniers out there, and sea level rise is very (although not completely) interconnected with climate change. To be fair to those folks, it's true that…

Introducing: World Locality Transit Graph

I built a dataset and map visualisation called the World Locality Transit Graph . Source code is on GitHub . It's a map of approximate transit times between any two given localities in various parts of the world. World Locality Transit Graph showing the dataset for Eastern Australia About the graph (Note: this section is copied from the README that can be seen on GitHub.) A "locality", for the…

Introducing: Floyd-Warshall CSV Generator

I built a little Python script called the Floyd-Warshall CSV Generator . It takes a CSV of graph edges as input, and generates a CSV of the edges that are the shortest paths between all pairs of vertices. The script is a simple wrapper of the SciPy floyd_warshall function , which in turn implements the Floyd-Warshall Algorithm . Hope you find it useful for all your directed (or undirected)…

On FastAPI

Over the past year or two, I've been heavily using FastAPI in my day job. I've been around the Python web framework block, and I gotta say, FastAPI really succeeds in its mission of building on the strengths of its predecessors (particularly Django and Flask ), while feeling more modern and adhering to certain opinionated principles. In my opinion, it's pretty much exactly what the best-in-breed…

What (I think) the Voice is all about

A few weeks ago, I had my first and only conversation with an ardent "No" campaigner for the upcoming Australian referendum on the Voice to Parliament. (I guess we really do all live in our own little echo chambers , because all my close friends and family are in the "Yes" camp just like me, and I was genuinely surprised and caught off guard to have bumped into a No guy, especially smack-bang in…

Ozersk: the city on the edge of plutonium

Ozersk (also spelled Ozyorsk) – originally known only by the codename Chelyabinsk-40 – is the site of the third-worst nuclear disaster in world history, as well as the birthplace of the Soviet Union's nuclear weapons arsenal. But I'll forgive you if you've never heard of it (I hadn't, until now). Unlike numbers one ( Chernobyl ) and two ( Fukushima ), the USSR managed to keep both the…

GDPR-compliant Google reCAPTCHA

Per the EU's GDPR and ePrivacy Directive , you must ask visitors to a website for their consent before setting any cookies, and/or before collecting any user tracking data. And because the GDPR applies to all EU citizens (who are residing within the EU), regardless of where in the world a website or its owner is based, in order to fully comply, in practice you should seek consent for all visitors…

Introducing: Instant-runoff voting simulator

I built a simulator showing how instant-runoff voting (called preferential voting in Australia) works step-by-step. Try it now . The simulator in action I hope that, by being an interactive, animated, round-by-round visualisation of the ballot distribution process, this simulation gives you a deeper understanding of how instant-runoff voting works. The rules coded into the simulator, are those…

Scott Morrison is not keen on ABC interviews

Scott Morrison surprised the fine folks over at the national broadcaster recently, by turning down their invitation for a pre-election debate with Anthony Albanese , instead choosing to have all three of his televised debates take place on commercial channels . I have also made the casual observation, over the last three years, that Morrison makes few appearances on Aunty in general, compared with…

Is Australia supporting atrocities in West Papua?

A wee lil' fact check style analysis of The Juice Media 's 2018 video Honest Government Ad: Visit West Papua . Not that I don't love TJM's videos (that would be un-Australien !). Just that a number of the claims in that particular piece took me by surprise. Nobody (except Indonesia!) is disputing that an awful lot of bad stuff has happened in Indonesian Papua over the last half-century or so, and…

On the Proof of Humanity project

Proof of Humanity (PoH) is a project that I stumbled upon a few weeks ago. Its aim is to create a registry of every living human on the planet. So far, it's up to about 15,000 out of 7 billion. Just for fun, I registered myself , so I'm now part of that tiny minority who, according to PoH, are verified humans! (Sorry, I guess the rest of you are just an illusion). Actual bona fide humans This is a…

Introducing: Hack Your Bradfield Vote

I built a tiny site, that I humbly hope makes a tiny difference in my home electorate of Bradfield, this 2022 federal election. Check out Hack Your Bradfield Vote . How "Hack Your Bradfield Vote" looks on desktop and mobile I'm not overly optimistic, here in what is one of the safest Liberal seats in Australia. But you never know, this may finally be the year when the winds of change rustle the…

I don't need a VPS anymore

I've paid for either a "shared hosting" subscription, or a VPS subscription, for my own use, for the last two decades. Mainly for serving web traffic, but also for backups, for Git repos, and for other bits and pieces. But, as of now, it's with bittersweet-ness that I declare, that that era in my life has come to a close. No more (personal) server that I wholly or partially manage. No more SSH'ing…

Email-based comment moderation with Netlify Functions

The most noteworthy feature of the recently-launched GreenAsh v5 , programming-wise, is its comment submission system. I enjoyed the luxury of the robust batteries-included comment engines of Drupal and Django , back in the day; but dynamic functionality like that isn't as straight-forward in the brave new world of SSG's . I promised that I'd provide a detailed run-down of what I built, so here…

Introducing GreenAsh 5

After a solid run of twelve years, I've put GreenAsh v4 out to pasture, and I've launched v5 to fill its plush shoes. Sporting a simple, readable, mobile-friendly design. GreenAsh v5 marks the culmination of my continuing mission , to convert over all of my personal sites, and all of the other sites that I still host slash maintain, to use a Static Site Generator (SSG) . As with some other sites…

The lost Armidale to Wallangarra railway

Running more-or-less alongside the most remote section of the New England Highway , through the Northern Tablelands region of NSW, can be found the remnants of a once-proud train line. The Great Northern Railway , as it was known in its heyday, provided the only railway service linking Sydney and Brisbane, between 1889 and 1930. Regular passenger services continued until 1972, and the line has…

Japan's cherry blossom: as indisputable as climate change evidence gets

This year, Japan's earliest cherry blossom in 1,200 years made headlines around the world . And rightly so. Apart from being (as far as I can tell) a truly unparalleled feat of long-term record-keeping, it's also a uniquely strong piece of evidence in the case for man-made climate change. I think this graph speaks for itself. Image source: BBC News I just want to briefly dive in to the data set…

On Tina

Continuing my foray into the world of Static Site Generators (SSGs), this time I decided to try out one that's quite different: TinaCMS (although Tina itself isn't actually an SSG, it's just an editing toolkit; so, strictly speaking, the SSG that I took for a spin is Next.js ). Shiny new toys. The latest and greatest that the JAMstack has to offer. Very much all alpha (I encountered quite a few…

Introducing: Is Pacific Highway Upgraded Yet?

Check out this fun little site that I just built: Is Pacific Highway Upgraded Yet? Spoiler alert: no it's not! I got thinking about this, in light of the government's announcement at the end of 2020 that the Pacific Highway upgrade is finished . I was like, hang on, no it's not! How about a web site to tell people how long we've already been waiting for this (spoiler alert: ages!), and how much…

On Eleventy

Following on from my last experiment with Hugo , I decided to dabble in a different static site generator (SSG). This time, Eleventy . I've rebuilt another one of my golden oldies, Jaza's World , using it. And, similarly, source code is up on GitHub, and the site is hosted on Netlify . I'm pleased to say that Eleventy delivered in the areas where Hugo disappointed me most, although there were…

On Hugo

After having it on my to-do list for several years, I finally got around to trying out a static site generator (SSG). In particular, Hugo . I decided to take Hugo for a spin, by rebuilding one of my golden oldies, Jaza's World Trip , with it. And, for bonus points, I published the source code on GitHub, and I deployed the site on Netlify . Hugo is great software with a great community , however it…

Private photo collections with AWSPics

I've created a new online home for my formidable collection of 25,000 personal photos. They now all live in an S3 bucket, and are viewable in a private gallery powered by the open-source AWSPics . In general, I'm happy with the new setup. For the past 15 years, I have painstakingly curated and organised my photos on Flickr. I have no complaints or regrets: Flickr was and still is a fantastic…

Good devs care about code

Theories abound regarding what makes a good dev. These theories generally revolve around one or more particular skills (both "hard" and "soft"), and levels of proficiency in said skills , that are " must-have " in order for a person to be a good dev. I disagree with said theories. I think that there's only one thing that makes a good dev, and it's not a skill at all. It's an attitude . A good dev…

Tolstoy: the forgotten philosopher

I recently finished reading the classic novel War and Peace . The 19 th -century epic is considered the masterpiece of Leo Tolstoy , and I must say it took me by surprise. In particular, I wasn't expecting its second epilogue , which is a distinct work of its own (and one that arguably doesn't belong in a novel): a philosophical essay discussing the question of " free will vs necessity". I know…

How can we make AI that reasons?

The past decade or so has been touted as a high point for achievements in Artificial Intelligence ( AI ). For the first time, computers have demonstrated formidable ability in such areas as image recognition , speech recognition , gaming , and (most recently) autonomous driving / piloting. Researchers and companies that are heavily invested in these technologies, at least, are in no small way…

The eccentric tale of Gustave Eiffel and his Tower

The Eiffel Tower , as it turns out, is far more than just the most iconic tourist attraction in the world. As the tallest structure ever built by man at the time – and holder of the record " tallest man-made structure in the world " for 41 years, following its completion in 1889 – it was a revolutionary feat of structural engineering. It was also highly controversial – deeply…

Twelve ASX stocks with record growth since 2000

I recently built a little web app called What If Stocks , to answer the question: based on a start and end date, and a pool of stocks and historical prices, what would have been the best stocks to invest in? This app isn't rocket science, it just ranks the stocks based on one simple metric: change in price during the selected period. I imported into this app, price data from 2000 to 2018, for all…

DNA: the most chaotic, most illegible, most mature, most brilliant codebase ever

As a computer programmer – i.e. as someone whose day job is to write relatively dumb, straight-forward code, that controls relatively dumb, straight-forward machines – DNA is a fascinating thing. Other coders agree . It has been called the code of life , and rightly so: the DNA that makes up a given organism's genome , is the set of instructions responsible for virtually everything…

Mobile phone IMEI whitelisting in Chile and elsewhere

Shortly after arriving in Chile recently, I was dismayed to discover that – due to a new law – my Aussie mobile phone would not work with a local prepaid Chilean SIM card, without me first completing a tedious bureaucratic exercise . So, whereas getting connected with a local mobile number was previously something that took about 10 minutes to achieve in Chile, it's now an endeavour…

A lightweight per-transaction Python function queue for Flask

The premise: each time a certain API method is called within a Flask / SQLAlchemy app (a method that primarily involves saving something to the database), send various notifications, e.g. log to the standard logger, and send an email to site admins. However, the way the API works, is that several different methods can be forced to run in a single DB transaction, by specifying that SQLAlchemy only…

How successful was the 20th century communism experiment?

During the course of the 20 th century, virtually every nation in the world was affected , either directly or indirectly, by the "red tide" of communism. Beginning with the Russian revolution in 1917 , and ostensibly ending with the close of the Cold War in 1991 (but actually not having any clear end, because several communist regimes remain on the scene to this day), communism was and is the…

Using Python's namedtuple for mock objects in tests

I have become quite a fan of Python's built-in namedtuple collection lately. As others have already written, despite having been available in Python 2.x and 3.x for a long time now, namedtuple continues to be under-appreciated and under-utilised by many programmers. # The ol fashioned tuple way fruits = [ ( banana , medium , yellow ), ( watermelon , large , pink )] for fruit in fruits:…

The Jobless Games

There is growing concern worldwide about the rise of automation , and about the looming mass unemployment that will logically result from it. In particular, the phenomenon of driverless cars – which will otherwise be one of the coolest and the most beneficial technologies of our time – is virtually guaranteed to relegate to the dustbin of history the "paid human driver", a vocation…

Ten rival national top cities of the world

Most countries have one city which is clearly top of the pops. In particular, one city (which may not necessarily be the national capital) is usually the largest population centre and the main economic powerhouse of a given country. Humbly presented here is a quick and not-overly-scientific list of ten countries that are an exception to this rule. That is, countries where two cities (or more!) vie…

Orientalists of the East India Company

The infamous East India Company , "the Company that Owned a Nation", is remembered harshly by history. And rightly so. On the whole, it was an exploitative venture, and the British individuals involved with it were ruthless opportunists. The Company's actions directly resulted in the impoverishment, the subjugation, and in several instances the death of countless citizens of the Indian…

Where is the official centre of Sydney?

There are several different ways of commonly identifying the "official centre point" of a city. However, there's little international consensus as to the definition of such a point, and in many countries and cities the definition is quite vague. Most reliable and most common, is to declare a Kilometre Zero marker as a city's (and often a region's or even a country's) official centre. Also popular…

Where there be no roads

And now for something completely different , here's an interesting question. What terra firma places in the world are completely without roads? Where in the world will you find large areas, in which there are absolutely no official vehicle routes? A road (of sorts) slowly being extended into the vast nothingness of Siberia. Image source: Favourite picture: Road construction in Siberia –…

Running a real Windows install in VirtualBox on Linux

Having a complete Windows (or Mac) desktop running within Linux has been possible for some time now, thanks to the wonders of Virtual Machine (VM) technology. However, the typical approach is to mount and boot a VM image, where the guest OS and hard disk are just files on the host filesystem. In this case, the guest OS can't be natively booted and run, because it doesn't occupy its own disk or…

Introducing Flask Editable Site

I'd like to humbly present Flask Editable Site , a template for building a small marketing web site in Flask where all content is live editable. Here's a demo of the app in action . Text and image block editing with Flask Editable Site. The aim of this app is to demonstrate that, with the help of modern JS libraries, and with some well-thought-out server-side snippets, it's now perfectly possible…

Cookies can't be more than 4KiB in size

Did you know: you can't reliably store more than 4KiB (4096 bytes) of data in a single browser cookie? I didn't until this week. What, I can't have my giant cookie and eat it too? Outrageous! Image source: Giant Chocolate chip cookie recipe . I'd never before stopped to think about whether or not there was a limit to how much you can put in a cookie. Usually, cookies only store very small string…

Robert Dawson: the first anthropologist of Aborigines?

The treatment of Aboriginal Australians in colonial times was generally atrocious . This is now well known and accepted by most . Until well into the 20 th century, Aborigines were subjected to exploitation, abuse, and cold-blooded murder . They were regarded as sub-human, and they were not recognised at all as the traditional owners of their lands. For a long time, virtually no serious attempts…

Splitting a Python codebase into dependencies for fun and profit

When the Python codebase for a project (let's call the project LasagnaFest ) starts getting big, and when you feel the urge to re-use a chunk of code (let's call that chunk foodutils ) in multiple places, there are a variety of steps at your disposal. The most obvious step is to move that foodutils code into its own file (thus making it a Python module ), and to then import that module wherever…

Generating a Postgres DB dump of a filtered relational set

PostgreSQL is my favourite RDBMS, and it's the fave of many others too. And rightly so: it's a good database! Nevertheless, nobody's perfect. When it comes to exporting Postgres data (as SQL INSERT statements, at least), the tool of choice is the standard pg_dump utility. Good ol' pg_dump is rock solid but, unfortunately, it doesn't allow for any row-level filtering. Turns out that, for a recent…

Storing Flask uploaded images and files on Amazon S3

Flask is still a relative newcomer in the world of Python frameworks (it recently celebrated its fifth birthday); and because of this, it's still sometimes trailing behind its rivals in terms of plugins to scratch a given itch. I recently discovered that this was the case, with storing and retrieving user-uploaded files on Amazon S3 . For static files (i.e. an app's seldom-changing CSS, JS, and…

Five long-distance and long-way-off Australian infrastructure links

Australia. It's a big place. With only a handful of heavily populated areas. And a whole lot of nothing in between. No, really. Nothing. Image source: Australian Outback Buffalo Safaris . Over the past century or so, much has been achieved in combating the famous Tyranny of Distance that naturally afflicts this land. High-quality road , rail , and air links now traverse the length and breadth of…

Conditionally adding HTTP response headers in Flask and Apache

For a Flask -based project that I'm currently working on, I just added some front-end functionality that depends on Font Awesome . Getting Font Awesome to load properly (in well-behaved modern browsers) shouldn't be much of a chore. However, my app spans multiple subdomains (achieved with the help of Flask's Blueprints per-subdomain feature ), and my static assets (CSS, JS, etc) are only served…

Forgotten realms of the Oxus region

In classical antiquity , a number of advanced civilisations flourished in the area that today comprises parts of Turkmenistan, Uzbekistan, Tajikistan, and Afghanistan. Through this area runs a river most commonly known by its Persian name, as the Amu Darya . However, in antiquity it was known by its Greek name, as the Oxus (and in the interests of avoiding anachronism , I will be referring to it…

First experiences developing a single-page JS-driven web app

For the past few months, my main dev project has been a custom tool that imports metric data from a variety of sources (via APIs), and that generates reports showing that data in numerous graphical and tabular formats. The app is private (and is still in alpha), so I'm afraid I can't go into more detail than that at this time. I decided (and I was encouraged by stakeholders) to build the tool as a…

Mixing GData auth with Google Discovery API queries

For those of you who have some experience working with Google's APIs, you may be aware of the fact that they fall into two categories : the Google Data APIs , which is mainly for older services; and the discovery-based APIs , which is mainly for newer services. There has been considerable confusion regarding the difference between the two APIs. I'm no expert, and I admit that I too have fallen…