Apr 302012
 

About 7 months ago, I stumbled across turntable.fm, a social music website where people can take turns DJing in a round-robin format, and people can share their music among listeners.  After bouncing between several rooms, I had settled into the All Music Mix room, which was being governed by a bot that had been created by user “dj mikeb”.  This bot uses an API to collect data on the room and enforce play limits and other rules within the room (which I found to be much of the appeal of the room).  As I saw other bots pop up in this and other rooms, I began to look into how to create my own.

I ended up chatting with another user “PodcastMike”, who had created a bot of his own that watched the same room and gathered data, and he pointed me to a GitHub repository (https://github.com/MikeWills/ttModeratorBot) as a place to start off.  Well, the only problem I ran into was that this ran on Node.js, which I had never used before.  I had heard of it a few times among those I follow on twitter, but I really knew nothing about it.

In addition, I’m almost embarrassed to say, I had never used Git and GitHub to grab a project, let alone fork and update it.  However, after some experimentation and trial and error, I was able to get the project onto my computer and found that Node.js was pretty easy to work with (at least when having experience with JavaScript and sample code to work with).  While the bot I had downloaded had some of the functionality I wanted, there were a number of changes I wanted to make.

A few days later, Funbot was born (he’s the little redhead in the spotlight).  I had tweaked the database setup to allow for remote databases, adjusted the database table structure to capture more of the data I wanted to gather, added the ability to tweed to it’s @TTFunbot, and made some other DJ management changes to fit the room I wanted to run.  And rather than keep it to myself, I forked the MikeWills project, which resulted in my own version (https://github.com/GuruGreg/ttModeratorBot), which is also the first GitHub repository to my name.

If you’re interested in checking out Funbot in action, or just spinning some good tunes, you can head on over to Funbot’s Musical Wonderland (I may or may not be there, but Funbot will keep you company).

And stay tuned as well, because I’ve got a lot more planned for the little guy!

May 272011
 

I’ve been looking at a few different ORM implementations for ColdFusion, including the native ColdFusion 9 implementation and Transfer ORM, and I’m having a hard time wrapping my head around the benefits of using it.  I understand that you can write things once, and then use that same code to connect to just about any database, but it also seems like an additional layer of complexity and abstraction that doesn’t provide many other benefits.  Especially in the case where you’re not planning on interfacing with more than a single database type, it seems like a significant burden to not only create your database objects, but then recreate them in an ORM.

To clarify, I’ve been using ColdFusion for about 7 years now, and I’ve worked extensively with mySQL, Microsoft SQL Server, and, most recently, four years with Oracle PL/SQL, and much of the work I do does not reference database tables directly, but calls (often complex) views and stored procedures to read and write the data I’m working with.  It’s usually no trouble at all for me to whip together what I need in the database and then call it from the ColdFusion code.

That said, are there any benefits to using ORM functionality that I’m missing?  I’ve read how much people enjoy working with it, but all I’m seeing as I read the documentation is more work without a whole lot of benefit (especially with how I’m used to working with my databases).

So, what’s so great about ORM?

Aug 302009
 

As a software developer, desktop space is at a premium.  I strongly prefer dual monitor setups because I can usually code in one screen and test in the other.  For this reason, I've often shied away from doing any serious development on a laptop (at least one that isn't docked) because of the single-monitor constraint.

That is, until I saw the gScreen Spacebook:

Now that's the stuff of software developers dreams (even if it is in the neighborhood of $3000)!

Mar 102009
 

So, apparently I had a little snafu where I copied my DEV configurations for my blog to my host by accident, leaving my site running very slow while trying to reach websites that only exist on my local machine…DOH!

Things are fixed now though…thank goodness!  Sorry for any inconvenience!

Jul 252008
 

Over the past few years, I've done a significant amount of Database Administrator (DBA) work in Oracle, Microsoft SQL and MySQL, and I've seen a lot of different approaches to databases. Needless to say, some have been more successful than others, and some have downright confounded me. While everyone has their own style and approaches, there are just some that are bad and should be avoided.

Hence, I've decided to create a topic on my blog here for Database Design Principles (DDP for short) where I can share the general mistakes I've seen, along with better suggested approaches to the problem. Some of these will be specific to certain database applications, but I plan on keeping things pretty general in order to help as many people as possible.

So keep an eye out for this new intermittent feature here on my blog!

May 152008
 

Ever want to store a value in a database as a decimal value, but then display that value on your ColdFusion website as a fraction.  Well, now you can!

The following function (cut out of a more general CFC) does just that for fractions as precise as 1/100, and will handle the whole number parts as well (i.e. displaying “1.25″ as “1 1/4″). 

<cffunction name="displayFraction" output="false" access="public" returntype="string" hint="Generates a fraction from a decimal.">
    <cfargument name="formatThis" type="Numeric" required="true">
    
    <cfset wholePart = int(formatThis)>
    <cfset fractionPart = (numberFormat(formatThis,".999") - int(formatThis)) * 100>
    
    <cfif fractionPart NEQ 0>
        <cfloop from="2" to="100" index="d">
            <cfif (round(fractionPart * d) MOD 100) EQ 0>
                <cfset denominator = d>
                <cfset numerator = round(fractionPart * d) / 100>
                <cfbreak>
            </cfif>
        </cfloop>
    </cfif>
    
    <cfif wholePart GT 0>
        <cfset fraction = "#wholePart#">
    <cfelse>
        <cfset fraction = "">
    </cfif>
    
    <cfif fractionPart NEQ 0>
        <cfset fraction = fraction &amp; " #numerator#/#denominator#">
    </cfif>
    
    <cfreturn fraction>
</cffunction>

I wrote it for a recipe storage application for personal use, and thought others might find it useful as well.  If you do find a good way to use it, feel free to drop me a line!

Jul 262007
 

I just wanted to pass along this article about "What motivates programmers?", and let me state that it is right on. It's the hardware.

In fact, a few months ago I had a fellow programmer with less seniorship at work get a new laptop because her old one died. At the same time, I was still working on my very slow desktop. Even though I realized the switch was purely functional, I was still a bit resentful.

Funny, isn't it?

Jul 102007
 

Sometimes, I really have a hard time believing the things that I read. Well, last week I came across a short article about a new book that computer science is not, and should not be based on mathematics.

Now, I can understand the opinion that programming requires less mathematical knowledge than it did in past decades because many algorithms have been established and languages have incorporated common complex computations into their folds. However, to claim that math is not needed for computer science is just rediculous. I'd love to see the author figure out the location of a mouse click without some kind of location calculation.

But maybe this does explain all the horribly inefficient code I've come across in my days as a developer.

Found via Slashdot