Pages

Sunday, August 31, 2008

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.

Thursday, February 28, 2008

New Airport Extreme

Man, these Apple products are like crack! Now that I have the MacBook, I wanted to upgrade the living room wireless access point. Went out to the Apple Store and ordered an Airport Extreme. Super easy to setup, very small and stylish, and it seems to run great. I'm using it in bridged mode and 802.11n only (radio set at 5 GHz). Hopefully I'll be able to use wireless outside in the backyard pool area. Highly recommended!

Saturday, February 16, 2008

New MacBook!

Just bought my first Mac...a black MacBook. I bought it with 1 GB of RAM, but immediately went to Newegg.com and purchased 4 GB of RAM to replace the original 1 GB that came with the system. So far so good. My Dell XPS went on the fritz late last week. It looks like the nVidia video card went to hell and now none of the operating systems will boot up on it. And the Dell is off warranty, so it's going to cost me some money to get the thing fixed. Oh well. So I'm rolling with the MacBook. For Windows, I'm going with VMware Fusion on the MacBook.