Monday, September 26, 2011

Coder at sea. Arg.

In the near recent (last few months) exploration of code and bugs,
I've run into many lessons to learn.

The lone coder.
It seems to happen more often than not.
A single coder is put in charge of a project.
Maybe even a large, long, daunting one.
And because of other priorities, maybe the testing is lax.
So when it is finally released out into the world, CHAOS ensues.
Everyone is then brought on to save the ship.
Scramble, late hours, quick fixes, fixes for the quick fixes, daily redeploys, defensive restarts.
And stability is still off in the distance, another week, two, a month.
So the more eyes, code reviews, the better.

Losing commits.
Having developers on different coding branches can cause this serious issue.
With the different streams of coding, there ends up being a lot of coding, especially if this includes production maintenance, an upcoming release, and new development.
And with those separate spaces (and especially with coders leaving), commits can get lost. The worst example: issues are broken again when fixes are lost, such as when a side branch (based off older code) is pushed to production.

In summary: JAXBContext. A memory hog.
This came up from explicit use and also from JAXWS. Recreating the JAXBContext is expensive and will block threads. I found this by wadding through thread dumps and finding half the threads blocked waiting to read a zip file for the JAXBContext creation. Both from explicit new instance creation (instead of just the marhaller) and from recreating the JAXWS service (instead of just the port).
This can grind the system down, cause constant garbage collections, and require hours of profiling (visualvm) and monitoring.

Error handling.
One example on a small but important project from a former coworker was fun to investigate. Well I thought it was fun, but it was time consuming.
On failing to copy a file, no errors were logged.
The user saw no error message in the UI, the log file was silent, the database had no mention of it.
After searching I found exceptions were being swallowed and the stacktrace message was too large for the database column it was being stuffed into (the database failure was at least returned in the REST call).
And later I found that database values are misconfigured (untested) and resources could have been deployed to production instead of QA (bad bad).
So these are some of the cleanups I've worked on periodically.

Sunday, September 25, 2011

Minecraft blocks

One of my birthday gifts was a set of magnetic Minecraft blocks.
But sadly the whiteboard at my work was not magnetic.

Finally after almost a month, I picked up a new magnetic whiteboard and here it is:

Put it up in my cubicle today. Nice to see one of my coworkers moving the TNT around under the animals.

Tuesday, September 13, 2011

Podcasts Update

I finally finished the last Cutting the Cable Firefly podcast (about the Serenity movie) on my way home from work and it included by feedback!
I actually wasn't expecting to hear it read over the show, so it was a nice surprise.
Mon, Aug 15, 2011 at 10:25 PM
Summer's almost over!

Hey guys,

Just writing in to say thanks.
I started listening to the Fringe podcasts last season and it really made me appreciate the show more.
It felt like I was getting more than just one episode per week of Fringe.

And so this summer I've been listening to the Cutting the Cable podcasts, enjoying them just as much.
I've seen Firefly in the past and loved it.
Although I'm not watching the shows/movies along with the podcasts, I still enjoy listening.
To/from work and just traveling in general, on my second hand old mp3 player.
As I type, I'm loading up the last few to get caught up.

So thanks!
And soon the summer will be over, Fringe will be back, and I can watch Nathan on Castle.
Oh and I'm super jealous of you going to Comic Con.
I hope to go some day. I did go to the last PAX East in Boston which was fun.


Thursday, September 8, 2011

Reading about Aliens?

I fairly recently finished a Dean Koontz novel, The Taking.
I found it at a bookstore (yes a real one with a real musty old paper/glue smell) for $3. After arriving home I thought about the purchase and expected I could find the book cheaper online. I was surprised to find it more expensive by $1 at Amazon, mainly for the shipping cost.
This was a crazy wild ride to read, keeping me wondering.
Basically there are some weird events happening that appear to be aliens invading, or demons, or both.
It all begins with hard rain falling constantly (apparently sucked up from the ocean) with various strange tastes/scents in the rain water.
I enjoyed reading descriptions of the rain when it was actually raining outside.
But then there is a strange feeling of something moving in the sky, a pressure coming down.
And more weird events. A dense fog ceiling. People disappearing or being attacked and killed, gruesome. Corpses reanimating. People floating through floors/ceilings.
And even weirder. UFOs flying overhead. Strange mushrooms with tentacles / people's faces inside, some moving around. Houses acting alive with creatures in their walls. Alien beings stealing people's faces in their hands. Characters/children being safe from the aliens.
I think the first half made some sense. A couple trying to survive. End of the world. Crazy weather. Spirits or zombies, aliens or demons.
But the second half seemed cluttered with all these different ideas that somehow evaporated at the end, literally.
So I enjoyed that it's an end of the world story with action and mystery, but not so much how it mixes in the grand question I think it's asking in the end. Is it possible that our ideas of aliens and demons, other universes and hell, could be one in the same? I'm sure after knowing this, it's probably better on the second read.

Birthday Gaming

Late night gaming on my birthday, played Battlefield 2 Bad Company.
Got kicked out of the second game we were doing well in. Ended up needing to update PunkBuster apparently. And later it randomly froze and I had to restart.
Otherwise, it was good to hop back on there for a few games.

Got some awesome Minecraft block magnets for my birthday (apparently from Etsy).
I tried to put them up on the whiteboard (I inherited from a former coworker) in the cubicle at my work, but apparently it cares not for the magnets. sad. i found a similar looking whiteboard on the Walmart site and it's made out of melamine (non-magnetic).

Thursday, September 1, 2011

More DnD Podcasts

No sadly not more Penny Arcade DnD, but I was alerted to a Robot Chicken DnD game.
I found them as videos on Youtube but I used a nice free service to convert them to mp3s and listen as podcasts,
I started to watch, but I realized I prefer listening. It's easier since I can listen on my commute. But mainly I enjoy imagining, which is harder when I'm staring at the players and reactions.
I think I'd probably listen to any DnD game hosted by Chris Perkins from Wizards of the Coast.

Bulk Work Tools

Recently a bunch of files needed to be fixed. Specifically a group of xml files needed to be generated online (on a logged in site) and then have text replaced in the files.
The plan was to divide the work among three of us, but I thought I could get it done faster/easier by automating it. And I was just curious to see how I could.
Sure, a simple script is one way, but I wondered what tools could do this. And so here is what I ended up doing.

I queried to get data needed to build the urls needed to generate each of the files. I put the urls in hrefs in an html file, simple regex replace to make the urls/links. I used a Firefox plugin, Download Them All, to auto download the files from all the links in the html file, and also rename them. Then I used Notepad++ to find and replace text in all files in the directory, Find in files. And that's it.
I do a lot of editing in a simple text editor, though it's usually been in Notepad2 instead of Notepad++, for source code highlighting (xml, etc), but that may change now.