jump to navigation

long time no see May 17, 2009

Posted by winden in demoscene, in real life, metablog.
add a comment

It has been now more than half a year since I last wrote, it’s funny to look back and see how sooo many things happened realise that time flies… so I think I’ll make a quick recap.

Christmas vacations:

Nice to have a few days of work from the comfort of the family couch, and the crazy glances when going for drinks at the Alameda at 3am with a t-shirt while everyone else was trying to avoid freezing with their jackets. The only negative point would be that I had to work during 1st Jan so I could not part all night long…

New android phone:

A nice treat for Christmas. At first it could not stay up for one complete day without going out of battery, but the new code version has improved a lot on that, and the photo application with the automatic GPS is really handy.

New blog:

I started the code for a new blog which I plan to host on my own domain, mainly motivated by now wanting to be held hostage anymore by pre-packaged systems. It’s not ready yet, but it will come for sure. At the very least I already have the code handy to slurp the contents off this blog, which is a plus.

Malaga offsite:

I had a quick 2 day trip to Malaga with my work team mates, we had lots of fun going around the city with Leunam and Niani hosting us around. Amonst the highlights of the trip were meeting Alex’s sister and the good time at the beach when both James and Kuba could not resist taking an small siesta :)

Breakpoint:

Contributed to the brokepoint sponsoring and took a good visit there… it was already almost two years since I last went to a big party, and was sorely missing it… It was nice meeting HAM, IQ, BP and all the others… for bonus points, I got to chat for a while Tron/Sanity^TRSI^Artwork of Interference fame  :)

Travel to California:

This time only for two weeks… too short trip, I think next time I’ll spend at least 1 month or so. The return was specially killer, I got so jetlagged I decided to take a few days off to cool down, which also helped plan future developments. While there I did my obligatory visits to San Francisco for drinks with Ryan/CTL, the Zeitgeist beer garden and new for this ocasion the Google San Francisco office. As improvements for next time, I think I’ll take a room at the city instead of Mountain View and also stay at least 1 month.

Social networking:

I’ve spent a bit of time tunning my Reader subscriptions and using it more and more to share links and comments. Also got back to using twitter to quickly broadcast stuff to the friends… back when I started using it almost no one nearby did so it was a bit of wasted time… now it had better value since more nearby people are already using it now…

Chromium for Linux and Mac:

The Linux and Mac versions have become stable enough that I can start to use them as primary browsers, the linux one at my work desktop and the mac one for my home laptop.

Some funky stuff is still happening: the mac version can’t load flash yet, which is good since it avoids unwelcome flashing stuff all over the screen but also means I have to copy-paste to firefox to watch youtube videos :/

Summary:

Lots of good things happened… and while I may post more frequently from now on, it is not a given… as they say on financial advertising: past performance should not be taken as guarantees of coming performance.

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…

  1. Download the relevant debian install image
  2. Burn it to a USB flashdisk
  3. Boot and do a default install
  4. Install aiccu and configure my sixxs tunnel to heanet
  5. Install radvd and export a /64 subnet out of my /48 prefix
  6. Tell OSX on my laptops to autoconfigure IPv6
  7. 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.

Garbage collecting links and other web-related chores October 12, 2008

Posted by winden in metablog.
add a comment

Today I’ve been rearranging a bit the links at the blog, mainly rearranging links and adding new ones

But while doing that, something I noticed and found amusing was that google reader has a very neat “Your stuff” page listing:

  • a neat profile complete with photo and links to other homepages
  • shared and starred posts, with a comment
  • shared notes, which is a very simple way to do blogging, with a title, a body and tags

That page is available also via RSS, so I’ve also syndicated it to the side of this blog.

Maybe it could even be made to replace the blog itself?

I find the blog keeps mixing both big posts with deep content with smaller “what’s up” posts, and maybe separating these smaller ones to the reader page would be better. But then just using the blog for posting big deep content doesn’t ring so well with the format, and maybe moving that content to a different format such as a proper webpage would be better.

All in all, I have to think a bit more about all this…

EDIT: I’ve created a homepage at google sites with a news frontpage, a links part and also a part for longer articles… let me know how you feel about that! :)

EDIT 2: Moved the homepage to my own domain :)

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:

  1. Place the proper numbers my hand or by preprocessor macros
  2. 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

Crinkler executable linker and compressor

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???