2015. december 5., szombat

Stop Microsoft CRM making your life miserable!

I have been annoyed beyond words by how bad is the Dynamics CRM 2015 Client built by Microsoft for their own Outlook application. I went through quite a bit of research, fiddling, trial and error, and these things seemed to help a bit.

Funny bit is that the CRM web interface seems to work faster now in Firefox and Chrome than in IE and Outlook. :) (Outlook also mostly loads CRM pages into Outlook windows.)

Hope they will help you too!

N.b.: yes, I am writing this after installing the latest 1.1 Update for Microsoft Dynamics CRM 2015 for Outlook and problems still presisting: https://support.microsoft.com/en-us/kb/3072333.

Script errors

If messages like this stop you regularly annoy the hell out of you:

..and render pages like "Edit Opportunity" unusable:
  1. Exit all programs;
  2. empty your %TEMP% folder;
  3.  flush your DNS cache and Internet Explorer cache as described here: http://www.dynamicscrmpros.com/clearing-microsoft-dynamics-crm-common-script-error/

Getting around the problem

If you are till getting the script errors, but do not want to resort to using browsers, you can also set Ribbon: View / reading pane to Right, then you can see almost all Opportunity data on the right without opeing the item and triggering all the script errors.
You can also add notes and other stuff without opening it: Ribbon:Add / Note etc.

Obviously it would be best if MS just fixed this, but I got tired waiting for that in the past few years using the Alpha quality software they put into GA... :(

Annoying Tracking windows blocking you

If your hands are tied for tens of seconds almost every minute by these windows (which will happily block applications other than Outlook as well):


1) Go to Windows search bar, type CRM, and select Diagnostics (same CRM icon though).

2) Make sure the following are checked under Synchronization Troubleshooting

Then go to the Advanced Troubleshooting and Delete temps  then Enable crm outlook addons

Finally Restart outlook a and sync a few times.

Even less tracking

Open an email, that is tracked by CRM, then select Options form the bottom CRM pane:
This dialog should open:
And disallow your software to send email and check your inbox (first two checkboxes).

Additional sources I used





2015. szeptember 27., vasárnap

Process iperf output for high latency high bandwidth broadband

Well after my last post I got the time to analyze, why WinSCP and the SFTP protocol in general cannot get a single TCP connection up to the maximum available bandwidth but usually max out at around 400Kbytes/sec, while 4-8 transfer do use up all the remote uplink (~10Mbit/sec cable uplink = ~1.25Mbytes/sec or ~1220 Kilobytes/sec).
I created (copy&paste) a long script to test several send buffer sizes and TCP windows. Iperf gives you output like this:
------------------------------------------------------------
Client connecting to 222.165.17.7, TCP port 443
TCP window size:  512 KByte (WARNING: requested  256 KByte)
------------------------------------------------------------
[  3] local 192.168.121.2 port 36327 connected with 222.165.17.7 port 443
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  6.06 MBytes   621 KBytes/sec
[  3] 10.0-20.0 sec  8.19 MBytes   838 KBytes/sec
[  3] 20.0-30.0 sec  8.31 MBytes   851 KBytes/sec
[  3] 30.0-40.0 sec  8.38 MBytes   858 KBytes/sec
[  3] 40.0-50.0 sec  8.12 MBytes   832 KBytes/sec
[  3] 50.0-60.0 sec  8.00 MBytes   819 KBytes/sec
[  3] 60.0-70.0 sec  7.62 MBytes   781 KBytes/sec
[  3] 70.0-80.0 sec  8.31 MBytes   851 KBytes/sec
[  3] 80.0-90.0 sec  8.12 MBytes   832 KBytes/sec
[  3] 90.0-100.0 sec  8.12 MBytes   832 KBytes/sec
[  3] 100.0-110.0 sec  8.19 MBytes   838 KBytes/sec
[  3] 110.0-120.0 sec  8.00 MBytes   819 KBytes/sec
[  3]  0.0-120.2 sec  95.5 MBytes   814 KBytes/sec
[  3] MSS size 1248 bytes (MTU 1288 bytes, unknown interface)


 I applied this script to the output of iperf to create a CSV only using bash scripting:
echo -ne "\xEF\xBB\xBF"
echo "Send buffer;MTU;MSS;TCP window;Speed"

while read TOPROCESS
do
    case "$TOPROCESS" in
        *buffer* )
            TOPROCESS="${TOPROCESS/K send buffer*/}"
            SENDBUFFER="${TOPROCESS/* /}"
            ;;
        TCP* )
            TOPROCESS="${TOPROCESS/ [KM]Byte (WARNING*/}"
            TOPROCESS="${TOPROCESS/TCP window size: /}"
            TOPROCESS="${TOPROCESS/ /}"
            case "$TOPROCESS" in
                1.00 )
                    WINSIZE="1024" ;;
                1.12 )
                    WINSIZE="1152" ;;
                1.25 )
                    WINSIZE="1280" ;;
                * )
                    WINSIZE="$TOPROCESS"
            esac ;;
        *MSS* )
            MSS=${TOPROCESS/* size /}
            MSS=${MSS/ bytes \(*}
            MTU=${TOPROCESS/*MTU /}
            MTU=${MTU/ bytes,*}
            ;;
        *Bytes/sec )
            SPEED=${TOPROCESS/ [KM]Bytes\/sec*/}
            SPEED=${SPEED/ Bytes\/sec*/}
            SPEED=${SPEED/*Bytes/}
            SPEED=${SPEED##* }
            case "$SPEED" in
                1.*    )
                    SPEED=${SPEED#1\.}
                    SPEED=${SPEED#0}
                    SPEED=$((SPEED*1024))
                    SPEED=${SPEED%??}
                    SPEED=$((SPEED+1024))
                ;;
                0.00 )
                    SPEED="0"
                ;;
            esac
            echo "$SENDBUFFER;$MTU;$MSS;$WINSIZE;$SPEED"
            ;;
        *0.0-10.0*Bytes/sec | Client\ connecting* | *connected\ with* | --------------* | *Interval*Transfer*Bandwidth* )
            # echo "Dropping connection ramp-up measurement"
            # echo "Dropping connecting/connected lines"
            # echo "Dropping separator lines"
            # echo "Dropping header lines"
            ;;
        * )
            echo "$TOPROCESS"
    esac
done < bandwidth-measurements.txt


This outputs a standard UTF-8 CSV for Excel, but the MSS and MTU readings are unfortunately always from the previous measurement. I did not bother fixing this, since it was the same for me along the whole measurement. :)

The result did highlight a few things:
  • Probably there have been some intermittent errors here and there
  • the send buffer size does not seem to change a lot, there are good results with 64 and 512 as well
  • TCP windows below 768kbyte/s are useless, however I did not try windows large enough to see the speed decline
  • probably I should rerun the tests with less buffer sizes and 768-5k window sizes
  • or just allow the sending linux box to scale it's TCP window very high :)

2015. június 28., vasárnap

Change Drive Letter and Paths greyed out? (Windows 7)

If you use Backblaze cloud backup it can be utterly frustrating that disconnecting and reconnecting USB drives can change their drive letters, and Backblaze has no method of cleverly "following"them.

Even more frustrating, that they do not provide a knowledge base article how to fix it (change it back).

But the worst thing happens, when for some reason you cannot do it right clicking your computer, then "Manage" then "Disk Management", then right clicking the Volume (not the disk!) with the improper drive letter: for one out of my three USB HDDs that option is greyed out!

Let's cut to the chase: i found the solution on this forum:
1. Open a command prompt.
2. Type in diskpart.
3. Type list disk to see a list of disks.
4. Type select disk #  (where # is the disk you want).
5. Type list volume to see partitions.
6. Type select volume #  (where # is the volume you want).
7. Type assign letter=x  (where x is the drive letter).

Using a command line and diskpart just worked for me! YMMW!

2015. május 3., vasárnap

Five times faster TCP speed on high latency high bandwith connections

All right, it took me quite some time to figure this out so I will just give you some background to see if you are in the same situation, then the solution.

My home connection in Singapore is a 100/10 Mbit/sec cable line, speedtest.net measures an average 10ms ping, 103.8Mbit/s (12 682 KiB/s) download and 5.9 Mbit/s (714 KiB/s) upload speed, which is kind of a decent connection (there is 500Mbps fiber available to those who really need it. :)

Ther server and network I would like to access is in Hungary, on a 120/20 Mbps cable, so obviously that 20Mbit/sec uplink should be limiting my download speeds at around 2441 KiB/s=20*1000*1000/1024/8.

I did test the intercontinental connection speed with speedtest.net:
  •  Magyar Telecom, Vodafone and Telenor servers
  • SG daytime and SG late evening HU daytime as well
The daunting average numbers (average of 3 or 5 for each server-daytime combination): 411ms ping (RTT), 1114 KiB/s download, 168 KiB/s upload. Also there is a huge variance even in the short term, and a large drop when both time zones are in daytime.

I have set up OpenVPN but could not get anything more than 175 KiB/s (neither using SMB nor pure FTP transfer).

Next tried SCP and SFTP without VPN: the best I could get was a much favorable 700 KiB/s. (Not CPU bound, even the far side Linux on and Atom CPU was only used 10%) That however is a protocol most movie players will not stream over. :)

Then I figure I will need to go rouge (I mean raw) and have set up iperf (and the necessary port forwarding on both sides). On the first run with default parameters I got back to results around 175 KiB/s!

After tuning TOS, increasing send buffer and TCP window size I was able to get it up to nearly 512 KiB/s.Clearly, something was still limiting it.
Windows accepted any window size I threw at it, but Linux maxed out at 320KiB for some reason. ("Should be enough for everyone!" some Linux believers might scream.)

But in fact calculating the Bandwidth Delay Product (see iperf page) for the six intercontinental per server averages I get, e.g. to Vodafone server in the evening 1235 KiB/s * 0.516sec (RTT) = 637 KiB of data can be in flight!

Then I just had to look up these network tuning parameters:
net.core.netdev_max_backlog = 5000
net.core.wmem_max = 12582912
net.core.rmem_max = 12582912
net.ipv4.tcp_rmem = 10240 87380 12582912
net.ipv4.tcp_wmem = 10240 87380 12582912

net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_sack = 1

Which you should put into /etc/sysctl.conf, then run 'sudo sysctl -p', and set TCP window size to 640KB (that should be enough for everyone!), voila:
[  3] 10.0-20.0 sec  9.75 MBytes   998 KBytes/sec
[  3] 20.0-30.0 sec  9.75 MBytes   998 KBytes/sec
[  3] 30.0-40.0 sec  9.62 MBytes   986 KBytes/sec
[  3] 40.0-50.0 sec  9.44 MBytes   966 KBytes/sec
[  3] 50.0-60.0 sec  9.88 MBytes  1011 KBytes/sec
[  3] 60.0-70.0 sec  9.56 MBytes   979 KBytes/sec
[  3] 70.0-80.0 sec  9.38 MBytes   960 KBytes/sec
[  3] 80.0-90.0 sec  9.38 MBytes   960 KBytes/sec

I admit I did not do a lot of further testing and tuning, since I got pretty close to the average value that was achievable according to the intercontinental speedtest measurements. :)

ToDo: 8 and 16 parallel TCP streams can rob more bandwidth and perform at a total of 1.2-1.3 MiB/s, so there is some more space for tuning.
But that may also just be fooling the rate limiting algorithms for a bit longer in the several routers between the endpoints, also streaming a single movie over multiple TCP streams is not feasible, so I think I am pretty much done for now. :)

EDIT: Another article about Windows 7 TCP tuning suggests:
netsh int tcp set global congestionprovider=ctcp
For better broadband utilization. :)

2014. augusztus 24., vasárnap

Quick buyers' guide to the ultimate bicycle lock

I was repeatedly told my bike lock (3kg armored cable lock from ABUS) is crap, should have a better one for my bike. I started reading up on the subject, here is a concise summary of my findings. See reference articles at the bottom. Just read the first 2 sections if you do not have time!

Principles

  1.  If you leave your bike in a place without traffic and people the thief  can try to break your lock forever - and no lock can withstand that.
  2. If you choose a crowded place to lock your bike lock only has to take longer to hack than the one on the next similar bike - they will pick the easier to break.
  3. You should spend at least 10% of the value of your bike on your lock.
In my case my Kona bike costs somewhere north of USD1000, so I am supposed to look for a $100+ lock (the current one cost around $30).

The winner

Without further ado: buy hardened steel squared or hexagonal link chains with hardened steel integrated locks or padlocks: these swing away from the angle grinder, slip out of the bolt cutters, resist longer than any other kind except for the best U-locks, with which however it is pretty hard to find any object to lock to where I live (Budapest, Hungary).
Read reviews before making a choice on the specific models: chain locks can also have weak points ("He found a weak link in the HipLok L1 Lite, snipping the shackle with bolt cutters in 29 seconds.").

Caveat emptor: these are heavy(!!!) and rattling pieces, you will have to wear them or put them e.g. into a backpack, cannot really fix it on the bike while riding.

Good examples

  1. ABUS Granit CityChain X-Plus - 1.9kg (85cm) - 3.7kg (170cm)
  2. OnGuard 8020 Mastiff ("hardened-steel links withstood a hacksaw and bolt cutters. After nearly three minutes of use, the battery in Ruzal's angle grinder died before he could cut the shackle") - 7kg
  3. OXFORD NEMESIS MOTORCYCLE ULTRA STRONG CHAIN and PADLOCK 1.5M - 9kg
  4. Blackburn ATTICA CHAIN AND PAD LOCK - 6kg
Or by anything with a Gold Sold Secure rating, or anything with four or five stars here.
Major manufacturers: Kryptonite, OnGuard, Abus, Blackburn, Masterlock, Knog, and Avenir.

Second best

U-locks (or D-locks) are the second best choices, hardest to cut through, however if large, a car jack can easily inserted into it. The smaller it is (against jacks) the harder it is to find a sufficiently narrow but strong object at the right height to lock your bike to. :(
If you by this, choose one that is locked on both ends of the U part:
  1. ABUS Granit X-Plus
  2. ONGUARD Brute
  3. Kryptonite New York Lock
  4. Kryptonite New York Fahgettaboudit U-Lock
  5. Kryptonite Evolution Series 4 
Most of them are up to 2kg.
Or by anything with a Gold Sold Secure rating, or anything with four or five stars here.

Not recommended

  1. Masterlock Force 3 - long term problems reported (ref. no. 11)
  2. TiGr - - easy target for bolt cutters and angle grinders (ref. no. 11)

Tools

This is what we are defending against:

  1. Battery powered angle grinders: the most hardcore tool, quite fast, not quiet, but cuts through any metal with time:
  2. Hacksaw: basically the hand powered version of the above, slower and quieter:
  3. Jack: mainly used against U locks, quite fast and quiet:
  4.  Bolt cutter: a cutting tool designed to yield a cutting force up to 100 times stronger than the force on the handle. Quick, quiet but clumsy:
  5. Wire cutter: basically small, pocketable version of the above, whichever lock cannot withstand this is a lost cause:

Standards

From reference no. 6:
"Sold Secure is an independent organisation administered by the Master Locksmiths Association. Locks submitted receive one of three ratings: Gold, Silver or Bronze. These reflect the length of time a lock will hold out against escalating levels of attack. Bronze is a minute with basic tools; Silver is three, with a wider array of tools; Gold is five minutes with a more sophisticated array of tools. 

The largest manufacturers also submit to the German and Dutch ART1 to 5+ standards. These are a very tough standard and worth looking out for. Gold or high ART-rated locks can be more expensive but they may help you get a discount on your insurance if you use one."

References

  1. Bike locking 101 in Hungarian - not fully agreed, but do not buy that they don't recommend
  2. German test TV show, obviously biased towards / sponsored by ABUS
  3. A quick comparison (only care about what is best recommended)
  4. A New York based mechanic shows you how easy it is: cable lock cut with wire cutters - unbiased
  5. Suggests u-lock for portability, however still chain is best for security and flexibility
  6. An in-depth guide
  7. Nice tips in there: GPS tracker and to use an additional cable for the wheel not hold by the chain
  8. Some more chain locks
  9. Shows that the fashionable Hip Lock chain lock is actually only Silver rated, still at the top of the league
  10. How to lock it? with either a chain or a U lock
  11. Another detailed write up

2014. július 28., hétfő

NTFS compression vs. 7zip

I was migrating 7 years of accumulated "My Documents" (word, PDF, scanned, totally mixed) of my wife to her new SSD, where capacity is still much more scarce.
I took time to decide: shall I compress all unused and old data with 7zip* to save space, but make it a lot more complicated to access them**, or shall I just let NTFS in Windows 7 do the job, leaving them accessible as single files?

I am posting the results, because they differ significantly from what I have expected: that would have been a slightly less efficient compression from NTFS.

Instead, this is what I got (for a subset of "My Documents" M-Z, 67 folders, 1 142 files).

Windows 7 NTFS compression (bytes):
Total size: 1 060 762 801, Compressed: 971 467 130, Gain: 8.4%
7zip Ultra compression (bytes):
Total size: 1 060 762 801, Compressed: 489 906 124, Gain: 53.8%

This means, that NTFS compression was basically useless on her "My Documents" contents, and that is not because the contents were incompressible: 7zip freed up more than six times more than NTFS, giving back more than half of the valuable SSD capacity!

Have had a quick Google: it seems there is no way to beef up NTFS compression levels the way Linux can be tweaked.

Comments Welcome!

*: 7z format, Ultra compression level, which obviously does combine multiple files for better compression, since I was unable to obtain single file statistics.

**: The other disadvantage being that a single archive is most probably a lot more fragile, a bit of damage could potentially make a lot of files inaccessible. Fortunately I have a backup of all the files, so this is not a concern. :)

2013. október 7., hétfő

Big JPEG Compression and Statistic experiment

A short while ago I had to think about how to make images smaller, without loosing (any more) information. For PNGs it is easy: I am a long time user of IrfanView, which includes the PNGOUT plugin to optimize compression of the image information.
Unfortunately two color images (used frequently in document scanning, because they use 1 bit per pixel, 1bpp) are usually stored in TIFF, Group 4 compressed images and in the past I have found these to be smaller than the same image saved in 1bpp PNG from IrfanView using PNGOUT. I have found no tools to poke around with this compression, also, IrfanView tends to save larger TIFF G4 images, than what come out of scanning.

This made me tudn my attention to Grayscale (8bpp) images,  which are often saves in JPEG, even though that is a lossy compression (meaning the decompressed image will not be equivalent to what came out of the scanner, just will look like that).
It is very easy to make a JPEG smaller by lowering its quality during compression, but it will just increase the difference from the original image thus decrease the similarity to that. We want to keep as much information of the original image as we can, so I was only looking into improving the compression while keeping the encoded information intact.

This made me do a large scale experiment on all my fifty two thousand JPEG images: I compressed them with all the different methods I could find, and recorded the results. In a series of posts I will review these result, because I have found several interesting angles to them:
  1. How to check the integrity of all your photos in an automated way: easily done with a following these instructions! Basically, on linux install jpeginfo, then, in the designated folder perform: (let me know if you need windows instructions!)

    find -iname "*.jpg" -print0 | xargs -0 jpeginfo -c | grep -e WARNING -e ERROR
    
  2. How much space can you save by re-compressing your photos, _without_ losing a single pixel of information (nor the EXIF data)?
  3. Is it really worth all the extra hassle to create ultra-progressive JPEGs?
  4. What is an arithmetic compressed JPEG, how much size it gains and which applications can read it?
  5. Which cameras / camera makes have the best and the worst JPEG compression engines?
  6. How have the megapixels evolved along the years?
  7. How do re-compression gains change compared to image size (megapixels)?
  8. How to automate all these, and which problems need to be solved for this (e.g. how to create progressive, arithmetic coded JPEGs)? actual scripts and binaries where needed!
  9. Shall I look at my 30GB+ MJPEG movies as well? :)
For starters, let's see what cameras have produced my 51719 JPEGs: (yes, several images were taken with mobile phones)

Apple 562
BlackBerry 135
Canon 5928
Casio 214
Fuji 17552
HP 112
Kodak 234
Minolta 244
Motorola 2
Nikon 9783
Nokia 1430
Olympus 13813
Panasonic 698
Pentax 5
Samsung 236
Sony 276
#N/A 495

And a sneak peak into the total possible filesize / storage gains, and for you to have a quick answer:
  1. Originals: 135.6GB
  2. Re-compressing only the Huffman coding: 130.21GB, 3.78% total gain
  3. Re-compressing the Huffman coding, and storing a progressive JPEG: 123.67GB, 8.79% total gain, 4,82% gain over just Huffman optimization!
  4. Re-compressing the Huffman coding, and optimizing progressive JPEG storage (a.k.a. ultra-progressive JPEG):122.53GB, 9.64% total gain, only 0.85% gain over progressive JPEG
  5. Re-compressing using arithmetic compression instead of Huffman: 116.88GB, 13.81% total gain, 4.17% gain over the best possible Huffman compression!
  6. Re-compressing using arithmetic compression and storing a progressive JPEG: 114.72GB, 15.4% total gain, 1,59% gain over non-progressive arithmetic JPEG
  7. Re-compressing using arithmetic compression and and optimizing progressive JPEG storage (a.k.a. ultra-progressive arithmetic JPEG): 113.94GB, 15.97% total gain, only 0.58% gain over progressive arithmetic JPEG
Breakdown for each camera brand in the next post!

Questions welcome, as always! :)

2013. január 13., vasárnap

Better use of Panasonic Viera remote with XBMC

I am using XBMC on a Raspberry Pi (raspbmc actually) with my Panasonic Viera plasma screen.
It really is fascinating to see that it can be controlled with the TV remote out-of-the-box, right after install. It uses a communication between the computer and the display, on the HDMI cable called CEC.
However I missed some functions while found a few buttons on the remote which did not do anything useful to me. So here is the result of my investigation on which buttons can be programmed and how I changed the defaults to a more sensible layout.

I found, that not all the button presses from the remote are actually reported over the HDMI cable to the computer: (I used the custom remote config printig messages described here)

number on the right (label of the button) - what it sends to XBMC
8 (OK) - select
9 (OPTION) - title
10 (no labels, just colors) - red, green, yellow, blue
11 (text) - teletext
12 (STTL) - subtitle
13 (1-9, 0) - one two, three, four, five, six, seven, eight, nine, zero
19 (X) - clear
20 (GUIDE) - guide
21 (just arrows) - up, down, left, right
22 (arrow turning from right to left) - back
26 (up and down arrows) - pageplus, pageminus

These buttons do not send any signals on CEC: 1, 2, 3, 4, 5, 6, 7, 14, 15, 16, 17, 18, 23, 24, 25 and unfortunatelly the whole group 27 of buttons, even though they seem best fit for media control. :(
And this is how I added all the usually needed: on notmal XBMC systems you modify this file:
/opt/xbmc-bcm/xbmc-bin/share/xbmc/system/keymaps/remote.xml
on the raspbmc I modified this (raspbmc can have multiple versions of XBMC at the same time and switch between them):
/home/pi/.xbmc-current/xbmc-bin/share/xbmc/system/keymaps/remote.xml
In there, inside global I added:



That makes the red button to stop playback, the green to play and yellow to pause. Blue will bring up the window to download subtitle for the item being played. (The subtitle add-on has to be installed and enabled for that.) I also changed zero to highlight an item in the file listings.
In the Home section I added:


For Guide button to show the System Info window and the OPTION button to go directly into Settings.
In the FullscreenVideo I have added:


This makes the program changing up and down buttons to adjust the subtitle delay directly.

Should you want to add more or other functions to the buttons or bring up other windows you can find the Action IDs here and the Window IDs here!

Happy hacking with the rest of the buttons, screens and functions! :)

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.

2012. november 15., csütörtök

HDTV screen calculation basics explained

This article is intended to give you the quick formulas to calculate all interesting measures from the diagonal size of your screen optionally walking you through the calculus with the lease possible pain. (hopefully :)
Let me know if you are interested in other calculations as well, and I will update this article when I find the time!

Quick formulas for 16:9 screens

Width:
w=0.8716 * d
Height:
h=0.4903 * d
Area:
a=0.4273 * d^2
Maximum distance from your eye to the screen to be able to see all the details displayed:
mh = 0.4358 * d / tan(hres / 120°)
mv = 0.2451 * d / tan(vres / 120°)
whichever is shorter.

Examples

Please note, that the viewable screen size is rarely equal to the size used in the marketing :) You shall use whatever specs your screen has. Both of my screens are w:h = 16:9.
  1. My new 50” (127cm) Panasonic Viera P50UT50E, native resolution: hres:vres = 1920:1080 pixels (full-HD, the usual resolution of blu-ray movies)
    d=49.9” (126.7cm) is viewable
    w=43.5" (110.5cm)
    h=24.5" (62.1cm)
    a=1064 square inch (6864.4cm2)
    mh=75.8" (192.6cm)

    mv=77.2" (196.2cm) -> visible horizontal and vertical resolution about the same
  2. My old 32” (81,3cm) JVC AV-32H40 CRT, native resolution: 720 * 576 pixels (PAL SDTV, the usual resolution of PAL DVDs)
    d=29.9” (75.9cm) is viewable
    w=26" (66.2cm)
    h=14.7" (37.2cm)

    a=382 square inch (2464.6cm2)mh=124" (314.9cm)
    mv=87.3" (221.7cm) -> visible vertical resolution is a lot better, makes you have to move closer
And the surprising information here is: stepping up from a 32" screen to an 50" one can earn you almost three (2,79) times as large of a screen area to watch! (Being full-HD it also has 2 megapixel native resolution compared to the 0.4 megapixel of the SDTV / DVD - that is quite an upgrade too :)

Stop here, if you don't care to know why. :)

Diagonal size and aspect ratio

The only information we need to know to start is the diagonal size (d) of your screen and the aspect ratio (width to height, w:h) of it:
  • nowadays usually 16:9
  • the old ones being 4:3
  • screens made for computers are often 16:10
  • and there are some 21:9 models out there. These are the ones best suited to watch movies see my upcoming post about how much better these are for movies and worse for TV shows! :)

Quick formulas for screens with other aspects

Please replace 16 and 9 with the aspect numbers for your screen:
Width:
w=16 * sqrt(d^2 / (16^2 + 9^2) )
Height:
h=9 * sqrt(d^2 / (16^2 + 9^2) )
Area:
a = 16*9 / (16^2 + 9^2) * d^2

Width and height from diagonal

We know how the diagonal of a square screen relates to its width and height:
w^2 + h^2 = d^2
Let’s define an unknown x knowing the relative ratio of the width and height of your screen:
Width:  
w=16 * x
and height:
h=9 * x
Use the aspect numbers of your own screen!

Now we substitute, so that we only have one unknown value to find out (we know d):
(16 * x)^2 + (h=9 * x)^2 = d^2
which is the same as:
256 * x^2 + 81 * x^2 = d^2
which is the same as:
337 * x^2 = d^2
which is the same as:
x^2 = d^2 / 337
which is the same as:
x = sqrt(d^2 / 337) (sqrt means "square root of")
This means that width and height both can be calculated from the diagonal.
Width:
w=16 * sqrt(d^2 / 337)
and height:
h=9 * sqrt(d^2 / 337)

Area from diagonal

We know how to calculate the area of the screen from its width and height:
a = w * h
We will substitute widht and height, know that we have the formulas for them:
a = 16 * sqrt(d^2 / 337) * 9 * sqrt(d^2 / 337)
Which is the same as:
a = 144 / 337 * d^2

Maximum viewing distance

According to the information I have found on Internet the smallest bit on a picture an average human eye can distinguish from another is one the size of a minute of arc: 1' (one degree of arc: 1° contains 60 minutes of arc: 60', the full circle is 360° which is 21600').
It is expressed this way, so that it does not matter how far that visible bit is. For example you may see the fly on the glass of your window in the same size as a building behind it in a distance, if they cover the same area of your visible field.
We refer to the maximum distance here as the where you cannot move any farther if you still want to see all the details that are displayed on your screen, supposing you actually use the full resolution of your screen. Some important points here:
  1. I suppose you are watching content on your screen, which does not have a smaller resolution than your screen. Watching a DVD film on a full HD screen will not really deliver you more details, since those are not recorded on the DVD.
  2. Some people might have better vision, some might have worse, this calculation is for the average.
  3. Some might argue, that even if you cannot see the difference between adjacent pixels, because they seem so small they still might look more "pleasing" to the eye. I do not care about such arguments. :)
  4. 3D TV-s indeed seem to need some further considerations. I will delve into that as soon as I find the time.
  5. We will not consider the minor difference in the visible size of a pixel in the center and on the edge of the screen. (the one on the edge is physically the same size, but is further from your eye, since the screen does not form a circle around your eye, thus it seems smaller)
 We can calculate this maximum distance from the data we already know: the width of the screen and the horizontal resolution or the height of the screen and the vertical resolution. The resolution is in turn the minimum number of minutes of arc we want to see, or else we just couldn't tell apart some separate pixels.
We will use the right-angled triangle between your eye, the center of the screen and either the top or the left edge of the screen.
  • There is a right angle in it at the center of the screen (there should be for optiam viewing experience anyhow :).
  • The lenght of the base of the triangle (between the center and the edge of the screen) is either half of the width or half of the height of the screen.
  • Its height is the distance between your eye and the screen, what we want to find out. :)
  • The angle at your eye is half the horizontal or vertical resolution (the other half covers the right or bottom half of the sceen).
 The tangent trigonometric function for an angle in a right triangle is:
tan(angle) = (lenght of the opposite side) / (lenght of the adjacent side)
but this is the same as:
(lenght of the adjacent side) = (lenght of the opposite side) / tan(angle)
so Maximum distance from your eye to the screen:
m = (half screen width) / tan(half horizontal resolution/60 degrees)
m = (half screen height) / tan(half vertical resolution/60 degrees)
whichever is shorter.

2011. március 28., hétfő

How to replace accented characters in Excel?

If you ever tried to generate user names and / or passwords from names with non-ASCII characters (accents, diacritical marks etc.) you had to find out that there is no function for that. I have only found solutions using macros.
I refrain from writing macros: I think anything that cannot be solved in an Excel sheet should not be, rather it should be programmed in a proper programming / scripting language.
Here is my 1 minute solution for that:
  1. The first two rows of your sheet should Start with From: and To: (see the screenshot) You should put the characters to replace in the first row and the accent less versions right below these.
  2. The first column below this should contain the original text to convert.
  3. Put this function right below the From and To rows, right of the first line of text to convert (third row, second column):
    =SUBSTITUTE(A3;B$1:B$2)
  4. Copy this function to the right (under each character to replace) and to all lines (which have text to fix).
Your last column is the all fixed text. :)

  • replace spaces, eg. From: " " To: "." like in the example.
  • You can also use this to delete: replace anything with empty
  • You can also use multiple letters (replace/ delete words, eg. change ß to ss and so on)
Have fun, let me know, if you need help! :)

2011. március 22., kedd

What to do, if you cannot connect your Nokia Phone to your PC?

Have you spent countless hours trying to connect your Nokia phone to Nokia PC Suite or Ovi suite, getting errors when Windows is trying to install all the different drivers.

This solution worked for me from Nokia Support Forums:
  1. First insure you either have Windows Media Player 10 or 11 installed
  2. Download Microsoft Media Transfer Protocol Porting Kit from: Here 
  3. Once downloaded and opened the files should extract to by default C:\WMSDK. If so navigate your self to C:\WMSDK\MTPPK12\Tools\DirectMTP and extract the zip file relevant to which version of Windows Media Player you have installed and your operating system.
  4. Once extracted navigate through the unzipped directory 2 folders in (they repeat the original name of the extracted folder.
  5. Once among list of files you shall find a file named mtpinfup.exe double click it and a command prompt window should appear briefly then disappear.
  6. Right click my computer, click manage, then select device manager and select the MTP device that is still unknown; right click it, select update driver OR: disconnect, wait and then reconnect your phone.
  7. Allow it to automatically scan for the drivers and install them correctly this time.
  8. ENJOY NEVER SEEING THAT MESSAGE AGAIN!!!!

Rendszeres olvasók