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
REM https://www.emacswiki.org/emacs/EmacsMsWindowsIntegration | |
c:\path\to\emacs\bin\emacsclientw.exe -c -n -a c:\path\to\emacs\bin\runemacs.exe |
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 | |
import matplotlib.pyplot as plt | |
import time as time | |
total_random_points = int(input("\nNumber of random points for Monte Carlo estimate value of PI?\n>")) | |
start_time = time.time() | |
inside_circle = 0 |
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
// https://doxygen.postgresql.org/erand48_8c_source.html | |
#pragma once | |
#include <cmath> | |
#define RAND48_SEED_0 (0x330e) | |
#define RAND48_SEED_1 (0xabcd) | |
#define RAND48_SEED_2 (0x1234) | |
#define RAND48_MULT_0 (0xe66d) |
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 <iostream> | |
#include <random> | |
#include <cstdlib> | |
#include <cstdio> | |
#include "erand48.h" | |
#ifndef M_PI | |
#define M_PI 3.14159265358979323846 | |
#endif // !M_PI |
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
// Place your settings in this file to overwrite the default settings | |
{ | |
"editor.fontSize": 15, | |
"editor.fontFamily": "'Consolas', 'Inziu IosevkaCC SC'", | |
"editor.fontLigatures": true, | |
"editor.renderLineHighlight": "none", | |
"editor.letterSpacing": 0, | |
"editor.minimap.enabled": false, | |
"editor.occurrencesHighlight": false, | |
"editor.cursorBlinking": "smooth", |
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
--[[ | |
ProFi v1.3, by Luke Perkin 2012. MIT Licence http://www.opensource.org/licenses/mit-license.php. | |
Example: | |
ProFi = require 'ProFi' | |
ProFi:start() | |
some_function() | |
another_function() | |
coroutine.resume( some_coroutine ) | |
ProFi:stop() |
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
/* | |
The C# version of https://github.com/cloudwu/lua-snapshot on https://github.com/topameng/tolua_runtime | |
*/ | |
using System; | |
using System.Text; | |
using LuaInterface; | |
public static class Snapshot | |
{ | |
private readonly static int TABLE = 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
#undef GOOGLE_ARRAYSIZE | |
#define GOOGLE_ARRAYSIZE(a) \ | |
((sizeof(a) / sizeof(*(a))) / \ | |
static_cast<size_t>(!(sizeof(a) % sizeof(*(a))))) |
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
#!/usr/bin/env python | |
"""Simple HTTP Server With Upload. | |
This module builds on BaseHTTPServer by implementing the standard GET | |
and HEAD requests in a fairly straightforward manner. | |
""" |
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
// https://www.shadertoy.com/view/lltczj | |
// https://www.reddit.com/r/twotriangles/comments/1hy5qy/tutorial_1_writing_a_simple_distance_field/ | |
const int MAX_ITER = 100; | |
const float MAX_DIST = 20.0; | |
const float EPSILON = 0.001; | |
float sphere(vec3 pos, float radius) | |
{ | |
return length(pos) - radius; |