Pages

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.