🔗 Terça-feira, 7 de março
Estava entre Ipanema e Leblon. Entrei numa banca de jornal, pela primeira vez em muito tempo, movido por pura curiosidade de olhar as revistas, além das capas de Veja, IstoÉ e Carta Capital que eu vejo penduradas todo dia. Fiquei me perguntando quem compra as revistas de dentro da banca hoje e quais revistas eu encontraria lá dentro.
Meu olho foi correndo meio a esmo. No fundo eu queria saber se acharia uma Guitar World, como as que o meu irmão mais velho comprava quando eu era criança, mas não achei.
A prateleira da altura dos olhos (sempre a mais importante no comércio, aprendi pequeno em casa) é tomada por revistas de palavras cruzadas da Coquerel.
Um livrinho “Old Games” exibia um grande logo do MSX. Dizia “436 jogos”. Fiquei imaginando se sairia uma edição do Apple II.
Num canto, os quadrinhos de faroeste do Tex. Quando eu era criança, elas já ficavam num canto da banca. Quando eu era criança, eu já me perguntava “quem diabos compra revistas do Tex?”
Revistas de mangá. Muitos mangás. Acho que tantos quanto revistas de palavras cruzadas. Esses não existiam na banca quando eu era criança.
Olho pra baixo, e pra minha surpresa aonda existe Disney Especial. “Os Cineastas”. Quando eu era criança muitas dessas edições já eram reedições do tempo que os meus irmãos mais velhos eram crianças.
Minha jornada nostálgica à infância é interrompida quando uma voz pergunta ao jornaleiro, que estava tranquilamente me ignorando atrás do balcão:
“Tem seda?”
Era um guri loirinho de cabelos cacheados, camiseta de uniforme de colégio particular, nenhum fio de barba no rosto, guiando uma bicicleta elétrica. Ele e o jornaleiro trocaram duas frases, acho que sobre o tipo de seda, não entendi direito, logo ele partiu.
Fui embora da banca. Não comprei nada, mas saí de lá me sentindo ao mesmo tempo velho e criança.
🔗 Receita de hummus
Ingredientes
* 1 lata de grão de bico
* suco de meio limão
* duas colheres de sopa cheias de tahine
* um dentinho de alho
* sal a gosto
Modo de preparo
Botar tudo no liquidificador e bater.
🔗 Pen-and-paper Street Fighter II
I just remembered an interesting tidbit from my childhood.
Around 7th grade in school I invented a pen-and-paper version of Street Fighter II for people to play during classes.
I don’t remember the exact details, but basically I drew a grid for the screen and then I drew stick figures in it, and passed the page around.
People would write-in their moves and then I played CPU: I’d erase the stick figures and redraw in new positions, update hit/miss, update the energy meters.
I remember trying to keep it balanced and true to the game: Dhalsim’s punch and kick could hit farther but were weaker, etc. I had all of the “sprites” with the character movements pre-determined on my notebook.
The game went on sneaking a page back and forth along players and me at the back of the class. I imagine how bored out of our minds we must have been in school to enjoy playing “Street Fighter II at 0.05 frames per second”.
🔗 Fun hack to redirect stdout and stderr in order
Prologue
This is anecdote about roundabout ways to get stuff done. Pierre mentioned in the comments below that a proper way to solve this is to use unbuffer (though it does _not_ produce the exact same order as the terminal!). But if you want to read the improper way to do this, read on! :)
The story
Due to buffering, the terminal messes with the order of stdout and stderr of a program when redirecting to a file or another program. It prints the outputs of both descriptors in correct order relative to each other when printing straight to the terminal:
] ./my_program stdout line 1 stdout line 2 stderr line 1 stdout line 3 stderr line 2 stderr line 3
This doesn’t change the order:
] ./my_program 2>&1 stdout line 1 stdout line 2 stderr line 1 stdout line 3 stderr line 2 stderr line 3
but it changes the order when saving to a file or redirecting to any program:
] ./my_program 2>&1 | cat stderr line 1 stderr line 2 stderr line 3 stdout line 1 stdout line 2 stdout line 3
This behavior is the same in three shells I tested (bash, zsh, dash).
A weird “solution”
I wanted to save the log while preserving the order of events. So I ended up with this evil hack:
] strace -ewrite -o trace.txt -s 2048 ./my_program; sed 's,^[^"]*"\(.*\)"[^"]*$,\1,g;s,\\n,,g;' trace.txt > mytrace.txt ] cat mytrace.txt stdout line 1 stdout line 2 stderr line 1 stdout line 3 stderr line 2 stderr line 3 +++ exited with 0 +++
It turns out that strace does log each write in the correct order, so I’m catching the write syscall.
Note the limitations: it truncates lines to 2048 characters (good enough for my logs) and I was simply cutting off n and not cleaning up any other escape characters. But it worked well enough so I could read my ordered logs in a text editor!
🔗 On the word “latino”
One of my least-favorite American English words is “latino”, for two reasons:
First, a linguistic reason: because it’s not inflected when used. When you’re used to the fact that in Spanish and Portuguese “latino” refers only to men and “latina” only to women, hearing “latino woman” sounds really weird (weirder than, say, “handsome woman”). Even weirder “latino women”, mixing a Spanish/Portuguese word and English grammar. “Bonito girls”? :)
Second, a sociological reason: because using a foreign loanword reinforces the otherness. Nobody calls the Italian community in America “italiano”, although that’s their name in Italian. The alternative “Hispanic” is not ideal because it doesn’t really make sense when including Brazil, which was never a Spanish colony (plus, the colonial past is something most countries want to leave behind).
I can’t change the language by myself, so I just avoid the term and use more specific ones whenever possible (Colombians, Argentines, Brazilians, South Americans, Latin Americans when referring to people from the area in general, etc.)
After writing the above, I checked Wikipedia and it seems the communites in the US agree with me:
« In a recent study, most Spanish-speakers of Spanish or Hispanic American descent do not prefer the term “Hispanic” or “Latino” when it comes to describing their identity. Instead, they prefer to be identified by their country of origin. When asked if they have a preference for either being identified as “Hispanic” or “Latino,” the Pew study finds that “half (51%) say they have no preference for either term.”[43] A majority (51%) say they most often identify themselves by their family’s country of origin, while 24% say they prefer a pan-ethnic label such as Hispanic or Latino. Among those 24% who have a preference for a pan-ethnic label, “‘Hispanic’ is preferred over ‘Latino’ by more than a two-to-one margin—33% versus 14%.” Twenty-one percent prefer to be referred to simply as “Americans.” »
I think the awkwardness in the grammar from point one actually reinforces point two, because it strikes me as something that no Spanish or Portuguese native speaker would come up with by themselves. So it sounds tacked upon.
Don’t get me wrong, I fully identify as a Brazilian, a South American and a Latin American — travellling abroad helps a lot to widen your cultural identity! — and I have no problem when people wear the term “latino” proudly, but I always pay close attention to the power of language and how it represents and propagates ideas.
Follow
🐘 Mastodon ▪ RSS (English), RSS (português), RSS (todos / all)
Last 10 entries
- Aniversário do Hisham 2025
- The aesthetics of color palettes
- Western civilization
- Why I no longer say "conservative" when I mean "cautious"
- Sorting "git branch" with most recent branches last
- Frustrating Software
- What every programmer should know about what every programmer should know
- A degradação da web em tempos de IA não é acidental
- There are two very different things called "package managers"
- Last day at Kong