Friday, October 30, 2009

FTP Issue: LPX-00200: could not convert from encoding UTF-8 to UCS2

I have an application that uploads XML files into an Oracle XML DB Repository. It was workinging succesfully on all documents except a few would fail...

My application would report the error:

FTPConnection closed

And in my Oracle logs I could see this error:

LPX-00200: could not convert from encoding UTF-8 to UCS2

I looked at the failing XML documents and noticed that they all had curly quotes in them. If I took them out, the file would upload.

The issue was that I needed to FTP as Binary and not as Text.

I was using the Java libarary FTPClient (it.sauronsoftware.ftp4j.FTPClient) and needed to set this command:


FTPClient .setType(FTPClient.TYPE_BINARY);

So just remember to use Binary mode when uploading to an Oracle XML DB Repository.

Thursday, October 1, 2009

Get the version number of an IDfSysObject in Documentum using DFC

I was in a situation where I needed to get the version number of a document. Such as 1.0 or 2.6 etc...

Unfortunately Documentum only provides a repeating attribute called r_version_label. This attribute can contain other values such as CURRENT or other user entered values.

But the important thing to note is that Documentum always stores the version number in the first r_version_label value.

Based on this assumption you can retrieve the version number from an IDfSysObject using the following ...

IDfSysObject.getRepeatingString("r_version_label", 0);


Hope this is helpful.

Thursday, April 23, 2009

Which is better for advertisers? MySpace or Facebook?


I had been using Facebook for a while... It has a minimum bid of 10 cents.  I was able to get a dozen or so hits a day with 15 cents as my maximum bid.

MySpace.com has a price per click miniumum bid of 25 cents.  Scared by the high minumum bid, I reluctantly tried it.  And I also set my facebook bid to 20 cents for comparison.

Myspace started getting me a couple dozen clicks a day, while my Facebook clicks skyrocketed and hit my $25 daily limit for a week straight.  Financing this out of my pocket money, I cannot afford $25 dollars a day so I had to lower my bid back down.  

...This leaving me with the conclussion that MySpace advertising is a waste of money.  At least looking at the cost per click.  MySpace does show your ad in a big banner though.  This works for increasing brand awareness for a company such as Coke, or for a new movie.  But for a startup like NoFouls.com, there is no value in showing an ad if the user is not going to visit your site.

So MySpace is a terrible place for startup advertising, Facebook eh... not so bad.  

Tuesday, March 17, 2009

How to combine 2 string arrays in java 1.4

/**

* Combines two string array's into one.

*

* @param first The first strings

* @param second The second strings

* @return The result will be a new String[] with the first array items,

* with the second array items appended

*

*

*/

private String[] combineStringArrays(String[] first, String[] second) {

   int total = first.length + second.length;

   String[] strings = new String[total];

   for (int i = 0; i < first.length; i++){

      strings[i] = first[i];

   }

   for (int i = 0; i < second.length; i++){

      strings[first.length + i] = second[i];

   }

   return strings;

}