Pedro Assunção

Archive for the ‘findings’ Category

Red Hot Chili Peppers lyrics generator

Here’s a little something i tried yesterday: a ruby script that mixes and matches verbs, nouns, adjectives, and colors to come up with crazy ass lyrics, red hot style. Enjoy $nouns = IO.readlines(‘names.txt’) $adjectives = IO.readlines(‘adjectives.txt’) $verbs = IO.readlines(‘verbs.txt’) $adjectives << ['red','blue','green','white','black','yellow','brown','gray'] $pronouns = IO.readlines(‘pronouns.txt’) $adverbs = IO.readlines(‘adverbs.txt’) $prepositions = IO.readlines(‘prepositions.txt’) def get_rand(collection) sleep rand [...]

Arm broken equals free time

I have broken an arm. This is the 1st time in my life that I have broken any bones in my body. And it sucks! But, rather than being all pessimistic about it, I prefer to see the positive side. See, you get a lot of free time to do things that you probably have [...]

Export Mysql result as CSV

Don’t ask me how the sed magic works, but it does. Taken from here. Running this: mysql -u<USER> -p<PASSWORD> <DATABASE> -B -e “select * from videos_video;” | sed ‘s/\t/”,”/g;s/^/”/;s/$/”/;s/\n//g’ will produce something like this: “id”,”title”,”url” “1″,”video 1″,”http://youtube(…)” “2″,”video 2″,”http://youtube(…)” “3″,”video 3″,”http://youtube(…)” Just pipe it to a .csv file and you’re done

Nice tweaks for OSX

I think most of them work on both Snow Leopard and Lion. Not sure about previous versions. Just type the ones you want to activate/deactivate on the command line and have fun. # Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs) defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 # Enable the [...]

Browser and visitor statistics

Was just now looking at google analytics for my blog and got some surprises, especially when it comes to the browser people use to access it. Seems that Chrome is leading and Internet Explorer is dead. Long live Internet Explorer Also, very interesting is the fact that i’m Portuguese and Portugal is not on the [...]

200 skydives and a long way to go

This Saturday – while coming back from the dropzone – i noticed that my last jump of the day had been my 200th. After realizing it, i started thinking about what it means and came to the conclusion that it means nothing. Think about it: that’s only about 3 hours of training (each skydive is [...]

OSX: Change time machine auto backup interval

The default time machine backup interval is every hour. Sometimes this can be really annoying so, if you find yourself in need to change this, here’s how: Navigate to /System/Library/LaunchDaemons and locate the file named com.apple.backupd-auto.plist. Inside this file you will find the following content: <key>StartInterval</key> <integer>3600</integer> 3600 means hourly (60 minutes X 60 seconds). [...]

NonUniqueObjectException: a different object with the same identifier value was already associated with the session

If you are developing in Swing and using hibernate you might – at some point in time – run into this exception: org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session What happened, you might ask? Well, turns out that when you close the session that created a given [...]

Is Bin Laden dead? I’ll believe it when i see it.

Are you kidding me? His body buried in the sea? This is the most wanted person in the history of the world and they don’t bring back the body to prove – without a shadow of a doubt – that he is truly dead? Give me a break. I’ll believe he is gone when i [...]

Pooping: you’re doing it wrong

Ever found yourself sitting  in the toilet and, when it’s that time to do some pushing, instinctively getting on your toes to help the process? Well, it turns out that there is a reason for that: Humans have an easier time pooping in a crouching position. So when you get on your toes you are [...]

The guy that took one picture of himself for 6 years

Remember Noah Kalina, the guy who took a picture of his face for 6 and a half years? Well, he still continues to do it. I’m guessing he wants to have a complete record of what he looked like through all his life. In his website you can see all the photos, by year. It’s [...]

Mitochondria regeneration method found. Wanna live forever?

Scientists have found a compound that creates new Mitochondria structures inside aging cells. This can lead to the reversal of cellular aging, the main reason why you die As we age, our tissues’ mitochondria start to get damaged (you can think of it as the tail of a long chord, that gets ripped progressively as [...]

Using Dropbox to automatically download torrents

Need to be able to remotely add torrents to your secure machine at home? Don’t want to expose any ports to the world in order to accomplish that? Solution: Use Dropbox and uTorrent. How? Setup uTorrent to automatically download any torrent files found in your Dropbox folder (like the picture says). After that, any torrent [...]

Google Circles… Lycos tried that in 2004.

There’s a lot of hype around the potentially upcoming Google Circles, the fancy new social networking website by the search giant. But – as it turns out – Lycos tried exactly the same back in 2004. Judging by the number of people who know this, they failed. From their press release at the time: “Lycos [...]

Guru meditation error

While reading my morning web comics, i noticed this error in wulffmorgenthaler: Guru meditation error. Apparently this is the default way the Varnish HTTP cache shows errors and – as it turns out – it comes from the old Commodore Amiga times. It’s always refreshing to find more developers with a sense of humor

Why you should sleep at least 7 hours per night

I’ve always been an apologist of sleeping at least 8 hours per night/day and – except for my brief experiments with other types of sleep cycles – i have always tried to do so myself. I am one of those people that feels better when i manage to sleep around 8-9 hours per night, otherwise [...]

OSX video streaming the easy way

The problem For a while now, i have been searching for a way to stream videos from my living room’s Mac Mini to my other Macs across the house. Especially to my laptop (or in the future to my tablet) when i’m laying in bed. Yes, i know i’m lazy, but one has to take [...]

OSX Lion headphones sound bug

If you’re trying the new developer preview version of OSX (10.7 – Lion) and find that the default sound output (headphones) is misbehaving, there is a quick fix for it. According to OSX developers, if you go into the Audio MIDI Setup (under /Applications/Utilities) and change the output format from 2ch-16bit to 2ch-32bit (like in [...]