Hiding the bird’s guts

Probably this is a stupid rant/question. If so, please clarify me. I can live without the insults. Really :)

OK, on to the relevant stuff. Twitter has a new OAuth authentication mechanism. To write an application able to post on twitter your application need to be registered and have a consumer key. That key is used to identify your application to twitter when requesting permissions to a user to post using her credentials.

Now, the problem is when your application is written in a scripting language, like Perl, Python, Ruby or anything similar. Will you insert this key verbatim in the source code? Then, when shipping your app, others can grab that token and use it as if it were your app. You can encrypt it, but you need to ship the decryption algorithm as well, so, making the key verbatim.

One of two things can be happening: or twitter guys are not good on this API thing, or I am being totally stupid.

Scripting Intelligence – Apress

Scripting Intelligence
Scripting Intelligence

I bought this book during YAPC::EU::2010, in Pisa. At that moment I just opened the book a little, and found the index interesting. It was a book being auctioned, and therefore my investment was not only thinking in the book contents and their usefulness, but also in the help to the conference organizers.

I was surprised the book was written with examples in Ruby. Just surprised because I was in a Perl conference, and when I opened the book, it seemed like Perl. But I am happy with other programming languages, and Ruby is an interesting language.

My problem arrived when I started reading the Natural Language Processing section on the book. I’ve read a couple of paragraphs and get annoyed. The author claims that works since 1980 in Natural Language Processing, but the book contents on this subject are quite basic and not well explained.

Would like to point three aspects that annoyed me. Two of them are related to Natural Language Processing, one other just about how examples are written in a powerful programming language like Ruby:

  1. The section on stemming seems like black magic. It shows an example of an word, and the respective stemmed word. But it doesn’t explain how to perform that task. Just points to a module that implements that task. I am against this kind of book. It is crucial that the author explains the basics on how the algorithms are implemented. Otherwise the reader will not learn a thing.
  2. On the segmentation algorithm, to show that some special words can make this task difficult mentions the human names prefixes, like Mr., Dr., etc. Then, they use an array of these human name prefixes for the algorithm to work. Not a problem, that is a common approach. But not to mention that we are talking about abbreviations, and not just human name prefixes, shows a lot of ignorance. No, I can understand that the author knows that. But to get an example, and develop code just for that example, without generalizing it, seems a bad idea.
  3. Finally, I do not understand why the author needs to declare an array with the digits from 0 to 9 no match floating point numbers in a string. Doesn’t Ruby as regular expressions, or the usual isDigit method? Or, at least, methods to construct lists by comprehension instead of listing all digits?