Home



me
deviantART facebook

My Blog

Show blog for which year?

Tue Jan 04, 2022

Happy New Year!

I updated fredkin.c to use delays measured in seconds and implemented rudimentary parsing for the data files. Data files expect actual data but will use defaults for live/empty cell characters, the delay and the generation if not provided.

I set a limit of 1 day to the delay (86,400 seconds). While arbitrary, this is run to watch the changes, I don't think anyone wants to stare at a static pattern for that long.

The man pages indicated nanosleep is POSIX compliant. usleep while largely supported is not POSIX compliant. I updated the code to use nanosleep. Rather than changing from microseconds to nanoseconds it made sense to just use seconds and let the computer do the math. Version 2.x stores the delay in save files as the number of microseconds. To use old save files in the new version, you can edit the save file and comment out the delay line by inserting a '#' at the beginning of the line, deleting the line, or changing the value to the number of seconds.

The previous save files were a fixed format header that expected a comment, delay and generation followed by data with a terminator. They should be compatible with this version although the delays are insane if you don't edit them as described above first and will appear to have hung the program on load. New save files are not compatible with earlier versions. Since the data files are now being parsed, hopefully that will not be a problem in the future.

The executable was compiled under Windows 11 and should work fine under Windows 10

fredkin-3.0.tar.bz2

Sat Apr 02, 2022

I've been playing around with VirtualBox a bit and manager to get Haiku OS running again. I haven't been profiling it, but the performance is decent when it has enough memory.

I was able to get biorhythm and magicsquare to compile and install with some tweaking:

I also needed to install ncurses6-dev.

One thing I need to figure out is how to change the screen resolution. It's definitely worth playing with.

Mon Apr 18, 2022

I came across some matrix problems showing Gauss Jordan Elimination on YouTube. I remembered essentially nothing of this and wanted some simple examples to do. So I slapped something together in C.

I guaranteed integer solutions by generating the system of equations from a randomly generated solution, so there is no logic to actually solve here. It shouldn't be too difficult to port to another language as long as multidimensional arrays are available.

The program is written top down and with limited interaction. It just shows the augmented matrix for a 3 variable system and will print the result after you hit "Enter".

The program should be run from the commandline. It was compiled on MSYS2 MinGW 64-bit and I have included a copy of the executable. It will accept an integer greater than 0 as an argument to set the maximum absolute value of the coefficient.

Download:

Sat Jun 18, 2022

I updated my page: https://mcsuper5.freeshell.org/datesandmileage.html to reflect the updated mileage rates for the second half of 2022. While I was there I did a little reformating and removed most of the hard line breaks.

Thu Sep 01, 2022

I wanted a copy of Rogue on High Sierra. RogueDarwin failed to compile. I made some minor updates to the Makefile and source. It now compiles on High Sierra with clang 10.0.0.

I added a few prototypes and changed some function definitions to return void since they used return without a value.

In the Makefile I turned off warnings and added .PHONY targets: install and clean.

/usr/local/bin is already in my $PATH, and /usr/local/share/man/man6 is searched on my system. Change the paths as appropriate in the Makefile.

I believe /var/games/rogue.scores was indicated in pathname.h, and it appears to be appropriate. You can change this by updating pathname.h. You should update this in the Makefile as well.

It looks like there is no shell interpretation on the path, that is, setting the pathname to ~/rogue.scores failed when run, so you may want to use the absolute path.

Download:

Fri Sep 02, 2022

I did a little searchng on RogueBasin and found that RogueDarwin already had a fork mac-rogue that appears to have already updated to compile on a recent compiler.

It was still a learning experience and I prefer /var/games/rogue.scores to rogue.scores.

The source compiles on NetBSD 8.2 if you define UNIX.

The version is rogue-clone: Version III.

Sat Nov 26, 2022

I got a copy of K&R's C Programming Language, 2nd Edition, last week.

The example in 1.2 gave me an idea. I've never gotten used to temperature conversions, so I decided to put together a utility. Temperature conversions using units is not intuitive.

I thought it would be a quick hack; however, temperature.c took on a life of its own after I decided to do some sanity and error checking. The source compiles on NetBSD 9.1 and on Linux. Finding appropriate headers for HUGE_VAL, DBL_MAX and DBL_MIN on both operating systems were problematic.

While it is pretty easy to get the number and the scale separately, it gets more complicated if the units are attached.

At least under float, I could get a result of -0.00 when the result should have been 0. I added a constant VARIANCE which hopefully brings us up to +0.00 when printed.

An alternative approach might be just to add the variance when the value was negative but within tolerance of zero.

I had started the project out using floats but switched to doubles after I saw how poor the precision was.

Mon Dec 05, 2022

I did a minor update to the source for magicsquare-22.tar.bz2.

The update seeds srand() on Linux and NetBSD using clock() which should allow for a random board on startup if you are using Linux or NetBSD, and updates the version. Unfortunately, seeding using clock doesn't appear to be help on NetBSD.

Fri Dec 09, 2022

I did a minor update to the source for magicsquare-23.tar.bz2.

The update seeds srandom() on using clock() which should allow for a random board on startup if you are using Linux. I'm assuming srandom() and clock() are available on most systems. I'm using getpid() for the seed on NetBSD which should be random enough for our purposes.

I also corrected the code to initialize the random number generator only once.

Alas, I am dying beyond my means.
		-- Oscar Wilde, as he sipped champagne on his deathbed

This blog has been viewed 1 times.

Saturday 27 April 2024   Michael J. Chappell   Contact me at: mcsuper5@freeshell.org Made with Emacs