Talking XMLRPC to a Wordpress instance

This is a short example demonstration how to use the Apache XMLRPC library to talk to a running Wordpress instance.

Wordpress 1.5 supports various XMLRPC operations by default ( MT & Blogger APIs for example ) however the two shown below are "demo" operations that all Wordpress installations should support and require no authentication.

To run this example you will need to include the dependencies - Apache XMLRPC & Jakarta COMMONS Codec - however if you are lazy, here is my "xmlrpc-2.0-dep.jar" JAR containing both.

Code

JAVA:
  1. import java.util.Vector;
  2.  
  3. import org.apache.xmlrpc.XmlRpcClient;
  4.  
  5. public class XMLRPCTest {
  6.  
  7.    /**
  8.     * @param args
  9.     */
  10.    public static void main(String[] args) {
  11.  
  12.       try {
  13.          
  14.          Object result;
  15.  
  16.          /* You can specify an alternative target URL here */
  17.          XmlRpcClient xmlrpc = new XmlRpcClient ("http://blog.lobstertechnology.com/xmlrpc");
  18.          
  19.          
  20.          /*
  21.           * demo.sayHello operation, returns a java.lang.String
  22.           *
  23.           */
  24.          result = xmlrpc.execute( "demo.sayHello", new Vector() );
  25.          System.out.println( "demo.sayHello: " + result +
  26.             " (" + result.getClass().getName() + ")" );
  27.  
  28.          
  29.          /*
  30.           * demo.addTwoNumbers operation, returns a java.lang.Integer
  31.           *
  32.           */
  33.          Vector params = new Vector ();
  34.          params.addElement ("5");
  35.          params.addElement ("8");
  36.          result = xmlrpc.execute( "demo.addTwoNumbers", params );
  37.          System.out.println( "demo.addTwoNumbers: " + result +
  38.             " (" + result.getClass().getName() + ")" );
  39.          
  40.       } catch ( Exception e ) {
  41.          e.printStackTrace();
  42.       }
  43.      
  44.    }
  45.  
  46. }

Example

CODE:
  1. demo.sayHello: Hello! (java.lang.String)
  2. demo.addTwoNumbers: 13 (java.lang.Integer)

Related Links

XMLRPCTest.java - Java Source Code
xmlrpc-2.0-dep.jar - Dependencies
Apache XMLRPC - http://ws.apache.org/xmlrpc/
Jakarta COMMONS Codec - http://jakarta.apache.org/commons/codec/

Using MEncoder to convert a DVD to DivX

More for my own benefit, but here goes...

This is an example of using MEncoder (Windows version) to convert a DVD to DivX. The original movie was widescreen and is being rescaled here to 720x408 to keep the 16:9 aspect ratio. The video bitrate I used was 1024kbit but you can tweak this as desired.

It may seem unusual for the first run to output to NUL ( /dev/null ) but actually the first run is writing information out to the file "divx2pass.log" and the second pass writes the movie out.

XML:
  1. mencoder -dvd-device D:\DVD\DVD_VIDEO dvd://1 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1024:mbd=2:turbo:vpass=1 -oac mp3lame -lameopts vbr=3 -ffourcc DX50 -vf scale=720:408 -o NUL
  2. mencoder -dvd-device D:\DVD\DVD_VIDEO dvd://1 -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=1024:mbd=2:turbo:vpass=2 -oac mp3lame -lameopts vbr=3 -ffourcc DX50 -vf scale=720:408 -o DVD_VIDEO.avi

Related Links
MPlayer (provides MEncoder) - http://www.mplayerhq.hu/homepage/
MEncoder Introduction Guide

MediaCodeSpeedEdit tool for DVD-Writers by ala42

Stumbled across this when trying to find out why my 16x DVD media wouldn't burn at anything higher than 4x.

Download your drive's latest firmware, feed it into MediaCodeSpeedEdit and you can edit the burn speeds for all media the drive can recognise.

Save the modified firmware and re-flash your drive with it. Pretty neat!

My only gripe is that the way you do it seems a little odd from the user-interface point of view. You select the media code of your blank discs by name, then double-click it to replace its burn speeds with the speeds of another media code. But hey..... it works!

Related Links

MediaCodeSpeedEdit - http://ala42.cdfreaks.com/MCSE/

[Oracle Toplink] Importing a 10.1.3DP3 project into the 10.1.3DP4 workbench doesnt work…