Shell Script Version Compare (vercmp)

Here is something useful. A very short shell script to compare standard version numbers of the form ##.##.## with up to four segments. It returns the difference of the first differing segment just like strcmp.

#!/bin/sh
 
expr '(' "$1" : '\([^.]*\)' ')' '-' '(' "$2" : '\([^.]*\)' ')' '|' \
    '(' "$1.0" : '[^.]*[.]\([^.]*\)' ')' '-' '(' "$2.0" : '[^.]*[.]\([^.]*\)' ')' '|' \
    '(' "$1.0.0" : '[^.]*[.][^.]*[.]\([^.]*\)' ')' '-' '(' "$2.0.0" : '[^.]*[.][^.]*[.]\([^.]*\)' ')' '|' \
    '(' "$1.0.0.0" : '[^.]*[.][^.]*[.][^.]*[.]\([^.]*\)' ')' '-' '(' "$2.0.0.0" : '[^.]*[.][^.]*[.][^.]*[.]\([^.]*\)' ')'

Update: Added zeros to deal with unbalanced version compares

, ,

5 Comments

Mondegreens – Bush, Testosterone

I have a knack for mis-hearing lyrics aka mondegreens. Now that my Palm Pre has lyrics in the music player I found a particularly egregious example.

Aron Bush
I’m man I’m man
I’m real proud of my manhood I’m real proud of my manhood
I like to smoke I like to smoke
ten thousand cigarillos ten thousand cigarillos
eight ball eight ball
I climb a deez fountains I’d climb any fountains
I never cry I never cry
on a ball when I’m loosin’ I only bawl when i’m loosin’
and I’ve never been wrong and I’ve never been wrong
never been wrong never been wrong
never been wrong never been wrong
and I’m lookin’ so good and I’m lookin’ so good
lookin’ so good lookin’ so good
lookin’ so good lookin’ so good
got a big ol’ gun got a big gold gun
got a big ol’ gun got a big gold gun
got a big ol’ bullet got a big gold bullet
and I guess you could say and I guess you could say
and I guess you could say yeah, I guess you could say
I will fire I’m real full of it
I’m real full of it I’m real full of it
I’m real full of it I’m real full of it
real full of it I’m real full of it
full of it full of it
full of it full of it
real straight I’m real straight
wanna see my pack of dealy yos wanna see my peccadillos?
hot dog!

7:30 in the mornin’
hot dog 7:30 in the mornin’
and I’m big as you are and I’m big into war
big as you are big into war
big as you are big into war
big as you are big into war
and I am a whore and I am a whore
I am a whore I am a whore
I am a whore I am a whore
got a big ol’ gun got a big gold gun
got a big ol’ gun got a big gold gun
got a big ol’ bullet got a big gold bullet
and I guess you could say and I guess you could say
and I guess you could say yeah, I guess you could say
I will fire I’m real full of it
I’m real full of it I’m real full of it
you’re real full of it you’re real full of it
we’re real full of it we’re real full of it
yeah yeah
ah, ah ah, ah
suck it
suck it
and I shake with your left and i shave with Gillette
shake with your left shave with Gillette
shake with your left shave with Gillette
and I’m pattin’ my back and I’m pattin’ my back
pattin’ my back pattin’ my back
pattin’ my back pattin’ my back
got a big ol’ gun got a big gold gun
got a big ol’ gun got a big gold gun
got a big ol’ bullet got a big gold bullet
and I guess you could say and I guess you could say
and I guess you could say yeah, I guess you could say
I’m real full of it I’m real full of it
I’m real full of it… I’m real full of it…

, , ,

No Comments

More Models in Progress for Marlton

Evesham Fire-Rescue Model Preview
I finally had a chance to add some 3D models to my Marlton collection. I get a few minutes here and there to add a wall or roof profile, edit out a tree so don’t judge too harshly. Included here is Doreens, Dog Days, and the huge fire station.



, , , , , , , , , ,

No Comments

Medela Pumps Look Like Air Horns

Breast Pump | Air Horn

Breast Pump | Air Horn


I could not help but notice how similar the objects look without having any relation to each other in function or history. I don’t think it is juvenile of me to see the relation as long as I don’t make air horn noises at in appropriate times.

, , , ,

1 Comment

Inkscape Growing Feature Palette

Inkscape Palette

One of the lead developers of Inkscape, Jon Cruz has been advocating for better color management in the Libre Graphics projects a lot recently. According to a post on Jon’s blog today, Inkscape is going to grow its support for swatches and swatch books. If it includes strong support for spot (solid) colors these changes will definitely affect graphic designers quite a bit. Some of the efforts listed include enhancing the swatch UI including more drag and drop, including gradients in swatches, and support for swatch book swapping and sharing. The description seems to indicate that switching a swatch book/set will replace the color on all objects that used swatches. The would allow a designer to explore and present different versions of the same work without any change to the objects at all. Sweet.

, , , , , , ,

No Comments

Freshmeat.net Finally Updates Site

Freshmeat 3.0 Screen Cap

Freshmeat 3.0 Screen Cap

Freshmeat.net has updated its site after many years of stagnation. It is such a shame because they were very well positioned to have really good marketshare any they mostly sat on their laurels. For example they should have been on top of the code search business. Maybe they will take over the extension/addon business from dysfunctional services like Addons Mozilla Org (AMO) [shakes fist]. AMO is a very well designed site/service with a crappy moderation process behind it (and I have personal experience).

The old design was an example of good design at the time with a not overcrowded feeling and convenient but mellow quick link icons. I In any case, my biggest dislike with the old site was the search. It may have been ok in a pre-Google world but if you cannot beat Googles search you need to embed it.

Freshmeat 3.0 Design Close-up

Freshmeat 3.0 Design Close-up

In this new design the listings are nice and compact. Textual buttons appear on mouse over to remove some clutter (I kind of liked the icons as opposed to text for repetition). Unfortunately they have removed a quick way to visit the homepage or full change log. They replaced some of the info effectively with a more modern tag construct but other info is missing. The search is much better but the language of a listing does not display in the results. The language was pretty important to me when browsing for a library. I have not seen if there is a good set of syntax for the search. Google codesearch like lang:c license:MIT syntax would be nice.

, , ,

No Comments

Local Parking Fail

I have a hard time believing the there is not some larger story but while searching for some fire department info I came across this gem.

EVESHAM RESPONDERS DEAL WITH PARKING MISHAP
Tuesday, August 5, 2008
On Wednesday August 5th, Engine 221 and EMS 229 were dispatched to the parking lot of the Promenade Shopping Center at 500 Route 73 South for a Motor Vehicle Collision. Units arrived to find a parking mishap whereby one vehicle jumped a curb and sidewalk, knocked down a light standard, and drove on top of another vehicle. EMS 229 checked the occupants of the vehicles for injuries while Engine 221 ensured that no ruptures of the oil pan or fuel cell occurred. Both units stood by while the tow company carefully removed the vehicles, so as to prevent further damages and environmental hazards.

, , , , , ,

No Comments

Second McCain Green Screen Challenge Begins

He did it again and the entries have started. Here are my favorite so far:




, ,

No Comments

Google Picasa Face Recognition In the Gutter

Google’s Picasa web service has an excellent new person tagging and face recognition features. Some times it gets a little confused. The above example, which is particularly comical, is one of the extreme examples. Most of the bogus faces are close ups of ears. I do really like these features (when they are working). I was primarily using tags for people so this removes a lot of work.

The social enhancements have a long way to go yet. There a whole bunch of sharing cases that are not covered.

, , , ,

1 Comment

Terribly Mysterious Convention Speeches

The Sphinx Speaks

The Sphinx Speaks

I think several speech writers were watching mystery men prior to the conventions this year. Here are a couple of quotes:

In politics, there are some candidates who use change to promote their careers. And then there are those, like John McCain, who use their careers to promote change.”
Palin

People the world over have always been more impressed by the power of our example than by the example of our power.Bill Clinton

There were a few more that I am having trouble finding moment. Here are some I made up (not necessarily my views). I hope none of them have been used.

We must bring the fight to our enemies before the fight brings our enemies to us.

We need to raise our interest in inflation before our inflation raises our interest.

We will withdraw our troops as soon as possible but it is not possible to withdraw our troops soon.

Instead of doubting the the benefits of drilling, we need to give drilling the benefit of the doubt.

We have changed the way individuals donated millions to millions of individuals donating change.

Attacks:

My opponent asks you to believe what he says but does he say what he believes.

Our opponents don’t believe you deserve change so they only offer the change they believe you deserve.

UPDATE: Doug tipped me Slate was inspired by my story or had the same observation. More likely the latter. The name for it is apparently Antimetabole. To borrow from bond I always knew Bill Clinton was a cunning linguist.

, , , ,

1 Comment

Bad Behavior has blocked 315 access attempts in the last 7 days.