Honolulu Hacker’s Guide to Lite Weight Backpacking
By kenglish
Based on some backpacking experience over the years, I’ve come up with this list of ways to reduce the weight of your pack. Read and Learn.
- Toilet Paper: Anyone who has moved before knows one thing: Books are heavy. Guess what books are made of?…. PAPER! That’s right, the same thing that they use to make toilet paper. I suggest you lighten your toilet paper load. Next time you go to the bath room, make note of how much toilet paper you need. How many times do you wipe? If you average 3-4 wipes, can use only 2 squares per wipe and can estimate you will be going to the bathroom 2 times a day, do some math, figure out how much mountain money you will REALLY need. If you are a guy, congratulations, you can bring less TP. Don’t tell the girls this, they may ask you to carry their tent.
- Deodorant: Seriously? All or some of your backpacking buddies are gonna smell worse than the slums of Manila. Why are you going out our way to smell good? Leave this item at home.
- Camera: Skip it. Don’t worry, one of you buddies will bring a camera especially if you are with a big group. One of them may even carry a tripod, a monopod and so much other camera gear that he is going to need a hip replacement by the age of 35. Don’t be that guy. Plus, think about it: if you are taking all the picture, you won’t be in any of them. My wiser older brother once told me: a picture without a person is postcard. If you want pictures of the scenery, just go on flickr and do a search. Chance are pretty good someone else has been there. Make their image your wallpaper. When your co-workers comes, you can brag about what a great trip you had and how much cooler you are than them. Go ahead, gloat away. You’ve got the wallpaper to back it up.
- Tent: So, you hiked all the way out into the woods so you can sleep INDOORS. Forget that. I have seen someone make a very sustainable shelter out of a rain tarp. You just need to be creative. Cavemen didn’t always make it back to the cave and they didn’t have REI either. What did they do? If the going gets really rough, you can sneak into your buddy’s tent.
- Water: I don’t think I need to ask this but what human do you know that will deny another person water?… and you can always count on others to carry water.
This only some of the great ideas that will be present in my new book on backpacking. Please e-mail to preorder it.
Best Music of 2006: My picks
By kenglish
1) Flaming Lips: At War with the Mystics
For the second time this decade, the Lips have nailed it. While the first song (“Yeah, Yeah, Yeah“) annoys the hell out of me, the rest of the record is an honest-to-God masterpiece. “Vein of Stars” and “Pompeii AM Götterdämmerung” are my favorites with “Sound of Failure” and “My Cosmic Autumn Rebellion” not far behind. I don’t know what it is about these guys. It’s not like they are best musicians in the world and Wayne Coyne isn’t the best singer (seriously, sometimes he’s really out of key). It must be that they just write great songs and have mastered the studio process.
2) Built to Spill: You in Reverse
Music has given us a Neil Young and a J. Mascis but Doug Martch carries the torch when it comes to loud, garage-rocked guitar shredding. With no apologies, the album kicks off with the 8:42 guitar solo driven “Going Against Your Mind.” The best moment of the album comes later with “Conventional Wisdom” and it’s melodic guitar duals towards the end (although they were probably both played by Martsch). I wouldn’t want to take credit away from the rest of the band, they are certainly sound in top form and remain an indie-rock power house almost a decade later. At first listen this album disappointed me but it has really grown on me over the years. It contains some of the sound of their early work blended with a new energy and some different ideas.
3) Amy Winehouse: Back to Black
Those of you that know me, know that I don’t normally listen to this kind of music: Pop, R&B, Neo-soul, whatever you want to call it. But at the time I was reading a lot of dlisted.com as a guilty pleasure and Wino was featured everyday in some new humiliating picture or story. I guess any press is good press because I had to hear her music to find out what the big deal was. I’m not only attracted to the drama presented in her lyrics but I genuinely like the sound and structure of these songs. The title track and “You know that I’m no good” are my two favorite here. The record as a whole falls in place very nicely.
4) Sonic Youth : Rather Ripped
This is the album Sonic Youth should have made in 1995 coming off their Lollapollza headline spot instead of Washing Machines. In my opinsion, this is the most accessible set of songs they have ever put together. Gone are the ten minutes of feedback and in is some catchy indie rock that is “Reena“, “Incenerate” and Renaldo’s “Rats.” Even the quiet numbers, (“Do You Believe in Rapture?“, “Or“, “Turquoise Boy“) sound like something a person unfamiliar with their style would enjoy.
5) Ratatat : Classics
If you haven’t heard of these guy, go listen to “Wildcats.” This NYC duo creates music that is a fusion of metal sounds and dance beats with a signature fade-in guitar. I’d rate this as the instrumental album of the year. You won’t find any shredding solos here but you’ll find well arranged melodic compositions. It’s great background and foreground music.
6) Bob Dylan: Modern Times
I have said earlier that I don’t think this album is as great as most critics crack it up but I am a Dylan fan and I’d be lying if I said this album hasn’t spent some time in my rotation. His singing is still pretty raspy and irritating at times but His band sounds great and his lyrics are still poetic and profound. I’ll never understand why this album is called “Modern Times” when it sounds more like a shuffle, remincent of old American music. I like “Spirit On The Water” and “The Levee’s Gonna Break” best here. For the die-hard Dylan, be sure to read the wikipedia article about writing credit controversy
Has comedy changed as a result of the internet?
By kenglish
Let’s think about how comedy has changed since we’ve started consuming digital video on the internet. Prior to the Internet, comedy media was consumed primarily through movies and television. However, the internet has made comedy infinitely more accessible and thus we’ve been laughing a lot harder these days at a lot of different things.
To begin, what is Comedy? The following summarizes a popular book about comedy:
Comedy Writing Secrets by Mel Helitzer
Why We laugh?
The two main motivations:
- We laugh out of surprise.
- We laugh when we feel superior.
There are six additional motivations each which supports the first two.
- We laugh out of Instinct
- We laugh at incongruity
- We laugh out of ambivalence
- We laugh out of release
- We laugh when we solve a puzzle
- We laugh to regress.
Recipe for Humor:
The following six elements must be present for any humor to work:
- Target
- Hostility
- Realism
- Exaggeration
- Emotion
- Surprise
These elements have not changed much, what has changed is the content.
How do I consume great comedy vidoes?
- Tosh.O Blog
- Redit.tv (click Happy)
This is my internet Comedy Highlight real. Since I won’t have time to show all these videos in class, I hope that the other students will visit my blog and watch them on their own time.
Early history:
Star Wars Gangsta Rap: The most popular flash-video of all time
Lenny Bruce, Eddy Murphy, Richard Pryor were all considered vulgar for their time. Now, notice that vulgarity is almost expected in interactions on the internet.
Popular Targets: Technology and Technology Workers
There is a hostility towards traditional media. Even though we’re consuming more traditional media than ever, it’s easier to make fun of it now:
Charlie Brooker – How To Report The News
Auto-tune the news with Joe Biden singing
Mixing Media:
Star Trek and Monty Python.
Don’t Taze me and MC Hammer.
Kesha/cops parody uses many internet based images.
Target/ Hostility: Popular Movies
Twilight ‘New Moon’ in one minute.
How Star Wars should have ended.
Realism (Fail Videos) Top 100 Fail Clips of 2009:
Tons of Suprises:
Misheard Metal Lyrics.
Digital video can be used to parody how ridiculous Television video is. Does this render Television obsolete or
engage us more in it. For example, before watching the Rap Chop video, I knew very little about the slap chop. Now I always check it out in the “As seen on TV” store.
Slap Chop Video.
Rooftop Comedy introduces us to new comedians in short, easy to consume forms.
Comedy by Consensus? Pride of origination?
So, has comedy changed? Not much. Our tolerance for bad comedy has certainly gone. Nothing is is off limits these days and technology has given comedy infinite more possibilities to expand.
Best Music of 2007: My picks
By kenglish
1) The Shins : Wincing the Night Away
This album represents a change of direction for the James Mercer and his little outfit from Portland. At first I didn’t like it. There’s still a pair of traditional catchy indie-pop songs that caught my attention, (“Australia” and “Phantom Limb“) and great pop songs they are. The rest of the album felt uneven but after a few listens, it occurred to me this unevenness is really bold experimentation: “Sea Legs” a Pink Floyd-ish funk song with a great instrumental break at the end, “Split Needle” displays something darker and “Red Rabbits” and “The Comet Appears” the sweet but oddly textured acoustic numbers. All around great music.
2) Pinback : Autumn of the Seraphs
San Diego based Pinback is one my favorite bands of the past decade. Even when they aren’t writing good songs (see “Devil You Know” and “I’m A Pretty Lady”), they sound awesome. The first 6 songs of this album blend together like Sgt. Pepper. While this isn’t the classic that Summer in Abaddon was, it’s proof that Pinback will continue to make great music.
3) José González : In Our Nature
It’s hard to create a unique sound with just an accoustic guitar but this guy has done it. His playing and singing are so very distinct, almost mesmerizing. “How Low”, “Down the Line”, “Cycling Trivialities” and the cover version of Massive Attack’s “Teardrop” are the stand out tracks here.
4) French Kicks: Two Thousand
This New York band adds more focus to their new wavish, retro-80s sound. This album is significant progression from “Trial of the Century” mainly because the songwriting and arrangements are better. Only “Hey I Wait” disappoints, the rest of the album is full of some great indie-pop (“So Far We Are”, “No Mean Time”). My favorite song on the album is “Knee High” which builds from drums and a synth to a wall of the classic Kicks sound.
5) Spoon: Ga Ga Ga Ga Ga
IMHO, there’s a room for Spoon in everyone’s catalog. Their music has so many hooks it’s almost ridiculous. With this 2007 release, they seem to be repeating themselves adding horns here and there but why change a formula that works so well.
6) Blonde Redhead: 23
From the opening chords of the title track to the soft intro of “Silently” this records seems to blend together. My only complaint is that it would have been a perfect record if they would have left off the last two songs. “Top Ranking” sounds more like something from an earlier period of the band and “My Impure Hair” just plain drags. Other than that, BR is at top form: “Spring And By Summer Fall” rocks, “Herione” is absolutely lovely and the sound of “Dr. Strangeluv” could only come from this band.
7) Thurston Moore: Trees Outside the Academy
To most people a Thurston Moore solo album will just sound like a Sonic Youth album without Kim and Renaldo singing. To some extents this is true. The basic SY elements of dark, subculture music are here but the songs have more accoustic guitar than you will ever encounter on an SY cut. “Honest James” shines as the best track: a lovely guitar dual. Of course there’s a few token noise songs here to blow your eardrums out but the rest is solid from a solid veteran indie-rocker.
8.) Panda Bear: Trees Outside the Academy
A solo album from one of the Animal Colletive guys and like that group, this album tries to one up Pet Sounds but it does a damn good job. The reverby effects and repetiveness make this album seem almost like an orchestral achievement. The melodies are very catchy and I found myself humming them quite regularly. Play “Bro” or “Take Pills” regularly and you will see what I mean.
Force download of fasta files and aln files with Apache
By kenglish
If you are serving fasta files or alignment files on your server, you may want to force users to download them instead of previewing them in the browser. My application would return the fasta files as Content-Type text/plain. I wanted to force it to application/x-fasta and force download. This is accomplished rather easily in Apache with the following directive:
<FilesMatch "\.(?i:fasta)$"> ForceType application/x-fasta Header set Content-Disposition attachment </FilesMatch> <FilesMatch "\.(?i:aln)$"> ForceType application/x-aln Header set Content-Disposition attachment </FilesMatch>
You will have to enable the apache module “mod_header” for this to work.
Best Music of 2008: My picks
By kenglish
1) R.E.M. : Accelerate
The 3 remaining veteran musicians of R.E.M. returned to the sound of Life Rich Paegent and Document to breath life back into a band that was one of the fore-bearers of alternative music in the 80s and 90s. At only 34 minutes, this record is perfectly paced. The majority of the songs are loud, distortion, garage rockers. “Man-sized Wreath” and “Supernatural Superserious” have that pop feel that could only be R.E.M. The title track and “Sing for the Submarine” explored darker territory while “Houston” and “Until the Day Is Done” show that they are still masters of acoustic rock. The highlight of the album for me is “Mr. Richards”, a poetic, political critique of the Bush Administration decorated in a great melodies and metaphors. Like “Exhuming McCarthy”, “Disturbance at the Heron House” and “Fall on Me”, that song will still sound good in 10-15 years.
2) Air France: No Way Down
I discovered this album on accident. This group from Sweden combines ambient sounds, dance beats and symphonic arrangements with just enough vocals to keep it out the instrumental category. Another short record, this one is only 22 minutes, the songs blend into one another. The best song is “No Excuses.”
3) Bob Dylan: Tell Tale Signs
A co-worker told me that PBS was making available a streaming version of this Dylan album when it was released. I listened to it online for about 2 weeks and fell in love. I’m not one of those who thinks that Love and Theft and Modern Times are the awesome masterpieces that critics and other fans declare. However, this release is a great sample of his last 15 years of material. It makes you wonder how some of the version of these songs never ended up on albums. “Born in Time” in particular memorizes the ears here whereas the original version is awful. Other stand outs in clude “Tel Ol’ Bill“, “Someday Baby” & “Dreamin’ of You.”
4) Torche: Meanderthal
This music isn’t for everyone. It’s pretty heavy but it’s the perfect combination of melodic and hard for me. “Grenades” feels like it could be the anthem of a new generation, “Sundown” a Jawboxish slow epic and the short instrumentals (“Triumph of Venus”, “Little Champion”) like every song on the album let the band showcase their technical chops. Only the last 3 songs are longer than 3:30 minutes. Watch out for the long octave solo in “Fat Waves.”
5) Cervantes: Making Friends and Enemies
Perhaps this decade’s most underrated act in San Francisco, Cervantes (formerly Dumbwaiter) has undergone a number of personnel changes over the years but the core members and songwriters remain to help the band reinvigorate and reinvent themselves each time. This album represent the pinnacle of their effort. The guitar work, the angst-driven vocals, the creative song structures and the hat-tips to their influences forge this record. This is one album that should be in your collection.
Using Ruby & Hpricot to find lowest mortgage rate in Hawaii
By kenglish
Each week the Honolulu Board of Realtors publishes a report of Hawaii Mortgage Rates. To find the lowest rate for your category is difficult. A non-programming solution would be to copy it into excel, delete all the rows that you need and then sort by the rate column. This takes too much time so I wrote a ruby script that parses this data. This is also a demonstration of how to use the ruby tool Hpricot, an HTML Parser. You will need to install the Hpricot gem for this to work
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | require 'rubygems' require 'hpricot' require 'open-uri' #term = '1-YR ARM' #term = '30-YR Fixed' term = '15-YR Fixed' doc = Hpricot.parse(open("http://www.hicentral.com/MortgageRates.asp")) rates = [] lender_name = "" (doc/"table"/"table"/"tr").each do | row | arr =[] (row/"td").each do | cell| arr << cell.inner_html() end if arr[1] =~ /15-YR Fixed/ lender_name = arr[0] arr.delete(lender_name) lender_name.sub!('<br />',' - ') end next unless arr[0] =~ /#{term}/ lender_data ={} lender_data[:lender_name] = lender_name lender_data[:term] = arr[0] lender_data[:apr] = arr[3].to_f rates << lender_data end 5.times do | rank | puts "Losest Rate ##{rank+1}" row = rates.min{|a,b| a[:apr] <=> b[:apr] } puts " Name: #{row[:lender_name]}" puts " Term: #{row[:term]}" puts " APR: #{row[:apr]}" rates.delete(row) end |
Here’s what’s going on:
- On line 7 you will notice that I am interested in the 15-Year mortgage rate. You can change this value to get the report for the term you want.
- On line 9, the program will download the latest rates from the hicentral.com website and parse the page returning an hpricot doc object.
- From line 14 to 30, the program parses each line in the mortgage rate table. The logic is custom to this table. The table is unusual because the lender name is first cell only on the first line (15-YR Fixed) for each lender. To accommodate this, we match the line that has “15-YR Fixed” in second position and delete the lender name from the array (lines 19-23). We then assign the data to our summary data structure (lines 25-29)
- Finally, we show the top 5 lowest mortgage rates (lines 32-38). To do this we use the Ruby max method (line 34). We delete the current max element so it is not counted in the next loop iteration (line 38).
Thomas Lecklider has a great tutorial on how to use Hpricot called Using Hpricot to Traverse and Parse HTML.
Your commends are welcome. Give some refactoring advice if you like. I have wordpress plugin for pre tag so to write ruby code just do:
<pre lang="ruby">
puts YEAH
</pre>
Best Music of 2009: My picks
By kenglish
1) Neko Case: Middle Cyclone
Fox Confessor Brings the Flood seemed a little off and it didn’t warm up to me the way Blacklisted, and Furnace Room Lullaby did but this record was on rotation in my music player for countless weeks. Radio friendly tracks like “This Tornado Loves You”, “People Got A Lotta Nerve” and “Red Tide” have a sleek, polished feel that could some day make them Alt-Country classics but the real gems here are the acoustic, non-traditional songs like “Polar Nettles”, “Fever”, “Vengenance is Sleeping” and the title track. These numbers weave in lovely harmonies, melodies and lyrics that are nothing more than memorizing.
2) Islands: Vapours
This album actually surprised me. Islands, a montreal based band, followed their remarkable 2005 debut Return to the Sea with a disappointing, overproduced and swollen album Arm’s Way. Vapours doesn’t revert to the sound of Return to the Sea. It’s more like a new beginning. It pulls the best sounds from the 80s and lays them on top of some very cleverly crafted indie-synth-pop tunes. This is fun music and each time I listen to this record I marvel at how well these songs are arranged. “Tender Torture”, “Devout” and “Switched On” are my favorites.
3) U2: No Line on the Horizon
I was talking to a guy at a campout this summer who described U2 as the “Beatles of our generation.” This pisses music critics off. When at the beginning of Rattle & Hum Bona said, “This song Charles Mason stole from the Beatles and now we’re stealing it back” wasn’t he implying that U2 was good enough or better than the Beatles and thus claiming their spot as the top rock act of all time? Oh, the nerve. As clique as it sounds, U2 does know how to reinvent itself very well and on this record they did it again while maintaining their core unique elements: Edges infinite guitar notes, Larry Mullen Jr’s creative rock drumming and Bono’s soulful, rock vocals. Great songs: “Breathe”, “Magnificent”, “Fez”
4) Morrissey : Years of Refusal
It’s not that obsessed with my 7th grade heroes, it’s just that they are still putting out great music. Morrissey returns from the melodrama of Ringleader of the Tormentor with an album that has much heavier, rock influences. His new band is tight, full of punk/pop hooks, raw and energetic. Of course, the lyrics are great too. Only one voice can successfully belt out lines like “It’s not your birthday anymore, did you really think we meant all of those syrupy, sentimental things that we said yesterday”.
5) George Jones Musicor Recordings Box Sets (1965-1971)
While this isn’t “new” music, these two box sets were released this year and are must haves for any fan of old country. They are appropriately titled Walk Through This World with Me and A Good Year for the Roses after two of his biggest hits of the era, possibly of his career. You’ll find plenty of saloon jumping honky tonks and soothing “lost my wife” ballads (literally, one is called “When The Wife Runs Off”). All of these are decorated with beautiful piano parts, thick female background harmonies, whiny slide guitars and one of the greatest voices in country music. Due to pressure from his manager and a changing country scene, this was a very productive period for George. The sheer size of these 2 box sets is a tribute to that:
10 Discs, 320 songs and 12 hours and 38 minutes of music. Not every song is a gem but that’s why there’s a next button on your mp3 player. However, there are songs here that you can’t miss: “Love Bug”, “I Cried Myself Awake”, “No Blues is Good News”, and one my all time favorites, “You’re Still On My Mind.” Country gets a bad rap from a lot of folks these days but this box set is simple, American music at its finest.
A SQL Server file ‘basename’ function
By kenglish
Given a file path: /var/www/html/index.html
Returns: index.html
Pretty common, here’s how you do it:
Perl:
use File::Basename; $fullname = "/usr/local/src/perl-5.6.1.tar.gz"; $file = basename($fullname);
PHP:
$path = "/home/httpd/html/index.php"; $file = basename($path);
Ruby:
path = "/usr/lib/ruby/site_ruby/1.8/rubygems/version.rb" File.basename path
Python:
import os.path path = "/usr/local/bin/python" os.path.basename(path)
T-SQL (MsSQL Server):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | CREATE FUNCTION [dbo].[fn_file_basename] ( -- Add the parameters for the function here @file_path Varchar(255) ) RETURNS Varchar(255) AS BEGIN declare @file_basename varchar(255) IF charindex('\', @file_path) != 0 set @file_basename= reverse(substring(reverse(@file_path), 1, charindex('\', reverse(@file_path))-1)) else set @file_basename=@file_path return @file_basename END |
My brilliant co-worker figured this out. The magic is done on line 11:
reverse(substring(reverse(@file_path), 1, charindex('\', reverse(@file_path))-1))
It reverses the string, find the first occurance of the character ‘\’, takes the substring to that character and the reverses again. How elegant!
Remove Invalid XML Characters with an SSIS Visual Basic Script
By kenglish
My boss is forcing us to use Microsoft SQL Service Intergration Services for our ETL process. I Googled around for a bit and could not find a good example of how to do this simple task: open an XML file, read the text, replace any invalid characters and write it back out to the same file. My VB is very rusty but this works pretty well. The ReadVariable portion is specific to SSIS but the rest should be generic. Hopefully, the next poor who needs to do this will be able to find this blog entry!
Imports System Imports System.Data Imports System.Math Imports Microsoft.SqlServer.Dts.Runtime Imports System.Text.RegularExpressions Imports System.Object Public Class ScriptMain Public Sub Main() Dts.TaskResult = Dts.Results.Success Dim strPath, strXML As String strPath = CStr(ReadVariable("User::strFileName")) strXML = FileIO.FileSystem.ReadAllText(strPath) Dim rgx As Regex = New Regex("[\x00-\x08\x0B-\x0C\x0E-\x1F]", RegexOptions.None) rgx.Replace(strXML, " ") FileIO.FileSystem.WriteAllText(strPath, strXML, False) End Sub Private Function ReadVariable(ByVal varName As String) As Object Dim result As Object Try Dim vars As Variables Dts.VariableDispenser.LockForRead(varName) Dts.VariableDispenser.GetVariables(vars) Try result = vars(varName).Value Catch ex As Exception Throw ex Finally vars.Unlock() End Try Catch ex As Exception Throw ex End Try Return result End Function End Class



June 24th, 2010