Archive for February, 2006

Enchance text readability on your laptop

Tuesday, February 21st, 2006

A lot of people don’t know this, but you can greatly enhance the appearance of the text displayed on your screen by turning on ClearType.
Cleartype is a new feature introduced in Windows XP that uses a technique known as “sub-pixel font rendering” to “round up” the text displayed.
While the “cleartyped” text may be a little too blurry on normal CRT monitors, it becomes more readable and pleasing to the eye on laptop monitors.
Cleartype vs standard
Cleartype is enabled by right-clicking on your desktop, selecting [Properties], then on the [Appearance] tab clicking on [Effects] and finally enabling “use the following method to smooth edges of screen fonts”. You can choose [Standard] or [Cleartype]. The difference between standard and cleartype is that the standard setting smooths only big-sized text, thus making it more suitable to CRT displays.
You can also change your Cleartype settings with ClearTweak, a free software from ioIsland.com.

Unknown runtime error in Internet explorer?

Sunday, February 19th, 2006

If you’re getting an “unknown runtime error” in internet explorer while using the javascript method object.innerHTML=”…some html”, here is a hint to put you on the right track: you’re probabily trying to put a block-level element inside an inline element.
For example, given the html code:

<p id="the_container">Hello</p>

<script type="text/javascript">
<!--
var obj=document.getElementById('the_container');
try
{
obj.innerHTML='<ul><li>List item 1</li><li>List item 2</li></ul>'; 
}
catch(ex)
{
alert(ex.message);
}
//-->
</script>

In internet explorer, a dialog will pop up complaining about an “unknown run-time error” (Thanks Microsoft for your helpful error messages). The solution (if you really can’t force your users to use Firefox :)) is to sobstitute the parent element with a block-level one, such as a DIV:

<div id="the_container2">Hello</div>
<script type="text/javascript">
<!--
var obj=document.getElementById('the_container2');
try
{
obj.innerHTML='<ul><li>List item 1</li><li>List item 2</li></ul>';
}
catch(ex)
{
alert(ex.message); // never displayed
}
//-->
</script>

How to choose your hosting plan

Thursday, February 9th, 2006

Choosing a good web hosting provider should always involve a bit of research (unless you like to throw your money out of the window, in which case you could always give some to me 🙂 ). There are a lot of parameters you should check before selling your soul choosing your hosting company. Here are some of them…

  • The server’s operating system That’s an easy choice, choose a Windows-based server if you intend to build your website using ASP or ASP.net, or choose a Linux for everything else.
  • The scripting language support That’s another easy one. What do you want to use for your website? ASP? ASP.net? php? perl? Ruby on rails? Do you need a particular script? Choose the hosting companies that give you what you want, and ditch the others.
  • The monthly bandwidth This is probably the most undervalued feature when choosing a web hosting plan. The term bandwidth refers to the amount of data your account can transfer in a month. That means that, for example, if your site consist of a single 100Kilobytes page and it gets viewed 100.000 times in a month, your account is consuming 100Kx100.000=10.000.000K, which is more or less 9.7 gigabytes in a month. It all depends on how many visitors your site gets and on the type of content you intend to publish. My advice is to stay away from companies claiming to give you “unlimited bandwidth”: there is no such thing as unlimited bandwidth, and it will often mean that if your website gets too many visitors, it will get randomly suspended or will get as slow as hell.
  • The disk space explains itself: How much space does your site need? how much do you think it will grow in the next two years? More space is better, but in most cases you won’t even need all the space offered by the hosting plan.
  • The domain name Of course you will need a domain name for your website. Does your hosting plan give you a free domain name? If yes, who will be the owner of the domain name? You or them? Keep in mind that you can always register a .com with godaddy for just $9/year.
  • Database resources This single parameter can mean everything or nothing, depending on how your site is done. Do you need to use a blog? a CMS? do you use any script that needs database access? Unlimited databases are, of course, better than being limited to just one or two, but with a little of manual labor, you can always use the same database with more scripts.
  • E-mail Any serious hosting provider will give your account some email capability. How many addresses do you need? Do they give you autoforwarders, mailing lists, autoresponders, and a catch-all address?
  • Uptime is another very important parameter. It indicates the probability a visitor has to find your site actually running. 99% uptime is simply not enough for any serious need, because it means that statistically you’ll lose a visitor every 100. Keeping in mind that 100% uptime is impossible, choose a company that gives you 99.9% (lose a visitor every 1000) uptime or more.
  • Speed You should always check the host’s speed (with a fast connection of course). How fast is the the hosting company’s website? How fast are their customers’ websites?
  • Raw log files Does your hosting plan give you access to raw log files? Raw log files are text files monitoring every single access to your website, and are very important for any kind of statistical analysis you want to do, in order to know better who your visitors are and what are they looking for.
  • The company’s reputation You have to choose a company you can trust. Once you have narrowed down the few companies that give you what you need, you should search for any complaints you can find on google. Be careful to weight them right however, there’s quite some difference between a forum user saying that the host xxx sucks and someone who took the time to create a website named “hostxxxsucks.com” to tell his horror story with that company. If you’re still in doubt, you can always ask to the people at webhostingtalk.com.

My search for a good web hosting company finally ended when I found LunarPages, wich is now giving away the basic plan (400GB bandwidth, 5GB HDD space, unlimited mysql databases, unlimited subdomains) for $6.95/month.
Ok, that’s it for this entry. Please leave a comment if you have anything to add, or just to say hi :), I’ll be sure to read them all.