Skip to content

Instantly share code, notes, and snippets.

View kulicuu's full-sized avatar

J Wylie Woodcock kulicuu

View GitHub Profile
use num_complex::Complex64;
use std::f64::consts::*;
pub fn ft_slow (
a: &Vec<Complex64>,
n: usize,
is: i8,
) -> Vec<Complex64>
{
@kulicuu
kulicuu / Instructions.md
Last active November 27, 2021 03:09
Byte parsing in C/C++

You have been given a data file containing a list of known non-local metaparticles.

The format of the data file is an array of interleaved structures representing the following data for each record:

  • a 32-bit unsigned integer (4 bytes)
  • 6 bytes of ASCII string, null-terminated
  • a 64-bit floating point number (8 bytes)
@kulicuu
kulicuu / main.rs
Last active November 17, 2021 21:30
Erupt Vulkan Scratchpad
use memoffset::offset_of;
use simple_logger::SimpleLogger;
use winit::{
event::{
Event, KeyboardInput, WindowEvent,
ElementState, StartCause, VirtualKeyCode,
DeviceEvent,
@kulicuu
kulicuu / gilded_rose_new.js
Created November 8, 2021 23:07
Assessment Kata from GildedRose Refactoring
const itemQualityFunctionIndex = {
"Aged Brie": function(item) {
item.quality++;
return item
},
"Backstage passes": function (item) {
if (item.sellIn <= 10 && item.sellIn > 5) {
item.quality += 2;
@kulicuu
kulicuu / main.rs
Last active November 4, 2021 15:10
map_memory segmentation fault in Vulkan
use memoffset::offset_of;
use simple_logger::SimpleLogger;
use winit::{
event::{
Event, KeyboardInput, WindowEvent,
ElementState, StartCause, VirtualKeyCode
},
@kulicuu
kulicuu / main.rs
Last active October 12, 2021 15:16
ash-window example updated to newest version of winit
use winit::{
event::{Event, KeyboardInput, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::WindowBuilder,
window::Window,
};
use simple_logger::SimpleLogger;
@kulicuu
kulicuu / main.rs
Created September 15, 2021 22:13
Mergesort in Rust translated from a Python implementation
// Mergesort implementation in Rust translated from the Python example at
// https://www.interviewbit.com/tutorial/merge-sort-algorithm/
fn main () {
println!(".......Mergesort");
let unsorted : [i32; 10] = [949, 8232, 158, 369, 1, 43, 949, 381112, 4184, 12];
@kulicuu
kulicuu / grand__unified__theory__of__software.md
Last active October 8, 2020 11:15
Grand Unified Theory of Software

Grand Unified Theory of Software:

(the 'grand unified' part is halfway jesting, but this is a nice generalization of the main requirements of programs.)

Proposition:

A program (software program), has at most two responsibilities: (1) State-management, and (2) Effects-propagation.

Discussion:

@kulicuu
kulicuu / Foundations__of__Discourse.md
Created September 22, 2020 18:26
Some discussion on setting a solid foundation for argumentation/discourse, with a secondary part discussing how to make the soft sciences hard.

Foundations of Discourse:

Every conversation, argument of import, runs into the same confusions of meaning. We all know how the meanings of words can shift with context. We all know how one man's meaning of a given word can differ substantially from another's. I'm not contributing anything new by commenting on this.

I have some elaborations on this idea that I believe can be helpful. These are inspired by, or taken directly from Gilles Deleuze's work in a book called "What is Philosophy."

@kulicuu
kulicuu / skepticism_parable.md
Last active September 22, 2020 18:33
Skepticism, a parable sketch

(A parable, half serious, just a sketch)

Skepticism:

Zara, labeled by reputation "Skeptic", showed up to town one day, took up residence in a travellers' house.

The Inquisitor questioned him over tea one morning:

>Is Zara a believer in the Almighty?