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)!
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!
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!
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 & " #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!
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?
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