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
// .NET 8.0, uses LLamaSharp and LLamaSharp's CUDA backend NuGet packages. | |
using LLama.Common; | |
using LLama; | |
using System.Text; | |
using Laureate; | |
using LLama.Native; | |
using LLama.Batched; | |
string modelPath = @"C:/Users/Cae/Downloads/noromaid-v0.4-mixtral-instruct-8x7b-zloss.Q3_K_M.gguf"; |
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
import os | |
import sage.all as sage | |
from itertools import combinations | |
from PIL import Image, ImageDraw | |
from typing import cast, Dict | |
from enum import Enum | |
os.system("clear") | |
class SimCircle: |
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
from numpy import prod | |
# Can we reorder the positive integers based on a logical ordering of their prime factorizations? | |
# If we could iterate through all finite-sized tuples of nonnegative integers, we could increment | |
# the first element of each to uniquely cover all possible prime factorizations. | |
# We can extend and invert the Cantor pairing function to generate all k-tuples for any positive k, | |
# but now we're only iterating through the integers with highest prime factor p(k). |
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; | |
// In the limit Hilbert curve, what percentage of order 1 Hilbert curves that appear in it are "right side up"? | |
namespace HilbertCalc { | |
class Program { | |
static void Main(string[] args) { | |
ulong[] curves = new ulong[] { 1, 0, 0, 0 }; // index 0 is "right side up," each subsequent index is 90 degrees counterclockwise | |
for (int i = 1; i <= 20; i++) { | |
Console.WriteLine($"Order {i} Hilbert curve:"); | |
ulong sum = curves[0] + curves[1] + curves[2] + curves[3]; |
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
# An implementation of Dr. Carla Savage's algorithm described in her | |
# 1989 paper "Gray code sequences of partitions" | |
# https://www.sciencedirect.com/science/article/abs/pii/0196677489900072 | |
# Referred to corrections made in a lecture by Dr. Sriram Pemmaraju | |
# https://homepage.cs.uiowa.edu/~sriram/196/fall01/lecture7.pdf | |
# Implemented by Tom Quinn (https://thquinn.github.io/) | |
# I've made my own corrections, see the comments. |
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.Runtime.InteropServices; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using ManagedWinapi; // this can be found here: http://mwinapi.sourceforge.net/ | |
using System.Windows.Forms; | |
using System.Drawing; | |
using Octokit; // this is from NuGet |
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.IO; | |
using System.Net; | |
using System.Text; | |
using System.Threading; | |
using System.Xml; | |
namespace Santaman | |
{ |
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
// Runs simplified goldfish games of Penny Dreadful Near-Death Experience Combo. Simplifications include: | |
// - no interaction from the opponent, obviously | |
// - doesn't simulate cards besides combo pieces and lands | |
// - no maximum hand size | |
// - Lost Auramancers doesn't actually remove NDE from the deck | |
// - generally poor decision making | |
// - lots of other stuff (see inline comments) | |
using System; | |
using System.Collections.Generic; |
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
import numpy as np, PIL | |
from PIL import Image | |
from queue import Queue | |
def within(board, coor): | |
return coor[0] >= 0 and coor[1] >= 0 and coor[0] < board.shape[0] and coor[1] < board.shape[1] | |
def get_neighbors(coor): | |
return [(coor[0] - 1, coor[1]), (coor[0] + 1, coor[1]), (coor[0], coor[1] - 1), (coor[0], coor[1] + 1)] | |
def next_diamond_coor(coor): | |
# Center |
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; | |
using System.Threading.Tasks; | |
namespace KabufudaSolver { | |
class Program { | |
static void Main(string[] args) { | |
Board board = new Board(Console.ReadLine(), int.Parse(Console.ReadLine())); |
NewerOlder