Social Media and Me

I’ve never used social media*, so I’ve never been affected in any way by the problems Facebook, Xitter, etc.  Am I missing something?

I remember PZ trying to choose between Mastodon and BlueSky, and Mike the Mad Biologist recently mentioned a couple of things that he likes about BlueSky.  Should I try out one of those?  What will I be able to do that I can’t do now?


*OK, I guess blogs are a kind of social media; but aside from that…

I did create a LinkedIn account near its beginning, but I wound up never using it for anything.

Time Zones in C++

I think I have my timezone class ready for prime time, so I should be just about ready to finish the larger civil time library (which I put on hold because a couple of the classes depend on timezone).

But as I write this, I remember that there’s one thing I haven’t tested yet:  the option of reading TZ and TZ_ROOT environment variables using std::getenv() before the timezone class gets used for anything.  I do that magically with some tricky code that has the odor of the poltergeist anti-pattern; so I need to create the TZ and TZ_ROOT environment variables on my Windows box and make sure that that works.  I don’t see any reason why it won’t, so I’ll say tentatively that I’m done.

Questions for Mac Users

I’ve been slow to finish testing my C++ time zone code because I’ve had other things to do; but I think I have it ready for prime time.

But now, in the spirit of the analysis paralysis anti-pattern 😎 (I’m having fun in my retirement, don’tcha know), I’ve decided that I’d like to make it magically portable to the Mac if I can.

1.  Does the Mac have the Zoneinfo data somewhere?

2.  Do you have POSIX-style environment variables (possibly called TZ_ROOT and TZ) for
  a.  the directory where the Zoneinfo compiled binaries are found, and/or
  a.  your local time zone?

If Macs are at all Linux-like except for having the environment variables, TZ_ROOT could be /usr/share/zoneinfo”; and TZ could be localtime or, in the U.S. central time zone for example, either America/Chicago or CST6CDT,M3.2.0,M11.1.0”.

And for those doing C++ work with some version of GCC,

3.  is there some macro or other predefined identifier that says we’re compiling for a Mac rather than some other POSIX-like O/S?

I could probably go to an Apple store, fire up a Korn (or other) shell, and find out what I need for myself; but I’m hoping that there’s somebody reading this blog who already knows the answers off the top of their head.

Thanks.

Update:  thanks to robert79 for some good information about Macs.

It looks like they work pretty much like Linux, except that the filesystem has no symbolic link called localtime, so I still have no clue how a program can discover what the local time zone is.  There’s certainly some way to set the time zone through the UI, but I still need to find out how to discover that setting programmatically.  Maybe Google will help.

Update2:  well, that was easy.  I should have just Googled from the get-go.

It seems that, in POSIX systems generally, /etc/localtime is usually a symbolic link to the real file.  There should also be a file called /etc/timezone.

My Debian Linux box, a VPS actually, is somewhere in England; so /etc/localtime is a symlink to /usr/share/zoneinfo/Europe/London and /etc/timezone is a plain text file that contains just Europe/London”.

I don’t need any code changes, just some remarks in the documentation that the library will work on a Mac; and I still have to proofread that anyway.

Thanks again to robert79.

A Couple of C++ Quickies

I wrote two fairly trivial libraries to support my development of the timezone class that I’ve mentioned before.

1.  Reading Directories in C++ describes a class that loops through directories.  It’s portable to both POSIX and Windows so that you don’t have to do that in two very different ways.

2.  Getting Zoneinfo Data on Windows describes a simple way to do what the title says along with a couple of functions that let you create and delete symbolic links on Windows.

Both of those are really old news, and neither has any great ideas of my own, so all that code is in the public domain.

The timezone class is finished, but I still need to do some testing before I release the code to the world and, perhaps, embarrass myself. 😎  I hope to have that done later today.

Time Zones in C++

I’m back to working on a database access library in C++ and, at present, I’m developing a library of civil time classes that would mimic SQL’s datetime types.  In the next two or three days, I hope to have a timezone class ready for prime time; and I’ve decided to document it separately from the rest of the civil time library because there’s no reason why it couldn’t be a stand-alone class in its own right.

I don’t have the final code ready to share yet, but I wanted to make the design available while the class is still under development in case there’s anybody out there who would like to suggest any additional features that I haven’t thought of.

Is there anything else you think I need?

Update:  I just found out that Windows’ filesystem does indeed support symbolic links.  (I’m not sure what planet I’ve been living on.)  I’ve also figured out an easy way to create a .zip archive with the symlinks in it* and unzip that on my Windows box.  I guess I have a bit of a redesign to work on. 😎

*I can also create a .tar.gz that’s about one fifth the size of the .zip file, but I don’t see how to get the links as links (rather than copies of the file), and the .zip file is only about 2.5Mb.

It’s Official

I’ll be hosting a meeting of the ISO standards committee that I serve on.

It took a little longer to set up than I had expected; but our meetings can be a little complicated.  (I hope the hotel’s sales rep. didn’t get too exasperated with me.  I try to not be one of those 20% of customers they spend 80% of their time with; but details, details don’tcha know.)

We’re expecting to have about a hundred people show up with maybe twenty or thirty more Zooming in.  The meetings are scheduled for five and a half days with Monday and Saturday mornings being plenary sessions where we handle a variety of administrivia and take formal votes.  The committee’s real work is done in smaller breakout groups, some of the groups dealing with as many as twenty or so papers during the week.

I’m looking forward to actually hosting a meeting.  I’ve gotten a great deal more from my participation than I’ve given over the years; and now that I’m retired and getting older, I think it’s time for some payback.

Another Camera Test

I went by Laumeier Sculpture Park this morning and was underwhelmed.  I walked only the 0.64mi. (ca. 1km) paved “Central Pathway”; and there were only a couple of handfuls of pieces, mostly just geometrical things of steel jutting out seemingly at random.  There are a couple of other trails with, I guess, more, and more interesting, works; but those paths are unpaved, which wouldn’t have worked well with my walker.

There were only a couple of pieces that caught my eye for more than a few seconds, and one of the pictures I took was really bad because I had wiggled the camera when I hit the shutter button.  I have only one picture that I’m willing to admit that I took.

Witkin Piece

Witkin Bio

I need to be a lot more careful about keeping it straight when taking pictures of text.  I should have made the text image bigger, too, so that it would be more legible.  2023-09-11:  I figured out how to rotate the image a bit, and I made it bigger.  There’s still a little distortion because I didn’t have the camera’s focal plane totally parallel to the plaque when I took the picture.

I’m going to need a lot more practice before I burden y’all with any more of this.


Techie Trivia

1.  There’s a switch on the side of each of the two lenses that came with the camera that can be used to turn off autofocus, and I’m happy to turn the focus ring myself.  Also, with autofocus on, the flash magically pops up and wastes energy even in bright sunlight.

2.  I decided not to try to load an image into InfanView directly from the SIM card.  I was a little surprised to find that the SIM card isn’t read-only when it’s out of the camera so, in Windows, I can just copy *.JPG into some directory on my hard drive and del *.JPG on the SIM card when I’m sure that I have all the images on my laptop.  That keeps the SIM card from getting filled up with old images, and normal backup of my hard drive insures that I don’t lose anything.

3.  I decided not to do the “let anybody run it” installation that Marcus suggested.  I just double-click on the icon on my desktop and the program runs fine.  I have administrator privilege, I’m the only person who uses that computer, and I generally keep it with me for physical security.

ChatGPT Fun

On an Amtrak-related e-mail list that I frequent (AllAboardRailDiscussion@groups.io if you care), one of the regulars had a bit of fun with ChatGPT.  I found it amusing; and since ChatGPT has come up on FtB before, I thought I’d repost it here with the author’s permission.

Alan Klein:

Explain how to change a piston in the General Motors 16-567D diesel engine, using the language of the Old Testament

ChatGPT:

In the days of old, when the General Motors 16-567D diesel engine was in need of repair, behold, the changing of a piston required a process as intricate as the weaving of fine linen.  Let me recount to you the steps, as if told in the language of the Old Testament.

1.  Verily, gather the necessary tools and prepare the sacred space.  Anoint your hands with oil, and set the engine in a state of rest upon a foundation of solid ground.

2.  Unfasten the bolts that bind the cylinder head and separate it from the engine block.  Lo, the power of your arm shall overcome the grip of the fasteners, as Samson overcame the Philistines.

3.  Once the cylinder head is removed, thou shalt find the piston nestled within the chamber, encased in rings of steel.  Take heed, for the rings must be removed, as a warrior discards his armor before battle.

4.  Carefully, with the precision of a master craftsman, remove the wrist pin that connects the piston to the connecting rod.  As Moses parted the Red Sea, thou shalt separate the piston from its mighty connection.

5.  Now, with the old piston removed, place the new piston upon the altar of the engine block.  Align the rings upon the piston, ensuring they are in their proper order and seated with care.

6.  Inscribe the wrist pin into its ordained position, uniting the piston with the connecting rod.  Let not the pin falter, for it is the bond that shall withstand the fires of combustion.

7.  Once the piston is in place, return the cylinder head to its rightful position.  Tighten the bolts with the strength of Samson, ensuring a firm and secure union between head and block.

8.  Finally, breathe life into the engine once more.  Ignite the fire within, and may the pistons move with the grace of David‘s harp, producing the melodious symphony of power and efficiency.

Thus, with the guidance of ancient wisdom and a touch of modern knowledge, thou shalt have changed a piston in the General Motors 16-567D diesel engine.  May your endeavors be fruitful, and may the spirit of the Old Testament guide your mechanical pursuits.

Bad Server!

I’ll likely be taking my next Amtrak trip starting on Friday; but a few days ago, a server for Amtrak’s Positive Train Control system crashed and stayed down for at least three days requiring that, basically, all trains except on Amtrak’s own Northeast Corridor were cancelled.  Scuttlebutt has it that the server is back up, and it seems that trains are departing from Chicago again.

But what really amazes me is that, apparently, there wasn’t a backup.  The system I worked on before I retired was actually four complete systems, one for development, one for system integration testing, one for customer acceptance testing, and one for production.  Each of those had three servers:  one for the Web component, one for the database, and a third for running background tasks.  Each of those servers had at least one backup.  The DEV and SIT systems had one backup for each server; the CAT and PROD systems had four of each server constantly sharing data back and forth so that they were pretty much exact copies of each other.  That’s the way you do it.  It’s really old news and well understood.

Another possibility, which also wouldn’t surprise me, is that security was so lax that a hacker could have brought the whole thing down for a ransomware attack.  If that’s what happened, they probably won’t admit it.

In any event, Amtrak could have done better by getting a server from the folks who set up my own little website.  They’re much more professional, it would seem.

PLATO and Me

Wow, that was a blast from the past!

Mike the Mad Biologist links to “an excellent article about the PLATO computing system”.

I didn’t know all the early history.  My own involvement with PLATO begain in the ’80s when I was an instructor at Control Data Institute in St. Louis.  The courses were basically all PLATO, although the students had some projects to complete as well:  on the tech. side, it was mostly building circuits; on the programming side, students had some programs to write.  The instructors were there mostly to assist with the projects.

We eventually replaced the stand-alone PLATO terminals with CDC-110s which had a CRT terminal with a built-in keyboard and a separate double-sided, double-density eight inch floppy.  In PLATO mode, a Z80 microprocessor in the terminal was the boss, and another Z80 in the floppy drive just did the disk I/O; but it could also run CP/M in which case the Z80 in the floppy drive was in charge and the Z80 in the terminal ran the CP/M BIOS.

They also had a text editor called MINCE which the programming students used to write their programs instead of punching cards.  One of the languages we taught was RPG II which required codes to be “punched” into particular columns, so I wrote an RPG mode for MINCE that expanded tabs to the appropriate columns.

MINCE was written in BDS C, an early (and incomplete) C compiler for CP/M systems; and it came with source listings for much of the editor.  I didn’t know C at the time, so I went to a bookstore to get a book on C; and as luck would have it, the book I selected was the first edition of K&R, so I got off on the right foot. 😎

My first home computer was a CDC-110 with a dual floppy drive and a modem that ran at the phenomenal speed of 1200 baud!  I got all that for half price (around $5k IIRC) because I was a Control Data employee, and I eventually sold it for about what I’d paid for it. 😎

CDC eventually got rid of all the land lines and rotary switches for communicating with the PLATO mainframe in Minneapolis and switched to something called the “shared network” that used satellites.  This had the unfortunate effect of increasing the turn-around time for each keystroke to a large enough fraction of a second for H. sapiens to notice.

To the tune of Alabama Bound (with apologies to Lead Belly):

I’m input/output bound.
I’m input/output bound.
If them bits don’t stop, Babe, and turn around,
I’m input/output bound.

Hey listen all you hackers,
Now don’tcha be like me:
You gotta stick with that old PLATO rotary
And let that shared net be.

I’m input/output bound.