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 <math.h> | |
#include <stdio.h> | |
// P Found using maxima | |
// | |
// y(x) := 4 * x * (%pi-x) / (%pi^2) ; | |
// z(x) := (1-p)*y(x) + p * y(x)^2; | |
// e(x) := z(x) - sin(x); | |
// solve( diff( integrate( e(x)^2, x, 0, %pi/2 ), p ) = 0, p ),numer; | |
// |
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 sys | |
import subprocess | |
import re | |
# A normal commit will just have two arguments, this filename and the filename | |
# of the commit message we want to change. Any other kind of commit we'll be | |
# cowardly about and just leave as is. | |
if len(sys.argv)!=2 : | |
sys.exit(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
#!/usr/bin/python | |
import sys | |
import os.path | |
import re | |
# Use this like this: | |
# cppfind . -l autogen | grep -v test | python include_grapher.py | neato -otest3.pdf -Tpdf -Goverlap=scale -Gstart=rand | |
# you can replace neato with dot or any of the other graphvis commands | |
# What the example does is finds all files using autogen in them anywhere, and graphs who includes what (directly) |
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
#ifndef ma_concurrent_queue_h | |
#define ma_concurrent_queue_h | |
// Based on code from http://www.justsoftwaresolutions.co.uk/threading/implementing-a-thread-safe-queue-using-condition-variables.html | |
// Original version by Anthony Williams | |
// Modifications by Michael Anderson | |
#include "boost/thread.hpp" | |
#include <deque> |
NewerOlder