-
π§βπ» New post on TIL Computer: Link: Probably Avoid Relying On Error Codes To Optimistically Insert In Postgres
-
π§βπ» New post on TIL Computer: Donβt Use βTβ RDS Instance Types For Production
-
π§βπ» New post on TIL Computer: Feedback Of Conditional Updates In PostgreSQL
-
π§βπ» New post on TIL Computer: Slow NATS Go Subscribers
-
π§βπ» New post on TIL Computer: psql Techniques
-
Weekly Update - 20 Oct 2024
Yeah, I know, it’s been a whileβ¦ again. A lot has been happening in life and there’ve been many days that I haven’t done any work on anything. Things are starting to settle down now, although I am expecting a few more bumpy days ahead, so we’ll see how we go with project work.
Cyber Burger
Yeah, I’m getting pretty tired of this one. I’m right in the trough of despair here, where the initial excitement has worn off and I just want to finish it. All the remaining work for it has been defined, which I think helps, and now it’s just a matter of plowing through the tasks.
Continue reading β -
π§βπ» New post on TIL Computer: Exporting a Query as a CSV File From PostgreSQL
-
π§βπ» New post on TIL Computer: HTMX And POST Redirects
-
Project Updates
Well, it’s been three weeks since my last post here, and as hard as it was to write this update, not writing it would’ve been harder. So let’s just skip the preamble and go straight to the update.
Cyber Burger (That Pico-8 Game)
I’m terrible at being coy, I’ll just spill the beens. That game I’ve been working on is call Cyber Burger. It’s based on a DOS game I saw on YouTube, and it seemed like a fun project to try and work on, with some tweaks to the gameplay that I think would make it more forgiving.
Continue reading β -
Simplifying UCL
I’ve been using UCL for several days now in that work tool I mentioned, and I’m wondering if the technical challenge that comes of making a featureful language is crowding out what I set out to do: making a useful command language that is easy to embed.
So I’m thinking of making some simplifications.
The first is to expand the possible use of pipes. To date, the only thing that can travel through pipes are streams. But many of the commands I’ve been adding simply return slices. This is probably because there’s currently no “stream” type available to the embedder, but even if there was, I’m wondering if it make sense to allow the embedder to pass slices, and other types, through pipes as well.
Continue reading β -
Imports And The New Model
Well, I dragged Photo Bucket out today to work on it a bit.
It’s fallen by the wayside a little, and I’ve been wondering if it’s worth continuing work on it. So many things about it that need to be looked at: the public site looks ugly, as does the admin section; working with more than a single image is a pain; backup and restore needs to be added; etc.
Continue reading β -
UCL: First Embed, and Optional Arguments
Came up with a name: Universal Control Language: UCL. See, you have TCL; but what if instead of being used for tools, it can be more universal? Sounds so much moreβ¦ universal, am I right? π
Yeah, okay. It’s not a great name. But it’ll do for now.
Anyway, I’ve started integrating this language with the admin tool I’m using at work. This tool I use is the impetus for this whole endeavour. Up until now, this tool was just a standard CLI command usable from the shell. But it’s not uncommon for me to have to invoke the tool multiple times in quick succession, and each time I invoke it, it needs to connect to backend systems, which can take a few seconds. Hence the reason why I’m converting it into a REPL.
Continue reading β -
Adding A Sidebar To A Tiny Theme Micro.blog
This is now a standalone Micro.blog Plugin called Sidebar For Tiny Theme which adds support for this out of the box. The method documented below no longer works, but I'm keeping it here for posterity reason.
I’d though I’d write a little about how I added a sidebar with recommendations to my Tiny Theme’ed Micro.blog, for anyone else interested in doing likewise. For an example on how this looks, please see this post, or just go to the home page of this site.
Continue reading β -
Photo Bucket Galleries and Using the HTML Popover API
Spent a bit more on Photo Bucket this evening. Tonight I started working on galleries, which’ll work more or less like albums.
At the moment you can create a gallery and add a photo to it. Most of the work so far has been backend so the UI is pretty rough. Eventually you’ll be able to do things like rearrange photos within galleries, but for the moment they’ll just be added to the end.
Continue reading β -
π Apple Watch Series 9 and Ultra 2 Ban Takes Effect; Apple Appeals
The ITCβs ruling was subject to a potential veto by U.S. President Biden by December 25th, but today, the Office of the U.S. Trade Representative issued a statement that it has decided against vetoing the ITC ruling, meaning that the ruling is now final.
It seems odd to me that Apple was expecting a reprieve from the White House over this patient dispute with Masimo. Issuing a veto looks like choosing one US company over another. Doesnβt seem like good political optics to me. Maybe it seemed to Apple it was worth a shot. π€·ββοΈ
-
Overhead someone say, in not so many words, that my UI design for something was sub-par. π Sad, but can’t deny that it’s true to a degree. Acknowledged area of potential development, I guess.
-
It’s amazing what a difference going to the gym can make. This afternoon I was feeling so lethargic, like all I wanted to do was crawl into bed. But I decided to crawl to the gym instead. I really didn’t want to, and I usually don’t go Mondays so I had an excuse not to. But I’m so glad I did because afterwards I got my energy back and I was eager to just do stuff.
Partial credit goes to coffee. It also helped with getting over the slump.
-
To Wordpress Or Not To Wordpress
I’m facing a bit of a dilemma.
I’ve been asked to setup a new website for someone who wants to stand up a new business. In therory this is something that I can do quite easily. I know HTML and CSS. I’ve made a living building backends for web-apps. I do have an undeveloped eye for design, but I like to think I have an idea of the principal of good website usability; and as long as I’m not too ambitious, and aim for a minimal usable site, I can probably put together a simple static website.
Continue reading β -
I was listening to an episode of Sharp Tech the other day. When the conversation moved on to AI and Ben Thompson’s experience with Sydney, an idea for a game came to me.
It’ll essentially be a text adventure, but the goal is to try to get a GPT AI to play it. The AI would give you a description of what it “sees” on their screen, and you have to tell it how to proceed. You can’t enter the commands yourself. Except, you have to use natural language to guide the AI through the game.
Maybe in the harder difficulty levels the AI could disagree with you and you’ll need to convince it to do what you say. Or maybe it’ll give you partial information about what it “sees”. It can say that it sees a castle, but doesn’t explain that there’s a gate-house as well, and you have to tease this information out of it in order to move forward.
This sort of harkens back to the time when you’re playing a game for the first time with someone that’s experienced, and they’re telling you what to do1. Here, you’re that experienced player giving assistance, even though you’ve never played the game yourself.
Anyway, free idea for anyone who wants it.
-
Or maybe those times when you’re trying to give tech support over the phone. Those are fun, right? Well, what better way to spend your downtime than playing a simulation of that. π ↩︎
-
-
Spotify Video Follow-up
Some follow-up from my post about Spotify videos. I looked into this a little and from what I understand they’re not full videos but “short looping video clips that play during certain songs,” at least according to this website.
So I guess my initial belief is incorrect. Spotify might have music videos (they’re a bunch of articles about them thinking about it in 2020-21) but this looks to be completely different.
Furthermore, you can turn them off. They’re called “Canvas Video Clips”, and if you go into the preferences of the Android mobile app, sure enough there’s a switch for them.
Continue reading β -
Finally bit the bullet and got scripting working in Dynamo-Browse. It’s officially in the tool, at least in the latest development version. It’s finally good to see this feature implemented. I’ve been waffling on this for a while, as the last several posts can attest, and it’s good to see some decisions made.
In the end I went with Tamarin as the scripting language. It was fortunate that the maintainer released version 1.0 just as I was about to merge the scripting feature branch into
main. I’ve been trying out the scripting feature at work and so far I’ve been finding it to work pretty well. It helps that the language syntax is quite close to Go, but I also think that the room to hide long-running tasks from the user (i.e. no promises everywhere) dramatically simplifies how scripts are written.As for the runtime, I decided to have scripts run in a separate go-routine. This means they don’t block the main thread and the user can still interact with the tool. This does mean that the script will need to indicate when a long running process is occurring β which they can do by displaying a message in the status line β but I think this is a good enough tradeoff to avoid having a running script lock-up the app. I still need to add a way for the user to kill long-running scripts (writing a GitHub ticket to do this now).
At the moment, only one script can run at any one time, sort of like how JavaScript in the browser works. This is also intentional, as it will prevent a whole bunch of scripts launching go-routines and slowing down the user experience. I think it will help in not introducing any potential synchronisation issues with parallel running scripts accessing the same memory space. No need to build methods in the API to handle this. Will this mean that script performance will be a problem? Not sure at this stage.
I’m also keeping the API intentionally small at this stage. There are methods to query a DynamoDB table, get access to the result set and the items, and do some basic UI and OS things. I’m hoping it’s small enough to be useful, at least at the start, without overwhelming script authors or locking me into an API design. I hope to add methods to the API over time.
Anyway, good to see this committed to.
-
First post of 2023. If current trends are to be maintained, I better get posting right away. π
Happy new year.
-
Audax Toolset Version 0.1.0
Audax Toolset version 0.1.0 is finally released and is available on GitHub. This version contains updates to Dynamo-Browse, which is still the only tool in the toolset so far.
Here are some of the headline features.
Adjusting The Displayed Columns
Consider a table full of items that look like the following:
pk S 00cae3cc-a9c0-4679-9e3a-032f75c2b506 sk S 00cae3cc-a9c0-4679-9e3a-032f75c2b506 address S 3473 Ville stad, Jersey , Mississippi 41540 city S Columbus colors M (2 items) door S MintCream front S Tan name S Creola Konopelski officeOpened BOOL False phone N 9974834360 ratings L (3 items) 0 N 4 1 N 3 2 N 4 web S http://www.investorgranular.net/proactive/integrate/open-sourceLet’s say you’re interested in seeing the city, the door colour and the website in the main table which, by default, would look something like this:
Continue reading β -
Here’s today’s instalment of Why Didn’t I Think of This Soonerβ’.
I’ve got into the habit of squashing commits before I push them as part of a pull request. In order to run the command I use to do this β
git rebase -i HEAD~nβ I need to know the number of commits I want to squash (this will be the value of n).Fortunately, I’ve got into the habit of prefixing each commit message with the Jira task number. For example, I may write a commit message with the first line being
ABC-123: fixed a bug in the thing, followed by a more detailed list of changes. I do for every commit, even for those “checkpoint commits” I make before changing branches.So all I need to do to get the number of commits I need to squash is to simply count up all the commits that start with the Jira task number. For all this time, the way I do this is to run
git logto open up the history in Vim, and manually count the number of commit messages that began with the particular Jira task number.Today, I remembered that I could use a shell pipeline to do the same thing:
git log | grep ABC-123 | wc -lwhich would save me stack-loads of time and potential mistakes.
Wish I thought of this sooner. π€¦
-
Adding A Back-Stack To Dynamo-Browse
Spent some more time working on dynamo-browse, this time adding a back-stack. This can be used to go back to the previously viewed table, query or filter by pressing the Backspace key, kind of like how a browser back button works.
This is the first feature that makes use of a workspace, which is a concept that I’ve been thinking about since the start of the project. A workspace is basically a file storing various bits of state that could be recalled in future launches of the tool. A workspace is always created, even if one is not explicitly specified by the user. The workspace filename be set by using the
Continue reading β-wswitch on launch, or if one is not specified, then a new workspace filename within the temp directory is generated. The workspace file itself is a Bolt database, which is a very simple, embeddable key/value store that uses B-Trees and memory-mapped data access. I’m actually using StormDB to access this file, since it provides a nice interface for storing and querying Go structs without having to worry about marshalling or unmarshalling. -
Release Preparation & Next Steps
Finally finished the website for the Audax toolset and cut an initial release (v0.0.2). I’ve also managed to get binary releases for Linux and Windows made. I’ve started to work on binary releases for MacOS with the intention of distributing it via Homebrew. This is completely new to me so I’m not sure what progress I’ve made so far: probably nothing. For one thing, I’ll need a separate machine to test with, since I’ve just been installing them from source on the machine’s I’ve been using. Code signing is going to be another thing that will be fun to deal with.
Continue reading β -
Time and Money
Spending a lot of time in Stripe recently. It’s a fantastic payment gateway and a pleasure to use, compared to something like PayPal which really does show its age.
But it’s so stressful and confusing dealing with money and subscriptions. The biggest uncertainty is dealing with anything that takes time. The problem I’m facing now is if the customer chooses to buy something like a database, which is billed a flat fee every month, and then they choose to buy another database during the billing period, can I track that with a single subscription and simply adjust the quantity amount? My current research suggests that I can, and that Stripe will handle the prorating of partial payments and credits. They even have a nice API to preview the next invoice which can be used to show the customer how much they will be paying for.
Continue reading β -
On Apple's Media Release Gymnastics
I started listening to the latest Talk Show, where John Gruber and MG Siegler discuss Apple’s media release of the class action settlement. Releasing it to the major media outlets in such a way as to spin the guideline clarification as a concession to developers, even though nothing has actually change, is genius if true. I imagine that’s why Apple’s PR department get the big bucks.
But I wonder if Apple has considered the potential blowback of this approach. I might be naive here, but I can’t help wonder whether these media outlets publishing that Apple hasn’t actually conceded anything will eventually realised that they have been had. Would that affect the relationship between the two in any way? Say Apple wants to publish some good news and expect these outlets to maintain the favourable air of their release. Would they do it?
Continue reading β -
Seeking Out Bad News
Sometimes I wonder if Iβm just going out of the way to seek bad news. Maybe itβs because I think that if I donβt, then a problem will go unaddressed as no-one else is aware of it.
Thereβs probably some evolutionary trait to this. Being the one that hears a predator, and reacts to it before anyone else, is an advantage. But in this day and age, many of the problems that I have anxiety about is pretty much known by everyone, and addressing it in any meaningful way is beyond my direct control.
Continue reading β -
The interesting thing about technology breakthroughs is how quickly the shift from the impossible to the banal actually is. An example of this is machine learning. This was something that was being researched on since the 1950s, with very little to show for it in terms of practical applications. This changed very recently, thanks to the growth of computing power. Now, many of these same techniques are used in many things that are taken for granted, like language translation, image recognition, and surfacing content in algorithmic timelines of social networks (not all utilisation of this technology is good).
This was one of the first thoughts I had when I heard about the announcement of a potential vaccine for malaria, which uses very similar technology to the mRNA Covid-19 vaccines.
-
Empty HTTP Headers in Go
Here is a technique for checking for the presence of a HTTP header in a Go request, even if the header has no value.
If there’s a header in a HTTP request that has no value, the parser used by Go will store the header against an empty string value. This string value is available using the
Continue reading βValues()method: using theGet()method will not work as that will return an empty string if the header is not present in the request, make it ambiguous for existential tests if empty header values are allowed. -
Dealing With Errors in Go
There’s a lot to like about Go, and I’ll happily admit being a huge fan of the language. But it will be dishonest of me not to acknowledge that some aspects of programming in Go results in more code than the equivalent in another language. My guess is that the best example of this is how Go programs deal with errors.
For those unfamiliar with how errors work in Go, the short version is that they are just like any other type that you deal with — like strings and integers — and they have no special control structure to handle them in any specific way. This means that, unlike languages that have exceptions, there is nothing like try/catch blocks; you are left with the standard control statements that are available.
Continue reading β -
Over the last few weeks, while Melbourne has been under lock-down to drive the Covid-19 cases down, the government has been ramping up it’s contact tracing infrastructure. It’s been quite flaky at the start but from what I hear now on Coronacast it’s in a pretty decent state. It has delt with outbreaks in both Kilmore and Shepparton, two regional cities here in Victoria.
Now the real test comes, with the potential of an outbreak at a school here in the north of Melbourne, a few days before restrictions are lifted. From what I’m reading, it looks like the testing and contact tracing infrastructure has moved in quite rapidly. The school has closed due to a precaution, popup testing sites have been deployed, and some 300 people have been told to self-isolate.
We’ll see how this goes over the coming days. If all goes well, then I will have greater confidence that the Vic government will be able to handle these outbreaks and we can move to Covid-normal like the rest of the country.
P.S. Only 5 cases today. This is a little higher than the 1 to 2 that we’ve been experiencing over the last week or so, but still quite good.
-
Let's hold the line, Melbourne. We've got this.
Today is a good day. Melbourne’s 14 day daily Covid-19 case average is now 29.4, which is beyond the 30 to 50 band required to move to the next stage of reopening. Seeing the fruits of our collective sacrifice, bringing the daily case numbers from a peak of around 740 in August down to the 11 we saw on Monday, makes me proud to be a Melburnian.
As much as I like for things to reopen sooner than planned, I think we should hold the line for as long as we possibly can. The potential prizes for doing so – the crushing of the virus, the ability to travel interstate again, the chance to eat at restaurants without fear of infection, the chance for a normalish Christmas and summer – are within reach. I know that’s easy for me to say as someone who has the ability to work from home, and I completely recognise those of us suffering right now being unable to work at all. But just like the darkest hour is before the dawn, so too will the sweet taste of victory and accomplishment be when we finally crush this virus and meet the rest of the country where they are. To rush this, to reopen too early, and see our effort thrown away would be upsetting.
Continue reading β -
On Suppression vs. Elimination
It was around the beginning of June, when the number of new Covid-19 cases for Victoria were around 10-20 a day, that there was a general feeling that suppression was working and that it was time to begin opening up. I will admit I took advantage of the looser restrictions, but I always wondered whether it would be better to remain closed for a little while longer and go for elimination. This was not the official strategy though: we have testing and tracing up and running and as long as we know where the virus is, we can continue to roll-back restrictions and achieve some semblance of normalcy.
Continue reading β -
Don't Get it Now
It’s scary times at the moment. The Corona Virus (SARS-CoV-2 and Covid-19) is raging through Europe at this moment, with hundreds of people dying in Italy, Spain and France and most of the those countries, along with the US, in lock-down. The hospital system is currently not equipped to be able to handle the peak number of patients that will require intensive care: doctors from Italy, France and New York are telling stories about how they have to choose who lives and dies, and I’m fearful that we may start hearing stories like that here. There is currently no cure, nor no treatment. There’s been models indicating that even if we take steps to suppress the virus now, there will be continuous surges in outbreaks until a vaccine is ready in 12 to 18 months, suggesting that we may need to be in a state of lock-down or at the very least, rigid social distancing until August 2021 at the latest. The WHO reckons that a majority of the worlds population will get infected over the next year.
Continue reading β