2012. december 16., vasárnap

How to match unicode characters?

Lately I have been digging through scraped movie information pages with grep, trying to extract information.
I was surprised to find, that '.*' in a regexp just does not match 'Castillos de cartón' (yes, that is a movie suggestion as well. :)
After some testing I saw that matching brakes at the accented character being actually represented in two bytes. After some digging I have found the solution at: http://www.regular-expressions.info/unicode.html
To sum it all up you will need a perl regexp, where \X is the unicode version of the dot, so instead of:

grep 'class="blackbigtitle">.*' 135428/.porthu.html

you should use:

grep -P 'class="blackbigtitle">\X*' 135428/.porthu.html

And that is all, folks! :)

2012. december 2., vasárnap

What is the optimal display for Movies and TV shows?

In my recent post I have explained the basic calculations for screen sizes, areas and maximum watching distances. Having a look at the areas I got curious, since one way or the other most people do not always use the full area of their screen for viewing: your 16:9 fullHD screen is fine when you are watching 16:9 TV Shows, however most of the movies are 2.35:1 aspect (~21:9), so you see black bars at the top and bottom of the screen watching these.

Recently I have seen screens advertised to be made specifically for movies: they have an aspect of 21:9 being 2.33:1, meaning practically no black bars when watching movies. I got curious: how much better are these screens for movies and how much worse for TV shows?
Should you choose this if you mostly watch movies?

Lets see the bare numbers: suppose we both screens are 50".
  • The 16:9 screen offers 1068.2 square inch of screen estate, fully used when watching 16:9 TV Shows. Only 813.9 is used however, when watching 2.35:1 movies.
  • The 21:9 screen comes with an area of 905.2, already 15% smaller due to the different aspect. This is fully utilized, when watching moves, which means only 11% more screen for film addicts. However watching TV Shows on these uses only 689.7 area, which is only 65% (less than two thirds!) of the other screen in this scenario.
Thus I would say you should not really go for the 21:9 ones: they offer only 11% more screen for movies but lose about one third of the screen when watching pretty much anything else.

Interestingly enough I was also under the impression, that the 21:9 screens are significantly more expensive, however I have found that at least the VIZIO XVT Cinemawide Smart 3D LED TV at $1930 is absolutely on par with the 16:9 ~58" screens with the same features (3D etc.) So this shall not be your sole motivation.

Rendszeres olvasók