Skip to content

Instantly share code, notes, and snippets.

View rajanand's full-sized avatar
🎯
Focusing

Rajanand Ilangovan rajanand

🎯
Focusing
View GitHub Profile
@rajanand
rajanand / find_week_and_quarter_from_date_sql_server.sql
Last active December 25, 2015 10:09
To find the week and quarter from date column using T-SQL. #SQLserver
--To find the week and quarter from date column using T-SQL.
DECLARE @temp_tb TABLE (CreateDate DATETIME)
INSERT INTO @temp_tb SELECT '2012-08-15 07:22:56.000'
INSERT INTO @temp_tb SELECT '2012-11-16 10:10:00.000'
INSERT INTO @temp_tb SELECT '2013-04-22 08:47:37.000'
INSERT INTO @temp_tb SELECT '2013-12-31 23:59:38.000'
INSERT INTO @temp_tb SELECT '2013-01-29 16:26:25.000'
@rajanand
rajanand / close database connection .sql
Last active December 30, 2015 13:49
To close all the connection of a database in SQL Server.
USE master
GO
ALTER DATABASE DatabaseName
SET OFFLINE WITH ROLLBACK IMMEDIATE
ALTER DATABASE DatabaseName
SET ONLINE
GO
@rajanand
rajanand / css_resources.md
Created December 8, 2013 15:38 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

/*
==============================================
CSS3 ANIMATION CHEAT SHEET
==============================================
Made by Justin Aguilar
www.justinaguilar.com/animations/
Questions, comments, concerns, love letters:
@rajanand
rajanand / datatype_counts.sql
Created February 9, 2014 18:49
To find the total counts of data types of the columns in all the databases. - SQL Server
--------------------------------------------------------------------------------------------
--To find the total counts of data types of the columns in all the databases. - SQL Server 2012.--
--------------------------------------------------------------------------------------------
USE tempdb
-- Result Table
CREATE TABLE DataTypeDetails (
DataBaseName VARCHAR(30)
,IMAGE INT
,XML INT
@rajanand
rajanand / Number of active connections
Created June 9, 2014 17:13
To find the number of active connections for each database in sql server.
--To find the no. of active connections in sql server
SELECT db_name(dbid) as database_name, loginame, count(dbid) as no_of_connections
FROM sys.sysprocesses
WHERE spid > 50
GROUP BY dbid, loginame

Keybase proof

I hereby claim:

  • I am rajanand on github.
  • I am rajanand (https://keybase.io/rajanand) on keybase.
  • I have a public key whose fingerprint is CA06 4C4C 6EC5 654B B19D 6915 D34D E539 6E07 91B6

To claim this, I am signing this object:

@rajanand
rajanand / factorial.py
Last active September 8, 2015 18:45
To find factorial in python using recursive function
#factorial in python using recursion
# visualize: http://go.rajanand.org/python_factorial_function
def fact(n):
if n==1:
return n
return n*fact(n-1)
print fact(5)
@rajanand
rajanand / close_pdw_sessions_to_restore_the_database.sql
Created April 16, 2016 17:13
Parallel Data Warehouse (PDW): To close all the session connected to the database and then drop the database in PDW (Microsoft APS).
-- 1. Get all the session id for the database.
-- 2. Kill all the session id.
-- 3. Drop database
--================================================
DECLARE @TOTAL_CONNECTIONS INT;
DECLARE @INDEX INT;
DECLARE @RESTORE_DB_NAME VARCHAR(100);
DECLARE @SQL_KILL_SESSION NVARCHAR(1000);
DECLARE @SQL_DROP_DB NVARCHAR(1000);
@rajanand
rajanand / Introduction to R.md
Last active December 8, 2017 04:12
Introduction to R

Introduction to R

Basics

Comments

In R programming # is used to comment a code. If a particular line is commented in a script, when the script is executed, anything after a # will be ignored. There is no separate multi-line (a block comment) comments unlike other languages like HTML, SQL, JavaScript, Java etc.

#Calculate 5 + 7

Arithmetic

R can be used as a simple calculator. Consider the following arithmetic operators.