Martin Suchan – BloQ Just another WordPress site

26Jul/110

HTC HD7, Windows Phone 7 + Mango, 2/2

V mé první části minirecenze jsem popsal základní parametry telefonu HTC HD7 a systému Windows Phone 7. V druhé části se budu věnovat vestavěným aplikacím a funkcím, a zaměřím se také na změny, které přínáší chystaná aktualizace Mango.

17Jul/110

HTC HD7, Windows Phone 7 – recenze 1/2

Asi tak před čtvrt rokem jsem si koupil nový telefon značky HTC HD7 se systémem Windows Phone 7, o kterém bude tato mini recenze.

Ještě před zakoupením jsem určitou dobu řešil, s jakým systémem by měl můj nový stroj být - jedno jsem věděl jistě, měl by to být dotykový smartphone, ať nejsem pozadu za dobou, že :) Rozhodoval jsem se mezi Androidem a právě Windows Phone 7, ale WP7 platforma nakonec výhrála - důvodem byla především výrazně nižší cena přístrojů ( 7500 Kč vs 13000 Kč za prakticky stejnou výbavu), chuť experimentovat a také příslib velké aktualizace, která na podzim přínese většinu chybějících vlastností. Inu koupil jsem si za 7,5 tisíce telefon HTC HD7 - je to asi po deseti letech můj první telefon jiné značky než (Sony) Ericsson.

 

14May/110

Creating ‘select multiple’ element in IE6 using jQuery

I was facing recently strange problem with creating <select> tag with 'multiple' attribute in IE6. Normally it's done using $("<select>").attr("multiple", true), but this does not work in IE6 - the crated select element was simple every time, without multiple choices. Setting 'multiple' attribute in IE6 programatically just doesn't work. I spent lot of time finding some workaround, but the solution I discovered is pretty simple, just use this object constructor:

$("<select multiple='multiple'>")

It's not 100% clean solution, but it works in IE6 and that's important.

If you know better solution, you might update the jQuery I created for this issue: http://bugs.jquery.com/ticket/9231

Tagged as: , No Comments
3Apr/110

Simple GUID generator

We had a discussion in our work about the uniqueness of GUIDs across the application word, possible chance of finding duplicates and overall the idea of using unique IDs. It gave me an idea to create a page working as a simple GUID generator - so I googled for about 5 minutes what is the exact structure of a GUID and refreshed my old PHP knowledge, put several lines of HTML code together and in less than 10 minutes I came with this page - it's really simple, but it works, uniqueness guaranteed :)
http://guid.suchan.cz/

Tagged as: No Comments
31Mar/110

New line characters in XML

Just a small hint - have you ever been wondering, how to put newline characters into XML document? typical string with escape sequence like '\n' can't be used, because this string has no special meaning in XML. Instead of you need to use hexadecimal escaped character: &#10; for newline or &#13; for carriage return. Simple, isn't it?

Tagged as: No Comments
16Mar/114

Fixing Lightword Theme in Internet Explorer 9

I have found some time ago, that my blog is not properly displayed in latest Internet Explorer 9 - all headers are gone. I just ignored this issue for some time, until now - final IE9 has been released, it's a sign to do something about it. Well, I googled what the problem might be - when inspecting the structure of a page I noticed, that all headers are written using some strange <cufon> tags.  As I found, Cufon is a very interesting way how to incorporate non-standard fonts on a web pages, but sadly in IE9 it wasn't working as expected.

There are basically two usable solutions - the easy one and the right one. In the easy one just add meta tag to your page saying "render this page in IE8 compatible mode":

<meta http-equiv="X-UA-Compatible" content="IE=8" />

This works, but somehow we all feel it's not the right solution.

The right one is just downloading fixed version of cufon.js library and replacing existing cufon-yui.js file in Lightword Theme folder. Sounds pretty easy:

You can download the updated file from this location. It's also good idea to minify the size of this file using for example this site. Done.

Source

Filed under: Tips&Tricks 4 Comments
23Feb/110

Jak jsem si koupil originalni hru…

...aneb s poctivostí nejdřív pojdeš.

V lednu jsem si na Czech Computeru koupil originální hru Settlers 7, ale nakonec jsem si jí ani jednou nemohl zahrát a musel jsem jí vrátit. Jak to? Jednoduše, aktivační klíč v balení hry byl neplatný a ani výrobce hry, ani distributor to nedokázal nijak vyřešit. Jako uživatel jsem na podpoře a dopisováním strávil několik dnů a výsledek byl jen ten, že mi byly vráceny peníze. Kdybych si tu samou hru stáhnul třeba z Pirátské zátoky, mohl bych hrát tak do dvou hodin.

Jak to všechno probíhalo?

18Feb/116

How to make text unselectable on HTML page

How to make text on a web page unselectable? There are several possible approaches - using overlay transparent image in front of the text, using image with text instead of text, or using the following best practice:

There are currently two independent ways for preventing text selection: using CSS style user-select: none; and using attribute on target element unselectable="on". Unfortunately only subset of browsers supports the first one and another subset the second one. To be more precise the CSS style user-select: none; is currently not supported anywhere, but you can use these browser specific styles:
-webkit-user-select: none; - working in Chrome and Safari
-moz-user-select: none; - working in FireFox

On the other hand unselectable="on" is working in Internet Explorer 6+ and in Opera. There is actually one simple hiccup with this property - you need to use it on each sub element in you text to prevent the selection across elements, but I'm sure you'll figure this out :)

Summing that up: using the style and the attribute at the same time on your text you can easily prevent selecting anything.

Example: you can't select this sentence :-P


Tagged as: , 6 Comments
15Feb/111

Disabling key down event propagation in JavaScript

Imagine this non-trivial problem: you have div element with overflow: auto; and long text inside. The scrollbar appears automatically. Normally when the div is focused pressing keys Up or Down causes moving the content up or down. But what if you don't want to scroll the content on keydown event?

11Feb/110

Badges for World Community Grid team statistics

Well, the idea of Team badges really caught me, so I wrote little Opera Extension which injects team badges to Team Statistics page - and it looks really great :)
Current ratio is 1 day in user badges = 1 year in team badges.
http://test.suchan.cz/WCG/WCGTeamBadges.oex

It is currently in "beta" phase - it have tested it only on few pages, but it should be OK - give it a try :)

Filed under: BOINC Continue reading