Skip to main content

Posts

Showing posts from 2016

Installing Ubuntu 16.04's friends into an iBook G4 with a USB pendrive

I had an old iBook G4 that could be useful for an elderly person, to be able to do her banking and basic internet browsing without having to use an XP-vintage, molasses-slow, honeypot-aspiring PC. There's a reasonably complete and up-to-date guide in https://ricanlinux.blogspot.com/2015/03/ubuntu-mate-on-my-ibook-g4.html . I had to change a couple of details; and there are a couple of practical considerations to be had. (Note to self: "lightness" in Linux rather correlates to "barebones" [3] , which correlates with "hardcore" (text configs, mailing list scouring, lots of googling). Next time I'll be trying a heavy-weight distro for this kind of thing; better slow-but-useable than less-slow-but-WTF.)

Grand Central Dispatch for Android?

(Sometimes after a couple of hours of research, the result is a dead-end or needs further digesting. Still, such a result might itself still be worth remembering. This is a Quick&Dirty report of one of those cases.) GCD is an implementation of thread pools / queueing (+ event management (sockets, files), etc) by Apple for Mac OS X / iOS. It was open-sourced, and FreeBSD got an implementation. They are practically an abstraction and simplification over pthreads (+ events, etc), and the GCD implementation includes some kernel and compiler changes (workqueues and blocks, respectively). Implementation details at http://newosxbook.com/articles/GCD.html . It's well performing and seemingly can help simplifying a lot. What if one wanted to use GCD in Android? Is there anything compatible enough and that could be used at the C level?

Cocinando con citrato sódico casero

Parece ser que un ingrediente típico para la "cocina molecular" de Ferrán Adriá y compañía es el citrato sódico, que se usa por ejemplo para esferificaciones, caviar de frutas y cosas así. Pero también se usa para algo mucho más simple y usable en casa en el día a día: ¡queso fundido!, que queda genial para salsas, dips, incluso fondues. ¿Pero cuál es el problema? Fundir queso es fácil, ¿no? En realidad, no. Prueba a fundir un taco de 100 gramos de queso normal y verás que el resultado es casi para tirar a la basura: un charco de aceite por un lado, una especie de trapo gomoso por otro. Esto lo podemos salvar con citrato sódico.

GitFlow (and friends) with remotes: avoid the busywork

If your local feature branch tracks origin/feature , you are probably working extra, no matter your flow . There are lots of places online where one can learn about GitFlow, but it's seemingly always discussed in a local way; the details, subtle or not, about using GitFlow when you are pushing and pulling your changes through the network are never mentioned. Now, GitFlow is a bit long on the teeth, and some of the younger and simpler alternatives do take into consideration things as Pull (or Merge) Requests; lately some even want the original GitFlow to be considered harmful . But still, there's a common basic concept in GitFlow and the alternatives, which is local feature branches. How and when exactly to merge them back into a development branch is one of the big differences, but is rarely detailed. The goal of this post is to gather some tips on how to keep developing in the local feature branch while staying involved on a lively repository; and how to make easier t

Doxygen error parsing in Eclipse CDT

Eclipse (or is it the CDT?) has, by default, some Doxygen integration: if the preferences are set appropriately, Doxygen-style comments are highlighted differently, and Doxygen commands in those comments are further highlighted. But that's about it. A particular missing feature is that errors in the comments are not highlighted in any way; and that's what made me look for a better alternative.

BPM-showing players for iOS

It's surprisingly difficult to find a way to browse one's music library on the iPhone together with the BPM values that were set on iTunes. Note that the BPM value is stored in the iTunes database, not in ID3 tags in the individual songs. I was surprised by this; I rather expected iTunes to offload as much information as possible onto the actual files. And probably that would be the best option to avoid end up slaves to iTunes' database. On the other hand, storing metadata aside saves us from absurdly bulky TimeMachine backups...

An IS_DEFINED() C macro to check whether another macro is defined

Every C programmer knows to use #defines and #ifdefs to disable compilation for a piece of code. But not everyone knows that there are better ways; the problem with this strategy is that the code becomes invisible to the compiler (and "smart" indexers), which means that it stops being checked for correctness. Also, if the rest of the code changes substantially, like variable renaming, function changing their signatures, etc, the disabled part falls out of sync and will need possibly serious work when re-enabled. There are easy improvements to the #ifdef strategy, with the inconvenience that they add boilerplate and/or waste cycles on runtime (important on embedded environments). But there's also a way to remove both the boilerplate AND the runtime checks!

Tweaking Waf for integration with Eclipse CDT

First, the way not taken: there is an official Waf extra named "eclipse.py" which theoretically creates the files that Eclipse expects in a project. But that extra is from 2011; both Waf and Eclipse have evolved since then, and I didn't have the time nor inclination to dig into both Waf and Eclipse internals. Also, what would be the end result of that extra: only build support, or full indexing? No docs, no idea, forget it. So let's make it easier. We already know that Eclipse's indexing system only needs to see the compiler command lines to get an idea of what files are related, where are the includes, what are the compiler flags, etc. So what about just making Waf spit out the command lines? And turns out, it's even easy: there is another extra called "print_commands" which does just that.