Archive for the 'General' Category

I’m speaking at EclipseCon 2008


I'm speaking at EclipseCon 2008

I will be talking about the BPMN modeler in a tutorial session, along with Hugues Malphettes and Alex Boisvert. You can chat with us on this mailing list if you have questions, or would like to help with the tutorial.

Please leave a comment if you want to meet for a beer!

NLS and StringBuffer

I was surprised to find in the M4 News And Noteworthy list a shortcut to change a concatenated String to StringBuffer.

At first, it looks like a good idea.

String s = "offset " + offset + " is at line " + line;

is changed to:

StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("offset ");
stringBuffer.append(offset);
stringBuffer.append(" is at line ");
stringBuffer.append(line);

I know using StringBuffers is better for performance UPDATE: I confused StringBuffer with StringBuilder! look at this bug for changing StringBuffer to StringBuilder.

I would have rather been going for this:

NLS.bind("offset {0} is at line {1}", offset, line);

Just because this is so much easier to internationalize.

I have almost finished doing i18n for the BPMN modeler, a component of the STP project, and I really lost time on such cases.

Just my $0.02!

SOA Tools Project On Subversion

Adrian Skehill and Matt just finished the migration of the STP project to Subversion.

Thanks for the awesome work guys!

Bugzilla won’t let me look

Bad surprise this morning:

trying to look for all the open bugs of GMF is just not possible apparently.

If you try to work around the limitation by searching for a space ” “, it results into an error:

You may not search, or create saved searches, without any search terms.

The help links look broken: I created the bug 205151 for that.

As for the listing of all open bugs, any workaround or fix is welcome.

Funnel 0.1

I worked some more on Funnel over the week-end to turn it into something usable. You can get it here.

The results look (In My Not So Humble Opinion) very good:

  • Funnel supports caching. It will register the feed if you ask it to, and will ping it back in case you update something. The data is stored in the database, maybe we can expose it if needed.
  • Funnel updates asynchronously. You run a script to update the feed data, and another one to generate the feed file
  • I made a nice website, that should be updated with more and more examples and documentation.

I still miss for now the background job that will trigger the update and generation scripts. It may be done using cron, which is fine for Unix-land.
I will probably add a rake task to force an update, and a script to run an update thread in background.

The admin interface is yet to be done. Once it is, I’ll shoot for 1.0. Stay tuned!

Push your feeds into Funnel

I have continued my experiment with the RSS libs a bit, and have built a first prototype that I call Funnel.

Funnel takes the feeds declared in the feeds table.

In a separate thread, it runs a script that looks at the feed, and if there is a new item or an item that looks like it is updated, it runs a filter on it.

The filter is completely extensible, so that I can add antispam measures later like I did here.

Once the item is accepted, it is picked up by the feed when building it using Builder.

I fund this project with Micropledge. Micropledge is a really cool website to get your open source projects funded. Check it out!

At this point, I achieved my primary goal but have new issues I need to deal with.

  • I want to record the feed optionally. I want to make it possible for the user to record completely the items in the items table, so that he does not have to bother about them.
  • I use Rails. While this gives a nice frame to my application, it is clearly overkill for some uses of Funnel. I think I should make it available in different little gems, and the core gem would provide pretty much as simple as Svn2Rss is.
  • The feed is not cached. It is currently recreated every time someone asks for it. Like Svn2Rss, I need to create an asynchronous way to output it.

If I have those core components working, I can easily create an administration interface and a UI to show my feed.

If you are interested into this project, you can fund it and/or join the mailing list:

Google Groups

Subscribe to Funnel Atom and RSS merger
Email:
Visit this group

Scala syntax extension

Follow up with yesterday:
you can get my Scala syntax gem extension here, and read below for the instructions on how to install it.

First here is the result:


/**
 so much fun
*/
class Auction(seller: Actor, minBid: Int, closing: Date) extends Actor {
  val StringForFun = "hello"
  val timeToShutdown = 36000000 // msec
  val bidIncrement = 10
  def act() {
    var maxBid = minBid - bidIncrement
    var maxBidder: Actor = null
    var running = true
    while (running) {
      receiveWithin ((closing.getTime() - new Date().getTime())) {
        case Offer(bid, client) =>
          if (bid >= maxBid + bidIncrement) {
            if (maxBid >= minBid) maxBidder ! BeatenOffer(bid)
            maxBid = bid; maxBidder = client; client ! BestOffer
          } else {
            client ! BeatenOffer(maxBid)
          }
        case Inquire(client) =>
          client ! Status(maxBid, closing)
        case TIMEOUT =>
          if (maxBid >= minBid) {
            val reply = AuctionConcluded(seller, maxBidder)
            maxBidder ! reply; seller ! reply
          } else {
            seller ! AuctionFailed
          }
          receiveWithin(timeToShutdown) {
            case Offer(_, client) => client ! AuctionOver
            case TIMEOUT => running = false
          }
      }
    }
  }
}

You will need to add those CSS elements to display things correctly:

pre {
	background: #000000 repeat-x;
	color: #00FF00;
	font-family: arial, 'lucida console', sans-serif;
	line-height: 160%;
	font-size: 120%;
}

code {
	color: #00EE00;
	font-style: bold;
	font-family: arial, 'lucida console', sans-serif;
}	

.comment { color: #333; font-style: italic; }
.keyword { color: #eff; font-weight: bold; }
.punct { color: #444; font-weight: bold; }
.symbol { color: #0bb; }
.string { color: #6b4; }
.ident { color: #00b; }
.constant { color: #66f; }
.regex { color: #a82; }
.number { color: #a33; }
.expr { color: #227; }

Then on your machine, you will need ruby and rubygems installed, and install redcloth and syntax:

gem install syntax
gem install redcloth

Put your sample into a text file in the same folder as run.rb, then run:

ruby run.rb myscala.txt > output.html

That’s about it. It’d be great to develop the same things for Java and CSS. In the mean time, enjoy!

Textile

When creating the documentation for svn2rss, I fell on the awesome “newgem” gem that Rubyforge provides to help outputting a website and releasing gems.

It was really very helpful, and I liked the way the syntax gem just transformed my ruby code into a nice color block. (I am still looking for the right shade of grey for the comments though)

I would like to provide an extension of the syntax gem to do the same thing for scala. (I still have to learn the language first, hopefully the pdfs on the website will be entertaining).

I haven’t been able to find a previous work in this area. Feel free to comment if you happen to have something already working.

Meanwhile, at Intalio…

Photo excerpted from Techcrunch fr.

Scala Eclipse plugin

Scala is a Java based language that combines the best of Ruby with strong types.

Sean McDirmid just released a new beta version of the plugin.

It is available through an update site: http://lamp.epfl.ch/~mcdirmid/scala.update

Congratulations to Sean for this achievement ! I look forward to dive into Scala and help on this front.

The complete announcement is available here.