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
And that judge wasn't gonna look at the twenty-seven eight-by-ten color glossy pictures with the circles and arrows and a paragraph on the back of each one, explainin' what each one was to be used as evidence against us. And we was fined fifty dollars and had to pick up the garbage in the snow, but that's not what I came to tell you about. | |
All your base are belong to us. | |
Support your local medievalist. | |
The three kinds of people: Those who can count and those who can't. | |
Must be user error. | |
Close Cover Before Striking | |
The light at the end of the tunnel is usually a train. | |
42 | |
First pants THEN your shoes. | |
BSA HandBook, 2nd Ed,: "Scouts as a rule do not go into the big woods." |
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 re | |
text = "101011011101010001101101011011101010100010101101010001101100101011011101010001110100111011010101101110110110101110110101000011010101101110110100111011010101101011010100110101001000100100011010100101011100110101001000101011010100110101001010100111010101101001001010101110100101010001010101101001001010100111010101101010101010110001010001110100101011010101010010010100011101000110101010110001010000101001001101010011101011011101010100101011010100111010110100101001001101010011010101000101001010110111010100011111010110110010101101110111010101000101001010111101101010001101001110110101011101101101101011010011101101011101101010001101000101001010111010110101001101010001101001000110101101010011010101001010111010110101001010100010101001110101011010100010101010101010011101011101001010100010101010101110100101101010101100010100010101001010011010101011010110101110100101101010101011" | |
def bin2ascii(binary_form): | |
"""Converts binary strings of length 8 to ASCII""" | |
if len(binary_form) != 8: | |
retur |
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
function quickPlot(varargin) | |
% This function is useful for printing point | |
% cloud data quickly. This function accepts | |
% one or more vectors, in either 2D or 3D, | |
% and either row-order or column-order format. | |
n = size(varargin, 2); | |
colors = char('r.', 'g.', 'b.', 'c.', 'm.'); | |
num_colors = size(colors, 1); |
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
/* | |
* The Monty Hall Problem is a famous teaching problem | |
* in statistics. It works like this: | |
* | |
* Imagine that you are on the show "Let's Make a Deal" | |
* with Monty Hall. Monty shows you three doors and says | |
* that a car exists behind one of them. You may pick | |
* one door and if the car is behind it, you win the car. | |
* | |
* You pick a door. Monty then chances the rules. He opens |
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
""" | |
This code computes pi. It's not the first python | |
pi computation tool that I've written. This program | |
is a good test of the mpi4py library, which is | |
essentially a python wrapper to the C MPI library. | |
To execute this code: | |
mpiexec -np NUMBER_OF_PROCESSES -f NODES_FILE python mpipypi.py |
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
function D = dijkstra(G, pairs) | |
% This function takes an adjacency matrix called G | |
% and a p-by-2 matrix called pairs. | |
% The pairs matrix will contain pairs of indices. | |
% This function will determine the shortest distance from | |
% the first index in the pair to the second index for | |
% every pair in matrix pairs. | |
% | |
% The function will only return a p-by-1 matrix of shortest | |
% distances. I could use it to also return the shortest path, |
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
function gplot3(A, xyz) | |
% GPLOT3(A, xyz) is nearly the same as GPLOT(A, xy) except | |
% that the xyz variable requires a third dimension. | |
% This function takes an adjacency matrix and visualizes it | |
% in 3D. | |
[d e] = size(A); | |
if d ~= e | |
error('A matrix must be square.'); | |
end |
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
function newCurve = spline3d(curve, dt) | |
% interpote a 3d curve using spline | |
% path 3*x | |
% newPath 3*x | |
x = curve(1, :); | |
y = curve(2, :); | |
z = curve(3, :); | |
t = cumsum([0;sqrt(diff(x(:)).^2 + diff(y(:)).^2 + diff(z(:)).^2)]); | |
sx = spline(t,x); | |
sy = spline(t,y); |
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
function V = rotationMatrix(P, x, y, z) | |
% rotationMatrix performs the 3 axis rotation on a | |
% matrix P, which is a 3-by-p set of points, where | |
% d is equal to 3 and represents the dimensionality | |
% of the data and p represents the total number of | |
% observations. | |
% | |
% x represents the amount of rotation along the x axis in radians | |
% y represents the amount of rotation along the y axis in radians | |
% z represents the amount of rotation along the z axis in radians |
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
function result = connected(A) | |
% connected(A) | |
% | |
% This function takes an adjacency matrix A | |
% and returns if the graph is connected. | |
% 1 means connected. | |
% 0 means not connected. | |
% We assume that the starting result is connected. | |
% In lawyer terms, the graph is connected until proven |
OlderNewer