Friday, 29 April 2011

CSS: CSS3 generator and CSS3 Please!


We have talked a lot about CSS3. The not-anymore new standard is giving some of us headaches. In this post I will show two incredibly useful tools to automatically create styles for your pages.

CSS3 Generator
CSS3 Generator is a simple page with a few sliders helping to create styles for a container. Basically, moving the sliders and selecting from color pickers, we can change:
1) border radius;
2) box shadow;
3) background gradient;
4) opacity.
When we are happy with the look of the container (through the live preview), we click "Get the code!" and a pop-up with the style sheets opens, ready to be used.

The generator is a very useful tool, quick and easy to use. One important note: CSS3 Generator can create style sheets with minimal IE7 and IE8 support. Impressive!

A big thanks goes to Eric Hoffman and Peter Funk for this remarkable tool.

CSS3 Please!
Another useful page is CSS3 Please! In this case, we have a styled page, where we can toggle CSS3 effects on and off. There's a live preview of our actions, so that we can understand what every single style is actually doing to the container.
The page is commented so it is a very interesting playground and learning tool. Through it, we can really learn what the rules are doing, how they apply to different browsers and finally decide what to - eventually - use in our web pages. In addition to all that, we can change the values of the styles and see the resulting effect, applied live to the container.

The original project was developed by Paul Irish and Jonathan Neal with many other nice people contributing. The project is an open one: anyone can contribute and new features will be introduced in the future.

Hope this will help you in building remarkable style sheets for your web pages. Please, leave your comments in the section below.

Wednesday, 27 April 2011

VBScript & ASP: loops!


Everybody uses looping functions with VBScript, however do we know how many possible variant there are? How many statements? Ok, now close your eyes and count them. How many statements can you remember?

The looping statements are used to repeat a block of code for a predetermined number of times. There are 4 statements to do so:
1) For ... Next - the code is run a number of times;
2) For Each ... Next - the code is run for each item in a collection;
3) Do ... Loop - the code is run until a condition is met;
4) While ... Wend - the same as Do ... Loop.

Monday, 25 April 2011

Happy Easter


Happy Easter to everyone

Have a splendid day with your family and loved ones.

(I just wonder what you are doing here today... I hope you're not working. If so, you have all my sympathy!)

By the way: tomorrow is Easter Monday and The Web Thought will be not publishing anything. Just have a relaxing holiday period. I will get back to you on the 27th.

Friday, 22 April 2011

ASP: is this a date? The IsDate function


Form validation is probably the most wanted feature by web developers. Every web programmer, at least once in a lifetime, has dealt with the issue: the user fills in the form and submit wrong data. Without validation, the best thing could happen is that an error is thrown. The worst case? The wrong data is submitted to your database... and believe me, most of the time you don't want that.
While complete JavaScript form validation solutions are available everywhere, today I would like to point out that VBScript has a very simple function that can help us in checking dates at least.

The function
The function I am talking about is IsDate. I've already talked about the function in a post about SQL Server queries and date functions. The VBScript function works in a similar way.
Basically it returns a Boolean value (true/false) stating if an expression is a date or can be converted to a date. The function uses the local settings in the evaluation process, so be careful in using it: for example, English months in words are not the same in Italian.

Wednesday, 20 April 2011

Exchange: the recovery storage group


Today we are talking about retro-software... As many of you are already using Exchange 2010, you might not be interested in the information given in this post. In fact the Recovery Storage Group has been removed from the Microsoft famous email server starting from the 2010 version.
Anyway, if you are sticking with a previous release then I believe you should - at least - know something about recovering mailboxes from a backup. In my experience, whenever I knew about a possible disaster recovery solution, the disastrous situations never occurred. It's like a protective talisman!
So, here we are. Read this post and take it as an amulet, protecting you from disastrous situations!

What is the Recovery Storage Group?
The Recovery Storage Group (RSG) is a storage group (!) that can be used to mount a backed-up copy of a mailbox store in your Exchange environment.
Typical situation:
1) Your Exchange is working and should continue to work;
2) You need to recover a deleted mailbox or single email;
3) You do have a back-up copy of the mailbox store;
4) You need to recover that back-up and put it in a safe position to extract mails with ExMerge.
Confused? You shouldn't, because the operation is quite easy - even if could be quite time consuming.

Monday, 18 April 2011

ASP: resulting recordset in two columns


Today I am going to show you a little trick: how to display your recordset data in two columns. And to do so, we will use the MOD remainder function.
Let me make things more clear. We assume we are getting data from a database consisting in a single column recordset. Something like:

Name 1
Name 2
Name 3
Name 4
Name 5

Regardless the number of rows, what we want is to display data the following way:

Name 1Name 2
Name 3Name 4
Name 5

How do we do it? Believe me it is very simple.

Friday, 15 April 2011

Google Font Api


Following other recent posts about using non-standard fonts, I would like to show how Google Font Api is working.
Following the examples in the related page, we can create text with a custom font. In reality there's a quite wide selection of available fonts, however it is limited. If you think it is too limited, then search the blog for other solutions.

The basic function of Google Web Fonts is linking to the Google Api. Put the following code in the <head> of your document:
<link rel="stylesheet" type="text/css" href="">
   h1 {
        font-family: 'Tangerine', serif;
        font-size: 48px;

Wednesday, 13 April 2011

iPhone & Exchange: the passcode lock


The perfect scenario! Your boss has just received his new iPhone 4. He is quite proud of it - and maybe a little bit scared due to his age - and he starts playing around with it. Since you are the ITC manager, it is quite clear that this means troubles. Yes, the damn phone is great - you have one yourself - however you perfectly know that such a piece of technology in the hands of a person who barely uses the basic functions of a pc (and that's troubles, you already know) is a problem. So, you slowly walk towards your miserable fate.
Now, after playing with his new toy a while, your boss asks for emails on the iPhone. No problem. You set up the Exchange account on the shiny new piece of technology easily and professionally in just a few clicks.
Happy and satisfied, you return to your beloved world - a.k.a. your desk with your stuff!
Just a few moments later, your boss comes back saying that the iPhone is not working. That is the usual problem: whenever something is not doing whatever a user expects, the technology behind it (either software or hardware) is inevitably broken. That is what I personally hear every day.
"Marco, my computer is not working."
"Why? What's wrong?"
"Can't send an email..."
"Please, explain what is happening..."
"I send it, and I receive a message back"
"Ok, what's the message?"
"I don't know. I haven't got the time to read it..."
"... but it says something about wrong mailbox ... I don't know ... Would you come over and see?"

Monday, 11 April 2011

JavaScript: catch the error!


Who knows about try... catch statement? Who use it?
I know that code have to be clean, working and thoroughly tested, however everybody should know about the possibility of managing syntax errors in JavaScript.
How terrible is when the JavaScript alert box popups with a runtime error (a nightmare for every programmer!) in front of our web visitor asking for "Do you wish to debug?"? Debug what?! Have I got a virus? Run, run, run away! And the visitor actually runs away (often scared) from your wonderful web site to never return, in fear of misterious threats.
So, why not use the try... catch statement?

Friday, 8 April 2011

CSS: create shapes in pure css


It's been a long time ago that I first heard about creating shapes with pure CSS. Now things are evolving - as I've already explained in quite a few posts lately. Again, compatibility is like a proverbial sword, hanging on our heads, however, if we feel like experimenting, this article can actually be a good place.
I am going to show you how to create shapes in CSS. As said, nothing really new.

Simple shapes
Let's start with very simple shapes.

.square {
width: 100px;
height: 100px;
background: blue; }

Wednesday, 6 April 2011

HTML5 and Internet Explorer 8: not good friends


With the gradual introduction of HTML5 new tags, web developers have questioned its use because of compatibility issues. I've already explained that with new elements you might always have troubles. Personally, what makes me really mad is not knowing exactly what will happen when I use HTML5. Will the web site look as I thought? Will it always look and behave as I see it in my testing browsers?

There's another thing to be considered: the future of internet will be "mobile". We've already noticed that the most used word when talking about the future internet is "mobile". Everything's going mobile. New technologies and new devices are capable of surfing the internet with mobile applications. I'm thinking about smartphones or tablets (prominent market analists think that 2011 and 2012 will be tablet years).

Said that, it is quite clear that web developers will have to (or should have already) start to develop sites and applications in a different way and use HTML5 new features. We should consider the way an iPhone user will see a web site. Possibly we will have to create a standard version and a mobile version of the sites - if we don't want to let mobile users go away or maybe even never reach our homepage.

To get to the point, it's been quite a while since I've started to look around to gather information regarding HTML5. It is quite known that Internet Explorer and HTML5 are not very good friends. Actually, IE doesn't even consider HTML5 new elements. That could be a big problem. But there's a workaround!

Monday, 4 April 2011

JavaScript: popup boxes


Today we are going to play with popup boxes and JavaScript!
What we are going to do is very simple. First of all we will create the code for a button that will trigger a simple alert box. Then we are going to create a confirm box and a prompt box.

The alert box
The JavaScript syntax used to make an alert box is:
The code itself is very simple and will pop up an alert box with an "ok" button. In order to close the box, the user needs to click the "ok" button.
The following is a good example:

Friday, 1 April 2011

What The Font: how to detect font used in an image


Have you ever needed to understand what was the font used in a logo, picture, image? Customers some times have no clue and if you need to redisign a company logo, you might end up trying to find out what was the font used. Today there's an efficient way of discovering the font: WhatTheFont.
I discovered the web service some months ago, when I needed to make a logo clearer and all I had was a lousy jpg. Working on the original image was a pain, so I decided to make it from scratch. Problem? Well, I asked what was the font used. The answer was a lapidary "Don't know what a font is!". WhatTheFont provided a fast solution and found the font.

The site is very easy to use. You can upload an image or link directly to the image source. The software will then ask you to confirm the recognition of every single letter found. And after that, it will provide possible solution based on the information gathered. Just try and see the result.