I searched a bit but I did not find a satisfying solution. The next step was to debug the upgrade script. The blog component was disabled (because of too much spam) and the upgrade script considered it as missing. Enable all products and clear the forum cache before upgrading.

If you are already suck in the upgrade stage you can edit the tables of vbulletin directly. Go to vb_product and set active to 1 for the product that is causing problems. Next, delete the content of vb_cache. After this, you can run the upgrade script again.

The SimpleXML extensions is intended to provide a “very simple and easily usable toolset”. This description lets you think that is simple to use but a more accurate description is that it lets you use it for for quick and simple cases. The basic example looks good:

$movies=new SimpleXMLElement($xmlstr);/* For each <character> node, we echo a separate <name>. */foreach($movies->movie->characters->characteras$character){echo$character->name,' played by ',$character->actor, PHP_EOL;}

One little issue: $character->name is an object not a regular php string. As a result, you have to cast everywhere as if you use a static language:

if((string)$foo->bar=='etc'){

if((string) $foo->bar == 'etc') {

or

str_etc((string)$xml->str);

str_etc((string)$xml->str);

There are also small differences on what functions are available or how they work, depending on what version of PHP you use.

In case of a slightly more complex xml (like some custom data feed) it is an usual approach to convert the xml object to nested array structure. http://php.net/manual/en/book.simplexml.php has a section of user contributed notes that is full of post regarding this action. There are two basic approaches:

$array=json_decode(json_encode($xml),TRUE);...// some cleanup if neeed

and some recursive parsing of the xml tree. Both methods kind of work if applied for the right problem. This shows that for the more than basic tasks SimpleXML becomes cumbersome, a nuisance to use.

The extension could be improved a bit to make it more usable but I think a lot of problems come from the nature of the XML format. Most data feed providers do not actually need or use the power/complexity of the XML format and could use a lighter more suitable format. Used data from providers that could easily use csv or json. It is easier to generate, parse, debug and use a lot less bandwidth & processing power all at the cost of sounding less “enterprise”.

The output is 23455. This happens because the $x reference remains even after the foreach loop ends. The reference is destroyed if you unset $x after the loop.

This is not very well known. If you have the misfortune to maintain some scripts with a coding style involving little structure, lots of spaghetti code and nested includes than you might be very puzzled by the behavior of a regular foreach loop just because the iterating value was used previously as a reference.

Artificial inteligence(AI) is a complex branch of computer science involving a lot of research by private and academic entities. The Google AI Challenge brings bot writers around a simple and fun idea. The idea is to write a bot to play a strategy game against other bots.

In the next challenge the bots will play an Ants game where they control an ant colony fighting for resources against another colonies. The system is functional but in beta version. There is a set of APIs for most programming languages, a couple of tutorials and the source code for the system itself is available.

The University of Waterloo Computer Science Club is organizing the contest with Google as a sponsor. There are no listed prizes but for people with some spare time it will provide quite enough entertainment value. I hope to have a least a bit of spare time for this and play a bit with it.

The MySQL server root password is not used very often and you can forget it or you inherit some already setup system and you do not have the MySQL root password. Technically, there is no way to recover the password but you can reset it.

The main inconvenience is that you have to stop the database server twice. The following instructions were tested on a Fedora Linux distribution but the main idea can be used on different operating systems, including Windows.

The main idea is to restart the mysql server without security, change the root password and restart again in normal mode. I recommend not doing this on a live server but if you already need this than there is a big sign that your system design has some issues.

First, stop the mysql server:

# service mysqld stop

Start the server with an option that enables anyone to connect without password.

# mysql -u root
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.52-log Source distribution
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Let’s say that you want to use the password “NEWPASS”, in the mysql prompt type:

The problem: Display an image inside a panel and handle different zoom levels. The best approach is to use an already made component. If a component is not available or you just have to write it using only the basic Swing components than might help you save some time.

One approach is to hold a BufferedImage and the zoom level(integer, initial 100) and draw the image with appropriate settings in a JPanel. Overwrite the paintComponent function of a JPanel. Set the size of the panel to match the size of the zoomed image. Add this panel inside a JScrollPane and you have an initial version. Enable double buffering for the resulting panel to have a smooth appearance.

I prefer this approach instead of using a zoomed copy of the image as it saves a lot of memory.

The positions on the drawing panel match the positions on the zoomed image. The coordinates in the original image are calculated using a simple formula:

int imageX = panelX *100/zoom;

int imageX = panelX * 100/zoom;

If the zoomed image is smaller than the container than the image will be in the top right corner. Most users will want it in the center of the container. The solution is to wrap the drawing panel inside a centering panel. There a couple of solutions using a custom layout manager, a combination of Box layouts, SpringLayout, etc. A simple solution is the GridBagLayout:

When changing the zoom, change the size of the drawing panel and call invalidate() and repaint() on the scroll pane view port. Now you have zoom in and zoom out.

You will notice a small problem. The zoom is not very intuitive, it will move the image to the top left corner. A more usable panel would zoom in/out preserving the view on the same area of the image. You need to calculate the new view position. There a couple of ways to do this I will present one of them:

After a routing update, Fedora 12 has some problems with the DNS service. The named service fails to start with with the following error:

Error in named configuration:
/etc/pki/dnssec-keys//named.dnssec.keys:1: open: /etc/pki/dnssec-keys//production/bg.conf: file not found

The update was not a fortunate one and an official fix will probably be issued soon. A quick way is to disable the DNSSEC options in named. Edit /etc/named.conf and comment the following lines:
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside . trust-anchor dlv.isc.org.;

and at the bottom:
include "/etc/pki/dnssec-keys//named.dnssec.keys";
include "/etc/pki/dnssec-keys//dlv/dlv.isc.org.conf";

The DNSSEC features ads digital signatures to your DNS queries. If you need this, keep searching for other solutions.