This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Xml.Linq; | |
using System.Xml; | |
namespace linqtoxml | |
{ | |
class Program |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
/* | |
* download NewtonSoft josn library from | |
* http://json.codeplex.com/ | |
* http://www.codeplex.com/json/Release/ProjectReleases.aspx | |
* */ | |
using Newtonsoft.Json; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
/* | |
* download NewtonSoft josn library from | |
* http://json.codeplex.com/ | |
* http://www.codeplex.com/json/Release/ProjectReleases.aspx | |
* */ | |
using Newtonsoft.Json.Linq; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public virtual int[] BucketSorting(int[] integers) | |
{ | |
//Verify input | |
if (integers == null || integers.Length == 0) | |
{ | |
return null; | |
} | |
//Find the maximum and minimum values in the array | |
int maxValue = integers[0]; //start with first element |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//find running processes pid | |
$ ps | |
//kill process [ kill processid] | |
$ kill 2065 | |
//OR | |
$ kill -9 2065 | |
//Where, -9 is special Kill signal, which will kill the process. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM cron job in Windows | |
REM command is schtasks | |
schtasks /create /tn "Drupal Cron Job" /tr "C:\PROGRA~1\MOZILL~1\firefox.exe http://www.example.com/cron.php" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF EXISTS (SELECT 1 | |
FROM INFORMATION_SCHEMA.TABLES | |
WHERE TABLE_TYPE='BASE TABLE' | |
AND TABLE_NAME='tablename') | |
SELECT 'tablename exists.' | |
ELSE | |
SELECT 'tablename does not exist.' | |
--To identify whether a particular table exists in a database, the following query can --be used in the application: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- to use sqlCmd ( command line sql tool) | |
-- open command prompt and execute the "sqlcmd.exe" probably located at | |
-- "C:\Program Files\Microsoft SQL Server\100\Tools\Binn" | |
> sqlcmd.exe -U username -P password -S .\sqlServer | |
This will open sql server in cmd | |
1> select DB_Name() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @name VARCHAR(50) -- database name | |
DECLARE @path VARCHAR(256) -- path for backup files | |
DECLARE @fileName VARCHAR(256) -- filename for backup | |
DECLARE @fileDate VARCHAR(20) -- used for file name | |
SET @path = 'C:\Backup\' | |
SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112) | |
DECLARE db_cursor CURSOR FOR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- /* Count Number Of Tables In A Database */ | |
SELECT COUNT(*) AS TABLE_COUNT FROM INFORMATION_SCHEMA.TABLES | |
WHERE TABLE_TYPE='BASE TABLE' | |
--- /* Count Number Of Views In A Database */ | |
SELECT COUNT(*) AS VIEW_COUNT FROM INFORMATION_SCHEMA.VIEWS | |
--- /* Count Number Of Stored Procedures In A Database */ | |
SELECT COUNT(*) AS PROCEDURE_COUNT FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE = 'PROCEDURE' |