Fernando Meyer

Writing a domain specific language DSL with python

Written Saturday 05 September 2009 by Fernando Meyer.

A domain-specific language is a piece of software designed to be useful for a specific task in a fixed problem domain, they're gaining popularity because they enhance productivity and reusability of artifacts. DSLs also enable expression and validation of concepts at the level of abstraction of the problem domain, this approach is very useful when you need to describe a user interface, a business process, a database, or the flow of information.

The DSL concept isn't new after all, special-purpose programming languages and all kinds of modeling, specification languages have always existed, but this term rise due the popularity of domain-specific model.

You can easily implement dsls using the ruby language, Java or even C# if you prefer, but this isn't the main propose of this article. The sine qua non become visible when I was implementing a simple test case with python. Indeed, there are a lot of python BDD-like frameworks, mostly who are self claimed the silver bullet, that are mismatching a lot of basic principles, but like I said, we are talking about dsls =)

With python we can easily create a piece of software that expresses some basic desired behavior, like rspec does, but much more pythonic.

spec.py

    # coding: pyspec

    class Bow:
        def shot(self):
            print "got shot"

        def score(self):
            return 5

    describe Bowling:
        it "should score 0 for gutter game":
            bowling = Bow()
            bowling.shot()
            assert that bowling.score.should_be(5)

we can easily make this test dsl a runnable piece of python code, whiteout writing incompressible regular expressions, just using the python codecs and tokenizer.

Fist of all we need to define a new encoding for pyspec - our pre defined spec file syntax - this neat hacking enables a new path to tokenize this file

tokenizer.py

    import tokenize
    import codecs, cStringIO, encodings
    from encodings import utf_8

    class StreamReader(utf_8.StreamReader):
        def __init__(self, *args, **kwargs):
            codecs.StreamReader.__init__(self, *args, **kwargs)
            data = tokenize.untokenize(translate(self.stream.readline))
            self.stream = cStringIO.StringIO(data)

    def search_function(s):
        if s!='pyspec': return None
        utf8=encodings.search_function('utf8') # Assume utf8 encoding
        return codecs.CodecInfo(
            name='pyspec',
            encode = utf8.encode,
            decode = utf8.decode,
            incrementalencoder=utf8.incrementalencoder,
            incrementaldecoder=utf8.incrementaldecoder,
            streamreader=StreamReader,
            streamwriter=utf8.streamwriter)

    codecs.register(search_function)

Our tiny translate function defines a easy way to translate both describe and it into a traditional python class and method definition.

    def method_for_it(token):
        return token.strip().replace(" ", "_").replace("\"","" ) + "(self)"

    def translate(readline):
        previous_name = ""
        for type, name,_,_,_ in tokenize.generate_tokens(readline):
            if type ==tokenize.NAME and name =='describe':
                yield tokenize.NAME, 'class'
            elif type ==tokenize.NAME and name =='it':
                yield tokenize.NAME, 'def'
            elif type == 3 and previous_name == 'it': 
                yield 3, method_for_it(name)
            else:
                yield type,name
            previous_name = name

Clever isn't ? Now, fell yourself free to fork this project on GitHub and finish the job =) maybe someday we can have a real BDD python framework. http://github.com/fmeyer/pydsl/tree/master

References:

  1. codecs — Codec registry and base classes
  2. tokenize — Tokenizer for Python source

Venha trabalhar na globo.com

Written Wednesday 02 September 2009 by Fernando Meyer.

A vaga é para uma das equipes responsáveis pelo desenvolvimento de novos produtos globo.com. Somos uma equipe multidisciplinar totalmente responsável pelos projetos desde sua concepção, criação, desenvolvimento, deployment até o suporte.

Não estamos procurando especificamente desenvolvedores Java, PHP, Ruby, Python, C ou C++, queremos uma pessoa totalmente agnóstica que não tenha medo de experimentar e aprender. É óbvio que cada um tenha suas especialidades e/ou preferências, mas estamos procurando programadores multidisciplinares e que além disso sejam capazes não só de programar mas de arquitetar, analisar, testar e trabalhar com novas tecnologias o tempo todo.

Mesmo assim, fortes conhecimentos em Ruby, Javascript, CSS, HTML, Banco de dados schema free, Infra e Amazon EC2 são um grande diferencial.

Por último mas não menos importante, todos nós somos geeks, apaixonados por tecnologia e super atualizados com as últimas novidades da Internet e do mercado. Nossa equipe é jovem, irreverente, descontraída e em constante evolução. É uma pessoa assim que estamos procurando.

A empresa oferece contratação apenas por CLT, com salário de mercado e plano de benefícios. Estamos localizados na Barra da Tijuca (Rio de Janeiro).

Se você acha que se enquadra, mande um email para nós beta@corp.globo.com com uma breve introdução, com todos os seus contatos github, twitter, LinkedIn e blog, mande também a lista dos 3 últimos livros que leu.

@fmeyer, @gcirne, @nevesbruno, @peleteiro

A simple way to time small bits of Python code

Written Sunday 30 August 2009 by Fernando Meyer.

The timeit module provides a simple way to time small bits of Python code. It has both command line as well as callable interfaces. It avoids a number of common traps for measuring execution times. See also Tim Peters' introduction to the "Algorithms" chapter in the Python Cookbook, published by O’Reilly.

the command line example:

python -mtimeit -s"from math import sqrt; x = 123" "x**.5"

the module example:

>>> import timeit
>>> s = """\
... try:
...     str.__nonzero__
... except AttributeError:
...     pass
... """
>>> t = timeit.Timer(stmt=s)
>>> print "%.2f usec/pass" % (1000000 * t.timeit(number=100000)/100000)
17.09 usec/pass
>>> s = """\
... if hasattr(str, '__nonzero__'): pass
... """
>>> t = timeit.Timer(stmt=s)
>>> print "%.2f usec/pass" % (1000000 * t.timeit(number=100000)/100000)
4.85 usec/pass

trailbikr.com

Written Wednesday 26 August 2009 by Fernando Meyer.

Vontade de mudar o mundo todo mundo tem, começar é sempre a parte difícil da coisa. Fazer um pouco aqui outro pouco acolá pode gerar uma imensa sensação de prazer no ser humano. Um exemplo clássico disso é você dispensar seu automóvel uma vez por semana e tentar algum tipo de transporte alternativo.

Quando estava morando em São Paulo ficava muito revoltado quando eu tinha que sair da Av. Paulista pegar 2 ônibus lotados, um transito de 2 horas e chegar suado e cansado no trabalho na Av. Faria Lima, todo esse sofrimento pra andar 16km por dia. Difícil não remeter a época em que eu podia pedalar 20km de bike por dia, época a qual meu corpo e o transito em Foz ajudavam bastante.

Um dia voltando de carona com uma colega depois de ficar parado por 30 minutos em um semáforo eu falei: ” – Flávia, você pode me deixar aqui, tem uma bicicletária e vou comprar uma bike e começar a ir trabalhar com ela”. Claro que arranquei algumas risadas, foi até engraçado uma pessoa do meu porte pedalando em Sampa, mas em 2 semanas comecei a sentir varias melhorias de humor e claro meu estado físico. Ficando menos tempo no transito eu tinha mais tempo pra mim, resumindo, foi um salto extremo de qualidade.

Em Maio eu decidi mudar para o Rio, cidade nova, emprego novo, problemas novos e de volta o velho sedentarismo, ganhei os quilos que perdi(e alguns outros a mais), o stress batendo a porta constantemente, foi quando decidi parar um pouco de pensar no bolso do RIM e voltei a pensar em mim.

Como você deve imaginar um Nerd de carteirinha pedalando logo tem a idéia de alguma ferramenta pra medir sua performance e acompanhar a evolução da coisa – Afinal, números são números- Em uma dessas pedaladas eu imaginava um site em que eu pudesse gravar meus percursos, minhas estatísticas de velocidade, altura do percurso, plotar no google maps e ainda compartilhar com o Kumpera, Achei algumas soluções prontas que atendiam parcialmente os requisitos mas nenhuma que trouxesse uma considerável elegância e praticidade. Foi em um estalo que decidi fazer o trailbikr.com um site onde você pode usar um iphone ou n95 no bolso enquanto pedala, sincronizar ele com um servidor e ver seus treinos e compara-los com o de amigos. A idéia que ronda a implementação até agora é essa: Praticidade, rapidez, objetividade e mobilidade.

Em janeiro provavelmente já terei uma versão beta liberada para algumas pessoas, até Março, o site estará no ar com os aplicativos para celular totalmente grátis pra todos que quiserem usar. Agora enquanto termino essa empreitada, vá treinando que logo estaremos prontos para receber seus workouts e mostra-los para o mundo todo.

Configuring Joseki + Pellet + TDB

Written Wednesday 27 May 2009 by Fernando Meyer.

I was looking for some documentation about using TDB and Pellet
reasoser on Jena without pet peeves, didn’t found anything usable at all, so after a few
attempts I was still fighting against an ambiguity error,
whenever Joseki tries to build a dataset, the following exception pops up

18:18:49 WARN  Configuration        :: Failed to build dataset from
description (service name: reason): cannot find a most specific type
for file:///joseki-config.ttl#dataset_reason, which has as
possibilities: ja:RDFDataset ja:InfModel.
com.hp.hpl.jena.assembler.exceptions.AmbiguousSpecificTypeException:
cannot find a most specific type for file:///Users/fmeyer/projects/semantic/
servicos/joseki/joseki-config.ttl#dataset_reason, which has as possibilities: 
ja:RDFDataset ja:InfModel.
 at com.hp.hpl.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.
 open(AssemblerGroup.java:104)
 at com.hp.hpl.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.
 open(AssemblerGroup.java:70)
 at com.hp.hpl.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:41)
 at com.hp.hpl.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:38)
 at org.joseki.DatasetDesc.newDataset(DatasetDesc.java:65)
 at org.joseki.DatasetDesc.initialize(DatasetDesc.java:60)
 at org.joseki.Configuration.processModel(Configuration.java:112)
 at org.joseki.Configuration.(Configuration.java:83)
 at org.joseki.Dispatcher.setConfiguration(Dispatcher.java:130)
 at org.joseki.Dispatcher.initServiceRegistry(Dispatcher.java:100)
 at org.joseki.Dispatcher.initServiceRegistry(Dispatcher.java:93)
 at org.joseki.RDFServer.init(RDFServer.java:79)
 at org.joseki.RDFServer.(RDFServer.java:64)
 at joseki.rdfserver.main(rdfserver.java:85)

We just need to define a GraphTDB as a subclass of a Model as follow to fix this issue

@prefix ja:      .
@prefix tdb:      .

## Initialize TDB.

[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
tdb:GraphTDB    rdfs:subClassOf  ja:Model .

## ---- A whole dadaset managed by TDB
< #dataset_reason> rdf:type      ja:RDFDataset ;
  ja:defaultGraph < #inf_graph> .

< #dataset> rdf:type      ja:RDFDataset ;
  ja:defaultGraph < #def_graph> ;
  .

< #inf_graph> rdf:type  ja:InfModel ;
    ja:reasoner [
        ja:reasonerClass
            "org.mindswap.pellet.jena.PelletReasonerFactory" ;
       ] ;
    ja:baseModel < #tdbGraph> .

< #def_graph> rdf:type  ja:InfModel ;
    ja:baseModel < #tdbGraph> .

< #tdbGraph> rdf:type tdb:GraphTDB ;
    tdb:location "DB" ;
    .

O scrume

Written Saturday 04 April 2009 by Fernando Meyer.

Como varias pessoas próximas a mim ja sabem eu deixei a RedHat em abril deste ano por motivos pessoais, o trabalho remoto mesmo tendo suas vantagens não conseguiu despertar em mim a mesma proatividade e cumplicidade que eu teria trabalhando com pessoas reais durante o dia-a-dia. Trabalhar em uma empresa em que eu pudesse estar fisicamente locado com um time e desenvolvendo um software incremental foram os motivos que me levaram a globo.com.

Dentro da gcom trabalhamos usando a metodologia Scrum, temos varios casos de sucesso e uma boa reputaçao no mercado brasileiro com a adoção desta metodologia. Mas o sucesso dos projetos não vem apenas do uso de uma metodologia agil, pessoas com otimas noções de negócio e tecnologia fazem o barco andar de forma gloriosa. Tive a sorte de participar logo no primeiro contato na empresa com profissionais que valorizam a qualidade de seu código, alem de entregar algo rápido e funcional também olham para o como fazer melhor, refatorar um algoritmo que não ficou bom em uma primeira abordagem, ou seja fazemos software.

Sempre brinco pelos corredores, que hoje em dia que as empresas se preocupam mais em vender a imagem que fazem o negocio de uma forma diferente das demais e deixam totalmente de lado as boas praticas de desenvolvimento que foram esculpidas durante anos de tentativas, erros e evoluções. Nasce ai o Scrume, a desculpa de usar a metodologia e/ou a abordagem agile com pessoas que não levam à paixão seu trabalho. Conversas que tive com o Philip calçado e artigos como “The Decline and Fall of Agile” veem apenas confirmar esta visão, anos de evolução sendo deixadas de lado por modismos.

Se você pensar de uma maneira racional, software vem sendo desenvolvido ao longo dos anos possibilitando avanços significativos em vários campos como biologia, astronomia e finanças para não me alongar, a não adoção do “scrum” não fez projetos como linux ou colocar o homem na lua com um tubo de 8088 por exemplo ser fadado ao fracasso. Ocorreram erros, acertos e em alguns momentos pessoas precisaram se sobrepor para trazer o bom senso a tona.

Concordo plenamente que a adoção do scrum por exemplo, aumenta a visibilidade dos problemas que ocorrem no desenvolvimento de features por termos um feedback rápido do cliente ou da organização, mas não é tendo apenas essa abordagem que fara seu projeto ser bem sucedido.

Os projetos hoje que dão certo, estão envoltos em uma gama de outros fatores que equilibram essa equação. Fica meu conselho, não é trazendo um evangelista e adotanto Scrum para sua empresa que fará seus projetos darem certo, mas se e somente se as pessoas envolvidas acreditarem no que estão fazendo.

Pagerank isn't for humans

Written Saturday 04 April 2009 by Fernando Meyer.

Transitioning from a web of links and a sequence of words to a web of content, meaning and knowledge is probably the next great moving that we are going to see on the next two or maybe three years.

I was chatting with a friend, how can we bring knowledge to the web, how can we use the web to make a really efficient human driven search engine, last week a few former Googlers made some noise about a totally new SE named cuil, I tried some queries on that page, but it does work almost like google, you must be pretty much binary to retrieve some interesting information, in another words, nothing has changed since 90’s on this area. This problem is around researcher’s minds for a long time, trust, influence, authority when applied to the web are essentially people based issues.

The propose is the content being an asset with information about what it really means running against the link/words algorithms with no explicit meaning and a simple assumption “yes … we know you’re a good reference because you have a lot of links”.

Make yourself a question, how to ask something? How do I ask for information?

You ask your close friend: “Sunday night guitar red cap TV?” when you really want to know about the Sunday night TV show where a girl with a funny red cap playing a guitar. Things does change when you bring meaning to it, thats what a human being does.

Indeed, Google is still leading this running, with several fields under extreme research, articles about Data Mining, Collective Intelligence and AI being published denotes the new approach.

Yes … things are about to change

Busca e Semantica

Written Saturday 04 April 2009 by Fernando Meyer.

Vontade de mudar o mundo todo mundo tem, começar é sempre a parte difícil da coisa. Fazer um pouco aqui outro pouco acolá pode gerar uma imensa sensação de prazer no ser humano. Um exemplo clássico disso é você dispensar seu automóvel uma vez por semana e tentar algum tipo de transporte alternativo.

Quando estava morando em São Paulo ficava muito revoltado quando eu tinha que sair da Av. Paulista pegar 2 ônibus lotados, um transito de 2 horas e chegar suado e cansado no trabalho na Av. Faria Lima, todo esse sofrimento pra andar 16km por dia. Difícil não remeter a época em que eu podia pedalar 20km de bike por dia, época a qual meu corpo e o transito em Foz ajudavam bastante.

Um dia voltando de carona com uma colega depois de ficar parado por 30 minutos em um semáforo eu falei: ” – Flávia, você pode me deixar aqui, tem uma bicicletária e vou comprar uma bike e começar a ir trabalhar com ela”. Claro que arranquei algumas risadas, foi até engraçado uma pessoa do meu porte pedalando em Sampa, mas em 2 semanas comecei a sentir varias melhorias de humor e claro meu estado físico. Ficando menos tempo no transito eu tinha mais tempo pra mim, resumindo, foi um salto extremo de qualidade.

Em Maio eu cai na besteira de decidi mudar para o Rio, cidade nova, emprego novo, problemas novos e de volta o velho sedentarismo, ganhei os quilos que perdi(e alguns outros a mais), o stress batendo a porta constantemente, foi quando decidi parar um pouco de pensar no bolso do RIM e voltei a pensar em mim.

Como você deve imaginar um Nerd de carteirinha pedalando logo tem a idéia de alguma ferramenta pra medir sua performance e acompanhar a evolução da coisa – Afinal, números são números- Em uma dessas pedaladas eu imaginava um site em que eu pudesse gravar meus percursos, minhas estatísticas de velocidade, altura do percurso, plotar no google maps e ainda compartilhar com o Kumpera, Achei algumas soluções prontas que atendiam parcialmente os requisitos mas nenhuma que trouxesse uma considerável elegância e praticidade. Foi em um estalo que decidi fazer o http://trailbikr.com um site onde você pode usar um iphone ou n95 no bolso enquanto pedala, sincronizar ele com um servidor e ver seus treinos e compara-los com o de amigos. A idéia que ronda a implementação até agora é essa: Praticidade, rapidez, objetividade e mobilidade.

Em janeiro provavelmente já terei uma versão *beta* liberada para algumas pessoas, até Março, o site estará no ar com os aplicativos para celular totalmente grátis pra todos que quiserem usar. Agora enquanto termino essa empreitada, vá treinando que logo estaremos prontos para receber seus workouts e mostra-los para o mundo todo. Tagged: bike, django, gps, python, software, track, trailbikr

Welcome to Django… conference

Written Saturday 02 August 2008 by Fernando Meyer.

DjangoCon is the first official international Django conference. It aims to bring together the community and provide a wide range of sessions, panels, lightning talks and showcases of Django usage within various businesses. The first DjangoCon will be on September 6-7, 2008 in Mountain View, CA at the Googleplex.

After losing the first registration day I constantly pissed of Robert Lofthouse about the registration site’s stability. So, for those who will attend the conference, see you there.

Ps: Is there another brazilian going to the conference?

Restoring Iphone 1604

Written Tuesday 22 July 2008 by Fernando Meyer.

When trying to restore my iPhone with iTunes and firmware 2.0, iTunes continuously shows a message that stops the restore process, it was probably related to basehand update, but I ain’t sure about this. After some headaches here is the solution.

Downgrade to 1.1.4

Step 1) The first problem in your downgrade is that you probably are getting error 20 in restore mode and error 160x in DFU mode. This is due to iTunes 7.7. So, you now you need to uninstall iTunes 7.7 and install iTunes 7.5. Load up Terminal and type the following: Step 2) Now that you have iTunes 7.5, you will still have the DFU driver for 7.7. This is good and will allow the process to work. Put your phone into DFU mode using the DFU steps. You will not have any display on your device in DFU mode. If you see the cable and connect to iTunes, you did not get into DFU mode. Step 3) Restore using iTunes 7.5. and 1.1.4 firmware, it will work after all. Now you have an unlocked 1.1.4 iphone, you can choose between upgrade to 2.0 with pwnage or unlock it with ziphone, again … up to you.

Me @ Fisl

Written Monday 21 July 2008 by Fernando Meyer.

Speaking about JBoss Drools When: 17 April, 1pm~2pm Room 41B

http://fisl.softwarelivre.org/9.0/papers/pub/programacao/274

Drools Antlr Lecture at Conexao java 2007

Written Saturday 21 June 2008 by Fernando Meyer.

As I promised at CJ2007 I’m uploading my slides and demo code from my ANTLR lecture. I got really surprised about people’s interest in ANTLR, compiler theory and DSL in general.

You can import the demo in both eclipse or Intellij (or use maven to generate your own ide config). to run the code without an ide just unpack and execute the runconsole.sh you can set variable’s values ex:

x=1

y=2

And execute some expression using these predefined variables ex:

3*(x-y)*(x/y)

when you finish to input your expression just press ctrl+D on unix or ctrl+Z on windows ( EOF char ) to execute it
ps: Thanks to Danilo Sato to help me figure out a Grammar ambiguity, my approach wasn’t the optimal solution to resolve the problem.

*Update, Sami Koivu just sent me the pictures from my lecture,

Explaining the compiler process

Explaining the compiler theory

Hands on

Hands On

The antlr grammar as itself

The Antlr Grammar file as itself

Drools DLS sample

Drools Sample DSL

No Javaone for me

Written Saturday 21 June 2008 by Fernando Meyer.

This morning I got a sweet email from JavaOne CCT,

Dear Fernando ,
Sun Microsystems, Inc. and the JavaOne(sm) Conference Content Team are grateful for your proposal to present at the 2008 JavaOne conference. The high quality of submissions made the selection process extremely difficult. We regret to inform you that we will be unable to accept your proposal.

Just today I spoke with three friends and a team mate from RedHat, none of these were accepted, I still don’t understand why Sun keeps supporting non-sense people as speakers on his conferences.

For those who will attend JavaOne I desire you a good time watching the JSF, NetBeans advanced topics and that guy dressing the brazilian flag :)

About Java 6 and Leopard

Written Saturday 21 June 2008 by Fernando Meyer.

I just updated my MBP to the latest Apple’s OS 10 ( leopard ) the system is good, few eye-candies updates, although was a bit disappointing don’t see java6 around ( they removed the early beta version from ADC as well, so, don’t waste your time looking for it).

Apple, I don’t care about java6 for now you can delay it until you make it good. BUT… man when you delivery something with your OperatingSystem make sure that this thing works, I got really angry with a BUGGED java5 version, the exactly version is

java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-237)
Java HotSpot(TM) Client VM (build 1.5.0_13-119, mixed mode, sharing)

This bug looks like its deep inside Apple’s windowing toolkit implementation as you can see in the following stack trace

Exception in thread “AWT-EventQueue-0″ java.lang.NullPointerException
at apple.awt.CGraphicsEnvironment.displayChanged(CGraphicsEnvironment.java:65)
Invalid memory access of location 00000000 eip=00000000
at apple.awt.CToolkit$4.run(CToolkit.java:1259)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.j

ava:269)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java>

A guy from GWT dev list submitted a bug report to Apple: Problem ID 5563333 - “CGraphicsEnvironment NullPointerException breaks continually on OsX 10.5″, so engineers and QA move your asses and get this thing done, because you are affecting my work and some more guys around the world.

Autotest for Java

Written Saturday 21 June 2008 by Fernando Meyer.

Little Continuous Integration with Growl Notifier Are you tired to run ant scripts and wait for tests results whenever you change some source file? Yes, me too, basically I got autotest’s idea for ruby and Did it work for ant as well. Continually runs tests based on files you’ve changed improving feedback with a fancy Growl alert.

If you are a Java developer and works with ant (on mac of course) check out my bash script( and avoid cruise control for little stuf ) **see update

Change all images paths on the script, put the script in your project folder and execute it

remember you need unit tests to use this script properly.

If you have some idea on how to improve it, let me know

** now hosted at github

git clone git://github.com/fmeyer/autotestmac.git

JBoss Drools 4.0 Released

Written Wednesday 25 July 2007 by Fernando Meyer.

jEdit can be set up to be a very productive Ruby on Rails IDE with efficiency boosting features very similar to the ones TextMate provides to

the Mac users out there. I would argue that it provides more productivity features than TextMate does as it is fully pluggable and has a strong following of plugin creators.
The following links are in some semblance of a suggested order:

  1. Finding the Best Ruby on Rails IDE for Windows
    Chronicles experience in finding the best Ruby on Rails IDE. I landed on jEdit for a number of reasons.
  2. jEdit Tutorial: A How-To on Abbreviations in Superabbrevs for HTML, Ruby on Rails and more
    Not sure what “abbreviations” are? Check this article out for an in depth explanation of what they are and how to set them up in jEdit.
  3. jEdit for ruby/rails development
    This article includes screenshots of more plugins than any of the others I have found. I’d follow the instructions here and go over to jEdit Snippets for Ruby on Rails to get a great set of abbreviations.
  4. jEdit Snippets for Ruby on Rails
    An excellent set of abbreviations with an online quick reference doc so you know what each of them does.
  5. Ruby jEdit Plugin
    This is the actual plugin needed to get Ruby on Rails autocompletion, RDoc integration, etc.

Just got fresh books from amazon.com

Written Wednesday 18 July 2007 by Fernando Meyer.

CIMG2736.JPGMy books from amazon arrived (with nice gifts from New York redhaters) yesterday. I spend about 2 hours reading some random pages and I can drop some lines about:

The IA book, I studied with the same book at university. so I just ordered to get the new 2002 version, but the mother… nice seller sent me the outdated 95’s version.
Principles of the Business Rule Approach, this book is a nice introduction to business rules, it explains all concepts in the natural way, some step-by-step topics are very interesting to figure out the more complicated rules concepts.
Jess in Action - that’s another book which you must have in your library, but don’t seize at it (try drools instead)
Expert Systems: Principles and Programming - That’s certainly the most advanced book I’ve ordered, so I must dive/read/assimilate more to write a good review.

    I think that’s a good start.

    Interesting links for today

    Written Tuesday 17 July 2007 by Fernando Meyer.

    Open source JBoss Rules gains speed

    http://www.infoworld.com/article/07/07/16/jboss-rules_1.html

    JBoss also extends business rules engine to nonprogrammers, adds MVEL language support

    Essencial Drools blog reading

    http://markproctor.blogspot.com/2007/07/essential-drools-blog-reading.html

    My IDE through the years

    Written Tuesday 17 July 2007 by Fernando Meyer.

    Today, after read something about the Kawa IDE, I tried to remember these I’ve used through the years.

    • Turbo Pascal - late 1997
    • Turbo C++ - 98/99
    • DJGPP - late 99
    • Emacs - 2000 - C++
    • Kawa - 2001 - Java
    • Netbeans- 2002/2003
    • Eclipse - 2003/2006
    • Visual Studio - 2006 - Yes I got a project in C#
    • IDEA intellij + textmate - 2007

    Maybe I missed something, but it’s just to get an overview.

    BRMS demo available

    Written Saturday 14 July 2007 by Fernando Meyer.

    I just did a post into Mark Proctor’s Blog covering a short tutorial about BRMS (Business Rules Management System).

    http://markproctor.blogspot.com/2007/07/discount-insurance-brokers-example-for.html

    Check this out.

    Hackers x Talkers

    Written Tuesday 10 July 2007 by Fernando Meyer.

    Drop all your computer science books (including that damn algorithm book), forget about you time reading the linux kernel sources and all the time across the night you’ve lost mining the internet looking for useful information, (even that black screen with gray letters using vi + C), now you can be a hacker just binding components and/or creating a web page with a nice css style. It reminds me a nice antonym to the hacker meaning,

    Talkers: A person who speaks more than effectively do something useful.

    missing the old times

    Alligator eggs

    Written Tuesday 10 July 2007 by Fernando Meyer.

    This puzzle just poped on my screen when I was googling http://worrydream.com/AlligatorEggs/ it’s a nice puzzle
    alligator game.

    This game represents the untyped lambda calculus. A hungry alligator is a lambda abstraction, an old alligator is parentheses, and eggs are variables. The eating rule corresponds to beta-reduction. The color rule corresponds to (over-cautious) alpha-conversion. The old age rule says that if a pair of parentheses contains a single term, the parentheses can be removed.
    I’m sure that after 4.0 drools release I’m going to implement this game as a drools DRL.

    Book Library Update

    Written Saturday 30 June 2007 by Fernando Meyer.

    I just ordered these four books in amazon store, and will do some reviews as soon as possible probably I’ll be busy for a while

    Expert Systems: Principles and Programming, Fourth Edition: Principles and Programming (Hardcover)

    Jess in Action: Java Rule-Based Systems (In Action series) [ILLUSTRATED] (Paperback)

    Artificial Intelligence: A Modern Approach (2nd Edition) (Hardcover)

    Principles of the Business Rule Approach (Paperback)

    CiscoVPN alternative

    Written Saturday 26 May 2007 by Fernando Meyer.

    I was looking for an alternative client for macOS because I hate the windows style of ciscoVPN client for mac,

    And I found this. http://www.nexumoja.org/projects/Shimo/

    Shimo is the best choice for mac for the following reasons;

    • More stable and well integrated than cisco vpn client
    • Nice statistics screen
    • Keychain integration
    • Connect on login
    • Can be easily integrate with growl for notifications
    • If you’ve installed cisco VPN before it will import your previous settings.

    I think that you all will enjoy it ;)

    Special tips building and debugging GWT based UI on Fedora Core 6

    Written Friday 04 May 2007 by Fernando Meyer.

    When launching Google web toolkit you get this error, org.eclipse.swt.SWTError: No more handles (java.lang.UnsatisfiedLinkError?: mozilla-1.7.12/libxpcom.so: Can’t load IA 32-bit .so on a IA 32-bit platform)

    FC6 has libstdc++.so.6.0.8 out of the box. Many times yum is smart enough to get the “compat” version of a lib when a newer one is installed, so I rolled the dice and tried:

    yum install libstdc++.so.5

    When launching the Eclipse debugger you get this error,
    ERROR: transport error 202: gethostbyname: unknown host “transport.c”,L41?
    ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) “debugInit.c”,L500?

    To correct the problem, just add the following line to /etc/hosts :

    127.0.0.1 localhost

    Probably it will be useful for you, as was for me.

    Learning English Spanish, Italian, Portuguese

    Written Sunday 14 January 2007 by Fernando Meyer.

    The English language has been at the forefront of globalization. English is celebrated as the language of global corporate management, the Internet, youth culture and science. At the same time, there appears to be a crisis in foreign language learning amongst native English speakers - it seems that there is no need any more to learn foreign languages if everyone now speaks English. But if you want to learn another language like Spanish, German or even Brazilian Portuguese, you can access these podcasts.
    Note: You must have ITunes installed in your computer.
    Learn Arabic Learn Chinese Learn Chinese Learn Chinese Learn Chinese English As a Second Language ESL English For Business Beginner French Learn French Learn French Learn French Learn French Verbs Learn German I II III IV Learn German Grammar Learn German Learn Greek Learn Hindi Learn Italian Learn Italian Learn Japanese With Video Japanese for Beginners Learn Japanese Symbols Learn Korean Learn Portuguese Learn Brazillian Portuguese in Spanish Learn Russian Learn Russian For Businesses Russian Literature Learn Spanish Learn Spanish Learn Spanish

    Switching from bloglines to vienna

    Written Thursday 11 January 2007 by Fernando Meyer.

    I’m changing my default RSS reader from the web-based bloglines to Vienna, a rss reader for Mac OS X, Vienna keeps following RSS feeds simple and functional with smart folders, groups, an integrated browser and item flagging. It’s the perfect tool for offline readers like me.

    ps: Yeap, I’m having some problems to get an internet connection here in Colombia; (sic)

    Linux Kernel in a Nutshell is now Creative Commons: free pdf download

    Written Wednesday 10 January 2007 by Fernando Meyer.

    Written by a leading developer and maintainer of the Linux kernel, Linux Kernel in a Nutshell is a comprehensive overview of kernel configuration and building, a critical task for Linux users and administrators.The book is available for download in either PDF or DocBook format for the entire book, or by the individual chapter.

    To quote of the book’s author:

    If you want to know how to build, configure, and install a custom Linux kernel on your machine, buy this book. It is written by someone who spends every day building, configuring, and installing custom kernels as part of the development process of this fun, collaborative project called Linux. I’m especially proud of the chapter on how to figure out how to configure a custom kernel based on the hardware running on your machine. This is an essential task for anyone wanting to wring out the best possible speed and control of your hardware.

    http://www.kroah.com/lkn/

    Firefox is crashing on my macbookpro

    Written Monday 08 January 2007 by Fernando Meyer.

    I don’t know why but it’s happening, every time when i open a second gmail tab my Firefox crashes

    Exception:  EXC_BAD_INSTRUCTION (0×0002)
    Code[0]:    0×0000000d
    Code[1]:    0×00006e64
    
    Thread 0 Crashed:
    0   libSystem.B.dylib                  0×90029ae5 _longjmp + 37
    1   00000000     0xc00101dd 0 + -1073675811
    

    I was looking for some similar bug at firefox bugzilla but, I didn’t found anything about it. That isn’t the unique problem, I’m coding a web interface to access and test some Webservices, then I discovered another bug: div element with visibility:hidden still show scrollbars, I couldn’t reproduce the problem on Firefox running over Win32 with the same html file, so I think that’s a bug.

    Berkeley e-classes for your IPod

    Written Sunday 07 January 2007 by Fernando Meyer.

    Last April, UC Berkeley, one of the premiere schools in the United States, announced its plan to put complete academic courses on iTunes. Fast forward nine months, and you can already find 59 full courses ready for your iPod. Simply click here to access Berkeley’s iTunes site (or here for the Rss feed).

    No matter where you live, you can access at no cost the very same courses attended by students paying full tuition. And, given the critical mass of courses being offered across a range of disciplines, you can put together your own personalized curriculum and expand your horizons on the fly.

    That’s include interesting computer’s science coursers like, CS 162 - Operating systems and System programming and CS 61C - Machine Structures. You can listen this podcast and forget about these classes in university (but I think that your teacher will not appreciate)

    Debug Backwards in time

    Written Thursday 04 January 2007 by Fernando Meyer.

    What if a debugger could allow you to simply step BACKWARDS? Instead of all that hassle with guessing where to put breakpoints and the fear of typing “continue” one too many times… What if you could simply go backwards to see what went wrong? This is the essence of the “Omniscient Debugger” — it remembers everything that happened during the run of a program, and allows the programmer to “step backwards in time” to see what happened at any point of the program. All variable values, all objects, all method calls, all exceptions are recorded and the programmer can now look at anything that happened at any time

    HomePage: http://www.lambdacs.com/debugger/debugger.html

    Article: http://www.lambdacs.com/debugger/Article.html

    Video: http://video.google.com/videoplay?docid=3897010229726822034&q=engedu+debugging

    Are you a professional programmer

    Written Sunday 08 October 2006 by Fernando Meyer.

    How do people become professional programmers? Many people go the “traditional” path through a computer science or software engineering education and from there into professional programming work. Others become professional programmers by accident. A person writes a small program to help at work, and their workmates say, “Oh great, you can write programs! You’re our programmer now!”

    This article explains what’s a real professional software developer, the real meaning of “Professional”

    http://www.developerdotstar.com/mag/articles/software_professionalism.html

    Are you happy at work

    Written Sunday 08 October 2006 by Fernando Meyer.

    Do you feel that you deserve promotion and more money? Are you focusing on what you want from your career?How passionate are you about your work?
    The best move to read about happiness at work. The site shares the good stuff, and there are some good places to start reading:

    Happiness at work is no longer a luxury - it’s the single best way to achieve lasting success and a worthwile work life.

    Firebug the javascript debugger for firefox

    Written Monday 14 August 2006 by Fernando Meyer.

    FireBug lets you explore the far corners of the DOM by keyboard or mouse. All of the tools you need to poke, prod, and monitor your JavaScript, CSS, HTML and Ajax are brought together into one seamless experience, including a debugger, an error console, command line, and a variety of fun inspectors.A quick overview of FireBug's features:

    • JavaScript debugger for stepping through code one line at a time
    • Status bar icon shows you when there is an error in a web page
    • A console that shows errors from JavaScript and CSS
    • Log messages from JavaScript in your web page to the console (bye bye "alert debugging")
    • An JavaScript command line (no more "javascript:" in the URL bar)
    • Spy on XMLHttpRequest traffic
    • Inspect HTML source, computed style, events, layout and the DOM

    https://addons.mozilla.org/firefox/1843/

    Aptana for Rails

    Written Sunday 13 August 2006 by Fernando Meyer.

    It’s a robust, free & open source (source available soon - licensed under the Eclipse Public License v1.0). After testing for a while, I put the radrails and RDT ( ruby development tools ) pluguins into Aptana. The result is a perfect web2.0 IDE to work on rails. Aptana IDE is supposed to be as good as dreamweaver. Aptana is a robust, JavaScript-focused IDE for building dynamic web applications. Highlights include the following features:

    • Code Assist on JavaScript, HTML, and CSS languages, including your own JavaScript functions
    • Ajax framework integration like DOJO, scriptaculos, AFLAX
    • Outliner that gives a snapshot view of your JavaScript, HTML, and CSS code structure
    • Error and warning notification for your code
    • Support for Aptana UI customization and extensions
    • Cross-platform support (mac, linux, win)

    Ajax links

    Written Wednesday 09 August 2006 by Fernando Meyer.

    Ajax links and interesting tutorials from Ajaxian.

    • How to design a large AJAX Application
    • In the guide you can download from the link above they cover the process of developed in the course of implementing two AJAX applications. This approach has made it easier for me to work with the design team, produce estimates for this type of project and communicate what is involved each step of the way to the project managers for scheduling purposes.

    • Adding AJAX to a website step by step
    • Webthumb is a small project of mine that takes a snapshot of a website and gives you thumbnails in 4 different sizes. Currently the site is rather boring and has a couple of usability problems especially on the pickup page. Over the next couple of days I’ll be using various AJAX techniques to upgrade Webthumb, writing about the process as things happen.

    • JavaScript Model-View-Controller with Dojo toolkit
    • The article describes an implementation of Model-View-Controller software design pattern in JavaScript. Created classes conform to Dojo toolkit class building concepts: dojo.lang.declare creates classes and dojo.event.connect supports low coupling of MVC.

    • RSS Feed Reader using Ajax and PHP Part1
    • RSS Feed Reader using Ajax and PHP Part2
    • This HOWTO I will explain how to build an RSS Feed Reader using AjaxAgent and PHP (sic, better than .net :P )

    Starting with ruby and rails

    Written Tuesday 16 August 2005 by Fernando Meyer.

    Like a Java developer for 4 years, I’ve seen programmers trying to complicate the things in a way such that even though they does not have “no idea” of that this for backwards of a functionality of the system. It isn’t a generalization, but, a peculiar characteristic of Java programmers. The majority always tries to use a lot of APIs and Frameworks to make a simple CRUD (acronym for Create Retrieve Update and Delete), I’ve seen cases where a simple system of email’s sender had 23 class that they dealt with since the sending until the writing in the database one log of sending, and an excessive amount of XML to configure frameworks. Just for a simple use-case1

    The people had lost motivation in deciding a problem with a simple and elegant solution. The best system is most complex and fuller of added documents, is these things that had been pushed at people’s mind today, and are a culture that the new professionals lead currently for the work market.

    Working a bit with “ruby on rails”. I could see how simple can be developed a web application. Without alot of configuration( java code/XML/scripts) methods and without my usual 5 frameworks. Rails is an excellent tool that interlook perfectly in the agile development environment.

    Trying:

    I come studying rails after a “warning” of a colleague who spoke to me: “Where cave that you lived that never heard to speak of rails” (question that I’ve answered with the name of my born location: Foz do iguaçu-Br). I started to look for in web about ruby and I’ve discovered a cool programming language with some characteristically interesting, Simple, robust and object oriented. Soon already it had introduced 50% of the concept, readily I started to search about rails, I’ve found a web site http://www.rubyonrails.com . I attended 30 times the video of rail’s demonstration and I didn’t believe on it. He developed a web application in 15 minutes without many delays, without configurations.(except of database.yml). My curiosity only increased, I’ve downloaded rails and as 99% of the people who worked with rails, making the same steps of the video to have certainty that functioned exactly. I’ve a Blog, made with ruby on rails was there after one 25 minutes. Soon I got passionate myself!

    I was in search of more material about rails and I’ve found the book Agile Web Development with Rails, Dave Thomas , and started to read, In the first pages, he say about 10 reasons to like rails.

    • It brings agility to web development.
    • I can create web pages with neat effects, just like the cool kids do.
    • It lets me focus on creating the application, not feeding the framework.
    • My applications stay maintainable as they grow.
    • I get to say “Yes” to clients more often.
    • Testing is built-in (and easy), so it gets used.
    • Instant feedback: edit the code, hit Refresh, and the change is in my browser.
    • Metaprogramming means I can program at a really high level.
    • Code generators let me get started quickly.
    • No XML, Scripting or code configuration

    Another cool things, like don’t need map a controller for URL standards with a configuration (like web.xml), separation of templates, and Activate Record(some times sql are half disordered, but it does not arrive the extremities as hibernate, and this is easy to correct), makes any person who works with development web to go heaven with rails.

    A cons that I had not thought but that I read in a web log: to carry an application in production state to a new framework can be a little stress and difficult, DBAs that likes names of simple tables and fields id to refer the primary keys, they’re rare.

    Before it thought that rails would be only another nerd’s toolkit to make little things in the Internet. But with passing of time I’ve already seen that people like Martin Fowler, had placed the hand in the rails and liked. Now recently Harding Piers wrote an article for sap to developer networks called SAP on Rails, and not on the skids where he shows as to integrate sap and rails to develop a application (you’re right that the connector has sufficiently code with bad smell and not beautifully code) but already is another reason to people turns the eyes for rails.

    Still can’t say that I’ll stop work with java and start with Rails, but rails is once of the best frameworks. And I would use it, at future not distant

    follow me on Twitter

    This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.