Nicolás Brailovsky


A modern blog

Archive for the ‘WTF’ Category

Vacations are over

author Posted by: nico on date Aug 15th, 2011 | filed Filed under: Funny, Meta-post, Programming

Long time without updates. I guess I needed vacations from the blog. It was not the first time and it probably won’t be the last one I take, but I’m back now with another truckload of C++ ramblings and misc stuff. Like this one:

Vim: Ni! Ni! Ni! Ni!

author Posted by: nico on date Jun 2nd, 2011 | filed Filed under: Funny, Vim Tips

Even though I have vim a Vim fan for a long time there still is a lot of stuff which amazes me about this little editor,  and this thing I last learned about it is in the “ZOMG that’s so cool I’m about to pee my pants” category. Unfortunately, if I were to draw a Venn diagram of the people who may find it cool I’d have to intersect the group of people reading my blog (yes, very small) with the group of people who like Vim and Monty Python. So, here’s to the null group:

Type :Ni! in Vim and be amazed, it’ll reply back: Do you demand a shrubbery?

Just how cool is that?

 

 

Just to remind you

author Posted by: nico on date May 12th, 2011 | filed Filed under: Funny, Vim

It’s been too long since the last time this image appeared on my blog:

Truth be told

author Posted by: nico on date Mar 17th, 2011 | filed Filed under: Funny

I bet 90% of enterprisey architecture diagrams are more or less like this one.

From Geek and Poke

Vim Tip: Vigor

author Posted by: nico on date Feb 15th, 2011 | filed Filed under: Funny, Vim Tips, WTF
Oh man. Just do a search on google images for Vim + Vigor. There are so many WTF images to choose from, I just can’t decide. Apparently since Vim is the name of sexual enhancement drug or something like that, combining Vim and Vigor is a formula for fun.

Well, Vim and Vigor have a different meaning in Linux. Just do an apt-get install vigor, then run it. You’ll have lots of fun with Vim’s evil cousing, I promise.

Brillant corporate inteligence

author Posted by: nico on date Nov 18th, 2010 | filed Filed under: WTF

In the I bet somebody got a really nice bonus category, I found this one while trying to compile MySQL++ on Solaris: http://lists.mysql.com/plusplus/7811.

Don’t worry though. Now it’ll be renamed to #define ORACLE.

PS: Kind of related is the story about Oracle breaking everything after a %s/Sun/Oracle in the JVM [1], though in that case I’m more inclined to blame sloppy programmers.

[1] http://it.slashdot.org/story/10/07/28/2121259/Oracles-Java-Company-Change-Breaks-Eclipse

Stacktrace or GTFO

author Posted by: nico on date Sep 24th, 2010 | filed Filed under: Funny

Remember:

Also, because otherwise this post would be empty:

C++ linking WTF

author Posted by: nico on date Sep 7th, 2010 | filed Filed under: C++, WTF

It is a commonly accepted fact that a succesfuly compiled application serves as enough proof of its correctness, but common wisdom doesn’t say a thing about linking. If you like linker WTF moments, you’ll love this snippet. Can you guess why won’t it compile?

  1. struct Foo {
  2.     static const int x = 0;
  3.     static const int y = 1;
  4.  
  5.     int z(bool x){
  6.         return (x)? Foo::x : Foo::y;
  7.     }
  8. };
  9.  
  10. #include
  11. int main() {
  12.     Foo z;
  13.     std::cout << z.z(true);
  14.     return 0;
  15. }
  16.  

Well, it does compile (gotcha!) but it just won’t link. Yet it seems so simple… let’s add some more mistery to this WTF moment, try this change:

  1.    int z(bool x){
  2.         int t = Foo::x;
  3.         return (x)? t : Foo::y;
  4.     }
  5.  

Holy shit, now it compiles? WTF? Some more strangeness:

  1.    int z(bool){
  2.         return (true)? Foo::x : Foo::y;
  3.     }
  4.  

And again, now it compiles. WTF? I’ll make a final change, this one should give you a clue about why it won’t compile. Revert all changes back to the original code but add this two lines after Foo:

  1.  
  2. const int Foo::x;
  3. const int Foo::y;
  4.  

Though weird at first, now you should have a clear picture:

  • The first case doesn’t compiles: x and y are declared in struct Foo, yet the linker doesn’t know in which translation unit they should be allocated.
  • The second and third cases… well I’m not sure why does this compiles but it’s probably because the linker can asume in which translation unit x and y should be allocated. I’m to lazy to check.
  • In the last case we explicitly say where should x and y be. According to standard, this is how these two ints should be declared.

So, some linker strangeness. Beware, it’s easy to get trapped by this one.

Vim Sexual Care

author Posted by: nico on date Sep 2nd, 2010 | filed Filed under: Funny, Vim, Vim Tips, WTF
Vim bestows its users all sort of magical properties, among which now we can count increased sexual performance. I bet you didn’t know, but Vim can help you keep your girl happy for days without end. Don’t believe me? Check this page.

Date time WTF

author Posted by: nico on date Aug 26th, 2010 | filed Filed under: Linux, WTF

Another one to add to my growing list of bad things about Ubuntu. For some reason my clock froze. I only noticed it when it started to be dark outside, for me the time had frozen at about 17pm.