Instantly share code, notes, and snippets.

View calc_lens.py
# finds possible lens configurations to make a working microscope given a set of available lenses and a couple of other parameters
# outputs the max and min magnification of each valid lens ordering and the total length of each lens system
lens = [25.4, 25.4, 25.4, 100.0, -75.0]
eye_dist = 270.00
# each lens adds one degree of freedom to the system; it's fully constrained
# with 2 lens but every additional lens adds a DoF
# so we'll brute force it by checking every possible combination of lengths
# between 10mm and 100mm and pick the best set of valid parameters
View texture_test.cpp
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/core/cuda.hpp>
#include <opencv2/core/cuda_stream_accessor.hpp>
#include <opencv2/cudev/ptr2d/glob.hpp>
void transfer_caller(cv::cudev::GlobPtrSz<float> in, cv::cudev::PtrStepSz<float> out);
View ADA4807.cir
* ADA4807 SPICE Macro-model
* Function: Amplifier
*
* Revision History:
* Rev. 4.0 Dec 2014 -TC
* Copyright 2014 by Analog Devices
*
* Refer to http://www.analog.com/Analog_Root/static/techSupport/designTools/spicemodels/license
* for License Statement. Use of this model indicates your acceptance
* of the terms and provisions in the License Staement.
View keybase.md

Keybase proof

I hereby claim:

  • I am cactorium on github.
  • I am cactorium (https://keybase.io/cactorium) on keybase.
  • I have a public key whose fingerprint is 9872 DAA3 6680 490B CD12 D694 0DC7 89A1 5B2E 6E75

To claim this, I am signing this object:

View vectors.cc
// so this week we're starting where we left off last week!
// we moved some of the stuff into a header file called "vectors.h"
// so check that out before moving forward
// include stuff as before
#include <vector>
#include <iostream>
// here we include our brand new header file
// note that its name is surrounded in quotes instead of brackets
View world.cc
// Same #includes as last time, nothing new here
#include <vector>
#include <iostream>
// C++ has structs just like C!
// This defines a new type of thing, called a Point
// so you can make Points, and they'll all have these exact components
struct Point {
double x, y, z, mass;
};
View hello.cc
// NOTE: if you are running in an IDE, you may need to add -std=c++11
// to the compiler settings for this to compile correctly.
// GCC (which is the most common compiler suite) defaults to using an older standard of
// C++, so it won't be able to understand all the awesomecool features we're using here
// until you tell it that you want to use them
//
// A line that starts with two slashes like this is a comment!
// They're ignored by the compiler, so you can write whatever you want in them
// They're mainly used for commenting code, to better describe what's happening
// in the code if it's complicated