Never Underestimate Radical Vision

March 25th, 2009

eat my tweet

So I have been listening all over the blogosphere, TWIT and even sports talk radio about the wonderful world of Twitter. I admit that I have followed Twitter since it was released but I have never really found the utility behind it. I just didn’t “get it.” I am not totally sure I “get it” now. With that said I am going to attempt to use Twitter and try to figure out the social utility of doing so. You can follow me on Twitter at http://twitter.com/supercodepoet.

As an aside, I found out really quickly that I needed to keep updated via Twitter and would like to know also when my friends are updating their status on Facebook. They have different programs but I really wanted to find some type of social aggregator. The problem I had was that I wanted Mac integrated tools that would sit in the status bar and use Growl for notification. After trying a few different programs I have found my perfect set of social utilities. The first tool is EventBox. This tool allows you to aggregate updates from Twitter, RSS, Facebook, Flickr, etc. This is a great tool with two different UI modes. You have a regular application window but you can also setup a heads-up-display, HUD, that will sit in your status bar. EventBox will also notify you when items arrive via Growl. This is a great tool for only $15. Right now if you go visit MacHeist you can get a free copy. EventBox allows you also to update your status in Facebook and Twitter but you do it separately. I wanted the ability to update both social networks with the same message. Enter MoodBlast, a little utility that allows you to update several social networks with the same message.

If you are on a Mac and need to follow and update your many social networks I think these tools form a great team to accomplish just that. You can try them out but first following me on Twitter: http://twitter.com/supercodepoet. Note: There are a ton of tools for windows users as well: click here.

October 25th, 2008

BorrowMe Lives!!!

For the past month I have been working with some great developers to develop an application for the iPhone and iPod Touch. This has been a great experience and I have learned a ton. After the grueling process of learning something totally different than my normal development path, BorrowMe finally is available on the iTunes Store for $1.99. The following is the application description:

“Who borrowed that DVD?” “Who loaned me this book?” “Who has my lawn mower?”

Sound familiar? We have the same problem; we like to loan things to our friends, and we like to borrow things from them, but have trouble keeping track of what went where. Our solution: BorrowMe. BorrowMe makes it easy to keep track of what you have borrowed, and what you have loaned. No due dates, no collection notices, just a casual arrangement between friends, sealed with a handshake and a smile.

Keep track of your valuables, but value your friendships with the following key features:

  • Separate lists for items you have borrowed and loaned.
  • Enter a new item, or select it from a list of existing items.
  • Use an existing category, or create a new one.
  • Friends can be selected from your contact list, or entered by hand.
  • A list of frequent borrows allows for quick and easy entry.
  • Take photos of your items, or pick an existing photo from your photo library.
  • Easily mark items as returned, and see returned items on demand.
  • Transfer loan information from device to device with an electronic “handshake”. This feature works just like a real handshake transaction. You borrow something from a buddy and want to track that item in BorrowMe. Your buddy needs to keep track of the loan in his/her BorrowMe. No need for both of you to enter the item. All it takes is one person entering the item as either a Borrow or Loan and then sending it via the “Handshake”. Your buddy just receives the “Handskake” and the item s enters his BorrowMe as the opposite of what you sent!

I think it is a great little productivity application I will use all the time. Go to the iTunes Store and try it out!

October 2nd, 2008

A Common Sense Plan

What do you think of this common sense plan to jump start the economy? After some feedback I will tell you who’s plan this is.

Common Sense Plan:

  • INSURANCE
    • Insure the subprime bonds/mortgages with an underlying FHA-type insurance. Government-insured and backed loans would have an instant market all over the world, creating immediate and needed liquidity.
    • In order for a company to accept the government-backed insurance, they must do two things:
      • Rewrite any mortgage that is more than three months delinquent to a 6% fixed-rate mortgage.
        • Roll all back payments with no late fees or legal costs into the balance. This brings homeowners current and allows them a chance to keep their homes.
        • Cancel all prepayment penalties to encourage refinancing or the sale of the property to pay off the bad loan. In the event of foreclosure or short sale, the borrower will not be held liable for any deficit balance. FHA does this now, and that encourages mortgage companies to go the extra mile while working with the borrower—again limiting foreclosures and ruined lives.
        • Cancel ALL golden parachutes of EXISTING and FUTURE CEOs and executive team members as long as the company holds these government-insured bonds/mortgages. This keeps underperforming executives from being paid when they don’t do their jobs.
        • This backstop will cost less than $50 billion—a small fraction of the current proposal.
    • MARK TO MARKET
      • Remove mark to market accounting rules for two years on only subprime Tier III bonds/mortgages. This keeps companies from being forced to artificially mark down bonds/mortgages below the value of the underlying mortgages and real estate.
      • This move creates patience in the market and has an immediate stabilizing effect on failing and ailing banks—and it costs the taxpayer nothing.
    • CAPITAL GAINS TAX
      • Remove the capital gains tax completely. Investors will flood the real estate and stock market in search of tax-free profits, creating tremendous—and immediate—liquidity in the markets. Again, this costs the taxpayer nothing.
      • This move will be seen as a lightning rod politically because many will say it is helping the rich. The truth is the rich will benefit, but it will be their money that stimulates the economy. This will enable all Americans to have more stable jobs and retirement investments that go up instead of down.

    This is not a time for envy, and it’s not a time for politics. It’s time for all of us, as Americans, to
    stand up, speak out, and fix this mess.

September 11th, 2008

How to setup Hibernate 3.3.0.SP1 in Maven

Here is just a quicky for a problem I was having trying to use the latest Hibernate in a project. I needed to setup Hibernate and HSQL in my pom.xml file so the project would build. I Googled around and could not find the correct answer. I tried the JBoss Maven repo were Hibernate lives but could not get the artifact hibernate or hibernate-distribution to work. After playing around here is the dependancies that are needed to get Hibernate Core to build with your code and using HSQL DB.

	<dependencies>
		<dependency>
			<groupId>hsqldb</groupId>
			<artifactId>hsqldb</artifactId>
			<version>1.8.0.7</version>
		</dependency>
		<dependency>
			<groupId>org.hibernate</groupId>
			<artifactId>hibernate-core</artifactId>
			<version>3.3.0.SP1</version>
		</dependency>
		<dependency>
			<groupId>org.slf4j</groupId>
			<artifactId>slf4j-log4j12</artifactId>
			<version>1.4.0</version>
		</dependency>
		<dependency>
			<groupId>javassist</groupId>
			<artifactId>javassist</artifactId>
			<version>3.8.1.GA</version>
		</dependency>
	</dependencies>
May 8th, 2008

Domain Specific Languages with Groovy

In general a DSL, domain specific language, is a language built to attack a specific problem domain and the lexicon of that language matches the problem domain. Huh?! What?! Is that even English?! In a nutshell a DSL is a language that maps to a very specific problem and the keywords are ones the users/developers of that problem space are familiar with. For example you have the problem domain of interacting with Apple’s iPod. Instead of using a general purpose programming language like Java you could develop a DSL that attacks the specific problem of interacting with and iPod. You could have specific commands like play, load, fast-forward, etc. Doing this in Groovy is really simple with method pointers. An example method pointer would be:

say = System.out.&println 

So lets setup the iPod interaction scenario and create a DSL around that. The first thing we need is a Song class to hold song information:

class Song {
  def title
  def artist
  def album 

  static Song newSong(title, artist, album) {
    new Song(title: title, artist: artist, album: album)
  }

  String toString() {
    "${title} by ${artist} on ${album}"
  }
}

Next we need an iPod class to hold that information:

class iPod {
  def static songs = []
}

This now gives us a basis for creating a DSL. We could use the classes out of the box but they are not in the language the use would be used to. Let’s abstract the user away from the class model and create a DSL they would be familiar with. We will do this by setting up some method pointers:

create_song = Song.&newSong
say = System.out.&println
play = { iPod.songs.each{song -> say song} }
load = iPod.songs.&add

Now we can write a little DSL script for interacting with out iPod:

load(create_song("Blue Collar Love", "StarFlyer 59", "Silver"))
load(create_song("Chasing Cars", "Snow Patrol", "Eyes Open"))

play()

This is just a small example of what is possible. There could be other ways to accomplish the same thing but I like this way. With the

ExpandoMetaClass

and meta-class programming combined with method pointers you can create a really interesting DSL that can help users or developers of your application by abstracting away the hard stuff. You could also embed a scripting language into your application by using a DSL.

This is just another example of what makes Groovy so "Groovy"

May 7th, 2008

Give me two Red Pills

I just got out of a session about taking the Red Pill - Groovy and Meta-programming. This session was flat out awesome! The speaker was excellent and his demonstrations were impressive. In my group at work we have been building applications with Groovy for about two months and I have already swallowed the Red Pill, but after this session I want a second dose. There is so much more about Groovy that I need to learn to truly unlock its power. The meta-programming aspect of the language is my untapped market. The speaker did a great job of showing how Groovy enables more productivity by having Java examples and then showing the Groovy equivalents. There were many oohs, ahhhs and laughter about how easy certain things are. What was really cool is how he javap’ed the Groovy class to basically show the bytecode and prove that it is really Java under the covers. He did a great job pf pointing out that he has heard that Groovy may replace Java and laughed that off. He basically said it would be live "icing replacing cake", it is not going to happen. Groovy is Java and they live happily together. This is a really excellent point. You can use Groovy without fear that you are cheating on your precious Java. I will blog hopefully later about some really cool code examples of things he showed with the MetaClass programming. This stuff is really super cool programming magic.

The takeaways really are threefold:

  1. Try it! Use in unit tests because the meta-programming can really make unit testing rock for even the hardest of problems. Not only does it rock but it is like a drug, the more you use it the more you need it.
  2. If you need to build rapid applications for proof-of-concept, prototypes, etc. on a JVM you really can not afford to not use Groovy. It is just Java but with the icing to let you get were you need to go quickly. Groovy is not better than Java it is just the icing on the cake. You can build real applications for very low cost in development time. Not only that it is easy for Java programmers to pick up because it is a world they are already familiar with.
  3. Groovy can be used and is used it production. Oracle, IBM, LinkedIn, Sun, Mutual of Omaha, etc. are all examples of companies that use Groovy in production applications. Is is slower than Java, sure, but only in milliseconds. Not everything about a business application is performance. They use it, you can too!

I strongly encourage you to watch this presentation when it is posted for FREE on the JavaOne web site. I will post a link when it becomes available. Be fore you make your mind up on Groovy give this presentation a watch. Give Groovy a try before you relegate it to the insignificant. I have taken the Red Pill and am about to swallow my second.

May 7th, 2008

It is all about YOU

So I am at JavaOne 2008 and had a great time listening to the Day One keynote/general session. Sun had some entertaining demos and the speakers were good. There were some very interesting messages they were trying push:

  1. Java + You - This is the main focus and message at this JavaOne. Sun is extending its focus from business to consumer. The new slogan is "Java on all the screens of your life", meaning phone, computer, car and TV. These screens should bring new an innovative content and applications to our life. The message was that Java is already there and will only grow to help us as developers deliver the apps that consumers want/need. This is a really interesting pitch. It was more like business, been there done that, the consumer/social ecosystem is where the new money is. How to role Web 2.0, RIA, social networking, mobile apps play into the new business model and how to monetize that market.
  2. JavaFX - this is the technology Sun is betting on for hitting the Web 2.0/RIA crowd. They introduced this tech last year but had more to show this year. I find this approach really interesting as there are already major players in this market (Flex and Silverlight). I am not sure what Sun wants to gain by inventing its own instead of integrating with Flash/Flex. We should see this play out over the next couple months. It may be just to leverage the ubiquity of the JVM instead of Flash. The really interesting bits was the ability to drag and FX app out of a web page and save it your desktop and use it like a desktop app. This was extremely cool! That seamless interaction between the Web and the Desktop is the holy grail in my opinion. When you can abstract away the idea of the connection then you can truly innovate the way we work with our apps.
  3. Mobile is a viable platform - Sun and Java have existed on the mobile platform for years and this was just extending the idea with FX running on the devices. This was really just a personnel message to myself that if I want to stay relevant I need to get into the mobile space a bit.

The keynote overall was really cool, very software rockstarish. Loved that they brought Neil Young on stage and showed how he was able to fulfill a dream by meshing BluRay and Java technology to provide a true interactive music experience.

I recommend anyone hoping online and watching the archived streaming keynote. It will definitely be interesting to see how the social aspect of Web 2.0 change the way we build applications. The focus on usability by non-techs will be huge in the future. Time to get creative!

November 8th, 2007

Variable initialization in BPEL 2.0

When using variables, either global or scope, in a BPEL process you have to make sure you initialize them with a value before use or an exception will be thrown. You can do this easily with an <assign> tag during the execution of the process. Yet, what if you want to use a global variable for the life-span of the process and do not want to reassign it on every <receive> or <pick> that starts the sequence?

As of BPEL 2.0 you can initialize your variables with an inline from-spec in the XML. What??? This is really quite simple. In the variable declaration sections that could look like this:

<variables>
       <variable name="PostCount" type="xsd:long"/>
</variables>

You just need to modify it with a from-spec like so:

<variables>
       <variable name="PostCount" type="xsd:long">
             <from><literal>1</literal></from>
        </variable>
</variables>

The the <assign>, <copy> and <to> tags are implied and do not need to be set.

This makes it very easy to initialize a variable at any scope when it is defined so you do not hit the uninitiated error when running your BPEL process. This also allows you to have global variables that can be used during the entire life-span of the process without having to reset it every <receive> or <pick> event.

NOTE: Currently the Sun BPEL SE for OpenESB does not support this inline variable initialization which makes using global variables for tracking quite pointless. Hopefully the team will implement this as it is standard BPEL 2.0.

October 19th, 2007

Maven repository tip #2

I was trying to deploy my maven plug-in to the internal repository and was having a little bit of trouble. I could not get my plug-in to deploy properly because of ‘Permission denied" errors. This was easily solved by deploying to the file path of the repo server instead of the http path of the web repo. For example, when deploying to a repo http://myrepo/maven2 that is stored on the local file system at /repo/maven/maven2 you need your scp:// statement to use the file system path so it shows up correctly in the http path. For example:

<distributionManagement>
  <repository>
    <id>internal-repo</id>
    <name>Internal repository for Maven</name>
    <url>scp://myrepo/repo/maven/maven2</url>
  </repository>
</distributionManagement>

Also, you can configure the authentication to the server in your Maven configuration file at MAVEN_HOME/conf/settings.xml. You need to add the following configuration under the <servers> element:

<server>
  <id>{unique repo id}</id>
  <username>{server username}</username>
  <password>{server password}</password>
</server>

For example:

<server>
  <id>internal-repo</id>
  <username>joeuser</username>
  <password>P@ssw0rd</password>
</server>

The id would be the same id you use in the deployment element in the pom.xml file.

 
October 18th, 2007

Maven 2 repository tip

"It’s a formidable scent… It stings the nostrils. In a good way."

I recently had issues setting a dependency to Ant 1.7.0 for a project I was developing. The default local repository for Maven 2 is located at ~/.m2/repository. This resolves in Windows  to C:\Document and Settings\{username}\.m2\repository.  When setting up a dependency in a project to Ant 1.7.0 the build would fail trying to grab Ant because of a illegal character in the path. It looks like Maven or something doesn’t escape the path properly and the spaces were causing the build problems. The fix was to point Maven to a new local repository path that had no spaces.

To do change your local repository:

  1. Navigate to MAVEN_HOME/conf/
  2. Edit the settings.xml file
  3. Under the <settings> element add an element called <localRepository> and enter your new path there.

For example, <localRepository>/.m2/respository</localRepository>

Your maven builds will take a little longer the first time you run them again because it fills the repository fresh. You could also just cut and paste your older repository contents and put them in the new place to minimize re-download.