Pages

Thursday, April 08, 2010

iPhone presentation

What a great turn out for the iPhone presentation last night. Thanks to everyone that came out. I've updated the Google Groups page for the presentation with links to blogs and other interesting information pertaining to iPhone platform development.

http://groups.google.com/group/jamsessions/web/10-04-07-iphone-os-the-next-killer-platform

A huge thanks goes out to my co-presenter, Bob McCune. The SenateJam demo was a big hit.

Sunday, April 04, 2010

Preparing for DevJam Jam Session iPhone presentation

I've been spending some time working on an iPhone development presentation that Bob McCune and I will co-present at DevJam's Jam Session this coming Wednesday. I was looking at job trends at indeed.com--iPhone is #3 on the list of top job trends. Here's the graph:



Wow! Talk about growth. Looking forward to the presentation.

Saturday, April 03, 2010

First impressions of the new iPad

What a beautiful device! A little bit heavy to hold in one hand for an extended period of time. Smudges from finger taps and swipes are more noticeable on this device, especially when reading text. I'll have to investigate a protective film and see that makes any difference.

The processor in this device is very fast; the device is very snappy with animations, games, and video. I can see game makers really going after this thing. EA seems to have a couple of games out for the iPad (I tried Scrabble and Need for Speed). Game control was very good for Need for Speed.

Transferring .epub files to your iPad

Transferring .epub files purchased outside of iTunes seems to be very easy. Download the .epub file to your computer. Open up iTunes and select File -> Add to Library... menu item. From the file chooser, select the .epub file that you want to transfer to your iPad. Click Choose and the eBook file will be added to your Book Library in iTunes 9.1. Sync as usual and the book will show up in iBooks.

Tuesday, March 23, 2010

Nice Mercurial tutorial by Joel Spolsky

Joel Spolsky (of Joel on Software) wrote a very entertaining and thorough tutorial on Mercurial, a distributed version control system (DVCS). The tutorial has a Subversion re-education pre-tutorial for those of us with Subversion brain damage. Well worth a look. Sadly, Joel will no longer be blogging, citing the need to focus on his growing software company. His musings on software development will be missed.

Friday, March 19, 2010

Mockito's @InjectMocks annotation does reflection-based DI

I've been using @InjectMocks heavily lately since it came out in version 1.8.3 of mockito. The javadocs for this annotation state that it uses setter injection to inject its dependencies. Being a lazy developer, I was writing a unit test yesterday at work and forgot to write the setter methods for a couple of dependencies on the SUT that I was testing. Lo and behold, the test passed and all mock verifications were satisfied. Very confused, I went back to some other unit tests and their SUTs and removed the setter methods. In all of my cases, the tests continued to pass. A quick note to the mockito list confirms what I discovered--@InjectMocks actually is using a reflection-based DI scheme, not unlike what Spring does when you annotate collaborator fields in a Spring bean with @Autowired and @Resource. Very cool feature, as this further reduces code noise. Here is the discussion on Google Groups.

Tuesday, March 16, 2010

Cool features in Cucumber, part 1

My Cucumber adventure (via cuke4duke) continues. I have been busy writing features and building out step definitions in Groovy. Groovy absolutely rocks for this sort of thing. I'm doing some more elaborate Cucumber features (at least in my novice head) and came upon this blog posting. Very handy stuff. More related to the Ruby version of Cucumber, but most of the concepts transfer over to cuke4duke.

Saturday, March 13, 2010

PeepCode screencast: Use the Cucumber

I've been interested in acceptance testing tools recently and Cucumber has been at the top of my list. PeepCode recently released a screencast on Cucumber. I've viewing it right now; the screencast is excellent and a nice introduction to Cucumber. I'm thinking of using it on a Grails web app. The screencast is based on a Rails 2 web application, which Cucumber seems to integration seamlessly with. Supposedly Cucumber is technology agnostic and works against any sort of web application.

CoverScout for retrieving iTunes album art

I recently purchased the MacHeist nanoBundle, a collection of Mac OS X applications and utilities. One of the utilities included in the bundle is CoverScout, a utility that will allow you to browse your iTunes library and retrieve hard to find album art. I have a fairly large collection of music and iTunes has been pretty average in its attempts to find album art. CoverScout will retrieve album art from many different sources and allow you to select which image to use. The images are also rated by quality. Very cool utility.

Monday, March 08, 2010

New annotations in mockito 1.8.3

Mockito 1.8.3 was recently released and I got a chance to use it today. There are a couple of new annotations available in this release: @Captor, @Spy, and @InjectMocks. I was able to use @Captor and @InjectMocks today. Even after just a few minutes with these two annotations, I'm sold. Very cool enhancement. I spent some quality time with EasyMock last week, and there's nothing easy with EasyMock. Ugh!! If you're hip to using mock objects in your Java unit testing efforts, you really should look at mockito these days. Details about @Captor and @InjectMocks follows.

@Captor


This annotation will automatically create typed argument captors (org.mockito.ArgumentCaptor<T>) in your unit tests. Argument captors are essential in verifying indirect outputs to your mocked collaborators.


public class Test{
@Captor ArgumentCaptor<Foobar> foobarCaptor;

@Before
public void init(){
MockitoAnnotations.init(this);
}

@Test
public void shouldDoSomethingUseful() {
//...
verify(mock.doStuff(foorbarCaptor.capture()));
Foobar capturedFoobar = foobarCaptor.getValue();
assertEquals("foobar", capturedFoobar.getName());
}
}


@InjectMocks


Automatically injects mocks by type using setter injection. Constructor injection is not currently available, but if you want to provide a patch, the mockito team will gladly consider your contribution. I'm actually more interested in reflection-based injection, similar to what Spring uses when annotating dependency fields using @Autowired. Having your unit tests inject dependencies via reflection would help me avoid the set* methods on the implementations. I may have to play with this a bit.


public class FooBarManagerTests {

@Mock private FooDependency mockFoo;
@Mock private BarDependency mockBar;
@InjectMocks private FooBarManager manager = new FooBarManagerImpl();

@Before
public void initMocks() {
// Initializes all mocks and then injects those mocks into the FooManager instance.
MockitoAnnotations.initMocks(this);
}

@Test
public void shouldDoSomething() {
manager.doSomething();
verify(mockFoo).doSomethingToFoo(any(String.class));
verify(mockBar).doSomethingToBar(any(Integer.class));
}
}

Saturday, February 27, 2010

Gerard Meszaros "From Concept to Product Backlog" talk

I just finished up an InfoQ presentation by Gerard Meszaros discussing how to go from the conceptualization of a project to the manifestation of a product backlog. I really enjoyed the presentation and it hits on some gray areas of current agile implementations that I have worked on. Highly recommended.

Monday, February 08, 2010

DevJam course offerings for February-March 2010

David Hussman recently posted the new DevJam course offerings for February and March 2010. I'll be leading the Introduction to Groovy, Introduction to Grails and Test Driven courses. The Test Driven course is open to Java and .NET developers (.NET examples in C#). Detailed information can be found at http://www.devjam.com/courses-and-training/index.php. Seating is limited to about 12 participants per course.

Wednesday, January 13, 2010

IntelliJ IDEA 9 as an Adobe Flex IDE

If you're on the fence about paying for a license for IntelliJ IDEA, here is one more reason to justify the cost of the license. Adobe Flex. I've spent just a little time with it and the Flex 4 Beta 2 SDK and I must admit, IntelliJ as a Flex IDE rocks. Much better than Flex Builder 3. You don't get a Design View with IntelliJ, but I never used it in Flex Builder and it seems of dubious value.

I can't comment on how it stacks up against Flash Builder 4, but Flex development in IntelliJ is a joy. I'll post more as a I get a chance to use it some more.

Wednesday, December 16, 2009

Are you cultivating your software development expert mind?

What are you doing to build your proficiency in software development? It's something I've been interested in lately. How do you develop an expert mind in software development? I spend my day consulting and I notice that most of the people that I develop software solutions with day-to-day do not spend any time outside of work cultivating their development skills. I'm somewhat dumbfounded by this phenomenon. Is this commonplace elsewhere?

I spend a fair amount of time reading books and then applying the reading to personal coding projects. Typically I have used these projects to learn a new technology. Recently I've started working through Dave Thomas's Code Katas. From Dave's Code Kata website:

Code Kata is an attempt to bring this element of practice to software development. A kata is an exercise in karate where you repeat a form many, many times, making little improvements in each. The intent behind code kata is similar. Each is a short exercise (perhaps 30 minutes to an hour long). Some involve programming, and can be coded in many different ways. Some are open ended, and involve thinking about the issues behind programming. These are unlikely to have a single correct answer.


So, again, what are you doing to practice software development?

Friday, November 13, 2009

Not a fan of Apple's new Magic Mouse

I recently purchased the new Apple Magic Mouse and after about a week of on and off use, I'm not a fan of it. For me, the laser tracking is terrible. I thought it might be the desk so I bought a mouse pad (remember those) and though the mouse pad made tracking a bit better, the Magic Mouse laser tracking performance is irritatingly poor on both the desk and mouse pad surfaces. It's a beautiful device, but it's basic performance is just terrible from my experiences with it. I'm going to hang onto it for a while and see if the driver support gets better over time.

Anyone else seeing issues with the basic laser tracking performance?

Wednesday, November 11, 2009

Using argument matchers in EasyMock and mockito

I spent some quality time with EasyMock today while coaching some developers on building tests around an existing codebase. We were mocking a dependency of our SUT and the method call that we wanted to mock had two parameters. When we wrote the expectation, we used the anyObject() matcher for the first parameter and tried to perform an exact match on the second parameter, a Boolean. Here is an example of what we were trying to do in EasyMock (NOTE: we statically imported EasyMock so we could reduce the amount of code noise by not prefacing our expect, matcher, replay and verify invocations with EasyMock.):


expect(mockObject.retrieveSomething((String) anyObject(), false)).andReturn(someObject);


Unfortunately, EasyMock and mockito do not like this. They both want you to use matchers for all parameters if you use matchers for any parameters. However, the two libraries react quite differently when this situation occurs. EasyMock complains with a somewhat confusing message that at first blush makes it seem like we declared the expectation for multiple invocations. It really threw us off for a while (at least an hour) trying to figure out what was wrong with our expectations. Here is how we fixed it in EasyMock:


expect(mockObject.retrieveSomething((String) anyObject(), eq(false))).andReturn(someObject);


Mockito does a much better job of stating that when you use a parameter argument matcher in your expectation, you have to use parameter argument matchers for all of the parameters of the method call participating in the expectation. I find it interesting that mockito retains the behavior of EasyMock (mockito is a fork of EasyMock) with regards to argument matching, but mockito improves on the error messaging when something goes wrong with the mock object setup. Further reinforces my decision to forego EasyMock in favor of mockito.

Getting a handle on code quality with Sonar

I've been working with a client recently who uses Sonar, an open source code quality management platform hosted at Codehaus. I'm thoroughly impressed with this tool. If you want to see what the tool can do without investing the time in installing it, take a look at the various screencasts. They also have a live version of Sonar up so you can play with it without installation.

We've been working on getting unit tests built around a legacy code base and Sonar has been a big help in identifying classes that are the biggest code coverage offenders. We used the Clouds feature, a word cloud that weights the class names in the cloud based on code coverage and complexity. The less test coverage on the class and/or the more complex the class, the larger the weight of that class name word in the word cloud. It really helped us focus on where to direct our testing efforts.

I have yet to get this tool up and running in one of my own projects, but things are finally starting to simmer down now with consulting and training activities that I hope to focus on building out a CI environment using Hudson and hooking in Sonar to that environment. Stay tuned.

Tuesday, November 10, 2009

Promoting keystroke use in Eclipse

If you want to promote key mappings use in Eclipse, MouseFeed might be your ticket. This Eclipse plugin monitors your mouse usage, and when you click on a UI component (button, menu, etc.) that can be invoked by key stroke, the MouseFeed plugin will pop up a small notification window stating that the action has a key mapping. The notification window disappears after a few seconds, but it's power is obvious. Very similar to the Key Promoter plugin in IntelliJ IDEA. Very cool Eclipse plugin.

Here is a screencast of the MouseFeed plugin in action:

Thursday, November 05, 2009

Completed another Test Driven and Refactoring course for DevJam

This time using C# and the .NET platform. The course went over really well, though we did have some small snafus with the training area in the DevJam office. Nothing that can't be tweaked. I had 15 participants in this class. All participants pair programmed when completing the hand-on exercises and again, I'm totally amazed at how well pair programming goes over when you get people away from their normal work environment. Everyone really grooved on the pair programming thing.

One area that we will need to work on is the mock objects content. We don't have any hands-on exercises for using mock objects and we heard about it in the reviews of the course. I did walk everyone through a demonstration of using mock objects in your unit tests, but I mis-gauged how much interest the participants had in mock objects and the desire to get their feet wet with mock objects. Some of the class participants stay after the course ended and we did another 40 minutes of live coding demos on the use and features of mock objects (using moq for the mocking framework in .NET).

All in all, an awesome two days for me and hopefully for the course participants.

Tuesday, October 27, 2009

Test Driven and Refactoring class in Chicago

Completed a two day Test Driven and Refactoring class in Chicago today. The class went really well and I think I really was able to get a few developers to come down off the TDD fence and really buy into it. That is always satisfying. The class was again offered by DevJam.

I did have a few participants that actually bowed out after the first day of training. One in particular was very abstinent about not writing tests and really does not believe unit testing and TDD in particular are useful in software development. This person was very much in favor of big design up front. This person's views really threw me for a loop. The group that I gave the training to has significant issues with quality, so the view of testing not worth the effort seemed very ironic in this situation. Needless to say, I was not able to get this person to realize how unit testing and TDD help you in the design process. Oh well, you can't win them all over.

I heard a lot of good feedback around the mock objects example that I demonstrated. In this example, I demonstrated not only behavior verification with the mock objects, but also was able to demonstrate capturing indirect outputs on the mock objects and then verifying the state of these indirect outputs. I used mockito 1.8 for the demo. All in all a great class.

Second Groovy and Grails training in the bag

Completed my second Groovy and Grails training for DevJam this past Saturday. This training session was much smoother than the first training. Still too much material and exercises to be taught in just one day. Received a lot of good feedback from the participants and hopefully this feedback helps solidify the training. I'm always amazed at how much stuff I could focus in on for the Groovy training. Really need to beef up the meata-object protocol stuff in the Groovy training.

Wednesday, October 07, 2009

Using the new Groovy-Eclipse V2 plugin

Started using the new Groovy-Eclipse V2 plugin. I'm continuing to fine tune some Groovy training that I've come up with in collaboration with DevJam. So far so good. Seems to work pretty well. I'm not expecting much at the moment, but the alpha seems pretty stable. We need an open source Groovy IDE for the training, and I would love to use Eclipse and this plugin to fulfill that role. I think I still prefer IntelliJ for Groovy stuff (it seems more mature), but it costs some money and most people are using Eclipse these days.

Monday, October 05, 2009

First Groovy and Grails training is in the bag

I made it through my first test run of Groovy and Grails training for DevJam this past Saturday. Had a couple of snafus occur. Nothing major and easily fixed. Did learn a couple of things though:

Don't put developers on an operating system that they don't know for training

The DevJam training has Mac minis which boot either Mac OS X Snow Leopard or Windows Vista (via Bootcamp). I had the systems booted to Mac OS X for the training. Unfortunately all of the developers that came to this training were unfamiliar with Mac OS X, but willing to try it. Bad move on my part. I ended up answering far too many questions on the operating system and which tools were were going to use. Oracle SQL Developer also gave me problems in the Mac OS X environment when trying to update the tool with the MySQL drivers through its software updating system.

If you think you have enough code examples, you don't!


I had about 10-12 Groovy code examples to demonstrate various features of the language. Far too few for the questions that cropped up. Luckily, it was Groovy and writing new code examples or changing existing code examples was pretty straightforward. Kudos to Groovy for being very easy to explore and play with. The participants thought very highly of the interactiveness of the coding during the session.

Don't try to do both Groovy and Grails in a single day.


I knew going in that doing both was going to be very difficult. I just didn't realize how difficult it would be. Again, due to operating system and tool snafus, I didn't finish up the Groovy stuff until well into the afternoon. Not much time for Grails. I was looking forward to the exercise in Grails and we didn't get very far with it.

Automate the packaging of the student materials in electronic format.


We decided to put all the training handouts, examples, and anything else helpful for the students on 4 GB flash drives and give the flash drives to the students to keep. That's good. What's not good is missing some things on the flash drive and updating flash drives during the course. Next time I'll use an Ant build script to build a distribution and clean out any Subversion metadata from the student materials.

The Groovy Eclipse plugin seems to be making headway.


One of the participants in the group, Nick Spilman, had his laptop along and was using Eclipse Galileo and the new Groovy Eclipse plugin during the Groovy portion of the training. He thought it worked well with Groovy. I used IntelliJ 9.0 EAP (Maia) and that also works well. Looks like SpringSource (or shall I say VMware now) is getting serious on the tooling for Groovy and Grails.

Need to spend more time on understanding Groovy's meta-programming facilities.


It's one thing to use Groovy and use its meta-programming faclities (aka MOP) successfully in your own work. It is a far different thing to try and teach others about Groovy's meta-programming facilities. Teaching a concept, especially a concept as complicated as meta-programming, is extremely difficult.

Performing test runs of presentations and trainings is essential.


I'm very pleased that I was afforded the opportunity to be able to offer a couple of test runs of this training to some developers before offering it to the public. Like anything else, it takes practice and feedback to get good at something. I have another test run of this training later this month and I'm sure it will be much better than it was the first time out.

Saturday, September 26, 2009

ColorSchemeDesigner.com

If you're developing a website and need to pick out a color scheme, take a look at ColorSchemeDesigner.com. Great webapp for picking color scheme. Liked it so much I donated some money to the developer. Highly recommended.

Monday, September 21, 2009

Video conversion with HandBrake

I have a JVC Everio HDD camcorder that I haven't used very much until just recently. Looking for some software to convert the MOD formatted video files on the Everio to a different format, I happened upon HandBrake. HandBrake did a nice job of converting the video to something I can use in QuickTime. Very impressed with this piece of open source software.

Thursday, September 17, 2009

Is Spring Framework becoming a configuration nightmare?

I had a crappy day dealing with Spring Framework 3.0 M4. I've been using Spring since 2004 and I've been a big fan of its use. Lately however, I've become concerned that Spring Framework is turning into another EJB, a configuration monster. I've been using Spring 3.0 M1 for a while now and recently upgraded to M4 to get access to some new Spring MVC annotations, @RequestBody and @ResponseBody. These annotations allow you to bind directly to the request body and response body, respectively. They're very helpful if you are using Spring MVC for ReSTful web services. They seemed relatively innocuous, but after some time with them, they are much more complicated to configure than one might expect from Spring. Still don't have a working solution with these new annotations. Part of it is the documentation isn't where it needs to be, but that will hopefully be remedied by the time 3.0 is GA. In the meantime, I'm stuck on the damn configuration of view resolvers, mapping adapters, and what not. Configuration kills! I've had the chance to work on Grails and I must say, I am very much longing for another opportunity to work on that platform. I realize that Grails uses Spring, but Grails also keeps Spring away from, behind the covers for the most part, so I can build solutions for my client instead of muddling through configuration acrobatics.

Tuesday, September 15, 2009

Keeping traceroute/tracepath by my side these days

Ugh! All sorts of networking issues lately at work. Each environment is set up differently from a networking standpoint. Makes promoting code a pain in the butt. I've been giving traceroute and tracepath both a workout these past couple of days. Who says learning Unix utilities is a waste of time in this day and age of graphical desktops and networking utilities. One tip from today: Make sure you specify the port that you want to route to in the traceroute/tracepath invocation. In our case it did make a difference ;-)

Monday, September 07, 2009

Snow Leopard ships with Subversion 1.6.5 support

Just upgraded to Versions 1.0.5 and noticed that Snow Leopard ships with Subversion 1.6.5 libraries and command line tools. Very cool. I'm assuming Xcode 3.2 also uses Subversion 1.6.5.

Thursday, September 03, 2009

Snow Leopard installation frees up a ton of disk space

Approximately 17 GB in my case. Not too shabby. Now I have to get Xcode 3.2 and the iPhone SDK add-on installed. BTW, the iPhone SDK installation now expects Xcode 3.2 to be previously installed, so make sure you've installed it off the Snow Leopard distribution. The 404 MB file size of the iPhone 3.0 SDK for Snow Leopard should be tip off if you've installed previous iPhone SDKs.

.NET thread local storage implementation kicks my butt

I got skooled today in .NET. I wrote a thread-local storage abstraction using named data slots some time ago. Avoid named data slots at all costs! Use the ThreadStaticAttribute instead. Not only is the ThreadStaticAttribute much easier to implement, but it performs better also. I had to wait till my code was in a near-prod environment before enough load could be generated to cause the race condition to occur. It took me about 2 days of debugging to find the issue. Most importantly, read the damn documentation before you attempt to write some threading code. There are some subtle issues in the .NET Base Class Library that I would have avoided if I had read the MSDN site. Very embarrassing.

From Microsoft:

The .NET Framework provides two mechanisms for using thread local storage (TLS): thread-relative static fields (that is, fields that are marked with the ThreadStaticAttribute attribute) and data slots. Thread-relative static fields provide much better performance than data slots, and enable compile-time type checking. For more information about using TLS, see Thread Local Storage: Thread-Relative Static Fields and Data Slots. (http://msdn.microsoft.com/en-us/library/system.threading.thread.allocatenameddataslot.aspx)

Monday, August 31, 2009

Mac Pro upgraded to Snow Leopard

Painless install of Snow Leopard on my early 2009 Mac Pro. I don't really notice much new. System seems a bit snappier, but that purely qualitative observation on my part. No numbers to back that up.

Tuesday, August 18, 2009

Know your SUT and your mocks

I was working with a colleague of mine tonight and he became confused with his unit test. It was an interesting exchange, so I thought I would write it up. He had a system under test (SUT), a service, that had a number of dependencies. The dependencies were mocked using a mocking framework (mockito in this instance). He was writing a test to get better code coverage in preparation for some refactoring and he started to add an expectation to the SUT. When he ran his test, the test failed, but the error lead you to believe that it was the improper use of matchers within mockito. It took him and I awhile to realize that he was trying to add expectations to a non-mock class. In hindsight, he should have picked up on this right away, as we have a coding convention of naming our mock object instances as mock*. The SUT does not follow this naming convention and hence you should see the problem right away. A little concerned that mockito didn't alert us to the fact that we were trying to add expectations to a non-mock instance. Moral of the story: Make your mock object instances stand out--name them appropriately so everyone knows that it's a mock.

Wednesday, August 12, 2009

My top 5 favorite Mac OS X apps/tools/utilities

One of my friends is buying his first Mac (a Mac mini) and I told him I would compile a list of tools and utilities that I use on my Mac systems. Here are my top 5 that I absolutely must have:


  • Google Quick Search Box/Quicksilver: I was a big fan of Quicksilver, but it seems to be dead. Sounds like the Quicksilver developer is now working with/for Google on something similar: Google Quick Search Box (QSB). Love QSB and it seems to be in active development too.


  • iTerm: Gotta have a command line. This one does tabbed terminal consoles.


  • TextMate: Great programmer's editor.


  • Versions: A good Subversion client for OS X.


  • Growl: Notification system. Extremely helpful.







Sunday, June 21, 2009

First reactions to Xcode 3.1.3

Code Sense seems to be much better. Acts intelligently and pressing Return on the suggestion selects the suggestion. It's been a while since I've been in Xcode, but I remember the Code Sense being somewhat odd. That doesn't seem to be the case now. BTW, I'm using Xcode from the iPhone SDK released last week.

Thursday, May 14, 2009

Learn IDE key mappings while pair programming

I'm a big believer in keeping the hands on the keyboard and minimizing the amount of mouse use when coding. Therefore, I tend to spend some time learning the keymappings for the IDE I am using. I'm most proficient with IntelliJ IDEA but I've also learned a good portion of the keymappings in Eclipse and Visual Studio+ReSharper.

I've been doing a fair amount of pair programming lately on my current gig, a good thing. One behavior that we have been practicing while pair programming is gently forcing the driver of the pair to use keymappings to activate various actions within the IDE. Neal Ford describes this in his book The Productive Programmer. Practicing this behavior while pair programming has proven very valuable to increasing our productivity while in the code base. Neal mentions the KeyPromoter plugin for IntelliJ; I've tried this plugin and I haven't become a big fan of it. Much easier if your navigator keeps you honest.

I've done this before with pair programming while working at Identix in 2004 with Hans Loedolff. Hans knew all the IntelliJ keymappings and could type at about 90 words per minute. He was an excellent pair programmmer.

nmon performance monitoring tool

One of the takeaways from yesterday's Tomcat Expert Series seminar was the use of nmon (Nigel's monitor), a curses-based performance monitoring tool. I had never heard of nmon before yesterday, so I was curious why I missed this tool in my IT travels. Seems the tool has originated out of IBM, originally on IBM's AIX Unix variant. The tool has been ported to Linux. More information here. If you're deploying onto Linux or AIX, it might be worthwhile to take a look at this tool and add it to your systems. Unfortunately it does not look like there's a version for Mac OS X yet. Hey, OS X is Unix too ;-)

Wednesday, May 13, 2009

Tomcat Expert Series here in Minneapolis

Attended the SpringSource Tomcat Expert Series seminar here in Minneapolis this morning at the Hyatt Regency. Filip Hanik of SpringSource presented. Filip is a major committer to the Apache Tomcat project. Excellent technical presentations on Tomcat and JVM performance tuning tips and debugging JVM memory and thread issues. Lots of good information around Sun's generational heap and garbage collecting the heap, If you get a chance to take this presentation in, you won't regret it. $75 USD for 3.5 hours and a nice lunch. Seemed like a nice turn out, probably 120 or so attendees. SpringSource seems to be picking up momentum in the JVM space with recent acquisitions of G2One (Groovy and Grails consulting and development) and Hyperic (web application monitoring and management tooling). Could be well positioned when the economy comes out of this funk it's currently in.

Friday, April 24, 2009

Adding GNOME to Ubuntu Server

I needed to add in an Xserver to my Ubuntu Server--Oracle 11g installer is graphical. I didn't want to play the redirecting of the X display back to OS X, so I did some searching and found this discussion. I'll reproduce the steps that I took. The forum posting has many different solutions.

Update your package system.
sudo apt-get update


Install the Ubuntu desktop package. This package seems to be a super package containing many package dependencies. It literally downloaded about 1.7 GB of software. Gdm is part of this install, so you don't have to do an individual install of that after the fact.
sudo apt-get install ubuntu-desktop



Gdm automatically starts the X system during bootup. To configure it to start, do the following:

sudo /etc/init.d/gdm start



You may need to reconfigure your video card, keyboard, etc. To do so, do the following:
sudo dpkg-reconfigure xserver-xorg


Thursday, April 23, 2009

Installing VMware Tools on Ubuntu Server

I'm brining up an Oracle 11g install on Ubuntu Server here at home, and I had a need to install VMware Tools on the server installation before I got hot and heavy into the Oracle installation. Here are some great instructions on how to do just that. I'm using VMware Fusion 2.0.4 on a Mac OS X 10.5.6 host system. Seems VMware has released the source for VMware Tools and you can now get it from an Ubuntu apt repository.

Saturday, April 11, 2009

Excellent Digg Dialogg with Trent Reznor

Excellent video with Trent Reznor of Nine Inch Nails. Kevin Rose of Digg hosts and the questions are from the community, voted up on Digg. Excellent content around Trent's efforts on alternative music distributions and business models. He also mentions his interactions with id Software and John Carmack. Has some nice comments about the programming profession. Well worth watching.

Sunday, April 05, 2009

Embedded domain components in Grails

The embedded component feature of Grails is not documented very well, in my opinion. Therefore, I thought I would create a blog entry so others don't have to spend the time trying to experiment with it to get it to work.


I recently spent some time working on a home project that I have implemented in Grails 1.1. Grails has a feature for embedding domain components into other domain classes. An embedded component participates in the domain class mapping to a database table; there is no join to an child embedded component table. In my domain object model, a TimeRecord is a domain component suitable for embedding. It doesn't live on its own, but is meant to be embedded as a reusable component throughout my domain object model. Grails has first-class support for embedded components, though it took me a bit of time to figure out how to get it to work. First the definition of the TimeRecord class:



class TimeRecord {
TimeRecordUnits units
BigDecimal value

static constraints = {
units(nullable: false)
value(nullable: false)
}
}

Nothing earth-shattering here. The reference to TimeRecordUnits is a Groovy enum. The TimeRecord class is not meant to be mapped to its own table in the database; it will become part of any domain object's table mapping whenever it is embedded in that domain object class. Thus, the TimeRecord class definition needs to reside inside some other domain object's Groovy file. Strange behavior, even for convention over configuration, but it does work.


Now embed the TimeRecord in another domain object class and that domain object's table mapping will also have TimeRecord properties mapped to it. Here is my Story class that has a TimeRecord contained in it:



class Story {

TimeRecord estimate

static embedded = ['estimate']

}

I've removed other Story properties to focus on the embedded component mapping. Grails has a static property named embedded that specifies the component object property that should participate as an embedded association. That's it. I put the TimeRecord definition in the Story.groovy file, directly after the Story definition. Everything maps correctly to the database and I don't get an extraneous time_record table being generated by GORM. Pretty cool.


I must say that domain object modeling in Grails is much, MUCH faster than it is in Java with Hibernate. I'm at least an order of magnitude faster with GORM in Grails than I was in Java and Hibernate. I'm hooked on Grails convention over configuration theme.


Powered by Zoundry Raven

Sunday, March 22, 2009

Grails domain object modeling with Groovy enums

I had a need to use enumerations within my object model in my Grails app today. I wrote up a Google Sites page about my solution. I am using Grails 1.1 for this solution.

Sunday, March 08, 2009

Having another look at Grails

It's been a while since I've really worked with Grails. I used it in 2007 for about 7 months, but we really didn't use it in a typical fashion, as the front end was done in Adobe Flex. 2007 was also fairly early in the life of Grails; I remember using version 0.5.6 when I started at the client.

I'm now building a sample application in Grails 1.0.4 and doing all the AJAX stuff in jQuery. I'm really impressed with Grails now! It's so much more productive than I remember it. Also, I have a couple of books that have been absolutely essential to getting me going with Grails again: The Definitive Guide to Grails, Second Edition and Groovy and Grails Recipes. I'm using IntelliJ IDEA 8.1 for all my development and its Groovy and Grails support is much better than I remember it. JetBrains really makes it easy to give them money every year for a personal license upgrade for IntelliJ.

I haven't been super pleased with the Grails documentation on the Grails site and hopefully SpringSource has a positive effect on this issue in the near future. My development has been plowing ahead very nicely. I really like that I don't have to restart the application server for every little change. That saves a ton of time and has a positive effect on your ability to stay focused on job at hand. Very impressed with Grails this time around.

Thursday, March 05, 2009

The amazing effect of Apple's iPhone platform and the App Store

Michael Tyson has a very relevant post about the amazing effect that Apple's App Store has been having on creative individuals who are driven enough to build applications for the iPhone platform. I'm around quite a few people who have iPhones. It's amazing to see and hear their enthusiasm for this great platform. Michael's post is a great testament that software development can be very rewarding. Great encouragement for those interested in looking at Objective-C and Cocoa Touch.

Tuesday, March 03, 2009

IntelliJ's support for @AspectJ pointcuts in Spring 2.x AOP

I came across a really nice feature in IntelliJ IDEA 8.1 (it may be in earlier versions, but I'm using 8.1). I've been doing some AOP work within Spring Framework 2.5.6, using the excellent @AspectJ pointcut annotations. Once you have everything configured in your Spring application context, IntelliJ will start to annotate where pointcuts are being applied within your code. The annotation/emblem shows up in the left hand gutter of the editor window, right next to the line numbers. Clicking on the emblem will cause a popup listing of all the advices that are applied at that particular join point. You can even navigate directly to the advice from the popup. Very cool. Eclipse has something similar with their AspectJ development tools (AJDT), but this is the first time I've seen something like this in IntelliJ, my preferred Java editor.

Thursday, February 26, 2009

Versions, a native Mac OS X Subversion client

Just bought a license for Versions, a native Mac OS X Subversion client. I've been playing around with Versions in pre-release form and really liked it. I did have some troubles with previous releases reading my 1.5-based working copy, but that seems to be fixed in the 1.0.3 version of the Versions client. I really like the responsiveness of Versions and they have a very clean and uncluttered UI. Previously, I was using SmartSVN. Check it out, I think you'll like what you see.

Tuesday, February 17, 2009

Google Sync for the iPhone

Just came across a new feature of Google Calendar today, Google Sync for your iPhone...

http://www.google.com/mobile/apple/sync.html

I immediately set this up on my iPhone and it works great.

Monday, February 16, 2009

Interesting Microsoft Research paper on the efficiency and effectiveness of TDD

From cLabs Blogki:


http://research.microsoft.com/en-us/projects/esm/nagappan_tdd.pdf


Case studies done on 4 development teams (three at Microsoft, one at IBM) that have adopted TDD. Results of the case studies indicate that the pre-release defect density of the four products decreased between 40% and 90% relative to similar projects tha tdid not use the TDD practice. The teams subjectively said that they experienced a 15-35% increase in initial development time after adopting TDD. Very interesting paper.


Powered by Zoundry Raven

Sunday, February 08, 2009

TED iPhone app is very cool

I seemed to have missed the release of the TED iPhone application. If you're into TED, the iPhone app is done very well and the video quality is great. You can download it from the App Store.


Powered by Zoundry Raven

jQuery resources, tutorials, tips

If you're into jQuery, this blog entry has a plethora of jQuery resources, tips, tricks, and tutorials.


Powered by Zoundry Raven

Thursday, January 29, 2009

Managing stories electronically

I've been involved in this agile project at my client for some time and for the past three months or so I've been working in a group that favors a low fidelity mechanism for managing their stories--Post-It notes on a board. The stories, tasks, and acceptance tests are all written on Post-It notes. We are required to keep the stories and tasks in Team Foundation Server (TFS) also, but the group manages the iteration's work from the Post-It notes. The TFS eScrum template is not a particular good system for managing stories and tasks, so we tend to stick to the low fidelity method.


I really dislike this behavior. The Post-It notes are difficult to keep stuck to anything for the entire iteration. They drop off the board and mysteriously get lost. The Post-It notes are typically written in many different handwritings. There's no consistency in display of stories and tasks. Some of the Post-It notes are almost unreadable. The format of the Post-It notes is not consistent. It's difficult to write much on a single Post-It note. Reporting, well...


I'm a big believer in managing your stories and tasks electronically. Use the Post-It notes during iteration planning to facilitate teamwork and collaboration, but don't leave the stories, acceptance tests and tasks in that form for any amount of time. Get them into a tracking system that allows you to easily manage the stories and tasks for the iteration. I'm a big believer of a dashboard view that gives you a high level overview of all the iterations stories and their progress in a single view.


Powered by Zoundry Raven

Sunday, January 25, 2009

Follow up on keeping fake objects simple

The Google Testing Blog has an a very timely article about keeping your fake object implemenations simple. I previously blogged about this issue. It's nice to see others have seen similar issues with the fake object test double.


Powered by Zoundry Raven

Saturday, January 24, 2009

Programming vibration on the iPhone

Erica Sadun has a timely blog posting about how to get your iPhone to vibrate from within your iPhone applications. I've been working on an educational app for the iPhone and wanted to use vibration for user feedback. And now I know how to.

Measuring value during an iteration

I'm currently working on a large agile project where we measure task burn-up. Our user stories are decomposed into individual tasks and the tasks are estimated. When a developer or a development pair completes a task, they mark that task complete in the tracking system. A daily chart is then generated by the tracking system that displays a line graph of units of tasks completed in the current iteration. The cumulative total task units from the estimates is another line on the graph, and it typically stays horizontal across the entire iteration. Up until recently I hadn't given much thought to these generated charts.

Now I'm wondering what value these charts actually provide. If management is interested in seeing that people are busy working and completing tasks, then these charts are spot on. They definitely will show the amount of work completed during the iteration and when it's completed. But really, is that metric all that important? I tend to say no. One issue off the top of my head that I have seen happen in our group is the completion of tasks on stories, but not fully completing the stories. For whatever reason, our user stories are drifting from one iteration to the next, never reaching the point of completion. Therefore, I conclude that we're keeping ourselves busy, but not adding any value to the overall product.

I want to know how much value I have built into the product. To measure that quantitatively, you need to measure user story burn-up. If you measure user story burn-up, you will focus the development team on completing stories. I think the emphasis needs to be on the user story; the task is a planning construct that just helps us decompose the story into units of development that can be worked on concurrently by a number of developer pairs. I don't know if I really care about task estimates anymore either. I'm drifting towards estimating at the user story level only.

Friday, January 23, 2009

Using ArgumentMatcher to capture indirect output arguments

Yesterday, I posted a blog entry about performing assertions directly in your ArgumentMatcher implementations.  I wanted to close the loop on my previous usage of the ArgumentMatcher.  After some discussion with the main committer to mockito, Szczepan Faber, it seems that ArgumentMatcher should only be used to capture the indirect output argument, making it accessible to the test code. Once the test code has the indirect output argument available to it, you can then assert on it to your heart's delight. Szczepan recommended not embedding the assertions directly in the ArgumentMatcher implementation.  More information can be found here.  Seems like a good approach. 

The importance of grooming the story backlog

I'm currently on an agile project in primarily a developer role.  Our iteration planning has been a sore spot with me since I joined the group.  We've made some tweaks and improvements, but our stories and their acceptance tests are poor quality.  We aren't doing much of any pre-planning, harvesting of stories, or grooming of the backlog.  It really hurts when we get to the iteration planning day.  I dread iteration planning. 

I'm a big believer in grooming the backlog while developers are working on the current iteration's stories; streamline your process by getting more things completed concurrently.  The coach and one or more of the testers get together with the customer and determine which features the customer would like to focus on in the next iteration.  If you need technical expertise, add the tech lead to this group.  Use the release backlog to jumpstart this conversation with candidate stories.  Fill out the details of this group of candidate stories for the next iteration.  This meeting between coach, testers, and customer focus on the feature details and the acceptance tests.  When you try to do this during iteration planning, there tends to be too many people and the conversation becomes chaotic.

Try to solidify your stories and acceptance tests well ahead of the iteration planning meeting.  Send out the stories and the accompanying acceptance tests to the rest of group before the iteration planning meeting.  Now the participants of the upcoming iteration planning can prepare off-line before the meeting. 

Thursday, January 22, 2009

Using assertions within your mockito ArgumentMatcher implementations

I've been using mockito in my Java work recently and have really enjoyed its functionality and ease of use.  Lately I've been trying to do a better job of verifying my SUT's indirect outputs, both behavior and state.  Behavior is easy to verify with mocking frameworks and mockito is no different.  State verification of indirect outputs is bit trickier, but still pretty easy to do once you know what matcher combination you need to use.  For mockito, you use the org.mockito.ArgumentMatcher<T> class and its subclasses (all implement the org.hamcrest.Matcher interface).  There is a single abstract method that you should implement, the matches(Object argument) method.  This method returns a boolean result. 

Today, I was having a conversation with a co-worker of mine, Ryan Anderson, about the use of the ArgumentMatcher.  Ryan wondered if one could use JUnit assertions within the matches method implementation and just return true if all of the assertions passed; failed assertions will not reach the return statement.  Indeed, you can use assertions in the ArgumentMatcher implementation.  JUnit assertions actually throw an instance of java.lang.AssertionError, thus your stack trace will show exactly which assertion within the ArgumentMatcher failed.  Much better using the assertions than testing and returning a boolean value.  Might be helpful for your testing efforts.

Wednesday, January 21, 2009

Taking fake objects too far

I recently worked on a Java project where we utilized the Fake Object pattern ad nauseum.  We used this pattern to provide a test double layer of our data access objects, but in doing so, we tried to implement too much of a fake repository for our domain objects.  The fake data access objects became a hindrance to writing unit tests and thus dissuaded people from writing unit tests.  Well, a friend of mine still on the project told me today that they are ripping out all the fake object implementations and putting in mocks and stubs using the excellent mockito library.  They hope to get back to easy test double usage and thus promote the use of unit testing and TDD.  Moral of the story: Your tests can accumulate technical debt.  Constantly ensure that test double usage is healthy in your unit tests.

Monday, January 19, 2009

Interface Builder: Remember to hook up the view to the ViewController's FileOwner view outlet

I don't know if I like or despise Interface Builder.  Most of the time it's an effective tool to building UI for the Mac and the iPhone.  Every so often, I'm completely confounded by it's tediousness.  Case in point: The ViewController's File Owner has an outlet for the view.  If you have one single view in your XIB, you still need to make a connection between the File Owner's view and the View object in the XIB file.  I spent significant time today trying to figure out why a multi-view iPhone example that I was working on kept throwing exceptions after I started adding the subviews to the codebase.  To me, Interface Builder seems a bit opaque; you never really know if everything is wired together properly.  I'm sure experience will help alleviate this type of issue cropping up in the future, but from my very limited exposure to the Xcode/Interface Builder tooling, it seems like the tooling could use a revamp to make things much more user friendly.  I believe the precursor to Eclipse, Visual Age for Java|Smalltalk had a similar UI wiring scheme, but with a much easier view of all the existing wirings.  Something similar would be helpful in Interface Builder.  


UPDATE on February 3, 2009: Bill Dudney has seen this phenomenon in his trainings and blogs about it here, with screenshots.

Wednesday, January 14, 2009

Google's Quick Search Box for the Mac

If you like Quicksilver for the Mac, you may want to look at Quick Search Box for the Mac.  One of the developers of qsb-mac is the Quicksilver creator, Nicholas Jitkoff.  Google is hosting it at googlecode as an open source project.  I like what I see of it already.

Tuesday, January 13, 2009

Beginning iPhone Development book

I finished up reading the book Beginning iPhone Development and working through most of the examples.  Excellent book for developers starting out on the iPhone platform.  The book is laid out with examples through 17 chapters or so.  The examples are all very relevant to functionalities on the iPhone: accelerometer, autorotation, autosizing, multiview applications, persistence, Quartz, OpenGL ES, gestural interfaces, Core Location, and others.  The examples are straightforward to understand and really give you a great taste of what's available with the Apple iPhone SDK.  There is nothing in this book about web applications on the iPhone--go elsewhere if you want to learn about that.  Looking forward to building and distributing some iPhone apps in the near future.

Interesting unit testing thoughts from Michael Feathers

Michael Feathers is well known within the agile community for his efforts and thoughts around testing. He has a very thoughtful post entitled The Flawed Theory Behind Unit Testing. The main takeaway that I glean from the posting was how tests make us slow down and reflect on our code. From the blog entry:

All of these techniques have been shown to increase quality. And, if we look closely we can see why: all of them force us to reflect on our code. That’s the magic, and it’s why unit testing works also. When you write unit tests, TDD-style or after your development, you scrutinize, you think, and often you prevent problems without even encountering a test failure.


I've been thinking more and more about my own testing behaviors these days, especially with my endeavors of teaching TDD and mentoring other developers on unit testing and the use of mock objects.

Thursday, January 08, 2009

.NET Base Class Library types not friendly to mocking with MoQ

I spent some quality time this week driving a design implemented in .NET using unit tests.  It was an enlightening experience and gave me a good glimpse at the quality of the BCL design.  I'm not impressed. We had issues trying to mock System.Net.WebRequest and System.Net.WebResponse and its decendents.  It seems that Microsoft prefers to expose abstract base classes, instead of using interfaces for this.  The aforementioned types are not interface types; they're abstract classes.  We've been using MoQ, a fine mocking framework, at the client I've been working at and I tried to create mock implementations of the System.Net.WebRequest and System.Net.WebResponse types.  No go--these types do not have public constructors.  The non-virtual, non-abstract methods also give MoQ headaches (good write up here about why methods of these abstract class types have to be explicitly decorated with virtual if you want to mock them).  Personally, I'm more fond of exposing interface types, thus alleviating the problem all together.  Very frustrating.  We did continue to unit test and utilized mocks for this, but it forced us to wrap these BCL types with our own types where we could control the virtual decoration.  Yuck!!

Thursday, January 01, 2009

Now deploying my development app to my iPhone 3G device

I went through the steps to get my Standard Developer Program activation hooked up through the Apple iPhone Developer Portal.  I wrote up a wiki page of how I did this.  I was prepared for the worst as I had heard the process was really convoluted and complex.  For me, following their user guide, the process was almost painless and quite simple.  I do recommend following the user's  guide though.

Wednesday, December 31, 2008

Regular expressions in Cocoa using NSPredicate

I spent some time tonight figuring out how to exploit the NSPredicate class from Cocoa for my regular expression needs. I've been trying to do some test-driven development in my iPhone development endeavors and had a need for regular expressions. NSPredicate seems to be the tool for the job, so I wrote up the following wiki page so I could keep this information around.

http://sites.google.com/a/pintailconsultingllc.com/objective-c-and-cocoa/Home/nspredicate-examples

I even cracked open my "Mastering Regular Expressions" book tonight.  Excellent tome on all things regular expression.  Highly recommended.


Tuesday, December 23, 2008

Can't login to the Apple iPhone Dev Connection

Hmmm... I'm having issues logging into the Apple iPhone Developer Connection. I can authenticate on the Mac Developer Connection site and ADC, but the iPhone Developer Connection site doesn't seem to use the same session information, so navigating from one Apple developer site to another seems to be impossible. Anyone else seen this?

Saturday, December 20, 2008

Using Subversion from Xcode 3.1.1

I started using the integrated Subversion SCM support in Xcode today. I've been working through some iPhone development examples from the Beginning iPhone Development book (the grapefruit book). I've been using the command line client and SmartSVN on my Mac up until now. Well, I found out that both the command line client and my SmartSVN client are both version 1.5.x and that the built-in support within Xcode is still at version 1.4.x. The working copies for a 1.5.x client won't work with the older client support that Xcode has linked into its executable. Therefore, if you plan on using Xcode's Subversion support, use only Xcode to interact with that working copy. A 1.5.x client will silently update the metadata in the .svn directories if used against a 1.4.x-based working copy, so be very careful with inadvertantly dropping down to the command line to do some SVN work. You'll most likely render your working copy unusable within Xcode if you do. Here's hoping that Apple will update Xcode and link it against a 1.5.x SVN client library.

Other than that little gotcha, the Subversion support within Xcode is pretty good. I think I prefer how the Java IDEs have it implemented (Eclipse and IntelliJ IDEA). Those tools make the SCM interactions much more seamless. In Xcode, it seems kinda off to the side. I'd really like key mappings for Commit Entire Project... and Update Entire Project. I'll have to look into that and see if that's possible.

Friday, December 05, 2008

EclEmma, a code coverage plugin for Eclipse

If you're an Eclipse user and you're full on with TDD, then you owe it to yourself to install the EclEmma plugin for Eclipse.  It's an open source tool for instrumenting code from within the Eclipse Workbench and then running tests to determine how much test coverage you have.  I've been a Cobertura user, but AFAIK there isn't a Cobertura plugin for Eclipse.  EMMA is another code coverage tool (and is baked into Jetbrains IntelliJ IDEA).  This plugin is very well done and really helped me to understand where I needed more tests.  The best thing about this plugin is that you can get code coverage on a single class that you're unit testing, so the turnaround time is very small for determining where you have holes in your test coverage.  Very impressive.  One gripe that I do have with it is the inability to turn off coverage on the tests.  I don't want to instrument those, but the tool seems to want to select the tests to instrument along with your source.  Not a big deal...I just ignored any of the coverage information pertaining to tests.

Thursday, November 27, 2008

iPhone development fun

Since I used up quite a bit of my Thanksgiving eating, sleeping, and struggling with Apache Ivy, I was only able to spend a little time working through some of the examples from the book "Beginning iPhone Development" from Apress.  So far it's been a pretty good book.  I've been messing around with Xcode for about 3 weeks now and I'm truly impressed with the Mac development environment.  The Cocoa framework is very well thought out and easily to use.  I really like how Interface Builder works, wiring up outlet and actions to code.  I can see why there's so much hype around iPhone development.  It's quite pleasurable.  The tools are really easy to use and the frameworks and Objective-C are fairly straightforward to pick up.  I've been doing the development on a MacBook and it's very much up to the task of Mac/iPhone development (it helps to have 4 GB of RAM in this thing though).  So far, I've had a ball doing iPhone development.

Apache Ivy...cool concept, but terrible out of box experience

So I spent some quality time with Apache Ivy this Thanksgiving holiday.  I wish I could say that was time well spent.  I really like the concept of Ivy...but the implementation is really complex and poorly documented for first time users.  For starters, all the configuration is in XML.  No big deal, but the XML configuration can get quite convoluted and it seems like the defaults are never what you want,so you end up writing more configuration to get the results you want.  I was never able to find a good ivysettings.xml example (full example, not bits and pieces).  The ivysettings.xml seems to be a prerequisite to configuring which Ivy repositories you will pull content from.  I wanted to pull my content from SpringSource's Enterprise Bundle Repository, which is not the default.  SpringSource has snippets of ivysettings.xml configuration, but not a base configuration that you can just copy and use.  Second, the bundle repositories seems to be in shambles.  Of all the repositories that I could find, only SpringSource's was documented enough that you could figure out how to pull the bundle dependency.  Unfortunately, I couldn't get my settings to connect to that repository.  Third, pulling dependencies like Spring Framework will pull in a whole bunch of unnecessary stuff, JARs that I did not want.  I really don't want to have to spend 2 days learning Ivy.  It's a nice to have feature for managing dependencies.  I just want it to work.  But it seems that Ivy expects a significant investment of time and work to get working properly.  Too bad, as I'll probably dump it for something else.  Am I being too critical of Ivy?  Should I not expect a good out of box experience with this tool?   

Monday, October 13, 2008

Line numbers in Java exception stack traces

Today at work, our development group was debugging an issue with our CI server deployment.  The log file contained a stack trace without any line numbers or other information.  This prompted some Googling on the subject, and elicited this blog entry:

http://sahyog.blogspot.com/2008/02/line-numbers-in-java-exception-stack.html

Good information about the javac task in Ant.  I did not know about the debuglevel option.


Wednesday, October 08, 2008

Custom argument matching with Mockito

I wrote up a wiki entry on my continuing adventures with Mockito.   This time, I'm trying to perform state verification of the inputs to the test double dependency.  And again, Mockito does not disappoint with its awesome Matchers and ArgumentMatcher support.  I'm really enjoying the use of Mockito.  Very much recommended.

 

Saturday, October 04, 2008

Updated my Mockito example

I updated my Mockito example on my wiki.  The example now uses Mockito's annotation support.  Cleans up the setup considerably.

http://sites.google.com/a/pintailconsultingllc.com/java/mockito-examples

Thursday, September 18, 2008

Using Rhino Mocks wiki entry

http://sites.google.com/a/pintailconsultingllc.com/net/using-rhino-mocks

My first foray into unit testing with a mocking framework in .NET.  Rhino Mocks has a very similar feel to EasyMock in the Java world.

Copy Source as HTML Visual Studio 2008 Addin

If you ever have a need to document source code in a wiki or a blog, this addin is very handy. 

Using Rhino Mocks with MS Test

This post helped me out tonight. If you get some silly message that Rhino.Mocks.dll is not in a trusted location, the resolution of the problem is fairly straightforward.

Thursday, September 11, 2008

Implementing object identity when using Hibernate

A good article on how to effectively implement object and database identity with Hibernate-mapped domain objects. Probably not specific to Hibernate, but for any domain object mapped by an ORM framework. Good read.

http://www.onjava.com/pub/a/onjava/2006/09/13/dont-let-hibernate-steal-your-identity.html

Friday, September 05, 2008

jMock example is now up

http://sites.google.com/a/pintailconsultingllc.com/java/jmock-examples

Of the three mocking frameworks that I've now briefly looked at, I'm most impressed with jMock. I just like the simplicity and feel of it. Very easy to use and I really like it's expectations implementation. I've started building out a sample Spring MVC web app which I will drive with TDD and mock object usage, utilizing jMock for object mocking. So far so good. I'll post more when I get the chance.

Wednesday, September 03, 2008

Custom JSP 2.0 tags example is now up

http://sites.google.com/a/pintailconsultingllc.com/java/custom-jsp-tag-libraries

I had a need to create a view helper for a web view that I was building, so I did a small spike solution on JSP 2.0 tags. They seem much easier to write than they were previously (I haven't written one in many years). I thought I'd put it up on the wiki for others to use. Hopefully it proves useful. This example is done using Spring MVC as the web framework. Nothing special needed to integrate the JSP 2.0 tag into the Spring MVC web app.

Sunday, August 31, 2008

Mockito example is now up

http://sites.google.com/a/pintailconsultingllc.com/java/mockito-examples


Same set of classes as the EasyMock demo. Not much difference between EasyMock and Mockito, at least not yet. Mockito probably is a bit easy to use (no replay method to be invoked before testing).

EasyMock example

We're starting to look at mock object frameworks at my current consulting gig, so I thought I'd put together a small example of how to use EasyMock.


http://sites.google.com/a/pintailconsultingllc.com/java/easymock-examples


Pretty simple but gets the point across on how to get started with EasyMock. Mockito examples are forthcoming.

Tuesday, August 12, 2008

Teaching programming with Python

Using Python to teach my daughters about programming. Thought it would be fun and get them to apply some of things they've learned in school. So far so good. We did a Hello World python script tonight.

Saturday, June 28, 2008

JavaScript apps with SproutCore

Installed the SproutCore Ruby gem this evening and I'm starting to play around with SproutCore. More information about SproutCore can be found at http://www.sproutcore.com. SproutCore uses Ruby and some other Ruby gems (Mongrel, Merb, and others) to help you build and test JavaScript apps. Apple is using this for their Mobile Me service. Looks really interesting and so far the examples are pretty cool.

Sunday, June 22, 2008

Valuing simplicity

I've been reading Douglas Crockford's JavaScript: The Good Parts. A good read, especially if you've done JavaScript in the past and didn't think much of it at the time (like myself). It's been an eye opening read. One of his lines in the book, "We value simplicity, ..." struck a chord with me. A very simple statement, but it sums up something that I hold very dear to my heart these days.

I value simplicity. A lot. That's why I think I like my Mac so well, after working with Windows and Linux. I like Windows because it's familiar, but there are so many options, and the options seem to change in every Windows release. The reliability of Windows also is a concern. Linux just isn't simple...it's not designed to be simple nor do it want to be. That's good for some situations, but terrible if you want to appeal to the masses. The Mac and other Apple products appeal to the masses due to simple by stylish designs.

I'm not finding all this AJAX, JavaScript, and DOM manipulation simple in design. It's quite the opposite. It's seems very messy and chaotic using HTML, CSS, and JavaScript for building web applications. And the interfaces that are being built still pale in comparison to rich applications. Hopefully things get better over time with the RiA technologies (Flex/Flash, Silverlight, etc.).

Extra-lazy collection fetching in Hibernate

I came across some new functionality in Hibernate recently, extra-lazy collection fetching. This functionality, which seems oddly named, basically allows you to initialize individual list or map items, if you have everything configured in Hibernate just right. The details of my spike solutions are written up on my wiki:

http://sites.google.com/a/pintailconsultingllc.com/java/hibernate-extra-lazy-collection-fetching

For small lists, I would recommend not using this functionality, as every item is a SQL call to the database. For a large list or child objects which are expensive to create, this might be just what you're looking for. It took me a while to get the list semantics to work properly. The @IndexedCollection is very important. I have not played with a map collection yet, but in theory that collection should work similarly.

Tuesday, June 17, 2008

Hall monitor tests

Hall monitor tests are tests included in your unit and integration test suites that ensure that coding conventions are followed. They codify and automate the tribal wisdom of the development group. I used them very effectively on a .NET project about a year ago. Kudos to Joe Muraski, Brad Hill, and Bob Schultz for their efforts with "hall monitor" tests.

Monday, June 16, 2008

kuler - Adobe's fabulous color picker/theme organizer tool

If you ever need to do any styling and need a set of colors for a theme, check out Adobe kuler tool. A Flash-based web tool that is simply amazing. Free for use; just log in with your Adobe ID and you're off and running.

http://kuler.adobe.com/

Friday, May 23, 2008

A rabbit killed my Internet connection

First off, kudos to the Comcast technical support person that came out to my home and quickly diagnosed the issue with our cable connection. It seems that rabbits around our parts have a taste for coaxial cable insulation (the black plastic covering of the cable). Our Internet service went on the fritz about a week ago. All my attempts to get it back online proved futile. Coinciding with this outage was the recent irrigation system work on Thursday. So I was all ready to place blame on the irrigation installers.

The Comcast technical support person stopped out a couple of days ago and inspected everything. He said he'd like blame it on the irrigation guys too because then they can bill the irrigation guys for the work and materials to fix it. Nope, the insulation on the coaxial cable was nibbled away very close to the house, two sections, each of about 2 inches in length. The Internet connection has been restored and the Comcast guy put some electrical conduit around the cable where it comes out of the ground and into the house to deter the rabbits from doing this again.

Monday, May 05, 2008

Understanding Flash window modes for embedding HTML rendering in Flex app

An excellent write up about Flash window modes. I'm attempting to use an IFrame in my Flex application to punch a hole into the Flash movie and allow HTML rendering in my Flex application. When doing this, one needs to understand window modes. I'll probably have more to say about the IFrame solution in Flex, but for the meantime, here are some very relevant links:

http://www.communitymx.com/content/article.cfm?cid=e5141


http://ccgi.arutherford.plus.com/blog/wordpress/?page_id=171


http://ccgi.arutherford.plus.com/blog/wordpress/?p=173

http://ccgi.arutherford.plus.com/blog/wordpress/?p=133

http://www.deitte.com/archives/2007/09/html_in_flex_wi.htm

Sunday, May 04, 2008

Getting Hibernate to format generated SQL

Use the configuration property hibernate.format_sql to have Hibernate format generated SQL. This feature needs to be used in conjunction with the hibernate.show_sql configuration property. Both need to be set to true to get nicely formatted SQL. Very handy for understanding what Hibernate is doing.

Saturday, April 26, 2008

flexcover: A code coverage tool for Adobe Flex

Found this interesting tool for Flex development. I've been using dbUInt Flex testing framework to do TDD with Flex. Having a code coverage tool will be very helpful for my TDD efforts.

Understanding Flex transport protocols

I've been doing some investigation of Adobe Flex remoting and messaging protocols. I've used the HttpService before and was somewhat underwhelmed by its performance. Recently, I've looked at BlazeDS and the AMF3 binary protocol. AMF3 seems much faster than transporting XML over HTTP. Well, James Ward has an excellent Flex application that quantitatively demonstrates this performance difference.

http://www.jamesward.org/census/ (Source code here)


Very well done and quite informative.

Sunday, April 13, 2008

First Flex app up and running with BlazeDS

Well it took me a while and a lot of browsing the web for the proper incantations, but I finally got a Flex app up and running with BlazeDS 3.x. Their reference documentation is not very clear about the Flex compiler arguments that you need to specify to reference the services-config.xml and to specify the servlet context root. I have a document of the steps that I went through, with screenshots, so others might have an easier time with this. BlazeDS remoting seems very quick and performant. For my application, I built a new Java web app up from scratch and did not use any of the turnkey stuff. In hindsight, it seems that magic revolves around the Flex compiler arguments. This Flex app also uses Cairngorm microarchitecture framework, which seems pretty straightforward to use. Next up is to hook in Spring and Hibernate on the Java server side.

Saturday, April 12, 2008

Silverlight 2.0 does have unit testing

Seems that Silverlight 2.0 does have some unit testing potential.

http://www.jeff.wilcox.name/2008/03/31/silverlight2-unit-testing/

Excellent tutorial on Cairngorm framework

If you do anything of any substance in Adobe Flex, you'll undoubtedly come across the Adobe Consulting Cairngorm framework. It can be a rather daunting framework to grasp at first, but David Tucker has an excellent multi-part tutorial to guide you on your way. Very much recommended.

http://www.davidtucker.net/category/cairngorm/

Tuesday, April 08, 2008

MSTest tools don't seem to work with Silverlight 2.0 projects

I've been playing around with Silverlight 2 beta in Visual Studio 2008. I tried to create a Test project in my Silverlight solution and add a Silverlight project as a reference to the Test project. No go! Complains about Silverlight assemblies can only be referenced by other Silverlight assemblies. This sucks...I wanted to drive a lot of my design of non-visual classes in the Silverlight project using tests. I assume that NUnit testing won't work either. Could be very interesting developing for the CoreCLR.

Friday, March 21, 2008

Sonos ZoneBridge now installed

Added the ZoneBridge to my Sonos music network tonight. Very easy to install--it's pretty much plug and play. My ZonePlayer is now connecting wirelessly to my ZoneBridge and the ZoneBridge is connected to my Airport Extreme access point in my living room. Not bad for about 20 minutes of configuration and software installation and setup. I have a pair of Definitive Technology ProMonitor 1000 speakers connected to the ZonePlayer ZP100. Sounds great.

Sonos Music System up and running

Received our Sonos music system today. For more information, go to http://www.sonos.com. I bought the Controller 100 and ZP100 Zone Player combo for $699. Set up the computer software on my Macbook. Installation on the Mac is effortless and I literally had it playing music from my NAS device in 5 minutes. Looks like it uses Windows Networking (aka SMB or CIFS) to access music libraries. I have a 1 TB Western Digital MyBook World NAS device connected to the network where I've been burning my WMA files to. Haven't tried Ogg Vorbis or iTunes collections yet. I absolutely love this music solution. Great out of box experience. Kudos Sonos!

BTW, I also purchased a Zone Bridge from Sonos, but have not connected that to the network yet. I post more when I get that online.