Skip to content

Instantly share code, notes, and snippets.

View Theoistic's full-sized avatar

Theodor Solbjorg Theoistic

View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sailing Schedule</title>
<style>
/* Add some basic styling */
#sailing-schedule-module {
font-family: Arial, sans-serif;
@Theoistic
Theoistic / Optimal.cs
Last active October 14, 2022 18:41
Pass Double Optimal Wunsch Needleman .. aka PDOWN algorithm - optimal string given variations
string[] LP = new string[] {
"DH869*",
"DHB69",
"DH69",
//"DH869",
"H689",
"DH89"
};
// Produces "DH869" - based on the LP data
@Theoistic
Theoistic / Picochain.cs
Last active August 31, 2022 00:56
Over simplified Blockchain
if(System.Environment.GetCommandLineArgs().Length == 0) {
Console.Write("Add something to the blockchain:\n> ");
AddBlock(Console.ReadLine());
} else {
switch (System.Environment.GetCommandLineArgs()[0]) {
case "-v": CheckBlockChain(); break;
default: AddBlock(System.Environment.GetCommandLineArgs()[0]); break;
}
}
@Theoistic
Theoistic / Program.cs
Created June 28, 2022 02:48
Pascal VOC to Yolo txt converter in C#
using System.Globalization;
using System.Text;
using System.Xml.Serialization;
string annotationdir = @"D:\Work\Datasets\AnnotationsXML\001plate";
string imagedir = @"D:\Work\Datasets\Images\001plate";
string[] annotations = Directory.GetFiles(annotationdir);
string[] images = Directory.GetFiles(imagedir);
using SharpNL.DocumentCategorizer;
using SharpNL.Extensions;
using SharpNL.Tokenize;
using SharpNL.Utility;
[Serializable]
public class IntentModel : IObjectStream<DocumentSample>
{
public string Intent { get; set; }
@Theoistic
Theoistic / LogParser.cs
Created February 11, 2022 14:02
SML Log Parser Demo
// Define the Regex fetch from the log
using System.Text.RegularExpressions;
Regex RegexMatch = new("((http)+[a-zA-Z://.]*)\r\n(Status:\\s+[0-9]*)");
// Search all files and log them out to the console
Directory.GetFiles(Environment.CurrentDirectory, "*.log")
.Select(f => File.ReadAllText(f))
.SelectMany(r => RegexMatch.Matches(r)
.Select(m => m.Value))
//.Where(w => !w.Contains("lol")) // filter out things that contain "lol" and discard them
@Theoistic
Theoistic / AfterLife.cs
Created September 14, 2021 04:26
Bring people back from the dead ;)
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.Serialization.Formatters.Binary;
using System.Text.RegularExpressions;
using System.Threading;
@Theoistic
Theoistic / Pandas.asm
Last active February 21, 2021 08:33
Some TikTok Panda Stuff
.intel_syntax noprefix
.global main
pandas:
.string "PANDA"
.zero 4
.string "THUNDER"
.zero 2
.string "TENT"
.zero 5
@Theoistic
Theoistic / QuBit.cs
Created February 6, 2021 19:08
The QuBit interpreter ..
using System;
using System.IO;
using System.Linq;
namespace qubit
{
public class QuBitInterpreter {
public static byte[] stack;
public static int pointer;
@Theoistic
Theoistic / LinqGoneWrong.cs
Created November 30, 2020 19:53
Linq Gone Wrong
var _w = new List<object>();
weeks.ForEach(x =>
{
var locations = new List<object>();
x.GroupBy(c => c.Location.Name).ForEach(l => {
var eh = new
{
Answers = l.GroupBy(n => n.Value)
.Select(n => new