quarta-feira, 26 de março de 2008

dry and kiss

while i was reading a post from jonas about grails, and grame's (grails project leader) response i began to think: are kiss and dry concepts together?

ok, i think i was not THAT clear.

I his post, jonas says that maven is a better than ant because it uses the dry concept: instead of writing a wonderfully big xml, you just write:

 mvn archetype:create -U \
-DarchetypeGroupId=net.liftweb \
-DarchetypeArtifactId=lift-archetype-blank \
-DarchetypeVersion=0.4 \
-DremoteRepositories=http://scala-tools.org/repo-releases \
-DgroupId=your.proj.gid -DartifactId=your-proj-id


ok, no kiss (keep it simple, stupid) here.

in grails (that uses grant — a tool built on top of ant) you say:

grails create-app

easy, ha?

to create a controller, in grails, you say:

grails create-controller


in maven, you would just create the classes (both test and controller) by hand, cause they are just stub classes.

Well, what i have here is dry versus kiss.

altought i love the dry principle, i prefer the kiss one.

just typing maven amount of code, for me, is just impossible, and, maven needs a pom.xml, that i never understood completely.
in grails, you don't have to write xml (neither ant, nor maven) and, if you really need to add a grant script, is groovy syntax.

another thing is, writing mvn archetype:create… is gonna scare people.
rails is famous because is as simple as grails. that's it.

if i say to a person that's starting with java now "hey, go to groovy/grails — it's easier!" and that person sees that amount of code, he will be so scared that he will never go to grails site again.
I, myself, was that kind of person — that's why i never used ant, maven and etc. They are too verbose, and they both have an xml (and, i really hate to create, edit and maintein xml) that is so f***ink difficult.
i falled in love for "agile" frameworks (starting with python's turbogears) because i don't have to write a big amount of everything. is just:

create application
create domain
create controller
create html
run application


and, i don't have to memorize a lot of command-line for all this.


And, one last word.
Grails is used in windows.
Windows users are afraid of CLI.
If you show this the maven example for them, they will certanly say: WTF!

sexta-feira, 23 de novembro de 2007

Problema: Java + Fedora 8

Ontem, eu estava com o Eclipse 3.3.1 aberto - quando resolvi testar o JBoss Tools.
Baixei do site, talz, criei um novo Dynamic Web Project, coloquei os facets (ou facelets, sei lá)... quando de repente, ao tentar criar um JSP, o Eclipse fecha.

Bem, eu, obviamente, pensei que tinha sido um dos famosos PermGen Error.

Mas não era.

Como eu tenho o costume de abrir o Eclipse por linha de comando, eu vi que lá, ao invés do erro do PermGen, estava isso daqui:

eclipse: xcb_xlib.c:50: xcb_xlib_unlock: Assertion `c->xlib.lock' failed.

Bem, eu pensei, deve ser erro do JBoss Tools.
Tentei de novo.
Mesmo erro.

Googlando por ai, eu encontrei diversos bugs abertos, mas nada de importante resolvido, até que eu resolvi ler o bug da Sun até o final.

Segundo os caras:

"(...) JDK is using a statically linked, non-thread-safe copy of libXinerama(...)"

Como eu não sou programador X, nem C=C+1, e sim programador Java, eu precisava de uma solucão.
E um cara chamado Josh Triplett postou nesse bug mesmo, uma solucão, que resolveu meu caso:

(O Josh postou a solucao com um caminho completo para esso .so, mas eu fiz usando $JAVA_HOME e funcionou.)

sed -i  's/XINERAMA/FAKEEXTN/g' $JAVA_HOME/jre/lib/i386/xawt/libmawt.so

E, ao tentar criar o JSP, tudo funcionou as mil maravilhas.

(Nota: Eu percebi que esse erro também ocorria ao tentar rodar programas Swing/AWT com a VM Sun)
(Nota 2: Se alguém descobrir que esse erro causa algum problema, avise-me )

Blogged with Flock

segunda-feira, 19 de novembro de 2007

Adobe Flex

What is it?

Uma solucao para RIA (Rich Internet Application) que não tem os mesmos limites de tecnologias com JSON, Ajax, GWT e etc. por ser baseada em Flash.

How does it works?

(MXML+ActionScript+Flash Class Library)+Compile=something.swf

Esse something.swf roda em um html, em um browser com o Adobe Flash Player.

Esse swf se comunica com o webserver, que, por sua vez, se comunica com todas as outras tecnologias java (J2EE, Web services e etc..)

how-does-flex-works

And?


Ainda não aprendi muito sobre a tecnologia para falar se é bom ou ruim. Mas de inicio eu já posso falar que eu nao gostei da dependencia com o Flash Player e por ser feito com ActionScript e MXML - que, provavelmente vai exigir uma curva de aprendizado para muitos desenvolvedores. Por outro lado, o Flex dá uma interface extremamente rica, e bem rápida (usando ADF11g como exemplo) para aplicacões web - com o beneficio da integração com Java ( e com o Eclipse, por meio de plugin).

Mais informacões:
- Apresentacão do Flex (c/ Java);
- Flex.org/Java

Blogged with Flock

demonoid.com fechado. para todo sempre

Como todos sabem, um dos melhores trackers de torrent do mundo, o Demonoid.com foi desativado pela CRIA (Canadia Recording Industry Association), depois de uma batalha de muitos meses.

Mas, será mesmo que ela tá certa?

Eu pergunto isso, porque algum tempo atrás (exatamente há 15 dias) eu fiquei sabendo via MeioBit que a Universidade de Londres, junto com a Industry Canada e a Decima Research fizeram uma pesquisa para descobrir o hábito dos usuários P2P.

Segundo a pesquisa:
"(...) we are unable to find direct evidence that P2P file-sharing either increases or decreases CD purchases in Canada. That is, in our analysis of the whole Canadian population we are unable to find any relationship between the number of P2P music tracks that were downloaded and the number CD purchases (...)"

(Traducao livre:
"Nós nao conseguimos encontrar evidencias diretas que o compartilhamentos de arquivos P2P aumentou ou diminuiu o numero de compras de CD no Canadá. Isto é, na nossa analise de toda a população do Canadá nós não conseguimos encontrar nenhum relacionamento entre o numero de faixas baixadas pelo P2P e o numero compras de CD" ).

E depois dessa pesquisa, a CRIA ainda ameaçou a empresa que alugava os servidores do Demonoid, obrigando o site a fechar.

Infelizmente, buscando noticias sobre o site na internet eu descobri que infelizmente, para os criadores do demonoid, o site fechou para sempre.

O que é uma pena, já que ele era o melhor tracker da internet, na minha opinião, já que, diferentemente do PirateBay.org, para baixar torrents, era totalmente necessario se cadastrar, e, para todo usuário cadastrado era mostrado o famigerado share ratio, junto com a quantidade exata de MB que o usuário baixou e "uploadeou".
Com isso, o site era extremamente organizado, e, com torrents excelentes. E com muitos seeds, já que o share ratio era publico.

Uma pena que a CRIA ainda acredita que torrents diminuem as vendas de cds, já que, na minha opinião, eles aumentam - porque o cara quando gosta de uma banda, quer ajuda-la.

Um pena, de verdade.


Blogged with Flock

quinta-feira, 1 de novembro de 2007

Carta Aberta de François Bancilhon a Steve Ballmer

Fonte: MandrivaBlog

Dear Steve,

Hi, this is François, from Mandriva.

I'm sure we're way too small for you to know me. You know, we're one of these tiny Linux company working hard for our place on the market. We produce a Linux Distro, Mandriva Linux. The last edition, Mandriva 2008 was seen as a pretty good version and we're proud of it. You should give it a spin, I'm sure you'd like it. We also happen to be one of the Linux companies that did not sign an agreement with your company (nobody's perfect).

We recently closed a deal with the Nigerian Government. Maybe you heard about it, Steve. They were looking for an affordable hardware+software solution for their schools. The initial batch was 17,000 machines. We had a good answer to their need: the Classmate PC from Intel, with a customized Mandriva Linux solution. We presented the solution to the local government, they liked the machine, they liked our system, they liked what we offered them, the fact that it was open, that we could customize it for their country and so on.

Then your people entered the game and the deal got more competitive. I would not say it got dirty, but someone could have said that. They fought and fought the deal, but still the customer was happy to get CMPC and Mandriva.

So we closed the deal, we got the order, we qualified the software, we got the machine shipped. In other word, we did our job. I understand the machine are being delivered right now.

And then, today, we hear from the customer a totally different story: "we shall pay for the Mandriva Software as agreed, but we shall replace it by Windows afterward."

Wow! I'm impressed, Steve! What have you done for these guys to change their mind like this? It's pretty clear to me, and it will be clear to everyone. How do you call what you just did Steve, in the place where you live? In my place, they give it various names, I'm sure you know them.

Hey Steve, how do you feel looking at yourself in the mirror in the morning?

Of course, I will keep fighting this one and the next one, and the next one. You have the money, the power, and maybe we have a different sense of ethics you and I, but I believe that hard work, good technology and ethics can win too.

cheers

François

PS: a message to our friends in Nigeria: it's still time to do the right thing and make the right choice, you will get lots of support for it and excellent services!

terça-feira, 30 de outubro de 2007

me.dium what?

Eu não sei ainda como chamar essa "extensão" do flock.

Mas eu se que é bem interessante.

Ele mostra uma barra lateral, onde ele mostra em que site da internet você está

Photo Sharing and Video Hosting at Photobucket

Nessa barra, voce que site vc está, onde estão seus amigos, e pode abrir salas e conversar com pessoas!
Por enquanto, o site é invite-only, maaas, caso você (assim como eu) utilize o Flock, poderá utilizado normalmente.

(O negócio é bem bom pra conhecer pessoas!)

http://me.dium.com
http://flock.com



Blogged with Flock

Night in Java

public class Night {
private Pub pub = new Pub(300);
private Person me = new Person(Status.SOBER);
public static void main (String[]args){

while(!me.getStatus.equals(Status.DRUNK){
for (Beer beer : pub.getStock())
me.drink(beer);
}
}
}