The amazing adventures of Doug Hughes

Archive for the ‘Blog’ Category

Getting Help

This is an article I wrote for my Java class at The Iron Yard. It’s being published here with permission.

Getting help

Often you will run into problems where your debugging strategies just don’t give you anything useful to work with. In these cases, you have to turn to other resources.

Craft a good question

The first step in getting help is to figure out the correct question to ask. Vague questions don’t lead to specific answers.

Instead of saying “when I click this button, it doesn’t work,” explain what you hoped it would do and what it actually does. To do this, you have to understand what it is you’re actually trying to accomplish. It might be a surprise to realize that sometimes you don’t know this. (more…)

Debugging Tools and Strategies

This is an article I wrote for my Java class at The Iron Yard. It’s being published here with permission.

If debugging is the process of removing bugs from code, then what is programming?

Undoubtably you’ve already run into a few bugs in your code. Figuring out the cause of these problems can be a frustrating and tedious experience. But, it can also be incredibly rewarding. There’s nothing quite like the feeling of finally squashing a particularly challenging bug.

As a professional programmer, you’ll be spending most of your time debugging. It’s virtually impossible to write code that works perfectly the first time. In fact, code that appears to work correctly on the first test will probably start to set off your mental alarm bells. The worry being, “what am I missing?!” (more…)

Today's Office Hours: Setting Up a Local ColdFusion Development Environment

I’m back again this week with another installment of Office Hours. Last week’s Office Hours went well and we all learned a bit about Git. This week Phillip Senn has asked to go over how to setup a local development environment for ColdFusion.

The show starts here at 3:30 pm today, Thursday November 8th. I’ll post a link to the Google+ Hangout and a link to the streaming video in this post around 3:15. I hope to see you this afternoon.

Join the hangoutor watchthe YouTube stream:

Office Hours: Git

I announced on Wednesday that I was going to start holding Office Hours as an open forum where I can help someone work through a problem they’re having. This week I’ll be working with Phillip Cenn to get him started with Git. Our session begins at 3:00PM ET. Up to eight people can join into our Google+ Hangout. Everyone else is welcome to watch the life stream below.

Google+ Hangout:

And this is where the live video stream will be:

Office Hours -or- I'm Unafraid of Making a Fool of Myself in Public

A couple of weeks ago I was honored to speak at the very excellent NCDevCon. While there I had a very interesting conversation with a guy by the name of Phillip Senn. Phillip expressed that he was looking for a mentor, someone who would push him towards better development practices and help him get unstuck when he encountered a problem he couldn’t get past. For example, he needs a bit of a push to get started with Git. He’d like to see how people setup their development environments, etc.

While I don’t really have the time or inclination to be a traditional mentor, the request got me thinking. I certainly don’t know everything there is to know about programming, but over the years I’ve gotten really good at learning new things quickly. I feel comfortable being thrown (or throwing myself) into new technical situations. I recognize patterns and can Google with the best of ’em.

So, Phillip and Iconceivedof what he dubbed “Office Hours”. The plan (at least for now) is for me to have a scheduled time to do a screencast where I help someone get started with or learn something new for free. I will be doing this in a Google+ hangout and streaming it live to my YouTube channel. I also plan to make archived sessions availableonline.

The first Office Hours will be this Friday, November 2nd from 3 to 5pm EST. Right before the office hours is set to begin I’ll publish the Office Hours Google+ Hangout URL, the live stream video, and any other relevant information. Those who are interested (up to 8 additional people) can join in the hangout and help out or follow along. Anyone else will be able to watch the video in real time.

For this first I will beworking with Phillip to help him get started with Git. Truth be told, while I use Git, I’m no Git guru. My intention, however, is to help him get it installed, create a new repo, commit code, branch, merge, etc. Basically, to give him a tour of as much of it as I can. I imagine this will be rather organic with a few false starts and dead ends before we really get anywhere. To me, part of what makes Office Hours interesting is that I’ll be learning while I do it too.

I want to make Office Hours a weekly event. I also want you to feel free to email me with your requests and suggestions. For example, perhaps you want help getting started with Node.js (or anything else). Just send me an email and, if I choose your topic, we’ll schedule a time for your Office Hours. I would request that you not limit your questions to what you expect me to know. If the topic is new to me I’ll work ahead and be ready to hit the ground running in our Office Hours session.

So, do you have any thoughts or suggestions? I’d love your feedback on the concept.



Doug @ NCDevCon – Javascript: things you never knew you didn't know

NCDevCon LogoI was pleased to find out that I’ve been invited to speak at at NCDevCon again this year. NCDevCon is a ColdFusion and web development focused conference event held annually at theCentennial Campus of NC State University in Raleigh, North Carolina. The even is put on by the fine folks at the Triangle ColdFusion User Group, aka. TACFUG.

Here are the details of my session:

Javascript: things you never knew you didn’t know.

So, you think you know JavaScript? I think not! There are a ton of small features hidden under the covers that many developers either don’t know about or don’t know how to use. This topic will go over an ad-hoc list JavaScript related goodies that I’ve picked up over the last year or so, including typed arrays, accessors, array folding, object inheritance, various tips and tricks, and more. Many of the topics relate to newer revisions of JavaScript and may not work in older browsers.

I hope to see you there!

Also, thanks again to TACFUG for inviting me to speak again! You guys are awesome.

Unborking VPN on OS X

For those of you using the inbuilt VPN features on OS X, you may have noticed that from time to time it will stop wanting to connect. For me, pretty much any time I disconnect from VPN, the next time I try to connect I will get an unfriendly message that looks like this:

VPN Connection An Unrecoverable error occurred. Verify your settings and try reconnecting.

This happens to me way too often. It can happen when trying to connect, it can happen after disconnecting and then reconnecting, it can happen without any apparent provocation.

In the past it seemed like the only option was to completely restart OS X. As you can imagine, this is not an acceptable solution to someone who keeps a lot of apps open, needs to use VPN frequently, and who doesn’t wish to waste time rebooting for no good reason.

Thankfully, Joe Bernard was able to track down the solution and was kind enough to share it with me.

Apparently there’s a process in OS X called “racoon”. Racoon is in charge of VPN connections. Here’s what Apple’s man pages have to say about it:

racoon is used to setup and maintain an IPSec tunnel or transport channel, between two devices, over which network traffic is conveyed securely. This security is made possible by cryptographic keys and operations on both devices. racoon relies on a standardized network protocol (IKE) to automatically negotiate and manage the cryptographic keys (e.g. security associations) that are necessary for the IPSec tunnel or transport channel to function. racoon speaks the IKE (ISAKMP/Oakley) key management protocol, to establish security associations with other hosts. The SPD (Security Policy Database) in the kernel usually triggers racoon. racoon usually sends all informational messages, warnings and error messages to syslogd(8) with the facility LOG_DAEMON and the priority LOG_INFO. Debugging messages are sent with the priority LOG_DEBUG. You should configure syslog.conf(5) appropriately to see these messages.

In a nutshell, Racoon gets borked. Sometimes this means that the racoon process needs to be restarted, but in my experience 99% of the time it means that it’s not actually running.

So, you can restart racoon from the terminal like so:

sudo /usr/sbin/racoon

I’ve also found that sometimes you need to restart the various networking interfaces you’re using. Because of this, I ended up writing a shell script I call

sudo ifconfig en0 down
sudo ifconfig en1 down
sudo ifconfig en0 up
sudo ifconfig en1 up
sudo /usr/sbin/racoon

I put this in my home directory, set it to be executable, and can run it like so:


Works like a charm for me. No more reboots to fix borked VPN connections! Productivity, here I come!

Tag Cloud