Jan 4, 2013

The end of the world is approaching...

Hi

First of all, Happy new year! :)

Last night I was surprised (upset?) for getting an offer (that I could not refuse) from a well know web site (which I like pretty much, by the way) claiming that that was my last chance to subscribe to their 1 month free premium plan.

I have absolutely no problem with the offer. What gets on my nerves is the fact that they have been sending  this very same offer for the past 6 ~ 9 months, saying each time that that was my last chance. 

Come on guys. You should already have noticed that I even went to your website and started the registration process.... you should ask yourselves why I did not finished it, instead of keeping bugging me ;)

See you!


Nov 15, 2012

Learning git

If you are a software developer you should already use some sort of SCM (if not I urge you to start to learn/use one now!). 

If you have not tried Git yet you should give it a try (but keep in mind it may take some time until you really appreciate its power).

I have been working with Git for at least 2 years and I am amazed how flexible / powerful it is. Actually it is so powerful I still learn new stuff about it almost every other day! Bellow you can find some useful resources to learn a little bit more about it:

Have fun!

Oct 15, 2012

Modern times

When I was a child (not so long ago :) I used to turn on the TV and wait for some time until it warmed up (ok, don't laugh). Exactly, it was a B&W valved tube tv.

Then, at my adolescence, my father bought us a new, shine, top technology color TV; it did not used valves any more and as a result live became better (not only I could turn the TV on and start watching my favorite programs instantaneously - or play video game - but now it had colors!!

Some more time passed (just a few years) and we fast forward to current days.

Now, after a long working day, leaving my office and walking 3 meters, I take a seat in front of my shine new, 51", full hd, 3D plasma TV, turn it on and... it takes 10 ~ 20 seconds to 
start displaying any interesting content (sure the TV maker logo appears in less than 5 secs but it is not that interesting any more)! What? Are we retrogressing ?

I really don't care if these TVs are actually computers... please tv makers, do it right! make it "boot" instantaneously, don't make me wait. I can foresee how the TVs ads will look like in the near future:
you do need to have this flub glob shob TV! It has more features than a computer scientist with a PHD is able to handle and it starts in (put some low number here) seconds!
What will be the next step? getting BSODs (calm down *nix fan boys I did not forget you ;) or Core dumps while watching TV?

You may think I'm kidding about the BSOD stuff, but I am not; for sure my cable TV setupbox already "implemented" this feature (the only deviation from the original BSOD is that you get absolutely no feedback so you are left wondering what happened and the only option is to restart it (hopping it fixes the problem); seriously, it is so crap that sometimes I need to restart it multiple times to get it working again (the cable tv support staff is so used to these issues that the first thing they ask you is to reset the setupbox :m ).

What do you think?

Oct 10, 2012

Icons, Icons, Icons....

From time to time I find myself looking for icons for my own projects....

If you ever had the same need check this out.

I really recommend it :)

Happy programming.

Sep 25, 2012

Angry user...

Sorry, I could not resist the pun :)

Well, some time ago (to be more precise 1 1/2 years ago) I've bought a (Chinese) Android Tablet so I could experiment, play games and may be try to develop some program (of course I've failed miserable to write any application for it :(. You can see a picture of the device bellow (it ended up to be much more resistant than what I expected! You can see its cracked 
screen due to 2 ~ 3 not so smooth landings - thanks to my young daughter):

Anyway, I use it regularly for reading ebooks, email reading and playing basic games. Talking about games I used to play "Angry Birds" (all free editions) on this device with no problems at all; but at some point in time something has changed and since then I am not able to play it anymore. The symptoms are always the same: I launch the game, its "splash screen" shows up followed by some screens and finally the "loading" screen shows up but then the application just dies without any trace! 


I had just accepted the fact that I'd not be able to play this game again on this device but last weekend I was recovering from a small surgery and I decided to investigate it a little bit more.


First thing I did was to install a log viewer (I'm using aLogCat) to check if I could find anything on Android logs. Indeed it was pretty easy to find the information I was looking for:


E/HttpRequestHelper( 4956): Exception from HttpClient.execute.
E/HttpRequestHelper( 4956): java.net.UnknownHostException: rovio.events.medio.com
E/HttpRequestHelper( 4956): at java.net.InetAddress.lookupHostByName(InetAddress.java:513)
E/HttpRequestHelper( 4956): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:278)
E/HttpRequestHelper( 4956): at java.net.InetAddress.getAllByName(InetAddress.java:242)
E/HttpRequestHelper( 4956): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)
E/HttpRequestHelper( 4956): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
E/HttpRequestHelper( 4956): at


Huum... ok, so the application tried to resolve the host "rovio.events.medio.com" and it failed bringing the whole app down! WTF? (I tried to access this host from my desktop and the result is the same (
Interesting enough, medio.com as well events.medio.com does exist) so I assume the problem is directly related to the subdomain "rovio" on events.medio.com.

Searching on net for this error did not bring any useful answer. Also I've tried to clear Angry Birds application data, 
re-install it and even a device factory reset (due to other issues) to no avail :(. 

Have you seem this error? Any ideas how to fix it? I doubt I am the first one to stumble on it!

Sep 15, 2012

Shopping abroad


If you by stuff while travelling abroad (more specifically to European and some Asiatic countries) you may be paying more than you need to! This is because in such countries there are some taxes that tourists do not need to pay but they are included in the product price anyway.

Bellow I show the basic steps to make sure you'll get a tax refund:


  1. Find a participant store
  2. Buy and pay (of course) your stuff
  3. Tell the clerk that you want to get a tax-refund (at this point he/she will fill a form with information regarding your purchases / you)
  4. At the airport do the procedure to get your refund.
I'll not explain all these steps in details here; instead I'll focus on how to proceed at the airport (step 4) because that was the most confusing part for me. For more information, including the complete list of countries you can check here.

Also, keep in mind that the following description is based on my own experience (mostly travelling to Germany) and it may be different in other countries (although I believe that they are either pretty similar if not the same in all countries).


So, when you get ready to return:


  1. At the check-in post inform the clerk that you have a tax-refund to claim. She/he should follow the usual procedure but instead of dispatching your bags immediately it will be handed back to you (with the baggage identification stickers on it).
  2. Now you need to go tho the customs where a custom official will check your purchases, receipts and stamp the form filled at the store. At this moment your bags will be dispatched.
  3. With your form stamped go to the "tax-free" post (usually within the board area, i.e, after the security checks) and present the just stamped form and your passport.
  4. Get some of your hard earned money  back.

Regarding refund methods I have used two different ones: i) cash, ii) credit in a credit card; sometimes the tax-refund clerk asks you which method do you want, sometimes he/she will pick one for you :)

One mistake I've made at least twice was to forget that in some flight connections you don't take your bags back at the intermediate airport. For instance in one of my travels I was returning from Germany to Brasil but my flight had a connection in France, i.e, I'd fly from Germany -> France -> Brasil. Since the instructions are to follow this procedure when you are leaving EU I planed to  do this in France, but wait, I did not got my bags back in France, so no refund for me this time. In this case I should have done the process in Germany.


BTW: Last time I got back 13 euros which represents more or less 10% of my expenses (this value may vary for each country of course).


Hope this help others....

Sep 4, 2012

C#/.Net Generic constraints

Hi

Despite having no doubt about the usefulness of type constraints in C# generics (this is a key feature to help avoiding bugs when writing generic code in C#) I always had  the impression that it should be able to express more constraints than what the C# language / compiler exposes.

Well, some
 time ago this blog entry called my attention on my RSS reader and motivated me to go and scan the .Net specification (more specifically § II.10.1.7 in the CLI Metadata Definition and Semantics document which can be downloaded from here) and to my surprise I found out that in addition to the valid C# generic constraints CLI also support constraining a generic argument to delegates, arrays and even enums! That is nice.

Next question is: does the C# compiler abides by these rules when consuming assemblies?


To answer this question I wrote a small class library (
in C#) that exposes some generic types and manually (ildasm/ilasm) added each of these constraints. After that I created one application (C#) that uses this library and confirmed that C# compiler does respect these constraints (at least in VS 2010 which uses CSC 4.0.30319.1). Bellow you can see the result of trying to use these generic types with incompatible types:
Generic parameter 'E' was constrained to enums
Generic parameter 'E' was constrained to enums

Generic parameter 'A' was constrained to arrays. 
You can download the sample application from here.

The bottom line:  Generic constrains in .Net  are more useful than what you may be lead to believe ;)

As always, don't be shy! Let me know what you think.

Hope you find this useful.