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
/* | |
* Example usage | |
* EXEC TestRecursion 5 | |
* | |
* Expected Output | |
* -----5 - NESTED LEVEL: 1 | |
* ----4 - NESTED LEVEL: 2 | |
* ---3 - NESTED LEVEL: 3 | |
* --2 - NESTED LEVEL: 4 | |
* -1 - NESTED LEVEL: 5 |
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
class Program | |
{ | |
#region Private variables | |
// the secret password which we will try to find via brute force | |
private static string password = "p123"; | |
private static string result; | |
private static bool isMatched = false; | |
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 @XML XML | |
SET @XML ='<Facility> | |
<Resources> | |
<Resource Type="Printer"> | |
<Item Id="3" Value="Bubbleshots Deskjet Pro" /> | |
<Item Id="253" Value="Topware LaserPrinter 5000" /> | |
<Item Id="7" Value="Jabberbox ClassyImage" /> | |
<Item Id="89" Value="Photoopia Megastar Over9000" /> | |
</Resource> | |
<Resource Type="Phone"> |
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 @XML AS XML | |
SELECT @XML = BulkColumn FROM OPENROWSET(BULK '\\a\file\path\to\your\document.xml', single_blob) AS R |
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
/* | |
Creates multiple batch statements to run a sql statement with a delay in between each batch execution. | |
*/ | |
DECLARE | |
@ReportTimeStamp DATETIME, | |
@ExitConditionTimeStamp DATETIME, | |
@Sql NVARCHAR(MAX), | |
@ParamsDefinition NVARCHAR(MAX), | |
@IntervalInSeconds INT, |
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
SELECT DATE('2011-09-10 11:24:03'); | |
#Prints 2011-09-10 | |
SELECT CURDATE() | |
#Prints the current date, e.g. 2011-09-10 |
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
SELECT DATEADD(DAY, 0, DATEDIFF(DAY, 0, GETDATE())) | |
-- Selects the current date as datetime, e.g. 2011-09-10 00:00:00.000 | |
SELECT CONVERT(VARCHAR(8), GETDATE(), 112) | |
-- Selects the current date as varchar, e.g. 20110910 |
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
/api/stations/status | |
============ | |
stations: [ | |
{ | |
"id": 1, | |
"name": "U Friedrichstr.", | |
"lifts_total": 4, | |
"lifts_working": 3 | |
}, | |
{ |
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
<html> | |
<body> | |
html5 audio test | |
</body> | |
<script> | |
/* | |
tried to use the HTML5 audio without <audio /> tags, just JavaScript | |
works in Chrome, also in FF if you replace .mp3 with .ogg - does not work in Safari | |
*/ | |
window.onload = function(){ |
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
import httplib | |
import time | |
def get_current_time(): | |
return time.strftime("%Y/%m/%d %H:%M:%S", time.localtime()) | |
def get_connection(domain, port): | |
if port == httplib.HTTPS_PORT: | |
return httplib.HTTPSConnection(domain) | |
return httplib.HTTPConnection(domain) |
OlderNewer