Archive for the ‘Software Development’ Category

Last week, I did loose a lot of time in what should have been a quick ColdFusion hack. My colleagues and I were just trying to set up a web service-based solution for a simple problem: they had a JavaScript page that needed a bit of data for which I already had the code in ColdFusion. So I created a new directory in an existing application, whipped up the required code in ‘index.cfm‘ to return a bit of JSON and tested the result from my browser… only to get an “Error 500 - Application index.cfm could not be found“.

Weird, heh? The required file was there, so why could CF11 not find it? Adding an ‘Application.cfm‘ did not help, neither did repackaging the code in a CFC. On CF8, on the other hand, everything worked as expected. So what was going on?

It took some time, but I did find the explanation: CF11 reserves the directory name ‘api’ for special treatment, so you can’t use it like any other directory name – and of course that was the name I had chosen! Adam Tuttle described the situation nicely in 2015:

Funny you should mention that the issue is inside an /api folder. I’m trying to track down the same problem, except I’m directly accessing an index.cfm (sort of — onRequest intercepts the request and redirects to CFCs as appropriate — it’s a Taffy API) and I’ve found that renaming the folder from /api to … literally anything else… works fine. It’s almost as if something in CF has special meaning at /api, like the special /rest mapping does.

Indeed, renaming my directory solved the problem – too bad it took me so long to find the cause. On to the next problem!

PS. Adam Tuttle has more to say on the subject, but his post on the subject has disappeared: the URL ‘http://fusiongrokker.com/post/coldfusion-11-sometimes-chokes-on-api‘ no longer points to the relevant text, but is redirected to another blog also belonging to Adam Tuttle. There, unfortunately, the post is NOT available. I won’t call this a case of linkrot, but it’s not good either. Luckily, the Wayback Machine has a copy of the page, including a few comments…

Read Full Post »

Brent Simmons isn’t a new name in this blog – I have cited his name several times since 2001. A few days ago he wrote:

It’s been years since I could build the Frontier kernel — but I finally got it building.

The high-level goal is to make that tool available again, because I think we need it.

The plan is to turn it into a modern Mac app, a 64-bit Cocoa app, and then add new features that make sense these days. (There are so many!) But that first step is a big one.

“Frontier Is Interesting”, says Jim Roepcke – click to see what he writes

It’s an interesting development, from several viewpoints. I wrote some of my first “web applications” in Frontier, and that makes that Frontier will always have a special place in my book of tools. It’s also nice to see a relevant piece of software evolve so that it continues to run on modern hardware and OS’s. At some point, I will certainly download and run a copy on my Mac.

But the question is: do I want to go back to developing stuff in Frontier? Do you want to?

Read Full Post »

It’s something I need to remember: how do I install an old PyUSB package on Xubuntu (or a similar Debian-based OS). Why, you ask? Because I need that old version 0.4.3 for the little script that reads the solar energy numbers from the SMA Sunny Beam.

Image of the SMA Sunny Beam monitor for our solar panel installation

The SMA Sunny Beam monitor for our solar panel installation

Luckily, it isn’t too hard to do. This is my context:

Step one is to make sure you have the required header files to compile the PyUSB package. So you open up a terminal session and execute

sudo apt-get install libusb-dev
sudo apt-get install python-dev

Step two: Extract the root folder and all the files from the PyUSB archive, and make that folder your current directory in the terminal session.

Step three: compile and install the package with this command:

sudo python setup.py install

That’s it. When all goes well, you’ll be able to verify the existence of two new files on your system, in a directory called “/usr/local/lib/python2.7/dist-packages“:



Read Full Post »

More than 8 years ago, I wrote about the Google App Engine as a platform. Much as I liked the concept, I also remarked that it would be… great to have a complete development environment within the browser, coupled to a runtime.

Turns out that Fog Creek, the software company founded by Joel Spolsky, has built just that: “a developer playground for building full-stack web-apps fast“. It’s called Gomix – but it was called HyperDev during the development of the product. That ties in neatly with my reference to HyperCard as an example of a simple tool that allows anyone to built the tool she/he needs. Nice work, Joel !

So here it is, my first “app” in Gomix (just for fun and with lots of tongue in cheek):


Read Full Post »

The InterWikiLinksPlugin, my small addition to JSPWiki is part of the JSPWiki source tree (or at least is was somewhere in 2009). But Pikacode managed to lose the version I installed there, so I am storing it for posterity on this site as well ;-)

Click the image to download the PDF

Click the image to download the PDF

I had to package it as a PDF file here in WordPress.com, but just copying the text content of the file and saving it as a Java file in the JSPWiki Plugins source directory should suffice for a successful compilation.

Read Full Post »

I just spent yesterday afternoon debugging a somewhat older ColdFusion+JavaScript application: some of the administration functions were not working. A partial explanation for my time spent on the issues is that the application was developed in the days of Internet Explorer 5. We’re still running IE6 on a substantial number of the several thousand PC’s in use in the company… in combination with an older version of Chrome. So refactoring the JavaScript code (to make it work in both browsers) was part of the ‘fun‘.

In the end, the real cause of the core problem I encountered was to be found in a few SQL statements that I had neglected to check out, wrongly assuming they had been working in the past. The reason they continued to slip under the radar was simple: the original developer had managed to “hide” that SQL code in a <cftry> statement with an empty <cfcatch>. So there was nothing in the logs, of course.

From the OWASP website

From the OWASP website

Finding the root cause reinforced a lesson I had learned a long time ago: only catch exceptions if you’re going to do something serious and meaningful with them. No, swallowing them whole isn’t meaningful. OWASP summarizes: “Swallowing exceptions is considered bad practice, because the ignored exception may lead the application to an unexpected failure, at a point in the code that bears no apparent relation to the source of the problem“.

This story teaches a second lesson as well. In the future, I will scan code for exception swallowing situations before I start debugging – that could have saved me a lot of time today!

Read Full Post »

Ray Camden wrote about the CF log file enhancements in CF9 a few years ago: “CF901: Logging enhancements“; among other things, he explained the possibility of disabling and enabling logging into particular log files. This is supposed to work in exactly the same manner in CF11. Since then this theme wasn’t discussed much. That’s too bad, because I have a strange problem in CF11, and there are no clues to find on the internet.

Here’s my situation:  I accidentally disabled a custom log file for a Scheduled task, and now I can’t find a way to re-enable this log. I tried hijacking the “disable” link by replacing it with “enable”, but that did not work – not even after a restart of ColdFusion.

I needed some time to figure out that I could go on with my work again by renaming the .cfm file as well as the log file, but that does not really count as a solution. So all advice to get this specific log back to work will be appreciated!

Read Full Post »

Older Posts »