Posted on 1 Comment

Looking to go corp

I love working for myself. I love working from the house. I have worked the past 9 weeks for free because I was unable to collect on my last two major projects. My business practices have to change to prevent this from happening again.

There are five companies in the Knoxville area that could woo me back into corporate life: Scripps Networks, Jewelry Television, Bush Beans, SAIC (wow! SAIC IPO’d!), and Clayton Homes. I am sure there are others. I really know my stuff when it comes to ColdFusion. PHP, MS SQL and MySQL. ColdFusion is my love. I learned yesterday that Jewelry Television has a ColdFusion position available and I am applying. Wish me luck!

Posted on Leave a comment

Securing Contacts and Jobs

I just put a resume out on this one. Sounds fun!

Duties and Responsibilities:
– Assist in composing web pages and in creating special sections as assigned by the Site coordinator
– Work hands-on in the development of web applications (AJAX/HTML/Javascript)
– Competence creating table-free layouts
– Prototype, develop, and maintain new features and enhancements
– Operates as a leader/lead worker among other staff, shares knowledge or training with subordinates and/or colleagues to benefit the entire department
– Participate in workflow design and analyze existing production and implementation processes in order to insure the overall quality of the sites
– Maintenance and support of existing templates and content production processes
– Perform web development, template writing, testing debugging, documentation, and installation tasks for on-line processes in accordance with industry best practices and specific internal procedures and standards
– Partner with Web-ops to ensure that interactive techniques and technologies translate through to shipping products and services
[Source]

One of the challenges of working for yourself is you have to shoot at a lot of barns to hit some work. The problem is barns move pretty quick! Sometimes it is just plain difficult to find a barn. Then the barn’s owner looks at you and may not even give you permission to shoot at the barn in the first place much less give you the barn.

Playing low budget developer and sales person at the same time can lead to missed deadlines or living with very little sleep. Finishing a project, then turning on sales mode can lead to dry spells where you wonder how you’ll eat. Ideally, you should be working with a sales person!

Posted on Leave a comment

Ill logic

Sometimes I feel less like a programmer (or am I a developer?)

  • Developers have some knowledge of the domain and the business
  • Developers care about maintenance burden
  • Developers know that work methods are more important than technical chops
  • Programmers try to solve every problem by coding
  • Developers seek repeatability, programmers like one-off heroics
  • Programmers like complexity, developers favor simplicity
  • Developers care about users
  • Developers like to satisfy a need, programmers like to finish
  • Developers work, programmers play

[Source]

Well, right now I could go either way. Mostly if I can’t get over this technical hurdle I’m going to go nuts and beg for a phone support job. By his definitions, usually I am a developer.

Posted on 2 Comments

Lower the bar!

I have to quit taking on the impossible projects.

What am I doing now? My current contract is to allow a user to enter a single product id or a list of product ids then go out to a government website and download the 17 or so pages of pdfs for each product. Then I combine the multiple pages of pdf documents into a single pdf document and present it to the user for download to their local machine. I may end up inserting footer information into each page of the pdf. I have to do this for 4 different countries. Then I have to convert the code from php 4.4.4 to php 4.0.0.

Posted on Leave a comment

Why document?

Because I have just spent 20 minutes trying to figure out what 1, 3, 5, and 6 mean in regard to access levels. Had the previous developer added a single comment to the database design to say 1=guest, 3=admin, 5=customer service, 6=suspended or the like my job would be more manageable.

Developers should document at a minimum within the code and in an external document. Further documentation can be injected into many other places such as the database table design via Enterprise Manager. Once you make commenting a habit, the pain goes away and it almost becomes fun.

Posted on 5 Comments

Bring Me A Rock!

In the Quality Assurance world, we sometimes talk about rocks. Putting aside the middle managers, the product team, customer service, the project manager, the end user and so forth, a product ultimately falls to 2 people or groups: the client and the vendor. The client describes what they want; the vendor fulfills the client’s needs. The industry does not matter; could be software, could be construction, industrial supplies, whatever. And the problems begin with the first conversation. See, the client and the vendor speak the same language but in different dialects. The customer speaks and the vendor thinks they understand and drawing upon their experiences in their industry moves on to make the product for the client.

Here is how it works:

Client: "Bring me a rock!"
Vendor, eager to satisfy: Rushes out and finds the perfect rock. Cleans the dirt from the rock. Polishes it and returns it to the client.
Client: "Not that rock! Weren’t you listening? I said, ‘Bring me a rock!’"
Vendor, thinking he understands better: Goes out, spends twice as long, finds the perfect rock. Cleans it, polishes it, checks with some managers who agree it is the perfect rock. And returns to the client.
Client: "Not that rock! I want flatter rock. That rock is too round. Bring me a rock!"
Vendor, slightly dejected but still enthused: Goes out, kicks around some rocks. Notices all rocks are round here. Travels to another location. Finds a nice flat rock. Returns to client.
Pattern continues…
Eventually…
Client: "Now that’s a rock! Why didn’t you bring me that one in the first place? Could I have two for the price of one?"

The subtle differences in the dialect and the assumptions made on both the client’s part and the vendor’s part often result in a frustrated vendor and a dissatisfied client. Unfortunately client’s often get frustrated when the vendor asks too many questions about the rock in the beginning. The client doesn’t understand why the vendor is so dense. When the client buys into the need to clearly define a specification at the beginning of the project, time, money and aggrivation is saved!

Really, Bring Me A Rock applies to all walks of life. We do this to our children too. "Clean your room." "I’m done. Room’s clean." "That room is a mess!" See the problem?

Posted on 1 Comment

CSS3 is coming!

CSS3 is coming! CSS3 is coming! Cascading Style Sheets allow design to be separated from programming. Before quality support of CSS within web browsers, designers and programmers had to rely on tricks to make the site appear correctly. One technique even included creating separate documents for each of the major browser, detecting the browser version, and presenting the correct document. What a pain!

With CSS, a programmer can create an HTML document sematically. In short a programmer can write code that says, "put a paragraph here" without worrying about what a paragraph’s appearance should be. That is, the programmer need not concern themselves with size of the font, indentions, emphasizing the first word, and so forth. The designer can manage that all through the style sheet.

Is it me or wasn’t vertical alignment of text promised in CSS3? I don’t see that in the list!

Posted on 1 Comment

All Things Web 2.0

View a list of the best and most popular web 2.0 applications. What is Web 2.0? It is being hailed the next generation of web applications. In reality, it is an old concept. The way the World Wide Web works is a client computer (your web browser) makes a protocol request (typically http) to a web server which then talks to other servers (ColdFusion, PHP, mail, news, etc.) and returns a document to your browser. We experience this as a screen refresh and the little icon in your browser spinning around like an abnoxious hourglass. Web 2.0 gives the illusion that the wait, the hourglass, has been eliminated. It uses JavaScript tricks to make the requests behind the scenes. You can witness this by adding something to your Google Calendar. Notice the word "Loading…"? That has replaced a total page refresh.

I have problem with Web 2.0 and that is accessibility. For years web developers have held back on certain capabilities in order to not limit their audience. I would ask my clients, "how successful would McDonald’s be if they turned away 80% of their customers?" In the early days relying on something like JavaScript could be just that limiting. As a business, you have to know who you are serving. If your customer base is primarily Mac users and your web developer says, "I don’t support Safari." then you need to decide if you are going to fire your web developer or your customers. Browsers have come a long way and for the most part are much more compliant and compatible and almost all support Javascript. So where is the accessibility problem? We have far more computer neophytes using computers today and playing on the Internet (primarily via the World Wide Web). Apply firewall settings too strictly or get overly aggressive on popup blocking and you may find that Javascript is disabled. Try disabling Javascript and use Google’s calendar. They can afford to turn people away. Can you?

Use Web 2.0! It is cool and what people will expect of your application. However, write it to degrade nicely. Detect that Javascript is disabled and, if so, present your site Web 1.0 style.

Posted on Leave a comment

ColdFusion Event Gateway / Web Service Gave Me Trouble

My programming love is ColdFusion. I have been working with it since early 1998 with the release of version 3. Version 8 will release next year. A feature of CFMX7 that I have not had the opportunity to use is the Event Gateway to turn a CFC into a web service.

ColdFusion event gateways are ColdFusion MX elements that let ColdFusion MX react to or generate external events or messages in an asynchronous manner. Event gateways let a ColdFusion application handle information that does not come through an HTTP request. For example, you can use event gateways to handle instant messages, short messages from mobile devices, or messages sent to a TCP/IP port. [Source]

The Project

I have a project that uses XML feeds to update inventory status from a wholesaler to the reseller. Unfortunately, do to problems at the wholesaler end, one of the feeds is unavailable and will remain so. The solution is to use a query of the database to obtain IDs of the active products then use CFHTTP to get the information from the wholesaler’s website (site scraping). Since there are roughly 1500 active products at any one time, making 1500 CFHTTP calls at once causes timeouts as the browser gives up before the webserver can finish its task. Since this update will be done only occasionally, 1500 requests to the wholesaler is not a big deal.

The Solution

The solution to the problem is to implement the CFHTTP request as a CFC, create a gateway instance with a 5 minute timeout, and call the gateway instance with small groups of product ids from a .cfm page. The concept works beautifully since the Event Gateway is asynchronous and decoupled from the browser which initiated the instance.

The Problem

I choose the .cfm to manage grouping the product IDs so that there would only be one query instead of 150 queries (~1500 products in groups of 10) as would happen if the query were within the CFC. So the code builds a list of IDs within a structure (as required by the Event Gateway)

The onIncomingMessage method must take a CFEvent structure that contains input information in its Data field, and processes the contents of the Data field as needed. [Source]

The loop that calls the gateway instance builds the list, calls the instance, clears the list, builds the next list, calls the instance, and so forth. Apparently I am able to alter the datastructure so quickly that the second list replaces the first list before the gateway instance fires so the CFC ends up processing only the information from the latter lists. More simply, the CFC processes whatever data is in the structure at the time the gateway event fires from the queue not the state of the structure at the time the gateway event was called by the ColdFusion application. Set up a gateway instance and try the following code. This is the CFC to which the gateway instance will be associated.

test.cfc

<cfcomponent displayname="Test Gateway" hint="Logs the idlist passed into the CFEvent.Data structure.">
   <cffunction name="onIncomingMessage" access="remote">
      <cfargument name="CFEvent" type="struct" required="yes">
      <cflog
         text="Gateway test complete for ids #CFEvent.Data.idlist#."
         file="GatewayTest"
         type="Information"
         application="Yes">
   </cffunction>
</cfcomponent>

The calling CF application is show below

test.cfm

<cfscript>
   datarange = structNew();
   tmplist = "8,1008,1019,1020,1021,1022,1024,1025,1026,1027,1030";

   datarange.idlist = duplicate(tmplist);
   datarange.datasource = "adult";

   status = SendGatewayMessage("TestGateway", datarange);

   tmplist = "8,20,19,18,17,16";

   datarange.idlist = duplicate(tmplist);
   status = SendGatewayMessage("TestGateway", datarange);
</cfscript>

You would expect the log file to have two different lines.

Gateway test complete for ids 8,1008,1019,1020,1021,1022,1024,1025,1026,1027,1030
Gateway test complete for ids 8,20,19,18,17,16

but instead it has two identical lines.

Gateway test complete for ids 8,20,19,18,17,16
Gateway test complete for ids 8,20,19,18,17,16

The Solution

I have not tested the solution yet but I am betting that I either

  1. have to let the CFC call the gateway instance after it has processed a batch of ids thus making this a synchronous process to itself but still asynchronous to the browser or
  2. Create a unique structure for each group of IDs to be processed

I prefer the latter. Update: Testing is complete and solution #2 works great!

Other Resources

About event gateways
Abobe’s (fomerly Macromedia formerly Allaire) overview
Deploying an event gateway
Macrodobellaire’s livedocs for initial setup of an event gateway
Using the CFML event gateway for asynchronous CFCs
This was the most helpful livedoc with critical information non-chalantly hidden within such as "Using the CFML event gateway for asynchronous CFCs"
SendGateWayMessage
Livedocs for SendGatewayMessage
The Asynchronous CFML Gateway – A Real-World Example of a Great New Technology
Matthew Woodward comes through in this ColdFusion Developer’s Journal article
Understanding Asynchronous Processing by Ben Forta
It wouldn’t be ColdFusion unless Uncle Ben said something.
Concurrency Library
It is very difficult to mention asychronous CFML without someone mentioning Sean Corfield’s work.
XML Path Language (XPath)
XPath is a language for addressing parts of an XML document, designed to be used by both XSLT and XPointer.
XPath Axes
XML Lessons at W3Schools
Posted on Leave a comment

Can’t see the code for all the debugging

So I’m pulling my hair out and pulling my hair out trying to figure out why my code isn’t working. In the process I resolve a fairly significant logic flaw (which is a good thing) but still it doesn’t seem to work and nothing is changing in the results when I finally remember that I put maxrows="10" on the <cfoutput> for troubleshooting.

Long and short that means I couldn’t figure out why anything past the 10th record was not updating and the reason was because I told the code not to update anything past the 10th record.

Thank you for joining me for that moment of Geek Zen.

Posted on Leave a comment

That thing programmers do

I’m doing that thing programmers have to do all too often. Today I’m staring at some gibberish and in as brief a time as possible I am absorbing it into my very essense. I can feel my brain swell with the influx of knowledge! Information overload. The synapses cannot fire fast enough and information gets arbitrarily filed in odd places.

Ok. Let’s see. When I was 8 years old after playing Axes (and Allies) I was thinking about searching for my descendants while skipping through the xpath in the woods.

Posted on 5 Comments

Are you cleaning up with AJAX?

AJAX bugs me because a bunch of developers that used to say "we can’t do that because we would limit our market" jumped on a bandwagon that potentially limits their market (ie. browsers that don’t support javascript or have javascript disabled don’t support AJAX). Try using Google’s calendar with javascript disabled or change your user agent to an unknown browser.

Regardless, all developers worth their salt should do some dabbling in AJAX. Here is a nice list of 126 examples.

Posted on Leave a comment

Fake a Left Outer Join with ColdFusion’s Query of Query

Since a Query of Query only supports INNER JOIN syntax, many developers are left frustrated because the incredibly useful LEFT OUTER JOIN is unavailable. Alistair Davidson has come up with a solution using the support UNION syntax.

For those of you now asking "what is an inner join? What is a left outer join?" I have provided an explanation in pictures and words. (complete with a typo of the word "columns")