programming

Insertion Sort In PHP

Insertion Sort In PHP

function insertion_sort4 ($a) {
for ($i = 1; $i < count($a); ++$i) {
/* Assume items before a[i] are sorted. */
/* Pick an number */
$key = [...]


Displaying your AIM Status

At work today, I had to figure out how to display someone’s AIM status on a web page (ideally with minimal programming involved). After having a hard time finding simple solutions via google, I asked my coworker Rich if knew of any. Indeed he did, and it was a simple programming free solution.
AOL offers a [...]


Rails Page Caching with Subdomains and Advanced Cache Invalidation Cron

Continuing to fight the good fight against Rails’ slowness and processor intensive handicap, I have been working a lot with page caching over the last day. I think I finally have a decent setup now. This write up talks about the Rails side of caching. This assumes that apache is serving up cached pages just [...]


Mongrel Rails + mod_proxy + mod_rewrite configuration for caching

Now that the Adamantine Arts site is getting more traffic, I wanted to implement page caching to really speed things up and prevent excessive server load. I’ll discuss page caching in Rails in more detail at another time. The problem at hand however was to get apache, mongrel, mod_proxy, and mod_rewrite to all play [...]


Building “Tag Cloud” in Rails

I am working on the new search engine for Adamantine Arts and wanted to display the top 25 queries. I thought it would be nice to display the searches in the cool tag cloud form where the more popular the search the larger the text.
So quick tutorial on how to build a tag cloud in [...]


Django in-url paging and reverse, url, permalink, etc

Here is a quick note that my coworker George discovered that I went around and changed in some of our development code…
Django’s url structure allows you to do your paging inline (bla.com/view/3/ instead of bla.com/view?page=3) which is better for url based page cache retrieval (at least in rails) as well as search spider optimization… [...]


A Night With Diablo

It is 4AM as I write this. I have to go to one of my good friends’ wedding tomorrow so I am going to pull the plug on this night soon. However, I just wanted to say that I was working on the new Adamantine Arts Galleria that has been in progress for three or [...]


Assigning onChange Events in Javascript

I wasted a small portion of the last few hours of work today with this issue and the docs everywhere were unclear. So I am going to explain really quick what happened in hopes that others don’t have to waste time with it either.
The correct code is:

var e = document.getElementById(’some_element’)
e.onchange = some_func
function some_func() { alert(’Oh [...]