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 | |
# Crude quarter tiling tool | |
# Installation: | |
# Move file to: /usr/local/bin/third-tiler | |
# Make executable: sudo chmod +x /usr/local/bin/third-tiler | |
# Assign keyboard shortcuts to commands like "third-tiler topleft" | |
APPNAME=$(wmctrl -lx | grep $(xprop -root | grep _NET_ACTIVE_WINDOW | head -1 | \ |
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
(*Probabilistically Calculating pi with OCaml*) | |
let f x = float_of_int x in | |
let hyp a b = sqrt((a *. a ) +. (b *. b)) in | |
let randcheck () = hyp (Random.float 1.0) (Random.float 1.0) < 1.0 in | |
let total_iterations = 1000000 in | |
let count_inside_quarter_circle = ref 0 in | |
for i = 1 to total_iterations do |
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
//Probabilistically Calculating pi with C# | |
using System; | |
using System.Math; | |
class MainClass { | |
public static void Main (string[] args) { | |
int total_iterations = 100000000; | |
int count_inside_quarter_circle = 0; | |
var r = new Random(); |
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
#ifndef CBUFFER_H | |
#define CBUFFER_H | |
#include <iostream> | |
#include <vector> | |
#include <cstdlib> | |
#include <string> | |
#include <stdexcept> | |
#include <cmath> |
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 <stdlib.h> | |
#include <stdio.h> | |
int solve(int i, int j); | |
int recursiverowcheck(int i, int j, int n); | |
int recursivecollumncheck(int i, int j, int n); | |
int recursiveboxcheck(int i, int j, int n); | |
void printpuzzle(void); | |
/* |