Wednesday, March 31, 2010

Getting a resource file from a module

I am looking at some product upgrade code that is trying to find a resource file relative to a module definition and I thought this would be a good example of how not to do it.

The existing code is...

_for a_file _over sw_module_manager.module(_self.module_name).resource_files(:data, _true).fast_elements()
_if a_file.index_of_seq(xml_file_name) _isnt _unset
fn << a_file

... and can be replaced with ...

fn << smallworld_product.get_data_file(xml_file_name,office_upgrade_runner.module_name)

Not only is the latter easier to read than the former, the former does not actually return the expected files.[Note: I spoke too soon. The former code does work but in my opinion is not as clean.] Additionally, the former bit of code calls :resource_files() which is a restricted method. The latter code calls :get_data_file() which is classified as advanced and may legitimately be called from other methods.

FME Odyssey Slides Now Available

Safe Software staff recently did their '2010: An FME Odyssey' tour of select North American cities. I was fortunate to attend the one in Denver. This was my first time at a FME User Group meeting and found it very helpful and informative. The interaction with the Safe staff was great. I also found very helpful the presentations given by real FME users explaining how they were using FME to solve a particular problem. You can find all the presentation slides here.

While this blog is focussed on Smallworld, I would still like to suggest that even the presentations that do not cover Smallworld would provide benefit to Smallworld users because they describe how problems in various industry segments were solved using FME. The Safe folks liked to say "data format is irrelevant" when it comes to FME. I agree heartily and look forward to discovering ways that FME can provide business benefit to customers that store their data in Smallworld.

Tuesday, March 23, 2010

Solving the Travelling Salesman problem with Smallworld and Cloud Resources

Here's a tool that can solve the Travelling Salesman problem in Smallworld. It makes use of Smallworld features/trail to create a list of points to visit and then uses a combination of cloud-based services as well as other Magik classes to suggest a more efficient ordering of the points.

(Disclosure: I work for iFactor Consulting and have been involved in the development of the Web Maps Connector that the above-mentioned link references)

Friday, March 5, 2010

Emacs 23

My friend Igor Lapitski recently announced that he was releasing his customizations for Emacs 23. I started using it this week and the most noticeable feature is the slick auto-completion functionality. As you start to type variable names or method names in a .magik file, the system tries to do auto completion based on both previous examples of that string in the current file and matching method names based on the method finder for that image. It works surprisingly fast and gives good results.

There are a lots of other cool features in this release. You can download it from here.

As I find other ones that stick out, I will post about them, too.

Wednesday, March 3, 2010

Smallworld EMEAI 2010

I arrived at the conference venue today. Nice weather in Noordwijk (on the beach south east of Amsterdam).
My main purpose here this week is to demonstrate the Web Maps Connector (the iFactor Consulting product that lets you view Bing Maps as a dataset in your Smallworld applications). I am fortunate to be hosted by the team from Realworld. You can see my demos at the Realworld booth starting at the reception this evening.

I also have interests in Smallworld/FME integration, visualization techniques, and any cool Magik code my colleague Graham has put together. (If you are a Magik GUI developer and you haven't tried his Dialog Designer you owe it to yourself to see a demo). Please stop by the booth and introduce yourself. I am very excited about being at this conference and look forward to meeting many of you.