ZopeEditManager 0.9.7 Universal

If you do a lot with Zope and don’t like to have to use Zope’s ZMI editor, external editing is a godsend. Unfortunately the ZopeEditManager application for Mac OS X hasn’t been updated in quite a while. This is fine because it still functions well, but the problem is the most recent binaries are not universal. I don’t have anything else using Rosetta, so I’d prefer not to have to install it.

Thankfully because it’s open source you can download the source. I’ve done just that and built a quick universal binary. I’ve made no other changes, and it seems to work quite nicely.

ZopeEditManager 0.9.7 Universal
MD5: 5bd3e6497ec0d65d21c60e138c8d6fa5
SHA1: da5f5e216d518727d6f95fe2af32c0db2c6039f9
Outtake from Gabriel’s Passport Photos

Outtake from Gabriel’s Passport Photos

One area I felt iPhone apps lacked was in tea-timers. There exist several, and they’re generally pretty decent, but they lack a bit of configurability I’d like. So I wrote Infusion. The most important feature for me personally is being able to start a pre-defined timer with one touch after Infusion launches, but it’ll also let you customize the startup tab, add teas, edit existing ones, and even just use it as a generic timer. I tried to include a fairly large number of teas. Not many tisanes (herbals) or blends (yet) simply because it’s difficult to keep up the large numbers that are specific to vendors.

Enjoy!

Railo on FreeBSD with Tomcat and Apache

This is primarily written for myself for posterity, but maybe others might find it useful.  I find myself wanting to play with Railo, an Open Source ColdFusion engine.  Java on FreeBSD can be quite un-fun, but I’m going to assume a working JDK to start off with.

First thing is to get Apache and Tomcat installed:

cd /usr/ports/www/apache22 && make install
cd /usr/ports/www/mod_jk-apache2 && make install
cd /usr/ports/www/tomcat6 && make install

Next is to create the /usr/local/etc/apache22/workers.properties file. The mod_jk port gives you a sample to start from. Mine contains:

worker.list=default          # The name of the tomcat server
worker.tomcat.port=8009       # The port of the tomcat server
worker.tomcat.host=127.0.0.1  # The host of the tomcat server
worker.tomcat.type=ajp13      # The type of the connection
worker.tomcat.lbfactor=1      # The weight of the tomcat server

Then mod_jk needs to be added to httpd.conf:

LoadModule jk_module libexec/apache22/mod_jk.so    # Load the mod_jk module

# mod_jk basic configuration
<IfModule mod_jk.c>
    JkWorkersFile etc/apache22/workers.properties # Set the worker.properties file
     JkLogFile  /var/log/jk.log                   # Set the jk log
     JkShmFile  /var/log/jk-runtime-status        # Set the status file
     JkLogLevel error                             # Set the log level
</IfModule>

That was successful in getting Tomcat up and working. Now for Railo. Thankfully, that’s the easy part. Railo provides a WAR file that can easily be dropped into Tomcat’s webapps directory. After that it’s a simple matter of telling Apache what to do about it. I simply added the following to my mod_jk.c’s IfModule:

JkMount /*.cf* default
DirectoryIndex index.html index.cfm index.cfml

And hey presto. I also added a <Host> entry for a particular domain I wanted to use Railo with:

 <Host name="domain.com" appBase="/path/to/domain.com">
    <Context path="" docBase="www"/>
</Host>

And simply extracted the Railo WAR file there instead of in Tomcat’s webapps directory and used it as the basis for the particular site. The only thing is to make sure the web server has appropriate permissions on the WEB-INF directory.

This is a little project I’ve been working on. If you’re an amateur astronomer with an iPhone, take a look!

We have a Gabriel.

We have a Gabriel.

Rounding DateTimes in Cocoa

Let’s see here, what’s the currently supported way to round a datetime to the nearest hour in Cocoa?

// Round the current date to the nearest hour
NSDate * currentDateTime = [NSDate date];
NSCalendar * currentCalendar = [NSCalendar currentCalendar];
NSDateComponents * dateComponents = [currentCalendar components:NSEraCalendarUnit | 
                                                                NSYearCalendarUnit | 
                                                                NSMonthCalendarUnit | 
                                                                NSDayCalendarUnit | 
                                                                NSHourCalendarUnit | 
                                                                NSMinuteCalendarUnit 
                                                       fromDate:currentDateTime];
if ([dateComponents minute] >= 30) 
    [dateComponents setHour:[dateComponents hour] + 1];
[dateComponents setMinute:0];
NSDate * roundedDate = [currentCalendar dateFromComponents:dateComponents];

The API seems a little excessive.  I can appreciate what Apple has tried to do in making dates more flexible and easier to internationalize, but should basic manipulation really be that cumbersome?

The advantages of working from home.

The advantages of working from home.

The braces being finished.

The braces being finished.

Braces being built to hold shelves in the room downstairs. 37 braces for 9&#160;12&#8217; shelves and 5&#160;4&#8217; shelves.

Braces being built to hold shelves in the room downstairs. 37 braces for 9 12’ shelves and 5 4’ shelves.