Is IP TV really a step forward?

Let me say that I've been an IP TV fan since its introduction a couple of years ago in my town. But now I have to say that I am really concerned with this stuff in general. Here is my negative side of experience:

  1. Problem with modem. When I got it the service was simple - more than hundred of channels and news from provider's web site. Yet the modem provider sold me had so huge problems - at the start it was freezing once per day. After hundred upgrades from provider (they can tamper with my modem/router and they do it even without telling the customers - one day you don't have a problem the next day you have a problem due to upgrade which you don't know it happen) it finally reached a state that one could call fairly stable. The modem in question is Sagem Fast 3344. My recommendation: stay away from this modem. Furthermore the rumor is that the modem we got was a part of shipment for Deutsche Telecom which rejected them as unusable and so they somehow got to my provider probably for free.
  2. You have to buy set top box (STB) and those aren't exactly cheap. My provider was giving (both modem and Amino 103 STB) for free if you sign a two year contract. This is worse that having them rented because you are on your own if it fails some day and you won't get it replaced with newer model.
  3. Amino 103 STB is the very low of the Amino offering - having only video output and stereo sound output. Since it is receiving a digital signal one would expect Dolby Digital 5.1 or something but, no. The device itself has one (1) red light which tells you whether it is connected to currency + it flashes when it is receiving remote control signals. That's it. No buttons. If your remote fails for some reason you can't turn it on, you can't change channels and you don't have a clue which channel it is streaming unless your TV is on. Why would you need to see the channel? Because there are radio stations on the list. And to listen (to switch) to the radio station you have to turn on the TV. Besides that Amino sometimes freezes or shows other weird behavior.
  4. MPEG Artifacts on the picture are often visible specially in fast moving scenes. And nobody know who the culprit is, well, nobody even cares that much besides the customer. I mean it could be a satellite receiving problem on the provider side, communication between provider and modem, modem problem, communication between modem and STB, STB problem. As one would expect there is no diagnostics whatsoever (exception is the modem which can tell you the line quality and the amount of packets dropped, etc.)
  5. Some channels work, some don't and some work sometimes. Do you get an explanation? No.
  6. Provider dependency - if your provider has problems or it decides to cut you out your are without TV for at least some time. If you have a problem you can call toll free support line, wait for 20 minutes to get a student that can't help you much anyway.
  7. A STB per TV you have to have a STB per television if you want to watch on more than one television set.
  8. No support for watching TV on computer. Currently you can watch using VLC application, yet it already happened that it stopped working for a day or two. So there is no guarantee that tomorrow you'll be able to see the picture on computer. Ah, and you need a second network card on the computer. The other option is to use a video input on your graphic card(wonderful one - convert from digital to analog to show on digital LCD) and of course, another STB to get the signal from.
  9. Recording. Oh, this is a big issue. Forget about recording your shows. So far there are two options. Either use your computer (see above) (you really want to leave your computer on and go through myriad of clicking and computer stuff just to record a show) or use set your STB to proper channel and use your classic VCR. The later is better but, but, you are running into problems if you want to record from more than one channel. Remember, lousy Amino can change channels only through remote control.
    My provider is preparing new service called personal recorder to record the shows. Sounds great, but: limits are 6 hours and each recording disappears into the void after 2 days. Great, if you are gone for more than two days forget it. Furthermore you have to set the recorder at least 15mins before the show. If you are watching a show and you want to record it to the end - forget it. Did I mention that service is not free? All in all the personal recorder is very much useless.
  10. Video on demand. This is another service that is being launched soon. Sounds great, but: you pay for movie and have 24hrs of time to watch it. Enough? Not for me. Imagine you start watching in the evening and suddenly you have to stop for whatever reason (kids, natural disaster, something else).  You can't watch it next day unless you get a day free and watch it in the morning. The picuture and sound quality is still a mystery. Furthermore movies aren't exactly cheap charged 2€ and the movie catalog is very thin full of all movies. I guess the quantity will improve slowly. Will I use VOD? Unless it changes - no, thanks.
  11. Games there are few games you can play. Simple classic games and the TV doesn't play when you are playing games. Who really needs these low level games in the era of hitech consoles is besides me.
  12. Picture in picture. Simply forget it.
  13. I certainly forgot some problems - I'll add it when they comes back to my memory...

I have started to think if IP TV is really an improvement over my old cable TV when you didn't need a STB - each TV has a tuner included and you can watch as many TVs your want each showing different channel for free. And you need to use a single remote control. And recording shows is so simple one could cry - fire up your VCR, make few clicks on remote and voila - any channel any time for as much time one wants. OK, you can't watch TV on your computer unless you use video/audio input on your graphic card but who watches TV on computer anyway? Since recording options on IP TV are none I would use computer as a (last resort) recorder, that's why I am concerned with watching IP TV on computer. Then cable TV service is much more reliable and picture has better quality (go figure). Perhaps the drawbacks are limit of the number of channels (around 40 vs unlimited on IP TV) and absence of electronic programming guide (EPG - at least I think there is still none on my cable TV - it is technically feasible though) but hey, I watch only max. 10 channels - others are junk.

Was I a naive when I switched to IP TV? Probably. I am aware of the potential of IP TV and was really hopping to see it in full glory. But it turned out that IP TV is two steps back in quality, ease of use, and much more expensive compared to cable TV. OK, there are some bright points (EPG, news) but then its other services are crap. Seems like IP TV is squeezed between a bad provider(s) and digital rights (who knows what's behind all of these problems) The near future is uncertain and doesn't look bright to me - even now, if you want VOD service you have to buy newer STB (not sure what happens if you want personal recorder). My provider SIOL, as all big companies, is completely ignoring customers, too. While they are making huge profits they aren't capable of delivering services that would actually work as one expects.

BTW as a test of IP TV ease of use, try teaching your mother to use it.

What do you think?

Use StringBuilder on string Refactor! Pro feature

One of the wellcome refactoring features of [DX] Refactor! Pro is "replace string with StringBuilder". Why would you want to do that? String building into a string variable is slow because each time you change the value of string variable the memory for new value is allocated, new value is stored into this new memory place and old memory block is released for garbage collection. So, if you have a bunch of string modifications, such as building a text, you should avoid using string variable and instead use StringBuilder class that deals with memory much more gently (note that if you have few modifications string variable is still a better option). That's why Use StringBuilder refactoring comes handy. Imagine this piece of immaginary code that happens to exist here and there:

int[] list = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 }; string concatenated = string.Empty; foreach (int item in list) { if (concatenated.Length > 0) concatenated += ", "; concatenated += item.ToString(); } return c

If the number of items would be greater this code will become relatively sluggish to execute. Obviously there is a need of StringBuilder but instead of manually rewritting the code you can do this: select the code and press Refactor! key, pick Use StringBuilder: concatenated from Refactor! menu:

Refactor! will preview what changes it will do to replace the string with StringBuilder. Confirm the change and here is what you'll get:

int[] list = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 }; StringBuilder concatenatedBuilder = new StringBuilder(); foreach (int item in list) { if (concatenatedBuilder.Length > 0) concatenatedBuilder.Append(", "); concatenatedBuilder.Append(item.ToString()); } return concatenatedBuilder.ToString();

Needless to say that no coding was required and the code will perform much better, specially with bigger lists. Cool, eh.

telerik switches from 4 to 3 releases per year

[tele] recently announced that it will reduce the pace of releases from 4 to 3 per year. Don't be misleaded as this doesn't mean they will provide less products or updates. It is actually the inverse - they will have more time to work on their products and they'll spend less time for "release" activities.

I think they did the right move. I mean, I've found myself often installing their updates and updating my projects which took my time, too. Actually I find myself very often upgrading various stuff through the day. And the fact that they'll have more time to actually do some work on the products is a positive one, too. So, all in all, 3 releases per year seems like a good compromise to me and customers will certainly benefit from this change.

QueryADataset

"How do I join two tables from dataset and display the result?"

This is a question that often appears in ado.net newsgroup. Actually very often. And there isn't a good solution to this problem out there. (There is Link over DataSet comming but it is years away from general adoption). Out of my head these are the possible solutions:

  1. Add columns and use DataColumn.Expression property.
    This is a limited solution and works only in simple cases, there were problems when updating to database such tables in .net 1.1 (not sure about .net 2.0 since I am avoiding this approach when doing updates) and it is intrusive.
  2. [MS] approach: HOW TO: Implement a DataSet JOIN helper class in Visual C# .NET(http://support.microsoft.com/default.aspx/kb/32608)
    Here a new DataTable is created and populated based on input parameters. This is somewhat better but still, it is very unflexible.
  3. Create a new DataTable (or a list of objects) manually and populate it using self made code.
    This is a flexible solution but requires some coding and looping and as a sight effect it might blur the code clarity.

But hey, there is another, much better solution. It is called QueryADataset. I saw it advertised from time to time but only recently decided to try it out (I wonder why I didn't try it before). Why is it good? Because it combines simplicity, flexibility and a SQL language (BTW, if you don't know what SQL is then forget doing database applications until you learn the basics).

Let's look at an example. Let's say I have a dataset instance named northwind1 containing Categories and Products tables from the database you all love - Northwind. Let's say I want to show CategoryName and count of related products in a table. Here is the code required to get a DataView with required fields:

DataView view = DsCommand.Execute(@" SELECT CategoryName, Count(*) As ProductName FROM Categories INNER JOIN Products ON Categories.CategoryID = Products.CategoryID GROUP BY CategoryName ORDER BY CategoryName ", northwind1);

And here is the result:

Can it be simplier? And this isn't exactly a trivial select - it contains a join, name aliasing, grouping and sorting.

But hey, you are not limited with such simple statements. You have a very substantial subset of SQL power in your hands. Let's say you want to filter products, too. Here is revisited query:

DataView view = DsCommand.Execute(@" SELECT CategoryName, Count(*) As ProductName FROM Categories INNER JOIN Products ON Categories.CategoryID = Products.CategoryID WHERE Products.UnitPrice > 20 GROUP BY CategoryName HAVING Count(*) > 4 ORDER BY CategoryName ", northwind1);

Here I additionaly filter by Products.UnitPrice and select only those categories having more than 4 such products. I hope you get the idea of the power behind QueryADataset.

And you are not limited to selects. Oh no, you can do INSERT/UPDATE/DELETE commands. But the fun doesn't stop here - even CREATE TABLE, DROP TABLE, CREATE INDEX and DROP INDEX commands are supported to certain extent. Read more here.

To sum it up, as it says on web site - it is a great addition to ADO.NET that lets you do SQL statements on the top of the DataSet - nothing gets executed on the database. I think I'll use this stuff from now on in all of my projects where I deal with datasets.

I am missing a couple of features though (suggestions):

  • I would like to pass an empty (strong typed) DataTable to Excute method, so my table is filled instead of new one created. You can call me strong typing maniac, but I really do believe in strong typing.
  • I would like to fill a list of classes instead a datatable sometimes. Because it is a lot easier to add complex additional properties to a class.

I guess I'll have a better knowledge of the product once I start to use it for real. BTW, the thing works on both .net 1.1 and 2.0.

Problem with LifeCam VX-6000 and its solution

Lately I bought [MS] LifeCam VX-6000 web cam for my computer running Vista Ultimate x86. First problem I've faced was that I had to wait for [MS] to release its Vista compatible drivers since I was running Vista even before it went to retail shelves. Ok, that's not a big deal, I am patient person I guess.

The bigger problem was that after installing proper drivers they were working just partially - I could use messenger video call but I couldn't use LifeCam's control panel to adjust the camera settings - I always got an exception upon connecting (without any good error message of course). Since I had no clue what was causing the problem I waited again until I've spotted a thread (using Google groups of course) where a guy stated that the culprit was.....Nero (I admit, I've installed Nero 6.something before, Vista warned me that it isn't much compatible and might cause problems (this message was so true, I just didn't know at the time), but I was able to burn media just fine).

So, I skeptically uninstalled Nero and LifeCam's control panel amazingly started to work. Go figure.

A syntax feature in enum I didn't know

Consider this enum declaration.

enum Gender { Female, Male, Alien, }

Do you think it compiles? Note that there is a comma after the last element. I would say that it won't compile, at least it doesn't look OK to me.

Guess what, it compiles and that's so good news. Why is it good news? Simple, if you happen to use code generators (hint: [CodeSmith]) you would know that the last comma is always a pain to remove when you are autogenerating an enum, for example. Even if you know the number of elements you want to include in the enum there is some code required to remove the last coma. Let's take a look at an example from my recent template:

public enum SomeList { <% string[] enumItems = new string[]{"One", "Two", "Three"}; for (int i=0; i<enumItems.Length; i++) { %> <%= enumItems[i ] %><% if (i<enumItems.Length-1) { %>,<% } %> <% } %> }

This code produces this output:

public enum SomeList { One, Two, Three }

To remove the last comma I had to use for instead of much more handy foreach. Furthermore I had to add an entire if clause next to the element (<% if (i<enumItems.Length-1) { %>,<% } %>) which further unnecessarily clutters the code. Quite much noise for a simple loop. Now, consider revisited version that leaves comma:

public enum SomeList { <% string[] enumItems = new string[]{"One", "Two", "Three"}; foreach (string item in enumItems) { %> <%= item %>, <% } %> }

Isn't this much more clear and compact code? The only difference is that output leaves last comma - however as I stated above, this isn't a problem at all.

The remorse of HP

A week or so ago I fumed over HP's attitude of forcing me into buying new scanner and ditching perfectly working old one just to get new drivers. And, as in the Lost series often happens, a miracle happened. HP people are obviously reading my blog and the felt a bit of remorse after my post. After all that scanner is their baby. So, the wise men there decided to make an inhuman effort and started porting drivers to Vista. Don't believe me? The same old arrogant page now reads like:

 

Sounds more reasonable. If they deliver, of course.