11 Lesser Known 3rd Party Libraries For Every Project

pennies_in_jar_small The Java 3rd party library ecosystem is a wild wild place. While everyone has heard of the big players such as Spring and Hibernate, too often the more humble, but equally important, libraries get left out in the cold.  It is for that reason that I give you the 11 lesser known 3rd party libraries that no project should be without.

Unit Testing

As always, the easiest place to start playing around with new libraries and languages is in unit tests.  I’m convinced they would be worth writing if only as an outlet for developers to try new and interesting tools, let along the code quality improvements.

DBUnit

While we can quibble over including databases in unit tests or if they are integration tests the fact of the matter is that at some point most people write a unit test that requires a database with some preexisting data.  Thats when DBUnit shines. It has the ability to use xml from a file or a string or any other type of input to clean and populate database tables with ease.  It even has some nice utilities for asserting data after a test has run.

Mockito

On the other end of the spectrum from full blown database integration is mocking. When you need to disentangle an object from its myriad of dependancies and test it in isolation mock objects come to the rescue. There are a number of solutions out there but Mockito takes the cake. To see why I prefer it to EasyMock check out their comparison. They’ve even added some niceties for BDD style testing.

Hamcrest Matchers

Since Junit 4.4, a core set of hamcrest matchers has been included with the distribution and has gone a long way to simplifying assertions by through a pseduo english DSL. For even more power you can include the whole hamcrest matcher jar and start playing with features such as asserting the contents of collections.

Apache Commons

Configuration

Most projects start with one properties file and before you know it there are two, then three, then ten and it gets out of control. You have static singletons that pull files off the class path and you’ve gone off the deep end. Thats why I say start Commons Configurations, even for that first file. Not only does it greatly simplify dealing with properties from the api point of view but it allows for pulling properties from xml, jdbc, property files, and much more. Its can even work as a simple api for dealing with xml in a jiffy.

DbUtils

These days with Spring JDBC, iBatis, Hibernate, ActiveObjects, and a host of other frameworks and libraries for dealing with JDBC its pretty easy to never have to directly touch the stuff.  However, if you find yourself in the hell which is closing a connection, session, and statement (with all the null checks and finals and exceptions and oh dear god) then Commons DbUtils is for you.  A simple close() method is provided which handles all the null checking and try catching and so on. So basic and yet so helpful.

IO

This one might be a bit more obscure but if you have ever needed to simply read the contents of a file you have no doubt been stymied by which reader gets wrapped by which buffered writer and who flushes what. Commons IO provides a beautifully simple api for file reading as well as some nice utility methods, similar to DbUtils, for closing all those annoying objects with out all the hassle.

Lang

If there was one library on my list it would come down to this or Google Collections. Commons Lang is the place for every utility method you have ever thought of writing. Every time you have though of creating a null safe version of any of the String methods, StringUtils has your back. If you have though of doing the same for Booleans then BooleanUtils is for you. Same for Object and ObjectUtils. But it doesnt stop there, StringUtils has more methods than you can shake a stick at and then there is the Builder package. The Builder package contains a Hashcode, ToString, Equals and CompareTo builder. Better yet they contain methods to build these values dynamically based on reflection. I’ve taken to making a base class from which all my domain objects inherit  that simply overrides Hashcode, ToString and Equals with the reflection based builders. Never again do you need to create these annoying methods by hand or have Eclipse generate them only to forget to regenerate when you add another field.

New Kids On The Block

SLF4J

Logging, everyone needs it. Thats probably why there are at least four major Java logging frameworks.  However, they are not all created equal. Java util logging is known to have a number of shortcomings when compared to Log4J and Commons Logging is just a facade that allows you to switch between the two more easily. Out of this mess comes SLF4J. Created by the creator of Log4J it is simply a set of interfaces that anyone can implement. The default implementation, also made by the same guy, is called logback and takes all the best of Log4J and improves on it. Moreover there are converters that route Log4J, CommonsLogging, and Java util logging to SLF4J. Never again do you have to struggle with multiple libraries and configuration files for all of your 3rd party libraries in your project. Simply drop in the converters and everything nicely flows into SLF4J.

Google Collections

Like I said before, if there were one library on my list it would come down to Commons Lang and Google Collections. If you have every used Commons Collections and cursed at its lack of type safety then Google Collections is for you. If you have ever balked at having to write List<Map<String, List<Integer>>> only to realized you have to type it all over again on the left hand side of the value assignment then Google Collections static methods such as newHashMap() are for you. If you are looking for a poor mans cache then MapMaker is for you. Finally, if you want to play around with functional programing ideas in Java look no farther than Predicate and Function and take it as a challenge to remove all for loops from your application.

c3p0

Database pooling, if you connectot to a database you need it. There are a few out there to choose from and the decision is always a bit of an argument but since Hibernate chose c3p0 as its default connection pool it has gotten significantly more attention than the other options and the prevailing winds seem to suggest that it is the way to go.

Joda Time

Not everyone has to deal with time in their programs but if you do, look no farther than Joda Time. From simple formatting to the complication of subtracting dates and everything in between, Joda Time is an easy to use api for all your date and time needs. No longer will you have deal with Calendars and wonder what exactly is a Gregorian one.

Efficient Lightweight JMS with Spring and ActiveMQ

Spring

© Darwin Bell

Asynchronicity, its the number one design principal for highly scalable systems, and for Java that means JMS, which in turn means ActiveMQ. But how do I use JMS efficiently? One can quickly  become overwhelmed with talk of containers, frameworks, and a plethora of options, most of which are outdated. So lets pick it apart.

Frameworks

The ActiveMQ documentation makes mention of two frameworks; Camel and Spring. The decision here comes down to simplicity vs functionality. Camel supports an immense amount of Enterprise Integration Patterns that can greatly simplify integrating a variety of services and orchestrating complicated message flows between components. Its certainly a best of breed if your system requires such functionality. However, if you are looking for simplicity and support for the basic best practices then Spring has the upper hand. For me, simplicity wins out any day of the week.

JCA (Use It Or Loose It)

Reading through ActiveMQ’s spring support one is instantly introduced to the idea of a JCA container and ActiveMQ’s various proxies and adaptors for working inside of one. However, this is all a red herring. JCA is part of the EJB specification and as with most of the EJB specification, Spring doesn’t support it. Then there is a mention of Jencks, a “lightweight JCA container for Spring”, which was spun off of ActiveMQ’s JCA container. At first this seems like the ideal solution, but let me stop you there.  Jencks was last updated on January 3rd 2007. At that time ActiveMQ was at version 4.1.x and Spring was at version 2.0.x and things have come a long way, a very long way. Even trying to get Jencks from the maven repository fails due to dependencies on ActiveMQ 4.1.x jars that no longer exist. The simple fact is there are better and simpler ways to ensure resource caching.

Sending Messages

The core of Spring’s message sending architecture is the JmsTemplate. In typical Spring template fashion, the JmsTemplate abstracts away all the cruft of opening and closing sessions and producers so all the application developer needs to worry about is the actual business logic. However, ActiveMQ is quick to point out the JmsTemplate gotchas, mostly that JmsTemplate is designed to open and close the session and producer on each call. To prevent this from absolutely destroying the messaging performance the documentation recommends using ActiveMQ’s PooledConnectionFactory which caches the sessions and message producers. However this too is outdated. Starting with version 2.5.3, Spring started shipping its own CachingConnectionFactory which I believe to be the preferred caching method. (UPDATE: In my more recent post, I talk about when you might want to use PooledConnectionFactory.) However, there is one catch to point out. By default the CachingConnectionFactory only caches one session which the javadoc claims to be sufficient for low concurrency situations. By contrast, the PooledConnectionFactory defaults to 500. As with most settings of this type, some amount of experimentation is probably in order. I’ve started with 100 which seems like a good compromise.

Receiving Messages

As you may have noticed, the JmsTemplate gotchas strongly discourages using the recieve() call on the JmsTemplate, again, since there is no pooling of sessions and consumers.  Moreover, all calls on the JmsTemplate are synchronous which means the calling thread will block until the method returns. This is fine when using JmsTemplate to send messages since the method returns almost instantly. However, when using the recieve() call, the thread will block until a message is received, which has a huge impact on performance. Unfortunately, neither the JmsTemplate gotchas nor the spring support documentation mentions the simple Spring solution for these problems. In fact they both recommend using Jencks, which we already debunked. The actual solution, using the DefaultMessageListenerContainer, is buried in the how do I use JMS efficiently documentation. The DefaultMessageListenerContainer allows for the asynchronous receipt of messages as well as caching sessions and message consumers. Even more interesting, the DefaultMessageListenerContainer can dynamically grow and shrink the number of listeners based on message volume. In short, this is why we can completely ignore JCA.

Putting It All Together

Spring Context XML

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:jms="http://www.springframework.org/schema/jms"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core-5.2.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-2.5.xsd">

<!-- enables annotation based configuration -->
<context:annotation-config />
<!-- scans for annotated classes in the com.company package -->
<context:component-scan base-package="com.company"/>
<!-- allows for ${} replacement in the spring xml configuration from the system.properties file on the classpath -->
<context:property-placeholder location="classpath:system.properties"/>
<!-- creates an activemq connection factory using the amq namespace -->
<amq:connectionFactory id="amqConnectionFactory" brokerURL="${jms.url}" userName="${jms.username}" password="${jms.password}" />
<!-- CachingConnectionFactory Definition, sessionCacheSize property is the number of sessions to cache -->
<bean id="connectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory">
    <constructor-arg ref="amqConnectionFactory" />
    <property name="exceptionListener" ref="jmsExceptionListener" />
    <property name="sessionCacheSize" value="100" />
</bean>
<!-- JmsTemplate Definition -->
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
   <constructor-arg ref="connectionFactory"/>
</bean>
<!-- listener container definition using the jms namespace, concurrency is the max number of concurrent listeners that can be started -->
<jms:listener-container concurrency="10" >
    <jms:listener id="QueueListener" destination="Queue.Name" ref="queueListener" />
</jms:listener-container>
</beans>

There are two things to notice here. First, I’ve added the amq and jms namespaces to the opening beans tag. Second, I’m using the Spring 2.5 annotation based configuration. By using the annotation based configuration I can simply add @Component annotation to my Java classes instead of having to specify them in the spring context xml explicitly. Additionally, I can add @Autowired on my constructors to have objects such as JmsTemplate automatically wired into my objects.

QueueSender

package com.company;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Component;

@Component
public class QueueSender
{
    private final JmsTemplate jmsTemplate;

    @Autowired
    public QueueSender( final JmsTemplate jmsTemplate )
    {
        this.jmsTemplate = jmsTemplate;
    }

    public void send( final String message )
    {
        jmsTemplate.convertAndSend( "Queue.Name", message );
    }
}

Queue Listener


package com.company;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

import org.springframework.stereotype.Component;

@Component
public class QueueListener implements MessageListener
{
    public void onMessage( final Message message )
    {
        if ( message instanceof TextMessage )
        {
            final TextMessage textMessage = (TextMessage) message;
            try
            {
                System.out.println( textMessage.getText() );
            }
            catch (final JMSException e)
            {
                e.printStackTrace();
            }
        }
    }
}

JmsExceptionListener

package com.company;

import javax.jms.ExceptionListener;
import javax.jms.JMSException;

import org.springframework.stereotype.Component;

@Component
public class JmsExceptionListener implements ExceptionListener
{
    public void onException( final JMSException e )
    {
        e.printStackTrace();
    }
}

Update

I have finally updated the wiki at activemq.apache.org. The following pages now recommend using MessageListenerContainers and JmsTemplate with a Pooling ConnectionFactory instead of JCA and Jencks.

Top 5 Static Analysis Plugins for Eclipse

Eclipse Icon

Static Analysis

How is it that static analysis is still a best kept secret while so much lips service is paid to code reviews?  We have long since understood that boring repetitive jobs should be left for the machines, but when it comes to code inspection there seems to be a mental block.  Humans hold the advantage when reviewing architecture, use of design patterns and code organization, but a machine will find when a known null value is dereferenced 100% of the time and that can hardly be said for even the OCD coders I know.  Therefore, I present the top five static analysis tools for Eclipse.  While you might not have the delight of working on a project running continuous integration with a full unit test suite, code coverage, and static analysis, you can at least run your own private versions and rest comfortably knowing you’ve done your best.

Code Coverage

I assume at the very least that you’ve written some unit tests in Junit or maybe TestNG, the next step is to see if you are actually testing enough of your code.  Code coverage has saved me a number of times when I’ve been a little lax in my TDD discipline.  Having written some code, followed by some tests, its very easy to forget that one code branch and fail to exercise it; EclEmma to the rescue.  EclEmma installs a Coverage mode right next to the run and debug modes that are standard to Eclipse.  Simply run your unit test with the Coverage mode and bang, your code shows up bright green, yellow or red, letting you quickly know where you forgot a test or two.

Bytecode Analysis

The next level of analysis comes from the well respected FindBugs tool.  After installing the plugin, FindBugs inspects the actual .class files of your compiled code for well know bugs and other suspicious behavior.  I’m constantly surprised at the lack of false positives and overall quality of the bugs it finds, from comparing strings with ==, to failing to close resources, and more, its spot on.

Code Complexity Analysis

Next in my list of favorites is complexity analysis.  These metrics, from simple lines of code in a method to the lesser know but more powerful Cyclomatic Complexity and Efferent Coupling, are the closest thing to a “stinky code” test that software engineering has come up with.  If you strive for loose coupling and DRY code, then EclipseMetrics is right up your alley.  Once it is installed you will see warnings where your methods are overly long or complex, or your classes are poorly organized.  Let the OCD run wild.

Dependancy Analysis

Dependancies are one of those things that can go unnoticed until they bite you in the rear.  Once circular dependancies creep in it can become incredibly hard to break apart and modularize your code.  This might not seem important in a small to medium sized project but once a project scales up, the need to break it apart becomes critical and keeping your ducks in a line from the get go makes life that much easier.  For this task we employ JDepend4Eclipse.

Source Code Analysis

Finally we come to PMD. This is the twin brother of FindBugs.  Where FindBugs checks the .class file, PMD checks the .java file.  There is a lot of overlap here but you can find some interesting things like unused code that javac might have optimized away in the .class file.

Monitoring ActiveMQ Using JMX Over SSH

Frustration If you want to know true confusion and frustration I suggest you attempt to monitor ActiveMQ using JMX over SSH port forwarding.

For those who use ActiveMQ, the JMX monitoring is some pretty impressive stuff.  You can dive into connections, queues, topics, subscriptions, etc and get stats about the current state of the system.  However, this nirvana of information is practically unreachable when AMQ is in a data center.  For the first six months or so working on AMQ I was able to get around this using the web console which gives some level of detail on topics and queues but once we moved into trying to debug bigger and bigger problems the console wasn’t cutting it any longer.

The Investigation Begins

As with anything AMQ, I started looking into the JMX documentaion.  Step one was to enable JMX in the activemq.xml file.

<broker useJmx="true" brokerName="BROKER1">

Fire it up, forward port 1099 (the default JMX port), give it a try, and, no go.  Come to find out, JMX uses two ports, one which is defaults to 1099 and one which is negotiated at runtime.  No worries, there is an “Advanced JMX Configuration” seciton in the documentation which lead me to this xml configuration.

<managementContext>
    <managementContext connectorPort="2011" jmxDomainName="test.domain"/>
</managementContext>

Awesome, I can change the default 1099 port but nothing else.  The AMQ documentation was failing me, as usual.  Google, here I come.  After some searching around I was able to dig up AMQ-892.  (Power user tip, search AMQ’s Jira site once the documentation has inevitably failed.)  It turns out you can configure the RMI server port and have been able to do so since version 4.1.

<managementContext connectorPort="11099" rmiServerPort="11119" jmxDomainName="org.apache.activemq"/>

I particularly liked the “This necessitates a documentation update in the wiki.” comment from 2007.  Way to jump on that.  Confident that this is bound to work I forward port 11099 and 11109, give it a whirl, and, failure.  It was at this point that I started to despair.

Deeper Down The Rabbit Hole

Quickly running out of options I decided to try running the same configuration on a dev box in the office, and of course I could connect to it flawlessly.  To add insult to injury I tried another dev box and this one failed.  The only difference I could easily see was one was running a VM image and the other was native but this didn’t point at any easily understandable target.  I was done.  I conceded defeat.  I would soldier on without JMX.

Meanwhile, my co-worker had been pressuring me to start packet sniffing with wireshark.  I had resisted, mostly because I dislike getting that low level, but also because RMI is a binary protocol and I didn’t think I could learn much.  However, I was bloody and beaten at this point and gave in. I downloaded the package, fired it up and started sniffing away.  Sure enough the binary was a bunch of gibberish, but tucked away in there was one string, the hostname of the amq server I was trying to connect to.  What the hell is this?!?  That question is left to the reader but at least the issue was clear, the hostname was inside the data center and not something I could connect to from my machine.  It also jived with the test on the local dev boxes.  The box with the VM image had an internal hostname that was not in the office dns, where as the native machine had an addressable hostname.

I attacked the problem with renewed vigor.  I found a JConsole FAQ on the AMQ website that I had previously dismissed for its cryptic message.  However, this time it made sense.  I quickly added

-Djava.rmi.server.hostname=127.0.0.1

to the Java Service Wrapper configuration for AMQ so communication would be forced back through the SSH tunnel, rebooted AMQ, and, wait for it, VICTORY.

The Morale of the Story

So the short answer is add the broker configuration, the management context (the second on up there), and the rmi hostname configuration, port forward 11099 and 11109, and fire up jconsole

jconsole service:jmx:rmi://127.0.0.1:11119/jndi/rmi://127.0.0.1:11099/jmxrmi

As with most of these posts, so easy once you know, but so hard to get there.

Unit Testing Spring Jersey Integration

Recently, I’ve been working on a side project which has given me the opportunity to play with an interesting Java technology stack. After a few weekends of working on the build and moving my way up the stack from database to service layer I was at the point of writing a full integration test. In the past I’ve done integration testing with an iBatis/Spring stack, which, with the help of DBUnit is a fairly simple exercise. However, this project is heavily REST based and the addition of Jersey (JAX-RS) was a serious curveball.

To really test the whole stack an embedded webserver is required.  Looking through the Jersey/Spring unit tests they make use of an exploded WAR using Glassfish.  Assuming this was the optimal solution I added Glassfish to my ivy.xml config and ran an ivy update.  However, once I realized the overwhelming volume of jars being downloaded I decided it was much too heavy weight of a solution.

My next choice was Jetty.  I have had experience with using Jetty in the past but I quickly ran into issues trying to get it working right with Jersey, Spring, and an exploded WAR configuration.  It was then that I saw the GrizzlyServerFactory referenced in another Jersey unit test.  After some prodding and reading into the source code I ended up with the following:

final URI baseUri = UriBuilder.fromUri( "http://localhost/" ).port( 9998 ).build();
final ServletAdapter adapter = new ServletAdapter();
adapter.addInitParameter( "com.sun.jersey.config.property.packages", <your-package-name> );
adapter.addContextParameter( "contextConfigLocation","classpath:applicationContext.xml" );
adapter.addServletListener( "org.springframework.web.context.ContextLoaderListener" );
adapter.setServletInstance( new SpringServlet() );
adapter.setContextPath( baseUri.getPath() );
SelectorThread threadSelector = GrizzlyServerFactory.create( baseUri, adapter );

We start by making a base Uri for localhost at a high numbered port.  Then we build the Grizzly ServletAdaptor.  The first parameter is the package name where your Jersey enabled are located.  The next two lines are taken directly from the web.xml file that is used for the actual WAR.  The first is the config location for the Spring Context and the second is the ContextLoaderListener servlet.  Finally we add the Jersey SpringServlet and the context path.  With these two objects created we can build a SelectorThread and begin using the server using the Jersey Client api that I talked about in my previous post.  When you are done, don’t forget to call stopEndpoint() on the SelectorThread when you are done.

EDIT:

I’ve recently come across one additional helpful tip regarding this setup. If you need to get access to your ApplicationContext, for instance to get access to the spring managed DataSource for database testing, there is a simple but non obvious way of doing this. The simple part is using Spring’s built in utilities for getting the application from a ServletContext.


WebApplicationContextUtils.getWebApplicationContext( adapter.getServletInstance().getServletConfig().getServletContext() );

However, when I first tried this I got an unexplained null pointer exception. After a long while trying to google around for the answer I gave up and dug into the source code. Turns out you need to add one important property to the ServletAdaptor for this to all work.


adapter.setProperty( "load-on-startup", 1 );

This will force your adaptor to initialize the servlet immediately and you populate the ServletConfig and ServletContext so you can get the ApplicationContext from them.

REST calls and JSON results in Java

I recently had the need interact with Twittervision’s RESTful api from Java. As usual, I started googling around for a solution but nothing obviously stood out. There are a handful of RESTful java frameworks, but these focus on providing a RESTful api and not consuming one. Finally, after an annoyingly difficult search I found an impressively simple solution based on Jersey.

The point to realize is that Jersey provides both a sever and a client api. To make use of the client api requires three simple lines:

Client client = Client.create();
WebResource webResource = 
client.resource("http://twittervision.com/user/current_status/bdarfler.json");
String response = webResource.get(String.class);

The result is a string of JSON, but now, how to parse it. After searching around I ended up settling on json-simple. A few simple lines of code and we can get the address for any twitter user.
final JSONObject jsonObj = (JSONObject) JSON_PARSER.parse( response );
if ( jsonObj != null &amp;&amp; jsonObj.containsKey( "location" ) )
{
final JSONObject location = (JSONObject) jsonObj.get( "location" );
return location.get( "address" ).toString();
}

So, once again, simple stuff but not as obvious as I was hoping it would be.

Integrate ant with dbdeploy not in the classpath

FrustrationThe need for a schema versioning system at LocaModa finally became a priority this sprint so I’ve spent the past few days researching and diving into implementation.  After comparing LiquiBase, dbdeploy, MIGRATEdb, and dbmigrate I settled on the simple SQL driven solution that dbdeploy provides and started integrating it with our Ant build.  Pramod Sadalage over at Agile DBA put up a nice post on the basics but I quickly hit a wall, the MySQL driver was not in my classpath.

As I mentioned earlier we are using Ivy for our dependancy management which makes it difficult to throw jars into the Ant classpath since they are automatically downloaded at build time.  So far this hasn’t been an issue since most Ant tasks allow you to specify the classpath as a parameter within the task.  Dbdeploy does not.  Goggling around I quickly found a posting that suggested patching the dbdeploy ant task as the only way to go, so off I went.  However, a few hours later, after wandering through the Java classloader abyss I was stymied.

I backed out of the changes and decided a different tactic was needed; back to Goggle I went.  This time I came across a post which suggested all I needed was to add the jar to the taskdef classpath  Could it really be that easy?  Switching back to my build.xml I doctored up the dbdeploy taskdef, kicked off a build and sure enough the damn thing worked.

So, if you want to centrally manage your ant dependencies, just remember to add the necessary classpath references to your taskdefs, like so:

<taskdef name="dbdeploy"
        classname="net.sf.dbdeploy.AntTarget"
        classpath="${dbdeploy.jar}:${mysql-connector.jar}"/>


The Best of the Best Podcasts

Podcast

I’m constantly surprised at how little press podcasts get.  Everyone and their mother has a DVR and has grown accustom to watching TV on their schedule, yet only a small minority see podcasts as the identical concept applied to radio.  Maybe this stems from a lack of interest in radio as opposed to TV.  Maybe it stems from people only using radio for its musical content, in which case mp3s are as far as they need to g.  Either way, its a shame and in hopes of remedying that in some small way, I have compiled my short list of podcasts which everyone should listen to. (download the opml file)

Public Radio

Public Radio is leading the field in providing their content in podcast form.  I have no concept of when any of these shows air on my local station (or even if they air).  Instead they show up in iTunes and I listen at my leisure.

On The Media

As a meta news show, it is the one and only news show necessary to fully understand how media covers (or fails to cover) the important stories of the week.

7AM ET News Summary Podcast

The daily news in under five minutes.  No Britney, no Timberlake, just the basics. 

Marketplace Morning Report

The daily financial news in under 10 minutes.  Increasingly important in the past six months.

Marketplace Money

A weekly one hour program on the financial sector and personal finance.  Everything you need to know for retirement, debt repayment, etc.

WNYC’s Radio Lab

Hands down the best science podcast.  Incredibly produced and riveting.

This American Life

An hour of touching, poignant, humorous and otherwise evocative stories about life in America. 

Speaking of Faith with Krista Tippett

A wonderful hour exploring every possible view on faith, spirituality, religion, ethics, morals, and all the other big questions in life.

Intelligence Squared

Thoughtful, intelligent, persuasive debates on the hot button topics of today in the Oxford style.

Software Development

The Java Posse

Hands down the best developer centric podcast available.  Four friends with four very different view points come together to recap anything and everything JVM related.

Pragmatic Podcasts

Interviews with authors from the Pragmatic Programers publishing company on their upcoming books.

Railscasts

Interviews with influential members of the Rails community.  The only tolerable rails podcast, more a comment about the other podcasts than about this one.

The Accidental Creative

An inspirational podcast aimed at artistic creatives but carries over well to the technical creative.

JavaWorld’s Java Technology Insider

An infrequent Java podcast with some solid content.

Personal Development

Zencast

Weekly one hour dharma talks, always insightful and inspirational

Buddhist Geeks: Seriously Buddhist, Seriously Geeky

Like the name says, these are a bunch of Buddhists who geek out about Buddhism, and occasionally about tech.

The New Man: Beyond the Macho Jerk and the New Age Wimp

A no bs, post-new age approach to manhood.  I imagine this is one of those love it or hate it podcasts.

Arts

IndieFeed: Performance Poetry

A thrice weekly slam poem delivered directly to your ears, improved only by the host genuine love for the genre and community

Philosophy Bites

Occasional podcast delving deep into a particular philosopher or philosophical concept, all with great British accents.

The Moth Podcast

“Real life stories, told live with out notes.”  The story equivalent of slam poetry.

Fora.tv – Audio Program of the Week

About as close as you can get to TED talks in an audio format.

Business

Harvard Business IdeaCast

Business for the thinking person.  No hype, no buzz words, no marketing speak.

Gen Y Marketing Podcast

A great take on marketing from the Gen Y perspective.  Gotta love the aussie accents.

Entrepreneurial Thought Leaders

A fantastic weekly lecture series at Stanford

No-Install Domain Setup Zen

No Install
In this down economy  the chatter about owning your own domain as a way of personal branding has been on the rise.  However, the elephant in the room is what to do with it once you have it?  For a large majority of people, installing and maintaing blogging software like WordPressMoveable Type, or Drupal is cumbersome, expensive, and unnecessarily time consuming.  Why go this route when everything else online is moving towards the cloud computing model?  I’ll show you how you can set up not only a blog but email, photos and more for little to no cost and without installing a single piece of software.

Getting a Domain

Go out and get yourself a GoDaddy domain using a promo code and you can be on your way for about $7.50 a year.  Nothing beats the price and since they are the 800 pound gorilla of domain hosting you are more likely to find good blog posts (like this one) about how to get your hosted applications up and running on it. 

Putting Up Content

blog.mydomain.com

As I mentioned in my previous post there are a really two ways to get hosted blogging, WordPress and Blogger.  Blogger integrates with GoDaddy freely and easily but is less polished than WordPress.  If you go the WordPress route the cost is $10/yr for redirecting and the set up is a bit confusing but its worth it for the superior platform.

  1. Go do your WordPress dashboard and click on the Upgrades menu
  2. Gift yourself a $10 credit
  3. Under the domains menu add blog.<your-domain>.com
  4. Create a CNAME record in GoDaddy that points from blog.<your-domain>.com to <your-blog>.wordpress.com
  5. Wait and verify that blog.<your-domain>.com redirects to <your-blog>.wordpress.com. 
  6. Follow these directions to make <your-blog>.wordpress.com to redirect to blog.<your-domain>.com

photos.mydomain.com

Unfortunately there is no free lunch here, the only options are Zenfolio and SmugMug.  Zenfolio’s integration seems pretty straight forward and requires a $40/yr subscription.  SmugMug is currently more full featured (for instance it integrates with S3 for storing digital negatives) and more customizable (check out this example) but it also costs more.  Their integration requires a $60/yr subscription.

Google Apps

One of the main reasons for getting your own domain is having an email address with that domain.  Luckily Google and GoDaddy make it very easy with two simple tutorials; one for forwarding the various subdomains and one for setting up your mail server.  Better yet, there is an automated tool for setting up the mail forwarding.

Miscellaneous Tools

wiki.mydomain.com

I’ll let my fellow bloggers extol the virtues of a personal wiki.  Now that you are convinced, go over to Wikidot, make yourself an account and follow the instructions on mapping it to your wiki subdomain.

openid.mydomain.com

More than three years after its inception OpenID is finally taking off with more and more sites providing and accepting the standard.  To centralize your identity at your new domain register at myOpenID and follow their convenient directions.

Tying it Together with Tumblr

Tumblr is one of the most under appreciated sites.  As a blogging platform it ranks last in traffic stats. However, its ability to function as a blog, share feed (via the bookmarklet), life stream (via importing arbitrary rss feeds), or any combination, all while remaining simple to use, is astounding.  For our purposes though, the killer feature is its ability to redirect from a custom domain.  With that setup you can easily start pulling in any feeds you like.  I pull in both my blog and my photoblog feeds but other options might include Twitter, YouTube, digg, etc.  You could also import a share feed from delicious but it pails comparison to using the Tumblr bookmarklet.  With the bookmarklet, content to shows up directly, instead of an imported link, and you can inject your own thoughts using comments.

But the fun doesn’t stop there.  Tumblr allows you to customize every last inch of your site which has resulted in a vibrant community of 3rd party themes and hacks.  After some experimentation, I settled on the nine of mine theme by Sid05.  However, the theme was only the base.  From there, I replaced the default feed with feedburner, added some google analytics, and did some very basic SEO.  Finally, I added comments using DISQUS and used add to any for a share & save link as well as an improved subscription link.

Happy Hunting

Well there you have it, the culmination of all the research that went into creating my homepage.  Use it wisely and don’t forget to drop me a comment.

This Web 2.0 Life

Tubes

Preface

I’m find myself intrigued by how others use the plethora of social media sites that dot the internet landscape. There are the Facebook only users, those that have branched out to Twitter, others that keep an external blog, even fewer who dabble in more than just a few sites, and then there are the elite that strive for that perfect interconnect that unifies their wide scattered online presence. I consider myself in the latter group and as such I feel the urge to share my setup.

Overview

Before we dive into the details I’d like to give a conceptual view of my setup. While some might be tempted to take the swiss army approach of trying to accomplish everything in Facebook or a single blog I find this limiting. In the case of Facebook, they have a wide array tools but none of which really stand out. In the case of a blog it quickly becomes obvious that, while possible, it was not meant to consolidate everything. Instead I like using a wide range of simple, single minded tools and then, through extensive use of rss, push and pull the content where it belongs. 

Self Generated Content

Words

When it comes to traditional blogging sites they tend to fall into two camps, the ones that focus on community and the ones that focus on the individual blogger. When I’m writing my personal musings and occasional moanings I like the feel of a community as well as a flexible set of privacy settings which is why I have my personal blog on LiveJournal. LiveJournal rose to ascension when I was in undergrad and as such its the platform where most of my friends still remain, as well as where many other people my age tend to reside. Additionally, given its nice set of privacy controls I can decide if the world, my friends, or only my closest confidents can see what I write. 

On the other hand, when I started to consider blogging on a more professional level I was instantly drawn to WordPress. In the hosted blog space for individual bloggers the same three names tend to fly around; WordPressTypepad, and Blogger. I wasn’t looking to pay so that quickly ruled out Typepad. As for WordPress vs Blogger the contrasts are pretty obvious. WordPress spends a lot of time on the fit and finish were as Blogger spends a lot of time on the advanced customization. At the end of the day WordPress’s clean interface and themes won out. 

Finally, lets not forget micro-blogging. In keeping with my simple and and focused mentality the clear winner here is TwitterPownce has been gobbled up by SixAppart and end of life’d while Jaiku and Plurk both try and be too clever (with added rss stream imports for Jaiku and crazy timeline visualization for Plurk) and lack in a solid desktop client story.  Interestingly enough the open source site identi.ca looks really slick but at this point I don’t think I can justify the cost of moving all my friends over to identi.ca and I have no interest in keeping a mirror of my twitter account.

Pictures

When it comes to photos things actually get a bit trickier. For a long time I was a pro user at Flickr which I found fantastic as an amateur photographer. As one would expect, the social aspect is top notch, and since it has an overwhelming mind share I have been solicited on it a number of times by people wanting to use my photos which is quite nice. However, as I became more serious about my photography I realized I needed something more serious for my photos. It was at that point that I made the switch to SmugMug. At the time it was the only serious option for professional photographers short of rolling their own solution. Additionally its multi-tiered membership levels gave me room for growth as a photographer.  

At the same time, I recognized the importance of setting up a photography blog to promote my photography beyond just posting them online.  There are a handful of photoblog sites but they all work under the paradigm of uploading photos which gets annoying quick, they really need to work on SmugMug and Flickr integration.  Instead, I prefer simply linking to them from my SmugMug account. Additionally, I couldn’t find one that can hang off my own domain.  So, even though a few of them are pretty slick looking I was drawn back to my blog stand by, WordPress.

With my professional pictures safely on SmugMug I was left with the issue of where to put my random snapshots of friends and events. I could have continued to use my Flickr account but I have serious issues with Yahoo!’s ridiculous username/account name clusterfu*k whereby I end up with a different Yahoo! name from my Flickr name from my Flickr url, its abysmal for someone who likes to have a unified web presence. The solution was to go where the people are. For photos of friends I end putting them in Facebook. For photos of family I usually put them on Picasa. However, more and more my family members are finding their was to Facebook so Picasa might be on its way out of my toolbox.

Sharing Others Content

The flip side of all this content generation is sharing other’s content. There are many options in this space with a plethora of sites all jockeying for a share of the social-bookmarking space. However, I find the social-bookmarking paradigm a poor fit for sharing of user content since here is no easy way of sharing the actual content, just links to it.  Google Reader, has a nice solution in this space where you can share items in your feeds and they end up on a public share page.  However, this requires that the content you want to share be in a feed to begin with and the public pages are not the prettiest things to look at.  In my opinion the stand out winner in this space is Tumblr.  Using a simple bookmarklet I can post pictures, text, videos or links from any site to a nicely styled and easily configurable site that works for both the rss junkie and the casual web browsing friend.  They also play nicely with using custom domains.

Social Networking

The last piece of this puzzle is social networking.  At this point its damn near impossible not to be on Facebook, and of course I am, but thats not the only social networking site either.  LinkedIn, is quickly becoming the social network of repute for the business world and the place to go for both job hunters and head hunters.  Finally, there is Twitter.  While it doesn’t try to be the center of your personal or professional universe like Facebook and LinkedIn it is still the go to place for connecting and communicating with friends and acquaintances, personal and professional alike.  Its an invaluable, on going conversation.

Consolidation

So thats the survey of applications I use, but now comes the fun part, consolidation.  I tend to group my generated and shared content loosely into two groups, personal and professional, which heavily influences where I pool my content.

For me my personal hub is Facebook and as such its the consolidation point for all of my personal content sharing and generation.  I use the Tumblelog facebook app to bring in my personal Tumblr, the default notes app to bring in my personal blog, and the Picasa Tab app to bring in my Picasa photos.  Additionally, I use the Twitter app to bring in my Twitter messages as status updates.

The professional piece took me a bit longer to figure out.  It wasn’t until I finally purchased my own domain (bdarfler.com) that things really came together.  As I alluded to before, I have my two wordpress blogs hanging off this domain as well as my SmugMug account, but how was I going to consolidate these as well as the professional content that I share?  This is where Tumblr really shines, that domain is actually just a Tumblr page, and nothing more.  Moreover, Tumblr can auto post content from any arbitrary rss feed, which allows my to consolidate content from my blog and photoblog as with the content that I post manually.  The added benefit of all this is getting one rss feed for everything I do professionally online which I can then pull into LinkedIn using the BlogLink app.

Conclusion

So there you have it, the eventual evolution of my online presence.  I’m sure things will continue to fluctuate but at this point I’m fairly satisfied with the whole situation.  If I get ambitious again I’ll write a post exposing more of the details of my setup over at bdarfler.com.  Its pretty interesting what you can do without actually hosting a single file and the Tumblr hacks I have are quite cool as well.  If you have any feedback, ideas, suggestions, etc. I would love to hear them below.

Follow

Get every new post delivered to your Inbox.