Older blog entries for maragato (starting at number 74)

Cancelamento de uma linha de celular na Argentina

Fácil:

1. Enviar uma carta (isso mesmo, uma carta, em papel) para a operadora (Claro) de punho com todas as informações pessoais (documento de identidade, nome completo, endereço, data de contratação da linha, motivo para o cancelamento, …)

2. Esperar "de 45 a 60 dias" (!!!!) e ligar para o atendimento a clientes para verificar se a carta foi recebida e se a mesma estava correta (!!!!)

3. Caso eles tenham recebido e os dados estiverem corretos, solicitar o início do processo de cancelamento. Mas…

4. No dia dessa chamada ao centro de atenção, todas as contas deve ter sido pagas–ok, normal–há pelo menos 10 dias úteis–wait what? Isso resulta em uma janela de duas semanas entre o momento em que você pode ligar e o momento em que a nova conta terá sido gerada para o mês seguinte. Tem que prestar atenção.

5. Uma vez iniciado o processo (que é iniciado nessa ligação, não quando você envia a carta dois meses antes), o processo pode levar até 60 dias.

As operadoras brasileiras são péssimas, mas as da Argentina ganham.

Mas há um loophole…

Procedimento para mudar a linha de pós para prépago:

1. Ligar para o *611 e escolher a opção 4 ("Desea cambiar tu línea a prepago")

2. Aguentar a atendente que vai tentar te convencer que você é burro porque pós é muito melhor e a sua vida vai ser miserável com prepago

3. Carregar 30 pesos.

4. Feito.

Agora é jogar fora o chip e ir pra galera!!. :)

#blog

Google+: Reshared 2 times
Google+: View post on Google+

Syndicated 2013-05-27 11:40:46 from robteix dot com

Join us on App.Net

I liked the idea behind App.Net (or ADN for the initiated) from the start; I’ve happily signed up during the initial funding effort and before it even existed. It is quite like Twitter, although it does have some pretty interesting API advantages that allow clients to do things that are not possible in Twitter such as creating private chat rooms (with Patter.) I found a text by Matt Gemmell, App.Net for conversations, that sums it up nicely:

The interesting part, though, is what you won’t be used to from Twitter. There are no ads, anywhere. Because it’s a paid service, there’s no spam at all; I’ve certainly never seen any. There’s an active and happy developer community, which ADN actually financially rewards. There’s a rich, modern, relentlessly improved API. And again because it’s a paid service, there’s a commensurately (and vanishingly) low number of Bieber fans, teenagers, illiterates, and sociopaths.

But the real difference I notice is in the conversations. On Twitter, the back-and-forth tends to be relatively brief, not only in terms of the 140-character limit, but also the number of replies. There’s a certain fire-and-forget sensibility to Twitter; it’s a noticeboard rather than a chatroom. Then there’s the keyword-spam (woe betide the person who mentions iPads, or MacBooks, or broadband, or just about anything). Oh, and let’s not forget the fact that any malcontent with internet access can create an account (or two, or ten) in seconds. Not a happy mixture.

I’d add that there seems to be less of a popular clique on ADN. Popular users seem to be much more engaging with “regular people” than on Twitter. And there’s the developers… although most of the rush is now behind us, it was fun to follow the developers working on ADN clients. It was a very collaborative effort, with alpha builds floating around and discussions about whether this or that should be done in a certain way.

As for the developers of ADN proper, well, you can try asking ADN CEO and Founder Dalton something to see if he’ll answer you in about 30 seconds. He actually does. :)

It all feels like a big community where everyone feels a bit like they own the place as well and want it to thrive. Again I think Matt is on the money on why this is so:

We value what we pay for. We not only pay for things which we deem to be of value, but we also retrospectively assign and justify value based on what we’ve paid. Any consumer is familiar with the simple psychology of cost equating as much to value after the transaction as value does to cost beforehand (likely moreso, from my own experience). At its core, I don’t think that the reason for the noticeably different, warmer, more discursive “feel” of ADN is any more complicated than that.

I personally love the service and I think you should consider it too. There is a free tier account that allows you to follow up to 40 people for free, as long as you’re invited by a current user. If you’re interested, I have a few invites.

Feel free to comment on this post by using Google+ or also by talking to me on, where else, ADN, where I’m @robteix. And of course Twitter isn’t going anywhere and I’m there too.

Syndicated 2013-05-18 18:08:49 from robteix dot com

Goodbye Intel

Eight years ago I joined a great company in Intel. It has been a great ride but as of a few minutes ago, I have informed my manager that I quitting my job for personal reasons.

A couple of years ago, I relocated to the software development centre in Cordoba, Argentina. It was always meant to be a temporary assignment but it ended up being longer than my family and I ever thought. And as our daughter grows up, it becomes ever more difficult to engage in international relocations, so my wife—who also works at Intel, by the way—and I decided that we needed to act. We set a hard deadline for the move and stuck to it. This is it.

My wife, daugher, and I at the Intel Minigolf side during the last Kids@work Day

My wife, daughter, and I at the Intel Miragolf site during the last Kids@work Day

My wife and daughter will be flying to Brazil in two weeks and I should follow some short time later, once I’m done closing everything behind. We’ll be relocating to Curitiba, where my wife and I first met 13 years ago, so it’s fitting.

So this is it. Good bye, Intel, it’s been fun and I wish you all the best.

Syndicated 2013-04-22 16:06:20 from robteix dot com

A Argentina por um brasileiro

Antes de começar, como imagino que fatalmente um argentino vai ler este post, acho melhor um rápido disclaimer: si sos argentino, espero que sepas leer esto cómo lo intenté escribirlo, o sea, no para decir que es mejor o peor en Argentina, pero sí cómo las cosas son diferentes. Abajo hay cosas buenas y malas (en mí opinión personal), aunque probablemente haya cosas que sean más negativas que positivas, pues seguramente es lo que más me llamaba la atención.

Este post é ao mesmo tempo algo que quero escrever há muito tempo e um tanto inspirado em um post recente que vi no Google+ de um francês comentando sobre o que considera particularidades do Brasil.

Passei mais de três anos em Córdoba, na Argentina, e desde que cheguei percebi como as coisas são diferentes entre aquele país e o Brasil. Há tempos venho contando coisas aos poucos a vários amigos e acho que está na hora de botar tudo junto.

Assim como no post do francês, algumas coisas aqui certamente são particularidades da região ou da cidade em que vivi e podem não acontecer em outras partes. Em outras palavras, o que segue é baseado em minha própria experiência, tanto na Argentina quanto no Brasil (e EUA em menor medida).

Na Argentina, a transmissão de jogos de futebol é de competência exclusiva do Estado. Durante os jogos, só passa propaganda política do governo federal. Aliás…

Na Argentina, a propaganda do governo não é apenas naquele estilo “olhe a nova represa! Governo Federal! País de todos”, não. É mais como horário político em tempos de campanha, exaltando a presidente e atacando opositores. Por exemplo, recentemente durante o intervalo dos jogos, o governo passava um mini-documentário de 15 minutos atacando o governador da província de Córdoba, que é opositor da presidente.

Na Argentina se para em fila para tudo. E não são filas pequenas.

Na Argentina, quando a criança nasce, ela precisa fazer o DNI (um misto de RG com CPF). Há enormes filas para isso e corta o coração ver filas enormes de mães com bebês recém-nascidos, às vezes debaixo de chuva.

Na Argentina não se deixa gestantes, idosos e deficientes passarem na frente nas filas.

Desde o início me surpreendeu a quantidade de carros muito velhos andando nas ruas da Argentina. São muitos e muito velhos. Em particular, os taxis tendem a ser carros bem mal cuidados, em contraste ao Brasil onde os taxis raramente são carros com mais de 2 anos.

20130416-082840.jpg

Na Argentina se reclama muito da falta de troco para tudo, mas os caixas eletrônicos só têm notas de 100. Ninguém parece ligar as duas coisas.

Na Argentina, você compra jogos e DVDs piratas em lojas legítimas em shopping centres legítimos.

Se no Brasil o problema dos correios são as longas greves periódicas, na Argentina o problema são roubos. É padrão coisas não chegarem, a ponto de muitos sites internacionais não aceitarem enviar coisas para a Argentina exceto por courrier. Revistas chegam (quando chegam) com _grande_ atraso, fora das embalagens originais e com claros sinais de uso.

Na Argentina o sistema bancário não é nem de perto desenvolvido como no Brasil. Isso valeria um post exclusivo, mas um ponto curioso é que você não pode pagar suas contas no banco. Cada serviço (luz, TV a cabo, aluguel…) usa uma empresa de cobrança diferente como Rapipago, PagoFácil, Pago mís cuentas. A maioria absoluta não oferece pagamento via internet, então você precisa ir a um local para fazer o pagamento. Pior, às vezes você chega em uma dessas e descobre que naquele local especifico eles não recebem contas do serviço que você quer pagar e você tem de ir a outro. Nota: sempre tem filas enormes.

Uma coisa bastante assustadora sobre bancos é que eu já fui em um caixa do Citi e retirei 10.000 pesos sem mostrar identidade, sem digitar senha e nem assinar nada. Se perder o cartão, perdeu, preiboi.

Na Argentina Lula é deus. A imagem do Lula na Argentina é algo completamente surreal, chegando a ser quase sobrenatural. Talvez um pouco pelas diferenças no sistema político, o argentino atribui ao Lula mesmo coisas sobre as quais ele não teria poder algum, como prender traficantes. Na Argentina, o Lula acabou com o crime no Brasil, acabou com a pobreza e curou todas as doenças. É irreal.

Curiosamente, embora seja o Lula tenha sido aliado do governo Kirchner, é a oposição que mais cria a imagem endeusada de Lula, sempre para comparar desfavoravelmente a presidente com Lula.

640px-Lula_Kirchner
(Fabio Rodrigues Pozzebom/ABr/CC-BY-3.0)

Na Argentina não se vê (muitos) mendigos na rua. Há pobreza, mas não como no Brasil.

Na Argentina, pessoas usam laptops e tablets em mesas em cafés mesmo na calçada. Eu usava meu laptop e mais tarde meu iPad e iPhone no ônibus. Nunca ouvi falar em gente que tenha sido roubada assim.

Na Argentina não fazem piadas com brasileiros. A diferença no tratamento entre os povos é tão gritante que chega a me dar vergonha. Conheci muitos argentinos no Brasil e todos sempre tiveram de aguentar piadas e piadas e piadas o tempo todo. Aqui nunca ninguém fez piada de brasileiro para mim e ficam surpresos quando eu comento isso.

Para imitar um brasileiro, eles dizem “é o maior do mundo” (invariavelmente pronunciado — e meio cantado — como “ê o maiorrr dô mondo”). Nunca ninguém soube (ou quis) me explicar a origem disso, mas parece o equivalente ao nosso “pero que si, pero que no“, que não faz nenhum sentido em espanhol.

Na Argentina a cultura brasileira é muito forte. Toda muita música brasileira nas rádios. Infelizmente só vem o pior: na escolhinha da nossa filha, ensinaram as crianças a cantar Michel Teló.

Na Argentina os motoristas de taxi não te ajudam a botar ou tirar malas. Aliás, muitos se recusam a sequer te deixar usar o porta-malas, te mandando colocar a mala no banco da frente do carro.

Na Argentina os motoristas de taxi andam com som alto e fumando. Às vezes eles param no meio do caminho e te pedem para sair porque apareceu algo mais importante para fazer do que levá-lo ao seu destino.

Na Argentina há manifestações todas as semanas (os funcionários municipais, os motoristas de taxi, etc.) e elas fecham as ruas do centro. A polícia deixa fecharem a rua toda.

Na Argentina, antes de começar um filme no cinema, você têm de aguentar meia hora de propaganda exaltando o político local.

20130416-194923.jpg

Na Argentina o governo manipula os índices de inflação e processa instituições que publicam seus próprios índices. É como se no Brasil o governo processasse a Fundação Getúlio Vargas sempre que esta publica os índices. Não é oficialmente proibido publicar isso, mas o governo usa uma lei genérica sobre tentar criar distúrbios sociais.

A fim de esconder as manipulações que ficavam claras com o Big Mac Index, o governo forçou o McDonald’s a vender o Big Mac na Argentina a um preço baixo por anos. O resultado é que você não vê Big Macs nos McDonald’s da Argentina. Eles sempre estiveram à venda, mas como o preço era artificialmente baixo por força do governo, o McDonald’s escondia dos cardápios.

Na Argentina, embora o governo diga que não há inflação, há congelamento de preços. E embora o governo diga que não há congelamento de preços, o governo anuncia de tempos em tempos que o congelamento de preços vai continuar por mais X meses.

Na Argentina não há maneiras fáceis de poupar dinheiro. Não há nem sequer uma Poupança. E como há uma inflação bastante alta (o governo nega!), o seu dinheiro desaparece. O argentino se acostumou há muitos anos a usar o dólar como poupança. O governo recentemente “proibiu” a compra de moeda estrangeira por argentinos: o chamado cepo cambiário.

Na Argentina não é oficialmente proibido comprar moeda estrangeira, só é necessário pedir autorização prévia, que será sumáriamente negada. Há exceções: se você provar que vai viajar para o exterior e justificar a necessidade dos fundos, eles liberam até 100 dólares por dia de viagem. Você precisa provar que vai viajar e efetivamente viajar. Comprar dólares e não viajar é punível com até 2 anos de cadeia. Se sua viagem for cancelada, você precisa voltar à AFIP (a Receita Federal daqui) para devolver os dólares.

Na Argentina é legal e normal fazer contratos em moeda estrangeira. Ninguém quer receber em pesos. Com o recente cepo, isto criou uma situação perversa onde pessoas compraram, por exemplo, imóveis e agora têm de pagar em dólares e não podem comprá-los, tendo então de recorrer ao paralelo, que é quase o dobro do valor. Ah sim, quando se diz que algo é em dólares, você tem de pagar em dólares mesmo e não em “pesos no valor equivalente a X dolares”.

Ainda como parte do cepo, é proibido a argentinos tirar dinheiro em caixa eletrônico fora do país com seus cartões bancários. Compras com cartão de crédito em moeda estrangeira contém uma multa de 20%.

Para fechar, na Argentina, sempre que há uma queda na popularidade do presidente, trazem à tona as Malvinas. E o povo engole toda a vez, algo que realmente me surpreende. O povo realmente leva isso à sério. Aliás, as Malvinas estão presentes em toda a parte na Argentina em monumentos, stickers em carros, pixações…

IMG_0222

Não fosse o fato de que há gente que vive nas Malvinas e tem a legitimidade de ter nascido lá de pais nascidos lá e assim por diante, eu defenderia que dessem as Malvinas para a Argentina só para perguntar “ok, e agora o que vocês vão fazer?” e acabar com essa muleta dos governos argentinos.

Acho que é por aí. Deve haver muito mais, mas é o que me veio à cabeça e acho que é suficiente por agora. Se eu lembrar de mais, escrevo outro post. Se tiver algum comentário, dúvida, etc, pode comentar no post relevante do Google+. Também sou @robteix no Twitter e também robteix no App.net.

Syndicated 2013-04-16 11:29:03 from robteix dot com

Day 4 of my family linguistical experiment

A little context first. A little under four years ago I was relocated to Cordoba, Argentina for a stint at the local development center. My daughter Milena was two months old when she arrived her.

For the first year of her life, she was mostly unexposed to Spanish as my wife and I spoke Portuguese at home and TV was in English. When she was a little over one year old, she started staying at daycare as we wanted her to socialize and later because my wife went back to work. This exposed her to Spanish. So at this point, she was hearing Spanish, Portuguese, and English every day.

About a year later, she wasn’t speaking much yet and we inevitably compared her with other kids her age1, who were already saying many words, some already forming simple sentences. Our pediatrician told us many times that this was perfectly normal but finally said that if we wanted to, we could visit a child psychologist to calm ourselves. We did just that.

After a few sessions, the psychologist told us that we should probably not worry about some neurological problem2 because Milena did not exhibit any signs commonly associated with these problems. She did however told us that she was worried that my wife was working instead of staying home with her child. This led to two things: (1) my wife felt extremely guilty, while at the same time (2) we both felt that this was idiotic. It also nearly led to a third thing: we almost decided to stop going because it was not helping at all. But we still had two more sessions already scheduled and paid for so we decided to at least go to those.

My wife did not go to the next session as she was still angry at the psychologist for making her feel guilty. I don’t blame her. In this session, the psychologist told me that we should stop speaking Portuguese to our daughter. She said this was bad for her and that later she would have many years to learn other languages. In my head, I immediately dismissed this. But…

First-time parent that I am, I started saying a few simple things in Spanish to my daughter. Not whole phrases, but things that I knew she heard at the daycare. Stuff like “come here” and “very good!”, I’d say in Spanish. We went to our last session and the psychologist asked about it and I told her that I wasn’t really saying everything in Spanish but some things. She insisted that we should not expose Milena to anthing else. My wife argued that many said kids learn languages easily but we didn’t really push too hard: we would not get back.

We told our pediatrician about it. He said we were insane if we did that because he personally knew other foreign families whose children learned multiple languages and that is was perfectly normal for our daughter to take a little longer to start talking but that once she started, she’d speak both languages. We agreed. But…

Almost without thought, we continued saying some things in Spanish simply because Milena seemed to respond better. Saying “don’t!” in Spanish yielded better results than saying it in Portuguese, probably because she heard it often at daycare. This led us to saying more and more in Spanish. Coincidence or not, she started speaking more and more. In retrospect, we took the easy route. It wasn’t intentional but that’s what we did.

Now, she speaks well but only in Spanish. And we have been speaking only Spanish to her for almost two years. And this led to a point where I feel uncomfortable when talking to my own daughter. My Spanish is alright, but not perfect. And it does not feel natural to me. It comes out “artificial” for lack of a better word. Also, her grandparents don’t speak Spanish. Nor do her cousins: when they meed, there’s this “wall” between them. My nephews and niece don’t understand my daughter, which leads to frustration and lots of crying. Kids.

Well, a few days ago I decided to start an experiment. I now speak almost entirely Portuguese to her3.

I thought it would be tough and I am surprised that the toughest part so far has been ME. I got so used to speaking Spanish to her that I actually have to make an effort to remember to speak Portuguese. As for her, I am very surprised at how much she understands. I say fairly complex sentences and she gets them, whereas when I used to try those in Spanish, she wouldn’t. That’s obviously my Spanish’s fault, not hers.

She still responds mostly in Spanish but it is clear that she understands what I am saying. My wife and I speak Portuguese to each other, so she must have picked much from that. And being fair, I know she listens to pop Brazilian songs at daycare4 but still, I thought it would have been a little more difficult.

I’m happily surprised.

If you care to comment or suggest something, please do so in this Google+ thread. Thanks. And I’m @robteix at Twitter, so you can shout at me there as well.

  1. Big mistake, by the way. Don’t do that. We are stupid.
  2. Read, autism.
  3. I say “almost” because I still use Spanish for words that I know she doesn’t know yet. Like “pelota” (“ball”) and “rojo” (“red”). although I always make a point to tell her what the Portuguese word is so she’ll learn it.
  4. We catch her often singing songs from Brazil that she’d never listen to at our home — in fact just this morning she actually woke up singing “ah, se eu te pego, ai ai…” in bed, which merits a whole other post…

Syndicated 2013-01-29 14:47:34 from robteix dot com

Bad parents make me want to smash

We went to a hypermarket this morning for some needed groceries. While my wife went grocery shopping, I stayed with our daughter in the playground they have in there.

At some point, my daughter decided it was time to play in the little train they have there. An older kid was there but the little train has two seats so she went to the empty one and sat with the smile of the kind of joy only a 3 year-old feels when heading to enter a toy train. That joy was short lived as the kid decided he didn’t want to share and pushed her out.

I calmed her down and since the kid was already in the train before her, I decided it wasn’t worth it and just calmed her down. “Let’s go play over there and then we’ll come back later! Come on! Let’s go!” (Kids that age respond to enthusiasm.)

Fast forward to a bit later and the train was empty. My daughter decided it was a good time for a second try. She climbed aboard and started playing with the levers when the kid from before comes rushing and shouting “no no no no!” He then climbs aboard and throws her out. Let me make it clear I am talking about My. Little. Princess.

Oh boy.

“Hey,” I stared at him, “that’s not cool!” He must have been 8 or 9, my daughter is 3. He should know better by now.

He just replied, “It’s mine!”

“No, it’s not!” I said it back, the way adults talk to naughty children. “Where are your parents?”

Before he would answer, this lady comes and asks what’s going on. She’s obviously the kid’s mother. I tell her that he pushed my daughter out of the train and she’s looking at me like I’m speaking Russian or something1.

“Why can’t your child share it my son?” she asked, indignantly.

What?

“She tried to share it!” I protested. “Your son threw her out then. And now she was in there when your came and threw her out again!”

“How rude!” she told me, clearly meaning me and not her annoying little moster.

avengers-hulk-smashing-loki

She grabbed her kid while telling him that he couldn’t play because “some parents think the playground belong to their children” and other things.

I tell you, one of the toughest things I faced being a dad was at playgrounds: restraining myself.

  1. To be fair, I was a bit upset and I am sure I was mangling my Spanish, which isn’t very good to begin with.

Syndicated 2013-01-05 21:26:20 from robteix dot com

Linux Kernel Linked List Explained

I appreciate beautiful, readable code. And if someone were to ask me for an example of beautiful code, I’ve always had the answer ready: the linked list implementation in the Linux kernel.

The code is gorgeous in its simplicity, clarity, and amazing flexibility. If there’s ever a museum for code, this belongs there. It is a masterpiece of the craft.

I was just telling a friend about it while we talked about beautiful code and he found this piece that I share here: Linux Kernel Linked List Explained.

Syndicated 2013-01-04 20:13:22 from robteix dot com

Container changes in C++11

The recently approved C++11 standard brings a lot of welcome changes to C++ that modernize the language a little bit. Among the many changes, we find that containers have received some special love.

Initialization

C++ was long behind modern languages when it came to initializing containers. While you could do

int a[] = {1, 2, 3};

for simple arrays, things tended to get more verbose for more complex containers:

vector<string> v;
v.push_back("One");
v.push_back("Two");
v.push_back("Three");

C++11 has introduced an easier, simpler way to initialize this:

vector<string> v = {"One", "Two", "Three"};

The effects of the changes are even better for things like maps, which could get cumbersome quickly:

map<string, vector<string> > m;
vector<string> v1;
v1.push_back("A");
v1.push_back("B");
v1.push_back("C");

vector<string> v2;
v2.push_back("A");
v2.push_back("B");
v2.push_back("C");

m["One"] = v1;
m["Two"] = v2;

This can now be expressed as:

map<string, vector<string>> m = {{"One", {"A", "B", "C"}},
                                 {"Two", {"Z", "Y", "X"}}};

Much simpler and in line with most modern languages. As an aside, there’s another change in C++11 that would be easy to miss in the code above. The declaration

map<string, vector<string>> m;

was illegal until now due to >> always being evaluated to the right-shift operator; a space would always be required, like

map<string, vector<string> > m

No longer the case.

Iterating

Iterating through containers was also inconvenient. Iterating the simple vector v above:

for (vector<string>::iterator i = v.begin();
     i != v.end(); i++)
    cout << i << endl;

Modern languages have long had some foreach equivalent that allowed us easier ways to iterate through these structures without having to explicitly worry about iterators types. C++11 is finally catching up:

for (string s : v)
    cout << s << endl;

As well, C++11 brings in a new keyword, auto, that will evaluate to a type in compile-type. So instead of

for (map<string, vector<string> >::iterator i = m.begin();
     i != m.end(); i++) {

we can now write

for (auto i = m.begin(); i != m.end(); i++) {

and auto will evaluate to map<string, vector<string>>::iterator.

Combining these changes, we move from the horrendous

for (map<string, vector<string> >::iterator i = m.begin();
     i != m.end(); i++)
    for (vector<string>::iterator j = i->second.begin();
         j != i->second.end(); j++)
        cout << i->first << ': ' << *j << endl;

to the much simpler

for (auto i : m)
    for (auto j : i.second)
        cout << i.first << ': ' << j << endl;

Not bad.

C++11 support varies a lot from compiler to compiler, but all of the changes above are already supported in the latest versions of GCC, LLVM, and MSVC compilers.

Syndicated 2012-12-15 14:41:36 from robteix dot com

FOR is evil or something

Have you ever wondered how FORs impact your code? How they are limiting your design and more important how they are transforming your code into an amount of lines without any human meaning?

How can you not want to read an article that starts like that? I had to steal the intro from the original. Seriously, I have used FOR since I learned BASIC back in the day. I never thought about how it was limiting my design. I. Must. Learn. How.

The article I am referring to is, Avoiding FORs – Anti-If Campaign. Eager learner I, I could not not read it.

After the resplendent intro, Avoiding FOR goes on to show “how to transform a simple example of a for […], to something more readable and well designed.”

It takes this unreadable piece of code — that I now recognize as unreadable:

public class Department {

    private List resources = new ArrayList();

    public void addResource(Resource resource) {
        this.resources.add(resource);
    }

    public void printSlips() {

        for (Resource resource : resources) {
            if(resource.lastContract().deadline().after(new Date())) {

                System.out.println(resource.name());
                System.out.println(resource.salary());
            }
        }
    }
}

My eyes hurt already. Thankfully the author transforms the aberration above into this clean, much more readable snippet:

public class ResourceOrderedCollection {
        private Collection<Resource> resources = new ArrayList<Resource>();



    public ResourceOrderedCollection() {
        super();
    }

    public ResourceOrderedCollection(Collection<Resource> resources) {
        this.resources = resources;
    }

    public void add(Resource resource) {
        this.resources.add(resource);
    }

    public void forEachDo(Block block) {
        Iterator<Resource> iterator = resources.iterator();

        while(iterator.hasNext()) {
            block.evaluate(iterator.next());
        }

    }

    public ResourceOrderedCollection select(Predicate predicate) {

        ResourceOrderedCollection resourceOrderedCollection = new ResourceOrderedCollection();

        Iterator<Resource> iterator = resources.iterator();

        while(iterator.hasNext()) {
            Resource resource = iterator.next();
            if(predicate.is(resource)) {
                resourceOrderedCollection.add(resource);
            }
        }

        return resourceOrderedCollection;
    }
}

public class Department {

    private List<Resource> resources = new ArrayList<Resource>();

    public void addResource(Resource resource) {
        this.resources.add(resource);
    }

    public void printSlips() {
        new ResourceOrderedCollection(this.resources).select(new InForcePredicate()).forEachDo(new PrintSlip());
    }

}

Wait, what? Is this an Onion article?

Snarky Mode Off.

I understand what the author wanted to do, but really, the example used is so off the left field that it’s not even funny.

Syndicated 2012-11-19 13:31:16 from robteix dot com

Missus Lady Wife’s bday

20121111-121454.jpg

Wife’s birthday translates into dad-daughter’s day out as my wife gets a day-off from us :)

Syndicated 2012-11-11 15:07:51 from robteix dot com

65 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!