The Dopefly Tech Blog

« The Dopefly Tech Blog Main page

Thunderbird hits 1.0

posted under category: General on December 7, 2004 by Nathan

I've been running Thunderbird since the 0.6 release, and it's been incredibly stable, an honest step upwards from outlook express and outlook 2000 that I had been using, plus it's free. Earlier today (well, yesterday, it's after midnight now), Mozilla released Thunderbird 1.0.

If you use Outlook Express, the free email program that comes with Windows, you shoud seriously consider upgrading. Thunderbird will migrate your mail and other settings so there is nothing to set up. It's easier to use. Easier to customize. It has built-in spam control -- it learns what spam is to you and can automatically delete it for you. There are already dozens of extensions and themes for Thunderbird, including many good time-savers.

If you use a more complex mail program such as Outlook, but don't find any use in the extra "bloat" features such as the calendar, tasks and sticky-notes, give Thunderbird a test drive for a few days. It's a lot faster and smarter overall. It's also more secure than Outlook.

If you're already using it, upgrade to the 1.0 final version. If you're not, look into it and try it out. "Reclaim Your Inbox!"

(Discuss with Disqus!)

Viagra Expression Tester

posted under category: ColdFusion on December 4, 2004 by Nathan

Test out Thursday's post, the Viagra Expression, with the Viagra Expression Testing Page.

It's pretty basic, but I plan to fix it up a little more when I have less people living in my house (friends and family for the holidays, should clear out by next week's end).

(Discuss with Disqus!)

The Viagra Expression

posted under category: ColdFusion on December 2, 2004 by Nathan

Rob Cockerham of cockeyed.com has inspired me. After reading his report on Viagra spam, titled There Are 600,426,974,379,824,381,952 Ways To Spell Viagra, I realized that I needed to develop a regular expression that can handle every misspelling possible. Well, it looks like I'm getting close.

Here is the RegEx so far:

\b((V|v|\\/)+([\W]*[\w]{0,2}[\W]*)(I|i|1|l|\||ï|ì|:|Ì|Î|Í|Ï|y|Y)*([\W]*[\w]{0,2}[\W]*){0,2}(A|a|@|/\\|á|à|â|ã|ä|å|æ|À|Á|Â|Ã|Ä|Å)+([\W]*[\w]{0,3}[\W]*)(G|g|6|9){1,4}([\W]*[\w]{0,3}[\W]*)(R|r|®){0,4}([\W]*[\w]{0,2}[\W]*)(A|a|@|/\\|á|à|â|ã|ä|å|æ|À|Á|Â|Ã|Ä|Å)+)\b

It's been tested with ColdFusion and Java, and should be similar to Perl syntax. It's about 260 characters long so far, test it out for yourself. It's not perfect, but it does a darn good job!

UPDATE:
1) Sorry to fullasagoog for throwing off your formatting
2) I made a page to test the viagra expression

(Discuss with Disqus!)

Moving Pixels, the Red/Blue Shift

posted under category: Design on November 30, 2004 by Nathan

Have you ever noticed your text seem to jump when you have a blue link with a red hover? Here's a sample, Notice the pixel shift:

This text should highlight red when you hover over it

The fact is, it does move, it moves 1/3 of a pixel on a traditional monitor. Monitors are made of RGB blocks, when you turn one off and turn on another, it makes your text seem to jump over just a bit.

So when you're placing some links and it looks like they might be moving, try a color closer to your original link.

(Discuss with Disqus!)

Cool Things CFEclipse Does (part 5)

posted under category: CFEclipse on November 17, 2004 by Nathan

If you haven't seen it yet, open the Dictionary View in CFEclipse by going to Window > Show View > Other, then selecting Dictionary from the CFEclipse views folder. This is your dictionary for HTML, Javascript and ColdFusion. Expanded documentation with examples is coming soon, so this panel is going to get much more useful!

(Discuss with Disqus!)

CFEclipse 1.1.17 is out!

posted under category: CFEclipse on November 12, 2004 by Nathan

Read about it.

If you have Auto-update enabled, Eclipse will ask you to update your CFE plugin the next time it starts up.

1.1.17 has a few of my personal favorite features added in, including code collapsing, drag & drop text, bracket highlighting, ctrl+double-clicking on tags selects the tag, ctrl+shift+double-click selects the tag block, intelligent tag insight (cffile action=copy has different attributes than action=upload), new preferences including trim trailing spaces, and over 15 bug fixes.

If you tried CFEclipse before and didn't like it, try it again! If you've never tried it, head to my CFEclipse Resource Page to learn about it and get help installing it.

(Discuss with Disqus!)

Cool Things CFEclipse Does (part 4)

posted under category: CFEclipse on November 10, 2004 by Nathan

It's been 2 months since an official release on the CFEclipse project. Another release is due any day now. What new feature can you expect to see in this one?

Something new (if you haven't tried Spike's nightly build), is bracket matching. Put the text cursor near a bracket and it will highlight it's matching pair. Soon (hopefully in time for the next release), it will have preferences so you can have it match #'s and quotes.

There's a lot of good stuff coming in this next release. We'll advertise it in all the usual channels, so get ready for it.

Just as a side note, I'm seeing a few things in the source that might interest a few people, including some FTP classes. Stay tuned!

(Discuss with Disqus!)

Firefox 1.0

posted under category: Browsers on November 9, 2004 by Nathan

Firefox 1.0 is released. I don't really feel the need to say it, except for the whole community thing. The more people who promote it, the better it is for everyone.

For the record, I use Firefox. I like it. It took me probably 3 months to switch. I played with it as a toy, then tried to get serious, and finally, made the switch one day and never looked back. Now that it's a much more completed product, it would make it a lot easier to switch faster.

Why is it better for everyone? Well, an end to pop-ups and spyware is probably number 1 and 2. For me personally though, as a web developer, the winning argument is the support for web standards that Microsoft Internet Explorer just doesn't have.

If you don't have it, install it, you won't be disappointed.

(Discuss with Disqus!)

Firefox Release Candidate 2

posted under category: Browsers on November 4, 2004 by Nathan

Firefox RC2 is out. If you're using the preview release or something before 1.0, you should upgrade. There's a few security and stability fixes, and it's just generally better. Also, the more people who use it, the better it gets.

The final 1.0 version is due for November 9th.

(Discuss with Disqus!)

CF Application Events

posted under category: ColdFusion on November 4, 2004 by Nathan

The next version of ColdFusion will have a much-requested feature called Application Events. Much like ASP and ASP.NET, CFMX "Blackstone" (code name), will have events for:

OnApplicationStart
OnApplicationEnd
OnSessionStart
OnSessionEnd
OnRequestStart
OnRequestEnd
OnRequest
OnError

Looks like the community will have to re-invent their best practices again. I for one look forward to it!

(Discuss with Disqus!)

ColdFusion programming advice

posted under category: ColdFusion on November 2, 2004 by Nathan

Here's some good advice for you CF programmers: Learn another programming language.

Yes, that might sound strange. No, I don't mean for you to get away from CF. ColdFusion is a great language, very versatile, very scalable, very strong. I'm just saying, if you want to to be a good programmer (of any language), you should know or learn another language.

This is my story.

I was introduced to CF as my first and only programming language. HTML doesn't count and neither do simple SQL select, update and insert statements. JavaScript didn't really make sense. The company paid for an Allaire "Fast Track to ColdFusion" course in Seattle, so I was set. 2 years later, I was still using CF, but looking back, I wasn't "getting it" fully.

Fast Forward to 2002, my employer decided it was time to switch to ASP "classic". That never happened, but I did spend 6 weeks reading and practicing my VBScript skills. On about the 3rd week (yes, i'm dense), something clicked and I suddenly got it. All of a sudden there was a difference between CFML and programming. I'd never made the jump until then.

Ever since, I've learned VBS, VB.NET, C#, Java and JavaScript like they were nothing (well, aside from vb's crappy syntax, and OO programming hurdles). But better yet, it gave me the ability to learn.

It sounds like an all around good thing to me. Increase my marketability, increase my knowledge, make me more valuable to my employer, give me a better understanding of the programming world around us, and make me a better ColdFusion programmer.

If you're not a solid programmer, or you think you are but only know CF (like me), take some time to learn a new language. It will pay you back 100 times.

(Discuss with Disqus!)

Professional tip #1

posted under category: General on November 1, 2004 by Nathan

Here's a professional tip:
Have a family.

Having a family reduces stress on your life (assuming your family life isn't stressful). Lower stress equals general happiness and contentment with life, which is important for feeling successful professionally.

Having a family, especially with kids, increases your income. At the very least, you get the dependant tax-break, but moreso, people with families generally make more money. Why? It's probably a balance of parents who know they have to work harder to create stability, and businesses who feel some warmth to people who rely on them to take care of others. I'm sure there's more there, if you were to dig deeper.

I'm no pro, really. I just saw it on 60 minutes a few months back and wanted to comment.

Anyway, my family (including week-old Jude) couldn't be happier.

(Discuss with Disqus!)

Cool Things CFEclipse Does (part 3)

posted under category: CFEclipse on October 26, 2004 by Nathan

Something new: Code Folding.

New builds of CFEclipse will search for CF tag blocks and put fold icons in the left margin. Highlight and it shows you your chunk. Click and it collapses the area. Very useful, thanks guys!

Spike keeps an updated, usually working version on his site. Download CFEclipse Latest build.

(Discuss with Disqus!)

Web Standards and YOU

posted under category: Standards on October 14, 2004 by Nathan

It dawned on me that designing and developing sites with web standards isn't usually a lack of desire to follow the standards, but a lack of knowing what these standards are, and how to properly implement them.

HTML is dead! XHTML has taken its place. The time to jump on the new bandwagon has come.

Why Upgrade?The simple facts are, standards-driven web sites are easier to maintain, save on bandwidth costs (and thus download faster), and are more compatable with emerging browsers (phones, etc.). Those equate directly to the bottom line.

What do I have to learn? If you write HTML, you should understand the XML basics, close all your unclosed <tag />'s, use lowercase tag and attribute names. After that, it's all about simplifying your markup and perfecting your CSS. Read some books, take a class, visit some web sites. Get involved and ask questions when you're lost.

I want to improve the quality of the internet experience by making the web a better place to surf. You can help! Start small if you want to, but do start on this path to web standards development.

(Discuss with Disqus!)

CFEclipse - Vote for new features!

posted under category: CFEclipse on October 6, 2004 by Nathan

Ollie, the CFEclipse project leader has announced "Get 'chore votes in!" That's right, it's time to vote on what features you most want in CFEclipse. If you use CFEclipse, or would like to except for this reason or that missing feature, etc., this is your chance to put in some feedback and get what you want.

Here's how it works:

- Head to the web site - Log in (or create an account)
- 'Join' the CFEclipse project and the users mail list
- Send an email to the list to get your 'Join' status upgraded to an official 'Observer'
- Browse the issues list - When you find a feature you like, click on "Vote For This Issue" -- you must be logged in
- You get 10 votes, and you can use up to 3 on any one item

There you go! Join us in making CFEclipse the best tool it can be!

(Discuss with Disqus!)

Free Code! - querycache.cfc

posted under category: ColdFusion on October 4, 2004 by Nathan

download queryCache now.

QueryCache is a way to have more control over CFMX's default query caching mechanism. While CachedWithin and CachedUntil work great for static queries, what is the best way to cache a query that will change frequently? The answer is queryCache.cfc.

Instantiate the queryCache object like this:
<cfset queryCache = createObject("component","queryCache")>
(note: I store it in application scoped CFC's variables scope)

Cache a query by running this instead of a cfquery tag:
<cfset myLocalQueryItem = cachedQuery("getThings", "SELECT * FROM table", "myDSN",createTimeSpan(1,0,0,0))>
The first field is the cached query's unique name, the second is your SQL statement, 3rd, your DSN, and last, an optional timeout period.

Flush a single cached query like this:
<cfset cachedQuery("getThings")>
where the only parameter is the unique name of your query.

Other queryCache functions:
<cfset isQueryCached("getThings")>
<cfset getCachedQueryKeys()>

Special features:
Cached a query based on a timeout or until it is explicitly deleted.
If a re-connection to the database fails, queryCache uses the latest cached query it has in memory.

QueryCache has been running on Dopefly.com flawlessly for over a month. I originally created it because my database server is up only half the time, and I wanted to improve performance. I am distributing the code free of charge with no license. Use it at your own risk, i'm not responsible for anything that happens when you use it.

download queryCache now.

(Discuss with Disqus!)

Thunderbird users: Compact This Folder!

posted under category: General on September 28, 2004 by Nathan

If you're using Mozilla Thunderbird to manage your email, this is important. Right-click on your folders, one at a time, and select "Compact This Folder." Don't worry, it's safe. It seems to flush out messages that were deleted, but still take up space in the mailbox

My mail folder was over 100MB for one account, and after compacting my mail folders, it ended up just over 40MB. Certainly worthwhile to remember to do every once in a while.

(Discuss with Disqus!)

Alagad image.cfc - fake bicubic resize

posted under category: ColdFusion on September 13, 2004 by Nathan

I've been playing and tinkering just a bit with the Alagad Image Component. It's a nice tool, but making thumbnails with it is tricky, and the output tends to be ugly. Here's my work-around for resizing an image with this thing.

imgWidth = image.getWidth();
if (imgWidth GT 500) {
image.blur(int(image.getWidth()/500));
image.scalePixels(...);
}

That's it. For every 500 pixels, you blur it one pixel before you size it down to make your thumbnail. YMMV, but 500px seems to be the sweet spot for me.

(Discuss with Disqus!)

Customized Debugging

posted under category: ColdFusion on September 9, 2004 by Nathan

One thing I think more developers should know is the ease of changing the debugging info in CFMX. Obviously you can flip a few switches in your CF Administrator under the debugging settings, but did you know you can actually edit the debugging files and create your own?

My favorite trick is to dump the queries. Rarely do we ever select data, then display it all, just as it came out of the database. Instead we use it here and there in the page, or display pieces of it. But what does your data actually look like when it comes out of your DB? Let's make a customized debug script and solve this problem.

Navigate yourself to your debug folder, usually %cfdir%\wwwroot\WEB-INF\debug\, and make a copy of the classic.cfm file. Call it dump.cfm.

Open that file up, and find the section on SQL Queries. You see it loops over the cfdebug_queries query object. Right before the </cfloop> tag, add this bit of code:

<cfif isQuery(cfdebug_queries.result[cfdebug_queries.currentRow])>
<cfdump var="#cfdebug_queries.result[cfdebug_queries.currentRow]#">
</cfif>


Now save the file, log into your CF Admin and change your "Debugging Output Format" file to this new dump file. The next page you load will give you insight into every query on your page.

(Discuss with Disqus!)

New in FireFox 1.0RC (coming out soon)

posted under category: Browsers on September 7, 2004 by Nathan

Just stumbled upon this link to the Firefox 1.0 PR Release Notes (PR1 is not released yet), and noticed something that will relieve a LOT of headaches.

Undetectable document.all support for site compatibility and improved compatibility for keyboard accelerators further smooth the transition for IE users
This means there's no need to re-code a lot of your javascript to stay compatable with Firefox. Of course it's still good if you do it the 'correct' way, with the standard document.getElementById(), but this should alleviate a lot of corporate intranet headaches, where some complex sites rely on Microsoft's proprietary javascript extensions.

(Discuss with Disqus!)

Gmail invites for ideas

posted under category: General on August 31, 2004 by Nathan

Give me a suggestion on how to improve this site, and I'll send you a GMail invite. It's as simple as that. I've got 6 to send right now, and my site sorta sucks :o) Leave your ideas and your address in the comments below!

(Discuss with Disqus!)

CFMX 6.1 Updater Released

posted under category: Servers on August 25, 2004 by Nathan

Just read on Steven Erat's Blog that the CFMX 6.1 Updater just came out. You've got to search for it, but you can find it on the Updater page.

I know it's been tested and verified and everything, but i'm still waiting a week or two with my ears open before applying it to my production servers.

(Discuss with Disqus!)

Cool Things CFEclipse Does (part 2)

posted under category: CFEclipse on August 25, 2004 by Nathan

It grabs TODO comments and adds them to the task view list, as well as adding a little blue icon next to your code where you wrote your TODO task.

<--- TODO: check the task list --->
<cfscript> // TODO: this will be a task too! </cfscript>

Now the problem, is that it's still in the CFEclipse source, to be released with the next version, whenever that comes out. In order to use it, you'll have to build it from the source. Read my CFEclipse resource page to find out how. It's really not too hard.

(Discuss with Disqus!)

CFQuery bug found

posted under category: ColdFusion on August 23, 2004 by Nathan

My co-worker Raff just discovered a bug with the CFQuery tag. When you set the variable for a query, and then run the cfquery tag, if the query doesn't return a recordset, your previously set variable will be undefined. Example:

<cfset qry = "">
<cfquery name="qry" datasource="dsn">
UPDATE table
SET field = 0
WHERE id = 1
</cfquery>
<cfdump var="#qry#">

The cfdump will throw an error, stating that "qry" doesn't exist.


Workarounds are fairly simple. Either check to see if your query is defined, or if you must have a query, even with a recordcount of zero, do <cfparam name="qry" default="#queryNew('')#"> after your cfquery call.

(Discuss with Disqus!)

Forget cfsilent, this is better!

posted under category: ColdFusion on August 19, 2004 by Nathan

Two thigs I hate:

1. White space at the top of my HTML doc, before anything loads, causing larger download sizes.
2. White space at the top of my XML docs, invalidating the XML (to some XML engines).

What can you do to avoid this in ColdFusion? Historically, ColdFusion 4 had <cfsetting enablecfoutputonly="yes">. While this works, it requires you to put <cfoutput> around everything you do want to output to the browser.

Newer still, ColdFusion 5 introduced the <cfsilent> tag. Absolutely nothing inside the cfsilent tagsets is outputted. This is nice, but for my purposes, it requires me to wrap it around the top of every page... "Now where was that cfsilent starting block?"

Now, thanks to CFMX and the underlying J2EE engine, we can use the amazingly powerful getPageContext(). Here is what I have been putting at the top of my pages and XML docs lately:

<cfset getPageContext().getOut().clearBuffer()>
This successfully clears the output buffer, making it fresh and ready to start anew.

(Discuss with Disqus!)

Cool Things CFEclipse Does (part 1)

posted under category: CFEclipse on August 18, 2004 by Nathan

I find myself constantly finding new features in CFEclipse that I didn't know I couldn't do without. My latest favorite is the tag attributes.

When you are typing out a tag, say, <cflocation. Then you type or select (from the tag insight dropdown) your first attribute, usually something like url="index.cfm". Now when you hit the space bar to see the tag insight again, it no longer displays the url attribute, only the remaining attributes, in this case, addtoken. Neat trick CFE team! Keep up the good work!

(Discuss with Disqus!)

Hotmail Junk Filter

posted under category: General on August 17, 2004 by Nathan

Now that I've got 250MB in my ancient Hotmail account, I can actually have the junk filter send messages to my junk mail folder, instead of straight to the trash. That's good, but I wish I could've done it sooner. Looks like Hotmail was filtering out ALL KINDS of mail. 5 out of the 24 it deemed junk were actually good, valid emails. Things like password requests and newsletters I'd signed up for, and had, at one point, been receiving regularly. Even the CFDJ newsletter I didn't know I was supposed to receive every month.

It's amazing the kinds of things you find just by looking harder.

(Discuss with Disqus!)

Hotmail - 1% of 250MB

posted under category: General on August 16, 2004 by Nathan

Looks like hotmail is sneaking in their 250 MB upgrade this weekend. What a relief. I've had a hotmail address for ages, and I've lost more than a few emails due to the old 'Your Inbox is reaching critical size' problem.

It's about time Hotmail catches up to the rest of the internet standard. Yahoo already upgraded to 100MB, and of course GMail with 1GB.

(Discuss with Disqus!)

Hosting Problems (I am such a hacker)

posted under category: Servers on August 13, 2004 by Nathan

I recently switched web site hosts, following David Medlock's suggestion of going with his provider. I thought it would be great and fun --and darn cheap! Well it's great to have a ColdFusion server for my site, but working with these people is difficult.

It took a whole month to get my SQL database hooked up. Here's a shortened transcript of my little sql battle:


me: Please hook up my SQL Database in ColdFusion.

them: Ok, please give us the details.

me: Ok, here's the server, password, etc.

them: Ok, it works, please test it.

me: Doesn't work. I'm seeing the error: [Macromedia][SequeLink JDBC Driver][SequeLink Server]The specified data source is not defined. Why are using SequeLink instead of the SQL Server driver?

them: Please double-check your code.

me: Here is my code and a link to the page where you can see it for yourself

them: Ok, forwarded to admin.

me: I can see the database, but can't add tables. Please use my dba acct instead of the limited account.

them: Ok, forwarded to admin.

me: It's been 4 days, now it says "data source not found"

them: Ok, forwarded to admin.

me: It's been 11 days. What's happening?

them: Ok, let's start over. What is your database info again?

me: Here's how to add it. Go to cf administrator, click on data sources ... ...

them: Your username is lowercase now? Before it was mixed case.

me: Case doesn't matter in SQL server usernames. I can connect to my database on your server from here. What is wrong with you?

them: Ok, forwarded to admin.

them: Ok, it works, please test it.

me: It's not working. Please refer to the test page i sent you earlier.

them: Ok, it works, please test it.

me: It's still not working. It isn't done until my test page works. I think you have it pointing to the wrong server.

them (admin): Ok, please wait.

them: (2 days later) (issue closed)

me: Do not close this issue. It should have been fixed weeks ago.

them (admin): Ok, looks like you deleted your ODBC connection. I re-made it and everything is perfect.

me: It still doesn't work. Now there is a database connected, but it isn't mine. Please view the test page again. Can I log into your CF Administrator and fix it myself?

me: Nevermind, I noticed the CF Admin was not password protected. Thanks! I have added my database using the regular SQL Server driver. Your admin may copy my settings for future databases, but DO NOT change anything

(Discuss with Disqus!)

The DopeFly Tech Blog

posted under category: General on August 12, 2004 by Nathan

So, welcome to my techie blog, thanks for reading it. Very kind of you. This isn't my first ever web log, in fact I've had plenty of the more manual versions in the past, since 97 or so. This one is by far the coolest (I think say that every time).

I made it myself, so there's a few things left to do to make it as cool as a real live blog, like searching by categories, dates, showing a little calendar of posts, maybe links to other blogs, all nice things that blogs tend to do, although I'm just guessing, since I've never even seen a real being administrated.

The more I work on this thing, the more I realize I should've just used raymond camden's blogCFC. But the experience was fun.

I've got some content brewing in the back of my head (and in my palm pilot), so this should be fun.Stay tuned.

(Discuss with Disqus!)
Nathan is a software developer at The Boeing Company in Charleston, SC. He is essentially a big programming nerd. Really, you could say that makes him a nerd among nerds. Aside from making software for the web, he plays with tech toys and likes to think about programming's big picture while speaking at conferences and generally impressing people with massive nerdiness and straight-faced sarcastic humor. Nathan got his programming start writing batch files in DOS. It should go without saying, but these thought and opinions have nothing to do with Boeing in any way.
This blog is also available as an RSS 2.0 feed. Click your heels together and click here to contact Nathan.