Saturday 27 February 2010

Using ImageMagick with perl to rotate/resize/etc tiff images makes them negatives

Solution is to add option=>'quantum:polarity=min-is-white' to the image object like this:

my $image = Image::Magick->new(magick=>'TIFF', option=>'quantum:polarity=min-is-white');

This is the perl equivalent (found after hours of searching the net :) of the convert.exe command line:

convert file.tif -define quantum:polarity=min-is-white -resample 200x200 [...]

Monday 15 February 2010

HTTP Sniffers

If you're in search for a HTTP sniffer that could show/dump the HTTP/SOAP conversation (headers and body) between your application and a server here are the free/trial choices I found usable:

- HTTP Debugger Pro (http://www.httpdebugger.com/) - sniffer for all traffic on any interface. However it is not showing the body of HTTP/SOAP requests/responses, only headers. This happened at least in my config were I had the client and server on the same machine ( a VM one; maybe they have problems with virtual interfaces?)

- Effe Tech HTTP Sniffer (http://www.effetech.com/) - it worked pretty well until the point it should catch a SOAP with DIME attachment HTTP conversation. There it failed to get the body of the request.

- SoapUI (http://www.soapui.org) - Their SOAP Monitor feature (described here http://www.eviware.com/blogs/oleblog/?p=827 ) is Santa's choice because it did the trick indeed, capturing all what I needed.
It should be used as a http tunnel but even so it works with both client and server on the same localhost. You should do 2 things to configure:
-- you need to create a new project
-- you need to add a wdsl file to the project in order to have an interface to listen to(?). I just added one WSDL file (http://www2.roguewave.com/support/docs/leif/leif/html/soapworxug/A-1.html) found on the internet and it started working without complaining that the file had nothing to do with my application.

Actually I tested even more applications but have found that:
- they need you to specify proxy in your app (they're built probably for browser sessions testing)
- they are completely buggy (too many to mention)
- they don't do what you expect (notably SOAP Sonar that looks impressive but doesn't do sniffing)

Saturday 6 February 2010

Slow laptop could mean subtle damaged harddisk

I encountered a strange case with a notebook that was really slow now and then, especially noticeable when writing something on its keyboard (like a simple web address in the browser).

It's true that it was badly treated and it has a broken corner due to a slip out from its case, associated with free falling from 1 meter or so. However, other than this slightly broken corner everything run apparently fine. Tried de-virus, de-frag, a successful hard disk thorough check (WD Diagnostics), almost reinstalled window$ but no change.

The explanation sprung naturally when the user noticed that, when playing movies (from hard disk) if shaken, the playback will be interrupted and then automatically restarted when stopped shaking it.

In other words there is something probably broken inside the hard disk that makes the whole system wait and request a re-reading of the current data if notebook shaken. I'd say is a damper broken or so.

Why lingering when typing?? Because of the small shocks from the fingers, the original user being an impetuous email writer.

Oddly enough, if shaken during the thorough WD diagnostics testing, it stops and waits for device to become ready each time it's shaken, however in the end the test result says everything is ok.