Monday, 30 April 2012

Exchange: delay the startup

   


The last time I had to change the company server hardware, I decided to use a virtual domain controller, while the Exchange Server remained on the physical machine.
Upon boot, Exchange couldn't find the domain controller and that gave me a lot of trouble. I needed to delay the Exchange Server service enough to allow the virtual DC to boot and be ready.
How can we do that?

Follow me and I will explain it to you.

Friday, 27 April 2012

CSS: IE hacks

   


In March last year, I've published a post about CSS conditional statements. The article explains how to create conditional statements and load specific stylesheets for specific Internet Explorer versions.
We all know that, in order to guarantee a cross-browser full compatibility of our web sites, the above solution gives us a possible clean way out of the problem.
With that in mind, there are situations when we don't really want to create different stylesheets for each version of IE, and a simpler solution would be preferable.
Those are the cases where we can use the famous IE CSS hacks.

Wednesday, 25 April 2012

jQuery: how to use it only for mobile

   


Developing responsive web sites is not always easy. We have seen something about it with media queries, but that was aimed to managing CSS stylesheets. Today I'm going to show you how to deal with jQuery.

I've found the following trick somewhere on the web, but I don't remember where, so if you are the author please leave a comment and I will give you credit for it.

Let's try to clear up a bit the situation. We want to trigger some jQuery or, generally speaking, some JavaScript code just when the visit is coming from a smartphone. Because we know that those devices mainly have a screen width of 480px, we are going to use that as condition.

Monday, 23 April 2012

VBScript: how to schedule the opening of an ASP page

   


Following an exchange of ideas with Still_ASP, a loyal reader of the web thought, I thought to write something about scheduling events on a Windows server.
Sometimes we might need to trigger some events independently from the actual opening of a page or a specific action taken by a user. If nobody is browsing your page, how could we trigger an event anyway?

To do so, we need to use a little trick that I will shortly explain.

Friday, 20 April 2012

CSS: backgrounds with CSS3

   


As I can see from the web thought statistics, there's a increasing interest in how to manage backgrounds with CSS and specifically with CSS3. So I decided to write down the following short tutorial. We are going to explore three interesting CSS properties: background-clip, background-origin and background-size.
I know, I've partially covered the subject in another post, however here we are going to see it more in depth.

Are you ready? Ok then, follow me...

Wednesday, 18 April 2012

CSS: how to forget about prefixes

   


Writing CSS stylesheet today can be a nightmare. With the high number of specific browser prefixes, we might end up banging our heads against the wall in the effort of not forgetting how to be sure our code is cross browser compatible.
Just to make things clearer: let's consider the following CSS:
.container {
  -moz-border-radius: 4px 0px 0px 4px;
  -webkit-border-radius: 4px 0px 0px 4px;
  border-radius: 4px 0px 0px 4px;
  -webkit-box-shadow: 0 0 4px #9c9c9c;
  -moz-box-shadow: 0 0 4px #9c9c9c;
  box-shadow: 0 0 4px #9c9c9c;
}

Monday, 16 April 2012

jQuery, JavaScript & ASP: barcodes resources

   


Following a brief exchange of thoughts with Carlo (one of the web thought readers), I have decided to publish a list of resources aimed to the creation of Barcodes. Originally, Carlo wanted to insert a barcode in a PDF document using FPDF, however the subroutine he found generates a HTML table that is almost impossible to embed in a PDF with FPDF.
Other solution are possible. The point is to create a Barcode image, save it on the server, and then insert it into the PDF. I haven't explored the above idea, but I think that the following resources might help some to accomplish the task.
Here's the list:

Barcode Coder (jQuery)

jQuery-Barcode (jQuery)

Pure ASP Barcode Generator (pure ASP)

ASP Barcode Script (pure ASP - Thanks to Carlo)

Barcode Generator (JavaScript)

Creating a Code 39 Barcode using HTML, CSS and Javascript (JavaScript)

Javascript Code128 Barcode (JavaScript)

Friday, 13 April 2012

Web Development: compress your code

   


When developing web documents, we should always take a close look at the size of the resulting code. While it is very important to keep things minimised in terms of file size, sometimes it's not easy just applying the usual rules, tips and tricks.
It is well known that, for example, it is a good habit to compress jpgs, and images and photos in general. At the same time, it is advisable to use minimised JavaScript libraries, such as reduced versions of jQuery or jQuery tools and plugins.

But sometimes, following all those simple rules could be not enough.
In those cases I've found an online tool which might be used to compress and minimise our code: HTML compressor.

Thursday, 12 April 2012

Wednesday, 11 April 2012

ASP & CSS: dynamic style rules for database items

   


If you work a lot with ASP and get data from databases, you might have been in need of creating different CSS rules for each item in a recordset.
We can create dynamic CSS rules with a simple loop, assuming we know the number of items to which we will apply the rule. The point is that we don't know how many recordset items we will get from the database, but we can create rules according to different situation, as I will explain shortly.

Now follow me and see what we can do.

Monday, 9 April 2012

CSS: text to path generator with csswarp

   


Today I would like to share an online tool which some of you might find interesting, at least as an clever example on what we could do with CSS3 and HTML5.
But before showing you this "wonder", I would like to spend a few general words and possibly gather your ideas on the matter.

I've recently read that in 2012 there will be an incredible expansion of HTML5 webapp. The use of the not-so-new HTML version will help developers in building specific applications that will work with recent browsers. For what I have seen lately, the most of those new webapp are basically drawing tools. Canvas, trasformation and animation are wisely used in order to allow free hand drawing using only the browser.
In a perfect future, we might end up without desktop applications, while the web will be the place where everyone can find the right tool, when needed.
It is an old idea that I've partially already encountered in a book by Jeremy Rifkin, in the early 2000. People will eventually use software on-demand and they will just pay for the time they use it. That could be the future... the not so far future, as I can see. Following the reasoning, we might just need a pc with a minimum set of system tools, while when we will need to write a document, prepare a spreadsheet or retouch a photo, we will just open the browser and go to the appropriate web site where the application will be always updated and ready to be used. With that in mind, it won't matter which will be our hardware: it could a smartphone, a tablet or a pc. At the same time, it won't matter where we will be - we will just need a data connection.

Sunday, 8 April 2012

Happy Easter...

   


... to anyone reading the web thought.
Have a splendid day and relax!

Friday, 6 April 2012

ASP: the dictonary object

   


I've recently worked a lot on ASP arrays. One thing that is rarely used in ASP is the dictionary object which is similar to an array but has some useful methods and properties, making it easier to manage.

The dictionary object can store information in pairs: key and item. Every key refers to an item. When we build a dictionary object we create a relation between a key and an item, so we can recall an item by its key.

An example
To create a dictionary object we simply do the following:
<%
Dim dicObj
set dicObj = Server.CreateObject("Scripting.Dictionary")
Now our object is ready to accept keys and items. In order to add them we use the .add method:
dicObj.add "one","firstItem"
dicObj.add "two","secondItem"
and so on.

Wednesday, 4 April 2012

Google+ and Google+ Page

   


As you may have noticed, today I've added the two new Google+ Blogger gadgets.

On the right hand side of the page, you can +1 the whole blog (while before you could only share single posts on Google+, Facebook, Twitter and so on) and contribute to the growth of the web thought.
Just below the Google+ badge, you can join the blog Google+ Page. Please, if you're interested and you want to be updated with the blog activity, either join the Google+ twt page, or follow in a reader (with RSS feed) or by email, subscribing with your preferred method.

Keep on following the web thought and stay updated with new articles!

SQL: wildcards

   


While we all know about the "%" wildcard, we might not know that there are other interesting ways of using special characters when building queries.
I suppose you are aware of what a wildcard is. Anyway, if you're new to SQL, wildcards are special characters used in queries and they can be used to substitute one or more characters while retrieving data from a database.
We must remember that we can use wildcards only with the "LIKE" operator.

Before going into the available wildcards, let me show you a basic example:
SELECT productCode, description, price
FROM prodTable
WHERE description LIKE 'p%'
The above query will retrieve all the products that have a description starting with "p" from the prodTable table.
Now, let's see which are the available wildcards.

Monday, 2 April 2012

JavaScript: 3D rotating images

   


I've recently needed to display products in 3D. It is a quite often requested feature, especially for commercial web sites, where items need to be shown from different perspectives.

Different solutions are available, but they usually contemplate the use of Flash or Java Applets. I must say, I don't like that kind of tools, especially Flash, because they require the installation of specific plugins on the client machine.

I started to search a JavaScript solution as soon as I realised that animated gifs involved a big (BIG!) work and not satisfactory result.
I knew that if the client have JavaScript disabled, it might pose a problem as well. However detecting JavaScript status and creating fallbacks is not a big issue. Thus I decided to follow the JavaScript solution.

What I've found is a remarkable script that I would like to share: 3D rotating images.
The author (Mark "Tarquin" Wilton-Jones) explains the script thoroughly in his page, so I won't get into it too much. It is enough to say that the script:
"[...] allows a normal image of a product to be replaced by images that appear to rotate. The images can be rotated or tilted automatically, or manually by the user. Manually, they can be changed using buttons, links, or simply by dragging the image with a mouse. Basic zooming is also possible. All of these features can be seamlessly combined, so the image could begin rotating automatically, then the user could take over and rotate it manually."

Just follow the above link and enjoy.