Thursday, 12 November 2009

How to Run Multiple/Concurrent OpenOffice.org Instances on Windows

In one of the project at work we have been using OpenOffice.org running in headless mode to do document format conversions in the background, i.e. converting to and from various MS Office formats OpenDocument formats and PDF. One problem of using standalone OpenOffice.org installation as backend is that you can only run one instance at a time. So while you can have a multi-user front end doing various processing, we used to be able to run document format conversion one at a time.

That sucks.

Here’s a trick to run multiple OpenOffice.org instances concurrently, all from one single installation, on Windows. Assuming the latest OpenOffice.org 3.x is installed. It’s actually pretty simple — just change the USERPROFILE environment variable! Or HOME on Linux/Solaris.

For example, in Java

ProcessBuilder pb = new ProcessBuilder("c:\\Program Files\\OpenOffice.org 3\\program\\soffice.exe",
    "-accept=socket,host=localhost,port=7999;urp;StarOffice.ServiceManager",
    "-invisible", "-headless", "-nologo", "-nofirststartwizard");
Map<String, String> env = pb.environment();
if (windoze) {
    env.put("USERPROFILE", "c:\\temp\\12345");
} else {
    env.put("HOME", "/tmp/12345");
}
Process ooo = pb.start();

Yeah I am putting this here because the search result on Google is pretty junky. And I just realised that I have not blogged for yonks. Busy buys busy.

Category: Technology | 0 Comment
Thursday, 11 June 2009

WordPress 2.8 “Baker” Released

Got it on WordPress’ Twitter status:

WordPress 2.8 “Baker” is now live to the world! http://bit.ly/wordpress28 (spread the good word)

Yup. It is here, and you can read more about the new features here. To upgrade to the latest version using subversion while Automattic haven’t tagged the 2.8 –

  1. Go into your previously checked-out WordPress directory
  2. Run svn switch -r 11549 http://svn.automattic.com/wordpress/trunk/
  3. Navigate to http://yourblob/wp-admin/upgrade.php

Done! You are running WordPress 2.8! Of course some plugins and themes might not work but who cares. You are now using the latest and greatest :) Most new features are admin panel related, but the one that interests me the most is:

  • Support timezones and automatic daylight savings time adjustment

Yes — it’s about time!

Friday, 29 May 2009

Top 500 Sites in Australia According to Alexa

Need to analyse a list of top sites in Australia, and the following Python scripts helped me to get the site name + domain name off from Alexa with minimum effort:

#!/usr/bin/env python
import re, urllib
r = r'<a  href="/siteinfo/(.*?)"  ><strong>(.*?)</strong>';
for i in range(25):
    u = 'http://www.alexa.com/topsites/countries;%d/AU' % i
    for x, m in enumerate(re.findall(r, urllib.urlopen(u).read())):
        print '%d. %s (%s)' % (x + 1 + i * 20, m[1], m[0].strip())

YMMV. Considering how Alexa has been trying to obfuscate their HTML pages to prevent scrapping, I won’t be surprised that this script stops to work tomorrow…

Thursday, 30 April 2009

Tour de Googleplex, Sydney

Saw this on Sydney Morning Herald yesterday — Google named Australia’s best place to work:

After its outstandingly successful parent company topped a 100 Best Places To Work survey conducted by the US magazine Fortune, Google Australia has claimed the No.1 spot in a similar Australian poll.

BRW, which conducted the study, said Google had created a legendary corporate culture of perks, fun, appreciation and reward for its staff.

I actually had a privilege to tour the new Googleplex in Pyrmont last Thursday for the Google Partners’ Day. That was quite an experience. Read on to see what I have learnt on that day.

Continue Reading »

Thursday, 26 March 2009
Friday, 20 March 2009
Thursday, 19 March 2009
Tuesday, 10 March 2009

At Physio This Morning

What happened yesterday morning at 5:30am

  • Anna called from her room that she wanted to go to the bathroom
  • Got out of bed, went to her room, and then carried her all the way to bathroom for wee.
  • Carried her all the way back to her room and put her to sleep.
  • Back to my own room. Laid down on my back…
  • “Ouch”

Yeah. Somehow I injured my back — to a point that it was too painful to go to work yesterday. Vivian booked me to see the physio at Unigym this morning so I can at least have some “fix” before heading to work. It’s the same physio she visited last week, whom I have never met, nor knew that Vivian and I are related.

So this morning. After filling out the form, she said, “Oh, your wife and daughter been here before?” Yup, that would be Elsie.

“Yeah?”

“She looks just like you!”

“Right… You haven’t seen the other one!”

Told Vivian about how others commented the similarity between Elsie and me when I got home this evening, and she wasn’t impressed :)

Anyway. At the end of the day, I need

  • A lot of stretches throughout the day.
  • Frequent exercise during the week.
  • Good posture when sitting in front of computers.

Or maybe I need to find a job that is not desk-bound…

Category: Life | 1 Comment