TPUG Library CD – disk image contents, mostly

TPUG – Toronto PET Users Group still publishes its software library for Commodore computers. You can buy it for $20.00 (Cdn) plus shipping and handling. Yes, it still makes TPUG money to sell it this way. No, it’s not available online.

The scanned library catalogues are available as PDF: About the TPUG Library. They’re searchable via web search engines:
Google: site:tpug.ca amiga “puzzle maker”. The search is only as good as the OCR in the scan, but is better than nothing.

What you can’t do is search inside the disk images themselves. The files I made below might help with that, especially once search engines get hold of them:

Each line has the disk name and then the name of the file in that disk image, something like:

TPUG C64/A-Monthly Disks/(c)aaa.d64 : 0 "tpug may86(c)aaa" ac 2a
TPUG C64/A-Monthly Disks/(c)aaa.d64 : 23 "autoload" prg
TPUG C64/A-Monthly Disks/(c)aaa.d64 : 119 "infusr/2.0.txt" seq
TPUG C64/A-Monthly Disks/(c)aaa.d64 : 13 "infbot/2.1" prg
 …

Note that I haven’t uploaded any of the disk images. Please don’t ask me for them.

Kind of embarrassed to admit how long it took me to work out this absurdly simple pattern

Kind of embarrassed to admit how long it took me to work out this absurdly simple pattern

Kind of embarrassed to admit how long it took me to work out this absurdly simple pattern

Instagram filter used: X-Pro II

View in Instagram ⇒

Printing two colour assistive tech at the @makersmakingchange booth at @caot.ace conference #prusai3mk3

Printing two colour assistive tech at the @makersmakingchange booth at @caot.ace conference #prusai3mk3

Printing two colour assistive tech at the @makersmakingchange booth at @caot.ace conference #prusai3mk3

Instagram filter used: Sierra

Photo taken at: Sheraton on the Falls

View in Instagram ⇒

Possibly Painless Network Printing from your Raspberry Pi

Printing from computers goes through waves of being difficult to being easy, then back to difficult again. This is likely due to the cycles of technology, complexity and user demand flow in and out of sync. I think we’re at peak annoyance right now.

It’s even harder with Raspberry Pis, as when printer drivers support Linux, 90% of them are for x86 or x86_64 computers only. ARM doesn’t get a look in. But one technology does actually seem to help: network printers that support IPP — Internet Printing Protocol.

We had an old Brother laser printer that just got slower and crankier and less useful as a printer, so yesterday I got a new Brother DCP-L2550DW to replace it. It says it supports Linux in the spec, but I knew not to be too optimistic with my Raspberry Pis. And indeed, it was seen on the network but no driver was found. I had a sad.

What turned my frown upside down was finding out about Raspbian’s cups-ipp-utils package. For desktop use, install it this way:

sudo apt install cups-ipp-utils system-config-printer

(leave off system-config-printer if you’re running from the terminal.)

On the desktop, open up Preferences → Print Settings and add a new printer. Yes, it prompts for your user password which you may have forgotten. I’ll wait while you try to remember it …

Now under Network Printers, you should see a device you recognize. Pick the one that says IPP network printer somewhere:

IPP network printer

Here’s where the magic happens: you actually want to pick the generic driver for once:

Select Generic (recommended) manufacturer

And again, the IPP utilities package will have picked the right driver for you:

Just go with what the driver suggests

Changing the name and location is optional:

Your new printer’s almost ready to go!

Hit Apply, and you should be printing!

(Hey, printer manufacturers have been known to be evil and make good, working stuff suddenly not work. IPP is supposed to make everything sparkly again, but I can’t guarantee that something wicked won’t come this way.)

Just what 2019 needs: the QBasic Online Help Index

QBasic (from olddos.exe) running nicely under dosbox on Linux

Only umpteen years late, I bring you the

QBasic Online Help Indexhttps://scruss.com/qbasic_hlp/

It’s the QuickHelp file from Microsoft’s ancient-but-still-useful QBasic interpreter for MS-DOS. I converted it to HTML, and made some minor cleanups so it would work better on the web.

So if you’ve got a hankering to understand the parameters for MKSMBF$ or know the syntax of PRINT USING, I’ve got your back.

gleeful bash scripting: contrived GCD function

The greatest common divisor (gcd) of two natural numbers is the largest number that evenly divides both. For instance gcd(8, 12) is 4. There are many clever and efficient ways to calculate the gcd of two numbers on a Linux machine. The method presented here is not among them.

#!/bin/bash
gcd(){ comm -12 --nocheck-order <(factor $1|sed 's/^[^ ]*/1/;s/ /\n/g') <(factor $2|sed 's/^[^ ]*/1/;s/ /\n/g')|tr '\n' \*|sed 's/.$/\n/'|bc;}
gcd $1 $2

(Contrived) example:

gcd.sh 24691357802469135780246913578 61728394506172839450617283945
12345678901234567890123456789

Which breaks down as:

prime factors of
24691357802469135780246913578
prime factors of
61728394506172839450617283945
2 
33
33
33
 5
77
1313
3131
3737
211211
241241
21612161
36073607
38033803
29061612906161

Multiply the factors common to both:

3 × 3 × 3 × 7 × 13 × 31 × 37 × 211 × 241 × 2161 × 3607 × 3803 × 2906161 = 12345678901234567890123456789

I’m sure someone else has used the output of factor and comm in this way before. The hard part was getting coprime numbers to output 1.

Digital Photo Archaeology: featuring hardware DRM from the crypt

So I picked up this large boy from the MSU Surplus Store:

Sony Digital Mavica MVC-FD91 (c. 1998 CE) — yes, that’s a 3½” floppy drive on there

You get about 7 high-resolution pictures on a disk. And high resolution by 1998 standards means this:

1024×768 whole pixels: that’s huge! The camera is autofocus with image stabilization, so it was quite a nifty unit at the time.

Pre-dating EXIF, its image metadata is limited. There’s an external ‘411’ thumbnail file that looks a bit like this:

If you care to dig about in such an ancient file, I’ve got a matching image and its 411 file here: MVC-005X.zip. And manuals? Here: Sony_Mavica-FDC91-W0007229M.pdf

Most annoyingly, the camera really only likes real Sony batteries, or it shuts down with an “InfoLithium” battery error. As this battery format is now used in generate photo lighting systems and Sony don’t make it any more, this may be a camera that dies from DRM before anything else.

HSV(ish) Colour Wheel in Python

Years back I wrote something about HSV colour cycling for Arduino. Things have moved on: we’re all writing code in MicroPython/CircuitPython now and 8-bit micro-controllers are looking decidedly quaint. Yes, yes; some of you must still write code in PIC assembly language and I’m sure that’s very lovely for you indeed don’t @ me.

If you look at the output of a typical HSV to RGB algorithm, the components map something like this:

Hue between 0-1, with saturation and value set to 1. Output range 0-1 for each component

These lines remind me so much of sine waves, if very blocky ones. The red trace in particular is just the cosine function, with the input range of 0..2π and the output range of -1..1 both mapped to 0..1. The green and blue traces are just the red trace shifted horizontally by ⅓ and ⅔ respectively.

Since we have transcendental functions in MicroPython, we don’t have to fossick about with linear approximations. The common RGB LED function wheel() uses similar linear interpolation as the graph above. Why make do with blocky cogwheels when you can have a smooth colour wheel?

def cos_wheel(pos):
# Input a value 0 to 255 to get a colour value.
# scruss (Stewart Russell) - 2019-03 - CC-BY-SA
from math import cos, pi
if pos < 0:
return (0, 0, 0)
pos %= 256
pos /= 255.0
return (int(255 * (1 + cos( pos * 2 * pi)) / 2),
int(255 * (1 + cos((pos - 1 / 3.0) * 2 * pi)) / 2),
int(255 * (1 + cos((pos - 2 / 3.0) * 2 * pi)) / 2))
Though you never quite get a pure red, green or blue, the results are pleasing

Quite elegant, I thought. Yeah, it may be computationally expensive, but check next year when we’ll all be running even faster µcs. Certainly none of the mystery switch statements or nested conditionals you’ll see in other code. Just maths, doing its thing.

First half is cosine wheel, second half (after red flash) is linear