Archive for June, 2008

Firefox 3.0 sopar mattan med motståndet

Monday, June 30th, 2008

IDG skriver att Firefox 3.0 sopar mattan med motståndet särskilt då med avseende på minnesutnyttjandet i Windows. Det är mycket möjligt, jag undviker att köra Windows så jag har ingen uppfattning i frågan.

Dock har jag kört Firefox 3.0 på OS X och där äter den minne utan motstycke. Det krävdes minst en omstart av Firefox per dag för att den skulle fungera acceptabelt. För inte så länge sedan bytte jag till Safari 3.1 och har inte tittat tillbaka sen dess.

How to copy production database data to the development database with Capistrano

Friday, June 27th, 2008

At times it is useful to easily be able to copy the content of the production database to the database running on your local development machine. In my case I use mysql on the production server and sqlite on my MacBook Pro. Unfortunately the use of different database servers makes this task a bit more tricky.

With a bit of googling I found a bit of code here and there which I combined and modified and turned into the following snippet of code to be dropped into your Capistrano deploy.rb file.

desc "Copy production database to development database" task :update_dev_db, :roles => :db do db = YAML::load(ERB.new(IO.read(File.join(File.dirname(FILE), 'database.yml'))).result)['production']

filename = "#{db['database']}_dump.#{Time.now.strftime '%Y%m%dT%:%H%M%S'}.sql" remote_path = "#{current_path}/tmp/#{filename}" local_path = "tmp/#{filename}"

on_rollback { run "rm #{remote_path}" }

run "mysqldump -u #{db['username']} --password=#{db['password']} --skip-opt #{db['database']} --complete-insert=true --skip-quote-names --no-create-info > #{remote_path}" do |ch, stream, data| puts data end

get remote_path, local_path

converted = File.read(local_path).gsub(/\'/, '\'\'') File.open("#{local_path}_converted", 'w') {|f| f.write(converted)}

system "sqlite3 db/dev.db < #{local_path}_converted" system "rm #{local_path}" system "rm #{local_path}_converted" run "rm #{remote_path}" end

There is a small problem with \n (new line) characters that on the production server get evaluated as they should. However, on the development machine after the data has been exported from mysql and imported into the sqlite database the \n characters will show as \n on the screen. But for me this is good enough for now.

Double quote escape

Wednesday, June 25th, 2008

If you ever need to have a ” (double quote) character in an attribute value in an XML document it’s good to know that it should be escaped with &#34; instead.

Read more about the escape mechanism.

Mora

Wednesday, June 25th, 2008

We spent the weekend in our cottage just outside of Mora in Dalarna. It was so nice to get away from everything and just take it easy for a few days. We did manage to squeeze in a day of climbing, though as we were both more or less hangover from the evening before we didn’t perform to good. I was close to doing a very fine 6c+ route but the incoming rain made my last attempt a bit stressed and I did one mistake too many at the end.

Next time I’ll do that route for sure!

Shoes

Wednesday, June 25th, 2008
Why did I put my shoes up there last night?

Dancing

Friday, June 20th, 2008
Traditional dancing at midsummer in Mora.

Midsummer

Friday, June 20th, 2008
Cosy feeling.

Lokfel

Wednesday, June 18th, 2008

Klockan är 16:55 och 16:41 tåget från Stockholm till Uppsala har ännu inte avgått. För ett par minuter sedan kom ett tåg som nu är överfullt med folk, både de som skulle ta 16:41 tåget och de som brukar ta 17:11 tåget men som var tidiga.

Tydligen står det egentliga tågsetet kvar någonstans med lokfel. Inte så konstigt då SJ använder gamla lok och vagnar från 80-talet på Uppsala-Stockholm sträckan.

One move is all it takes to make me happy!

Wednesday, June 18th, 2008

Yesterday me and Camilla went out climbing in the evening even though there had been the occasional rain shower during the day. In the evening the sky was all blue and the sun was shining, which was promising. But the local crag is in a dark and shadow place in the forest, which sucks, but does make it climbable during the really hot summer days.

It usually takes a while for the rock to dry but we were lucky and two routes were mostly dry, so we put up a top rope and started climbing.

During the warmup run the bottom crack felt easy but the upper 7a continuation felt impossibly hard. I couldn’t figure out how to get the 1.5 meters to the right where I needed to be and quite a few of the crucial holds were wet and slippery. It really felt like I had no chance whatsoever of doing this route any time soon.

After Camilla found some hidden crap foot placements the second run felt much better. I even managed to do the move to the right by inventing a sick sequence!

With my right hand on a good hold in the crack above my head and the left hand above the right on a sharp small sidepull I put my right foot 1.5 dm above my left foot on a semi-good hold. Then I cross in with the left foot quite up and far to the right on to a poor foot placement. I move the weight over to the left foot, control my balance, let the right foot swing over far to the right onto a good placement and reach up and grab a jug with my right hand.

If done properly it requires no effort whatsoever! Just a bit of precise balance control. That move made the whole evening worth it, even though it was wet, cold and miserable.

The upper part of the route is easier but compensates by being sharp and painful. With better conditions it shouldn’t be too hard though. So overall I went home with a positive feeling yesterday. It might not take that long to do that route after all.

Steve McClure does Rhapsody easily and Trotter did it again

Monday, June 16th, 2008
“Sonnie you little maggot, you should really try the route one more time, but this time, do it the way you always dreamed you would, placing those seven pieces of gear as you climb, from the bottom to the top, without error. Stop being a punter and git er done.” So I did. It took me two tries that day, but I linked Rhapsody again for the second time this week, placing all gear on lead and oddly enough, it felt easier. I didn’t wobble at the last move (the redpoint crux for sure) like last time. I felt solid dynoing for the sloper. It was the only way I would be entirely satisfied with myself. All of my hardest climbs I have placed gear on lead and this one was to be no exception, I needed complete closure.

You can read the rest of the entry, apparently written while waiting at Heathrow for the plane back to Canada, in Sonnie Trotter’s blog.

At UKClimbing we read that Steve McClure did Rhapsody during his second two day visit. That’s really impressive!