Nov

27

Posted by : Billy | On : November 27, 2011

Small tip, but this held me up a bit.

For unit testing in ColdFusion, MXUnit is the standard. Even better, you can run your tests from within Eclipse, via a plugin.

After dropping MXUnit into my app (OSX 10.7.2 on dev machine, Eclipse+CFEclipse, Tomcat 7.0, Open BlueDragon 2.0 – had some pathing issues, but that’s another post…)

Right clicking on a unit test (such as in mxunit/samples/MyComponentTest.cfc) and selecting Run MXUnit Test, I received the following error:

Turns out it was going to port 80, rather than the port my CFML engine was running on (8080 in my case). This is an Eclipse preference:

Change the port to “http://localhost:8080/…” (or whatever you’re running) and it should work

Nov

27

Posted by : Billy | On : November 27, 2011

I’m trying to get back on the git train. I worked with it on a project a couple of years ago, and really liked it, but since then, I really haven’t strayed from Subversion. Truth is, svn is easy: there are more tools, and you don’t have to deal with SSH keys and whatnot. However, on my current project, I really run the technology, so I really wanted to do thing the “right way”.

Our project management solution is Assembla. We were on Unfuddle, which is pretty good, but Assembla offers more. (I flirted with using a private GitHub repo) Some of the advantages Assembla offers:

  • Single project workspace, multiple repos. I like being able to tie checkins to tickets, but don’t want a single set of tickets: other solutions are one-to-one or many-to-many with their tickets projects and repos.
  • Support for post-commit hooks
  • Integrated chat (not really useful, but makes impromptu chats without requiring folks to run IM clients)
  • Agile planning tools: This was the thing that no one else seemed to do. It features burn down charts, a Kanban card wall, virtual stand-up meetings, per sprint hour summaries, and more.

On agile: I’m the only developer – does agile make sense? Absolutely!! I frequently have to drop things at a split moment’s notice and work on something else: it’s imperative I inject tasks and still keep sight of the overall progress. I could really go into this, but that’s for another blog post.

So I set up my git repo in Assemba, committed locally, and was ready to push. (This isn’t a git tutorial … we’ll get to the point here in a minute) However, the connection failed when doing the following:

git remote add origin git@git.assembla.com:myrepo.git
git push origin master

You want to make sure you properly set up your SSH keys:

  • When setting up your SSH public key in Assembla, it’s easiest to upload (https://www.assembla.com/user/edit/edit_git_settings) your pub file (for example, id_rsa.pub). If you’re on a Mac, you’ll either have to enable seeing hidden folders (since it’s in ~/.ssh), or copy it someplace you can easily get to from browser:
    cp ~/.ssh/id_rsa.pub ~/Desktop/id_rsa.pub
  • Make sure you have git configured with the email address that you use to login to Assembla:
    git config --global user.email myassemblaemailaddress@example.com
  • This was the one I still had to do to make it work .. configure your SSH hosts by editing ~/.ssh/config with the following: (if there’s other entries, just add to bottom of file)
    Host git.assembla.com
    IdentityFile ~/.ssh/id_rsa
    GSSAPIAuthentication no
    PubkeyAuthentication yes
    PasswordAuthentication no

That did the trick. I realize I left much about git out here (for example, you may not want to globally set your email address) but I just wanted to show what worked for me.

Sep

04

Posted by : Billy | On : September 4, 2011

Due to how Google Chrome handles “untrusted” SSL certs and the fact that Selenium uses its own cert when running tests, if you hit an SSL URL in Chrome when running a Selenium test, you’ll get a big ugly red screen asking you to confirm the security exception – and you’ll have to do this for every single test! Not good if you’re automating multiple tests, and unlike Firefox, you can’t permanently set the exception.

Solution is readily found, but I want to clarify how you use it, since I had trouble with it. You use the -trustAllSSLCertificates flag, but you specify this when launching Selenium (I was under the impression you specified this to the browser arguments when calling .start())

java -jar selenium-server-standalone-2.2.0.jar -trustAllSSLCertificates

Sep

01

Posted by : Billy | On : September 1, 2011

This afternoon I was interviewed for a pretty big podcast – .NET Rocks. .NET Rocks is of course focused on .NET, but it also talks a ton on other technologies as well. I had the privilege of talking up ColdFusion on their show. As in any situation where you’re speaking in a “public” setting, there are things you wish you had said, or had said differently, but on the whole, it went well. The show is to be published on September 8, 2011.

Jul

13

Posted by : Billy | On : July 13, 2011

I’m developing an app I plan to deploy to the Amazon Web Service Elastic Beanstalk. While I could develop it in my own environment, package as a WAR, and then upload, it’s far easier to get the AWS SDK for Eclipse:

  • install the plugin in Eclipse
  • create a new AWS Java Web project
  • drop all your files inside of WebContent (including your app engine if you’re using one – in my case, I’m using Railo)
  • test via a local copy of Tomcat: Run as > Run on Server > select configured Tomcat instance
  • when you’re done, just deploy to Elastic Beanstalk via Eclipse

Problem is that the URLs it generates locally aren’t very friendly: http://localhost:8080/myprojectname. This differs from what it’ll look like in production, which isn’t good, and even if I can come up with a workaround, why?

Note that making your changes inside of Tomcat config doesn’t do the trick – you’re deploying to your local Tomcat instance via Eclipse, which brings along its own settings.

Changing the port was easy:

  • stop server (Servers tab, right click server, Stop)
  • double click server name, brings up property page
  • expand Ports on right, click HTTP/1.1, change to port 80
  • save (Ctrl+S) – you’d expect to see an OK or Apply button, but this is just a front-end to an XML file, so just save it

Since port 80 is the default HTTP port, now your URL is http://localhost/projectname. Closer, but not what I want.

Actually, changing the path is very simple, but I searched for a while, and finally found it.

  • go back to the server property page, and look to the very bottom .. click on Modules tab.
  • Find listing for your app, which is probably only one listed. Highlight, click Edit, and change path from /myproject to /
  • save file

Now when you run your app, you’ll get http://localhost

Jul

04

Posted by : Billy | On : July 4, 2011

Currently I’m trying to write a service bus using Amazon’s Simple Queue Service. The idea is to use gateways in ColdFusion, or in this case, in Railo. To do this, you write a watcher, listener, and driver. These are added inside of the Railo directory (bit of a new concept for me, since for 12+ years of working with Adobe ColdFusion I’ve never really touched the CFIDE directory). However, no matter what I did, I couldn’t get my new driver (SQSWatcher) to show up. Maddening!

Turns out my confusion was where the Railo install directory was. I’m running Railo inside of Tomcat on Ubuntu, so here’s the thing: it looks like Railo is installed to:

/opt/railo

All the files are there: the admin files, what you need for the gateway, and everything else Railo needs to do its thing. Apparently, these are a duplicate of the “real” Railo install, which is inside of

/opt/railo/tomcat/webapps/ROOT/WEB-INF/railo

Makes perfect sense, since Railo is just an app inside of Tomcat, but why the duplicated files in the parent directories? (Probably used for other install types, but seems installer needs to be reworked a bit to know if it’s a Tomcat install or not)

Apr

04

Posted by : Billy | On : April 4, 2011

As languages mature and add functions, we find them using function names that we ourselves would use. For example, a recent application passed metadata along to a PDF writer function.. makes sense to write a function called GetMetadata(), right? Well, turns out that’s already used in ColdFusion. So within my CFC, even though that function was defined, calls to the function retrieved what was internal to ColdFusion (CFC metadata, for those curious) without throwing an error. So, how do we call our CFC’s function without renaming it? By referencing it as this.GetMetadata()

Feb

12

Posted by : Billy | On : February 12, 2011

Fonts have always been tricky on the web, and while techniques have emerged in recent years with regard to replacing them, I’ve drug my feet a bit, and have always taken the easy way out (use “web-safe” fonts or use graphic replacement, which can hurt SEO). On a recent project, I chose to do it the right way. I initially considered Cufon, which is awesome, but decided to try my hand with @font-face. Nice thing about it is it’s one of those few techniques that actually has rich Internet Explorer support, though you have to have the right file format, and have some additional CSS. After some digging for conversion tools, I came across a @font-face generator:

http://www.fontsquirrel.com/fontface/generator

Not only does it do conversion, it creates all the possible formats you could need: TTF, Web-only fonts, iPhone (prior to iOS 4.2), SVG, and it generates your CSS. It must be noted that you should always have the proper license for font embedding: if in doubt, contact your font foundry.

This should probably take care of all my needs.. I’ll go with Cufon if I identify any edge case scenarios.

Feb

11

Posted by : Billy | On : February 11, 2011

Security is tough. We tend to convince ourselves that it isn’t as tough as it really is, basing our premise on the lack of a negative experience: no one has broken in, so no one can. More likely is the idea that you haven’t attracted sufficient attention. But when you do …

Much has been written in recent months about the so-called “Anonymous” and their attacks and mayhem connected with Wikileaks. The CEO of a security firm decided to go undercover and dig up some info on this pseudo-group, and it didn’t turn out so well for him and his company. What’s the worst thing that could happen to a security firm?

http://arstechnica.com/tech-policy/news/2011/02/how-one-security-firm-tracked-anonymousand-paid-a-heavy-price.ars

Feb

08

Posted by : Billy | On : February 8, 2011

On the Railo mailing list, someone was mentioning the trouble they were having adding entries to their hosts file.
The key is you need to edit it as administrator. When opening Notepad(++), right click and select “Run as administrator”.

I edit my hosts file often (I like domains like “myclient.dev”), so I set up a shortcut on my desktop:

  • target:
C:Windowsnotepad.exe c:WindowsSystem32driversetchosts
  • click Advanced tab, check “Run as administrator”