Loading a UIImage from a bundle

I've been scratching my freaking head for an hour trying to figure out how to load an image from my application's bundle. Doing this in Interface Builder is easy as pie, but not so straightforward. [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"thefilename" ofType:@"jpg"]]; Easy, isn't it?

June 4, 2009 · 1 min · Aaron

Google App Engine & Java

So I've spent a few days going over Google App Engine for Java. So far, I have to say, I'm impressed. Google has created a really cool service that lets anyone write a Java web application and host it on their multitude of servers. This is all for free, I might add. You have to be aware of a number of limitations including no threading and you're limited to their data store for persistence. Once you get over that, you'll see the advantage of it: ...

April 24, 2009 · 1 min · Aaron

Microsoft WCF Web Services & Java

I spent a good 50+ hours on trying to consume a Microsoft WCF secure web service with a Java solution. I tried Spring Web Services, Axis2, and looked at Metro/Tango and decided Axis2 was the "easiest" solution. The web service I'm connecting to implements WS-Security, WS-SecureConversation, WS-Policy, WS-Trust and WS-Addressing (at least) and it's provided through a .NET 3.5 WCF endpoint. It doesn't work. Axis2 can't handle SpNego which is a WCF closed protocol allowing two WCF machines to negotiate the credentials between them. The client has spent way too much money paying me to continue to figure out a Java solution, so I wrote a .NET 3.5 C# client. Took me literally five lines of code and it's working. That's great for .NET developers but a whole lotta horse shit for the rest of the world. I'm hoping Axis2's Rampart module is updated to play nice with WS-SecureConversation and a .NET WCF web service. Until then, I'm using the .NET client to download the data and I'm storing the SOAP body into a database table. On the Java side, I'm still using JAXB2 to unmarshall the data into Java objects and process it through our existing persistence framework. ...

March 6, 2009 · 1 min · Aaron

When YOU are on the Internet

I've never been one to give a shit about what of "me" is online. I have blog(s), am on Twitter and many other social networking services. Up until now, I've pretty much said my mind and didn't care about the audience. I made a judgment call error a while back on Twitter, and now I'm correcting the issue. The question comes to be, how does one split yourself from your professional life online from your personal life? To be honest, it's fairly difficult if not impossible if you're trying to keep your identity at all the same between the two. For instance, I originally signed up with Twitter to broadcast things to my friends. A friend of mine got interested as well, and we started following each other. Then, I started working for the same employer and soon coworkers found my profile through my friend. I have always tried to keep some level of anonymity but when my real picture was plastered on my twitter profile, it was hard to hide the fact it was me. ...

February 16, 2009 · 2 min · Aaron

Getting Macs to play with Ubuntu

I'm a fan of Unix operating systems in general. That's what got me interested in switching to Mac OS X because it's Unix-based. It was inevitable that I would eventually get a server-class machine again that wasn't Mac-based. The new Dell machine that I have running has Ubuntu 8.10 - a Debian-based machine which is something I'm new too. I wanted to set up the Ubuntu machine to share files with the Macs on my network but not by using the crappy Samba protocol or even NFS. I know both are troublesome and not as speedy on a Mac. My only other choice was to get AFP working on the Ubuntu server and to my delight, packages exist for this. Netatalk is an Appletalk daemon and Avahi is a Bonjour zeroconf equivalent. Installing those packages and starting the services didn't do it for me. Leopard was having issues with the cleartext passwords being passed to AFPD so I went nowhere. ...

February 6, 2009 · 2 min · Aaron

Top 25 Most Dangerous Programming Errors

The SANS Institute released a report on the top 25 most dangerous programming errors in the industry on January 12th, 2009. Items such as SQL injection, Cross-Site-Scripting problems and input validation top the list. The issue brought up isn't necessarily the errors themselves but rather the education of programmers and software engineers to be aware of the problems and include testing to find them. Most programmers coming out of college today aren't specifically taught what is considered a bad programming error. Becoming familiar with the list and learning more about the errors you don't understand will make you a better and safer programmer. ...

January 14, 2009 · 1 min · Aaron

An idea for a college course :: Unit Testing

After spending a significant amount of time this week on writing JUnit tests for a Spring Web app, I've come to a conclusion. College courses, even in the grad classes I am taking don't spend enough time on the concepts behind unit tests. Granted JUnit and NUnit has been covered in the classes I've had but really only the testing framework is discussed. Test-driven development (TDD) teaches us how to write a test first, make it fail, stub out your methods, and then code until your test passes. The practicality of TDD in the real world is limited because a requirement is to have your system well designed up front. Getting to a point where you'll know method names ahead of time means you've spent a significant amount of time thinking about the design and analyzing that design. ...

December 25, 2008 · 2 min · Aaron

JUnit Testing

I'd like to point out that writing JUnit tests after the fact is a pain in the ass. I like to think I know enough about software engineering to develop software that has high cohesion and limited coupling. Not following test-driven development allows me to forget some of those simple rules and now writing EasyMocks is killing me.

December 23, 2008 · 1 min · Aaron

Springs of a Different Color

So I spent most of the past few months learning the bleeding edge of the Spring Framework, 2.5.x. The training I went to covered this version, the books I had covered the same. My first assignment? Using Spring 2.0 and Web Flow 1. Talk about crushed. Now I have to unlearn everything and go back to a previous version. This happens a lot, from what I've seen. Companies aren't willing to upgrade because of fear of stuff breaking; but they'll write shit loads of work-around code to keep old solutions working. That eventually bites them in the ass when the product they're on goes off support and they're forced to do a huge conversion. ...

October 17, 2008 · 1 min · Aaron

Domain-Driven Design

In my Thursday night graduate class, Enterprise Data Modeling, we're working through Eric Evans' book, Domain-Drive Design. The book is taking us through the concept of designing an application based on the domain, or business use, rather than through UML and directly with objects. So far, it's pretty dry but the concepts are very clear and relative to my world. I'm only on chapter 3 but already the concept of a ubiquitous language is a solidification of what I've tried to do since the beginning of my career with computers. I've always known, maybe not so consciously, that business users and developers typically live on different levels. In the past, I've been the one the users come to for help because I don't throw up the typical IT wall in front of them. This book explains why developers suck at obtaining requirements and why end users don't give two shits about developers. Developing a vocabulary and language that BOTH parties can speak about a domain is key. ...

September 14, 2008 · 2 min · Aaron