Posts Tagged ‘oddities’

20081202 The BBC accidentally reveals some source code

… in this recipe (scroll to the bottom), and here’s the question: Which programming language are they using in that piece of code?

My vote goes for Perl, because…

  • It’s a well-known, public fact that they use Perl. In fact I have even heard someone complained the version of Perl they use is so old and stagnant they had to sort of emulate new features (already existing in newer versions of Perl)
  • It can’t be PHP because of the brackets surrounding glossid
  • It can’t be Python or ruby because of the ending semicolon. Ok, you can use semicolons with Python or Ruby but it’s idiotic to do such a thing when you’re free of that tyranny
  • I also thought of some JSON which hadn’t been properly hidden, but again, why use a dollar sign to name a variable in javascript unless you’re using it for jQuery or something like that?

If anybody from the beeb wants to reveal which language is it, feel free to do that… no need to use your @bbc.co.uk e-mail in the comment ;-)

Oh, and just in case they fix this little anomaly in their system, here’s a screenshot of the page. Captured with Screengrab.

By the way, I’m so hoping their database of recipes is not built upon a ton of manually typed in hashes. For the sake of their own mental health, specially the maintainers’. It worries me that the rest of recipes I have checked do not exhibit this problem. I really hope no one has to update these pages manually.

Edit: Added “in that piece of code” to clarify the question, sorry if it was too vague O:-)

20080408 Mental note about #ifndef’s

When using #ifndef for #include guards:

#ifndef BLAH_H
#define BLAH_H

// code

#endif

make sure that #ifndef and #define are the first lines of the archive!

I had placed some comments before them and that made me lose several hours, trying to find out why class forward declarations didn’t work as they should. One could expect the compiler to ignore comments automatically but that’s not the case.

I also looked for something as #pragma once for GCC, since I remembered that from when I used Visual C++, but although it was supported at some time, it is now deprecated, so the only solution is placing the #ifndef where it must be (at the very beginning).

20080226 Xcode3 oddities

It’s been a couple of interesting days already, got ideas for something fun and I’m using XCode quite furiously. Everything began since I got SDL working with OpenGl (what derived into a Linux version of the famously rotating triangle with pink background), then a couple of weeks later I made some additions which I’m further developing now.

But… what’s going on with XCode3? It’s just me the only one which has to close it and reopen it again every X debugging attempts? or maybe that’s what the X in XCode stands for…

The symptoms are: you Build and Go (Compile and debug in ye olde jargon) and then one would expect the debugger to pop up. But nothing happens because a) it didn’t rebuild at all or b) it couldn’t attach the debugger to the process. So it runs as normal.

There’s another weird thing, sometimes I add a new method in a class header (I’m working with C++) and when I write the method body in the .cpp file and try to compile, I get a message saying that there aren’t matches with the definitions of the class, blabla. I solved this one cleaning all targets and rebuilding again, but if you know a better way of fixing it, I’m all ears.

Maybe there are hidden options which can be configured with

defaults write com.apple.Xcode AppleAnnoyances off

or something like that!

Event though, I must say that I like XCode2 way more than the previous version. If I had to choose a single reason it would be the removal of ZeroLink, then I would say the new finder, code folding, etc. (I never use its SCM features or design features so I can’t tell)

20070524 Unexpected T_PAAMAYIM_NEKUDOTAYIM

In almost every programming language, parsing errors tend to be boring, and PHP is not going to be an exception… unless you get one of these:

Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM

If you aren’t aware, what it means is “Oh, there’s an unexpected double colon where it shouldn’t have appeared”.

But even if it’s a bit obscure, sometimes it’s funny to get this error. Just for contrasting with all the plainly boring rest, like unexpected ‘}’, unexpected ‘,’ … all that. Even more funny is that those characters (‘::’) are also defined as T_DOUBLE_COLON. But why did the programmers decide to use the cryptic error message is something of a mistery for me yet.

The first time I got the error I thought I had found an easter egg! Either that, or the php interpreter had gone nuts…

20050120 Pucca, Jessica Fletcher y las pajaritas

Andaba yo -es un decir- esta mañana en el metro, de camino a St.Paul’s, meditando e intentando dilucidar si me estaba convirtiendo en una kitsch inglesa, porque empieza a gustarme la ropa de aquí, y preguntándome si algún día llegaría a vestir tan mal como las inglesas, cuando de repente me he dado cuenta de que había un chino mirándome detenidamente. Y no, no estaba mirando ninguna parte de mi anatomía… no… estaba mirando con muchísima atención el bolso de Pucca que me regaló Sardu por mi cumple. Claro, el bolso tiene una especie de dibujos, que yo nunca pensé que fueran letras en serio, pero se ve que el chino estaba tratando de entender qué ponía, por eso estaba tan atento. Seguro que era algo tal que “QWERTY” pero con letras chinas. Digo yo que de ahí su cara de “Ein??”

El bolso de pucca

Y luego a la hora del lunch -que por cierto hoy he comido tardísimo, ¡a las 14.30h!- va y resulta que la tele que en recepción, por una vez no tenía puesta las bbc news. En su lugar me he encontrado con mi vieja amiga Jessica Fletcher, es decir, el recurso más socorrido de TV3, canal9 y en general imagino que todas las autonómicas para llenar programación en verano… Ver Se ha escrito un crimen en inglés ha sido como un shock, como si toda la vida te hubieran engañado hasta que de repente te dicen la verdad… increíble, increíble… (una nunca olvida una pistola de la que se desenrolla un papelito que dice ¡BANG!).

Por la tarde, después de arreglar como media docena de bugs ajenos, apañar una serie de imágenes de un cliente indeciso (o tocawebs, como lo queramos llamar), y poner en marcha un cms y blabla, me volvía otra vez al metro cuando han vuelto a suceder cosas extrañas… De repente empiezo a ver gente con smoking… y pajarita, claro… Al principio han sido solo dos hombres, al lado de un edificio de oficinas, así que pensé que quizá eran recepcionistas o algo XD, luego paso por al lado del Museum of London y me veo como tres tíos más seguidos, vestidos con el smoking y la pajarita. Jopé que raro… bajando al metro dos más, y en el metro ya eran incontables. No sé qué tipo de fiesta rara será hoy, pero es que si ellos van con smoking y pajarita, ellas o estaban esperándolos en la sala de fiestas, o era una fiesta men-only, porque no he visto a ninguna mujer requetearreglada como los de las pajaritas.

Ya para rematar de cosas raras, volviendo por Westbourne Grove (me mola mogollón ese nombre de calle, especialmente pronunciado, es algo así como buestburnnn gruuuuub, graciosísimo xD), paso por al lado de una tienda que tiene montones de trastos para la cocina, que si cocteleras raras, reposabandejas, vamos, todo tipo de accesorio, y había delante una tía con una lata de medio litro de cerveza, descojonándose del escaparate y señalando los cacharros que más gracia le hacían. Y se reía gritando IHAAAAAAAHAHAHAHAAAAAA y enseñando los dientes como un caballo… ¡Ay qué cosas tan raras! Me he tenido que ir corriendo aguantándome la risa XDDDDDD