Here is a bit of Cocoa code, take what you want and enjoy!


Current Contents:

Bullet   CSVEdit is my first attempt to produce a Cocoa application that I could actually use. It is a "Comma Separated Values" text file editor. It can be started by:

After the program receives a file, a dialog is presented to the user that will allow choosing the field separator, record separator, and how to handle quotes. During the table build phase, if a record is found to have an improper number of fields, a dialog will be shown that will allow the user to edit the incorrect record. There is no way to add or delete a record at this point. When editing an existing record, the user must leave the field before the change is recorded. When saving the file the user will have an opportunity to specify the record and field separators.

Bullet   Spirolateral is a simple program that draws pretty patterns. The algorithm is fairly simple, take one step, turn some fixed angle, take two steps in the new direction turn... repeat this x times and then repeat the whole process from where you ended up y times. I recommend that you start with an initial length of 10, the turning angle should be given in degrees, all of the input values should be integers. Under the edit menu there are items that will allow you to set the background color and the pen color.

Bullet   BiggerSQL v1.3.9 is yet another Postgresql database utility. It allows the user to browse Postgresql databases, execute sequences of SQL statements and define and execute PL/pgsql functions. The results of queries can be saved in a variety of formats for use in other programs. Feedback/fixes/suggestions welcome.

Feb 14, 2008 It has been several years since 1.3.8 was released. This newer version is a Universal build that should run on Tiger and Leopard systems. The embedded postgresql documentation has been updated to Postgresql 8.3.

I have only (briefly) tested this on MacOS X 10.3.2-5 and Postgresql 7.4.0-5. If you are running versions of Postgresql earlier than 7.4 you will need to recompile the application. (Here is a gzipped tarball of the project for the darwin ports folks).

Bullet   dailyWakeup version 1, released March 21 2004,is a command line program that will allow the user to queue a wakeup request to their Macintosh. I use the program to wake up my Mac a couple of minutes before each cron job is scheduled to run. My crontabs are set to fire at 1:15am daily, 4:30am weekly on Saturday and at 5:30am on the first of every month. The first time dailyWakeup is run it queues a wakeup call for 1:12:30 the next morning. Then I created a file, /etc/daily.local. The contents of this file are executed by the cron daemon at 1:15. The contents currently look like this

/usr/bin/mail -s Crontab jerry <<DOC
Cron ran at `date`
`/usr/local/bin/dailyWakeup`
DOC
When this script is executed by cron, it sends mail to me and queues another wakeup for the next morning. When dailyWakeup runs it also checks to see if it is Saturday or the first of the month and will queue wakeup requests for the later cron jobs. If you are not familiar with how cron works this might ( in any case ) require you to read the man pages. The dailyWakeup program must be run as root. If you power down your machine and miss a daily cron call you will need to manually run the dailyWakeup program to get back in sync. Hmmm, looks like a system startup script for dailyWakeup needs to be written...
[time passes...]

Bullet   Startup script for dailyWakeup. This is a system startup script for dailyWake up.

Suggested use:

  1. Examine the source to dailyWakeup.m and adjust the times for your system.
  2. Compile dailyWakeup and place into /usr/local/bin ( that is where the startup script expects to find the program).
  3. Untar the DailyWakeup.tar archive in /Library/StartupItems (as root) and change the owner of everything to root.
If everything goes well every time the system reboots an event will be queued for the next day. This is actually rarely needed since the power manager queue will survive a reboot ( even zapping parameter ram ). In any case you can trim the extra events by using ShowPMQueue. It is not clear to me how many events the queue can hold. My main surprise in building the Startup script was that I had to put some code into the StopService routine, I suspect the StopService might be called before the StartService routine.

Bullet   ShowPMQueue version 1.0 released March 21, 2004 is a program that lets a suitably privileged user manipulate the Power Manager Event Queue. The program lists all oll of the scheduled events in the queue. When an event is clicked the "delete" button will activate and a suitably privileged user can delete the event. There is also an "schedule" button that will bring up a dialog that a suitably privileged user can use to specify the time, an identification string, and an event type ( wake, sleep, powerdown, restart and wakeorrestart) selecting OK will queue the event.

What is a "suitably privileged user"? The program needs root privilege in order to delete or add an event. Unfortunately, I do not understand the authentication/security mechanisms built into the operating system. This means that I have to either set the executable to be owned by root and set the suid bit or drop into the applications folder and directly execute the actual compiled file as root. No privilege is required to simply view the queue. I hope some kind soul will show me how to "get root" in a more convenient fashion. Source code is included.
[time passes...]

Bullet   PMQueueManager version 1.1a released April 5, 2004. This is a reworked version of ShowPMQueue that uses the Security Manager to authenticate users prior to adding or deleting power manager events, ie the user has to supply an administrative username and password. This application can be moved to any location and will still work. Be sure to read the ReadMe in the project, it contains important info on building and using the application. The download contains all of the source code and there is a prebuilt version of the application in the Build directory of the project.

Changes From Version 1.1

  1. Added an Icon for the application

Changes From Version 1.0

  1. Fixed a problem with Zombies being created.
  2. The current date is always shown when the Add button is clicked.
  3. The date is now selected via steppers and the users login name is the only choice for the "scheduledBy" field.

Bullet  keypress.c ( Released April 30, 2004) is a utility program that will restart the "time to sleep" timer that is set in the "time to go to sleep" panel of the Energy Saver Preference panel. This is needed because if the mac is awakened by a "wake" event and not a keypress or mouse click, the machine will fall back to sleep in a much shorter period of time ( 2~4 minutes! ). I recently received this clue from a kind person...I am using this by placing the following file:

400.keypress

#!/bin/sh
/usr/local/bin/keypress
into /etc/periodic/{daily | weekly | daily} ( and make sure it is executable )

Since the "usual" script starts with 500, the keypress program will run before the standard default actions. My default "go to sleep" time is fifteen minutes. Currently this is enough time to do all of the assigned tasks. If you examine /var/log/system.log you will be able to see if you have enough time allocated to complete your tasks.

Bullet  ImageBrower-0.96 released Jan 25, 2008 is a Cocoa program that allows the user to browse the images contained in a user selectable directory. Once a directory is selected, thumbnails will be constructed. The user can then view (user) scaled versions of each image by

  1. Clicking on a thumbnail.
  2. Repeatly using the Left/Right arrow key
  3. Selecting the Slide Show Menu Item.
The program is distributed as a DMG file with a prebuilt binary at the top level of the distribution. Be sure to read the README file for more information. This is free software. Enjoy! This will be an ongoing project for a while, feedback and suggestions welcomed.

Starting with version 0.95 there will be two prebuilt universal binaries located in the top level of the dmg, one for Leopard and one for Tiger. If you are running Leopard use the leopard version it is much more efficient for building PDFs.

Version 0.95 now supports "Graphic Novels" (aka Comics), they look great in full screen mode.

The complete Readme is here. It can also be found under the help menu.

Changes


Send mail to me (Jerry LeVan) if you have any problems....


Counter courtesy of http://www.digits.com

Last update Feb 14, 2008