Thursday, November 15, 2007

Half backed apple

Ok, so the portuguese version of Apple Store is up, some might say not a minute too soon, but not me.

I mean, either Apple entered the Web 2.0 bandwagon of "release soon, release often" or someone should get their ass kicked. What the hell is up with this 3 language web page?

Do you speek Spanporglish? I didn't bother looking any further. That was quite enough for me.

Tuesday, November 13, 2007

An ice cream that creamed a car

This is a somewhat old story that I've read some time ago. It came up today in a conversation I was having with some co-screenies.

I had to do some googling, but was able to find a good enough recount of the story. Read it here.

toad codebits day 1 - random thoughts

Well, in and out of the first day of Sapo Codebits, or Toad, and a few thoughts sprung to mind.

I'm gonna do this the old school way of dividing in a The Good, The Bad, The Ugly sort of way, so..

The Good :
- Getting to know fellas like Diogo, Luis, the segway dude, Samuel and the lovely Mono Hacker, and meeting up with "the" PHP Man , the Python Evangelist Extraordinaire, Franc and the hacker behind some of the funniest storys I've heard and of course, the geekiest guy I know Cafonso
- Mike Culver's Presentation. That was what I was there for.

The Bad :
- The Wireless bandwidth available.
- The food.
- Did I mention the low bandwidth (well, the codebits page is kind of remeniscent of a heyday of 16k modems, but come on!!)

The Ugly :
- PT's Pulso app.
I mean, the app/system in itself looks great and seems to be a wonderful piece of enterprisey software, but PT taking advantage of Open Source Software to build a great product and then selling it? What are they giving back to the community? Bug-fixes? Is that enough for such a big company? Shouldn't we expect a little more? Ok, this is just one more reason why I don't like PT, Sapo or any of the PTM companies.

Final verdict:
- If you were there, probably you had fun. If you weren't ,don't feel too bad. It's a well over hyped event.

I'll be back tomorrow, and hopefully I'll be able to catch up again with some of the folks I've met today and be able to see some more presentations.

toad codebits day 1

Well, it seems that I made the cut after all, but I only managed to get here some 30 minutes ago.

Not all is lost, I still managed to catch Mike Culver talk about Amazon WebServices, namely S3 and the amazing EC2. As soon as I'm able I'll post an update about the talk itself and my first impressions.

Stay tuned.

Saturday, November 03, 2007

Toad CodeBits

We're just 10 days away from Toad CodeBits.



This promises to be the biggest gathering of 'tuga* code monkeys this year and I'm looking forward to being there. Although, come to think of it, I don't know if I'll actually make it. The thing is, it seems that you have to both register for the event and then make some sort of announcement and hope that you make the final cut.

That last bit seems to be a problem for me, 'cause I really don't like Sapo (the company, the search engine, the portal, the....) at all. But since I have to admit that I would really like to be there, here it goes....

If I manage to get in, I'm looking forward to hearing Mike Culver from Amazon, Marco Gonçalves (on the BSDs) and hu... wraygunn


* 'tuga is slang for Portuguese.

Wednesday, October 24, 2007

Abertura Facil

Afinal não sou o unico a ter um problema com embalagens de "abertura facil".

Tuesday, October 09, 2007

Freedom (I still think this is the end of the record industry)


08 october 2007: big news
hello everyone. i've waited a long time to be able to make the
following announcement: as of right now nine inch nails is a totally
free agent, free of any recording contract with any label. i have
been under recording contracts for 18 years and have watched the
business radically mutate from one thing to something inherently very
different and it gives me great pleasure to be able to finally have a
direct relationship with the audience as i see fit and appropriate.
look for some announcements in the near future regarding 2008.
exciting times, indeed.
posted by trent reznor at 10:45 am.


More information on the usual place

Wednesday, October 03, 2007

FASTA, betta, more

My girlfriend's sister asked for help. But all she got was a 16.

The purpose of this script is to get a file(name) as a first argument, a regexp as a second argument and then search trough the file and print out the whole sequence where any of the possible regexp values are found, being that the searched sequence itself must be identified with "<>" symbols and then do a little basic math with the elements we've found.

To try this out, save the following as (for instance) sequences.txt:

>50c's and 50t's
cccccccccccccccccccccccccccccccccccccccccccccccccctttttttttt
tttttttttttttttttttttttttttttttttttttttt
>10G's and 90A's
GGGGGGGGGGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
>A random sequence
ccagtcctgtctaaggactttggttcatgcgttaatttcggttagccagtggcgcccacg
taacaaagtgcgaccgacctgcttccatagcattgaaatgtccttgattggagattttac
gcaggaggactgataagttcgggtctgaattgatgcagcgaacgttcatccaatactcag
acttgcactcagtcg
>A second random sequence
cgcatgacggccctcctcgacggttcattaaccttgcacaccaactgttcctcaaccgat
ctggtgtctttctcacttacatagcagttgctgtaccatttgatgggaacccgagatcac
cgggttatcgcgggagtttattccgaattgttctcggaaatgtggcgtcggcttgaattg
ggaataatacggatcttgacaagcacgatttcatccacaatgcggcacgagtaatcccct
tctggaaggatgcagaaaggacatatacaatgagctagccacgtggcgcataacgcagct
tggttagaaactaaatctatacaggaagatacagaatgggaacagtgtcgctcagtctag
ccagctagatccgcctttagtcgaccttaggggtaaggca

And the below code as scripty.pl:

print "\n\n *girfriends_sister_school_id* \*girfriends_sisters_friend_school_id*\n\n";
print "filename:\n";
$filename = ;
open(TEMPFILE, $filename) or die("Cannot open the file $filename");
print "Insert the regular expression to find:\n";
chomp($regexp=);
while () {

if ( /^>/xms) {
$paragraph = "";
$paragraph_head = $_
}
if ( /^$/xms) {
push @paragraphs, $paragraph;
} else {
$paragraph .= $_;
}
}
push @paragraphs, $paragraph;
foreach (@paragraphs) {
while ( $_ =~ /($regexp)/gi) {
$expressions{$1} += 1;
}
}
foreach $key (keys %expressions) {
print "\n\nPattern = $key\n";
foreach (@paragraphs) {
if ($_ =~ /$key/) {
$paragraph_with_patterns = $_;
$total = length$paragraph_with_patterns;
$counterA = 0;
$counterC = 0;
$counterT = 0;
$counterG = 0;
if ($key =~ /a/){
while ( $paragraph_with_patterns =~ /a/gi) {
$counterA += 1;
$sum1 = ($counterA/$total);
}
}
if ($key =~ /c/){
while ( $paragraph_with_patterns =~ /c/gi) {
$counterC += 1;
$sum2 = ($counterC/$total);
}
}
if ($key =~ /t/){
while ( $paragraph_with_patterns =~ /t/gi) {
$counterT += 1;
$sum3 = ($counterT/$total);
}
}
if ($key =~ /g/){
while ( $paragraph_with_patterns =~ /g/gi) {
$counterG += 1;
$sum4 = ($counterG/$total);
}
}
$paragraph_with_patterns =~ s/($key)/\<$1\>/gi;
print "$paragraph_with_patterns\n\n";
%sum = ();
%sum1 = ();
%sum2 = ();
%sum3 = ();
%sum4 = ();
if ($counterA >0){
%sum1 = ("A", $counterA);
}
if ($counterC >0){
%sum2 = ("C", $counterC);
}
if ($counterT >0){
%sum3 = ("T", $counterT);
}
if ($counterG >0){
%sum4 = ("G", $counterG);
}
%sum = (%sum1,%sum2,%sum3,%sum4);
foreach $key_id (sort hashValueDescendingNum (keys(%sum))) {
$div = ($sum{$key_id}/$total);
print "$key_id = $sum{$key_id} \/ $total = $div\n";
}
}
}
}
sub hashValueDescendingNum{
$sum{$b} <=> $sum{$a};
}
exit;

Then run perl scripty.pl . Put sequences.txt as the file and a[c|t]g as the regexp when prompted.

I had alot of fun doing this wich is a good thing since I didn't get paid.

And no, neither bio::perl, nor any other module for that matter, were options.

Finally, a major thank you must go out to sab for the priceless (as in: he didn't get paid either) help.

Tuesday, October 02, 2007

::1

This is my new home. I won it in a City contest.





As another geek has said before, the only hard thing to do when moving to a new 127.0.0.1 (or ::1 in IPv6) is dealing with the gas company. What a bunch of pricks!

Well, anyways you're always ...

Tuesday, August 14, 2007

that's cool

Quicky:

Are you using OS X to develop the next big Rails app and need ImageMagick, RMagick and friends?

Well, just point your browser to rubyforge and download the rmagick-osx-installer package, unzip it and read the fine manual. If you have all the pre-requisites, "sudo run" the installer script and then... go out for a coffee.

When you're back you'll have the following log in your terminal windows:

libpng was installed successfully
libjpeg was installed successfully
ghostscript was installed successfully
ghostscript-fonts-std was installed successfully
FreeType was installed successfully
libwmf was installed successfully
ImageMagick was installed successfully
RMagick was installed successfully
Removing rm_install_tmp directory...Done

That simple.

Thursday, August 02, 2007

Rediscovering the desktop

As you might have noticed, I've been on a rather long break from my blogging activity, and again this was due to my Mac being broken. Again.

It's not like I didn't have a replacement (my old trusty Asus M6N), but as I've said before, i get depressed when my Mac brakes. And it just happens oh so many times.

Anyway, the downside, apart from the depression bit, was that I missed the opportunity of ego-blogging about the brand new Ruby-Lang Portuguese site .I'm very proud of being a part of the amazing team behind it, and sincere kudos must go out to Emanuel and Franc.

On the upside I had the chance of rediscovering Linux on the laptop!
I'm lucky that my Asus is a pretty linux-compatible, but with the new Ubuntu 7.04, everything just works. That includes wireless, the extra (media) buttons, the compiz powered desktop effects, the works.

Now, I've been known to prefer Suse/Novel over any Debian based system for users and user-grade hardware, but Ubuntu has been making such an extraordinary evolution that it has (for all that I care) become the de facto distro for desktop use. It just gives you roughly 70% you'll need from the first boot, and the rest you'll get with Automatix. For a little more specific usage needs, the excellent Aptitude app will do the trick. You'll never get so much for so little!

Anyway, here's a little list of apps I've been (re)discovering:
Aptana + RadRails (Netbeans, eat your heart out!. Thankfully its cross-platform);
F-Spot (will give iPhone a run for its money any day);
Songbird (think iTunes minus clutter);
Gnome-Launch-Box (it's a Quicksilver clone, gets the job done);

And a list of what I miss:
Integrated Dictionary just a shortcut away;
Textmate (it was growing on me...);
Dashboard (what? I love eye candy...);

That's not so bad is it?

Tuesday, July 03, 2007

Making the enterprise see red - part I

Ruby trough Rails has been a poster-child for the so called web 2.0, but in the enterprise level the adoption rate hasn't been all that remarkable.

Rather than go trough an extensive diatribe about how adoption rates in the enterprise for just about any open source technology is always necessarily slow, because no self respecting OSS programmer plays golf, I'll just list some of the perceived weaknesses and shortcoming usually attributed to Ruby.
- Contrary to Perl, it doesn't come installed by default on just about every Unix-like OS;
- The treathing model used is week;
- Rails doesn't scale;
- It's just a fad, and it will go away before it matures;
- Poor Unicode support;
- No single good IDE and Text Editors are soo 80's;
- Nobody wants to learn yet another language especially when there is close to 0 employability for it;

While most of these are (at least to some extent) true, there are many projects that aim at overcoming them. And Ruby itself is still just version 1.8.6 at this point.

One such project seems to be catching enough wind behind it so that it could drive Ruby into mass (wishful thinking here...) adoption. JRuby.

Now, one might expect that the "J" would stand for Japanese, but remarkably it stands for Java. Isn't that ironic? Ruby is sometimes hailed as "What programmers should be using to still have time for a personal life" contrary to Java's "Write once. Then again, Just one more time... Ok, call your mom and cancel dinner" motto.

Jruby (which just recently reached the 1.0 mark) is a pure Java implementation of Ruby, and it's developed by Thomas Enebo and Charles Nutter with Ola Bini also being credited here and there, and, to some extent, sponsored by SUN. It aims at being more that just another implementation of Ruby (not that there are many...) which means that while still programming in pure Ruby, a coder can now enjoy the following added benefits:
- Java's scaling capabilities since Ruby code now runs inside a JVM which means parallelization in multi-processor setups ;
- An optimized Database connectivity with JDBC;
- Same level of Java's Unicode support;
- Garbage Collection handled by Java. (don't we all appreciate that?);
- A great IDE (Netbeans 6. Packed with all typical goodies plus code completion and a Swing Form Builder, it just might be the VB6 of the XXI century), plus a pretty good one (XCode + a hack);
- Access to those millions of lines of code in Java classes;

And last but not least : Integration. This is the one that's going bring it home.

With Jruby and a rails plugin called GoldSpike (previously rails-integration) we're a simple rake command away from turning any Rails app into a standard WAR file, which in turn can be deployed in either Tomcat or Glassfish or presumably just about any other applet container.

What this means is, in an enterprise environment where you have all these layers (think MVC in different LAN segments) set up and where any innovation is foreseen as potentially disruptive if not outright forbidden, we can easily introduce Ruby and Rails code, and from a manager's point of view its a win-win situation where the developers get things done faster, and the implemented structure is maintained without any hiccups. And they still get Sun's level of support.

In parts II and III I'll be showing some code and examples of rapid deployment with JRuby.

Monday, June 11, 2007

The Automator

I've always been one to dislike repetitive tasks. I think it's partially because I find it hard to concentrate for a long time on tedious chores and partially because I fear getting carpel tunnel syndrome.

Just this weekend my "disability" was put to the test. I found myself going trough 8 GB of assorted files (note to self: do _not_ label zipped backups "stuff"...) trying to find a couple of pictures I wanted my girlfriend to see. I didn't know the filenames (note to self: rename the pictures I like because PIC00731 or DSC00239 aren't real _names_) or the time stamps.

Know, if I was "doing" Windows, I would pull out one of my 50+ lines VBS's, but that wouldn't get me no lollypop. I might had tried a bash-slash-perl trick to move only a couple of selected filetypes onto a new folder, but that wouldn't get me too far either since I would still need at least one more action to open all of them. And my girlfriend would leave before waiting for me to get the script right....

The solution ended up being my new favorite Mac OSX app. Automator.

Automator comes bundled with OSX 10.4 and basically it's a tool that provides you with a way to visually set up a group of actions that get a specific job done. And they call it a workflow, which pretty much sums it up.

Although you would use it to build a program, the programming background needed to use is zero, and the learning curve is neglectable.

After analyzing my specific needs, I came up with this list of necessary steps:
1 - specify the main folder;
2 - get the folder contents, repeating for each of the subfolders;
3 - filter the specified finder items by file type;
4 - decide what to do with them, in this case, I wanted to open the images in Preview so i could see them and find the ones I really needed.

And this was what I got:

Not bad huh?

By selecting and dragging the specific actions from the action list on the left to the right side pane and then changing a couple of options I was done! I saved it as an Application, runned it and 2 minutes later I was seeing the images trough Preview's Slideshow feature.

Wednesday, June 06, 2007

tiananmen e o "massacre" de berlin. em perspectiva


Fez esta semana anos que estudantes e outros bebados se juntaram numa manifestação sem precedentes na praça de Tiananmen para gritar pelo benfica e lutar pela democracia na china. Também fez anos a Angelina Jolie, mais merecedora de manifestações e apelos, mas muito menos interessante enquanto fenomeno social.

Em Rostock esta semana houve (uma vez mais) confrontos numa manifestação organizada como protesto anti-globalização, o que prova que quase vinte anos depois e a quase meio mundo de distancia, um pais moderno e democratico também consegue atiçar a policia sobre jovens manifestantes e tudo em nome da defesa daquilo em que acreditam. Se não é a ordem e disciplina chinesa, então que seja a democracia capitalista ocidental.


Este semana morreu um blogger, um fotografo, um amigo, um professor, um ser humano de fazer corar de humildade qualquer palerma que se ache com alguma piada ou que julgue perceber alguma coisa sobre alguma coisa.

Não há ninguem que tenha frequentado o IADE (ou que conheça alguém que tenha frequentado o IADE) que não tenha ouvido falar do Prof. Roberto.

A sua perda é irreparavel, mais de 600 comentários no seu ultimo post e a multidão no seu velório ontem á noite dão-me razão. Muitos mais nunca o esquecerão.

morabeza roberto!

Saturday, May 26, 2007

On job offers and career management pt II - The end is the beginning is the end

Well, after much consideration and hearing lots of opinions (which I respectfully considered and discarded) I've decided to stay at my current job for now.

You know, sometimes it's not just about the money for me. I would miss the friends I've made (I can't believe I keep calling my coworkers "friends") and I would miss Solaris. And AIX, and Informix and Perl and... and to be completely honest, the offer wasn't all that you know? I mean, I actually heard the words "We only sell Microsoft technologies because if we didn't they would badmouth us to our potential costumers" and _that_ is something I want to stay away from.

And yeah, the title of this post is a reference to "batman and robin", because that's how I feel sometimes when I'm working with likes of "no-time-to-blog"er, penantes, "still offline" sab and "blogui? isso não é da SUN não" alex.

...And I _do_ mean the fellowship part, not the homosexual connoted male in tights thing, ok???

Thursday, May 24, 2007

+1

Tuesday Penantes switched.

I'm counting the number of "converts" I've brought into the light ... does anybody know how many I'll need so I get a free toy from Steve?

Tuesday, May 15, 2007

Some people are just... different!


"As the climate grows more and more desperate for record labels, their answer to their mostly self-inflicted wounds seems to be to screw the consumer over even more. A couple of examples that quickly come to mind:

* The ABSURD retail pricing of Year Zero in Australia. Shame on you, UMG. Year Zero is selling for $34.99 Australian dollars ($29.10 US). No wonder people steal music. Avril Lavigne's record in the same store was $21.99 ($18.21 US).
By the way, when I asked a label rep about this his response was: "It's because we know you have a real core audience that will pay whatever it costs when you put something out - you know, true fans. It's the pop stuff we have to discount to get people to buy."
So... I guess as a reward for being a "true fan" you get ripped off.

* The dreaded EURO Maxi-single. Nothing but a consumer rip-off that I've been talked into my whole career. No more.

The point is, I am trying my best to make sure the music and items NIN puts in the marketplace have value, substance and are worth you considering purchasing. I am not allowing Capital G to be repackaged into several configurations that result in you getting ripped off.

We are planning a full-length remix collection of substance that will be announced soon."


Posted by Trent Reznor, as seen on : http://www.nin.com/tr/default.aspx

Saturday, May 12, 2007

FARM project (*)

You might have heard me drool about having helped implement the first Rails app at work.

If you read this blog regularly, you might even know that this was a project done in collaboration with penantes.

Now, what has been missing is an overview of the technology used and a brief explanation thereof.

The project itself is little more that a web-based front-end to penantes's voodoo-like perl scripts and it's purpose is solely of giving interested parties a better view of the spell's script's results.

Well, we had an old Dell Poweredge laying around, so that was the machine used. It had an ancient implementation of Red Hat 8 (actually. I think it was vd who installed it) so that had to go. Not so much because it was old, but because it was Red Hat. And no noticeable services running around so a clean install it would be.

For OS we chose FreeBSD. We wasn't our first choice, but Ubuntu didn't correctly recognize the SCSI controllers and the openSolaris DVD was well...a DVD, and Debian 4 was late. The machine at this time didn't have a working network connection and only a CD drive for media. Since FreeBSD is a distant cousin from both Solaris and Mac (I just had to bring this up) it was the next best thing.

The install was easy enough and the software available was pretty much all we needed.
For web serving we have Apache, for database we used Mysql, and has i've said, we used Rails for development. And apart from configuring Apache with fcgid which is a hole new post subject, everything runs just fine for now.

Recommended reading Rails on FreeBSD wiki page.

(*) in case you didn't notice....
FreeBSD
Apache
Rails
Mysql

27th birthday

My favorite birthday presents:







Wednesday, May 02, 2007

i can't do what???

09F911029D74E35BD84156C5635688C0

or if you prefer...

0x09F911029D74E35BD84156C5635688C0