Recent Entries
- Webby!!!
- My Job Description
- XML in Actionscript 2: A Way to Cheat
- The Most Maddening Bug of the Week
- JSDUMP: Javascript - Coldfusion Object Inspector
- Giving A Job Interview
- Switching to iG:Syntax Hiliter Plugin
- Best Firefox Plugin EVER
- More ColdFusion RSS hacks
- Getting My Wordpress Blog Into ColdFusion Using RSS
Blog Under Construction
Fancy database tricks, embarrassing mistakes, novel ideas and adventure reports.
Webby!!!
4/8/2008 4:23
This was waiting for me in my in-box this morning:
It is my pleasure to inform you that Cisco Data Center Assurance Program Interactive Tool has been selected as an Official Honoree for the IT Hardware/Software category in The 12th Annual Webby Awards.
The Official Honoree distinction is awarded to work that scores in the top 15% of all work entered into the Webby Awards. With nearly 10,000 entries received from all 50 states and over 60 countries, this is an outstanding accomplishment for you and your team.
Congratulations!
YOUR OFFICIAL HONOREE LISTING:
Your listing on the Webby site is located at http://www.webbyawards.com/webbys/current_honorees.php?season=12
Again, congratulations!
David-Michel Davies
Executive Director
My Job Description
4/3/2008 2:36
There’s something surreal and heartbreaking about reading a job post for the job I’m leaving. I don’t know what to make of the fact that they’re hiring two people to replace me- one for the ColdFusion & database stuff, and another for the crazy Actionscripting. Here’s the ad for my job, a good explanation of about 60% of my current responsibilities:
INTRODUCTION:
Established interactive development and marketing firm looking to hire an experienced Flash Programmer.
OVERVIEW:
We’re looking for someone with strong Flash programming skills, effective project management and communication skills to expand our design and project development team. This individual must be able to demonstrate through past work strong development skills of Flash interactives and applications. This individual should keep in touch with trends in Web programming and technologies, be capable of working under tight deadlines, provide a creative contribution to the projects and our team, and participate in constructive client-focused problem solving and project implementation. A sense of humor is key!
NOTES:
This is a part/full time contract position with potential to lead to a Full Time employment position.
JOB DESCRIPTION:
Work with our team in the development and programming of Web-based applications.
Understand our business objectives, and become a contributor in its evolution and success.
Demonstrate superior client interaction and communication skills as well as a strong work ethic
SKILLS:
Flash Actionscript 2.0 – Be comfortable writing classes that extend MovieClip, working with XML, and dynamic tweening
Flash Actionscript 3.0 – Master the concepts of Display Lists, Event Dispatching, polymorphism, inheritance. Experience with Tweener, PaperVision, recursion a plus (Trees? DListIterators? Euler Integrators? Move to the front of the line if you even know what I’m talking about).
Experience with XML, RSS and Web service technologies a plus
Experience with ColdFusion and AJAX programming a plus.
Proficiency in Dreamweaver
Comprehensive knowledge of MS SQL and MySQL database structure, creation and integration with applications
Well-developed sense of logic combined with a flair for “thinking outside the box”
Solid problem-solving and technical skills that can be delivered while meeting deadlines
Ability to analyze and delineate large-scale projects and properly prioritize their development
Highly organized with a talent for multi-tasking
REQUIRED QUALIFICATIONS:
3-5 years Flash programming experience
ABOUT OUR COMPANY:
We’re growing and expanding and looking for the right group of people. With our long history, it’s not just about talent and skills, but also about the chemistry you add to the group. We have long-term, close relationships with our clients, and amongst our team.
Quick Facts:
13 years in operation
Small group of professionals
South End Boston location
Markets include: Financial Services, High Tech, Music/Entertainment, Research, e-learning,
architecture/engineering/construction
XML in Actionscript 2: A Way to Cheat
6/20/2007 3:00
It used to be that if I had an XML document to parse and load into Flash actionscript (and I’m talking in 2.0 days) that I was going to spend all day on it asking each node, step by step, “DO YOU HAVE ANY CHILDREN? WHAT IS THE NEXT ONE? WHAT IS THE NEXT ONE?” until none of us could take it anymore. Then in one of my weeping fits one of the smurfs I see sometimes said, “Why don’t you see if there’s an Actionscript implementation of the easy-to-use XML parsing language, XPath?” So I checked and there was. I’ve been using it for almost a year now and it performs really well, you should have seen how proud of myself I was for finding it. Thanks to the Open-Source Flash community its now been a long time since I had to cut myself over an XML headache. The savings in band-aids have been tremendous.
The Most Maddening Bug of the Week
5/18/2007 5:14
When there's lots of complicated look-ups or exceedingly long drop-down lists involved in an application's workflow, I generally replace them with AJAX widgets- little bits of code that vastly improve the user friendliness of an application. I discussed the main method I use to do this in the previous blog entry, "Using the Adapter Pattern in Prototype."
This creates a situation where you have a form on a page and lots of surrounding Javascript widgets that operate on the form, usually setting hidden form fields. This week I had a "submit" event handler for the form setting two hidden fields, but the second field just wouldn't accept the new value in IE 7. The code looked like this:
-
$("courseList").value = str;
-
$("newHire").value = str2;
But when the form was submitted, the "newHire" field had its original value. Performing an "alert($("newHire").value);" following the assignment showed a popup with the expected (str2) value. Firefox posted the expected value of newHire, but IE7 refused to change it (though it changed the first field flawlessly). After pulling out my hair for three hours, I used this workaround:
-
//the id of the form is "myForm"
-
$("myForm")["newHire"].value = str2;
It now works fabulously with both IE and Firefox.
JSDUMP: Javascript - Coldfusion Object Inspector
5/14/2007 5:32
So you're building a sophisticated Prototype AJAX application with all kinds of request objectsflinging nested Hashes and dealing with JSON server responses. You're going to run into the problem of needing to explore your client-side javascript objects, especially if your server responses are JSON strings with embedded coldfusion exception data.
The first (rather obvious) approach is to convert the Hash objects to a JSON string, easy enough to do with a simple call to Hash.toJSON(), probably like this:
-
alert(myHash.toJSON());
Which admittedly is more useful than:
-
alert(myHash);
This would only give you a message saying "[Object object]." The toJSON() gives you a detailed debug string, maybe something like this:
-
{"foo":[{"var1":7},{"var1":32}]}
Given the dense character of javascript object notation, this is still a total pain in the ass. If your eye is very well trained to the grammar of object notation, you can extract useful information from simple examples but if you're dealing with queries or server-side exception data you're going to want a better way to inspect your objects.Inspecting complex data structures in ColdFusion is easy, you just use cfdump, giving you a pretty color-coded table with collapsible rows that makes it is easy to visualize the nested character of complex data structures. Wouldn't it be great to be able to do this with your client side javascript?
Here's a clever way to make ColdFusion do it for you with Prototype Ajax.Updater:
-
jsdump = function(obj_to_debug) {
-
var params = "json=" + obj_to_debug.toJSON();
-
var req = new Ajax.Updater({success:'debug_area'}, 'CF_json_dump.cfm',
-
{parameters:params, method:'get' });
-
}
This takes a Prototype hash object, sends it to a ColdFusion template called "CF_json_dump.cfm" and tells it to display the output in an HTML element that has the id attribute set to "debug_area."
Now here's the code for "CF_json_dump.cfm," which just takes the json string we prepared as part of the above code listing and uses the lovely CFJSON component to decode the JSON string into a ColdFusion struct (or array, nested structures/arrays, whatever).
-
<cfscript>
-
if(not isDefined("url.json")) {
-
url.json = "{}";
-
}
-
application.json = createobject("component", "json");
-
</cfscript>
-
<cfdump var="#application.json.decode(url.json)#">
Giving A Job Interview
5/14/2007 3:10
Today I had to conduct my first job interview, not as an applicant but as an interviewer. It was for a position like mine: a programmer-analyst do-it-all type who has to design, build, and support whatever it is that my agency decides it needs that day. Whether its a new module for our vast client management system or someone asking for a list of all the one-armed clients with freckles who were born on a Tuesday, it can be pretty varied and fast-paced stuff.
One thing's for sure: I wish I had put together a coding test because its pretty hard to get a sense of someone's capabilities when they've clearly been coached on how to tell me what I want to hear. You get lots of meaningless dribble about being an "eager team player." I'd be more impressed if an interviewee confessed to being a self-centered prima donna. I probed the boundaries of his technical abilities with specific questions and for the most part I got competent answers. But what I really learned had nothing to do with the candidate but about the nature of job interviewing itself: everyone's an over-polite bullshitter, which really frustrates the process of finding new team members. A few times I tried daring him to cut through it. After my coworker asked a few canned questions about why he wanted to leave his current position and getting one of those coached responses, I desperately wanted to ask, "Your current boss is a douche, isn't he?"
I don't expect a candidate to know about half the questions I ask about AJAX postbacks and CSS floating and clearing. I'm not looking for a direct technical answer, I'm looking to see whether their eyes light up or glaze over. If they light up, I know I have someone I can teach. If their eyes glaze over, I have a troglodyte who thinks AJAX is just a buzzword and who honestly can't imagine a role for object-oriented ColdFusion. It tells me nothing if they merely panic.
Its an odd thing to sit in a room with someone in a state of terror. I don't know if I learned anything actionable for future job interviews of my own, other than that most people know transparency when they see through it.
If anyone ever comes before me for a job interview, here's the playbook of how to impress me:
Refer to some great article you just read on A List Apart.
Know about Sliding Doors CSS technique.
If you're showing me a code sample with a SQL statement that starts with "Select *" you can stop right there. Don't call us; we'll call you (but probably not).
Demonstrate knowledge of a Bean/DAO design pattern.
Be nervous enough to look like you want the job, but not so nervous that you freak out and risk incontinence.
If you have a canned answer for a generic question like, "What is your greatest strength?" at least pretend to think about it for a second. Don't quote directly from "Who Moved My Cheese?" And don't say "my enthusiasm"- that's my stock answer.
Switching to iG:Syntax Hiliter Plugin
2/15/2007 3:26
Figuring out how to get Wordpress to respect my ColdFusion code has been surprisingly not very difficult for this Wordpress neophyte, considering the time I've been able to invest in it. With the simple preserve-code-formatting plugin I first used I had to copy and paste coldfusion code into invisible code tags that had to be created in HTML view- only to have cf tags removed after each edit! Much fancier is the ig:Syntax highliter. While it's not everything I'd hoped: there's still some extraneous html code showing up at the end of my RSS example.
One trick to the ig:Syntax highlighter for ColdFusion is that you need to add cfm.php to the ig_syntax_hilite\geshi folder of the install, which you will find in the GeSHi zip on sourceforge. (ig:Syntax is based on GeSHi, I'm not clear on the relationship but the file appears to (mostly) work so I'm done with it for now).
Here's my CSS to style the code:
-
.cfm, .javascript, .css, .sql {
-
background-color:#D3DFC1;
-
border:1px solid #473117;
-
padding:1em;
-
}
-
.cfm ol, .javascript ol, .css ol, .sql ol {
-
list-style:none;
-
padding:0;
-
margin:0;
-
}
-
.cfm ol li, .javascript ol li, .css ol li, .sql ol lo {
-
margin:0;
-
}
-
.igBar {
-
display:none;
-
}
-
.langName {
-
display:none;
-
}
Best Firefox Plugin EVER
2/10/2007 12:32
I just got my invitation to join me.dium.com, a private beta of a Firefox plug-in that allows you to see other medium users who are on the same web page as you and chat with them. This is going to be a very big deal. With 10,000 users and another 4,000 waiting to join I can imagine they're waiting to expand their server clusters before a public roll out, but it seems promising [update: its now 3 months later and NOBODY is using it].
Medium works like a Firefox sidebar with a chic slate gray interface (see this screenshot). At the top you'll see a circle with a bunch of icons representing the website I'm on and similar websites which may or may not have medium users. See that orange person with the plus in the middle on myspace? That's me. The little blue people are other medium users. Below the website HUD you'll see a tabbed interface- those are "chat rooms." The way it works is a little confusing at first: Type something in on the "Home" chat room and it creates a child chat room. People click on "join" next to the comment you leave in "home" and a tab opens for that chat room (you can see I have 5 chats open plus the "home" chat which appears to be local to the website I'm on). Basically any of those little blue people can see something you type in the "home" chat (and everything you say there becomes its own chat room).
Concerned about privacy? After all, these users can see what site your on, and clicking on the icon will navigate to whatever page they're on. The good folks at medium thought about that too: check out this screenshot.
Sweet.
More ColdFusion RSS hacks
2/9/2007 4:12
My BlogRSS component has progressed to generate the list of links you see at the left (if you're reading this on samedwards.net). So this has become a blog about making a blog... wow that's really something. But at least it forced me to slice up the background images and tile the middle with CSS. You can still faintly see a line where the top and bottom slices meet the middle but overall not bad.
Getting My Wordpress Blog Into ColdFusion Using RSS
2/7/2007 12:52
I wanted to integrate this blog with my existing ColdFusion pages and didn't want to resort to having a seperate php page for my blog. Since Wordpress serves a standard RSS feed, it was simple enough to grab it via RSS. Here's the code:
-
<pre><cfcomponent>
-
<cffunction name="getBlog" access="public" returntype="string" output="true">
-
<cfset var blogXML = "" />
-
<cfset var bFormatted = "" />
-
<cfset var tmpDate = "" />
-
<cfset var bArr = "" />
-
<cfhttp url="http://samedwar.setupmyblog.com/?feed=rss2" method="get" />
-
<cfscript>
-
blogXML = xmlParse(cfhttp.fileContent);
-
bArr = xmlSearch(blogXML, "/rss/channel/item");
-
</cfscript>
-
<cfloop from="1" to="#arraylen(bArr)#" index="i">
-
<cfsavecontent variable="tmpBlog">
-
<cfoutput>
-
<div class="blogEntry">
-
<h4 class="blogEntryTitle">#bArr[i].title.xmlText#</h4>
-
<cfset tmpDate = createodbcdatetime(bArr[i].pubDate.xmlText) />
-
<p class="blogEntryDate">#dateformat(tmpDate, "m/d/yyyy")# #timeformat(tmpDate, "h:mm")#</p>
-
-
-
#bArr[i]["content:encoded"].xmlText#</div>
-
</cfoutput>
-
</cfsavecontent>
-
<cfset bFormatted = bFormatted & tmpBlog />
-
</cfloop>
-
<cfreturn bFormatted>
-
</cffunction>
-
</cfcomponent></pre>
-
<div class="blogEntry"></div>
I still have to wire up the links you see to the left, but not bad for an hour's effort.