26 January 2012

How to check your site speed and performance

Hi all,

In this post I will give a short list of sites and tips that will help you to improve your site's speed and performance.

First a list of sites:
1) Google's Page Speed OnlinePage Speed Online analyzes the content of a web page, then generates suggestions to make that page faster. Reducing page load times can reduce bounce rates and increase conversion rates; Note: you can also find a Google Chrome Extension for this tool, here on this page.

23 January 2012

SQL: Concatinate Rows into a string without using variables

Hi All,

Here is a small SQL script which allows you to concatenate the values from all rows into a single row/value.


SELECT T.value + ',' AS [text()]

FROM myTable T
FOR XML PATH ('')

Override jQuery.val() and jQuery.val(value)

Hi all,

Sometimes there are cases when you need to do something when $.val() and $.val(value) from jQuery is called,  but then you still want the default behavior to be kept. Here is an example of how you could do that:

Code:
var originalVal = this.originalVal = $.fn.val;
$.fn.val = function(value) {
    if (typeof value == 'undefined') {
        alert('Getting the value');
        return originalVal.call(this);
    }
    else {
        alert('Setting the value');

        return originalVal.call(this, value);
    }
};


I for example have used it for a jQuery widget, I wanted to override the default behavior of the val()  function when this is performed on the element for which a widget was used. So what I have done is I have added a custom attribute to the element for which I am using the widget and then in the val() I am checking the presence of that attribute - just like below:

11 January 2012

SQL: Rename Column/Table Name

Hi All,

We all sometimes need to rename a column/table from our database, however we do not want to drop all our records from the table where the column is renamed or the name of that table is changed.

For that there is such a nice SPROC in MS SQL: sp_rename.

This SPROC can be used to rename any user-created object in current DB.

However there is also a caution:

10 January 2012

What's New in ASP.NET 4.5 and Visual Web Developer 11 Developer Preview

What's New in ASP.NET 4.5 and Visual Web Developer 11 Developer Preview

This document lists features and enhancements that are being introduced in ASP.NET 4.5. It also lists improvements being made for web development in Visual Studio (Visual Web Developer).

Need more? Leave comments and subscribe to my blog.

.