File Encoding Conversion

Posted by Paolo Wed, 27 Feb 2008 18:47:00 GMT

This morning I struggled a bit to find a decent encoding converter for osx… from time to time I get stuck on encoding issues so I wanted to have something ‘friendly’ to handle this kind of problems…

I found Cyclone based on Apple Text Encoding Converter (look for TEC) but it kept failing in some strange ways (It gave me weird messages about converters creation). After googling for a while I gave up. It seems there are no good-free-GUI alternatives on the net…

Sometimes the solution is closer than you think and the good old iconv rescued me in a snap:

[paolo@fingus]$ iconv -f UTF-16 -t UTF-8 utf16_file.txt > utf8_file.txt

you can list the available encodings with:

[paolo@fingus]$ iconv -l

The cool part is you can use it in conjunction with TextMate’s Filter Through Command feature thus enabling in-editor lightning-fast conversions.

The only missing part was discovering the original file’s encoding, in order to pass iconv the correct -f option. The not-so-reliable way I used was to open the file with Firefox and inspect the encoding using the View -> Character Encoding menu item.

That’s it, problem solved. If you know better ways to do this… let me know!

Socialize it: Add to del.icio.us Digg it! Technorati: File Encoding Conversion Add to reddit.com

Posted in  | Tags  | 1 comment | no trackbacks

SpringFramework meeting report

Posted by Paolo Fri, 20 Jul 2007 14:35:00 GMT

Last weekend I had the opportunity to give a speech at the Spring Framework meeting in Cagliari.

My speech was about new features I and Michele added to the Java Parancoe framework, fixtures and plugins (the Parancoe website hasn’t been migrated from the old java.net one yet so be patient).

I think Parancoe is now the only Java framework that supports Yaml fixtures as RubyOnRails does, and that’s pretty cool because we can now have solid functional tests and we can share test data between the test and development environment.

The pluggability of Parancoe it’s a cool feature too, we can now extend the framework without cluttering the core… You just define a fragment of a web application and you can put its jar file in the classpath, thus enabling the plugin. Plugins can autocreate tables, populate them with yaml fixtures, expose DAOs, business services, controllers and can interact with the application lifecycle (filters/interceptors or context listeners).

An example? the Italy Plugin. If you drop the parancoe-plugin-italy.jar in your classpath your application will be blessed with 4 new auto-created tables: Comuni, Provincie, Regioni, Procure. Those tables get auto-populated with real data when your app starts, and you’ll automatically have the spring managed DAOs you need to interact with these tables exposed in your spring context. Having these kind of modules simplify and quickens the development of your Java applications.

Many other plugins are on the way, World Plugin and Security Plugin on top of them.

PS: If you’re interested in the Parancoe framework, drop me a line or put a comment here.

Getting back to the SpringMeeting. I’ll point you to a few resources:

That’s it for now…

Socialize it: Add to del.icio.us Digg it! Technorati: SpringFramework meeting report Add to reddit.com

Posted in , ,  | Tags , , , , , ,  | no comments | no trackbacks

Todo list and next action with GMail

Posted by Paolo Mon, 07 May 2007 18:49:00 GMT

I’m kind of getting into GTD during this period, but I find myself very lazy at organizing my stuff. I find it pretty difficult to stick with a specific tool for managing my todo list. Basically I don’t want to use yet another tool, and I feel I would only need a quick and dirty solution to track my todo items and my very next actions.

After trying a bunch of tools I came out with this simple solution: I store todo items in my GMail account. Nothing new or very smart, but it works pretty well. Let’s see how to do it:

  1. create a new contact named todo whose email is your_account_name+todo@gmail.com (eg: paolo.dona+todo@gmail.com)
  2. create a label todo
  3. create a filter that matches to:(your_account_name+todo@gmail.com) and do this: Skip Inbox, Apply label “todo”.

Once you’ve completed these little steps, you can start using your brand new todo-list manager. Oh well, I haven’t told you how to use it yet… so:

How to add a todo item?

Send an email to your todo contact (It’s just yourself!) and it will be automatically archived, this way it doesn’t clutter your inbox.

How to see your pending items?

Click on your todo label inside the left Labels box.

How to mark a todo item as finished?

Delete it. (YOU said it’s finished :-P)

How to mark a todo item as a “next action”?

Star it.

How to see you next actions?

Run this search: label:todo is:starred. Actually I’m using the saved searches greasemonkey script to save this query and have it available as a next actions link just under my Labels box.

Conclusions

This approach is very simple but I see a few key benefits in it:

  1. Gmail is always open in my browser, I don’t need to keep another window or tab open just to see my todos.
  2. I can add filters that automatically populate my todo list. For example my Google Calendar reminders get labelled as todo so I can see them in my todo list. The same happens with Basecamp or Highrise todo item/task notifications.
  3. You can play with labels and easily let todo items belong to projects, locations etc (GTD style).
  4. You can reply to your todo items to add comments or further details to the activity they refer to.

Feel free to share your ideas on this.

Socialize it: Add to del.icio.us Digg it! Technorati: Todo list and next action with GMail Add to reddit.com

Posted in  | Tags , , ,  | 4 comments | no trackbacks

DNS shortcuts by OpenDNS

Posted by Paolo Mon, 23 Apr 2007 19:34:00 GMT

Today I discovered a nice feature of OpenDNS: if you register an account in opendns.com you will be able to map URL shortucts to web sites. They will be recognized automatically when you type them in your preferred web browser. For example I mapped “mail” to http://mail.seesaw.it, and this allow me to open my webmail page just typing “mail” in my firefox navigation bar. This could be even faster than using a bookmark if you’re already using keyboard shortcuts in your browser.

A sample: I often need to open the SeeSaw’s Basecamp account (http://seesaw.seework.com). I registered an OpenDNS shortcut named “bc” that points to that URL and now I can do something like:

  • open firefox (ALT+SPACE, type “f” then ENTER) using Launchy.
  • open basecamp in firefox (CTRL+L, type “bc” then ENTER)

Pretty cool! Of course you need to use OpenDNS in order to make that work.. Happy shortcutting!

Socialize it: Add to del.icio.us Digg it! Technorati: DNS shortcuts by OpenDNS Add to reddit.com

Posted in  | Tags ,  | 4 comments | no trackbacks

Fixing KRJS

Posted by Paolo Fri, 02 Mar 2007 19:19:00 GMT

A few days ago I discovered the great KRJS Plugin for RubyOnRails. It basically lets you write callbacks methods in your controller and binds them to ajax calls based on a naming convention.

You can write something like this:
def on_account_login_blur
   render :update do |page|
      page.insert_html :after, 'form', '...'
   end
end

that is automatically AJAX-invoked at the onBlur event in the account_login input field.

KRJS inserts the onBlur event in your field if it finds a matching method in the current controller.

The only issue with this plugin is that it redefines TagHelper’s tag and content_tag methods. So, if you’re using something like:
ActionView::Base.field_error_proc = Proc.new do |html, instance|
  # customization of your error messages here
end
...you’re losing all your error handling goodness. I struggled a bit with this and end up rewiting KRJS to use the rails alias_method_chain over the original tag and content_tag methods. While doing this I also tried to clean up the code a bit.

So if you’re interested you can download my version here,. Don’t be afraid to report any issue, it’s alpha code …

Good AJAXing

Socialize it: Add to del.icio.us Digg it! Technorati: Fixing KRJS Add to reddit.com

Posted in  | Tags , , , ,  | 2 comments | no trackbacks

Auto-Completion in Irb

Posted by Michele Tue, 17 Oct 2006 20:12:00 GMT

A fast & effective way for having auto-completion in irb (with some limitation) via web on rails

Socialize it: Add to del.icio.us Digg it! Technorati: Auto-Completion in Irb Add to reddit.com

Posted in  | Tags , , , ,  | no comments | no trackbacks

Older posts: 1 2


SeeSaw srl - Via Monte Pasubio, 8 37126 Verona - tel +39 045 4857457 fax 045 4851151 P.Iva 03609790237