This file contains hidden or 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
| // compile with: | |
| // g++ -O2 --std=c++14 -Rpass=inline main.cpp 2> >(grep "pages_from_the_fire" -A1) | |
| // | |
| #include <iostream> | |
| #include <vector> | |
| class Base { | |
| public: | |
| virtual int pages_from_the_fire() { return ++x; } |
This file contains hidden or 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
| """ | |
| Show us how adding more terms to regular polynomials are good at some | |
| functions (sines for example) but fail with others, such as Runge's | |
| function. | |
| Show how chebyshev nodes help. | |
| """ | |
| import numpy as np | |
| import matplotlib.pyplot as plt |
This file contains hidden or 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 <unordered_map> | |
| #include "default.hpp" | |
| class Talkative : public TalkativeBase | |
| { | |
| public: | |
| Talkative& operator=(const Talkative& t) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
| /* | |
| * Quick experiment to demonstrate touch screen debouncing/smoothing | |
| */ | |
| #include <Elegoo_GFX.h> // Core graphics library | |
| #include <Elegoo_TFTLCD.h> // Hardware-specific library | |
| #include <TouchScreen.h> | |
| #define YP A3 // must be an analog pin, use "An" notation! | |
| #define XM A2 // must be an analog pin, use "An" notation! |
This file contains hidden or 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
| # Shows networking with bash (/dev/udp) | |
| # Shows interpreting hex strings as bytes | |
| BCASTIP=${1} | |
| WOLPORT=7 | |
| MAGIC="\xff\xff\xff\xff\xff\xff" | |
| MAC=$(echo ${2} | tr ':' ' ') | |
| # Expects mac address to be punctuated by colons ':', transforms |
This file contains hidden or 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
| """ | |
| Demo code for showing how a Self-Organized Map (Kohonen Map) learns handwritten digit data in an | |
| unsupervised manner. | |
| Data source: https://archive.ics.uci.edu/ml/machine-learning-databases/optdigits/ | |
| This code uses 'optdigits.tra' | |
| Each line is a handwritten digit. | |
| The first 64 numbers are gray levels for an 8 x 8 image. | |
| The last number is the digit class. |
This file contains hidden or 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
| """Simple simulator to explore conditional independence in Bayesian networks | |
| Node representation: | |
| Say the node is has two parents named L and K and the probability table is | |
| L | K | p(T) | |
| -------------- | |
| F | F | 0.2 | |
| F | T | 0.4 |
This file contains hidden or 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 URL format is documented at http://ssd.jpl.nasa.gov/horizons_batch.cgi | |
| I figured out the template by using the webinterface to make a query I wanted and then | |
| clicking 'batch-file' to see how the batch file commands would look like. | |
| Also see https://github.com/mommermi/callhorizons by Michael Mommert | |
| """ | |
| import urllib.request | |
| import time |
This file contains hidden or 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
| #lang racket | |
| ;; Visualize a sum of two 3D Gaussians as concentric isosurfaces | |
| ;; Note: this example requires Racket 5.2 or later | |
| (require plot) | |
| ;; Returns an R x R x R -> R Gaussian function centered at (cx,cy,cz) | |
| (define ((gaussian cx cy cz) x y z) | |
| (exp (- (+ (sqr (- x cx)) (sqr (- y cy)) (sqr (- z cz)))))) |