Little Continuous Integration with Growl Notifier 2

Posted by Fernando Meyer on November 19, 2007

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

Antlr Lecture at Conexao Java 2007 3

Posted by Fernando Meyer on November 12, 2007

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

Interesting links for today

Posted by Fernando Meyer on July 17, 2007

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

BRMS demo available 1

Posted by Fernando Meyer on July 14, 2007

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.

Alligator Eggs

Posted by Fernando Meyer on July 10, 2007

I grab this url from a stashed place in the web 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.

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

Posted by Fernando Meyer on May 04, 2007

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.

Debugging Backwards in Time 3

Posted by Fernando Meyer on January 04, 2007

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

Static reflection request 1

Posted by Fernando Meyer on September 26, 2006

What would you like to do with Java and cannot? Perhaps write code like.

[java]mock.expects(once()).method(Foo.class.instanceMethods.bar(String.class));[/java]

insted of:

[java]mock.expects(once()).method(”bar”).with(isA(String.class));[/java]

I don’t even know, why sun still use isA?

Carlos Villela wrote about a new feature request for Java’s reflection API on his blog.

Starting with ruby and rails 1

Posted by Fernando Meyer on August 16, 2005

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 ;)

Fernando Meyer fmcamargo at gmail.com

1 “Still those exist that would above create 30 types of different documents for email sender’s use case ;)”