Thursday 27 March 2008

New Ruby Dev Site at Sun

Sun has a new landing site for Ruby developers. For all things Sun and Ruby check out:
http://developers.sun.com/ruby/

Create a Clean Zip on OS X Leopard 10.5

Have you ever created a zip archive on your Mac and sent it to folks on another OS? Have they complained about about all the metadata directories included in the zip? An extra .DS_Store and __MACOSX directory, in every directory, seems to always cause a few complaints. What is a Mac fan boy/girl supposed to do?



Well last week I did a little searching around for a solution. I found several Applescript solutions that seemed a bit over complicated to me and require much more effort than I am willing to provide. :) There must be a simpler solution to the problem, and I think I have found it.



You can use the built in zip command to get a clean archive. I haven't thoroughly tested this, but so far it seems to work. To produce a clean metadata free archive use the following command:


zip -rX archive_name.zip dir_to_zip -x *.DS_Store*


A brief explanation is in order.



  • The -r switch recurses the target directory and gets all subdirectories.

  • The -X switch removes "extra file attributes" according to the man page. It seems to remove the "__MACOSX" files as well.

  • The -x switch allows you to provide a space separated list of file or directory patterns to exclude. So for example, if you needed to remove subversion directories you could add *.svn* to the end of the example.



I've tested the zips created with this method on XP and on Ubuntu 7.10 and both seem to be metadata free. Please drop me a comment if you can further elaborate or have a better version of this command. The best solution must be found for the sake of Mac users everywhere! :)

Wednesday 19 March 2008

Featured gadget: Miniclip Games Gadget


Name: Miniclip Games Gadget
Author:
Catalin Avram
Description: Play a hundred Miniclip games right from your desktop

More information | Download gadget

Each week this blog features a
recently added Google Desktop gadget that looks promising. If you'd like to see all new Desktop gadgets as they're published, subscribe to the RSS feed.

Monday 17 March 2008

Doomsday (Dumbsday?)

Well I went and saw the apocalyptic action film Doomsday over the weekend and learned some very interesting things. Before I go into the detail a quick overview is in order for those of you who have not seen the film.



The year is 2038. Thirty years prior, a killer virus breaks out in Scotland. The virus involves lots of bleeding and throwing up, and its deadly. So, the authorities decide to quarantine the entire country of Scotland. They erect a wall, mine the ocean, setup a no fly zone, no one gets out. Back to the present(future), it looks like the virus has returned in London this time. However, the authorities have noticed that there are a few survivors in Scotland. So they decide to send in the hottest babe they can find (played by Rhona Mitra, and she is hot) to unravel the mystery of the survivors and bring back a cure.



Here is what I learned about humanity after an apocalyptic event:




  1. The most likely people to survive a killer virus are hair stylists and tattoo artists. Cause in the post apocalypse, everyone has a punk hairdo, lots of tattoos, and look like extras from the Road Warrior.

  2. You can survive for 30 years as cannibals. I guess man jerky must keep better than beef jerky.

  3. Even though ancient castles were designed to hold 20 to 30 people of an average size of 5' 6", if you try hard, you can get at least 200 or 300 people in one, and still have room for a Gladiatorial Arena! Humans can accomplish anything if they put their mind to it.

  4. Livestock will be free to multiply like crazy. Since no farmers survive, everyone forgets how to grow crops and raise animals. See 1 and 2 above.


Here is what I learned about the future:



  1. We will soon lose the ability to make night vision goggles. Cause they send the heroine into an area without electricity in the middle of the night, without any.

  2. We will also soon forget how to make bullet proof glass. Cause the armored personnel carrier in the film has its windows broken out with simple pipes and arrows.

  3. Unmanned drones will also become a thing of the past. The only intel available in 2038 is from satellite photos.

  4. Cell phone networks will not change at all, cause if you find a phone made in 2008, 30 years in the future, it still works. Plus cell towers still work even when there is no electricity, I didn't know that!

  5. You won't be able to make a GPS tracking device smaller then the size of a small flashlight.


I won't say the movie is bad, you just have to have a high suspension of disbelief level. The story is very similar to Escape from New York, with Road Warrior stylizations thrown in. My advice, wait for the DVD.

Friday 14 March 2008

Featured gadget: Date Display



The Date Display gadget is one of the most popular Desktop gadgets by an external developer.

A reviewer named Srinivas says: "cool gadget..this has become one of my default gadgets ;)"

An anonymous reviewer says: "The calendar is perfect... except the Wedsneday [sic]..."

If you already have this gadget and the misspelling of Wednesday bothers you, download the latest version to get the correct spelling.

Name: Date Display
Author: Paulo Santos
Description: Displays the day, month and year like an old-fashioned wall calendar

More information | Download gadget

This blog periodically features a Google Desktop gadget and a quote from someone who uses it. If you'd like to recommend a gadget, send an email to desktop-gadgets AT google DOT com.

Thursday 13 March 2008

Dell Linux Laptop???

About 3 weeks ago, I saw that Dell had their 15.4" Linux laptop on sale for about $450. Wanted to try a major brand Ubuntu based Laptop, so I ordered one.



Well I still don't have the machine and I got a call from Dell telling me that the machine is backordered another week.



No wonder Michael Dell had to come back. What a mess. My previous experiences with Dell have been very positive. Generally you would order something and get it within a week. This time they projected a 2 week turn around, and now I'm looking at more like 4 weeks. Not a good way to do business.



Still looking forward to the machine. My previous Dell's had great keyboards and were very durable. It will be nice to have one again, without Windows on it!

Weather RSS Update

Well after using Weatherbug for about 1 week, I have had a change of heart. When you go to their Web page for a full forecast, they create pop under ads in your browser. Naughty, naughty. I simply don't use sites that do pop overs or pop unders. So Weatherbug is on my banned list.



I did find an alternative. Yahoo has a weather RSS feed service described at:
http://developer.yahoo.com/rss/
You just use the provided URL and a parameter for the Zip code and you are all set.

Tuesday 11 March 2008

J2EE Startup Class

Been wondering if such a thing existed so I could use it in my current project. Turns out it does! According to this blog entry (thanks Vinny), you can add a:
<load-on-startup>1<load-on-startup>
element to your servlet element in web.xml. This loads your servlet and runs its init method. The number in the element represents the order the servlets are loaded in if you have more than 1 starting. Pretty cool. I guess I will get to see how well it works shortly.

Monday 10 March 2008

Catch the latest Desktop gadgets



Have you ever wanted to keep track of the newest Google Desktop gadgets right from your sidebar? With our brand new XML feed, that's now as easy as adding it to your favorite RSS gadget.

If you don't already have the Google Web Clips gadget in your sidebar, here's how to add it:
  1. Click the "+" at the top right of your sidebar and search for [ web clips ].
  2. Click the green Add button below the Web Clips gadget.
  3. Click the down arrow in the gadget's top-right corner and select Options.
  4. In the Current Web Clips section, enter http://desktop.google.com/feeds/gadgets.xml?type=rss and click Add.
  5. If you'd only like to keep track of new gadgets, deselect the checkbox next to "Automatically add clips from frequently viewed sites." You can also highlight any unwanted feeds in the Current Web Clips section and click Remove to delete them.
  6. Click OK.

Now just click the title of any new gadget to see its description, or double-click to download the gadget from our gallery.

Enjoy :)

Friday 7 March 2008

Weather RSS

As you know, cluttered web pages with microscopic fonts drive me crazy. Of any category, probably the worst offender is weather sites. Pick any of the big sites weather.com or weatherunderground.com, for example, to see what I mean. The pages are nearly as chaotic as the weather itself is.

Well I think I have found a solution. If you use an RSS reader like Google Reader or NetNewswire, you can get an RSS feed from Weatherbug.com. Just got to their Weatherbug RSS page, fill out a little information and voila! You have a weather feed with just the information you want, no clutter. Yay for Weatherbug!

Wednesday 5 March 2008

To be(ta) or not to be



In October 2007 we released Google Desktop 5.5 (beta), which enabled you to use hundreds of useful desktop gadgets on your iGoogle homepage. I've been one of the happy gadget fans myself. Since I work in a team spread across a number of locations, I've found the World Daylight Alarm Clock gadget to be very handy. Whenever I open the browser to send mail or look at the calendar, I can see daybreak in other cities and plan my work accordingly. And when I'm researching a particular topic, I use the Wikipedia gadget in my iGoogle homepage to quickly type in the topics and preview them in the little details window in context without opening new browser tabs or windows.


Today, Google Desktop 5.5 is out of beta and available in 31 languages (including 2 new ones, Thai and Indonesian). This is great news for lots of people around the world, even me (I use the Hindi version of Google Desktop), as we can now use our favourite desktop gadgets in the language of our choice in the iGoogle homepage. For those of you who are new to Google Desktop, the installation is more streamlined and it's easier to start using desktop gadgets from the iGoogle homepage. So go ahead, choose your favourites from the desktop gallery and select the 'add to iGoogle' link to make them available in your iGoogle homepage � in your language.

Tuesday 4 March 2008

uninitialized constant RedCloth (NameError)

OK, here is another bone headed mistake I made that I will post about in hopes of helping other poor souls who run across the problem. This morning I decided to play around a bit with the RedCloth library that comes with Ruby 1.8 on Mac OS X 10.5 Leopard. So I wrote a simple program in Ruby and tried to run it. Every time I did I got:

uninitialized constant RedCloth (NameError)



And here is my program if you are interested:




#!/usr/bin/ruby
require 'rubygems'
require 'RedCloth'
doc = RedCloth.new "h2. test header

just some text

another para"
puts doc.to_html



Pretty simple. (RedCloth, by the way, is a processor for Textile. Kind of a simple yet powerful way to mark up text like you would in a wiki.) Well I know the RedCloth Gem is in my path and is installed. I know my code should work, but it doesn't. What is the problem?



Turns out I unfortunately named my test file "redcloth.rb". Turns out the Gem file is named "RedCloth.rb" and is in the path and can be executed from the command line. If you don't know, OS X is case insensitive like Windows XP, so those names are equivalent. Thusly, Ruby faithfully tried to load my local script file, which doesn't define any of the needed objects. Therefore, the error. Naming the file "rctest.rb" fixes the problem.



So I hope this little note helps someone else out in the future. So if you get a: "uninitialized constant XXXXXX (NameError)", make sure your file name isn't the same as a the Gem file.

Saturday 1 March 2008

NetBSD Toaster


So it may not be the most practical use of NetBSD or a TS-7200 SBC, but you can't fault the imagination of the engineers at Technologic Systems. Did I mention, it comes w/ an RJ45 connector an Apache Web server and it plays MP3s while making toast!

Sure beats the Micro$oft Flying Toasters!


More here.