Minor gotcha with Liza Daly’s fast_iter

February 1st, 2012

http://www.ibm.com/developerworks/xml/library/x-hiperfparse

This is a really useful article about “High-performance XML parsing in Python with lxml”.

But there’s one gotcha I’ve discovered with the fast_iter() method described therein. Can’t comment on that website without getting yet another developer ID, so I’ll describe the issue here and hope that Google picks it up.

The problem comes with nested tags with the same name.

For example:


<product>
<data>
<product>Some useful data</product>
</data>
</product>

As far as I can see, the internal “product” will be cleared before the external one is handled, leaving with you with an empty tag.

Stop Telling Everyone To Do Startups – Tell Them to Not Do It!

December 14th, 2011

As a woman who has run a startup, I’m confused by the furore about Penelope Trunk’s article “Stop Telling Women To Do Startups”.

I’d encourage anyone to think about working for themselves; I’ve found it on the whole more fun and better paid than working for others, you certainly have a closer idea of when your employer (= you) is going to run out of money and stop paying you…

But running a startup? When I founded my first startup in 1995, I’d always say to anyone who was thinking about starting their own – “Don’t Do It”. On the basis that if anyone was put off by that minor pushback, they’d never be able to stand the real pressure of actually doing it!

So the idea of telling anyone – woman, man, whatever – that they *should* be doing a startup… Well, that seems to me like something that would only be said by someone with a vested interest; or from someone who had no idea what they were talking about and therefore should not be talking.

Rachel

P.S. The original article from Penelope Trunk had a different title “Investors fund mostly men, which is fine for women”. TechCrunch seem to have added their own title to the same article.

Here’s the links:

http://blog.penelopetrunk.com/2011/12/11/men-are-getting-all-the-vc-funding-and-thats-fine/

http://techcrunch.com/2011/12/11/stop-telling-women-to-do-startups/

Query ‘SHOW PROCESSLIST’

October 3rd, 2011

SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;

gives the same info (in recent MySqls) and can be filtered;

HOWTO reconfigure timezone on ubuntu

September 20th, 2011

sudo dpkg-reconfigure tzdata

HOWTO: setup a new remote git branch

September 18th, 2011

- on local machine, create the branch
git branch mynewbranch

- push to remote
git push origin mynewbranch

- remove local branch
git branch -d mynewbranch

- pull down new remote branch
git checkout -b mynewbranch origin/mynewbranch

For any other nodes which need this branch:

git fetch origin
git checkout -b mynewbranch origin/mynewbranch

Based on http://progit.org/book/ch3-5.html, which has the clearest explanation I’ve seen.

AttributeError: ‘Libvirt’ object has no attribute ‘vm’

August 28th, 2011

Probable reason: Not providing the hostname option. (plus bug in handling the –overwrite option)

Workaround: Use a distinct hostname

how to describe a power cable

August 26th, 2011

http://en.wikipedia.org/wiki/IEC_60320

ImportError: No module named pstats

July 27th, 2011

Install python-profiler

MBR problem solved

July 27th, 2011

I’ve got one machine with a totally screwed MBR.

Booted into Ubuntu LiveCD, mounted main partition. Reinstalled grub. Working. Phew.


mount /dev/sda7 /media/maverick
grub-install --root-directory=/media/maverick /dev/sda
reboot

VirginBroadband ssh timeouts

July 20th, 2011

I attempted to upgrade to Virgin’s 50 Mbps Internet, so they replaced my old cable modem with their new SuperHub.

And immediately my ssh connections to remote servers started timing out after a couple of mins. Very annoying…

I’ve been on the phone to their support team and have so far been told:

  • “It’s a known problem with some hubs, we’ll send you another one.”
  • “It works for me. Can’t be a problem.”
  • “You’ve changed the hub’s IP address so that’s the problem.”
  • “It must be a problem with your computer.”

So now they’re sending me out an old-style cable modem. And in the meantime, I did some googling, and found this
rather useful thread on Virgin’s forums.

So basically, yes it is a problem, their staff should be trained to know it’s a problem, but there’s a work-around using the ssh options ServerAliveCountMax and ServerAliveInterval which might save my sanity.