I recently read an article on Engadget about how Apple is removing protective screens from their store. There's a lot of sinister comments about how Apple is probably going to be making a competing product, or they are "censoring" products now... but I think the reality is much simpler; they are ugly. End of story.
How many times as one of your iPhone/Touch friends came up to you and said, "Hey, check out my new ultra kool iPhone...", and then they proceed to hand you a condom wrapped device with the plastic screen protector starting to fall off, or chipped around the edges.... Yeah... we've all been there. And then when you pull out your Nexus One and show them, they give you this look like... "Well, try to imagine mine without the condom and screen protector that's starting to peel away... mine would look way cooler than yours then..."
Bottom line, is that Steve doesn't believe the iphone should be wrapped in condoms, duct tape, electrical tape, or plastic screen things. The iPhone probably does look cool without all those things... but good luck finding one.
Everytime I see people holding an iPhone wrapped in some awful wrapping, I imagine that if I walked into their livingroom, I'd probably find that their furniture draped in large plastic coverings....
Wednesday, March 17, 2010
Wednesday, March 3, 2010
My App Store is Bigger Than Yours...
Really people, is this what it's come down to. It seems that every few days I see a blog posting that heralds Apple because they have 140K+ apps, followed by, "oh and Android has a pitiful 20K+ apps".
What's the obsession with this comparison. Let's face it, once your get past the first 1000 apps, you really don't have much left for comparisons. How many calculators, twitter clients, flashlights, farts, etc, do we need? I mean, using the # of apps as a success metric, would indicate that the Apple Mac OSX is basically a failure. I mean windows has far more apps for the desktop than Apple, so, we must conclude that Apple has failed on the desktop, and should just fold up shop now. The reality, is the Apple's desktop is probably just a strong as Windows, since again, after we get past the first several hundred apps... the rest really don't do much to attract a person to one OS vs the other.
It seems that this obsession with App numbers goes even deeper making intelligent people making statements like... "Apple can't help but to succeed with the ipad... when it releases, it will have 140K+ apps at its disposal". I had someone say those exact words to me. My comment was, "Oh, so OSX doesn't have 140K apps". Let's face it, OSX has more than 140K apps, so it would make more sense for Apple to install OSX on a tablet to gain access to the millions of applications available on OSX. But wait, that would mean that Apple couldn't control what you do with the device, and they could install applications from other sources, other than Apple. That's not good for Apple.
I don't think that anyone is going to disagree that the iphone has more apps. I have an ipod touch and an android phone. I've installed about 20 apps on each, and beyond that, I can't say there's much more that really interests me. Everyone is different, so chances are you are going to have a different set of 20 apps, but I'm willing to bet that even in those 20, we are going to have some overlap.
The number of apps in the store is a good marketing metric, but it doesn't indicate a useful measure of applications. I've had people say that "free apps" are useless because they are free. You do realize that the difference in 95% of the cases between a free app and a paid one... is the price. I mean, in most cases, it's still some poor smuck writing the application in his/her spare time after work. One person decides to give it away (like doing charity) and the other person decides to charge 99 cents.
I think a better metric is to look at metrics like month over month growth, and return rates, etc, but you don't see a lot of that happening.
So, the next time you hear yourself croaking out the 140K stat about the Apple App Store, just ask yourself, is that a relevant statistic in your argument.
What's the obsession with this comparison. Let's face it, once your get past the first 1000 apps, you really don't have much left for comparisons. How many calculators, twitter clients, flashlights, farts, etc, do we need? I mean, using the # of apps as a success metric, would indicate that the Apple Mac OSX is basically a failure. I mean windows has far more apps for the desktop than Apple, so, we must conclude that Apple has failed on the desktop, and should just fold up shop now. The reality, is the Apple's desktop is probably just a strong as Windows, since again, after we get past the first several hundred apps... the rest really don't do much to attract a person to one OS vs the other.
It seems that this obsession with App numbers goes even deeper making intelligent people making statements like... "Apple can't help but to succeed with the ipad... when it releases, it will have 140K+ apps at its disposal". I had someone say those exact words to me. My comment was, "Oh, so OSX doesn't have 140K apps". Let's face it, OSX has more than 140K apps, so it would make more sense for Apple to install OSX on a tablet to gain access to the millions of applications available on OSX. But wait, that would mean that Apple couldn't control what you do with the device, and they could install applications from other sources, other than Apple. That's not good for Apple.
I don't think that anyone is going to disagree that the iphone has more apps. I have an ipod touch and an android phone. I've installed about 20 apps on each, and beyond that, I can't say there's much more that really interests me. Everyone is different, so chances are you are going to have a different set of 20 apps, but I'm willing to bet that even in those 20, we are going to have some overlap.
The number of apps in the store is a good marketing metric, but it doesn't indicate a useful measure of applications. I've had people say that "free apps" are useless because they are free. You do realize that the difference in 95% of the cases between a free app and a paid one... is the price. I mean, in most cases, it's still some poor smuck writing the application in his/her spare time after work. One person decides to give it away (like doing charity) and the other person decides to charge 99 cents.
I think a better metric is to look at metrics like month over month growth, and return rates, etc, but you don't see a lot of that happening.
So, the next time you hear yourself croaking out the 140K stat about the Apple App Store, just ask yourself, is that a relevant statistic in your argument.
Wednesday, July 22, 2009
Setting up Linux Software RAID in Ubuntu 9.04
I decided that I needed some data redundancy for my media collection and personal documents. I was running zfs for awhile, with 2, 1 gig drives, but then I decided to switch to Linux Software Raid.
I found 2 pretty articles on how to setup and configure a Linux Software RAID.
In my particular setup, I had 2, 1 gig disks, but I wanted to re-use those while switching to the software raid setup. So, do that, I basically, stole a disk from the zfs raid setup, partitioned it, created the linux raid, formatted it, and then copied the zfs drive to the newly created linux raid device. Pretty easy right? Well, it was, but i'll into some extra details about the complete process.
I had 2 sata devices, /dev/sda, and /dev/sdb
First, install mdadm
When you install mdadm, it will want to install postfix. I don't know why, but it does. I just answered the basic install questions and carried on.
Next, prepare 1 of your 2 disks for a linux raid.
If it doesn't have a partition, then create one (n), and then change the partition type to Raid Auto Detect (t then fd)
You should now have a /dev/sda1 device. You can verify this using the print command (p) and then write (w) your changes.
Next, we create the raid array. In my case, I will eventually have 2 disks, but I wanted to create the array with just a single disk (/dev/sda1) for now, and then add in the other disk (/dev/sdb1) later.
Creating the array was pretty simple.
# sudo mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda1 missing
Notice that for the second device, I used the word, "missing". This is special reserved word for mdadm and it is used to acknowledge that you are creating an array, but you do not yet have all the devices. You need at least 1 device, which I did have.
Now that you've created the array, we need to format it.
That should take a few minutes, and we are now ready to mount the device.
# sudo mkdir /media/Transfer
We now have a mounted device under /media/Tranfer. We'll use that to transfer all the files from our old device onto the new device. In my case, my zfs drive was mounted under /home, so I used rsync to sync the zfs mounted drive with my newly mounted linux raid device
# sudo rsync -av /home /media/Transfer
This will take a long time, depending on your disk size. In my case, it took a couple of hours.
Once the transfer is complete, I then added in my other zfs drive to my linux raid. This required that I partition the drive in the same way that I partitioned my other drive. Basically, using fdisk, I created a new partition, and then set the partition type to fd (Linux Raid)
Once that was done, all I needed to do was add the new drive to my existing linux raid array.
# sudo mdadm --manage /dev/md0 -a /dev/sdb1
Once you do this, you'll notice your hard drive light will remain on or flash very quickly. Basically the Raid Array is now copying all data from the source disk to the newly added disk. This will take a couple of hours as well, but the system is fully usable during that time.
You can check the status of the Raid at any time by issuing the command
The output will be something like,
Personalities : [raid1]
md0 : active raid1 sda1[2] sdb1[0]
976759936 blocks [2/1] [U_]
[========>............] recovery = 44.4% (434131840/976759936) finish=135.6min speed=66645K/sec
Finally, don't forget to update your /etc/fstab to reflect that your new mount device is /dev/md0 and not whatever it used to be. In my case, it was a matter of changing the device to that /home was mounted as device /dev/md0
I found 2 pretty articles on how to setup and configure a Linux Software RAID.
In my particular setup, I had 2, 1 gig disks, but I wanted to re-use those while switching to the software raid setup. So, do that, I basically, stole a disk from the zfs raid setup, partitioned it, created the linux raid, formatted it, and then copied the zfs drive to the newly created linux raid device. Pretty easy right? Well, it was, but i'll into some extra details about the complete process.
I had 2 sata devices, /dev/sda, and /dev/sdb
First, install mdadm
# sudo apt-get install mdadm
When you install mdadm, it will want to install postfix. I don't know why, but it does. I just answered the basic install questions and carried on.
Next, prepare 1 of your 2 disks for a linux raid.
# sudo fdisk /dev/sda
If it doesn't have a partition, then create one (n), and then change the partition type to Raid Auto Detect (t then fd)
You should now have a /dev/sda1 device. You can verify this using the print command (p) and then write (w) your changes.
Next, we create the raid array. In my case, I will eventually have 2 disks, but I wanted to create the array with just a single disk (/dev/sda1) for now, and then add in the other disk (/dev/sdb1) later.
Creating the array was pretty simple.
# sudo mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda1 missing
Notice that for the second device, I used the word, "missing". This is special reserved word for mdadm and it is used to acknowledge that you are creating an array, but you do not yet have all the devices. You need at least 1 device, which I did have.
Now that you've created the array, we need to format it.
# sudo mkfs.ext4 /dev/md0
That should take a few minutes, and we are now ready to mount the device.
# sudo mkdir /media/Transfer
# sudo mount /dev/md0 /media/Transfer
We now have a mounted device under /media/Tranfer. We'll use that to transfer all the files from our old device onto the new device. In my case, my zfs drive was mounted under /home, so I used rsync to sync the zfs mounted drive with my newly mounted linux raid device
# sudo rsync -av /home /media/Transfer
This will take a long time, depending on your disk size. In my case, it took a couple of hours.
Once the transfer is complete, I then added in my other zfs drive to my linux raid. This required that I partition the drive in the same way that I partitioned my other drive. Basically, using fdisk, I created a new partition, and then set the partition type to fd (Linux Raid)
Once that was done, all I needed to do was add the new drive to my existing linux raid array.
# sudo mdadm --manage /dev/md0 -a /dev/sdb1
Once you do this, you'll notice your hard drive light will remain on or flash very quickly. Basically the Raid Array is now copying all data from the source disk to the newly added disk. This will take a couple of hours as well, but the system is fully usable during that time.
You can check the status of the Raid at any time by issuing the command
# cat /proc/mdstat
The output will be something like,
Personalities : [raid1]
md0 : active raid1 sda1[2] sdb1[0]
976759936 blocks [2/1] [U_]
[========>............] recovery = 44.4% (434131840/976759936) finish=135.6min speed=66645K/sec
Finally, don't forget to update your /etc/fstab to reflect that your new mount device is /dev/md0 and not whatever it used to be. In my case, it was a matter of changing the device to that /home was mounted as device /dev/md0
Tuesday, March 31, 2009
Tip: How to find to which jar a class file belongs
It's a common problem in larger projects, where you are using a Class reference, but you don't know which of the 20 jars in your project is actually providing the implementation.
In my case, I needed to know which jar file was providing the Hex class.
In my case, I needed to know which jar file was providing the Hex class.
System.out.println(Hex.class.getProtectionDomain().
getCodeSource().getLocation().toString());
getCodeSource().getLocation().toString());
It turns out that it's in axis2.jar :)
Wednesday, February 4, 2009
Using Bookmarks in Your Development Projects
I've recently began helping with large project at work. The project contains a very large codebase, and in working through all the pieces, I thought, "I wish I could just bookmark some of these locations, so that I could return to particular areas later on". This thought hit me after I spent about 10 minutes trying to find a piece of code that I knew I visited earlier in the week.
It appears that I didn't have to look far for a bookmarking feature. I use Eclipse, and the great folks on that project have already thought about this. To bookmark a section of code, simply right click in the left hand margin of the code editor, and you'll see an "Add Bookmark..." link. Click it, and you will create a bookmark in the code that you can then use to quickly jump back to that location.
You'll also want to add the "Bookmarks" view to your perspective as well. Simply click Window -> Show View and enter Bookmark. Then add that view.
Bookmarks isn't something that you'll need/want when you are browsing your own projects, but it can certainly save time when you are browsing code in a larger project that you are not yet familiar with.
Bookmarking... It's a good thing. (Sometimes)
It appears that I didn't have to look far for a bookmarking feature. I use Eclipse, and the great folks on that project have already thought about this. To bookmark a section of code, simply right click in the left hand margin of the code editor, and you'll see an "Add Bookmark..." link. Click it, and you will create a bookmark in the code that you can then use to quickly jump back to that location.
You'll also want to add the "Bookmarks" view to your perspective as well. Simply click Window -> Show View and enter Bookmark. Then add that view.
Bookmarks isn't something that you'll need/want when you are browsing your own projects, but it can certainly save time when you are browsing code in a larger project that you are not yet familiar with.
Bookmarking... It's a good thing. (Sometimes)
Tuesday, January 6, 2009
Apple Store: Music to be DRM Free this year
Well it appears that Apple music will finally become totally DRM free by the end of the first quarter of this year.
The Apple Keynote for this year was quite dull, but that was one small piece of good news to come out of it.
How long before TV and Video execs realize that DRM is bad for their content as well?
The Apple Keynote for this year was quite dull, but that was one small piece of good news to come out of it.
How long before TV and Video execs realize that DRM is bad for their content as well?
Thursday, December 18, 2008
XBMC on AppleTV - Is is worth it?
This is where the fun stopped. First, the AppleTV unit does not have a power off (at least nothing that was obvious), so, for every reboot, I had to unplug the unit. While this wasn't a huge deal in my test environment, it's going to be annoying to anyone that has a unit in their home entertainment cabinet.
So, after a few minutes, I decided to launch XBMC. Having used XBMC on the XBOX for a couple of years, this was the real prize for me. After XBMC launched, I was actually stuck in a window (not fullscreen). I then used the Settings menu to make the application fullscreen. I Also calibrated the screen, so that the UI could fill the entire area. I wasn't disappointed with the UI. It was responsive and worked pretty much like the XBOX version.
To my disappointment, the XBMC on the AppleTV could not play any 720p x264 content in a mkv container. I tried about 10 files, and all files were un watchable. Audio was fine, but the video was completely jittery. This was a huge disappointment for me. The core reason my friend had purchased this unit was because he wanted to watch 720p content in XBMC. That's not going to happen with this release. It's not the fault of XMBC, it's a great product, but there's only so much you can do when you have decode and render in software on such a limited device. Apparently the device will play 720p content if you convert it to mp4, but who wants to convert video?
We both should have done more research into XBMC on the AppleTV before buying the unit. But, we were such fans, we rushed in. Given that XBMC can't play 720p x64 content (without re-encoding it), then he could have purchased and Xbox and put XBMC on that for only $50. You can already play 720p content on an Xbox, if you are willing to convert it to mpeg2. So, right now, we have 1 brand new AppleTV unit for sale.
Is XBMC on the AppleTV worth it? Well, if you're an AppleTV fan, and you have already purchased an AppleTV for the purposes of renting and downloading movies, then I'd say that Yes, putting on XBMC is well worth it. XMBC will add functionality to the AppleTV unit, and you won't be disappointed, until you try to play your 720p content. But, if you are looking at buying an AppleTV just to run XBMC, then buy a Xbox. For much less, you will get the same features.
A couple of weeks ago, I test drove a Popcorn Hour unit. Even though I was unimpressed with the performance of the UI, I would certainly choose that unit over the AppleTV, solely based on the fact that it played my 720p mkv files without an issue.
Recently, SageTV released a stand alone HD Player, which I suspect would be the better than both the AppleTV or the Popcorn Hour. I haven't tried it myself, but you can check out more on the SageTV HD Theatre (HD200) on GeekTonic. I currently own the HD100 that SageTV released previous to the HD200, and it plays all my current media without issue.
The Bad
- Slow boot time
- No cables (except for power)
- Only 6 buttons on the remote
- XBMC can't play HD files
- No power off button
- The unit runs very hot
The Good
- Simple AppleTV interface
- XBMC was easy to install
- XBMC worked well (as long you don't need to play HD)
- Slim and Sleek unit
More AppleTV Images
Movie Listings
The Mummy Movie Details
Sunday, December 14, 2008
Batch Metadata Tools gets Custom Content Proivder
As of version 1.12, the Batch Metadata Tools now has a "build your own content provider". This new feature, called a CompositeMetadataProvider, is basically a way to compose or build a new content provider from 2 other content providers, using only configuration.
For example, you can create a new content provider that uses the IMDB provider to search, but then uses themovidedb.com provider to fetch the details and thumbnail information. You can also configure which fields from the search provider that you want to use instead of those in the detail provider.
This new composite provider model may be a little tricky to understand at first, but it opens up some great potential to pull content from multiple sources when fetching metadata information.
For example, you can create a new content provider that uses the IMDB provider to search, but then uses themovidedb.com provider to fetch the details and thumbnail information. You can also configure which fields from the search provider that you want to use instead of those in the detail provider.
This new composite provider model may be a little tricky to understand at first, but it opens up some great potential to pull content from multiple sources when fetching metadata information.
Saturday, December 13, 2008
Batch Metadata Tools gets new Metadata Provider
Last week I applied for an api_key for themoviedb.com for the Batch Metadata Tools project, and it was granted. Then within a couple of hours, I had the full integration with themoviedb.com complete.
Their api is really simple. It mainly consists of two commands; Search and GetInfo. The search takes a single search argument and returns a list of matches, and the get info command will return back the complete movie information for a given match. Simple and easy.
Batch Metadata Tools is now at version 1.11, and you can red more about how to use this new provider in the project wiki.
About Batch Metadata Tools
The Batch Metadata Tools project is a small java project that provide movie information and cover art for movie files. Currently it's used within the SageTV community for fetching movie information when you import a large collection of movies. Although it is currently used for SageTV, it supports a pluggable output provider, so that it could be used to read/write other formats.
Currently the Batch Metadata Tools has search providers for IMDB, DVDProfiler, and themoviedb.com.
Their api is really simple. It mainly consists of two commands; Search and GetInfo. The search takes a single search argument and returns a list of matches, and the get info command will return back the complete movie information for a given match. Simple and easy.
Batch Metadata Tools is now at version 1.11, and you can red more about how to use this new provider in the project wiki.
About Batch Metadata Tools
The Batch Metadata Tools project is a small java project that provide movie information and cover art for movie files. Currently it's used within the SageTV community for fetching movie information when you import a large collection of movies. Although it is currently used for SageTV, it supports a pluggable output provider, so that it could be used to read/write other formats.
Currently the Batch Metadata Tools has search providers for IMDB, DVDProfiler, and themoviedb.com.
Thursday, December 4, 2008
Popcorn Hour A-110
This week, I had the pleasure of trying out a new Popcorn Hour A-110.
It would seem that this device is marketed at the regular consumer that just wants to watch HD content, without the hassle of configuring too much software/hardware.
If my brother-in-law is a measure of the common person, then I think the unit falls short. I have it now, because he could not get it working. When I got the unit, I plugged it in, and the networking was configured for a static IP. Because of that, pressing any option, other than Settings caused the unit to lock up.
After I changed the IP to use DHCP, it worked fine. I configured it to go against my media shares, and it played .mkv files, .ts files (HDPVR), and regular divx/xvid files. The responsiveness of the unit was very good for starting and stopping the playback of a file. Much faster than my SageTV HD-100. But the menus were much more sluggish, especially the online vidoes.
The online videos section is quite rich. There is lots of selection, but the UI feels slow to render.
A few months back, I showed my SageTV setup to my brother-in-law, and he wanted it. He didn't need/want the PVR functionality, just the distributed nature of the system, and the HD-100 for HD content. He is setup now with an Xbox running XBMC, which serves his needs quite well, except for HD content.
I'm a huge SageTV fan, but I could not bring myself to recommend SageTV to him, since I did not want to spend my days supporting his setup, and mine. So, I recommended that he get a popcorn hour; plug and play. Well, as it turns out, I still need to support him, which is disappointing, to say the least.
Of course, had I known that SageTV was going to be releasing a STB, and not just an extender, then I would have told him to wait for the SageTV STB. It's too bad they didn't run a pre press release stating their intentions.
Today, there are several options for HD STB Media Players.
I think that now that I have played with the Popcorn Hour, it is a nice device. UI is very spartan, but functional. But, I think that if I wanted just a HD media center, then I'd either get the Apple TV and run XBMC on it, or I'd get the SageTV HD Theatre. Given my setup I would lean towards the SageTV HD Theatre, since I already have SageTV installed. If I had nothing, and I knew my needs didn't include a PVR, then I'd probably get the Apple TV running XBMC.
Of course the lesson learned here, is that no matter how much you think a device is easy to use, leave it up the consumer to prove you wrong every time.
It would seem that this device is marketed at the regular consumer that just wants to watch HD content, without the hassle of configuring too much software/hardware.
If my brother-in-law is a measure of the common person, then I think the unit falls short. I have it now, because he could not get it working. When I got the unit, I plugged it in, and the networking was configured for a static IP. Because of that, pressing any option, other than Settings caused the unit to lock up.
After I changed the IP to use DHCP, it worked fine. I configured it to go against my media shares, and it played .mkv files, .ts files (HDPVR), and regular divx/xvid files. The responsiveness of the unit was very good for starting and stopping the playback of a file. Much faster than my SageTV HD-100. But the menus were much more sluggish, especially the online vidoes.
The online videos section is quite rich. There is lots of selection, but the UI feels slow to render.
A few months back, I showed my SageTV setup to my brother-in-law, and he wanted it. He didn't need/want the PVR functionality, just the distributed nature of the system, and the HD-100 for HD content. He is setup now with an Xbox running XBMC, which serves his needs quite well, except for HD content.
I'm a huge SageTV fan, but I could not bring myself to recommend SageTV to him, since I did not want to spend my days supporting his setup, and mine. So, I recommended that he get a popcorn hour; plug and play. Well, as it turns out, I still need to support him, which is disappointing, to say the least.
Of course, had I known that SageTV was going to be releasing a STB, and not just an extender, then I would have told him to wait for the SageTV STB. It's too bad they didn't run a pre press release stating their intentions.
Today, there are several options for HD STB Media Players.
- Popcorn Hour
- AppleTV (Running XBMC)
- SageTV HD Theater
I think that now that I have played with the Popcorn Hour, it is a nice device. UI is very spartan, but functional. But, I think that if I wanted just a HD media center, then I'd either get the Apple TV and run XBMC on it, or I'd get the SageTV HD Theatre. Given my setup I would lean towards the SageTV HD Theatre, since I already have SageTV installed. If I had nothing, and I knew my needs didn't include a PVR, then I'd probably get the Apple TV running XBMC.
Of course the lesson learned here, is that no matter how much you think a device is easy to use, leave it up the consumer to prove you wrong every time.
Wednesday, October 15, 2008
Rest APIs for SageTV
Last week I reported that I had created a Java RPC api for SageTV. This week I've released the Rest API addition.
Using the Rest APIs you can access any of the SageTV services using a simple Url syntax. It helps to know and understand the javadoc, since the Rest APIs follow that structure.
For example to tell SageTV to refresh its media file collection, you can use the following url:
or if you wanted to find a list of clients connected to your server:
All responses are returned as Xml and documented in the project's wiki.
Using the Rest APIs you can access any of the SageTV services using a simple Url syntax. It helps to know and understand the javadoc, since the Rest APIs follow that structure.
For example to tell SageTV to refresh its media file collection, you can use the following url:
http://server:8080/sagex/rpcXml/Global/RunLibraryImportScan/falseor if you wanted to find a list of clients connected to your server:
http://server:8080/sagex/rpcXml/Global/GetConnectedClientsAll responses are returned as Xml and documented in the project's wiki.
Monday, October 6, 2008
Java 5 Features - Part 1 - Formatting
I've been using Java for a long time, and one of the first comments I made about Java, when I switched from C, was "Where's printf?". Most people will never need to use printf, and in the few cases that you need to format something, you can use Java's MessageFormat class, at least that's what Java enthusiasts would have you believe.
As you may know, Java 5 introduced the printf() function. Even though I knew it was there, I still resisted using it until recently. And now, I can't imagine not having it. I don't know why I resisted using it? I used Generics as soon as it was availble, but printf() just eluded me, even though I found it to a great function in C.
I may be one of the last people that still write command line applications. I like command line applications, and a well written command line application can support a gui, if needed. But, command line applications require a lot of printing to the console screen. In java, this resulted in a lot of ugly code like
But using printf, you can clean that up a little....
I don't suggest that you abuse the printf function, but know it's there. Also know that the String function has a static method for using printf formatting. This can be handy at times when you need to log a lot of data in a single line, or if you need to simply format a String for some reason.
For example,
or
The whole printf function can do a lot of pretty complex formatting, so check it out, and the next your are printing messages to the console, just maybe you'll use printf().
As you may know, Java 5 introduced the printf() function. Even though I knew it was there, I still resisted using it until recently. And now, I can't imagine not having it. I don't know why I resisted using it? I used Generics as soon as it was availble, but printf() just eluded me, even though I found it to a great function in C.
I may be one of the last people that still write command line applications. I like command line applications, and a well written command line application can support a gui, if needed. But, command line applications require a lot of printing to the console screen. In java, this resulted in a lot of ugly code like
System.out.println("Unable to open File: " + file.getAbsolutePath() + " for writing. Please check permissions.");
But using printf, you can clean that up a little....
System.out.printf("Unable to open File: %s for writing. Please check permissions.", file.getAbsolutePath());
I don't suggest that you abuse the printf function, but know it's there. Also know that the String function has a static method for using printf formatting. This can be handy at times when you need to log a lot of data in a single line, or if you need to simply format a String for some reason.
For example,
log.debug(String.format("The Process: %s took %sms to run.", process, time));
or
String msg = String.format("%-20s: %s", cmd, description);
The whole printf function can do a lot of pretty complex formatting, so check it out, and the next your are printing messages to the console, just maybe you'll use printf().
Java RPC for SageTV
I released a Java RPC library for SageTV. Sometimes, I find myself needing remote access to SageTV to do things that are just not convenient to do from the SageUI or the web server interface.
Initially the small project started out as a part of the GUI redesign of the Batch Metadata tools that I released earlier, but I thought it would be useful in other cases. (The GUI redesign is not released yet, but it's getting there)
The API is completely generated from the public SageTV javadoc, so it is complete. Also, the API enables you to write code and then choose to either embed it in SageTV or run it externally.
An example use of this api would include... Write a small Java utility to find all Watched TV Shows and then move them to an archival area. Or, on a nightly basis, find all HD recorded shows and transcode them into SD so that your SD MVP extenders can play them as well.
Both the client and the server are included in the same small jar (~70k), and the client will attempt to automatically find the running RPC server, so it should be zero configuration from the client side.
I hope the API may be of use to people that want to write java applications that interact with SageTV.
Initially the small project started out as a part of the GUI redesign of the Batch Metadata tools that I released earlier, but I thought it would be useful in other cases. (The GUI redesign is not released yet, but it's getting there)
The API is completely generated from the public SageTV javadoc, so it is complete. Also, the API enables you to write code and then choose to either embed it in SageTV or run it externally.
An example use of this api would include... Write a small Java utility to find all Watched TV Shows and then move them to an archival area. Or, on a nightly basis, find all HD recorded shows and transcode them into SD so that your SD MVP extenders can play them as well.
Both the client and the server are included in the same small jar (~70k), and the client will attempt to automatically find the running RPC server, so it should be zero configuration from the client side.
I hope the API may be of use to people that want to write java applications that interact with SageTV.
Thursday, September 18, 2008
Media Center / PVR Concept
Recently, I had an idea for an open concept Media Center and PVR. This concept includes a 3 tier system consisting of a Front End, Application Server, and Backend.
The First Tier
The Front End consists of an Html/Css/Javascript rendering engine combined with a media player. WebKit and Mplayer would be a good choices for this, since both can already be ported to different hardware, including PCs and low powered devices.
Using Html as the front end seems like a logical choice since there is a large pool of existing web developers that are familiar with technologies. The Front End engine will also require a robust media player engine such as mplayer or vlc. Html pages can embed video windows into their pages, as when displaying the Guide data, or play fullscreen, when watching regular TV or movies.
The Html UI itself would have several common branded UI elements, such as input boxes, tables, buttons, etc, and Application Designers would be encouraged to leverage those UI elements so that themes would would work with their custom applications.
The Second Tier
The second tier would be an Application Server. My choice for this, because I use java, would be to use Tomcat or Jetty as the server. The server's role would be to serve up resources to the Front End and to handle Rest services. The Server, since it is a standard Application Server, can host any number of custom, server side applications. The applications would be deployed to the Server and then accessible to any of the clients. There would be a well defined set of restful services that would define the core interactions between the Client and the Application Server.
Two standard applications that would be deployed on the the Server would be a Media Center application and a PVR Application. These 2 core applications would simply be pluggable proxy applications that proxy Front End requests to the Back End. For example, the Frond End may send to a request to the Server for a list of all movies in the Media Center. The Server would dispatch that request to one or more Backend plugins, and send the formatted results to the Front End. The Server, in this case, would accept plugins for different Back Ends, and the server could, in theory, utilize multiple backends or different types. Examples of backends, could include MythTV or SageTV.
When media is being streamed to the Client, it would either do so via a proxy service in the Application Server, or the Client would play the Url directly from the backend. Using this model, if a back end can support exporting a media streams over http, then it can elect to have its stream read directly by the client. In the case where the back end cannot export it's media stream over http, then the proxy application in the application server would provide an http stream to the client. But, even if a client is receiving a stream directly from the backend, it would still be required to send its commands via the application server. In order words, the backends are media exporters only, and should not be interacted with directly from a client.
The Third Tier
The third tier is the Back End. As mentioned above, a back end would probably consist of using MythTV, SageTV, or some other extensible PVR/MediaCenter that is already well established. By using an existing backend, as a plugin, the user is not locked into any technology, and they can move between different backend solutions. This may not be an attractive feature to backend providers, but it is an attractive feature to consumers.
Keep in mind, the concept here remains the same, no matter what the actual technology that is used. The concept is an open media center consisting of 3 tiers; Html Frontend, Application Web Server, and PVR Backend. I've chosen Java as the preferred Application Web Server, but in reality, it could be any open web server technology.
Pros and Cons
Pros
I own a number of small embedded devices, such as the MVP and HD-100. At some point, I'd like to play around with seeing how well these devices could handle a WebKit rendering engine and see if this idea could actually come to life on these devices. I know some people have played with the MVP and have used it as a front-end to ReplayTV and MythTV. My challenge would be so see if WebKit could actually run on these devices and be usuable as a MediaCenter/PVR front end.
The First Tier
The Front End consists of an Html/Css/Javascript rendering engine combined with a media player. WebKit and Mplayer would be a good choices for this, since both can already be ported to different hardware, including PCs and low powered devices.
Using Html as the front end seems like a logical choice since there is a large pool of existing web developers that are familiar with technologies. The Front End engine will also require a robust media player engine such as mplayer or vlc. Html pages can embed video windows into their pages, as when displaying the Guide data, or play fullscreen, when watching regular TV or movies.
The Html UI itself would have several common branded UI elements, such as input boxes, tables, buttons, etc, and Application Designers would be encouraged to leverage those UI elements so that themes would would work with their custom applications.
The Second Tier
The second tier would be an Application Server. My choice for this, because I use java, would be to use Tomcat or Jetty as the server. The server's role would be to serve up resources to the Front End and to handle Rest services. The Server, since it is a standard Application Server, can host any number of custom, server side applications. The applications would be deployed to the Server and then accessible to any of the clients. There would be a well defined set of restful services that would define the core interactions between the Client and the Application Server.
Two standard applications that would be deployed on the the Server would be a Media Center application and a PVR Application. These 2 core applications would simply be pluggable proxy applications that proxy Front End requests to the Back End. For example, the Frond End may send to a request to the Server for a list of all movies in the Media Center. The Server would dispatch that request to one or more Backend plugins, and send the formatted results to the Front End. The Server, in this case, would accept plugins for different Back Ends, and the server could, in theory, utilize multiple backends or different types. Examples of backends, could include MythTV or SageTV.
When media is being streamed to the Client, it would either do so via a proxy service in the Application Server, or the Client would play the Url directly from the backend. Using this model, if a back end can support exporting a media streams over http, then it can elect to have its stream read directly by the client. In the case where the back end cannot export it's media stream over http, then the proxy application in the application server would provide an http stream to the client. But, even if a client is receiving a stream directly from the backend, it would still be required to send its commands via the application server. In order words, the backends are media exporters only, and should not be interacted with directly from a client.
The Third Tier
The third tier is the Back End. As mentioned above, a back end would probably consist of using MythTV, SageTV, or some other extensible PVR/MediaCenter that is already well established. By using an existing backend, as a plugin, the user is not locked into any technology, and they can move between different backend solutions. This may not be an attractive feature to backend providers, but it is an attractive feature to consumers.
Keep in mind, the concept here remains the same, no matter what the actual technology that is used. The concept is an open media center consisting of 3 tiers; Html Frontend, Application Web Server, and PVR Backend. I've chosen Java as the preferred Application Web Server, but in reality, it could be any open web server technology.
Pros and Cons
Pros
- Web technologies are widely used and fairly easy to understand
- Using a middle tier means that you don't have vendor lock in
- Doesn't "reinvent the wheel" when it comes to PVR solutions, since you are reusing existing PVR Backends.
- WebKit and MPlayer haven been ported to many embedded devices.
- Rapid development and deployment of Media Center applications using Html
- Middle Tier can proxy more than 1 back end, allowing you to add/remove backends for testing, etc.
- Many systems are single tier, some are 2. Adding in a third tier (in this case ,the middle tier) adds some complexity.
- Html won't allow from some of the eye candy that some Media Centers are using today.
- Interaction between the Front-end and the Middle Tier needs to be well thought out.
I own a number of small embedded devices, such as the MVP and HD-100. At some point, I'd like to play around with seeing how well these devices could handle a WebKit rendering engine and see if this idea could actually come to life on these devices. I know some people have played with the MVP and have used it as a front-end to ReplayTV and MythTV. My challenge would be so see if WebKit could actually run on these devices and be usuable as a MediaCenter/PVR front end.
Wednesday, September 17, 2008
Metadata Tool Goes Visual
I originally wrote the Batch Metadata tool because I had a large collection of movies, and Sage didn't provide a way to import my existing collection with metadata. Nielm's IMDB tool was good, but it's a one at a time solution.
So, a tool was born, and it works quite well at what it's meant to do; fetch metadata and create output properites and thumbnails. Now, I'm looking at a bigger picture, that includes full media management. Obviously the Batch Metadata tool is a part of the solution,
and I decided to use GWT (Google Widget Toolkit) as the UI. I was looking for an excuse to try out GWT and this project became my excuse.
I decided to make this a web application for one main reason; I like web applications. I read my email online, my photos are online, my calendar is online, and all this translates into convenient access to my information. I wanted my media to be accessed in the same way. I have 7 computers in my house. I don't use all of them, but I do use 4 of them. I wanted to be able to quickly access my media, make changes and import new movies from any of those computers. A web application made sense.
The features that I'm looking at putting into this application include
Stay in touch. I'll update my blog on the progress.
So, a tool was born, and it works quite well at what it's meant to do; fetch metadata and create output properites and thumbnails. Now, I'm looking at a bigger picture, that includes full media management. Obviously the Batch Metadata tool is a part of the solution,
and I decided to use GWT (Google Widget Toolkit) as the UI. I was looking for an excuse to try out GWT and this project became my excuse.I decided to make this a web application for one main reason; I like web applications. I read my email online, my photos are online, my calendar is online, and all this translates into convenient access to my information. I wanted my media to be accessed in the same way. I have 7 computers in my house. I don't use all of them, but I do use 4 of them. I wanted to be able to quickly access my media, make changes and import new movies from any of those computers. A web application made sense.
The features that I'm looking at putting into this application include
- Media importing from local filesystem.
- Metadata fetching (from multiple sources)
- Batch metadata updating (from multiple sources)
- Metadata editing
- Cover art updating (from mulitple sources)
- File management (moving and deleting)
- UPnP Server
- Media playback
- SageTV integration
- Handle TV media (recorded shows) as well as movies.
Stay in touch. I'll update my blog on the progress.
Monday, September 15, 2008
SageTV - PVR and Media Center
Several months ago I decided to take SageTV for a spin. I'm a long time XBMC fan, but with HD becoming ubiquitous, I needed to find a solution that could deliver HD content to my TV, and XBMC on the Xbox wasn't doing it.
My first experience with SageTV was a little disappointing. I only needed a HD Media Center, and Sage's Media Center functionality is severely lacking. But, despite that, I forged ahead with a complete SageTV install. The final selling point for me was the SageTV could use a thin client media extender as a front end. Shortly after installing SageTV, I purchased the HD100 Media Extender for SageTV
. This extender product worked flawlessly on my divx, xvid, dvd, and HD content. Without the HD extender, SageTV is just like any other Media Center solution, except that it costs money.
One of the core features missing in the SageTV Media Center is the lack of an automated metadata import tool, that can import movie metadata from external sources, such as IMDB, or other locations. This is a standard feature in my XMBC configuration and not having it made the movie experience so much less enjoyable. Not having this feature bothered me so much that I decided to write an external tool that could scrape movie information from several sources and allow SageTV to import that information. This tool is the Batch MetaData Tool. Although the Batch MetaData Tool was written with SageTV in mind, it can be extended to output it's metadata information in different formats. I'll post more about the this tool later.
Since Installing SageTV and buying the HD100, I decided to give the PVR funtionality a try. I started out with SD content, then I purchased the HD-PVR and a Bell 6141 reciever and I started recording HD content. The quality and the performance was very good. SageTV has a very nice interface for recording TV shows, resolving conflicts, and managing recorded shows. I still can't use it to replace my Bell dual tuner HD PVR, but I do use it to supplement it. The great thing about having SageTV is that all of my recordings can be accessed via any computer, or extender, in the house, or even over the internet using the Placeshifter client. Record once, Watch anywhere; a dream come true.
Unfortunately, it's not all bliss. My SageTV setup has locked up from time to time. It seems that it is a combination of SageTV and the HD-PVR. If I disconnect the HD-PVR, then SageTV does not lock up at all. In fact, my SageTV was up for several months until I hooked up the HD-PVR. This may have nothing to do with SageTV and everything to do with the HD-PVR drivers. I'm still investigating.
Just for reference, I thought I'd make a Pros and Cons list of SageTV features.
SageTV Pros
If you want a slick HD setup, without a computer in the living room, then SageTV is your answer. It may not be the most visually appealing software, but it will get the job done. If you plan on having a full blown computer in the livingroom, then perhaps something free and open source might be a better option. When I first bought SageTV, XMBC for Linux was not available. Given all that I really wanted was a HD Media Center with lots of functionality, then XMBC for Linux would be been a great choice. It would have required that I put a computer in the livingroom, but given what I've spent on SageTV licenses and hardware (HD-PVR and HD100), I could have put a computer in the livingroom.
So, I've jumped into SageTV with both feet. My next steps are to personalize it and make it better for my needs. To achieve this, I've compiled a list of projects that I'm either working on, or plan to work on, in order to make SageTV better suit my needs.
Proposed Personal Projects
Stay in touch, and I'll keep you posted on how I make out with these ambitious projects.
My first experience with SageTV was a little disappointing. I only needed a HD Media Center, and Sage's Media Center functionality is severely lacking. But, despite that, I forged ahead with a complete SageTV install. The final selling point for me was the SageTV could use a thin client media extender as a front end. Shortly after installing SageTV, I purchased the HD100 Media Extender for SageTV
. This extender product worked flawlessly on my divx, xvid, dvd, and HD content. Without the HD extender, SageTV is just like any other Media Center solution, except that it costs money.One of the core features missing in the SageTV Media Center is the lack of an automated metadata import tool, that can import movie metadata from external sources, such as IMDB, or other locations. This is a standard feature in my XMBC configuration and not having it made the movie experience so much less enjoyable. Not having this feature bothered me so much that I decided to write an external tool that could scrape movie information from several sources and allow SageTV to import that information. This tool is the Batch MetaData Tool. Although the Batch MetaData Tool was written with SageTV in mind, it can be extended to output it's metadata information in different formats. I'll post more about the this tool later.
Since Installing SageTV and buying the HD100, I decided to give the PVR funtionality a try. I started out with SD content, then I purchased the HD-PVR and a Bell 6141 reciever and I started recording HD content. The quality and the performance was very good. SageTV has a very nice interface for recording TV shows, resolving conflicts, and managing recorded shows. I still can't use it to replace my Bell dual tuner HD PVR, but I do use it to supplement it. The great thing about having SageTV is that all of my recordings can be accessed via any computer, or extender, in the house, or even over the internet using the Placeshifter client. Record once, Watch anywhere; a dream come true.
Unfortunately, it's not all bliss. My SageTV setup has locked up from time to time. It seems that it is a combination of SageTV and the HD-PVR. If I disconnect the HD-PVR, then SageTV does not lock up at all. In fact, my SageTV was up for several months until I hooked up the HD-PVR. This may have nothing to do with SageTV and everything to do with the HD-PVR drivers. I'm still investigating.
Just for reference, I thought I'd make a Pros and Cons list of SageTV features.
SageTV Pros
- Stable and reliable PVR and Media Center
- Supports SD and HD extenders
- Supports Plugins
- User-friendly UI
- Java based (not everyone would consider this a Pro, but I do)
- Runs on Windows/Linux/Mac
- Has built-in EPG data
- Great at managing recordings
- Placeshifter that turns SageTV into a Sling like appliance.
- Linux version has no trial
- Plugin model requires learning a new Xml scripting language
- Media Center is very lacking in features (IMDB lookup, Stacking, Genres)
- Cost. You license everything. Server, Client and Extenders.
- No UPnP Media Server or Renderer support.
- Can't play DVDs unless they have been decrypted.
- Can't play iso files.
- Placeshifter can't play DVDs at all.
If you want a slick HD setup, without a computer in the living room, then SageTV is your answer. It may not be the most visually appealing software, but it will get the job done. If you plan on having a full blown computer in the livingroom, then perhaps something free and open source might be a better option. When I first bought SageTV, XMBC for Linux was not available. Given all that I really wanted was a HD Media Center with lots of functionality, then XMBC for Linux would be been a great choice. It would have required that I put a computer in the livingroom, but given what I've spent on SageTV licenses and hardware (HD-PVR and HD100), I could have put a computer in the livingroom.So, I've jumped into SageTV with both feet. My next steps are to personalize it and make it better for my needs. To achieve this, I've compiled a list of projects that I'm either working on, or plan to work on, in order to make SageTV better suit my needs.
Proposed Personal Projects
- GWT based media management tool (extending what I've already done with the Batch MetaData Tool) (in progress)
- Add in UPnP Server support so that I can use my Xbox's as SD clients, and potentially a PS3 as a client. (researching)
- Remote API for SageTV (Export the SageAPI as a set of restful services) (in progress)
- GWT based plugin manager. Tool that will show plugins, and allow you install them from the web interface. (researching)
Stay in touch, and I'll keep you posted on how I make out with these ambitious projects.
Friday, September 12, 2008
First Contact
I play with a lot of technologies, mainly java enabled ones, but still, I do my share of testing the bleeding edge.
As I dabble in each of these new and old technologies, I find myself making notes about things I like and things I don't like. I thought it might prove useful to others if I shared my experiences as I investigate and use technologies.
Over the past year, I've played with, OSGI, UPnP, GWT, MythTV, SageTV, and extending my knowledge of the Java language. I have 13 years experience programming online commerce applications. 10 of those years were spent in Java. The first few years I spent in C, until I was forced to move to Java. I resisted the change, but now I am very much a Java technology evangelist.
Over the next few months, I'll post articles on my experiences with technology. Some of the upcoming ideas that I'm currently working on include....
As I dabble in each of these new and old technologies, I find myself making notes about things I like and things I don't like. I thought it might prove useful to others if I shared my experiences as I investigate and use technologies.
Over the past year, I've played with, OSGI, UPnP, GWT, MythTV, SageTV, and extending my knowledge of the Java language. I have 13 years experience programming online commerce applications. 10 of those years were spent in Java. The first few years I spent in C, until I was forced to move to Java. I resisted the change, but now I am very much a Java technology evangelist.
Over the next few months, I'll post articles on my experiences with technology. Some of the upcoming ideas that I'm currently working on include....
- Writing applications using GWT
- MythTV as a SageTV network encoder
- Embedding OSGI in existing applications
- Building a UPnP Server
- Java Lessons
- SageTV experiences
Subscribe to:
Posts (Atom)