Project Euler

In the comments to my post about my prime sieve from last week, Duncan pointed me to Project Euler, which is a collection of math problems that you can solve.  Not sure if it makes me crazy that I think it's really cool, but I do.  Even better, once you solve a problem, you gain [...]

CFGroovy 1.1 Goodness?

For CFGroovy 1.1, I want to do this sort of thing, where GroovyFactoryBean will instantiate the specified Groovy object and return it, suitable for injecting into an arbitrary CFC of choice:
<bean id="groovyFactory" class="cfgroovy.GroovyFactoryBean">
<constructor-arg name="cfgroovy"><ref bean="cfgroovy" /></constructor-arg>
</bean>
<bean class="cfcs.service">
<constructor-arg name="dao">
<bean factory-bean="groovyFactory" factory-method="getObject">
<constructor-arg name="clazz"><value>com.barneyb.Dao</value></constructor-arg>
[...]

CFGroovy 1.0 RC3

This is the final expected RC for CFGrovoy 1.0 and includes a couple more API tweaks (backwards compatible, of course).  Bad form to do this right now, but like the attributes-to-params change, I want to get them in before the 1.0 release so I can build the next round of enhancements without mucking up the [...]

Awesomest Code Ever

I found this uncommitted change to a file on one of our shared dev servers today:
<CFIF IsDefined("request.traceactive")><CFELSE><CFSET request.traceactive = "false"/></CFIF>
<CFSET request.traceactive = 'false'/>
I don't even know where to start…

The Groovy Sieve of Barney

Ok, it's really Eratosthenes', but it's my implementation (in Groovy, of course) along with simple display (in CFML, of course), and can be found here (with full source, of course).  If you just want to see the core sieve, here it is ('bound' is the upper range of the search):
class Node {
[...]

Calling FB3Lite as a Custom Tag

Today at work, Joshua wanted to invoke one of our FB3Lite apps from within an external CFM file (a CMS template) to reuse some code.  So I added a little snippet to the top of index.cfm to detect if it's being called as a custom tag and only execute during the start phase.  So you [...]

Base Conversion Functions

In the theme of URL shorteners, I whipped up some simple base conversion functions that don't have the hard limit of 36 that the inputBaseN and formatBaseN built-ins do, but otherwise are exact replacements.  Everything is controlled by the first line, the list of digits.  The functions will support whatever base you want, as long [...]

My Real URL Shortening Service

For those of you who didn't get the joke last night, the whole thing was a joke.  While it does do exactly as advertised, it deliberately creates exceptionally long URLs.  In order for the app to actually return a shorter URL than you submit, the original URL must be at least 189 characters long.  I [...]

My New URL Shortening Service

Joshua, Koen and I were discussing URL shortening services (tinyurl, bit.ly, is.gd, etc.) over lunch this week, and so I decided to write my own (UrlShrink) available here: http://www.barneyb.com/applications/urlshrink/app/
It's ludicriously simple.  I opted for memory storage (think Mailinator) instead of a database for performance reasons.  With the load I anticipate, I think it'll be a [...]

What is The Matrix?

It's control. And I've decided that the control is irrelevant. There are exactly three people in my life that I'll relinquish control to. Two of them don't yet reach my waist (that'll change), the other one can nearly look me in the eye (especially in heels). The first two pretty do, [...]