I do java server code for a living. It's my bread and butter. At home when I do my silly little math notes I play with haskell. That's my chocolate dessert. But sometimes I get a craving for something completely different. So in the last couple of weeks I've been hacking a cocoa app: my spicy Thai dish. I don't do it often but it's very tasty when I try it.
I needed a regex lib in this little cocoa app. There are regex packages available for cocoa (see CocoaDev). It seems though that Apple is using icu internally (you can guess that from the Predicates Programming Guide for example). I wanted to use that too. libicucore.dylib is on the system, compiled and ready to use. Unfortunately Apple doesn't provide the headers because the icu API is not final yet and Apple understandably doesn't want to commit to it yet.
So I downloaded the icu package that Apple uses and wrote my own obj-c wrappers for now until Apple officially exposes theirs. You can get the wrappers and a small how-to readme file from here. Use at your own risk.
I played with iWeb the other day. A pretty cool application. I didn't like the cheesy slideshow though that it generates for non .mac publishing so I set about to replace that. I figured out a way and posted the solution on the iWeb discussion list. I got pretty good feedback so I'm sharing my 2 seconds of mac community fame here.
Basically iWeb dumps a folder called "SlideShow_assets" into your published folder. You can replace that with whatever favorite javascript or flash slideshow package you want, it just needs to get the image urls info and current slide index from the opening photo page.
I kinda like the Couloir slideshow which is open source under the Creative Commons 'Attribution-ShareAlike 2.0' License. I adapted it to work with iWeb. Here's an example.
You can use the same modifications if you like, download from here.
Whenever you publish with iWeb, replace the SlideShow_assets folder provided by iWeb with this one.
iWeb has a very appealing approach to web content creation. I like using templates that are done by artists and look good but that are not straightjackets like Sandvox and others have.
So will I use iWeb to replace the current codemanic.com content ? Not yet, not completely, maybe in bits and pieces. I'm working on a python publishing script that will push only differences and do other magic and once I have that I might start using iWeb more for codemanic content. Haven't figured out yet how to convince it to allow flash content and there are other restrictions that bug me. We'll see how it evolves. There is hope seeing how iPhoto evolved from almost unusable and slow to an elegant and snappy application.
This Monday we went to see the Warriors-Rockets game. I wanted to put a link on this blog to the pictures we took during the game but I couldn't. A while ago I switched the photo gallery on this site to use the excellent SlideShowPro flash component. The feature lacking in this release of the component is album addressability. The author, Todd Dominey, assured me that the feature is coming. But what do I do in the meantime ?
Well, the cool thing about Actionscript (and Javascript) is that it is infinitely bendable. With a little "guessing" and some appropriate prototype setting on the right movie clip I hacked this feature to work with the current release of the component (without having access to the source of the component).
[Update] SlideshowPro now has permalinks implemented in a very cool way (based on Kevin Lynch's 'stateful linking' scheme). I removed my hack.
So now I can point you to the game pictures.
Speaking of flash, this website is getting more and more of it. The Home Page features an adapted animation from the Levitated Daily Source. Go check out Levitated, it gives you hours of tinkering fun, all with the fla sources included.
I always wondered how to embed math formulas in the blog. There aren't that many alternatives. One solution I will try with this post is using pdf2swf from the collection of swf tools to convert the pdf generated with LaTeX to a swf file.
[Update] I'm back to generating jpgs out of the LaTeX pdf. The swf file doesn't render too well.
[Update] The sum above is the number of all k-permutations, with k=0, ...,n. This gives for example the size of the problem space for the ballons in a box problem, which shows that a brute-force approach has an exponential penalty.
This one is a classic.
If you're on a mac and can spare 200 bucks you can try out these guys for a more pleasant UI building experience.
I'm an emacs junkie so I really love this one. I cannot believe I only discovered it a few days ago.
This gives you incremental search (Ctrl-s) in any NSTextView. Very cool. Thank you, Michael.
Adapted from the book "Snow Crash" by Neal Stephenson.
Under the right conditions, your terminal can tie into the deep structures, bypassing the higher app functions. Which is to say, someone who knows the right words can speak words, or show you visual symbols, that go past all ... the security precautions, and plugs himself into the core, enabling him to exert absolute control over the machine.
You can run todays nam-shub inside a directory that's under cvs and it will recursively find all the files that you modified (status M) and open them in FileMerge.app comparing them to their base version.
Note it creates little turds next to the modified files that start with .# and end with ~. You can change that if you don't like that behavior.