Skip to main content

Posts

Taking a snapshot of the ports in an AVR (AT90CAN128)

A small inline function to take a snapshot of all the ports as simultaneously as possible, which means 7 cycles from first to last, which means less than 0.5 usec from first to last at 16 MHz. Can't be faster. Had to be done in asm inline because if not gcc prefers to interleave the input instructions with store instructions. Done this way, the inputs come first and the storage comes later, generated automatically.

A hacky fix for SuperDuper running out of space: "delete first" with rsync

Rsync has a possibility to delete the to-be-deleted files in the destination before it starts syncing files that actually need syncing. That is sorely missing in Shirt Pocket's program SuperDuper!, which is actually a nice backup program, and for some time was one of the few sane options available to make fully reliable backups. SuperDuper! just starts copying blindly, and can then find itself in the situation where the backup destination can't contain the new files + the old files that should be deleted but still weren't. So that problem would be solved with rsync's "delete first" behaviour. I see there have been people complaining about this in Shirt Pocket's forums for at least 5 years, and the developers seem to only say "yes, we will do something sometime". But they still didn't. So, this is the command line to be used: sudo rsync --delete --existing --ignore-existing --recursive  /Volumes/ORIGINAL_VOLUME/ /Volumes/BACKUP_VOLUM...

Lyrics for "Sem bo amor" (Nelson Freitas)

Originally in creole, and in http://www.afrikaonline.net/t4011-sem-bo-amor-nelson-freitas-part-to-semedo-loony-johnson-2012   is translated to portuguese, but with bad ortography. Here it is corrected enough so that Google Translate can give a good result. Anyway, and amazingly enough, the lyrics end up making sense after all the process, and even being not-really-moronic and fitting to the song mood. Nice surprise. Ondas de mar estao chamando por ti Estrela no ceu ilumina-me o caminho Vento esta soprando escuto sua voz Nao ha dias que nao sonho contigo Mas nao quero entregar, tudo em ti Prefiro ficar, sozinho (Refrao) Sem teu amor "girl" Meu coraçao fica mais forte Mas com teu amor "girl" De certeza vou sentir a dor Parte: To Semedo Ja vi que tu és Aquela mulher tao especial Um toque divinal Faz-me enfeitiçar Sentir como se tens Aquela força que é poder que leva o meu ser Aonde nao quero ir Mas nao quero vir a entregar (entregar) Tudo em ti Prefiro ficar (fica...

Microwave oven sponge cake

I needed my recipe for a microwave oven-made sponge cake, and could not find it. Never more. So here it is. I have seen different variations online. Some are interesting, some aren't. This is one version I have kind of settled in after some tries and changes and mixings with other recipes. It still is evolving, but is a good start point, or of course end point. (Yeah, microwave oven. It works. This is kind of a survival recipe; it won't be as good as with a normal oven, but is incredibly fast (15 mins from beginning to cake), and it is better than a lot of sponge cakes and muffins you see in supermarkets and even coffee shops. Yeah, it also works for muffins. And if you don't have a normal oven in your rented flat, it's actually more than good enough) Ingredients: 4 eggs 450 g flour (substitute about a third of it with Graham for more interesting texture; or change to 300 g flour+200 g cocoa for a chocolate sponge cake) 450 g sugar (no big difference with bro...

Memory access stride in loops change loop timing in AVR C!

I found a strange situation when programming in C for AVRs. I have a bunch of structures to be worked on, but any of them can be flagged "active" or not at any given moment, to signal whether they need further work. My first approximation was to add a (uint8_t volatile: set in main, checked in interrupt time) member variable named "active" to the struct, to quickly check/set each structure. Shock: only looping through the array checking the "active" member variables was taking an enormous amount of time – about 20 clock cycles per access !

Selecting a mobile internet operator in Poland

( see the 2014 update ) About one year ago I was tired of the problems with my then-current internet provider, Play. So I decided to try the 4 major operators in Poland. I got a "starter pack" for each one, which can be bought for about 10 zl each, and tried them with my telephones/modems/computers. These are the results of testing with speedtest.net, pingtest.net, youtube's speed test and torrenting some big Linux disc image. And since this is mobile internet, I tried each in a set of places in Warsaw - and some even outside of the city. Note that I was looking for smartphone use: voice + data, with data being in the 5 GB/month range, possibly more. So data packages measured in MB didn't cut it (since they are usually much more expensive). And internet-only SIMs were out, too. The tests are one year old, but I can confirm that the results are still valid at least for T-Mobile and Play, since I still use them both. For non-technically inclined people, the summ...

Enlaces a mensajes de correo

Gruber, de Daring Fireball, escribió hace tiempo sobre la posibilidad de crear URLs que enlazan a mensajes en tu buzón de Mail.app . Y es algo tremendamente útil y que no veo publicado en español, así que aquí pongo un pequeño resumen. Primero: de qué se trata exactamente? Pues que es un enlace que, cuando clicas en él, se abre Mail.app y te muestra el mensaje concreto que sea, en medio de tu buzón. Muy útil si por ejemplo dentro de 2 semanas tendrás que usar un mensaje que acabas de recibir: puedes usar el enlace al mensaje en iCal, de forma que la alarma que te saltará dentro de 2 semanas tiene un link que al clicarlo abre el mensaje correspondiente. La cosa es que Mail.app entiende esas URLs, y se crean automáticamente si por ejemplo arrastras un mensaje desde Mail.app a iCal. Tienen este aspecto: message:// , donde MESSAGE-ID está contenido en las cabeceras de cualquier mensaje. Y sí, es muy útil, pero Mail.app no tiene una forma directa de crear tales links. Una forma es...