05 July 2009

Have some fun, Whether you wear Specs or not, Its Mandatory U Complete each Test in 4-5 Seconds,

This is a simple neurological test.
Sit comfortably and be calm !


1- Find the C below. Do not use any cursor help.

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO COOOOOOOOOOOOOOO

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO

OOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOO





2- If you already found the C, now find the 6 below.

9999999999999999999 9999999999999999
9999999999999999 9999999999999

9999999999999999999 9999999999999999
9999999999999999 9999999999999

9999999999999999999 9999999999999999
9999999999999999 9999999999999

9999699999999999999 9999999999999999
9999999999999999 9999999999999

9999999999999999999 9999999999999999
9999999999999999 9999999999999

9999999999999999999 9999999999999999
9999999999999999 9999999999999






3- Now find the N below. It's a little more difficult..

MMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMM MNMMMM
MMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMM MMMMMM
MMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMM MMMMMM
MMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMM MMMMMM
MMMMMMMMMMMMMMMMMMM



This is NOT a joke. If you were able to pass these 3 tests, you can cancel
your annual visit to your neurologist.
Your brain is great and you're far from having Alzheimer Disease.

Congratulations!

03 July 2009

Many time in commercial web sites client want to export data as excel sheet result correct with date time formatting and number decimal point formatting.

here is that kind of example.

string styles = "style> .amount { mso-number-format:0.00; } .exDate { mso-number-format: dd\\/mmm\\/yyyy; } /style> ";
//please write lessthan sign before "style" word


Table xl = new Table();
xl.BorderWidth = 1;
System.Web.UI.HtmlControls.HtmlForm form = new System.Web.UI.HtmlControls.HtmlForm();

string attachment = "attachment; filename=saActionTest.xls";

Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/ms-excel";

System.IO.StringWriter stw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htextw = new System.Web.UI.HtmlTextWriter(stw);

TableRow trTitle = new TableRow();
TableCell tcTitle = new TableCell();
tcTitle.Text = "saAction Test";
trTitle.Cells.Add(tcTitle);

TableCell tcDate = new TableCell();
tcDate.CssClass = "exDate";
tcDate.Text = DateTime.Now.ToShortDateString();
trTitle.Cells.Add(tcDate);

double m1 = 150.50;
TableRow trTitle2 = new TableRow();
TableCell tcTitle2 = new TableCell();
tcTitle2.CssClass = "amount";
tcTitle2.Text = m1.ToString();
trTitle2.Cells.Add(tcTitle2);

xl.Rows.Add(trTitle);

xl.RenderControl(htextw);
xl.Dispose();

Response.Write(stw.ToString());
Response.End();


And the excel sheet result is :



You can see that there is also date, Now Some time many developer faces date problem MM/dd/yyy or dd/MM/yyyy etc. it depends on system's setting as default though you want to add your own date format you have to apply style "mso-number-format" in your code.

There are many other style you can apply to get correct date and number decimal points amount.

mso-number-format:"0" No Decimals
mso-number-format:"0\.00" 2 Decimals
mso-number-format:"mm\/dd\/yy" Date format
mso-number-format:"m\/d\/yy\ h\:mm\ AM\/PM" D -T AMPM
mso-number-format:"Short Date" 03/07/2009
mso-number-format:"Medium Date" 05-jan-2008
mso-number-format:"Short Time" 8:67
mso-number-format:"Medium Time" 8:67 am
mso-number-format:"Long Time" 8:67:25:00
mso-number-format:"Percent" Percent - two decimals
mso-number-format:"0\.E+00" Scientific Notation
mso-number-format:"\@" Text
mso-number-format:"\#\ ???\/???" Fractions - up to 3 digits (312/943)
mso-number-format:"\0022£\0022\#\,\#\#0\.00" £12.76
mso-number-format:"\#\,\#\#0\.00_ \;\[Red\]\-\#\,\#\#0\.00\ " 2 decimals, negative numbers in red and signed
(1.86 -1.66)
mso-number-format:"\\#\\,\\#\\#0\\.00_\\)\\;\\[Black\\]\\\\(\\#\\,\\#\\#0\\.00\\\\)" Accounting Format –5,(5)

30 June 2009

Web designers have limitation to use font in web site, because fonts are comes form user computer not from web site.

But Adobe Flash have a feature to embed font in flash animation.

sIFR is meant to replace short passages of plain browser text with text rendered in your typeface of choice, regardless of whether or not your users have that font installed on their systems. It accomplishes this by using a combination of javascript,

Read more about sIFR.

See the example.

26 June 2009

Which java script framework you are using? If you are confuse that which framework use in web development jQuery or MootTools; I suggest you to go through this article.

This web site have very useful information about jQuery and MootTools.

Visit http://jqueryvsmootools.com/

Well I like jQuery. ;)
It is very good to compress javascript before you upload it before live site.

here it is a online tool to Compress and obfuscate Javascript code online completely free using this compressor.

Just enter your code and click on "Compress".


make it easy!

25 June 2009

Add cool flash based gadgets in you block.


See here, click any where in flash area fish will come here to eat that food!




Visit http://abowman.com/google-modules/ too see more gadgets.

19 June 2009

Writing inline documentation is very useful but many developers are excusing that its is taking to much time to write down comments, Friends here is a tool for you which will write XML documentation in your C# or VB.net code vary quickly.

This tool is works with Visual Studio 2005, 2008.

GhostDoc is a free Visual Studio extension that automatically generates XML documentation comments.

Its allows us to add quick documentation for :
  • Methods
  • Properties with its data type
  • Parameters Name
  • Variable Name
See the below example :


Just right click on clock on the name of the function, where will be a menu with "Document this".
Click on it and it will write word quickly documentation for you.

See here the result:



So GhostDoc is very useful tool,

happy codding.

17 June 2009

I you are working on live site and you need to make some modifications on live server, during this modification you want to show a user friendly message that "Site is under maintenance" or "Site is under construction." or something like that, without affecting any page or database.

You just need to make a simple HTML page with "app_offline.htm" name and upload it on root directory of the web site. once user try to open this site, IIS will open this page in place of "default.aspx".

and you can write down, user friendly message on this page. after completing your task just delete this file or rename it. and site will start work as it is.


16 June 2009

WMD is a simple, lightweight HTML editor for blog comments, forum posts, and basic content management. You can add WMD to any textarea with one line of code. Add live preview with one line more.

See Demo here.

If any user don't want any advance functionality and just want to provide lightweight HTML editor, WMD is a very useful tool.

Some other popular editor are :

15 June 2009

When user click on "Send", "Submit", "Save" or "OK" button, page starts process for postback and user did net get idea whats going on,

Some time when there is lots of data are transferring; we need to create user friendly web application to get idea to user that still its working please wait for some time.

Using only javascript to so process or fire some function when user click on submit button, after check validations or before checking validation.

A button on page:
asp:button runat="server" id="btnSave" onclick="btnSave_Click">


One hidden div tag with processing image:

div id="divProcess" class="goProcess">
img src="http://www.blogger.com/images/bigrotation2.gif" alt="Image" />
/div>


Now one javascript function:

script language="javascript" type="text/javascript">
function WebForm_OnSubmit() {
if (typeof (ValidatorOnSubmit) == "function" && ValidatorOnSubmit() == false) {
return false;
}
else {
document.getElementById("divProcess").style.display = "block";
return true;
}
}
/script>


that all; now when user click on submit button; it will check validations first; else it will show that image;

the javascript function name is "WebForm_OnSubmit" which fires every time when user clicks on Submit button.