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
#include <stdlib.h> | |
#include <stdint.h> | |
#include "rng.h" | |
static uint32_t rng_current_seed = 0; | |
rng * | |
rng_create(uint32_t seed) { | |
rng *r = malloc(sizeof(r)); | |
r->seed = seed; |
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
// | |
// Finds and displays the filenames of all UTF8 files that contain a byte order mark | |
// in a specified directory tree. | |
// | |
// based on information from the following URL | |
// | |
// http://stackoverflow.com/questions/4520184/how-to-detect-the-character-encoding-of-a-text-file | |
// | |
using System; |
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
''' <summary> | |
''' Simple parser for time periods from a string. | |
''' e.g. | |
''' 1d | |
''' 1m | |
''' 2days | |
''' </summary> | |
''' <param name="str"></param> | |
''' <returns></returns> | |
''' <remarks></remarks> |
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
-- http://stackoverflow.com/questions/7892334/get-size-of-all-tables-in-database | |
SELECT | |
t.NAME AS TableName, | |
p.rows AS RowCounts, | |
SUM(a.total_pages) * 8 AS TotalSpaceKB, | |
SUM(a.used_pages) * 8 AS UsedSpaceKB, | |
(SUM(a.total_pages) - SUM(a.used_pages)) * 8 AS UnusedSpaceKB | |
FROM | |
sys.tables t |
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
#include <fcntl.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <io.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <conio.h> | |
int albion_boost_gold(const char *filename, uint16_t gold_to_give) { | |
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
/* Albion Gold Boost for DOS */ | |
#include <stdio.h> | |
#include <fcntl.h> | |
#include <io.h> | |
#include <sys/types.h> | |
int main(int argc, char *argv[]) { | |
int fd; |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace dttm | |
{ | |
class Program | |
{ | |
static int Main(string[] args) |
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
@REM Requires the following tools | |
@REM Blat <http://sourceforge.net/projects/blat> | |
@REM Dttm <https://gist.github.com/nramsbottom/2296fffdf49fcb824fe4> | |
@REM Curl <http://curl.haxx.se/> | |
@SETLOCAL | |
@REM Set this to 1 to show all script output on the console | |
@REM which will help when debugging. |
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
long targetFileSize = UUInt32.MaxValue + (long)(UInt32.MaxValue / 2); | |
long bytesWritten = 0; | |
byte[] buf = new byte[8192]; | |
var rng = new System.Security.Cryptography.RNGCryptoServiceProvider(); | |
using (var output = File.Open(@"C:\tmp\garbage.dat", FileMode.CreateNew, FileAccess.Write, FileShare.None)) | |
{ | |
while (bytesWritten < targetFileSize) | |
{ | |
rng.GetBytes(buf); | |
output.Write(buf, 0, buf.Length); |
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 string ReadToEnd(this StreamReader reader, int maximumCharacters) | |
{ | |
var builder = new System.Text.StringBuilder(); | |
while (true) | |
{ | |
var line = reader.ReadLine(); | |
if (line == null) | |
break; | |
if (builder.Length + line.Length > maximumCharacters) |
OlderNewer