Skip to content

Instantly share code, notes, and snippets.

@blueintegral
blueintegral / gist:7416f9303d89570b458a
Created March 11, 2016 02:57
Solving the pip install error with msvc9compiler
Microsoft Windows [Version 10.0.10586]
(c) 2015 Microsoft Corporation. All rights reserved.
C:\>cd "Program Files (x86)\Microsoft Visual Studio 9.0"
C:\Program Files (x86)\Microsoft Visual Studio 9.0>cd VC
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC>cd bin
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin>cd amd64
@blueintegral
blueintegral / ball_sense.c
Created January 19, 2014 20:29
Robocup ball sense code with added LFSR and debug stuff
#include <board.h>
#include "main.h"
#include "status.h"
#include "timer.h"
#include "ball_sense.h"
#include "adc.h"
//How much ambient IR light we can handle
//FIXME This number is arbitrary and needs to be chosen experimentally
@blueintegral
blueintegral / gist:6263391
Created August 18, 2013 19:10
Hardcoded value version of DIY CyberGlove Arduino code
float analog0;
float analog1;
float analog2;
float analog3;
float analog0_close;
float analog1_close;
float analog2_close;
float analog3_close;
@blueintegral
blueintegral / gist:6263384
Created August 18, 2013 19:09
DIY CyberGlove Arduino code
float analog0;
float analog1;
float analog2;
float analog3;
float analog0_close;
float analog1_close;
float analog2_close;
float analog3_close;
float analog0_open;
float analog1_open;
@blueintegral
blueintegral / index.html
Created May 23, 2013 00:21
Cosmic Microwave Background mapping - Maps an image taken by the Planck Survey onto a sphere.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Planck Cosmic Microwave Background</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
@blueintegral
blueintegral / threading_demo.c
Created January 15, 2013 06:20
Demonstrates effect of threading by calculating perfect numbers (an integer equal to the sum of its integer divisors with no remainders) and primes under 1,000,000 with and without threads.
// Perfect.cpp : Defines the entry point for the console application.
#include "stdafx.h"
#include "Windows.h"
#include "LIMITS.h"
static HANDLE Thread_mutex;
int prime_count1;
int prime_count2;
int prime_count3;
int prime_count4;
@blueintegral
blueintegral / parity.asm
Last active December 11, 2015 03:19
Compute parity of a number
#Hunter Scott
#Version for MARS
#declare and reserve space for data and variables after .data
.data
#string constant
title: .asciiz "Program computes the pariety of number"
prompt: .asciiz "Input a number please: "
o_title: .asciiz "The pariety is "
# newline junk
newline: .byte 10,13,00,00
@blueintegral
blueintegral / sierpinski.m
Created January 15, 2013 03:52
Simple recursive Sierpinski triangle generator I wrote for MATLAB
function sierpinski(pair1,pair2,pair3)
X = (((pair1(1)-pair2(1))^2)+((pair1(2)-pair2(2))^2))^(1/2);
Y = (((pair3(1)-pair2(1))^2)+((pair3(2)-pair2(2))^2))^(1/2);
Z = (((pair3(1)-pair1(1))^2)+((pair3(2)-pair1(2))^2))^(1/2);
if X >= 0.1 && Y >= 0.1 && Z >= 0.1
x = [pair1(1) pair2(1) pair3(1) pair1(1)];
y = [pair1(2) pair2(2) pair3(2) pair1(2)];
for index = 1:length(pair1)
A(index) = (pair2(index)+pair3(index))/2;
B(index) = (pair1(index)+pair3(index))/2;
@blueintegral
blueintegral / gist:9339804
Last active August 29, 2015 13:56
keybase.md
### Keybase proof
I hereby claim:
* I am blueintegral on github.
* I am hunter (https://keybase.io/hunter) on keybase.
* I have a public key whose fingerprint is DECD 24A6 5BB9 7D5E 12B9 CCAE C5B3 F178 DF88 9B2F
To claim this, I am signing this object: