This file contains 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 static class CsvExtensions | |
{ | |
// | |
// sample usage: | |
// | |
// var list = new object[] { | |
// new { Email = "svetlahristova0@gmail.bg", Name = "Свет.а Х,истова", UnsubscribeToken = "12\r34" }, | |
// new { Email = "test", Name = "11\"22", UnsubscribeToken = "5\n67" }, | |
// }; | |
// var csv = string.Join(Environment.NewLine, list.ToCsvTable()); |
This file contains 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
/* | |
Sample DBCC DBInfo() With TableResults output. Notice double dbi_dbccLastKnownGood field. Fix at the bottom. | |
ParentObject Object Field VALUE | |
------------------------------- --------------------------------- ------------------------------------ --------------------------------------------------------- | |
DBINFO STRUCTURE: DBINFO @0x00000000420BD670 dbi_dbid 5 | |
DBINFO STRUCTURE: DBINFO @0x00000000420BD670 dbi_status 9502720 | |
DBINFO STRUCTURE: DBINFO @0x00000000420BD670 dbi_nextid 348222265 | |
DBINFO STRUCTURE: DBINFO @0x00000000420BD670 dbi_dbname Dreem15_IVB |
This file contains 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 @TmpColumns TABLE ( | |
TableName SYSNAME | |
, ColumnName SYSNAME | |
, object_id INT | |
, column_id INT | |
) | |
INSERT @TmpColumns | |
SELECT s.TableName, s.ColumnName, c.object_id, c.column_id | |
--FROM ( |
This file contains 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
/* | |
Based on http://www.sqlskills.com/blogs/jonathan/finding-implicit-column-conversions-in-the-plan-cache/ | |
Results made (mostly) usable by deduping on statements and ordering output by tables and columns | |
Uses sys.columns instead of INFORMATION_SCHEMA.COLUMNS for performance (nothing gained here) | |
*/ |
This file contains 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
sqlio v1.5.SG | |
using system counter for latency timings, 2343896 counts per second | |
8 threads writing for 360 secs to file D:\testfile.dat | |
using 8KB random IOs | |
enabling multiple I/Os per thread with 8 outstanding | |
buffering set to use hardware disk cache (but not file cache) | |
using current size: 36864 MB for file: D:\testfile.dat | |
initialization done | |
CUMULATIVE DATA: | |
throughput metrics: |
This file contains 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
//Convert all unsafe characters in szStringIn to escape sequences | |
//lpszStringIn and lpszStringOut should be different strings | |
inline _Success_(return != FALSE) BOOL AtlEscapeUrl( | |
_In_z_ LPCSTR szStringIn, | |
_Out_writes_to_(dwMaxLength, *pdwStrLen) LPSTR szStringOut, | |
_Out_opt_ DWORD* pdwStrLen, | |
_In_ DWORD dwMaxLength, | |
_In_ DWORD dwFlags = 0) | |
{ | |
ATLENSURE( szStringIn != NULL ); |
This file contains 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
@echo off | |
for /f "tokens=1-2 delims=|" %%i in ('cscript //nologo bitrate.vbs /f:"%~1" /m:"%~2"') do ( | |
if %%j LSS 320 echo %%i has bitrate %%j and will be deleted | |
) |
This file contains 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
-- $Id: re.lua,v 1.44 2013/03/26 20:11:40 roberto Exp $ | |
-- imported functions and modules | |
local tonumber, type, print, error = tonumber, type, print, error | |
local setmetatable = setmetatable | |
local m = require"lpeg" | |
-- 'm' will be used to parse expressions, and 'mm' will be used to | |
-- create expressions; that is, 're' runs on 'm', creating patterns | |
-- on 'mm' |
This file contains 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
-- This transpiler generates Lua source code from input brainf**k program, then compiles and | |
-- executes this Lua source code. Can be used with LuaJIT for jitted brainf**k experience. | |
-- | |
-- Based on https://github.com/prapin/LuaBrainFuck/blob/master/brainfuck.lua | |
-- Inspired by https://github.com/luapower/bf and its dynasm implementation (~5-10x faster) | |
-- Optimizations from https://www.nayuki.io/page/optimizing-brainfuck-compiler | |
-- | |
-- Optimizations due to lpeg grammar: | |
-- instead of generating repeating `i = i + 1` just output `i = i + N` | |
-- instead of generating repeating `t[i] = t[i] + 1` just output `t[i] = t[i] + N` |
This file contains 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
--local strict = require"strict" | |
local function permutations(t) | |
local fn = coroutine.yield | |
local function permgen(t, n) | |
for i = 1, n do | |
t[n], t[i] = t[i], t[n] | |
if n == 1 then | |
fn(t) | |
else |
OlderNewer