tag:blogger.com,1999:blog-24398861210950173052024-03-13T03:33:55.819-07:00Rachit AgarwalAnonymoushttp://www.blogger.com/profile/09157174425473051583noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-2439886121095017305.post-33499117269804143632015-10-21T06:46:00.000-07:002015-10-21T06:56:56.209-07:00Strict in Java Script<div dir="ltr" style="text-align: left;" trbidi="on">
<b>What is Strict: </b><br />
<b><br /></b>
Strict is not statement it is a literal expression which comes in Java Script 1.8.5 library. If we are using strict in java script file than it indicate code execute under strict mode.<br />
<br />
<b>Example:</b><br />
<b><br /></b>
"use strict"<br />
i = 10;<br />
<br />
This code will not execute. It will give the error because we have not declare i.<br />
<br />
"use strict"<br />
var i =10;<br />
<br />
It will work because we have declare the i.</div>
Anonymoushttp://www.blogger.com/profile/09157174425473051583noreply@blogger.com0tag:blogger.com,1999:blog-2439886121095017305.post-16278812872401472662013-06-17T07:50:00.002-07:002013-06-17T07:50:38.352-07:00Compare two time in javascript<div dir="ltr" style="text-align: left;" trbidi="on">
Below is the function used to compare the two time using java scipt. <br />
<br />
<br />
function checkTime(startTime, endTime) {<br />
//compare two times are same or not.... <br />
if (Date.parse('17/06/2013 ' + endTime) - Date.parse('17/06/2013 ' + startTime) == 0) {<br /> alert('Both time cannot be same');<br /> return false;<br /> }<br /> else if (Date.parse('17/06/2013 ' + endTime) < Date.parse('17/06/2013 ' + startTime)) {<br /> alert('End time should be greater then Start time');<br /> return false;<br />
}<br /> return true;<br />
} <br />
<br clear="all" />
This function returns true if end time is greater than the start time. Otherwise it return false.<br />
Instead of '17/06/201' you can use any date. <br />
<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/09157174425473051583noreply@blogger.com0tag:blogger.com,1999:blog-2439886121095017305.post-16290359385430071042013-06-12T07:49:00.001-07:002013-08-12T07:56:29.720-07:00Time Validation in Java Script<div dir="ltr" style="text-align: left;" trbidi="on">
<div>
This function validate the time format in 24 hours. </div>
<div>
</div>
<div>
function timeValidation(strTime) {</div>
<div>
if (strTime.indexOf(':') == -1 || strTime.length < 4 || strTime.length > 5) {</div>
<div>
return false;</div>
<div>
}</div>
<div>
var n = strTime.split(":");</div>
<div>
if (n.length > 2) {</div>
<div>
return false;</div>
<div>
}</div>
<div>
<br /></div>
<div>
if (isNaN(n[0]) || n[0] > 23) {</div>
<div>
return false;</div>
<div>
}</div>
<div>
var minutePart = n[1].substring(0, 2);</div>
<div>
<br /></div>
<div>
if (minutePart.length!=2 || isNaN(minutePart) || minutePart > 59) {</div>
<div>
return false;</div>
<div>
} </div>
<div>
return true;</div>
<div>
<br /></div>
<div>
}</div>
</div>
Anonymoushttp://www.blogger.com/profile/09157174425473051583noreply@blogger.com0tag:blogger.com,1999:blog-2439886121095017305.post-81665598780316533122013-05-29T20:46:00.000-07:002013-05-30T07:53:30.296-07:00Website URL validation in Java Script<div dir="ltr" style="text-align: left;" trbidi="on">
funtion WebsiteValidation(){<br />
var website = document.getElementById("<%=TxtWeb.ClientID %>").value.toLowerCase();<br />
if (website != "") {<br />
var websitePart = website.split(".");<br />
if (websitePart.length > 2) {<br />
if (websitePart[0] == "www" && websitePart[1].length > 1 && websitePart[websitePart.length - 1].length < 4 && websitePart[websitePart.length - 1].length > 1) {<br />
}<br />
else {<br />
alert('Invalid website');<br />
return false;<br />
}<br />
}<br />
else {<br />
alert('Invalid website');<br />
return false;<br />
}<br />
} <br />
}</div>
Anonymoushttp://www.blogger.com/profile/09157174425473051583noreply@blogger.com0tag:blogger.com,1999:blog-2439886121095017305.post-79144866831794183392013-05-27T23:30:00.002-07:002013-05-29T07:42:18.594-07:00Website URL validation in C#<div dir="ltr" style="text-align: left;" trbidi="on">
public bool UrlValidation(string websiteUrl)<br />
{ var websitePart = websiteUrl.Split('.');<br />
if (websitePart.Length > 2) {<br />
if (websitePart[0] == "www" && websitePart[1].Length > 1 && websitePart[websitePart.Length - 1].Length < 4 && websitePart[websitePart.Length - 1].Length > 1) {<br />
return true;<br />
}<br />
else {<br />
<br />
return false;<br />
}<br />
}<br />
else {<br />
<br />
return false;<br />
}<br />
}</div>
Anonymoushttp://www.blogger.com/profile/09157174425473051583noreply@blogger.com0tag:blogger.com,1999:blog-2439886121095017305.post-12216234714424865712013-05-17T02:17:00.002-07:002013-05-17T07:59:50.674-07:00Remove Special Characters in SQL Server<div dir="ltr" style="text-align: left;" trbidi="on">
Below is code:<br />
<br />
Create Function [dbo].[RemoveNonAlphaCharacters]<br />
(<br />
@Temp VarChar(1000)<br />
) <br />
Returns VarChar(1000) <br />
AS <br />
Begin <br />
<br />
Declare @KeepValues as varchar(50) = '%[^a-z0-9]%' <br />
While PatIndex(@KeepValues, @Temp) > 0 <br />
Set @Temp = Stuff(@Temp, PatIndex(@KeepValues, @Temp), 1, '') <br />
<br />
Return @Temp <br />
End</div>
Anonymoushttp://www.blogger.com/profile/09157174425473051583noreply@blogger.com0tag:blogger.com,1999:blog-2439886121095017305.post-65416197600532776822012-08-11T03:15:00.000-07:002012-08-31T02:03:15.437-07:00Classes Vs Structure<div dir="ltr" style="text-align: left;" trbidi="on">
Below are differences between Class & Structure<br />
1) Class are reference type but struct are vaslue type.<br />
2) Class are comes in inheritance but struct not.<br />
3) A struct can't be abstract but class can.<br />
4) One can't initialized the variable in struct.<br />
5) Fields are automatically initialized with classes.<br />
6) A struct can't be null.<br />
<br /></div>
Anonymoushttp://www.blogger.com/profile/09157174425473051583noreply@blogger.com0tag:blogger.com,1999:blog-2439886121095017305.post-2500727128001146902012-01-04T08:00:00.001-08:002012-08-11T03:01:47.591-07:00WCF<div dir="ltr" style="text-align: left;" trbidi="on">
WCF (Window Communication Foundation) is framework for building SOA based application. WCF is just like Web Service. WCF is provides the communication between client and server. It provides better security as compared to Web Services. <span style="background-color: white; color: #444444; font-family: 'Segoe UI', Arial, sans-serif; font-size: 13px; line-height: 17px; text-align: -webkit-auto;">Interoperability </span> is the main feature of WCF. WCF is the combination of the Web Service, MSMQ, COM+ and Remoting</div>Anonymoushttp://www.blogger.com/profile/09157174425473051583noreply@blogger.com0tag:blogger.com,1999:blog-2439886121095017305.post-90814499807681855362011-11-13T08:51:00.000-08:002012-08-11T03:02:19.259-07:00Indexes in SQL Server<div dir="ltr" style="text-align: left;" trbidi="on">
Hello,<br />
<div>
<br /></div>
<div>
I want to learn indexes in SQL Server. I have googled lot but not find any good article. Can any one please help me<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
</div>Anonymoushttp://www.blogger.com/profile/09157174425473051583noreply@blogger.com0tag:blogger.com,1999:blog-2439886121095017305.post-17224622099173262882011-11-06T08:00:00.000-08:002011-11-13T09:07:59.048-08:00Factory Pattern (Design Pattern)Nice article to learn and understand factory pattern<div><br /></div><div><a href="http://www.codeproject.com/KB/architecture/FactoryPattern.aspx">http://www.codeproject.com/KB/architecture/FactoryPattern.aspx</a></div>Anonymoushttp://www.blogger.com/profile/09157174425473051583noreply@blogger.com0