Pedro Assunção

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 :D


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 i already know that Saturday morning is going to be “wasted” sleeping :)

Now it turns out i was probably right: Some new studies have shown that 95% of people require at least 7 hours per night to function properly (i mean in an optimal way). From the remaining 5%, 2.5 require more than 7 hours. This means that only 2.5% of all people have an optimal sleep time of 7 hours or less.

So, i’m going to bed now :)


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 advantage of technology, right? :)

The problem is that i never found a nice enough way to do it. I tried streaming through VLC, but unfortunately the wireless network seems not to be enough to cope with the amount of data. Also, it’s a bit cumbersome to have to setup the stream every time i want to watch a movie in bed. I looked into whether XBMC or Plex would do the trick and, although there are some built in server capabilities, i was never able to make it work for my needs.

The solution

Enter StreamToMe and ServeToMe. Both applications are available in the Mac Appstore (they also have iPhone, iPod, and iPad apps) and allow seamless video streaming across Macs. Painless. You define the folders you want to share in the server and the client gets to browse them, complete with video thumbnails. Extremely cool and practical, especially because they convert the videos on the fly so it plays smoothly even across 3G networks :D

From their website:

“Files are live-transcoded into the native format for your device so you don’t need to pre-convert your media. Adaptive bitrates mean that you can stream over WiFi or 3G.”

Now if i could just get an android version :)


How to lose half your page visits in 1 month (and how to recover from it)

A while back i changed my blog domain name from diffract.me to pedroassuncao.com. However, i was dumb enough not to redirect the traffic to the new name – in a transition period. The result? A drop from 100+ visits per day to less than 20.

I have to admit that it kind of bummed me out a little. Being a Buddhist-light i tried my best not to let it get to me and told myself that it would eventually recover just as long as i kept writing stuff that can help some people – combined with nicely chosen post titles and search engine keywords.

Turns out i was right: a couple of months later the visits are slowly recovering – as you can see from the screenshot of my analytics account.

That is all very neat but where is the “helping people” part, you might ask. Here it is: I thought i might share some of the techniques i currently employ to attract people to look at what i write. They are no different from what others have blogged about before, but it’s always good to share this information around with prospective new bloggers:

  • Write about stuff that you think will help other people. This may mean writing about solutions to problems you yourself encountered, or just writing about interesting stuff you did/saw/ate/whatever that other humans will possibly find interesting :)
  • Read a lot of news/blogs/stories about stuff that you have interest in. And *write insightful* comments on them. Most comments systems will allow you to enter your URL and/or twitter name and will show those in the comments you write. This is a great way to drive the curious people back to your site;
  • For every helpful post you write, submit the link to the major news sites (think digg, reddit, hacker news, etc). This will make sure that search engines will have more interest in your site, since you will be linked back when they crawl those. It will also make some more people aware of what you are writing, which leads me to the following point…
  • Write catchy post titles. And by catchy i don’t mean cheesy or sensationalist. Create a habit of getting to the point in your titles while – at the same time – being original to entice curiosity. Writing titles is a form of art in itself, believe me;
  • Link whenever you are referencing something that can be linked to. Again, search engines will use this information to your advantage in page rankings. And other bloggers will appreciate the traffic, so it’s a win-win situation :)

That’s it. Happy blogging, and feel free to drop me a line ;)


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 the image), that should take care of the problem.

Peace.


Eclipse IDE introduces … wait for it … a market place!

Application markets and stores are all the rage these days. Let’s see, there’s the apple store, the android market, Microsoft’s app store, Nokia’s OVI store, and probably a gazillion more. It’s like if you don’t have one, you don’t really exist.

Well, now the eclipse IDE has got one as well. You can get plugins and the likes there, in which seems to be an easier way to find components to install. Gone are the times when you had to copy and paste endless amounts of update sites to install your favorite plugins. Or so i hope :)


Apple will remove java from OSX with Lion, so what?

I don’t get all the fuss about Apple no longer shipping java with OSX. Windows never did. Linux does not. So what?

Actually, with Lion, they will make it extremely easy to install anyways. According to early reports about the developer preview release, when a user tries to run a java application (or install one), the operating system will look online for the latest runtime virtual machine and prompt the user to install it. IT’S EVEN EASIER THAN ON WINDOWS, PEOPLE! :D

You can get more info in this article.


Stuff from movies: Transparent multi touch screen

Now this is what i call the future coming to us: Stuff previously only seen in movies coming to the real world. LG has demo’ed a transparent multi touch display. Can i have one? :)


Full list of Coca Cola brands – had no idea there were so many

As a part of my Ruby learning process, i decided to write something to retrieve the full list of brands that Coca Cola currently owns from their website. The list is split across multiple pages, but with some Ruby magic and a nice library called Hpricot to traverse the HTML it was 5 minutes of work :)

Here’s the script:

require 'open-uri'
require 'rubygems'
require 'hpricot'
require 'pp'

my_file = File.new("cola.txt", 'w')

('a'..'z').each do |letter|
open("http://www.thecoca-colacompany.com/brands/product_list_#{letter}.html") do |f|

    # meta info
    #pp f.meta

    #pp 'Content-Type: ' + f.content_type
    #pp 'Last modified: ' + f.last_modified.to_s

    doc = Hpricot.XML(f)
    div = doc/"#products_link_list"
    (div/:ul).each do |ul|
      (ul/:li).each do |li|
        if (li/:a).first
          my_file.puts((li/:a).first.inner_html)
        else
          my_file.puts li.inner_html.to_s
        end
      end
    end

  end
end

And here’s the full list of brands that belong to Coca Cola:

A&W
Acueducto
Ades
Agua Manantial
Ali
Alive
Alpina
Ambasa
Ameyal
Amorino
Andina/Andina light
Andina Fortified
Andina Fresh
Andina Frut
Andina Nectar
Apollinaris
Aqua+
Aquabona
Aquactivede by Aquarius
Aquana
Aquarius
Aquarius Active Diet
BACARDI Mixers*
BACARDI Premium Mixers*
Bajoru Gira
Bankia
Barq’s
Barrelitos
BEAT
Beautia
Bebere
Benedictino
Beverly
Bevi
Bibo
Big Crush
Big Tai
Bimbo
Bimbo Break
Biotime
Bird’s Nest*
Bistra
Bistrone
Bjare
Blackfire
Boco
Bogadera
Bom Bit Maesil
BonAqua/BonAqa
Borneo
Botaniq 1QQ
Botany
BPM
Brazzi
Bright & Early
Brisa Agua Pura
Brisa by Bonaqua
Brisa con un Toque de Gas
Brisa Spa
Bu
Bubbly
burn
buzz
CAFÉ ZU
caffeine-free Barq’s
caffeine-free Coca-Cola
caffeine-free Diet Coke/caffeine-free Coca-Cola light
Calypso
Canada Dry
Canning’s
Cappy
Caprice
Caribou Coffee*
Carioca
Cascal
Carver’s
Cepita
Chaqwa
Charrua
Chaudfontaine
Cheers
cherry Coke
cherry Coke zero
Chinotto
Chinotto light
Ciel
CITRA
Club
Coca-Cola
Coca-Cola Black Cherry Vanilla
Coca-Cola Blāk
Coca-Cola C2
Coca-Cola Citra
Coca-Cola light/Diet Coke
Coca-Cola with Lemon
Coca-Cola with Lime
Coca-Cola with Raspberry
Coca-Cola Zero
Cocoteen
Cola Guaraná Jesus
Country Club
Cresta
Cristal
Crush
Crusta
Crystal
Damla Minera
DANNON*
DASANI
DASANI Active
DASANI Balance
DASANI Flavors
DASANI Nutriwater
DASANI Plus
Del Valle
Del Valle Frut
Del Valle Frutsi
Del Valle Frutsi Desarrollo
Del Valle Kapo
Del Valle Mais light
Del Valle light
Delaware Punch
diet A&W
diet Andina Frut/Andina Frut light
diet Andina Nectar/Andina Nectar light
diet Barq’s
diet Canada Dry
Diet cherry Coke
Diet Coke/Coca-Cola light
Diet Coke Black Cherry Vanilla
Diet Coke Citra/Coca-Cola light Citra
Diet Coke Plus
Diet Coke Sweetened with Splenda®
Diet Coke with Lemon/Coca-Cola light with Lemon
Diet Coke with Lime/Coca-Cola light with Lime
Diet Coke with Raspberry
Diet Crush
diet Dr Pepper/Dr Pepper Zero
diet Fanta/Fanta light/Fanta Zero/Fanta Free
diet Freskyta
diet INCA KOLA
diet Kia Ora
diet Krest
diet Lift/Lift light
diet Lilt/Lilt Zero
diet Master Pour
diet Mello Yello
diet Mezzo Mix
diet Minute Maid Soft Drink
diet Nestea/Nestea light*
diet Northern Neck
diet Oasis
diet Quatro/Quatro light
diet Schweppes
diet Seagram’s*
diet Sprite/Sprite light/diet Sprite Zero/Sprite Zero
diet Squirt
diet Tai/Tai light
diet Vanilla Coke
Disney Xtreme Cooler*
Diva
Dobriy
Dogadan
Dorna
Dr Pepper
E2
Earth and Sky
Eight O’Clock
El Rayek
Enviga*
Epika
Escuis
Eva Water
Fanta
Fanta Verdia
Far Coast
Felicia
Finley
Fioravanti
Fire
Five Alive
Flavor Rage
Fontana
Fresca
Fresca 1
Frescolita
Freskyta
Fresquinha
Fress
Frestea*
Friolin
Frisco
Frugos
Frugos Fresh
Fruit Solutions
Fruitia
Fruitier
Fruitopia
Fruktime
Frutina
Frutonic
Full Throttle
Full Throttle Blue Demon
Full Throttle Sugar Free
Funchum Orange Drink
Furusato Dayori
FUZE Healthy Infusions
GEORGIA
GEORGIA Club
GEORGIA Gold
GEORGIA Grande
Gini
Girios Gira
glacéau smartwater
glacéau vitaminwater
glacéau vitaminwater zero
Gladiator
Godiva* Belgian Blends
Gold Peak
Gold Spot
Golden Crush
Goombay Punch
Goulburn Valley
Grapette
Groovy
Guaraná Kuat light
Guaraná Kuat Zero
Hajime
Haru No Mint Shukan
Hawai
Healthworks
Heppinger
Hero
Hi Spot
Hi-C
Hires
Hit
Horizon
Hot Point
Huang
Ice Dew
Ice Dew 3+
Ice Tea Leao
illy issimo*
INCA KOLA
Ipsei
Izvorul Alb
Jaz Cola
Jericho
Jet Tonic
Jolly Juice
Joy
Joya
Juan Valdez
Juices To Go
Just Juice
Kani
Kapo
Kapo Zero
Karada Meguri-Cha
Kashaya Tea
Keloco
Keri
Kia Ora
Kildevaeld
Kilimanjaro
Kin
Kinley
Kist
Kiwi Blue
Kochakaden
Kola Inglesa
Koumisoukai
Krest
Kristal
Kropla Beskidu
Krushka & Bochka
Kuat
Kuat Guaraná
Kuat light
Kuli
Kyun
La Jolla
La Vuelta
Lanitis
Lanitis Extra
Lanitis Filaraki
Leao Green Tea
Leao Guaraná Power
Leao Iced Tea
Less Is More, Kinley
Lift
Lift Plus
Lift Plus light
Lilia
Lilt
Limca
Limelite
Limonade
Linnuse
Lion
Love Body
Maaza
Mad River
Malvern
Manantial
Mare Rosso
Marocha
Master Chill
Master Pour
Matte Leao
Matusov Pramen
Mazoe
Mello
Mello Yello
Mer
Mezzo
Mezzo Mix
Miami
Mickey*
Migoro-Nomigoro
Minaqua
Mineragua
Minute Maid
Minute Maid Active
Minute Maid Antiox
Minute Maid Deli
Minute Maid Duofrutas
Minute Maid Fruit Plus
Minute Maid Heart Wise
Minute Maid Just 10
Minute Maid Light
Minute Maid Mais
Minute Maid Nutri+
Minute Maid Premium
Minute Maid Soft Drink
Minute Maid Splash
Mireille
Mission
Mone
Montefiore
Mori No Mizudayori
Morning Deli
Mother
Mr. Pibb
multiVita
Nada
Nagomi
Nalu
Namthip
Nanairo Acha
Naturaqua
Natures Own*
Nectarin
Nestea*
Nestea Choglit*
Nestea COOL*
Nestea Viteao*
Nevada
Neverfail
Next
Nico
Nordic Mist
Northern Neck
NOS
Nos Entendemos
Oasis
Odwalla
Olimpija
Orchy
Paani Treated Water
Pacific Orchard
Pampa
Paradise Sun
Parle
Pasazade
Pearona
Peats Ridge Springs
Pibb Xtra
Pibb Zero
Piko
Pilskania
Planet Java*
Play Energy Drink
Pocket Dr
Poiana Negri
Polar Brew
Poms
Ponkana
Pop
Portello
POWERADE
POWERADE Advance
POWERADE alive
POWERADE aqua+
POWERADE Balance
POWERADE light
POWERADE OPTION
POWERADE Zero
Powerplay
Premio
Presta
Presta light
Pulp Orange
Pulpy
Pump
Pumped Enhanced Hydration
Pura Sol
Qoo
Quatro
Quwat Jabal
R’fresh
Ramlosa
Real
Real Leaf
Real Gold
Rehab
Relentless
Rich
Richy
Riwa
Roemerquelle
Rosa
Rosalta
Roses
Royal Tru
Royal Tru light
Safety First
Safia
Sahtain
Samantha
Samurai
San Luis
Sarsi
Saryusaisai
Schuss
Schweppes
Schweppes Abbey Well
Seagram’s*
Seltz
Sensation
Sensun Gazoz
SENZAO
Shandy
Shangri-La
ShiZen*
Shock
Signature
Sim
Simba
Simply Apple
Simply Grapefruit
Simply Lemonade
Simply Limeade
Simply Orange
Smart
Sobo
Sokenbicha
Solo
Sonfil
Soonsoo 100
Southern Sun
Sparkle
Sparletta
Sparletta Iron Brew
Splash
Splice
Sport
Sprite
Sprite 3G
Sprite Duo
Sprite Flavors
Sprite Ice
Sprite Remix
Sprite Zero/diet Sprite/Sprite light /diet Sprite Zero
Spur
Squirt
Stoney Gold Ginger Beer
Sucos Mais
Sunfill
SURGE
Svali
Sveva
Sweecha
TaB
TaB energy
TaB X-Tra
TADAS
Tai
The Spirit of Georgia
The Wellness From Coca-Cola
Thextons
Thums Up
Tian Yu Di/Heaven and Earth
Tiky
Toppur
Top’s
Tropi
Tropical
Turkuaz
Ultra
Urge
Urun
V Florida 7
Valle Frut
Valpre
Valser
Valser Viva
Vanilla Coke
Vanilla Coke Zero
VAULT
VAULT Zero
Vegitabeta
VICA
Vio
Vita
Vital
Wilkins
Wink
Winnie the Pooh*
Yangguang
Yangguang Juicy T
Yo Conozco a Hugo
Yoli
Youki
Yuan Ye


Dropbox plus Mercurial -driven development. Anyone tried that?

One of the biggest pains of any developer is maintaing the source code. Especially if you – like me – have a gazillion pet projects that need to be updated whenever you come up with “cool idea #20000″ for one of them.

Version control systems like Mercurial are awesome, but they are only part of the equation; there’s still the time consuming process of deploying the changes to “production”. So i wonder if it would be a good idea to have a Mercurial repository sitting on a dropbox account and develop directly there. This way any changes to the source code would be instantly reflected on production.

I am aware that this is unthinkable for serious projects (the kind you get paid to do), but it can probably work for fun pet projects.

Do you have any experience with something like that? Share your thoughts, if you have any :)


Random notes on India

Some random notes i scribbled down in my little paper notepad, on my trip from Bangalore to Goa, this weekend:

  • Saw 10 people inside a car that could normally only hold 5;
  • Took me 2 hours to drive 17Km inside Bangalore;
  • Saw a movie theater that was only showing Indian movies;
  • Products usually have a date of manufacture, as opposed to expiry date;
  • You don’t see many foreigners on the streets (i was pretty much the only one everywhere i went);
  • There are drinking water trucks distributing on the streets;
  • From times to times there are cows roaming between the cars, especially on smaller roads;
  • Indians are very humble and seem not to get pissed off easily (if you see the traffic here, you’ll understand why stress cannot possibly affect them);
  • Highways are a place of gathering; There are people walking, you can go in reverse, get into the opposite lanes;
  • People get into and out of buses while it’s still moving, usually taking the times when it’s turning or slowing down for other cars to pass;
  • Our bus – at some point during the night – had to reverse in the highway, because the driver overshot the place where we were supposed to stop for a break;
  • At some point there was this really thick fog (you could not see 5 meters in front of the bus), but the driver still kept going at the same (insane) speed :)
  • The second stop was in some remote place that had nothing but a road and a farm. Peaceful;
  • Food at the hotel in Goa (Marigold – Panaji) is around 3 Euro per meal; Some dishes are even cheaper (around 1.5 Euro);
  • One single bed room there was around 2000 Rupees for 1 night (40 euro);
  • On the way there, more hardware stores could be seen than places with food;
  • In Goa is also rare to find foreigners on the streets;
  • From Panaji to Calangute (beaches) is about 30 minutes by scooter;
  • Aguada fort is great :)
  • Cricket is the national sport; You can find a lot of people watching the games on TV shops’ stands;
  • Domino’s pizza in Goa: found a pizza that is not spicy;
  • Correction, after pouring the so-called Oregano condiments, it is a bit spicy. Turns out the “Oregano” also contained white and black pepper;
  • A lot of the tourism is internal. Which makes sense, considering the size of the country;
  • 60 cl of Cola = 30 rupees = 60 euro cents; 1 cent = 1 cl :)
  • It’s very funny that there is a guard at the church door, keeping people from entering the “house of the lord” after the service has started.

Observations on vehicle traffic in India

Cow in Bangalore

I’ll keep this one short. I am currently visiting Bangalore – in the context of a business trip – and these are my observations/thoughts about the traffic in the streets here :)

  • Most trucks don’t have tail lights. I mean, who needs to see trucks in the highway anyways? :)
  • There are trucks parked in the highway. On a lane. Not kidding!
  • There are cars going in reverse in the middle of the road (also saw it once in a highway)
  • Some people bike their way *against* the traffic flow (on the highway as well)!
  • Lane marks are basically useless. If you have 3 lanes, you will probably have 5 cars side by side :)
  • Using the horn is a form of communication. Seems to be analogous to the Sonar systems in the submarines. During the night lights are also used intensively for this purpose :)
  • Roads have close to no illumination, which makes it much easier to run people over. You know, the ones that are crossing the highway on foot.
  • Drivers will pass you wherever there is space open. Left, right, middle, doesn’t really matter. Use the sonar :)
  • There are signs saying “Please respect the traffic rules”, hehe :)
  • You can spot the occasional tractor in the highway.
  • Most people don’t speak a lot of English, but they all drive like Nigel Mansell or Damon Hill :)

Will operating systems become user interface agnostic?

After reading a post in PCPro.co.uk, about the dual core ARM phone that can run both Android and Ubuntu at the same time, i can’t help being excited about the possibilities that the near future holds for us, mobile-wise.

I’m pretty sure that – at some point in time – we will not need laptops or desktop computers anymore; we can just go around with our tablets and/or phones and – when we need more screen space to work – just plug it into an external setup (screen, mouse, keyboard) and hack away.

Which brings me to think that the next versions of mobile operating systems will become more and more full fledged operating systems as we traditionally think of them on the desktop. Sure, right now they are being tailored to suit touch screen interfaces (tablets, phones), but i think we might get to a point where they will have to become user interface agnostic, to allow this type of hybrid behavior.


Will there ever be a segway device that looks cool?

There’s a new segway-like vehicle: It’s called SoloWheel and it’s basically a simpler version of the former. It does look like much harder to “drive” than the segway, though, so i seriously doubt this will pick up any momentum, if you catch my drift :)

Here’s the link to the engadget article and the essential videos. The first is basically an ad, and the second is an interaction of a normal person with the device for the first time:


Installing Ruby on Rails on OSX (snow leopard)

Just some notes i might update while going through the procedure.

To start with, gem might complain that bundler requires a higher version. Something like this might happen, when you run “sudo gem install rails”:

ERROR:  Error installing bundler:
bundler requires RubyGems version >= 1.3.6
ERROR:  Error installing bundler:        bundler requires RubyGems version >= 1.3.6

If you run into that, you need to ask gem to update itself:

sudo gem update --system

Then rails’ installation should work. Actually i get errors installing the documentation for some gems. Should look into that…


A statement, a question, and a cool car

Let’s start with the question: Who the hell can live happily in negative temperatures? Maybe i’m biased, given my warmer origins but – man – there’s no way i could be happy living in a dark, cold place. It’s no wonder people who work in dark places (miners, underground train drivers, etc) tend to be more depressed than people that live in warm climates. I mean, take South America for instance; even though they are not amongst the world’s richest populations, they are all extremely positive and happy people.

Which brings us to the statement: If we were meant to live in the cold, we would not have been losing body hair along the centuries like we have. And yes, that’s my 2 cents of “guessing” science to back up the previous question :)

Finally, i have to say i found this car really intriguing. If i didn’t love my Citroen AX so much i might be tempted to buy one of these Daihatsu Materia:


Idea for a better customer satisfaction/feedback service

Recently i had to fill one of those client/customer satisfaction surveys. Endless pages of “how well do you grade feature X” questions that frustrate you beyond the point of killing yourself and your colleagues.

And that got me thinking: how about a simple form that asks “Are you happy? Yes/No”? If you answer “yes”, case closed. And some people are just plainly happy with the service/product/job so this is definitely a time saver. If you answer “no”, you are presented with a text field where you can start typing what you are not happy about and, as you do, it queries for responses from other people to suggest you with stuff that might be a problem to you. If you find one that applies to what you are trying to complain about, you choose it and another text field presents itself to complain about something else. If you don’t find one previous reply, yours is added. Repeat until done.

How’s that for simplicity?

And while we’re are it, why not make it an online survey service and make tons of cash?

Who’s your friend? Now start coding! ;)