Older blog entries for maragato (starting at number 45)

Chrome and the new Lion full-screen behaviour

Three wise monkeys by Anderson Mancini

While I was ranting about the annoyances I found in OSX Lion today, a friend commented he had no issues at all, except for the full-screen mode. I got curious because the new Lion full-screen mode is probably the only new feature I found interesting. What did Apple do so wrong?

The answer: Google Chrome.

Wait, what? My friend was complaining that in Chrome you needed to use a keyboard shortcut in order to leave full-screen mode. That, he continued, was because Apple had given programmers too much freedom to implement the new feature any way they wanted. And he knew that, he assured me, because he had searched Google and confirmed it.

The new full-screen mode in Lion is implemented as a window behaviour not enabled by default, but adding it to a window is remarkably easy*:

NSWindowCollectionBehavior behavior = [window collectionBehavior];
behavior |= NSWindowCollectionBehaviorFullScreenPrimary;
[window setCollectionBehavior:behavior];

Adding the NSWindowCollectionBehaviorFullScreenPrimary behaviour to a window will enable a small button to its top right corner. When enabled, the mode will allocate a new Desktop for the fullscreen app and will also add a icon to the system menu to allow you to quickly leave full-screen mode.

And that’s the little icon my friend complained Chrome wasn’t showing, forcing him to use a keyboard shortcut. Imagine the trepidity! And all because of Apple.

I tried to explain that the problem was that Chrome’s windows still didn’t support the new full-screen behaviour but my friend’s version of reality was unswayable: Chrome supported the new behaviour and the problem was Apple. He had searched Google to confirm it. What could I possibly do?

Search it myself is what. And search I did. And I found this comment on Chromium’s bug tracker:

Comment 39 by rsesek@chromium.org, Jul 15, 2011

We had a conversation with one of our designers, and what we’re going to do right now is remove the fullscreen button so we don’t advertise a behavior that we don’t really implement. That change just landed and will hit Canary/Dev channels soon.

Long-term, we’re going to implement a proper fullscreen interface for Lion. In this interface, we’ll also experiment with having a collapsable toolbar. Until then, fullscreen will operate as it does on Leopard/Snow Leopard.

So there it is, straight from the source. Chromium — same as Chrome — still doesn’t support the new behaviour. Done. Nothing like reality to end a discussion.

Except my friend would not yield. Apple still needs to fix Chrome and anyone who disagrees — presumably that Chromium developer himself — is to be disregarded as an Apple fanboy.

If however you don’t want to wait for Google (or is it Apple?0 to release Chrome with the new full-screen behaviour, you can get by using Maximizer, which adds the behaviour to any application window.

* Yes, I do realize that if you’re supporting multiple OSX versions and, even worse, multiple platforms, things get slightly more complex, but still.

(Image by Anderson Mancini)

Syndicated 2011-08-02 02:19:42 from ~robteix

Hit Girl

I’m a sucker for comics and some of the movies based on them (the Dark Knight, Iron Man, X-Men and Spideman movies being the best of them.) But last night I’ve watched Kick-Ass and now I have a new favourite superhero: Hit-Girl.

Best. Action. Hero. Ever.

Show’s over motherfuckers!

Syndicated 2011-07-31 12:06:47 from ~robteix

The Ship Song Project

Oh goose pumps! Goose pumps! Beautiful video publicity for the Sidney Opera House.

Syndicated 2011-07-24 15:50:32 from ~robteix

I love infographics

Everybody loves infographics.[citation needed] Make one about stacked $100 bills and you know I’ll just have to post about it. Check out A visualization of USA debt for nice infographics to help make sense of how enormous the debt situation of the US is. The one below is just a sample.


Syndicated 2011-07-23 01:41:49 from ~robteix

Very cool video on the Space Shuttle Program

After three decades, the Space Shuttle is finally retired. Check out the video below for a bit of history. I thought the video so well done! In a little over 8 minutes it gives you a feeling of how much happened already. Also, stop to think about this for a minute: 30 FUCKING YEARS.

Most nations who tried to launch payloads into space failed miserably and still haven’t achieved it. And yet, THIRTY years ago the Shuttle started operation.

What’s next? NASA is now helping private enterprises develop the capability to fly people to the ISS so it can buy flights commercially. How long will it take? No one knows. And none of the companies is working on anything like the shuttle, so the future for now looks like it’s going to be on heavy-rockets.

Syndicated 2011-07-22 16:56:24 from ~robteix

“¿Por qué están todos hablando inglés?”

I’ve been spending an insalubrious amount of time on Google +. I managed to plump for a pretty good group to follow and as a consequence I’ve been getting consistently interesting content. As for myself, I mostly I post in English. A couple of days ago, I posted something most inconsequential and it would have been an unreservedly unremarkable post wasn’t it for the fact that it was geolocated in Cordoba, Argentina, which caused it to attract the attention of people nearby. In the middle of the comments, someone asked, in Spanish: “why is everyone speaking English?” That was a fair question and it touched something that has bugged me in the past.

Some part of my brain must miss the good old times of hunting and gathering as I ended up as a nomadic man—albeit one who doesn’t hunt and at most gathers food from grocery stores, so there might be a flaw in my theory. My rootless nature made me move a lot. This and the nature of my work caused me to make friends in several places other than my native Brazil[1].

We’ve already established that I communicate in Portuguese. Working at a US-based multinational as well as with open source, I also use English quite a bit—and my aforesaid rootlessness has taken me to inhabit the beautiful state of Oregon in the past. Oh and did I mention I am currently putting in a tour of duty in Argentina?

The Myth of the Tower of Babel

The Myth of the Tower of Babel

The result of all of this—in blatant contrast with the pre-Tower of Babel times when everybody obviously spoke English—is that I communicate daily in multiple languages. There isn’t a day—well, weekday—I don’t have to speak Spanish, Portuguese, English and French with someone or another. And that is fine and actually quite nice: you do lose languages if you don’t use them. Not like riding a bike, I suppose. Regardless, it is not a problem to communicate 1:1 in those languages. But what about 1:many conversations?

Blogging is a clear example. Should I blog in Portuguese as some keep telling me I should? I cannot reasonably expect my non-Brazilian readers to understand Portuguese. If I write in French, my Quebecer friends will be happy but what about the rest? Nationalistic rants aside, English is an international language nowadays, just as Latin and French once were. Aside from very few people, the vast majority of the people I know can understand English and that’s why I use it most often than any other.

Ideally, one would use their own native language and computer translation would do the rest. Unfortunately we are not there yet. I will admit that computer translation is getting better and better and it is fairly good if you write clear, short sentences. And it will get better. But I am skeptic that we will ever get to the point where the algorithms will be able to deal with subtleties, innuendos and all the puns that make up human interactions.

The way I see, I currently have a few options –

  • I write in Portuguese, as the ever vigilant Brazilian crowd demands it. That would soothe the wrathful nationalists who believe me a Traitor Of The Fatherland™. But it also limits my already limited audience; not good.
  • I write multiple versions of the same thing in each language. That would begin to feel like actual work, not fun. Also, having tried that in the past, I’ve learned that after I was done with the first version, the others never came out naturally.
  • I write in English. Sure it makes me a bootlicking lackey of the imperialist Yankees in the eyes of the insecure, but it also helps me reach pretty much everyone I know.

But using English is not a perfect solution either. For once, I am obviously not a native speaker and thus have an imperfect and narrow vocabulary. As well, I don’t share the cultural experiences that help define the subtleties of English. And finally, there are heaps of topics that just feel wrong in English: such as local—as in Brazilian—topics. It just feels weird.

Back to Google+, I have created Circles for Portuguese and French, but these are not much valuable until Google comes up with some system of set arithmetic that would allow me to say something to the effect of “Post this to members of Circle X who also happen to be members of Circle French.” Until then, English is my best bet.

[1] Experience tells me that I am required to point out that we, cheerful Brazilians, speak Portuguese, not Spanish.

(Image Credit: <a href=”http://www.flickr.com/photos/thomasthomas/“>ThomasThomas</a>, Creative Commons)

Syndicated 2011-07-13 19:32:22 from ~robteix

Fighting the IT overlords

Years ago, I needed an external direct Internet connection out of a lab. The first solution was to call a broadband provider and install a DSL line, but the IT department was trying to stop labs from adding more such external lines and started pushing its own solution.

Setting it up was complex because the people working on the infrastructure had never heard of this. I believe I was their Guinea Pig. As well, requesting changes was always difficult because it required second level support and the first level staff didn’t know what I was talking about.

One day I decided to document the process to help future generations. For my own amusement, I started writing it as a letter for “future occupants of the lab” where I detailed this big mistery of our ongoing, silent war against a dreadful enemy: the IT department. Later, when I was moving to a different job, I added other things to that document that I thought important in the day to day operations of a lab like that. The final document was nearly 100 pages long and had this cover page saying “To the future lurkers of Roberto’s Lair.” I did re-read the document a couple of years after I left that job and found it in some archive. It was poorly written, filled with typos and with fragrant errors. But I had fun writing it.

That was many, many moons ago.

Recently I had an exchange with someone online. The guy said he thought my name was familiar but we ended up not figuring out where he might know me from. Until today.

    From: [REDACTED]
    Sent: Friday, June 24, 2011 1:58 PM
    To: Teixeira, Roberto S
    Subject: I knew I knew you!
                     I knew I knew you! I had to check it to make sure I was right and I think I was. Aren’t you the guy who wrote the document about the IT overlords? We have two copies of that document here with lots of annotations bt we still use them. I need to scan and send them to you.

I’d love that.

Syndicated 2011-06-24 19:48:11 from robteix.com

Anagramizer, a simple anagram solver in Go

This weekend I took the family to celebrate Father’s Day away from town. We went around getting to know parts of the province we live in and never been to.

We came back yesterday and the plan today was for a nice, calm day at home (it’s a holiday of some sort here.) Then I got engaged in a game called Hanging with Friends, a mix of the traditional hangman with a bit of Scrabble.

Since English isn’t my first language, I have a limited vocabulary, which leaves me at a disadvantage against my English-speaking friends. I can handle the “hangman” part of the game where I have to guess the word my friends come up with; but when it becomes “Scrabble” and I’ve got to form words using only a given set of letters and still make them difficult enough that a native English speaker will have problems figuring them out, then it’s tough.

An itch that needed some scratching. Enter Anagramizer.

When I woke up this morning, I decided to write a little program to help me. You call it cheating, I call it having a bit of nerd fun.

Being that I’m currently in love with Go, I decided to write in that language and it was really easy and quick to do it. It took me about half an hour to write the program that did what I needed. But then…

I succumbed to the temptation and started adding bells and whistles. Admittedly it was mostly for my own amusement and trying stuff in Go, but by the time we were leaving for lunch, the program had more options than the KDE audio volume utility (see what I did just there?)

I decided to make it available to anyone who wants to play with it. It served its purpose of entertaining me for about half a day :)

It’s now available on Github and released under a BSD licence.

Syndicated 2011-06-21 00:18:27 from Roberto Teixeira's blog

Euler 9 in Go

This was surprising to me. For fun I picked one of the Euler algorithms I played with in the past and rewrote it in Go. The idea was to rewrite it idiomatically to see how different things might look. Nothing else. The very first thing I did was to get the exact algorithm and rewrite, no idiomatic changes.

package main
import "fmt"
func isTriplet(a, b, c int) bool {
        return a * a + b * b == c * c
func main() {
        for a := 1; a < 1000; a++ {
                for b := a + 1; b < (1000 - a) / 2; b++ {
                        c := 1000 - a - b
                        if isTriplet(a, b, c) {
                                fmt.Println(a * b * c)

What surprised me is that this thing runs in 0.005s, which is faster than the Python implementation and very close to the one in C. It surprised me because this wasn’t really supposed to happen. The Go compiler isn’t well optimized, especially compared to compilers with a many-years headstart.

Syndicated 2011-06-14 15:30:06 from Roberto Teixeira's blog

36 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!