Nuevo planning diario November 13, 2008
Posted by winden in Uncategorized.6 comments
- 7:50: preparar un té en modo zombie
- 8 a 9: cotilleos varios por IM con los compis de España
- 9: pa la ofi, desayuno de batido de frutas
- 9-10: coding
- 10: desayuno 2, cafelito
- 10-11.30: coding
- 11 a 12 y media: almuerzo
- 12 y media: cafelito de despues del almuerzo
- coding coding coding
- 3 y media: traslado estrategico a un sitio donde me de el sol antes de que termine de ponerse
- 6 y media: pa casa
- relax relax relax
- 10 y pico: cena
- hasta quedarme sobao: irc
Welcome to the 21th century: IPv6 all over the house November 1, 2008
Posted by winden in Uncategorized.1 comment so far
Since getting hold of an small eee for testing, one of the nagging ideas I had was to turn it into a small noiseless router for home. So yesterday I got hold of a 2nd hand 701 eee for just 100 bucks and proceeded with the rituals…
- Download the relevant debian install image
- Burn it to a USB flashdisk
- Boot and do a default install
- Install aiccu and configure my sixxs tunnel to heanet
- Install radvd and export a /64 subnet out of my /48 prefix
- Tell OSX on my laptops to autoconfigure IPv6
- Final “avoid getting mad” touch: enter the IPv6 addresses into DNS
Et voilá, now I can get native connectivity everywhere without any NAT! I’ve already configured my IPv6 addresses on my DNS servers and can ssh from any to any without problems :)
I guess a next step would be to make an ethernet bridge between my Sevilla and Dublin sites to enable seamless music / video / files streaming… a long time ago I used to use cipe for linux-linux bridges, maybe I could also move that part into the 21th century and do IPSec? ;)
An interesting presentation on improving productivity October 27, 2008
Posted by winden in in real life.1 comment so far
I was seeing a few days ago this presentation about improving team productivity, and have but to wonder about the limiting of hours worked per day. To quote the presentation (bolds are mine): “Ford chewed on this problem for 12 years and run dozens of experiments. As a result of Ford’s experiments,he and his fellow industrialists lobbied Congress to pass 40 hour a week labor laws. Not because he was nice. Because he wanted to make the most money possible. We like to think of a 40 hour work week as a ‘liberal policy’ when in fact it was hard headed capitalism at it’s finest.”
I guess this is worth translating: Como resultados de los experimentos de Ford, el congreso hizo leyes para tener 40 horas a la semana de trabajo. No por querer ser bueno con los trabajadores, sino porque asi ganaba más dinero. Capitalismo llevado al máximo.
Disconnected from home? Listen to your music! September 10, 2008
Posted by winden in in real life, Linklog.add a comment
One of the things I’ve felt missing since being an ex-patria is a lack of my own language. It is true that there is many people from all over the country, and of course I keep chatting daily with many people from home, but I still lack the immediate warm of a quick good laugh or word play in andalusian :)
It may be for this reason, then, that lately I’ve listened quite a bit more than usual to Chambao. While not the overall best sellers nor the best known, the group managed to ride the flamenco-fusion fashion quite well and gave us quite a few memorable songs.
I found out quite a few videos and even an official chambao video channel, so let me link to a few of my prefered songs like the famous ahí estas tú or pokito a poko (concert in wroclaw^poland?!?).
Just like they say…
Volveré a encontrarme con vosotros
Volveré a sonreír en la mañana
Volveré con lágrima en los ojo
Mirar al cielo y dar las gracias
ps. kudos para chambao por decidir apostar por la tecnología y permitir los videos en lugar de bloquearlos :)
Como sentirse más cerca de España cuando estas fuera September 6, 2008
Posted by winden in in real life, Linklog.add a comment
Me encuentro por el youtube unos videos del vaya semanita, y vaya si me ha gustado, ese humor puntiagudo y esas frases 100% made in spain, un ejemplo rápido:
anchon: pero maite! dios nos dijo que no cogieramos el fruto del arbol de guernica!
maite: PRINGAO! tu te haces llamar vasco? a que no hay HUEVOS de comerte la manzana?
anchon: que no? a ver trae paca y que no coja carrerilla a ver si voy a inventar la sidra!
1000% recomendable :)
Noise is dead, long live noise! August 31, 2008
Posted by winden in coding, demoscene.2 comments
Apparently Perlin noise, even the real Ken Perlin one that no demoscener ever uses due to being too compute intensive, is long dead in the high end and has been replaced by wavelet noise.
What I find really amazing is that all these variants shown on the paper describing good noise look somewhat different to the naked eye but are amazingly different when analyzed via frequencies at page 7.
I think it may be cool to try doing inverse noise synthesis by creating an spectral texture and doing an inverse frequency transform, something that I remember hearing was sometimes done for sound synthesis.
ps. paper found via the Pixar online library
Shaving bits off a float, the shiny way August 30, 2008
Posted by winden in coding, demoscene.2 comments
One of the most used tricks for space optimization on 4k intros is to mangle floating point values on the executables before compressing.
Recap on standard floating point number storage
To recap, a float is stored in memory using 4 bytes, with bit-fields packed like this:
- 1 bit for sign, s
- 8 bits for exponent, e
- 23 bits for mantissa, m
The exponent is stored with 127 added to it, so the final value is basically
- value = power(2, e – 127) * (1.0 + m)
What this means is that the exponent is used to select which bracket to use:
- e = 125 –> value is between 0.25 and 0.5
- e = 126 –> value is between 0.5 and1
- e = 127 –> value is between 1 and 2
- e = 128 –> value is between 2 and 4
- e = 129 –> value is betweem 4 and 8
And then the mantissa is used to select a number inside than bracket.
Shaving off bits
Compressor engines work by detecting repeating patterns and encoding them in non-obvious ways. The most obvious pattern to detect are strings of zero bits or zero bytes.
That can be used in our advantage: the executable or datafile will compress better if there are many zero bytes, and that is easy to do if we somehow force some bits on the float values to zero. Let’s say we blank out the 2 lower bytes on a float. That means that we end up with this floating point representation:
- 1 bit for sign
- 8 bits for exponent
- 7 bits for mantissa
You could say that this forces us to use numbers other than what we wanted, but that was already the case since floats are only an approximation. How do you store π on a normal float? You can’t, since a float is just a 23-binary digits approximation to the value we want!
I really need a value that is not available by using fewer bits… Help!
That’s so wrong it hurts, you don’t really need them for making a demo. A demo is created by faking, fudging and tweaking until it looks good. You can probably achieve what you want by mangling either that number, another number or the whole formula in a random way.
How to shave bits, the shiny way (aka “in the future the compilers will obsolete the coders”)
Ideally, we would want to automate the whole process of shaving off bytes. One of the nicest parts of C++ is that compilers can detect and eliminate operations at compile time if they can prove that the result will be the same as doing it at run time. Given C++ templates and reasonably modern C++ compilers such as gcc 4, we can try this way:
class f16 {
private:
union {
mutable unsigned int _iv;
mutable float _v;
};
public:
inline f16(float const v) {
_v = v;
_iv = _iv & mask;
}
inline operator float() const {
return _v;
}
inline operator unsigned int() const {
return _iv;
}
};
What is happening here is that we create an object from a float, and the constructor stores that value with the lower 16 bits forced to zero. As the real storage place is marked as private and thus hidden from any other code, the compiler is able to optimise it and the resulting executable only has the masked value.
How to shave bits, the reliable way (aka “compilers are evil and does things behind my back”)
A big problem with the previous method is that it depends on the compiler realizing that he can optimize the code that way. If you need to be sure that the compiler only stores truncated numbers in the executable, the easiest way is to simply never feed him numbers other than the ones that are already in the format we want.
There are two ways:
- Place the proper numbers my hand or by preprocessor macros
- Make a filter that reads the source code, detects the floating point values and outputs the code to another file with truncated numbers.
How to shave bits, the backhanded way (aka “compilers are dumb, I better fix their output afterwards”)
Nowadays the leading executable compressor Crinkler is capable of automatically truncating bits. This is done by using the name of the variable as a hint to the compressor, which dutifully takes the variable and masks off lower bits before starting to compress anything. While nice and really automatic, I’d consider this a catch-all rule and just use any of the previous techniques in addition to achieve better control of the numbers.
Relevant links:
Wikipedia article on floating point numbers
IQ/RGBA article on truncating floating point numbers by hand
in4k article on truncating floating point numbers both by hand and by script
local dns server == fast internet July 31, 2008
Posted by winden in Uncategorized.1 comment so far
Since starting to use my new home network at Dbulin, I had noticed that loading anything on the browser always took ages, and my first suspect was of course the isp-provided dns servers. So, today I’ve installed maradns a local dns resolver for my home network on my mac, and it is like… infinitely better???