C Sharp
C# ADO.NETADO.NET ExamplesC# ASP.NETC# ASP.NET LINQC# ASP.NET MVCC# Collections and GenericsC# Collections ExamplesC# File HandlingC# Flow ControlC# StreamsC# Streams ExamplesC# ThreadingC# XMLLanguage BasicsObject Oriented Concepts C#Csharp OOPS ExamplesCSS
CSS BasicsHTML
HTML BasicsXHTMLJavascript
MYSQL
MYSQL AdministrationMYSQL BasicsPHP
CakePHPCodeigniterLanguage BasicsPhp Basics ExamplesObject Oriented PHPPhp OOPS ExamplesPHP ArraysPhp Arrays ExamplesPHP CookiesPHP Date and TimePHP Date Time ExamplesPHP Design patternsPHP File HandlingPHP Flow ControlPHP FormsPhp Forms ExamplesPHP MailPHP MYSQLPhp Mysql ExamplesPHP Regular ExpressionsPHP sessionsPHP XMLPHP XML ExamplesZend FrameworkPL/SQL
PL/SQL - Language BasicsPLSQL Basics ExamplesPL/SQL - String ManipulationPL/SQL - XMLPL/SQL ConversionPLSQL - Date ManipulationSql Server
MSSQL BasicsTransact-SQLAdvantages of using unit-test frameworks.
Unit-testing frameworks are code libraries and modules that help developers unit-test their code.
The unit testing framework provides a class …
Technique of test-driven development
Test-driven development begins by writing a test that fails; then you move on to creating the production code, seeing …
Generic implementation of simple unit test in csharp
Unit-testing frameworks can help make helper methods more generic like this, so tests are written more easily.
Test implementation:
public class …
Simple unit test in csharp
Class to be tested:
public class SimpleNumber
{
public int ParseAndSum(string numbers)
{
if(numbers.Length==0)
{
return 0;
}
if(!numbers.Contains(","))
{
return int.Parse(numbers);
}
else
{
throw new InvalidOperationException(
"I can only handle 0 or 1 …
Characteristics of a good unit test
A unit test should have the following properties:
The unit test should be automated and repeatable.
The unit test should be …
Read file up to 1024 bytes of data in csharp
Stream stream = File.OpenRead(@"C:\data\file.xml");
int bytesToRead = 1024;
int bytesRead = 0;
byte [ ] buffer = new byte [bytesToRead];
// Fill up …
Array concatenation in Javascript
<HTML>
<HEAD>
<TITLE>Array Concatenation Example</TITLE>
<SCRIPT LANGUAGE=”JavaScript”>
// global variables
var arrayOne, arrayTwo, arrayThree, textObj
// initialize after load to access text object in form
function …
Setting Browser Status Message using Javascript
<HTML>
<HEAD>
<TITLE>window.defaultStatus property</TITLE>
<SCRIPT LANGUAGE=”JavaScript”>
window.defaultStatus = “Welcome to my Web site.”
</SCRIPT>
</HEAD>
<BODY>
<A HREF=”http://www.microsoft.com”
onMouseOver=”window.status = ‘Visit Microsoft\’s Home page.’;return true”
onMouseOut=”window.status = ‘’;return true”>Microsoft</A><P>
<A …
Check Before Closing a Window in Javascript
<HTML>
<HEAD>
<TITLE>window.closed Property</TITLE>
<SCRIPT LANGUAGE=”JavaScript”>
// initialize global var for new window object
// so it can be accessed by all functions on …
Csharp client side private caching
We can enable private caching if we specified a value of ‘Client’ for the Location attribute of an OutputCache …
Csharp Programmatically Setting Page Caching
The example code below shows a page whose expiration is set programmatically and uses the sliding expiration scheme. The …
VaryByParam,VaryByHeader, VaryByControl, VaryByCustom OutputCache Directive Attributes
VaryByCustom
Vary the output cache either by browser name and version or by a custom string, which must be handled …
CSharp OutputCache Directive Example
The OutputCache directive is added to the header of any ASP.NET page. It specifies the duration (in seconds) that …
LINQ to Objects: Query objects in LINQ
Language Integrated Query (LINQ, pronounced “link”) is a Microsoft .NET Framework component that adds native data querying capabilities to …
Popular Tags
xml parsing x 28
arrays x 26
file x 22
object oriented x 15
data types x 14
xml x 13
rpc x 13
simplexml x 11
file handling x 11
string x 11
stylesheet x 11
form post x 10
MVC x 10
filestream x 10
table x 10

