A ridiculously easy way to fill out SVG templates with Python

Posted by on 31 Jul 2022 | Tagged as: Python, robobait, software engineering

I recently started a filing project. It requires labels printed on slips of paper, each with a name and ID number in nice big letters. I authored my labels in the SVG graphics format. But editing SVG files for each label is impractical, so I searched for a way to treat the SVG as a template, and fill it out with a spreadsheet of data. I found a ridiculously easy way to do it in Python — with only 9 lines of clever code.

Continue Reading »

Multiple branches at once: git worktree or big sister

Posted by on 30 Jun 2022 | Tagged as: robobait, software engineering, technical support

A while ago, I was working on a software development project which kept several version branches active in its source code repository. Their team checked in changes rapidly, as I puttered away on my part of the code. I was swamped by the effort of pulling their changes, branch by branch. So I found one way to make it easier: the git worktree feature. I set up another way: the “big sister” repository. Let me describe them to you. Maybe it will help you with your projects.

Continue Reading »

Improvising a pill organiser from a toilet paper roll

Posted by on 31 May 2022 | Tagged as: miscellaneous

The organiser

This was a modest little idea, but it was easy and it worked well. I recently needed to take a medication four times a day. I wanted a way to remind myself which doses I had already taken, and which was the next to take. Using only an empty toilet paper roll and a marker, I improvised an organiser that met the need. This is what I made, and how I used it. Maybe you will find the idea useful.

Continue Reading »

A tale of cascading open source tasks: MacPorts documentation

Posted by on 30 Apr 2022 | Tagged as: software engineering, web technology

All I wanted to do was to add a mention of Github changeset links to the MacPorts documentation.

I like contributing to free software projects. One way I pick which specific contribution to make, is that I recall something which was an obstacle for me. I come up with a change which would reduce that obstacle. I look through the project’s open source for how to make that change. Then I make a pull request, or submit a patch, which contains that change.

Sometimes, in order to make the change, I need to learn the tools or languages which that project uses for its code or documentation. That can lead to a cascade of subsidiary tasks or related changes. This is a story of that happening to a ridiculous degree, about 20 months ago.

Continue Reading »

How to resolve “warning: The macro `AC_PROG_LIBTOOL’ is obsolete.”

Posted by on 31 Mar 2022 | Tagged as: robobait, technical support

If you encounter a message, “warning: The macro 'AC_PROG_LIBTOOL' is obsolete“, when running an autogen.sh script in a software project which uses GNU Autotools, I may be able to help you understand it. I encountered this message recently, when working on the Freeciv codebase. In short, this message misled me greatly. What it is really saying is that you should replace the macro name 'AC_PROG_LIBTOOL' with the newer name 'LT_INIT'. Because I had a hard time finding clear documentation, I wrote this blog post to be alternative documentation for others in this situation.

Continue Reading »

I adopted Unicode character U+5B57 「字」!

Posted by on 28 Feb 2022 | Tagged as: Japan, language, Unicode, web technology

The Gold Sponsor of U+5B57 「字」

One fun thing I did, late in 2021, was to donate a bit of money to the Unicode Consortium to sponsor U+5B57 「字」, my favourite of their more than 144,000 characters. It is a silly thing, but also a bit noble, and a bit useful, and a bit interesting if one peels back the cover and looks at the mechanisms to which it connects. In other words, it is the sort of thing I like to do.

Continue Reading »

StackOverflow 10K

Posted by on 31 Jan 2022 | Tagged as: i18n, Python, software engineering, technical support, Unicode, web technology

I have been active on StackOverflow for more than twelve years. StackOverflow is a phenomenally successful question and answer website, aimed at software developers seeking technical answers. Part of what makes StackOverflow successful is that it gamifies “reputation”: your reputation goes up when you write good answers, and ask good questions, and otherwise help. On 23 December 2021, my StackOverflow reputation rose past 10,000. This is a gratifying milestone.

I am user Jim DeLaHunt on StackOverflow. I apparently posted my first question there on 23. November, 2009. I asked if anyone could point me to “an XML language for describing file attributes of a directory tree?” I did not get a good direct answer. I did get a reference to the XML-dev email list, which I follow to this day. My first answer was to my own question about the XML language. My first answer to someone else’s question was about three weeks later, and it was about detecting a character encoding.

Over twelve years, I have written 133 answers, most of which languish in obscurity. Three have earned particularly many upvotes (and, between them, over 40% of my reputation):

  1. How to escape apostrophe (‘) in MySql?” This is a pretty simple answer. I suspect that it gets a lot of upvotes because many people ask this question. My answer also has the virtue that it quotes a specific clause in the official documentation to prove that the answer is correct. Not all StackOverflow answers cite reliable sources. This answer has earned 226 votes to date, bringing in over 22% of my total reputation.
  2. Is there a way to pass optional parameters to a function?” This too is a simple answer to a frequently-asked question. I cited an official source in this answer also. This answer has earned 116 votes to date, bringing in over 11% of my total reputation.
  3. What exactly is a “raw string regex” and how can you use it?” I think this is the best answer of the three. It finds a way to clarify a particularly murky area of the Python language, which often baffles people. I think it is easier to understand than the official documentation. This answer has earned 108 votes to date, bringing in over 10% of my total reputation. I think it was a vote on this question which put me over 10,000. I like that.

StackOverflow turns the reputation score into a variety of rankings. They put me in the top 4% for reputation overall. This sounds very impressive, until you learn that I am only 24,308-ranked among all participants. Mind you, there are over 16 million participants. I imagine there is a long, inactive tail, compared to which my small activity looks great.

In a similar vein, StackOverflow ranks me among the top 5% in the topics of “Python” and “MySQL“; the top 10% in “Unicode“; and the top 20% in “Internationalization“, “UTF-8“, and “Django“. That reflects some combination of effort on my part, and flattery due to the long, inactive tail.

I put a lot of work, 8-10 years ago, into answering questions and building my reputation. Now I find that upvotes trickle in for my existing 133 questions. My reputation rises surprisingly steadily, even if I don’t contribute anything new, giving me a kind of StackOverflow pension. But I still get satisfaction from plugging away there every now and again, trying to find a good question and write a clear answer. Maybe, in less than 12 years from now, I might reach StackOverflow 20,000.

Top issues in Universal Acceptance of non-Latin email addresses and domain names (IUC45 session)

Posted by on 31 Oct 2021 | Tagged as: meetings and conferences, Unicode, Universal Acceptance

Two weeks ago was the Internationalization and Unicode Conference. This year is the 45th conference, or IUC45. I delivered a presentation: Top issues in Universal Acceptance of non-Latin email addresses and domain names. Here are my slides.

Continue Reading »

Canadian election mechanics, an immigrant engineer’s view

Posted by on 30 Sep 2021 | Tagged as: Canada, community, Democratic Reform, politics

Canada held a national election 10 days ago. I have watched and voted in US elections for 40 years — first in California, where I spent my early adulthood, and later Washington state. I have been watching elections in Canada for 15 years, since I immigrated in 2005. I first voted here in 2017, after becoming a citizen. But in this election, on 20. September 2021, I served as a poll worker for the first time. This gave me an insider’s view of how this election was run. As an engineer, I love the process and methods in use around me. I can’t resist writing down some of the differences in election mechanics, between this Canadian election, and the California and Washington election mechanics which I have experienced.

One issue. This election was about one issue: electing members to a national Parliament. There were no other races. Nothing from the province or city. By contrast, the US elections I know usually piled multiple races and initiative questions into a single election and a single ballot.

Elections Canada specimen ballot, with fictional candidate names
Sample Canadian national election ballot (Source: Elections Canada training manual)

A small, simple ballot. The ballot was a single slip of paper, slightly larger than the palm of my hand. The only issue was the general election to the Parliament. Canada’s current electoral system, the archaic “First-past-the-post” system, meant that voters at my location voted only on candidates for one electoral district. The above sample has four names, but our ballot had five names.

Very manual ballot marking. A voter filled out the ballot with a pencil or pen. They put an “X” or check-mark or solid fill-in in one of the circles. Then the voter folded the ballot back up, and (after tearing off a stub) put the ballot in the ballot box themselves. By contrast, for Washington elections the voter must fill in a space on the ballot in a way that a scanning machine can read. (The same is true for Vancouver municipal elections.) In California, I sometimes filled in scannable marks on a paper ballot, and sometimes tapped in choices on a voting machine’s computer screen.

One elections office. All the voting in this election, nationwide, was operated by a single office, Elections Canada. A separate organisation, Elections B.C., runs provincial elections, and a city department runs Vancouver municipal elections. By contrast, in both California and Washington, election operations are delegated to county-level elections offices. These offices run elections for municipal, county, statewide, and national races. In the US, I currently vote through the services of the Whatcom County Auditor’s Office.

Very specific geographical ballot boxes. Elections Canada divided the electoral districts into small, local “poll divisions”, each with a specific voting desk and ballot box. I was the Deputy Returning Officer for Poll Division 125 of Electoral District 59034 (Vancouver Centre). This corresponded to two condo towers, one on Robson Street and one on Hamilton Street. People at those addresses voted at my desk. If they waited in line, they waited with their neighbours. People at other addresses voted elsewhere. I was located in a room in the Vancouver Public Library’s main branch. Our room had perhaps 10 voting desks and 12 poll divisions. Some desks and ballot boxes embraced two poll divisions. One curious side effect of this is that some voting desks had long lines, and some had none, depending on how many neighbours turned out to vote. There was no taking the next open voting booth of several equivalents, as in California. And of course, Washington has 100% mail-in voting, so it is much different.

Very voter-friendly rules. As right-wing politicians in various US states try to set up voting rules to exclude participation by citizens they don’t want, it was refreshing to see Elections Canada operate by voter-friendly rules. Voters could register on election day. Voters who had moved but not updated themselves on our registry could update their address on the voter rolls. And in particular…

Voter ID was not evil. In the US, requiring voters to show identification is branded as a right-wing tool for voter suppression. This works by limiting the acceptable identification to a short list which the suppressed voters are less likely to have. In contrast, Elections Canada accepted documents from a long and very flexible list as identification. And, for voters who had none of those documents, they could still vote if another voter vouched for them.

Very manual ballot counting. At the end of the voting day, we closed our doors to voters, and then spent an hour counting the votes in our ballot box by hand. As Deputy Returning Officer, I cut open my corrugated cardboard ballot box, and read each ballot myself. Another poll worker, who had other duties during the day, sat beside me and tallied the votes — and provided a check that I was not misreading. We then recounted and double-checked all ballots. We packaged ballots up into a series of envelopes, by hand, and sealed then signed each. We filled out a paper form with the Statement of the Vote for our poll division, by hand, making three carbonless copies.

Very manual results aggregation. How did the results get to Elections Canada, for aggregation into overall riding results? By the supervisor of my location calling the district office of Elections Canada, then coming to my desk, reading the numbers from my Statement of the Vote form to the district office. There was shouting to be heard over background noise. There was a frustrated repeating of misheard numbers. There was nary a web-hosted tally form in sight.

Security through simplicity, wide delegation, and many eyes. Of the 52,039 ballots cast in Vancouver Centre, 120 were cast in my polling division’s ballot box. I know exactly how many votes each candidate got. One the three copies of the Statement of the Vote form came home with me. And, I was present in the election room all day. All the ballot boxes in the room were sealed and on public display. I have high confidence that there was no gross tampering or ballot-box stuffing at our location. (In contrast to, say, this reporter’s experience at polling places in Tatarstan during the recent Russian election.) I am confident that no voting machine misrecorded votes, because there was no voting machine. I know that voters verified what their ballot said, because the ballot is simple, and each voter controlled the marks on their own ballot. Now there are limits to my confidence. I don’t have visibility into how Elections Canada aggregated my results into the total of 52,039. I wish that I could see a preliminary report of polling division results, to check against what I wrote in my form, before the results are declared final. But overall, I could verify more of the leaf nodes of the election tree in Canada than I could in Washington or California.

A very, very long day. The flip side of simplicity is lots of manual work. The downside (one of many) to holding an election during a pandemic is that many people who would ordinarily take the poll worker job declined. Elections Canada was scrambling for poll workers. My spouse and I signed up in part because we were younger, vaccinated, and thus less at risk; we felt we had a patriotic duty to step in. But they wanted us to work the whole day. We reported at 05:30h, and weren’t released until about 22:00h. We had only one meal break, and a couple of bio breaks. It was an interesting day. It was a fulfilling day. But boy, it was a looooong day.

Texas pro-life whistleblower website

Posted by on 31 Aug 2021 | Tagged as: culture, politics, robobait, USA

Bless their heart, people in Texas have set up a pro-life whistleblower web site to try and persuade Texas to anonymously report each other for personal medical decisions about abortion.

These folks, “Texas Right to Life”, say they want to enforce the Texas Heartbeat Act, which claims to let people sue each other based on reports like this. This is the same faction which claims personal choice over a medical decision like wearing a mask or getting a shot to prevent unnecessary deaths, but then forbids choice when it comes to abortion.

The good news is, someone has set up a similarly-named, but good, web site: https://www.prolifewhistleblower.net/ . Go to that web site to find out about detectable heartbeats and standard medical practice and why abortions should not be illegal. Maybe, some people looking for the snitch website will find the good website instead. Let’s hope the good website is the first result search engines return for a search like “report abortions in Texas” — and that the bad website is waaaay down in the search results.

But how internet search engines come up with the order of search results? By looking at what other web pages link to each website. My blog is small, but the links on these pages will help in their small way to push the good result up in the search results. Do you have a web site or blog? You could link to the good web site also.

Now, another thing people are doing is gumming up the bad web site with spurious reports. I won’t link to the bad site here, but it has the same URL as the good web site, except use “.com” instead of “.net”. You currently can’t connect to the bad site except from an internet address inside the USA. You can’t see the anonymous report form except from an internet address within Texas. But there (V) are (P) ways (N) to arrange to have a Texas internet address.

To fill out a report, have the following information: How do you think the law has been violated (500 chars), How did you obtain this evidence (200 chars), Clinic or Doctor this evidence relates to (20 chars), City (30 chars), State (30 chars), Zip (30 chars). You must answer, Are you currently elected to public office? with Yes or No, and check “I am not a robot”. Now, I read that many people are submitting reports with false information. I hope they are being careful. Sites with report forms like this can easily filter out clearly bogus reports (e.g. state is not Texas, or Zip does not match City, or it mentions someone famous who is not an abortionist). It is harder to filter out plausible-sounding reports. Some anti-abortionist will have to spend effort to check them out. The more effort they waste, the less this bad website helps them.

Of course, this being the internet, someone has made another website, https://prolifewhistleblower.fun/ , to have “fun” with the bad web site by automatically generating false reports and submitting them via your internet address. I found it interesting and worthwhile.

Search engines, hear my keywords, and raise up my links! Texas Heartbeat Act! Prolife Whistleblower Web site!

Next »