nunojob:~ dscape/08$ echo The Black Sheep

Archive for the ‘Software’ Category

myAmbrosio

Para aqueles que andam sempre atentos as novas startups aqui está mais um projecto inovador acabadinho de sair da Universidade do Minho. Apesar de o projecto ainda estar muito verde os autores já contam com algumas parcerias importantes, assim como o sempre necessário apoio financeiro.

A ideia por trás do Ambrosio é um agregador de produtos/lojas de comercio tradicional, servindo este como veiculo de promoção das lojas/produtos e fornecendo aos utilizadores finais produtos que, por exemplo, não conseguem comprar num Hipermercado perto de si. Outro tipo de mercado que se pode abrir é certamento o do turismo rural através de, por exemplo, uma sugestão de onde dormir, onde comer ou indicação de onde estão a decorrer as festas tradicionais da terra.

Caso estejam interessados no conceito podem ver o video explicativo acabadinho de sair e contactar os autores com sugestões.

Summer School CDDIP 2008, Struer, Denmark – Selected!

I was selected for all paid trip Struer (Denmark) representing University of Minho – Portugal in the Summer School CDDIP 2008 Erasmus IP program. As far as I know at least five lucky Portuguese students will attend.

But what is CDDIP? CDDIP stands for Conceptual Design and Development of Innovative Products and the goal is to facilitate better interdisciplinary and multidisciplinary collaboration for BSc and MSc students with different technical backgrounds.

If you are from another country and you are also going you can leave me a comment. See you there!

Devolvam as passwords aos vossos utilizadores com Ruby on Rails 2.0

Uma coisa que me chateia imenso nas webapplications de trazer por casa – traduzindo aquelas que são feitas por colegas meus ou por outros amadores pela web fora – é o facto de guardarem quase sempre as passwords na base de dados em plaintext. Acho que não tem o direito de saber a password que uso, nem que a use exclusivamente nesse site (como é o caso)

Assim, se quem fez a aplicação for mal intencionado, pode simplesmente obter a vossa password escrevendo

select * from users where user.username = 'nick'

Mas mesmo que não sejam mal intencionados, outra pessoa pode aceder a base de dados. Ou podem simplesmente não se ter protegido contra sql injection. Há um milhão de razões pelas quais nunca se deve guardar as password em plaintext, sendo que a principal deles é o facto da password não ser vossa. É do utilizador. E isso faz toda a diferença! Não acreditam em mim certo? Estou a exagerar.

Convido-os a visitar esta página

Agora procurem por ‘qualquer_coisa. O resultado é

  • Pesquisa por “\’qualquer_coisa”:

Este \’ é importantíssimo pois significa que a página se esta a proteger contra ataques de sql injection. Caso contrario um hacker podia, com alguma sorte, obter informação privilegiada que estava contida nessa base de dados.

Mas ninguém faz um erro destes, certo? Errado. Vamos ao google e procurem php em páginas de Portugal. O sexto resultado, e único que testei, é a associação nacional de farmácias. Se procurarem por ‘qualquer_coisa o resultado é um não tão surpreendente erro. Isto é um exemplo de milhares, alguns dos quais onde vocês inserem as vossa password (e sabe-se lá o que mais) diariamente. Não se sentiam melhor se soubessem que nessa base de dados não está a vossa password?

Mas voltando ao assunto, a táctica que vou usar consiste em usar um algoritmo de one way hash chamado SHA. O utilizador, quando se regista no site, insere a sua password. Esta é processada (num processo que se chama de digest) para uma hash que contém não a password mas sim a encriptação dessa password em SHA. Como SHA é um algoritmo de one-way-hash, é fácil obter a hash única para qualquer palavra mas quase impossível de decifrar no sentido inverso. Para ser suficiente, mas não é.

Comecemos por ir para a consola do rails. Entrem no terminal e naveguem até onde tem a vossa Ruby on Rails web application. Agora escrevam.

./script/console

Quando lá estiverem podem verificar que aplicando este algoritmo a palavra porto obtemos sempre a mesma resposta.

>> password = 'porto'
=> "porto"
>> Digest::SHA256.hexdigest(password)
=> "01735c5ff1608734e4c38449a00b74bb9a8d5423ed548238da70178e9e803483"
>> Digest::SHA256.hexdigest(password)
=> "01735c5ff1608734e4c38449a00b74bb9a8d5423ed548238da70178e9e803483"

Não sei se repararam mas o nosso utilizador usa uma palavra pass muito fraca. Isto vai fazer a diferença, por o hacker pode obter a password facilmente se tiver a hash.

Como? Sim eu disse que era muito difícil crackar o SHA, alias não conheço ninguém que o tenha feito. Ninguém conhece :P

Mas o hacker pode pegar numa lista de palavras comuns nas passwords e, para cada uma das palavras associar a hash correspondente. Agora se tiver a vossa hash pode comparar com o dicionário que criou descobrir algumas das passwords da base de dados, aquelas que estavam na lista de palavras comuns.

Para resolver este problema usamos um salt. Um salt é também uma palavra (como a vossa password) que sera usada para evitar esta técnica. é mais simples mostrar que explicar, e por isso mesmo:

>> password = 'porto'
salt = [Array.new(6){rand(256).chr}.join].pack("m").chomp
>> salt = [Array.new(6){rand(256).chr}.join].pack("m").chomp
=> "19L6gVcD"
>> salt = [Array.new(6){rand(256).chr}.join].pack("m").chomp
=> "CqEVe632"
>> password = 'porto'
=> "porto"
>> Digest::SHA256.hexdigest(password + salt)
=> "c017e1c49096149097050c76f0406dce9245058e0d..."

De certeza que o hacker não vai procurar pela string portoCqEVe632 e, portanto, os nossos utilizadores estão seguros. Caso queiram saber um pouco mais sobre o que se passa no criação do salt, e que é aquele pack(‘m’) peçam nos comentários e eu escrevo um artigo sobre isso. Senão nunca mais saio daqui! :P.

Agora surge a pergunta, como usar esta informação em rails. Simples.

Vamos começar por criar um projecto:

rails secureusers && cd secureusers

Agora precisamos de criar o modelo de utilizador

./script/generate model User username:string \
  password_hash:string password_salt:string
rake db:migrate

Abram o vosso User.rb model, apaguem o que lá tem, e insiram o seguinte código

require 'digest/sha2'
class User < ActiveRecord::Base
# usei o attr_accessible em vez do
# attr_protected :password_hash, :password_salt
# porque é boa prática em Rails usar o enabled para 
# os campos acessíveis e não o contrário.
#
# Imaginem que tinham um campo isAdmin e se 
# esqueciam de por no protected.
# Ao dizerem que enabled só o :username impedem 
# o acesso a todo e qualquer outro campo,
# excepto aqueles que foram explicitamente 
# escolhidos por vocês.
  attr_accessible :username
  attr_accessor :password

  def before_save
    unless password.blank?
      salt = [Array.new(6){rand(256).chr}.join].pack("m").chomp
      self.password_salt, self.password_hash = salt,
      Digest::SHA256.hexdigest(password + salt)
    end
  end

  def self.authenticate(username, password)
    user = User.find :first,
        :conditions => ['username = ?', username])
      if user.blank?
        raise "O utilizador não existe"
      elsif Digest::SHA256.hexdigest(password + user.password_salt) != user.password_hash
        raise "A autenticação falhou"
      else
        user
      end
  end
end

Usei o attr_accessible em vez do protected porque considero esta uma boa practica. Prefiro dizer quais os campos acessíveis que quais os que se deve proteger. Assim não corro o risco de me esquecer de proteger algum campo. E os que são para ver nota-se bem quando faltam :P Podem ler mais sobre isto aqui.

Depois de toda esta explicação o código deve ser muito facil de entender. Até para quem não sabe Ruby. Vamos testar?

>> nuno = User.new
=> #<user id: nil,
  username: nil,
  password_hash: nil,
  password_salt: nil,
  created_at: nil,
  updated_at: nil>
>> nuno.username = 'nuno'
=> "nuno"
>> nuno.password = 'porto'
=> "porto"
>> nuno.save
=> true
>> nuno
=> #</user><user id: 1, 
  username: "nuno",
  password_hash: "c490ea11d96be24ece2ca0dba11d84fc9b...",
  password_salt: "V+b7Sqjh",
  created_at: "2008-02-12 19:28:54",
  updated_at: "2008-02-12 19:28:54">

E agora autenticar:

User.authenticate 'nuno', 'porto'
=> #</user><user id: 1, 
  username: "nuno",
  password_hash: "c490ea11d96be24ece2ca0dba11d84fc9b...",
  password_salt: "V+b7Sqjh",
  created_at: "2008-02-12 19:28:54",
  updated_at: "2008-02-12 19:28:54">

Fixe. É so por no session[:user] ;) Para finalizar aconselho-vos vivamente a suportarem open-id para o processo de autenticação dos utilizadores. Existem plugins muito bons que o fazem, e podem ler mais sobre open-id no seu fantástico guia supersónico.

Working different models in the same form on Ruby on Rails

Well it’s been a heck of a week, loving somethings on rails and hating others :P

Anyway I had a problem with working with different models on a form. If you are having the same kind of issues I’ll give you some pointers:

My notes file is so big I think I’ll never solve all those issues. *g* Anyway another pointer I can give you is to check out haml. I didn’t used it but it sure is simpler than html.

Skitch Invites (Mac OS X only)

I have been receiving some emails asking me how do I create these images. Well I use Skitch, which is one of my favorite Mac OS X apps (along with Books, Textmate and iSync). Unfortunately it’s still invite only.

Anyway if your interested in giving Skitch a try just leave a comment in this post, and I’ll send it to the email you provided as soon as possible.

Screencast app for Mac OS X Leopard

I’m looking for the best screencast software (sound recording is a must have) to run on my MacBook.

So far I found the following software:

From what I have read so far it seems iShowU gathers most of the preferences. But when a app is prefixed by an i mac users seem to love it immediately.

Anyone tried any of these products? What are your thoughts on them? Which one would you advice me to use?

[EDIT: Currently I have tested most of these products and I'm using iShowU and KeyCastr]

MacBook OS X Leopard Tips: Controlling the fan speed with Fan Control

I use my computer for something like 6 hours a day so it’s bound to get hot. I didn’t like the apple scheme for the fans that consists basically in making no noise until it’s hot and then make a lot of it.

So I looked for a open-source application to help me control the fan rpm and found Fan Control. I wouldn’t even post this if not for one simple fact: The source is included in the dmg file. Good job guys!

É um ultraje!! Google shame on you!

Vão ao google e procurem Avast. Agora cliquem no primeiro link patrocinado e saquem isso. Tentem instalar. Por incrivel que pareca, sendo que o avast é um antivirus com uma versão gratuita e bem maneirinho, vão vós pedir que enviem uma mensagem por dois euros para pagar a aplicação.

Isto trata-se, como me parece evidente, de um esquema para fazer as pessoas pagarem por algo que é gratuito. O Google permite que este tipo de iniciativas se espalhe colocando-as a frente de um utilizador incauto!? São estes os clientes da Google!? Eu preferia ser pobre.

NUNCA MANDEM MENSAGENS A PAGAR 2 EUROS POR SOFTWARE. O SOFTWARE NÃO CUSTA 2 EUROS!

Pelos menos eu gosto de pensar que não! :)

Faz-me lembrar de algo que o meu pai recentemente me disse para ler:

Discurso sobre o Filho da Puta
Alberto Pimenta

o pequeno filho-da-puta
é sempre
um pequeno filho-da-puta;
mas não há filho-da-puta,
por pequeno que seja,
que não tenha
a sua própria
grandeza
diz o pequeno filho-da-puta
no entanto, há
filhos-da-puta
que nascem grandes
e
filhos-da-puta
que nascem pequenos,
diz o pequeno filho-da-puta.
de resto,
os filhos-da-puta
não se medem aos palmos,
diz ainda
o pequeno filho-da-puta.
o pequeno
filho-da-puta
tem uma pequena
visão das coisas
e
mostra em
tudo quanto faz
e diz
que é mesmo
o pequeno filho-da-puta
no entanto,
o pequeno filho-da-puta
tem orgulho em
ser
o pequeno filho-da-puta
todos
os grandes filhos-da-puta
são reproduções em
ponto pequeno
do pequeno filho-da-puta,
diz o pequeno filho-da-puta.
dentro do
pequeno filho-da-puta
estão em idéia
todos os
grandes filhos-da-puta
diz o pequeno filho-da-puta.
tudo o que é mau
para o pequeno
é mau
para o grande filho-da-puta,
diz o pequeno filho-da-puta.
o pequeno filho-da-puta
foi concebido
pelo pequeno senhor
à sua imagem e
semelhança,
diz o pequeno filho-da-puta.
é o pequeno
filho-da-puta
que dá ao grande
tudo aquilo de que ele
precisa
para ser o grande filho-da-puta,
diz o pequeno filho-da-puta.
de resto,
o pequeno filho-da-puta vê
o engrandecimento
do grande filho-da-puta:
o pequeno filho-da-puta
o pequeno senhor
Sujeito Serviçal
Simples Sobejo
ou seja, o pequeno filho-da-puta.

From Ubuntu/Windows to Mac OS-X Leopard

I just got my first brand new MacBook and, as one would expect, some problems emerged by leaving my usual OS combo (Ubuntu/Windows) for Mac OS X Leopard. I’m still undecided whether to install Ubuntu or use VMWare Fusion to use Linux. As for Microsoft Windows as long as I don’t need to use .NET I don’t think I’ll install it. Not even with the free licenses Microsoft provides University of Minho students.

First I had to decide what to install:

The question you are probably asking is why Firefox instead of Safari!? Because the damn unsafe add-on for del.icio.us is just that: del.icio.us! I just can’t live without it. Maybe if the guys over there worked the basics of security we could say that it’s both excellent and safe! And don’t say there’s a add-on for Safari as well. I’ll only accept it if the add-on is as good as the one provided by Yahoo.

Now we go for the fun part. The problems and solving them. Your attention please, this is only fun for me when I do it on my computer so it won’t be pleasure if you ask me to fix your computer! Joana this one is for you, I know how your mind thinks.. Almost as badly as mine. Oh well, we are related aren’t we? :\ Please release those crazy Christmas photos to the world! :X

I’ll start with a small OS free tip and then go for the Q/A part. If you are Portuguese like myself you just hate all the results that google gives you from .br domains. Most of the results are overrated and most of the times you just wish that they weren’t there. If this is the case just do your normal search in google but write -br in the end. Just test this, go to google and type governo brasileiro -br. It works ;)

  1. How do I get my mouse to behave like a normal one by removing this dreadful acceleration?

    Easy. Check Rúben’s blog @
    http://blog.0×82.com/2007/12/mac-os-and-usb-mouse.html

  2. What’s wrong with the encoding on TextEdit? The automatic descovery does not work and even when I specifically tell him to use this encoding it won’t work. The Where is ISO 8859-15 dilemma.

    Still don’t know. Anyone? If you want to test the bug just do this (from here):

    $ echo é > ~/a.txt
    $ cat ~/a.txt
    é
    Open a.txt with TextEdit and get:
    È

    Cracked it! At least I have a partial fix for Migrating documents from Ubuntu to Mac OS X Leopard:

    cmd + space terminal enter

    {go to the directory where the file is}

    bash$ iconv -f ISO-8859-15 -t UTF-8 {filename} > UTF8-{filename}

    For me it was:

    bash$ iconv -f ISO-8859-15 -t UTF-8 Pam.tex > UTF8-Pam.tex

    And yes PAM is as in Pluggable Authentication Modules. So I have a latex work on that :P

    
    
  3. Where is type-a-name application? It’s not on the dock.

    Just press cmd + space and type what you are looking for. This is called spotlight. Either this or open Finder and go to applications.

  4. Why doesn’t it show my dashboard when I go to the left/whatever corner?

    Have you even configured your mac? Common.. Click the apple on the top left corner and go to System Preferences. Exposé and Spaces. And now that you are there take a look around and configure all the other things that you neglected.

  5. This computer is always underlining the words in red. (when the spelling is right :P If not you are a dumbass for asking this!)

    Just press cmd + mouse and change the language. Thanks Nuno Veloso from Apple Tech Team for this tip.

  6. How can I see the right mouse button menu?

    crtl + mouseclick

  7. PageUp/PageDown!?

    fn+ up
    fn + down

If after this you still feel like reading about Mac OS for rookies – like myself – you can check this section in Arun Gupta’s Blog or check this extensive list of Keyboard Shortcuts. Have fun!

Now let’s get back to work, something almost impossible when your doing a report on LaTeX and the encodings are never right.

One final touch: ctrl + alt + cmd + 8. Merry Christmas! :)

Ruby on Rails vs Java

Featured DB2 Student Ambassador

Featured IBM DB2 Student Ambassador

I’m really happy to announce that I was selected as featured DB2 Student Ambassador on IBM website. I really would like to thanks Vítor Rodrigues for all the help, for being a my DB2 mentor and most of all a good friend! I also feel obliged to mention the work of the other DB2 Ambassadors that have helped to establish the first Portuguese DB2 Study Group. So Simão, Hélder, João, Nuno and Marcelo thank you :) Finally I would like to thank the support of CeSIUM and CAOS, two students organization that I am a part of and that provided the hardware and know-how that made the site, blog and DB2 server a reality.

I hope that with this many Portuguese students like myself see that your work can be recognized – even by industry leaders like IBM – if you just go the extra mile. So do it! It’s your life, live it to the the fullest.

Para ser grande, sê inteiro: nada
Teu exagera ou exclui.

Sê todo em cada coisa. Põe quanto és
No mínimo que fazes.

Assim em cada lago a lua toda
Brilha, porque alta vive

Ricardo Reis (Fernando Pessoa)

Melhor Cliente SVN para Windows

Ando a procura de um cliente SVN para Windows.

Sugestões?

[EDIT: Diogo Gomes não usar Windows não é uma solução. Um informático desenvolve onde têm que e não onde quer :P]

Resultado Actual:

  1. TortoiseSVN com quatro votos
  2. RapidSVN com dois votos
  3. SmartSVN com um voto

Diffie-Hellman Java Implementation

Diffie-Hellman is a cryptographic key agreement algorithm that allows two parties that have no prior knowledge of each other to jointly establish a shared secret key over an insecure communications channel. This key can then be used to encrypt subsequent communications using a symmetric key cipher.

We were asked at cryptography classes to develop such algorithm using the core java libraries. I made a little test – I think they call it jUnit – to prove that both famous Bob and infamous Alice share the same dirty little secret.. :)Source:
http://nunojobpinto.googlepages.com/diffie-hellman.zip
[EDIT: As Ruben pointed out Diffie-Hellman is vulnerable to man-in-the-middle attacks. This is a purely academic work and - despite the brilliance of the response - is not intended to be used as is. If you want to learn more about this maybe you should read about station-to-station and certificates. In Portuguese you can use the resources given to cryptography masters students at University of Minho]Also if your using Netbeans IDE 6 you are probably noticing that the themes SUCK. I don’t even mean this as it’s not eye-candy, I really mean they hurt the eyes and I am already using glasses due to the overwhelming amount of time I spend at my laptop.To surpass this I advise you to download these files:

Now open your very own Netbeans IDE – wait 10 minutes for it to start – and then go to:

  • Tools -> Plugins -> Downloaded -> Add

Now add the two files you have just downloaded and change the theme in Tools -> Preferences and you are ready to go.

Chaos Theory: The Butterfly Effect [Lorenz Attactor]

I was asked to deliver some work on chaos theory and my group choose Lorenz Attractor as object of study. It’s a really nice chaos function as you can learn in the wiki page dedicated to the subject.The work was developed in OpenGL but I’m pretty sure that it would have been easier to do so in PovRay. Ok, bad joke :PI found some useful links for OpenGL Beginners from IST (here) and UMINHO (here). If you are just learning OpenGL give them a look. (Portuguese only, sorry)If you want to give the application a try download the sources at
http://nunojobpinto.googlepages.com/isdGL.zip
and compile them. You’ll need GCC, build-essentials and – who would of thought? – the OpenGL libraries.It’s all explained in a slightly demented readme file. Have a nice week!

Netbeans 6 RC2 Uninstallation Issue

Well i have been using Netbeans IDE Beta 1 for some time now.

I was using it to develop some Ruby on Rails projects. Some days ago I was in cryptography classes and tried to use the Apache Tomcat support for the Netbeans Beta 1. As I found out there was some bug in my way I decided to download the new RC2 and see if the issue got fixed in the meanwhile.

That when I first tried to uninstall Netbeans Beta 1. I got this error and still don’t know how to fix it. So I submitted it to Netbeans Community as a bug.

Anyone with the same problem got it fixed?

[UPDATE: Solution here]

I know that I have recently said that Netbeans has the best support to work on Ruby on Rails. It does. But just don’t use the beta. It’s crappy. If your on 512mb of RAM like me your computer will hate Netbeans Beta. I don’t even know if they will ever get this fixed. (Maybe a lightweight version of Netbeans is in order)

Is there such thing as the perfect IDE? We should be focusing on developing not on the IDE.

Bye bye Hotmail!

Hoje estive a ajudar a minha prima a configurar o seu gmail para gerir as outras contas de email que ela usa.

Para quem não sabe o gmail permite receber emails de contas IMAP e POP3. Ou seja, muito basicamente podem usar o vosso gmail como se fosse um cliente de email normal (ex: Thunderbird, Outlook). Deste modo conseguem centralizar todas as contas de email que têm num só sitio.

O problema surge quando ela me perguntou se “não dava para por o hotmail“. Como seria de esperar, não. Ou melhor, não directamente. Apenas é possível se recorrermos a serviços externos para o fazer. Serviços esses que são pagos. Serviços que não deviam sequer existir.

Mas existem, e existem porque a Microsoft assim o quis. Optaram por desenvolver uma plataforma de email que não se pode aceder de outra forma que não pelo site deles. Não o fizeram por descuido, claro, fizeram porque é a estratégia da empresa. Para a Microsoft nunca existem regras nem standards, existem sempre interesses. Os deles.

A destruição é o modelo de negocio.

Eu sou jovem. Talvez por isso ainda acredite na criação como modelo de negocio.

Hotmail Account Deleted

Por estas razões optei por apagar as minhas contas hotmail. Sei que a Google não é assim tão diferente da Microsoft, basta ver que não incluiram o Facebook no OpenSocial, mas ao menos quiser ver o meu gmail noutro sitio posso.

Basta querer.

DB2 Express-C 9.5 Released

A new version of DB2 Express-C was made available by IBM today. As you might already know DB2 Express-C is a free dataserver without limits on database size or number of users.

We got this news from

You won’t find this new version on IBM DB2 Express-C Website, but you can download the Linux Version here and the Windows Version here.Mac version is still not available. This is probably the down side as many of us are waiting for IBM to ship a Express-C DB2 version for Macintosh. Hopefully next time?

I still didn’t tested the new DB2 but according to Antonio

Version 9.5 brings to the table a great deal of new enhancements and features. Among these there is also the reduced amount of memory requirements and the improved efficiency of operations on Linux. Oh and it will also make you rich and more beautiful. I mean, pureXML support has been greatly improved and it is a release that is sure to please many people on both Windows and Linux.

I know the t-shirt looks great. Hopefully Vítor will send me one! :P

Model-Driven Architecture

A arquitectura baseada em modelos parte da premissa que as equipas de desenvolvimento iram usar técnicas sofisticadas e exaustivas para criar os seus modelos. Apenas dessa forma se pode esperar transformar automaticamente esses mesmos modelos em soluções especificas de plataforma.

Apesar de, em perspectiva, tais expectativas serem muito promissoras falta-lhes algum ajustamento aquilo que é actualmente a realidade no desenvolvimento de aplicações.
A nova geração de programadores mostra-se mais ágil e adaptada as realidades emergentes desta industria. Neste âmbito não é espectável que estes tenham a tarefa exaustiva de especificar o modelo para que se possa gerar um PSM.

Mesmo que o fosse, a natureza volátil da informática ensina-nos que nada deve ser tomado como certo e que existe o risco da MDA não ser praticável a esse ponto. A própria história corrobora esta hipótese. Na memoria estão ainda outras abordagens promissoras, como o CASE, que nunca chegaram a atingir os seus objectivos.

Não estou a dizer que este modelo não é útil, ou sequer que vai ter o mesmo destino que o CASE. Mas é difícil encarar o desenvolvimento baseado em modelos noutra perspectiva que não a de rascunho. Vamos elaborar extensos blueprints com a especificação completa da nossa solução, sem saber se depois vamos poder actualmente fazer uso deles? Seria uma perda de tempo, sem resultados práticos nenhuns.

A primeira vitória já a OMG conseguiu. É actualmente inconcebível desenvolver um sistema de software complexo moderno sem se recorrer ao uso de modelos.

Agora quanto ao futuro, só o futuro dirá! :P

Coupling for the Objected Oriented Aproach

For those who know nothing about coupling it’s described on the wikipedia as the degree to which each program module relies on each one of the other modules.

Doesn’t ring a bell? Well, I don’t fancy that definition as well. Others have defined it as the level of interdependency between a method and the environment. Maybe this one suits you better.

Associated with this term often comes cohesion. Cohesion relates to the number and diversity of tasks for which a single unit of an application is responsible. It is relevant for units of a single class and an individual method.

After knowing these two concepts it’s fairly easy to understand that we strive for a loosely coupled class structure where objects have high cohesion. This combination normally allows us to perform changes in classes with minimal impact on the overall solution, while creating high quality reusable components.

Just yesterday I saw something on this subject on Web 2.0 Summit – why can’t I go to the good conferences? – coverage on O’Reilly Radar. There I found this image that was taken from Charles Perrow’s Normal Accidents: Living with High-Risk Technologies – no, I don’t think you’ll find this one in the library – that correctly reflects this reality.

So if all of this is so straightforward why am I talking about it? Well as of today I found someone that believes that all of this is wrong. I tried to google it to see if I found such theory but I was unable to. Tight coupling in a complex system!? Ideas anyone?

To finish, and for those of you who are not satisfied with the style (I call it short-and-bad) of this little introduction – or if you just want to learn a little more – you can read chapter 7 of Objects First With Java by D. Barnes and M. Kölling. In my opinion this is simply the best books for OOP beginner. And if you like the book and you want to read the rest of it you have two choices:

  1. Buy it
  2. Get it from you Library (uminho students click here)

Microsoft Student Partner

Tenho que confessar que não contava escrever um artigo sobre a Microsoft no próximo século. Suponho que quem lê esta página acha que eu devo ser um fundamentalista- semi-taliban-anti-microsoft. É mentira. Programo em C# usando .NET e VSTO já à um ano e inclusivamente já o fiz profissionalmente para a MobiComp. No meu dia a dia uso Windows XP (copia original que me foi fornecida pela Microsoft por ser estudante de engenheira informática). O meu primeiro computador já corria DOS e depois tive um com o fantástico Windows 3.1 (mas já na altura eu preferia a consola :P).

Podem até dizer que ando amuado por causa do triste episódio que aconteceu quando me convidaram para ser MSP. É mentira e está provado já que até optei por não publicar o acontecido para não embaraçar ninguém.

Então vejam lá que na TakeOff o Vítor Santos da Microsoft fez algumas afirmações polémicas. Como tal tentou remediar pedidindo ao Alcides que cortasse o podcast de forma a omitir essas declarações., tendo este acedido ao pedido. O pessoal não gostou nada e contestou, mas não sei dizer se tiveram razão já que não tenho noção se as gravações estavam ou não prometidas antes da conferencia.

Passado uns meses eis que surge um novo Alcides MSP. Até aqui tudo normal já que a qualidade do Alcides enquanto estudante é muito acima da média considerando os estudantes que a Microsoft escolheu para MSP no ano transacto. E acreditem que nem querem saber qual é a média…

Depois eis que surge um post muito elaborado e igualmente contraditório no blog do Alcides sobre a validade (ou falta dela) do desenvolvimento em Open-Source. As afirmações dele pareceram-me ingénuas e infundadas, mas recusei-me a comentar até porque não me considero uma autoridade no assunto. Longe disso.

Agora vejo esta resposta a dar cabo do artigo dele. Cai-me o queixo ao chão. Os contornos da situação e da realidade da Microsoft Portugal mais parece um argumento de um filme Hollywoodesco. A empresa de Software que não produz software parece andar “por cá” apenas para fazer marketing e gerir os interesses da marca.

Monopólio Windows nos portáteis

Já andava a procura disto à algum tempo.

Afinal eu não podia ser o único maluco a dizer que não era normal ser impossível comprar um portátil sem Microsoft Windows. Um maluco francês também concorda comigo e levou a ACER a tribunal por não lhe terem permitido comprar o PC sem sistema operativo. Adivinhem lá quem ganhou o caso? Não só o portátil lhe ficou por menos de metade do preço original, como ainda teve direito a uma indemnização.

Eu cá acho que devia-se apresentar uma petição ao parlamento sobre este assunto. Infelizmente, com os políticos que temos, parece pouco provável que algo surgisse de tal acção. Isto apesar de já haver um relatório do Globalization Institute que recomenda à comissão europeia a venda separada do portátil / sistema operativo.

O monopólio do Windows impõe um custo extra virtualmente a todos os negócios da União Europeia, já que os preços desceriam se existisse um ambiente de maior concorrência.

Era giro que algo tipo 10.000 Portugueses apresentassem uma queixa contra as marcas de portáteis, pedindo indemnizações. Assim poupava-se 5 anos de burocracias para estabelecer na lei algo que é evidente:

Um portátil é hardware, não é Microsoft Windows + Nero + Junk Software.

Is Windows Vista the new ME?

Microsoft has given all the IT students at my university free licenses to almost all the software common developers use. So I have been using Windows Vista right from it’s release with satisfactory results.

Well it seems not everyone is getting the same results. I am tired of reading about companies that migrate back to XP for lack of some functionality, that companies deny to make drivers for Vista when they already have for XP, etc. Will SP1 fix all this and make Vista a better choice? For Microsoft sake it better be.

Let us see. Apple (and Mac-OS) are on the peak of their popularity yet and Linux platforms like Ubuntu give a easy to use operative system where you can do everything you normally do in Windows (and a bit more if your a coder) with a slight difference, it’s free. Many of you are unaware of this fact but when you buy a new laptop 120€ go straight to Microsoft. That about 10% of the value of your laptop. Why pay for it when you can have it for free?

Right now the Portuguese Parliament is discussing the adoption of open-source software in the public companies. The mentality is changed and personally I don’t believe Microsoft would survive a new Windows ME, there’s simply no contingency plan like they had back then. I know that Microsoft has some advantages, people are used to it, they don’t know they are paying for it, laptop manufacturers enforce Windows as mandatory, PC games are for Windows only, etc. But things have changed and I don’t know how much more time can Microsoft live of the past. If they don’t give users a a new way to interact with a computer, if they don’t trill the crowd with a new Windows, a genuine breakthrough, then it’s a one way street to nowhere.

I know a new service pack won’t change Vista as much as it is necessary to satisfy consumers. But if it succeeds it will provide Microsoft the time to rethink their strategy. If they continue to bet on the same they did 10 years ago, they will fail. And then, they will fall.

Joost is now a public

I was one of the beta testers for Joost. It used to be invite only.

What the hell is Joost right? Joost is an application that intends to create a new type of television, Internet Television. You can select the show you want to see and it will be buffered into your computer. So anytime you feel like watching your favorite series you just have to enter Joost and select it. And it’s free.

I remember to be astonished the first time I opened it but with time the lack of good quality shows and live features turned me away from it. If they put all Scrubs & The Simpsons episodes in there, I’ll certainly change my mind.

Anyway good news for all of you who never saw it. Now you can try Joost.

I like The Really Terrible Film Channel. It is described as the home of misunderstood movies who are so bad, that they are actually good! You should give it a go if you have nothing else useful to do with your time (hurray!? :P)

Be surprised!

Joost™ the best of tv and the internet

format c:\

Chegou a altura de um novo format. Com uma licenciatura em cima este menino estava mesmo a precisar.

Software:

  • Windows XP SP2
  • Linux Ubuntu
  • Firefox
  • PDFCreator
  • Cisco Systems VPN Client
  • Open Office
  • Java Development Kit
  • Glasgow Haskell Compiler
  • Avast (Windows)
  • RocketDock (Windows)
  • Joost (Windows)
  • WinRAR (Windows)
  • Visual Studio (Windows)
  • Nero Burning Rom (Windows)

Online Backup

Quando trabalhei na MobiComp este conceito do online backup estava sempre a rondar a minha cabeça. Numa das minhas pesquisas descobri um já muito evoluído Mozy. Infelizmente não quero apenas backup como em soluções como esta, queria mais algo do tipo everything-everywhere. Penso que o GDrive será mais ou menos um Mozy da Google e, neste sentido, talvez o MobileKeeper seja mesmo das poucas soluções disponíveis que se aproximam deste conceito.

Não se ponham a pensar que a MobiComp vai aparecer e levar tudo. É uma empresa de média dimensão, sem capacidade para lutar contra os gigantes que lhe fariam frente. Apesar de ter a possibilidade de inovar, criando um novo nicho de mercado, nunca o fará a custa da sua estabilidade financeira (que se encontra dependente da sua carteira de clientes na industria móvel)

De qualquer forma estava hoje a ver os feeds e deparei-me um, para mim, até agora desconhecido competidor do Mozy. A diferença é simples, não te dão 2Gb de espaço mas sim espaço ilimitado durante 15 dias. Se quiserem mais informações visitem o site do Carbonite. Se quiserem 25Gb grátis sem limite te tempo pode ver o MediaMax.

DB2 Express C for Mac

I attended a conference by Vítor Rodrigues on DB2 pureXML approach on University of Minho last Wednesday. I was quite please to see that DB2 Express C was available for free and that, as far as I’m concerned, all features where available. You might not know this but most of my colleagues use Mac, so the main downfall for the presentation was the fact that no Mac version was available. Well, according to Antonio Cangiano that about to change. IBM is working on some beta version of DB2 for Mac, and it’s not just the client. It’s the whole thing. You can check for details here.

Another thing worthy of mention, the post Cangiano made about Haskell. It’s called Haskell Eye for the Ruby Guy and, in a certain way, represents that topic introduced here some days ago. Definitely worth the time you will spend reading it.

The ever growing software complexity requires the power of high level abstractions and the functional paradigm which helps us adopt a more declarative programming style where the side effects are marginalized.

Follow

Get every new post delivered to your Inbox.