Fortune Cookies for Android 1.30

Fortune Cookies for Android 1.30

I've just released Fortune Cookies for Android 1.30. The last update was in... 2013... it turns out the Android ecosystem has moved on a bit since then and it wasn't even in the Play Store any more as a result. This update has a nice modern theme but is otherwise just an Android version of the classic UNIX fortune command. The database of fortunes is ancient and just running this might get you canceled / fired / etc so use with due caution. If you have this installed it will update as soon as the release is approved.

Add your comment...

Related Posts

(All Code Posts)

(Published to the Fediverse as: Fortune Cookies for Android 1.30 #code #fortune #software UNIX style fortune cookies on Android (updated for Android 12) )

Catfood Earth 4.30

Updated on Sunday, October 23, 2022

Catfood Earth Satellite Composite Image of Earth including Volcanoes and Earthquakes

Catfood Earth 4.30 is available to download.

This update fixes a couple of problems with the screensaver. It now has improved support for multiple monitors (the image will repeat rather than stretch). There was a problem with the screensaver not starting in some cases. This should now be fixed. After upgrading to 4.30 please find and run the 'Catfood Earth Screensaver Settings' shortcut to configure the screensaver.

4.30 also includes version 2022d of the time zone database.

Add your comment...

Related Posts

(All Code Posts)

Autumnal Equinox 2022

Catfood Earth render of the exact moment of the Autumnal (Fall) Equinox 2022.

Autumn (or Fall) starts now (23 September 2022, 01:04 UTC) in the Northern Hemisphere, Spring if you happen to be south of the Equator. Rendered in Catfood Earth.

Add your comment...

Related Posts

(All Code Posts)

(Published to the Fediverse as: Autumnal Equinox 2022 #code #catfood #earth #equinox #autumnal Render of 23 September 2022, 01:04 UTC, the exact moment of the Autumnal Equinox 2022 in Catfood Earth. )

Photo Sorter 1.20

Updated on Sunday, October 2, 2022

Photo Sorter 1.20

Photo Sorter has been updated to handle some duplicates I've been developing in Google Photos. These are pretty specific rules but might be helpful if you are trying to maintain a local archive from Google Photos via Google Takeout. You can get the latest binary and source from github (or fork away if it's not quite what you need).

The first change is that Photo Sorter now checks for duplicates in the source folder as well as the destination. If two source files have the same date taken and the same filename then the larger file is chosen as the winner and the smaller file is deleted. The filename check ignores anything in parentheses, so 123.jpg is considered to be the same filename as 123(1).jpg. This helps alleviate a fun bug where Google Photos will export via the API a different file that was originally uploaded. I've stopped using the Google Photos API for this reason, and because it will under no circumstances allow you to download a video that is the same quality as the original upload. Crazy edge case Google. Happily Google Takeout still works so I'm stuck doing it slowly and wastefully.

The second change is that if a source duplicate is found using the rules above then it will also be deleted from the destination folder (in order to be replaced by the presumed better version of itself).

Photo Sorter copies some folder full of photos and movies to a different folder with a clean structure and some de-duplication. It's been keeping me sane since 2018.

Add your comment...

Related Posts

(All Code Posts)

Catfood WebCamSaver 3.29.0002

Updated on Saturday, September 24, 2022

Catfood WebCamSaver 3.29.0002

Catfood WebCamSaver 3.29 is now available to download.

This release updates the webcam list and includes a selection of new webcams provided by a long-time user.

Add your comment...

Related Posts

(All Code Posts)

Summer Solstice 2022

Summer Solstice 2022

Summer starts right now (09:14 UTC June 21 2022) in the northern hemisphere, winter for those with latitude signum differences. Rendered in Catfood Earth.

Add your comment...

Related Posts

(All Code Posts)

(Published to the Fediverse as: Summer Solstice 2022 #code #solstice #summer #winter #earth #northern #estival Rendering of the exact moment of Summer Solstice 2022 (June 21, 2022 at 09:14 UTC) in Catfood Earth. )

Outlook/Office iCal feed 400 bad request error with C# WebClient

Updated on Tuesday, June 21, 2022

400

Just in case it helps someone else I was able to fetch an Outlook iCal feed using C#'s WebClient for years until it stopped working in June, 2022 with a 400 / bad request error. I was downloading a set of calendars and the fix was just to use a new WebClient for each calendar so it must be some kind of state thing in WebClient.

To regain around 1% of sanity I have a task that pulls the various calendars that life throws at me and combines them into a single, de-duplicated calendar. The Google Calendar on my phone is gorgeous as a result. My primary calendar is orange and then all of the miscellanea are teal and unique. It would be great if Google Calendar could do this without help, but it was worth the effort not to have some random soccer match repeated five times in different colors.

Last week one calendar, an Outlook feed, started failing with 400 bad request.

Naturally I assumed that the server had started to suddenly care about some header or other and I started playing around with setting User-Agent and various Accept headers without any luck. To make debugging slightly easier I moved the Outlook calendar out of a loop (where I was iterating through a list of iCal feeds that I need to be aware of) and then it magically started working. The magic in this case must be a fresh WebClient and so the fix was to use a new WebClient for each calendar instead of reusing a single instance. It looks like WebClient is deprecated in .NET 6 and one is supposed to start using HttpClient instead so that's probably another fix but not one I'm going to wrestle with today.

Add your comment...

Related Posts

(All Code Posts)

(Published to the Fediverse as: Outlook/Office iCal feed 400 bad request error with C# WebClient #code #c# #outlook How to fix a 400 / bad request error with the C# WebClient when downloading an Office iCal feed. )

Catfood WebCamSaver 3.28

Updated on Friday, June 24, 2022

Catfood WebCamSaver 3.28

Catfood WebCamSaver 3.28 is available to download.

This release updates the webcam list.

Add your comment...

Related Posts

(All Code Posts)

Long term solar powered time lapse camera using Arduino

Solar powered 5MP Arduino time lapse camera

After a few experiments I have a pretty decent platform for capturing long term time lapse footage. The system is designed to run for around a month and captures a photo every thirty seconds during daylight hours. It's a fairly cheap build so I'm not too worried about theft or accidental damage. This post contains build instructions and sample code to get the camera up and running. Before that, here's a quick video made from a few test runs:

On the hardware side you need an Arduino Mega 2560 REV3, the OV5642 camera module, an SD module and card, a battery and a solar panel. You'll also want a waterproof case, cables and some zip ties. Everything I used is on this Amazon list. I tried a few different power solutions and the Voltaic Systems 6W solar panel + 6,400 mAh battery combination is ideal. Their battery banks are 'always on' and continue to provide power even when the Arduino isn't doing anything. Most battery banks shut down when there is low power usage. In my testing the 6W panel managed to keep the system running with no issues.

The main limitation is that Arduino only supports up to 32GB SD cards. With the code below this allows around a month of photos. Depending on the application you could go much longer - the variables are interval (I'm shooting a frame around every 30 seconds) and file size (lower resolution and/or JPEG quality). At some point I'd like to figure out cellular upload but for now 32GB will have to do.

Assembly is pretty easy. The OV5642 camera uses both the I2C and SPI buses. For I2C connect the pins labeled SCL and SDA to SCL and SDA on the Arduino Mega (D21 and D20 pins - search Arduino Mega pinout if necessary). The SPI connections are MISO, MOSI and SCK (available at D50, D51 and D52). You also need CS (chip select) - wire this to D10. Finally wire ground and power to the GND and 5V pins. The SD module also uses SPI. Wire its MISO, MOSI and SCK to the same pins (D50, D51 and D52). SD needs a separate CS (chip select), use D7. And finally for SD connect ground and power to GND and 5V. That's it.

The box linked above is large enough to fit all the components easily. You'll need to drill two holes, one for the camera lens and one for the solar panel cable. Once assembled, seal around both as well as you can.

To program the Mega you need to install the Arduino IDE and then download and install the ArduCAM library. Make sure that the ArduCAM folder is directly under the libraries folder for your Arduino IDE (on Windows this is probably C:\Program Files (x86)\Arduino\libraries\ArduCAM). Then open the file memorysaver.h in the ArduCAM folder and make sure that only the OV5642 line is uncommented (#define OV5642_MINI_5MP_PLUS). If you get build errors it's almost certainly this step that is the problem so check carefully.

At this point I'd suggest trying the blink sample to make sure that you can connect to and program your board successfully. Once this is working create a new sketch and then copy the code below:

A few notes on the code. Near the top you can uncomment the line #define USE_SERIAL to get diagnostic messages written to the serial monitor. This can be useful for debugging if necessary. The sketch uses the built in LED to indicate problems as well - if everything is working you'll see the LED light up during setup and then switch off once the main loop starts. When a picture is written to the SD card the SD module LED will light up, so if you see that happening every 30 seconds or so then you should be in good shape. If the setup code fails to find the camera or SD module the internal LED will blink indicating that you need to fix something. Check that the OV5642 and SD modules are correctly wired. I would also try disconnecting power from the Mega for a few seconds. I have experienced connection issues with the OV5642 that are only fixed by a power cycle.

At startup there is also a check for existing files on the SD card and the file number is incremented by 1000 as needed until existing files will not be overwritten. This is useful in case the system loses power and restarts for any reason. I have included most configurable parameters for the camera module in the setup code like contrast and exposure adjustments so these should be easy to tweak based on your specific application.

Finally the startup code disables Mega features that are not used and after each photo the camera is powered down and the Mega put to sleep. Each sleep is around nine seconds. The number of sleeps depends on the size of the image - if below 200K it will sleep for around half an hour before trying again. This saves filling up the SD card with nighttime images and preserves power when the solar panel is unlikely to be helpful. This is another area to tweak depending on how you plan to use the system.

If you have any questions (or if you build this and it works for you) please leave a comment below.

Add your comment...

Related Posts

(All Code Posts)

(Published to the Fediverse as: Long term solar powered time lapse camera using Arduino #code #video #arduino #camera #c++ How to build and program a solar powered time lapse camera based on the Arduino Mega 2560 and a 5MP camera module. Includes full parts list and working code. )

Vernal (Spring) Equinox 2022

Spring Equinox 2022 rendered in Catfood Earth

Spring starts right now in the northern hemisphere, Autumn if you happen to find yourself south of the equator. Rendered in Catfood Earth.

Add your comment...

Related Posts

(All Code Posts)

(Published to the Fediverse as: Vernal (Spring) Equinox 2022 #code #earth #equinox #spring #autumn #vernal Spring Equinox at 15:33 UTC on March 20, 2022 rendered in Catfood Earth. )