LOL Boowebb
posted Friday, Jan 18, 2008 @ 04:51 PM EST (edit)

http://lolinator.com/lol/boowebb.com/

Other fun sites to LOL:

http://lolinator.com/lol/boowebb.com/hiking

http://lolinator.com/lol/en.wikipedia.org/wiki/Lolcats

http://lolinator.com/lol/www.scientology.org/

Stop It!
posted Friday, Jan 18, 2008 @ 03:49 PM EST (edit)

OK, if you are one of the however-many-millions using BlueTooth(tm) headsets with your cell phones - stop now!

We get it. You are _SO_ important that someone may call at any moment and you must be able to answer the call at a moment's notice. Nevermind that your phone actually rings 4+ times before you need to answer it and that the time it would take to life a phone to your ear or - heaven forbid! - remove a headset from your pocket and insert it into your ear.

Now what I'm talking about is not opposition to BlueTooth(tm) headsets or headsets in general (we'll get to that in a moment). I am opposed to people that walk around with these things in their ears like they are jewelry.

My favorite was a couple of years ago on a flight. After the "you can now get up and walk around" message was broadcast to the passengers some dude comes walking up the aisle with a BlueTooth(tm) headset in his ear. Really? You going to take an important call mid-flight?

Another fine example is when attending the Tacoma Days festival (yes, I will admit the irony of me passing judgement on people from the Tacoma Days festival) the number of people walking around just "waiting for the call." Clearly I don't get enough phone calls - I just don' get it.

But while we're on the subject - stop talking in elevators and inside public places ESPECIALLY if you are in line. My immediate reaction is to start conversing with this person. After all they clearly are unconcerned with my personal space so why should I be concerned with theirs? And if you are in line at a store is there a more demeaning act than treating the checker like a 2nd class citizen?

This of course makes me long for the days when you actually might not be home when someone called. Don't get me wrong, I would hate to not have my cell phone but this is just swinging too far.

Now onto BlueTooth(tm) itself. First, it's dangerous. My old boss of course got himself all hooked up with the BlueTooth(tm)/BMW integration - a nice feature that hooks your phone into your car's speakers and displays caller ID on your radio display. A nice feature until you happen to be driving around with a date and another girlfriend calls.

Second - what's the point? Yippee, I can have a 5' wireless network around me. I have exactly three cables coming out of my laptop at the moment which somehow are not creating a huge burden for me from a clutter perspective. Last time I checked a wired mouse was about the same size as a wireless mouse. Outside of a wireless headset for my phone I don't feel any more mobile with BlueTooth(tm) in my life.

In a nutshell - I'm impressed. I don't get BlueTooth(tm) at all and yet they've somehow convinced us all that it's the next best thing.

But I digress. Where was I?

Oh yeah - you look stupid with that thing in your ear.

Extract Files From Subversion for Propagation
posted Tuesday, Jan 15, 2008 @ 12:47 PM EST (edit)

Problem:

You store your site files in a subversion repository for source control. When you update your site you don't want to upload the entire tree (nor the svn working copy files) nor do you want to spend time hunting and pecking for the changed files.

Solution:

Use the following script on *nix to extract non-svn files that have recently changed:

find . -not ( -name '.svn' -type d -prune ) -not ( -name '*.log' ) -type f -mmin -240 -print | zip ~/Desktop/prop -@

Discussion:

We're building upon syntax we've used in two previous posts: delete files from a subversion sandbox and zip changed files in your subversion sandbox.

In this case we are using the "find" command combined with the -mmin option to find file modified within a specified number of minutes. find . -mmin -X will find files in the current directory structure modified in the last X minutes. find . -mmin X will find files in the current directory structure modified before X minutes ago.

In the example above we're findiing all files not in .svn folders modified less than 240 minutes ago. We pipe the results of that find to the zip utility to zip up the results. We are also filtering out the Rails-specific "development.log" from being zipped.

If you want to propagate an entire directory structure you can use svn export on your working copy to extract out all your files (this is the same as a checkout without the .svn folders). You can also svn export from the repository to pull a specific revision or branch.

svn export . ~/Desktop/prop
svn export http://repos/project/tags/release_1.0 ~/Desktop/prop

And for those Rails developers you can obviously use Capistrano to get around most of these issues.

Delete All Files in a Subversion Working Copy
posted Friday, Jan 11, 2008 @ 01:07 PM EST (edit)

Problem:

You want to remove all the files in your subversion working copy but you do not want to remove the folder structure.

Description:

I have had to do this when upgrading an application from Rails 1.x to Rails 2.0. The file structure of my project changed significantly enough that I just moved everything out to a non-working copy to do the work. When I started to move the work back in there were a lot of files/folders that had changed.

Rather than work through the manual process of moving files in svn it's sometimes easier to just start from a new point in time within the same repository. In that case you want to:

  1. remove all the files in your current working copy yet preserve the folder structure for SVN
  2. move all the new files into your working copy and commit those changes
  3. clean up any new/missing files and folders.

Solution:

*nix

From the command line run:

find . -not \( -name '.svn' -type d -prune \) -type f -print | xargs rm 

This says....

find from the current directory (find .)
...ignoring files in a directory called '.svn' (-not ( -name '.svn' -type d -prune ))
...any file (-type f)
...and delete it (-print lists the files and xargs rm removes any file in that list)

oddly enough the following _will_ list out the same as above...

find . -type d -name '.svn' -prune -o -type f -print
but -delete is invoked with -depth implied so you will end up deleting required svn files if you run

find . -type d -name '.svn' -prune -o -type f -print

Windows

This is easier from the UI with your favorite search tool. I use Directory Opus so from the advanced tab specify Location to not match .svn and type matches files only.

Any other good ideas for this on Windows?

The Definition of "Ballsy"
posted Wednesday, Jan 09, 2008 @ 06:28 PM EST (edit)

http://www.google.com/microsoft.html

RAILS_DEFAULT_LOGGER: Writing to the Log in Rails
posted Wednesday, Jan 09, 2008 @ 01:33 PM EST (edit)

One great thing about Rails is the logs that are produced in development mode. By default rails will list out all SQL statements and trace all controller calls.

It is possible to add custom messages to the rails log through a poorly documented RAILS_DEFAULT_LOGGER object which is defined in environment.rb.

The following log levels are available:

  • debug
  • info
  • warn
  • error
  • fatal

Therefore, to add debug calls to your code for development mode just add the following:

RAILS_DEFAULT_LOGGER.info "foo bar"

I've found it useful to add a method to application_helper for this for consistency. It helps as well to add line feeds and searchable text to make your output stand out in the log file.

def add_to_log(output)
  RAILS_DEFAULT_LOGGER.info "\n ***mylog*** #{output}\n"
end
Easily Zip Changed Files in Your Subversion Working Copy
posted Wednesday, Jan 02, 2008 @ 02:06 PM EST (edit)

Subversion is a great tool for source control on a team of software developers. Every check-in we do into subversion must be accompanied by a code review from a fellow developer. The best method for doing this is to send the modified files to another developer in zip format. But how does one do this with a large source tree?

*nix

From the command line run the following:

svn status | grep ^[AM] | awk '{print $2}' | zip ~/Desktop/cr -@

A small explanation of what's going on here:

  • this makes heavy use of piping (aka the | or "pipe" character) which sends the output of a command on the left of the pipe as input to the command on the right. as a short exampe ls -l | grep ^A will send a directory listing to grep will will then evaluate that list and parse out only those entries that start with A (which really will be none...).

  • svn status will list all files in your working copy (local sandbox) that are not in sync with the svn repository.

  • svn status returns ?, !, A, M, D for "unknown," "file missing," "added," "modified," and "deleted" respectively. it lists this info in column 1 and the file path in column 2.

  • we use grep ^[AM] to filter out the list for added and modified files only. it's a regular expression that says find matches where the line starts with A or M. this means the output of svn status | grep ^[AM] will be a list of all added and modified files in your working copy.

  • we use awk '{print $2}' to print the 2nd column front standard input. this means that svn status | grep ^[AM] | awk '{print $2}' will list the paths of each file in your svn working copy that has been added or modified.

  • zip is the most obvious command in this sequence - it builds a zip file in the location specified. the only odd option is -@ which tells zip to take the list of files to zip from standard input.

I have actually saved this to a bash script to make sure I delete any existing cr.zip.

Windows

Heaven forbid you can actually do something more easily and nearly as geeky on Windows but it's true....

This assumes you use TortoiseSVN which is a stellar program that integrates into the Windows shell.

Right-click on your trunk directory and choose TortoiseSVN => SVN Check for Modifications. This command sends svn status and returns the list to a dialog box. From here you can double-click each file for easy diff.

To zip these files up create a new zip file (on your desktop) with your zip utility of choice (aka WinRar or WinZip - as you'll see in a moment) and open the zip in your utility.

From the TortoiseSVN window select all the files you want to zip (you will have to manually unselect (or not select) deleted, missing, or non-added files which is made easier if you sort by the "text status" column) and drag them to the title bar of your zip utility. With WinRar and WinZip you get a dialog giving you options about how you want to add these files - make sure you select to add the files with full paths or when they are unzipped they'll be all at the root of the zip file.

I have not played with other zip utilities on windows outside of 7z which does give you the option to add files by full path.