Wednesday, December 02, 2009

openoffice Word to HTML conversion failed, ErrorCodeIOException - ErrCode = 1287

I'm converting Word documents to html using openoffice 3.1 headless version with uno protocol (python).
Reading the Word document with loadComponentFromURL was successful, but saving it as html using storeToURL threw com.sun.star.task.ErrorCodeIOException with ErrCode = 1287.

Interesting thing was the conversion worked great when I ran the code locally on the production server (debian 64), using the python's main function (if __name__ == "__main__"), but failed when I ran it from a remote machine, using http post.

I couldn't find this error code on the internet, so now that I've found the solution I'm posting it.

The issue was improper permissions for the soffice process to write the file in the target directory.

The soffice process ran under user A, and the python code ran under user B. The target directory was created in the python code, user B, so the soffice couldn't write in it.
When I ran the code locally, I logged in with user A, and that's why it worked. Had I logged in with user B I would have seen the same error.
Solution was to add users A and B to the same user group on the debian machine.

QED.

Sunday, November 15, 2009

tidy crashed on Debian 64bit

I'm was working on a python project that invoked a tidy process. We were using the tidy python wrapper utidylib for that, with this code:
import tidy
tidy_obj = tidy.parseString(html, {})
tidy_outstream = StringIO.StringIO()
tidy_obj.write(tidy_outstream)
tidy_html = tidy_outstream.getvalue()
And it worked fine. Almost.
When  invoked it more frequently, i.e. every few seconds, it sometimes succeeded and sometimes crashed, FOR THE SAME HTML INPUT.
Searching the Internet I found that there is a known issue of tidy crashes on Debian 64 bit machines. Too bad.
Looking for an alternate tool to do the same trick I found another python wrapper for tidy that pretends to solve this issue: pytidylib. And the syntax is simpler:
import tidylib
tidy_html, errs = tidylib.tidy_document(html, {})
And guess what ? tidy process no longer crashes !
And while you are reading this, you may find this list of tidy options useful.
Enjoy tidying :-)

Thursday, November 05, 2009

Free Vulnerabilities Detector Tool - Secunia Personal Software Inspector (PSI)

I found this free software that scans your pc and detects software vulnerabilities and code flaws, alerts for installed programs that expose you to security threats and lists the latest security updates and patches you need to install. It also gives you the link to the relevant upgrade.

I scanned my pc and it found some programs needed an update such as: old version of firefox I had installed aside to the latest version I have,  ancient version of Adobe Reader, stale JRE, vulnerable Windows Media Player (6.x ...), .NET framework needed to be patched and some other flaws.

After I found some trojan horses on my machine last week, this is a tool I recommend wholeheartedly.

Secunia Personal Software Inspector (PSI), download here:
http://secunia.com/vulnerability_scanning/personal/

Wednesday, September 23, 2009

Dojo 1.0 and Beyond

Here's a presentation I gave last year about the Dojo library.

The presentation will teach you:
1. What is Dojo.
2. Dojo design goals.
3. Dojo concerns (widgets, packaging, data access, DOM scripting and performance).
4. Difference between Dojo Core, Dojo Dijit and DojoX and what's inside each package.

Presentation URL:
What is Dojo 1.0 and Beyond

For more about Dojo, visit dojotoolkit .

Here I go again...

It's been a while since I updated this blog... sorry :-)

SO (crossing my fingers),
I'm back in town, and plan to update this blog regularly.
I'll start with posting some presentations I gave at work (sharedbook dot com).

Stay tuned !