Skip to content

Instantly share code, notes, and snippets.

View ekralc's full-sized avatar
🎓

James ekralc

🎓
View GitHub Profile
@ekralc
ekralc / pyproject.toml
Created September 26, 2022 21:29
Sample pyproject.toml for Poetry bug report
[tool.poetry]
name = "test"
version = "0.1.0"
description = ""
authors = ["Your Name <you@example.com>"]
readme = ["README.md", "LICENSE"]
[tool.poetry.dependencies]
python = "^3.8"
@ekralc
ekralc / latest-fxserver.go
Last active September 9, 2022 15:05
Command line tool to fetch the URL of the latest FXServer artifact.
package main
import (
"fmt"
"log"
"net/http"
"net/url"
"os"
"regexp"
"strings"
@ekralc
ekralc / check_binary_search_sequence.py
Created May 19, 2022 10:47
Algorithm to check if a sequence of examined nodes in a binary-search tree is valid
def checkSeq(lb, ub, lst, k):
l = lb - 1
u = ub + 1
for num in lst:
if num > k:
if num >= u:
print("Exceeded upper bound on: " + str(num))
return False
u = num
@ekralc
ekralc / queue.c
Last active January 25, 2022 20:12
FIFO queue implementation in C using a circular array
#include <stdlib.h>
typedef int datatype;
typedef struct queue {
datatype *arr;
int front;
int rear;
size_t size;
} queue;
@ekralc
ekralc / gaussian_elimination_pivot.py
Last active January 12, 2022 17:27
Python implementation of Gaussian elimination using row pivoting.
import numpy as np
def gaussian_elimination_pivot(A, b):
"""
Converts a normal linear system of equations to upper triangular form
A is a non-singular n x n matrix containing coefficients
b is an n-vector containing the values
"""
@ekralc
ekralc / gaussian_elimination.py
Last active January 12, 2022 16:33
Python implementation of Gaussian elimination for use with NumPy arrays
import numpy as np
def gaussian_elimination(A, b):
"""
Converts a normal linear system of equations to upper triangular form
A is a non-singular n x n matrix containing coefficients
b is an n-vector containing the values
"""
@ekralc
ekralc / quicksort.cpp
Last active January 4, 2022 14:44
Recursive implementation of the quicksort algorithm in C++
#include <vector>
#include <iostream>
template <typename T> std::vector<T> quicksort(const std::vector<T> &A) {
if (A.size() < 2) return A;
std::vector<T> left;
std::vector<T> mid;
std::vector<T> right;
{"obj":{"x":-13.152498245239,"y":-2228.2902832031,"code":"9017"},"left":{"obj":{"x":-934.90258789063,"y":-178.86724853516,"code":"7179"},"left":{"obj":{"x":-885.44458007813,"y":-1302.3771972656,"code":"8234"},"left":{"obj":{"x":-1175.83203125,"y":-916.56103515625,"code":"8092"},"left":{"obj":{"x":-1176.1430664063,"y":-1392.3951416016,"code":"8220"},"left":{"obj":{"x":-1312.3676757813,"y":-1265.9447021484,"code":"8214"},"left":{"obj":{"x":-1289.033203125,"y":-1317.2657470703,"code":"8213"},"left":{"obj":{"x":-1804.8181152344,"y":-2797.4165039063,"code":"10021"},"left":{"obj":{"x":-1471.8472900391,"y":-3266.0051269531,"code":"10017"},"left":{"obj":{"x":-1573.0844726563,"y":-3227.0913085938,"code":"10019"},"left":{"obj":{"x":-1573.0844726563,"y":-3227.0913085938,"code":"10018"},"left":null,"right":null,"parent":null,"dimension":0},"right":{"obj":{"x":-1930.2440185547,"y":-3038.2138671875,"code":"10020"},"left":null,"right":null,"parent":null,"dimension":0},"parent":null,"dimension":1},"right":{"obj":{"x":-1407.7