Keep your ColdFusion small by using expression evaluation well
Size matters. The smaller the better, right?
I like to keep my code concise; this lets me see more logic at once. This gets to the argument of readability, which is quite valid, but I’d say we’re moving towards smaller code – look at Lamdas in .NET, the increasing use of ORM, Ruby on Rails syntax, increasing use of functional languages like F#, etc.
Adobe ColdFusion lets you enclose expressions inside of #something# – so you can do:
#somevar+1#
ColdFusion 9 introduced something I love – ternary operators. Instead of:
<cfif someBoolean>
<cfset myVal = "value1">
<cfelse>
<cfset myVal = "value2">
</cfif>
you can do:
<cfset myVal = someBoolean ? "value1" : "value2">
So for a bit more fun, let’s combine the 2 ideas:
<cfoutput>#someBoolean ? "value1" : "value2"#</cfoutput>
We just turned 6 lines of ColdFusion into 1!
When to use? To me, building <select>’s can be one of the more tedious things I do. So I try to keep it small as I can. I recently built a select box with customers grouped by active status:
<cfquery name="qryCustomers">
select customerId, companyName, active from customers order by active desc, companyName
</cfquery>
<select name="clients" size="15">
<cfoutput query="clients" group="active">
<optgroup label="#active?"active":"inactive"#">
<cfoutput>
<option value="#customerId#">#companyName#</option>
</cfoutput>
</optgroup>
</cfoutput>
</select>
Coffee, cigarette smoke, and 4G is on the menu
Decided to go down to Denny’s for some food and get some work done. They have a wi-fi connection, but I know better than to waste my time with it. So of course I plug in my Clear modem … I’ve blogged about it before and how much I like, but wow. I’m totally blown away by my speed tonight:

Twice as fast (down) as I’ve ever seen. Nice.
She’s getting closer
Generally speaking, my blog is more of a “geek” blog, so I don’t get into much of things on a personal level. However, it’s reasonable to take the liberty to announce that I’ll be getting married in November.
Leah is far from a nerd, but she isn’t totally befuddled by geekiness… I guess that’s due to the fact that her dad worked in IT. Sometimes, she tries to get the terminology right, and gets oh so close…. Last night, she asked, “If I put all my stuff in the clouds, will it make my computer faster?” I couldn’t help but smile.
Lessons learned: BIOS settings and SSD drives
There was a time when I didn’t run a computer I didn’t build myself. Over the years, however, that has changed, and computers have come down so much in cost that it just doesn’t make sense to build your own.
Unless you want the high high end. As in a computer that no one makes, or that you lose price advantage once you spec it out with one of the manufacturers, at which case the disadvantages of manufactured computers kick in (inability to pick exact hardware, bloat-ware, etc). I recently built such a machine. I might go into more details in another post, but basic specs: i7-980 Extreme Edition, 6 GB of Corsair Dominator DDR3, 80 GB Intel SSD for software, 3×1 TB Western Digital Caviar Black drives in a RAID 5, and some other stuff (I’m a developer not a gamer, so some of the other hardware you might see in an extreme machine I don’t need).
Recently updated the BIOS to try to figure out an issue with the DVD burner (downside to building your own: troubleshooting miscellaneous hardware imcompatibilities). When I did, instant blue screen. Turns out this reset the BIOS, and as I didn’t set the BIOS up to begin with, it took a little while to figure out the correct settings. Point of shame: I actually didn’t “build” the computer; I bought all the part at Fry’s and let them turn all the screws, as it was cost effective to do that. (I installed Windows however.) I’ve never worked with an SSD or RAID, so this was tricky.
Two things I learned in troubleshooting this:
- Enable RAID (thank you Captain Obvious)
- Enable AHCI for the SSD if you want it to boot (my basic research has shown you can tweak the registry to lessen this need, but can’t really set the registry if you can’t boot, unless you can get into Safe Mode command line) – I have an Intel X25, so this might not be true for all drives
Now, on to figure out why I can’t burn DVD’s …..
Clear broadband and wi-fi router interference
Be very careful where you place your wi-fi router in proximity to your Clear broadband modem. Placed them right next to each other:

Then I moved the router just a few feet away:

OOPS!!!!
I sometimes post demos, screenshots, etc for clients to review … this isn’t the only domain I own (I tend to buy them for fun … ever seen that show on TLC, “Hoarding”? I’m kinda like that, only with domain names instead of pizza boxes.) However, this one makes the most sense as I do consulting under my own name. So I’ll drop their files into a folder on my site, except I kinda goofed and put it in the root of my site. Soo…. if you came here in recent days, please forgive the screenshot that’s been here for a few days.
Concise guide to setting up Linux server for the developer
Awesome list of commands for setting up a Linux server (written from perspective of CF development, but quite applicable to all development):
http://www.bytespring.com/blog/server-setup-notes-ubuntu
Only wish it had some for CF install
True Love in 2010
Had a fun little discussion with a guy at Best Buy. He saw my iPhone 3G and was asked if it was the new 4. That’s another story, but thanks to some pre-order hi-jinks (not the same problems others were having) I don’t have one yet. In time I’ll get one, so we talked about what to do with the current phone. Rather than sell it on eBay, I told him my girlfriend had claimed it. Of course, it’ll sit in a box for a while …. I joked that I don’t love her that much. The sign of true love in 2010: whether or not you get them an iPhone data plan. A year of iPhone service.. that’s more than a decent ring. Even if you get married, you technically can change your mind the next month. iPhone service? Locked in for 2 years. Now THAT is commitment!
LINQ goodness: sensible type conversion
I love using bit types in my database schemas – but I’ve always felt a bit strange, as pretty much the entire programming world uses the idea of a boolean, not a bit. Conceptually they’re the same, but it feels more natural to set true/false rather than 1/0. It almost feels like a holdover from an earlier era, where “we” (I’m only 33, so I use that term loosely, as I didn’t really get into programming until the late 90′s) used computer-friendly values to represent real-world constructs, before today’s type-based abstraction. Still, it felt wrong writing SQL like:
INSERT INTO myTable (myField,isState)
VALUES ('myValue',1);
Like much of the programming world, I’m moving more and more out of the SQL realm, relying on ORM. When doing C#, that’s LINQ. It made me smile when I tried:
MyTable mt = new MyTable();
mt.myField = "myValue";
mt.isState = (someBooleanCondition) ? 1 : 0; // set 1 if true, 0 if false, to use SQL bit type
and it returned an error. Yes, I smiled at an error: “int cannot be converted into bool” LINQ treated the bit field as a boolean, so the proper code (which makes all right with the world):
mt.isState = someBooleanCondition;
Oracle’s strategy re MySQL
Just saw anĀ article on InfoWorld stating that MySQL use was up, despite being acquired by Oracle. Despite the fact that Oracle sells a database server. The conspiracy theories stated that Oracle would suffocate or kill the product, as it is a “competitor”. These number supposedly disprove that. I think it’s silly to think Oracle wants to can MySQL: it isn’t competition. People who use MySQL aren’t the kind to buy Oracle. In the absence of MySQL, they’d go to PostgreSQL, not Oracle (or SQL Server, etc). However, MySQL benefits from open source contributions. Sooo… if someone decides to steal some MySQL innovation, as the code is freely available, who would act on the license issue? MySQL, of course. So, Oracle simply takes the best of MySQL and rolls it into its own product. Oracle probably won’t sue themselves.
