Tuesday, March 29, 2011

How easy it is to be kind!

On David Cásseres site today I read his blog post entitled Checkstand. I was struck by how simple and kind the young man was. It takes just something simple and just paying a little attention to others to be in a position to help them or make them feel good. I sit here now wondering how I might do better at this as well! Not only for customers, but friends and family as well. I think that may be the resolution I never did figure out for the new year. Funny thing is it fits in with the Golden Rule so nicely... ;-)

Have a great day readers!

Sunday, February 28, 2010

Remove the annoying .svn dirs

While moving a Subversion repo to Git, I again was reminded how much I like Git and it's simplicity with regards to what metadata it stores and needs to run.

The particular issue is one most SVN users are familiar with, the .svn hidden dirs. There is one for every directory in a SVN project. With Git there is just one up at the top of each project. The .git directory serves the same purpose and only intrudes in one place. A perfect example of the DRY principle at work

Anyway, I wrote this little command line script to get rid of the annoying .svn dirs when I copied the repo over to what will be it's new Git home.

find . -name ".svn" -exec rm -rf '{}' \;

It finds the .svn dirs and removes them forcefully. I know it's not a big revelation, but it is handy.

Sunday, February 07, 2010

Codeswarm 0.1 on OS X 10.6 with a Git repo

The other day while browsing, I came upon a link to the google code Codeswarm project. Codeswarm allows you to visualize the changes in your source code repository over time. Codeswarm is available here: http://code.google.com/p/codeswarm/

The Codeswarm application will run as an applet allowing you to supply the URL of the repo to visualize and then showing you the changes in your repo graphically. It allows you to save those visualizations as image files which you can then make a movie out of. You can also config some files to use your local cloned repo by giving a config file the directory path to your repo.

This post shows the steps to do use codeswarm 0.1 on OS X 10.6 along with your local clone of the remote Git source repo.

Thanks go to several hints and people who supplied them on the Codeswarm project wiki. I just put several of them together that fit for my need. Also, I couldn't find a page on the wiki that really fit this kind of step by step posting, so I decided to put a blog entry up about how I did it. I did also leave these steps as a comment on one of the wiki pages but it really wasn't the correct one for it, so that cemented my doing this post. So without further ado…

Steps to get it running with your Git

Make sure you have JDK 1.6 installed and setup, including having JAVAHOME set. These steps do not use the OpenGL option which while making it faster are still experimental.

Build and Run
  1. Change directories to your codeswarm directory. ( cd )
  2. Type the ant command to start build
  3. Change directories to your git repo directory. ( cd )
  4. Type in this command (all on one line):
  5. git-log --name -status --pretty=format:'%n------------------------------------------------------------------------%nr%h | %ae | %ai (%aD) | x lines%nChanged paths:' > activity.log
  6. Change directories to your `codeswarm` directory. ( cd )
  7. Change directories to the `convert_logs` directory. ( cd convert_logs )
  8. Convert the log files to XML format. The `-g` option means log format is git. (In git's case a modified git output log by step 2 above) (This command converts the git log to a XML version of itself). To do the conversion, type this command:
  9. python convert_logs.py -g /activity.log -o activity.xml
  10. Change directories to the root codeswarm directory. ( cd .. )
  11. Change directories to the `data` directory. ( cd data )
  12. Edit the `sample.config` file to change the `TakeSnapshots` variable to true like this: `TakeSnapshots=true`
  13. In the `sample.config` file also change the `InputFile` variable to be the path to your XML version of the activity logs. We just had step 5 output it into the same directory the command ran in, so in this case the setting is like this: `InputFile=./convert_logs/activity.xml`
  14. Change directories back up one directory to the codeswarm root directory. ( cd .. )
  15. Create a 'frames' directory at top level of codeswarm directory if there isn't one already. This is where all the snapshots of the progress go. (You'll see exceptions about files not being able to be written if you don't do this.) ( mkdir frames )
  16. Type `run.sh` on command line in this directory.

Make a movie
  1. Look in `./frames` directory and you'll see all your snapshots. Depending on which tools you have available, you can then take these snapshots and make a movie. I pasted them all into iMovie, selected them all and gave them all a frame duration of 00:02 seconds (2 seconds) (In TimeCode format the first set of zero's before colon is minutes and the second set after colon is second) Anyway this produced a nice little movie
  1. Change directories to your git repo directory. ( cd )
  2. Cleanup the activity.log file in your git repo directory. ( rm activity.log )
  3. Change directories to your `codeswarm` directory. (cd )
  4. Change directories to the `convert_logs` directory. ( cd convert_logs )
  5. Cleanup the activity.xml file in your convert_log directory in the codeswarm directory. ( rm activity.xml )
  6. Change directories to your `codeswarm` directory. ( cd )
  7. Change directories to your `codeswarm` directory. ( cd ./frames )
  8. Clean up all the snapshots. ( rm *.png )

NOTE: Where absolute paths are such as in step 5 above, change the path to be the correct one for where you put your file.

My Sample video (most rudimentary)

Other code swarmers

Tuesday, December 22, 2009

Code Formatter for Blogger


This tool helped me to format my code for my previous post and I wanted to let people know it worked quite well, has an easy to use interface and just worked!

ServiceMix 3.3.1 Basic Sample Build fails - How to fix

I've been learning ServiceMix 3.3.1 for some stuff at work lately. I've also had to learn Maven as ServiceMix uses it for many things as well. I started like most people by following the Getting Started guide and trying the wsdl-first sample which worked quite well right off the bat. However when I went to try to work thru the basic example, I ran into a failure right away.

I chose the .../examples/basic sample to work on next based on it's name. I needed the next simple example to help me learn. While it is basic in terms that there is no source code for any custom service units or engines, there is an assembly which is defined in the servicemix.xml config file. It is not basic in the sense that you need to understand that it's a static deployment of components, it starts up a servicemix instance when it's run, etc.

So finding that the basic example is not so basic to understand, I tried to run it for the first time hoping that it's output would help enlighten me. Alas it failed with lots of output.

On a side note, I am running OS X Snow Leopard (10.6.2) with JDK 1.6.0_17, Maven 2.2.1 and ServiceMix 3.3.1 which I got as a download binary. But this issue is going to hit anyone trying the basic sample with 3.3.1.

The Problem
When I tried to build the apache-servicemix-3.3.1/examples/basic sample, I got the following error output (truncated for brevity):
 mvn jbi:embeddedServicemix
[INFO] Scanning for projects...
[INFO] snapshot org.apache.servicemix:samples:3.3.1-SNAPSHOT: checking for updates from apache.snapshots
Downloading: http://people.apache.org/repo/m2-snapshot-repository/org/apache/servicemix/samples/3.3.1-SNAPSHOT/samples-3.3.1-SNAPSHOT.pom
[INFO] Unable to find resource 'org.apache.servicemix:samples:pom:3.3.1-SNAPSHOT' in repository apache.snapshots (http://people.apache.org/repo/m2-snapshot-repository)
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).

I looked in the forums and mailing list archives for ServiceMix and at many Google hits related to ServiceMix and build issues. I even posted a question to the ICQ. But no answer was to be found or had. After looking at many JIRA issues, other peoples issues, etc., I finally found a little blurb online that helped me figure it out. It took awhile because nothing talked about the basic example. The blurb I did find was about someone else's problem building something else. But it was enough that it helped me figure out what was wrong with mine and it showed me yet again that it's oftentimes a super simple thing.

The Fix
The fix is actually quite simple and had I had more experience with Maven it might have jumped out to me right away. In the pom.xml file in the base director of the basic example, I had to change the following code at the very top of the pom.xml file:

to be:

The only change being the removal of the text -SNAPSHOT from the version tag value. After I removed that and saved the pom.xml file, I was ready to try the build again.

Build it & Run it -- Success???
I typed the following at the command line (as stated in the README.txt file in the basic sample dir):

mvn jbi:embeddedServicemix

The build continued along fine and then automatically started servicemix. Wahoo! In my terminal I saw ServiceMix start outputting text like the following and continue doing it every few seconds:
 2009-12-23 01:21:49,961 [.trace-thread-3] INFO TraceComponent         - Exchange: InOnly[
id: ID:
status: Active
role: provider
service: {http://servicemix.apache.org/demo/}trace
endpoint: trace
in: <?xml version="1.0" encoding="UTF-8"?><timer><name>My Example Job</name><group>ServiceMix</group><fullname>ServiceMix.My Example Job</fullname><description/><fireTime>Wed Dec 23 01:21:49 CST 2009</fireTime></timer>
] received IN message: org.apache.servicemix.jbi.messaging.NormalizedMessageImpl@15a08be5{properties: {}}
2009-12-23 01:21:49,961 [.trace-thread-3] INFO TraceComponent - Body is: <?xml version="1.0" encoding="UTF-8"?><timer><name>My Example Job</name><group>ServiceMix</group><fullname>ServiceMix.My Example Job</fullname><description/><fireTime>Wed Dec 23 01:21:49 CST 2009</fireTime></timer>
I had it working.

After the sidetrack to learn some Maven and searching the net, I'm finally back to trying to understand what a static deployment means in ServiceMix, etc.

I hope this helps someone who's beginning with ServiceMix.

Wednesday, November 12, 2008

Long Time Gone...

It's been a long time. I'm now working on a iPhone Development book for Addison Wesley due in early 2009.

I still use Java, Smalltalk and Lisp. Lately I've been playing with Clozure. It's a nice Lisp-1 type language on top of the JVM.

Anyway, now that the NDA is lifted for the iPhone I thought I'd start posting more again, so hopefully life doesn't intervene and leave no time to do so. Till next time, take care.

Tuesday, November 28, 2006

Such a simple thing can give much joy....

It's amazing how something so simple can add a bit of joy to a life...

Tuesday, November 14, 2006

Universal Music Group can kiss my dollars goodbye!

While reading this link Red Hot Chili Peppers, QOTSA, T.I. Rock For Zune about the Zune launch, I came across this quote by UMG chairman/CEO Doug Morris.

"These devices are just repositories for stolen music, and they all know it," UMG chairman/CEO Doug Morris says. "So it's time to get paid for it."

Well Mr. Morris, I'm and iPod owner and now you can kiss my business away and not just from music, but from anything I can find out Universal Group is into, that includes DVD's, movies at the theatre, etc. Before you write me off, you might want to know that I own approximately 2000 CD's which I've bought over the years since 1985, I have about 200 DVD's, my son and I go to the movies almost every weekend, sometimes we'll even see two movies. We are the demographic your industry loves. But you can be sure that I will from now on not be contributing to your company or from any company that is part of your group or any artist that is part of your group.

You see Mr. Morris, you and your record industry might also be considered thieves, especially after all the lies you've told the consumer over the years. And lies you still tell, like those about iPod users.

I'm old enough and close enough to the music industry to remember all the industry's talk about CD's being cheaper to produce than vinyl, so that consumers should expect prices to come down. I remember many of the other lies your industry told. I remember paying $16 to $25 dollars per CD. I remember when your industry quit selling CD singles because they cut into the full album sales. I remember that your industry sold those singles for $3.99 each when a vinyl 45 or cassette single could be had for less than half that. Your industry used that to get rid of all singles sales. Leaving consumers to only buy full albums. I remember your industry lobbing for laws to make it illegal for someone to record songs off the radio for the own listening later.

I also know that your industry doesn't like people knowing how much your corporate profits went up dramatically from the 70's till now. You don't like people knowing about all the money you sucked from the coffers, the coffers which were filled by the boom of music in the 80's and 90's and brought along by MTV. You don't like the artists to know it and you don't like consumers to know it! And yet you call us thieves. You steal from your artist and from the consumer.

Capitalism allows all these things to happened, but when you call me a thief because I own an iPod, you've gone to far! That's liable to all the honest consumers of music. People stole music before the iPod came out and copied it to the early MP3 players. I did not own one of those, I waited till the iPod came out and I've bought songs from the Apple store. And I bought songs legally on iTunes.

You are upset now because your not making as big a profit as you want! You can't keep the growth factor going up much, you have competition from independent labels and the vast new sources of other music. Instead of being competitive with that, you call me a thief!

I can tell you this Mr. Morris. I will continue not to steal music, but you won't make any more money off me either. So your net result is that you'll still be losing money. Your arrogant Mr. Morris! You insult me and other honest consumers. Your customer service sucks Mr. Morris!

So now I won't steal the songs Mr. Morris, nor will I buy them. I'll record them off the radio as per my legal rights and then copy them to my iPod and still hear them in a legal way. Or better yet, I'll listen to other artists who are independent. You see Mr. Morris there is plenty of great music out there now. And it's in channels you don't control. That's the real thing that irks you and your industry!

I'll get the satisfaction of knowing that you Mr. Morris won't get a dime from me directly, I'll get the satisfaction that your big mouth has cause an artist to be a little ticked off with you because the won't get my dime either. Maybe just maybe those artists will move to a more progressive consumer friendly media giant or giants. Maybe they'll fire you after their contract is over with you. And then, maybe they will get more of there share of the vast profits that your industry has been getting since the advent of the CD. They'll get back what you and your industry has been stealing from them.

You and your industry can be considered thieves and thugs. You bully consumers and artist Mr. Morris! You do it both in the way you've marketed, scammed and played the system and now in your words and legal fights. You hate the biggest audience for your product, because they don't consume it in the way you want and others are empowering them to do so. It's called "freedom" Mr. Morris! Your industries monopoly on how, when and to whom product was delivered is over

The iPod and the revolution around it have forced your industry to wake up and have to be responsive to the consumer again. How have you responded to those consumers? Your threatening and suing children, teenagers and people who don't even have a computers. Your industry has put virus's on the consumers computers (and then said that destruction of a consumers property was not your fault - how two faced is that?). Your industry has colluded with radio in payola. The iPod and it's brethren has given back the option for consumers to buy the music they want to hear! The MP3 and iPod has given many other acts more distribution options things you don't like.

I have no problem with artist making profits from their songs and hard work! M vast collection of CD's will attest to that as I've paid for my music. But you know as well as I do that most artists make less than 5% of any song sold. You and your industry eat the other 95%. Your like the charity organizations that take in $1 and then give $0.10 cents to the needy and list the other $0.95 on the books as salaries, overhead, etc.

You tell me I'm a thief! Well you can kiss my a$$ goodbye Mr. Morris! You see, now I can listen to lots of artists who create great music and I can get to it because of the net, the iPod and the revolution that they brought about. I don't need you Mr. Morris! I'm no longer limited to what you and your group think I should buy. I can make sure the artists gets all the money.

Price fought for this and he was right. Artists take note!

With quotes like yours and others, we all see the greed and hatred you have for the consumer. We're just a profit number to you and if not that, then we're thieves. Your colors and your industry's colors are showing brightly Mr. Morris!

Here's hoping you are hit further by results of your disdain for the consumer. I hope that artists and consumers are further empowered by the revolution in media that is happening with iPods, video sites, more content creation by individuals and independent studios. Here's hoping they break you guys and make you realize the harm your doing to the very consumers you seem to want to sell too! To the artists and the consumers. It's a sad day when the middle-men get 95% of the profits and then alienate your very audience. Watch the company you keep... I hope new artists think twice before signing with a company that has a leader like you, a person who alienates a large part of the audience. Think twice and maybe three times...

As I was editing this post, I found this other blogger who shares some similar thoughts. Read it here: Universal Calls MP3 Users Thieves. In it I found out that Steve Balmer thinks I'm a thief also! Also, make sure you read the post referred too in here about Zune Pricing also. What a screw for the consumer! At least Apple is fair with it's users and tries to respect both parties. When you deal with the Microsoft and the music guys like Mr. Morris you always feel like your playing some kind of shell game and looking for how they are going to get one over on you. Good to see someone opened up that box. Lets just hope consumers get the information and don't fall for the shell-game.

Viva La iPod Revolution!