Skip to content

Instantly share code, notes, and snippets.

View rijesha's full-sized avatar

Rijesh Augustine rijesha

  • Edmonton, Alberta, Canada
View GitHub Profile
@rijesha
rijesha / third-tiler
Last active November 15, 2019 01:15 — forked from peteruithoven/quarter-tiler
Crude third-tiler tiling tool for elementary OS
#!/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 | \
(*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
@rijesha
rijesha / calculatingpi.cs
Last active January 18, 2018 07:34
Probabilistically Calculating pi
//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();
@rijesha
rijesha / cBuffer.hpp
Created January 15, 2018 23:02
C++ Circular Buffer
#ifndef CBUFFER_H
#define CBUFFER_H
#include <iostream>
#include <vector>
#include <cstdlib>
#include <string>
#include <stdexcept>
#include <cmath>
@rijesha
rijesha / recursive_sudoku.c
Created January 8, 2018 01:32
C code for solving sudoku recursively
#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);
/*