The reason Object-oriented programming seems to help us handle complexity is because it forces us to write code in a specific fashion instead of a huge variety of ways. Task-oriented programming is much more intuitive, which is why programming started that way. Object-orientation takes training...

As some of you make know, I'm working on XMPP (Jabber) integration for the StackOverflow chat system, as an XMPP component written in Ruby using the xmpp4r package.
I'm struggling with one issue (well, many issues, but one issue at the moment :-) I am taking the JSON feed from the chat and extra...

Been scratching my head on this for a while....
I have a PDO object with pdo->setAttribute(PDO::ATTR_AUTOCOMMIT,0); as I want to use FOR UPDATE with some InnoDB tables. Reading the MySQL documentation, FOR UPDATE will only lock read rows if:
You are in a transaction
You are not in a trans...

Are you running on *nix? If so, I'd delegate the problem to xmllint. I work with a system that generates xml before sending it over the net; we validate our xml with xmllint, like so:
command = "xmllint #{temp_file_path} --schema #{schema_file_path} --noout 2>&1"
output = `#{com...