12/03/2008

iPod / Zune feature request: Listen to Video

Just a little feature request. I'd like to be able to play a video file as an audio file on my Zune.

For certain shows, EX// Russell Peters comedy acts - I'd like to be able to turn off my LCD screen so I can just listen to the audio.

My primary reason for wanting this is to save some juice.

Over and Out

06/03/2008

Holy Hadoop!!

I'm still trying to decide if I mean holy as in holy grail or holy crap cause they are both pretty applicable.

Yahoo launched Haadop in production today and I have to say the statistics are bloody unbelievable. Whomever questioned Microsoft's reasons for wanting to buy this company may either be a financial analyst or partially crazy.

Statistics:
  • Number of links between pages in the index: roughly 1 trillion links
  • Size of output: over 300 TB, compressed!
  • Number of cores used to run a single Map-Reduce job: over 10,000
  • Raw disk used in the production cluster: over 5 Petabytes


Open Office Sucks and So Does Your Face (UnoRuntime + C#)

If you are stubborn, or an idiot, or you just like using junky apps Open Office is for you. This is probably one of the only situations I'd suggest paying for and installing Office 2007 / 2003. It's just worth it.

I've been doing some automation in C# / Open Office [which I would love to rename Open Orface] and have been having issues porting Java code into C# - especially with this god darn UnoRuntime B.S.

So, what the fark is UnoRuntime and how the hell do I use it in Open Office. Well, I'm not going to get into the nitty gritty about it here - rather I'm going to explain how you don't use this somewhat core seeming object when building automation in C#.

As I'm sure you are aware - UnoRuntime is not available from C# - BUT - Most of the Java examples use this object heavily to query the UI layer and for object creation (or brokering I'm no expert under the Open Orface hood).

At first I took a look into Marshal.QueryInterface method just to see if I couldn't find the UnoRuntime somewhere in the COM layer - I turned around and decided to use an elaborate try catch + reflection algorithm to gain some concrete understanding of what was in the uno objects.

As you work more with Open Office you will realize the C# library uno, and unoidl namespaces merely contain gigantic unorganized transparent object proxy's that point into completely nonintuitive open office objects. Moreover, these open office objects are heavily based on the use of Interfaces - well I looked a bit deeper into the types I was calling and low and behold - they are pretty much huge junky objects that expose a countless number of interfaces - so we don't really even need the UnoRuntime (which makes me wonder why Java uses it).

The bottom line in this article is that UnoRuntime doesn't exist in C#. If you are porting Open Orface Java code into C# then forget about UnoRuntime. Do everything through casting and shut the hell up.

Here is an example of the Java to C# difference in creating a text property replacer:

xRepDesc is of interface type: XReplaceDescriptor AND XPropertyReplace so you can just cast the xRepDesc into XPropertyReplace and boom you're running.

Java:
XPropertyReplace xPropRepl = (XPropertyReplace) UnoRuntime.queryInterface(XPropertyReplace.class, xRepDesc);

C#:
XPropertyReplace xPropRepl = ((XPropertyReplace)xRepDesc);

Just in case you don't know, you create the xRepDesc object by, guess what - casting xComponent (of type - you guessed it XComponet - seriously wtf is an XComponent):

XReplaceDescriptor xRepDesc = ((unoidl.com.sun.star.util.XReplaceable)xComponent).createReplaceDescriptor();

I'm going to go ahead and call this automarshalling and be done with it. It sucks and if I had a server app I'd be tempted to write all my Open Orface automation in Java and write a high level COM abstraction to port a simple oAssWrapper.RunJunk(params) method and not have to deal with the hassle - OR - just go the Open Document route and use MS Word automation and then merely use open office to convert the document.

Over And Out