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 <stdio.h> | |
#include <SDL2\SDL.h> | |
// assumes installed using vcpkg | |
#ifdef _DEBUG | |
#pragma comment(lib, "SDL2d") | |
#pragma comment(lib, "SDL2maind") | |
#else | |
#pragma comment(lib, "SDL2") |
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.Globalization; | |
using System.Text; | |
using CsvHelper; | |
using CsvHelper.Configuration; | |
var sourcePath = @"C:\Users\nramsbottom\Desktop\Food Shopping.csv"; | |
var reader = new StreamReader(sourcePath, Encoding.UTF8); | |
var parser = new CsvReader(reader, new CsvConfiguration(CultureInfo.InvariantCulture) |
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.Text; | |
using System.Text.Json; | |
using System.Threading.Tasks; | |
using Azure.Storage.Queues; // [email protected] | |
namespace GitHub.nramsbottom.Azure.Storage.Queues | |
{ | |
public class AzureQueueWriter<T> where T : class, new() | |
{ |
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
; dd if=/dev/zero of=boot.img count=1440 bs=1k | |
; nasm boot.asm -f bin -o boot.bin | |
; dd if=boot.bin bs=512 of=boot.img conv=notrunc | |
; od -t x1 -A n boot.bin | |
; A simple boot sector that prints a message to the screen using a BIOS routine. | |
; | |
mov ah,0x0e ; int 10/ ah = 0eh -> scrolling teletype BIOS routine | |
mov al,'H' | |
int 0x10 |
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 bool IsFileLocked(string path) | |
{ | |
try | |
{ | |
using var fs = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.None); | |
} | |
catch (IOException ex) | |
{ | |
if (ex.HResult == -2147024864) | |
return true; // file is locked |
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
private string ReadAsciiZeroString(byte[] bytes) | |
{ | |
for (int n = 0; n < bytes.Length; n++) | |
{ | |
if (bytes[n] == '\0') | |
return System.Text.Encoding.ASCII.GetString(bytes, 0, n); | |
} | |
return string.Empty; | |
} |
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
#!/bin/bash | |
# this is a script that was made to extract the video and *second* audio stream | |
# from an all the mp4 files in the current directory and rebuild them to contain | |
# just the video and the second audio stream | |
for filename in *.avi; do | |
ffmpeg -y -i "$filename" -an -vcodec copy video.mp4 | |
ffmpeg -y -i "$filename" -map 0:2 -vn -acodec copy audio.mp3 |
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
void show_bits(unsigned int i) { | |
printf("|32 |24 |16 |8 |\n"); | |
for (int n = 31; n >= 0; n--) { | |
printf("%u", (0x1 << n) & i ? 1 : 0); | |
} | |
printf(" %8X %u", i, i); | |
printf("\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
using System.IO; | |
namespace LogFilter | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
const string InputPath = @"D:\Temp\u_ex191014.log"; | |
const string OutputPath = @"D:\Temp\output.log"; |
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.IO; | |
namespace GenerateTone | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// generate one second of 1khz audio |
NewerOlder