Tuesday, December 22, 2009

ways to Speed Up your Page Response Times.

Its ok with if we develop any web application, but it you speed up your application in right manner then you will be a charm of web. users requirement is they want to see your application page as quickly as , but if your application is time consuming from all the aspect then surely no one will stay on with your site. here i got some nice and simple techniques which will improve your page speed from all the aspect. now google also setting this as a basic criteria.

Now you all knows mozilla has some good addon call "Firebug" you can install that plus you can also install ""Google page Speed " which will tell hows your application is behave . there is one more useful addon by yahoo is "YSlow" .



from this addons you will get lot of information , also try this
1. Load your CSS first and your JavaScript last
Load your css in <head > tag above your body . and try to load your javascript above the closing the body tag.

2. Using Sub domains for parallel downloads
This is like cool one , on your site that are lot many static and dynamic images , you can identify that what are the static and what are the dynamic and according to that you can set your sub domain which will useful for parallel download ,so the time requires to download a single image will be get converted into parallel server and parallel image get download from your one of the server .The ideal case is you can set max of 3 server for same,

3. Minify JS and CSS:
Again size get matter , means one your page if you keep unwanted space on js & css surly size get increase, in this case you can reduce that and make them as lighter as possible, if you use above tools they will give you option how to inimize this or minimize version of same.

4. Avoid redirects:
No matter if you do a server-side header redirect, JS,HTML redirect, your site is going to load a header with a blank page, then load your new page, increasing the time it takes for a user to get to the actual page they want to go to

5. Using CSS Sprites to reduce HTTP Requests
CSS Sprites may be the coolest thing, it get reduce your page loads and also reduce the amount of request for each particular images. now look at below you can see one image (static one) contain 15 + images now using CSS you can cut that according to your requirement (using Padding and all )
and use that as you want.
Best example you can see is " YouTube CSS Sprite ".



define that like this way:


< style >
.sprite {
background:url(http://s.ytimg.com/yt/img/master-vfl87445.png);
}

#logo {
width:100px;
height:45px;
background-position:0 0;
}
</style >

<div id="logo" class="sprite"> </div>



That was a lot of stuff, but hopefully you picked up a few tips on how to make your web pages load faster. if you know more on this
add it on comments .

Thursday, December 17, 2009

Traversing an Html table with Javascript

This article will introduce you on how to get html table content using DOM Inteface, ones we create an Table on html and suppose we need to retive that table content on server side, on any purpose then this will helps you.you can refer this its really nice way to parse the html table and get the content on same .

mozilla developer has given a good link on ,how to create a DOm interface for table structure

sample example:
1. lets create a Table

<table>
<tbody>
<tr> <td> This is first td </td></tr>
<tr> <td> This is second td </td></tr>
<tr> <td> This is third td </td></tr>
</tbody>
</table>


2. now create a Dom inteface to read this table content , for that you can use Javascript to read this

<script >
function start() {
// get the reference for the body
var body = document.getElementsByTagName("body")[0];

// creates a <table> element and a <tbody> element
var tbl = document.createElement("table");
var tblBody = document.createElement("tbody");

// creating all cells
for (var j = 0; j < 2; j++) {
// creates a table row
var row = document.createElement("tr");

for (var i = 0; i < 2; i++) {
// Create a <td> element and a text node, make the text
// node the contents of the <td>, and put the <td> at
// the end of the table row
var cell = document.createElement("td");
var cellText = document.createTextNode("cell is row "+j+", column "+i);
cell.appendChild(cellText);
row.appendChild(cell);
}

// add the row to the end of the table body
tblBody.appendChild(row);
}

// put the <tbody> in the <table>
tbl.appendChild(tblBody);
// appends <table> into <body>
body.appendChild(tbl);
// sets the border attribute of tbl to 2;
tbl.setAttribute("border", "2");
}
</script >


3. This javascript will first read the table tag element and search with tbody and tr then next td and retrive the content on same .

4. Remember this technique. You will use it frequently in programming for the W3C DOM. First, you create elements from the top down; then you attach the children to the parents from the bottom up.

5. Its create just like this way .

Thursday, December 10, 2009

Facebook and MySpace deals with Google for real-time search



Yes, Myspace and FaceBook have signed with Google for the Real-Time search giant.
Facebook and MySpace both are very popular Networking as well as Social bookmarking site, with contain huge amount of Data as well as Traffic too.

so with the Help of that data Google may give you better result and better Search , Till now we know google deal with Twitter but now they also deal with FaceBook and MySpace . Which means if someone get Search on any Topics then they also get the Real - Time Updates for this social media sites ,

This has led to Both Google as well as Bings .in Order to make there search result very faster adn exact. On recent interview with Tom Stocky Google Director of Product Management. he is saying "People are crazy about the Search and they want up-to-date search result what they looking for " they also said people are also looking for Search result as well as the result come is must be fresh , so surely this Process will help to make google better.

Google would not reveal the financial terms of its agreements – however Facebook’s chief operating officer, Sheryl Sandberg publicly stated at Web 2.0 in San Francisco, that it would be making no money from making public status updates available to search engines. However, MySpace and Facebook have not revealed similar details.

But In Order with Bings they still has to Integrate the search with Twitter into search Process, they also come up with new separate site with "tweets". lets hope it will come soon.

Thursday, December 3, 2009

Google Audio indexing

Google get introduce new technology call Google Audio Indexing (Gaudi) . which allow the user to better search from video point of view. It basically using Speech technology to find out the Exact word inside that video and jump the user according to that world where these words get spoken.

Basically you all know words,sentence, text can get search easily, but this is really nice way to search the text from video itself. which will give your result more additionally.

How you can use this :
Look at the below pics you can get ,



if i want to search related with gas prices it will show you result on where exactly this word get spoken on various videos. on left hand side you can see there are Channel filters you can even though filter your search by clicking on that tab . and right hand side you can see there is one video call Gang of 10 and on that video , after particular period some yellow dots are there they are mentioning where exactly that word get spoken, you can directly move your cursor at that position and listen that word. and at bottom its shows various pages result.

You can also Share this videos with your friends just clicking share button on that video . or simply copy-paste that URL also.

one more thing you can only search the videos from Youtube source only.
if you want to know how its works look at this : http://labs.google.com/gaudi
Currently this technology its in Google Lab , it will publish soon.

Saturday, November 28, 2009

MozillaLabs Launches new projects on MozillaLab

mozilla now launches new terms just like "Googlelabs" its a "mozillalabs". its a just like a virtual lab where people can come on this share there ideas , there feedback and all to make mozilla very string form all the aspects. here you can make new Experiments and also play with the new technologies and new concepts.

as you all know mozilla allready have thousands of addons and so many sub products to make web browser better . and also make web better from end of user also. if you want to check all the such cool addon ans all refer this .
it also have lots of thems , plugins, tabs , web application & developments tools, language supporter terms , videos and many more.

now we come back to the actual point mozillalabs. now in mozilla labs there are some nice projects are there

1.TestSwarm: - its a new mozilla lab project that gives the developer an easy and quick test to there javascript code , firebug addon is also there but we need to add that manually , mozilla make browser its self javascript compatible , if you want to contribute with the project as a tester simple check the TestSwarm.com. currentl the site is in alpha mode and addon on mozilla labs , This Project now support 7 operating system , window 2000 to OS x 10.5



if you want to use TestSwarm on your server download this from here

2. Mozilla weave : it get explore the blending of the desktop and the Web through deeper integration of the browser with online services.
it has some nice features just like
- AES Encryption , used to encrypt the date.
- PKI - public key infrastructure.
- JSON
- Debugging tools

if you want to use this you can get it from here : Install Weave v0.1.28
- https://labs.mozilla.com/forum/index.php/topic,657.0.html
but as i said its all are in labs so try it on your risk.

3. Test Pilot :
Test Pilot platform is opening with first Test Pilot add-on for Firefox 3.5. They are looking for Firefox users of all levels of skill and technical knowledge to help improve Firefox and Labs experiments.

4. Bespine
it Embedded on 0.5 in first release to come from Reboted codebase,why its better coz ones you are using this then there is no longer need or required o add any javascript to your page
except the Bespine itself. look at the below

<!DOCTYPE html>
<html><head>
<link href="BespinEmbedded.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="BespinEmbedded.js"></script>
<style>
.bespin { margin: 0; padding: 0; border: 0;
height: 300px; border: 10px solid #ddd;
-moz-border-radius: 10px;
-webkit-border-radius: 10px; }
</style>
</head>
<body>
<h1>Sample Editor as a Component</h1>
<div id="editor" class="bespin"
data-bespin-options='{ "stealFocus": true }'>
// The text of this div shows up in the editor.
var thisCode = "what shows up in the editor";
function editMe() {
alert("and have fun!");
}
</div>
<script>
window.onBespinLoad = function() {
console.log("this is called when Bespin is loaded");
};
</script>
</body>
</html>

with this you can go secure your application.
the page will give you the View something like this :



if you like this article please add some comments ,

Thursday, November 26, 2009

Single Sign-On for everyone SSO

Single Sign-On (SSO) is a very brand topic now a days. most of the application are running under different subdomain as well as different .net framworks also.in which ones the user logs in it will stay logged still user switch to various web site or different domain. SSO will help you in this
case now lets see how how to build it.

- SSO for different domain.
suppose we have two different application - http://Foo.com and http://Bar.com. now ones the user get login successfully we need to redirect that user to bar.com site for next process . in this case they cant share cookies and session . so for this case we need to create its own cookies and call it on other side to veridy its a right user.to achieve this we need to create a special page (sso.aspx) on both the site m and check the cookies exits or not and flow the process.on sso.aspx page you need to do some code like this


void Page_Load()
{
UriBuilder uri = new UriBuilder(Request.UrlReferrer);
HttpCookie hcok = HttpContext.Current.Request.Cookies[".BarAuth"];
if (hcok != null && hcok.HasKeys) //chk cookies exits
{
string cookie = HttpContext.Current.Server.UrlDecode(hcok.Value);

FormsAuthenticationTicket fatick = FormsAuthentication.Decrypt(cookie);

uri.Query = uri.Query + "&ssoauth=" + fatick.Name; //add login name in query.

}
Response.Redirect(uri.ToString());
}


now if authentication cookies are exits on bar.com, it will decrypt user name and pass name back to the ssoauth. on http://foo.com site we need to add some code on http request for processing pipeline, it will be Application_BeginRequest event or HttpHandler event.

if - authentication cookie exists on Foo.com, continue processing the request
- uthentication cookie doesn’t exist, redirect to Bar.com/sso.aspx.


- if applications run under different versions of .NET
its possible that foo and bar application are running on different version of .net .in such case above application will not work beacuase .net 2.0 encryption is different its AES. or in .net1.1 it was 3DES.on .net 2.0 new attribute get added for backwords application


< machineKey validationKey="F789KJSER82ERKJ4KJ23KH42KJH444JHG234K4KJB23"
decryptionKey="j234GF23HG2432347ASD7ASDHJA6ASD6HH27374743432" validation="SHA1" decryption="3DES" / >


you need to just set decryption="3DES" .to run old application.dont add this on web.config of .net 1.1 it will gives Error.

- mixed-mode authentication (Forms and windows)
long time back we dealt with only form authentication, but now we can user window authentication also. basically we use form auth for check the user form auth . if the user is reside in Intranet then we can use window auth on NT doamin,

Requset.ServerVatiables["LOGON_USER"]

in this we can also set Anonymouse access disable from IIS panel . now LOGON_USER contain NT domain name of the logges on Intranet, but all the other user (internet) get ready for window auth then we can check login via Form auth and if it get fail m move them to Window domain, you can also solve this problem by haveing a special entry page for Intranet users that has Integrate Windows Authentication enabled, validates the domain user, creates a Forms cookie and redirects to the main web site.

one more easy way is , if ananymous access is enable for web site, IIS get pass request through asp.net runtime process . if result is Error(404 - page not found) then IIS will attempt other method for that site. you just enable both the access for same look at below code


if(System.Web.HttpContext.Current.Request.ServerVariables["LOGON_USER"] == "")
{
System.Web.HttpContext.Current.Response.StatusCode = 401;
System.Web.HttpContext.Current.Response.End();
}
else
{
// move to valid domain
}


in the above code , it will first check if the domain user get empty string .It will terminate the request and return the 401 IIS error , in this case if your is already logg in domian , the request will repeated .and if not then he will go through the window auth for upto 3 times , and still he can't pass that 3 attempt the he/she will ge the Error as 4.0 (which is Access Denied )

There are few more ways for SSO in .net application . its also possible to implement this process in Different platform aslo , actual idea will become same but may be implementation get change according to platform.

Thank you , if you like this plz add some comments.

Thursday, November 19, 2009

Explore images with Google Image Swirl.

now google launched Image Search call " Google Image Swirl ".if you want to search for car you will get the all the images related with cars in http://images.google.com/ but make your search Perfect with all the aspects google now use image swirl, now this is in Google lab.

when you search car section on image swirl you will get the array of images of various cars with different different models & different different variations. you click any one of that it will open all the cars related with same. now this is done on new computer vision research to cluster all the similar images on to this group to make your search better.

For Example : now you search with cars you will get the set of 12 images thumbnail of cars , like this





now ones you find any perticual car is you'r looking for click on that it will show you all the cluster images of that cars in one single circle. like this you can enhanse your search.


you can also explore your additional sub-groups with any cluster and make search better.now this technology is develop for Picasa and Similar images.

Image Swirl is working for more than 200,000 Queries and now plan to include more in feature.they are using using auto-complete option when you start with search box just like Google Suggest.so lets try with Google Image Swirl today to make your search better,

happy googleing...