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
def f(n) | |
(2 * n + 1)**-1 | |
end | |
def g(n) | |
((-1)**n).to_f | |
end | |
def 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
#!/usr/bin/env ruby | |
# encoding: UTF-8 | |
require 'complex' | |
Tau = 2 * Math::PI | |
TableWidth = 20 | |
####################################################################### | |
## This is a script I was using to simulate an analog Resistor | |
## Capacitor in series filter, to see if I had the math right. |
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
For although light oftenest behaves as a wave, it can be looked on as a mote, the *lightbit*. | |
We have already said by the way that a mote of stuff can behave not only as a chunk, but as a wave. | |
Down among the unclefts, things do not happen in steady flowings, but in leaps between bestandings that are forbidden. | |
The knowledge-hunt of this is called *lump beholding*. |
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> | |
#include <string.h> | |
#include <math.h> | |
#include "common.h" | |
// Enums | |
enum {SAW, SQUARE, SINE}; |
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
require 'matrix' | |
#### | |
## Random program that uses matrices to find intersection between 2 lines | |
## the linear algebra way. | |
## I am not sure why I made this, but it's probably because I like matrices | |
class Line | |
attr_reader :slope, :offset |
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
;;;; | |
; Create an iNES header | |
.ines {"prog": 1, "char": 0, "mapper": 0, "mirror": 0} | |
;;;; | |
; Include all the symbols in the nes library | |
.inc <nes.sym> | |
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
// Comple with g++ *.cpp -o prog // | |
#include <iostream> | |
#include "test.h" | |
using namespace std; | |
int main(int argc, char **argv){ | |
Test test; |
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 <stdio.h> | |
#include <stdint.h> | |
//// Create some pretend Memory Mapped Registers | |
volatile uint64_t memory_mapped_registers[] = {0, 0, 0, 0, 0, 0, 0, 0, 0}; | |
#define bit_depth uint64_t | |
#define mmio_byte(mem_addr) (*(volatile bit_depth *)(mem_addr)) |
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
//// | |
// Curiously Recurring Template Pattern | |
#include <stdio.h> | |
template <typename T> | |
struct Counter { | |
// Static class members variables | |
static int objects_created; | |
static int objects_alive; |
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
(use readline) | |
(current-input-port (make-readline-port)) | |
(install-history-file #f ".csi.history") | |
(parse-and-bind "set editing-mode vi") |
OlderNewer