As has been widely reported James Carville (he of Clinton stratergizing) came out in defense of John McCain in saying that he was too honorable to have known about the ridiculous Obama kindergarten ad.
The ad - this season's version of the 1988 Willie Horton ad - charges that Obama wants to teach kindergarten children sex education when in fact he sponsored legislation to teach children how to identify sexual predators. It is ludicrous in its interpretation of the facts in an obvious attempt to scare people into thinking Obama is a superfreak Liberal.
But, to stay on point, what the feazy is Carville talking about?
First, if you put your name on something you might want to watch it and approve it before it goes out the door. At worst McCain believes the salacious attacks will get him elected; at best McCain has no control over his staff. Neither trait sounds like the kind we'd like in a President.
Second, the bill that was signed into law to force a candidate to take responsibility for ads aimed at another candidate was called the Bipartisan Campaign Reform Act - AKA the McCain-Feingold Act. I'm going to go out on a limb and say if you sponsored the bill then maybe, just maybe, you are fully aware of these rules.
Ignorance is not an excuse. Time to take some personal responsibility. McCain should know about these ads which is tantamount to agreement. The alternative is incompetence.
With the release of the new Terminator 4 trailer:
It occurred to me and a co-worker that Christian Bale should star in every sci fi role for the next several years. Some examples:
Dune - the perfect Paul Atreides. He's already got the skin suit look down.
Blade Runner (no remake scheduled) - We felt that Ed Norton would be the perfect Deckard and Bale should play Batty. We also agreed that we'd be incredibly geeked if Ed Norton ended up as the Riddler. Following that line of thought it became obvious that Bale and Norton should star together in every movie they do.
Superman - since Brandon Routh is out why not? Or maybe Bale would just be a good Bizarro or Cyclops? This discussion quickly deteriorated into how much we'd like to see a Doomsday/Superman movie.
OK, Tobey can stay on as Spider-man. And Robert Downey can be Iron Man.
And, at the very least, he should be a "red shirt" in Star Trek Zero.
How are you going to deal with that Religious Right?
Thanks to Gawker for finding this!
Why anyone would listen to what this insipid man has to say is beyond me - there is remotely nothing he discusses that is factual nor practical. Enjoy him making a fool out of himself acting the prima donna.
The great thing about music is that is can envoke very specific memories - what you were doing during a certain song, who broke your heart, etc. This one always makes me chuckle when the song comes on:
In high school we had a teacher Ms. Nelson who taught math. She was right out of college so we joked around with her a lot. So we knew her as Penny Nelson. Turns out she got engaged the 2nd or 3rd year of her teaching. Then we found out that she was marrying some guy with the last name Lane.
Guess what we whistled when we walked by her classroom the rest of the year?
Problem
You want to lock your computer when you get up from it. You don't like hot corners for whatever reason (you're a keyboard junkie, they are used for other tasks, you are used to Win-L on Windows).
Solution
Use Quicksilver to start the screen saver application with a keystroke.
Discussion
I live in a dual world and one nice thing about Windows is you can Win-L to lock your computer when you get up from it (See here why you might want to do this).
The Macintosh solution is to first change your security preferences to "require a password to wake the computer from sleep or screen saver" (same think with the Windows screen saver).
Many people like to then set a "hot corner" to start their screen saver (screen saver preferences, hot corner button). This means you have to drag your mouse into one of the four screen corners to start the screen saver. There are two reasons why I personally don't like this:
I love Quicksilver which is a launching program for Macintosh (and much more). I love my keyboard and I prefer not to use my mouse. So it makes sense for me to be able to launch the screen saver from the keyboard and Quicksilver should be able to help me do this.
I run Parallels in full screen mode and for some reason the hot corners tend to be less reliable when Parallels is running.
To do this you first need Quicksilver - a quick download and easy setup will have you up and running quickly. Quick tutorial - CTRL-SPACE will open the QS launcher then you start typing in the names of apps you want to launch or control. Certain apps - like iTunes - can be controlled through QS to fine detail. Play. Have fun.
Back to this screen saver issue....
By default QS will scan your Applications directory for ... well apps to launch. You can either have it scan all applications or you can create a custom link directly to the screen saver application. I chose the latter because the former added an additional 300+ applications to the QS catalog.
Here's how:
- Open QS preferences.
- Click the catalog button on the top bar.
- Click the Custom button on the left sidebar.
- Click the + sign on the lower status bar to add a new custom catalog entry - File and Folder Scanner type.
- Browse to /System/Library/Frameworks/ScreenSaver.framework/Resources/ScreenSaverEngine.app and open it.
That's it. Now I don't get all fancy with QS - I just CTRL-SPACE and type screen and this comes up for me. Easy-peasy.
OK, I've got to give Mercurial a try. In order to import the files from my local working copy (will try hg convert later) I needed to prune out my local copy.
Yes, you can use SVN export as well. But I wanted to try to delete all the files within a directory structure. Here's how to use "find" and "rm" together to remove specific directories in a directory structure:
find . -name '.svn' -type d -print0 | xargs -0 rm -rf
the "find" part of this argument will find all files in and under the current directory named ".svn" that are directories and print them out as a list. those results are piped to xargs to turn into an argument list for rm. the "r" option works through the tree recursively and the "f" option forces removal. This is necessary in order to remove folders that have files in them.
http://lolinator.com/lol/boowebb.com/
Other fun sites to LOL:
http://lolinator.com/lol/boowebb.com/hiking
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.
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.
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:
- remove all the files in your current working copy yet preserve the folder structure for SVN
- move all the new files into your working copy and commit those changes
- 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...but -delete is invoked with -depth implied so you will end up deleting required svn files if you runfind . -type d -name '.svn' -prune -o -type f -printfind . -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?
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
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.
This is amazing - who would have thought Microsoft would have allowed this backdoor....