❌ About FreshRSS

Normal view

There are new articles available, click to refresh the page.
Before yesterdayForward in code

Libadalang, Alire, and macOS

Background

This exercise was prompted by the need for Scripted Testing to be supported by – as far as possible – code generation. The need is for the public or interfacing view of a supporting part (domain) of a system to be able to log calls made to it and to provide values on calls to it, using a scripting mechanism.

Read more Β»

Building GCC 12.2.0 on Ventura for aarch64

These are notes on building GCC 12.2.0 and GNAT tools for Apple silicon.

There were two main problems:

  • the base package was built on an Intel machine (lockheed - named after Shadowcat’s companion dragon), running Monterey (macOS 12).
  • the build machine, an M1 mac Mini (temeraire - named after Naomi Novik’s dragon) was by this time running Ventura (macOS 13), but I wanted to make sure that users could continue to run on Monterey.
Read more Β»

Word, templates, rage

This is with Word 2019 for Mac. Why am I using Word, anyway? - because LibreOffice has stopped working with our membership database in SQLite, and wasn’t working at all well with a CSV export. Oh, and Word doesn’t work with SQLite either.

I managed to create a Word template by careful editing of the LibreOffice version; painful to have to work with CSVs, but better than filling in 100 membership letters by hand (most of our members have email, so a Python script using email.mime, smtplib, sqlite3 etc worked for them, leaving the diehards ...)

OK, the organisation has a new chair, time to update the template.

Where is it? Turns out, ~/Library/Group Containers/UBF8T346G9.Office/User Content/Templates. Well done, Microsoft.

And then, the challenge is to find a way of editing the template. Whatever I try, whatever tips I follow on the net, all I can do is edit a document based on the template, which is not what I need to happen!

I would look into PDFs viaΒ fpdf2, but I should only have another year in this post and the next person might have an issue with that. (The same applies to using SQLite, of course. Hmm.)

So I guess it’s back to LibreOffice.


Coding Guidelines

Coding_Guide

This is a rather self-satisfied document, written in the mid-1990’s, which may still have some relevance.

Coding Guide

Purpose and Scope

While it is hard to make a silk purse out of a sow’s ear (to create good code from a bad design), it is all too easy to do the reverse.

The principle that clear, readable, understandable source text eases program evolution, adaptation, and maintenance is not dependent on the programming language in which the text is written. The purpose of this document is to indicate those language-independent techniques which can help you to produce source text with these qualities.

!DOCTYPE>Read more Β»
  • 19 May 2019 at 15:04

Mojave vs. GCC

After you've installed Xcode (or, my preference, the Command Line Tools via xcode-select -install) so that you can install and use GNAT, you may expect to be able to compile C code too.

Mojave may surprise you with

$ gcc casing.c -o casing
casing.c:1:10: fatal error: stdio.h: No such file or directory
    1 | #include <stdio.h>
      |          ^~~~~~~~~
      compilation terminated.

The reason, according to this question and its answers, is that Apple's developer tools, in particular the clang compiler, know where to find the include files under /Library/Developer; GCC doesn't (I'm sure it could be made to, but ...) and so we have to add an extra step to install them in the normal place:

$ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
Password:
installer: Package name is macOS_SDK_headers_for_macOS_10.14
installer: Installing at base path /
installer: The install was successful.
You may need to repeat this after macOS or Command Line Tools (or Xcode) updates.
❌
❌