Posts

Showing posts with the label Java

Making REST Calls Retryable in Biking Weather Suitability Forecast Application

One frustration I had noticed with my Biking Weather Suitability Forecast Application was that I found it often would not show results until I reloaded the page, and a look at the application logs showed that the REST calls to one of the APIs called had failed or timed out. After doing some research into using Spring's Retryable options for methods, I decided to make the DailyReportCollectionService method getCurrentDailyReports() retryable, so that it would be attempted a second time after a one second pause if the first try didn't succeed in returning complete data, with a third and final attempt made as the " Recover " option. First, I added the following two required dependencies to the dependencies section of the application's pom.xml file. <dependency> <groupId>org.springframework.retry</groupId> <artifactId>spring-retry</artifactId> </dependency> <dependency...

Adding Verbal Warnings and Time Quotas Configurable by Account for Forced Logouts in Programmatic MacOS Parental Controls

Building upon the original Restoring Forced Logouts Removed from MacOS Parental Controls , the original refinements , and the New Year updates to them, I have since added code to add the following features. Give two verbal warnings about (approximate) time remaining before forced logout; and Make the minutes allowed per day a configurable property which can be customized for individual accounts. The first was added as a courtesy to our boys. The second was added to allow cutting back or eliminating hours for each boy individually if they didn't complete their list of basic daily tasks to be done to be allowed the full amount of computer time for the following day, or to increase it for sick days and the like. Making it a property also allows changing it on the fly, without having to alter the code, and also eliminates some very inconvenient hard-coded values. The properties were added to the end of the application.properties file. At the same time, I added a missing J...

My Java Version of the Original "Oregon Trail" Game

I have completed coding of a Java port of the original "Oregon Trail" text-based computer game, based on the 1978 BASIC source code. More details and the source code may be found at my github page for the project .

Further New Year Updates for Forced Logouts in Programmatic MacOS Parental Controls

Early this January, 2022, Sara and I noticed that it seemed like the boys could stay on the computer much longer than what the forced time quotas my refined program enforced. Investigating the code revealed something I should have anticipated, having been part of a " Y2K readiness team" earlier in my career. The problem was that my "UserLoginTime" objects were obtained given the output from the bash shell's "who" command, which only shows the login time for users using a two-digit month and two-digit day, but no year. When I constructed UserLoginTimes that were holdovers from old logins at the end of December 2021, the code was assuming that it was December of the current year - nearly a year in  the future. So, when checking whether the total time online for the boys was greater than the specified value, the code was subtracting a future date and time from the current date and time, resulting in a negative "elapsed time", thus never timi...

Refining Forced Logouts in Programmatic MacOS Parental Controls

It did not take long for the more math- and computer-oriented of our twin sons to figure out the loophole I mentioned at the end of my original post, " Restoring Forced Logouts Removed from MacOS Parental Controls ": Crafty minds can probably already spot one loophole with how this works. The kids will only get logged out from their current session if the current session has been an hour or more. There is nothing checking their usage for the day. So, if they want to get the most time, they could log in for, say, 50 minutes, and then log in a few minutes later for another 50 minutes or so, and so forth. The fix will involve a more complex refinement. I think I will need to create a small database of total minutes logged in per day and user (for the monitored kids, not the adults), and add 5 minutes for every time they show up as being logged in by the every-5-minute-run of LogTimerApp. Then, if the total time for the day hits the hour limit, then do the logout. So, I ...

Restoring Forced Logouts Removed from MacOS Parental Controls

At some point between the release of MacOS "Mojave" and MacOS "Big Sur", one of the key features that I liked about the parental controls — the ability to force logouts from the Mac after the time quota for the day was met — was removed. This is my least favorite removal of a previous feature of the Mac operating system since the removal of the photo mosaic screen saver with the change from Lion to Mountain Lion (see this old video for an example of what it used to look like). While I know the focus now is on screen time specific to various apps across all devices, we really only have the one Mac that our boys use and which we want to limit their time on, and we don't want them to use up their allotted hour on, say, Minecraft, and then spend another hour browsing YouTube videos in a web browser. Since I could not find any way to force logouts after a time using the current "Screen Time" settings in MacOS Big Sur, I decided I would have to come up wi...

Sunrise and Sunset Times Added to Biking Weather Suitability Forecast App

Although it is pretty much the end of the biking season for the year as I write this, I have added an upgrade to my Biking Weather Suitability Forecast app: the sunrise and sunset times for the location. For now, this means Richfield, Minnesota. Perhaps someday I will get to making the app more customizable for the user.

My Biking Weather Suitability Forecast Web App

I have added a new page for my new " Biking Weather Suitability Forecast Web App ". Find more information about the app at the page; for now, it is hard-coded to focus on suitability using hard-coded criteria and for Richfield, Minnesota, only. The forecasts can probably be considered "close enough" for the rest of the Twin Cities metro area.

Java Applet Troubles

I apologize to those who may be trying to run some of the old Java applets on my site, especially the Mandelbrot and Julia Set applet , only to find that recent versions of the Java Runtime Environment have increased security requirements that now block these from running. I hope to find some time in the coming weeks to see if I might be able to make some changes that would allow these to work again. As I mention in the pages accompanying the applets, the jar files are downloadable, allowing running these applications as applications on one's own machine, rather than as applets within a browser.

An Old Program of Mine Once Again Becomes Useful...

I received a fun email this morning, in which the sender asked if they might use my Java implementation of the Advanced Encryption Standard (AES) . It is rather fun for a 6-year-old program, written for a class, to be of use to someone else. That ranks up there with previous requests to use my even older Mandelbrot and Julia Set applet from both an undergraduate student and a teacher.