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
\documentclass[12pt]{article} | |
\usepackage{fullpage} | |
\usepackage[fleqn]{amsmath} | |
\begin{document} | |
\begin{abstract} | |
\begin{center} | |
Equation Challenge | |
\end{center} |
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
package main | |
import "fmt" | |
func main() { | |
size := 7 | |
grid := make([][]int, size) | |
for k := 0; k < size; k++ { |
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 bisect | |
import timeit | |
#Finds the Nth golumb number from the | |
#sequence x(n) using a binary search | |
def findNthGolumb(n, x, upto) : | |
pos = bisect.bisect(x, n, 1, upto) | |
return pos - 1 | |
#Creates the sequence x(n) where x(n) is k |
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
#Quine1 | |
e=r'''print "e=r''"+"'"+e+"''"+"'\n"+e''' | |
print "e=r''"+"'"+e+"''"+"'\n"+e | |
#Quine2 | |
x='%s=%s;print x%%("x",chr(39)+x+chr(39))';print x%("x",chr(39)+x+chr(39)) | |
#Quine3 | |
y="%" | |
z='y="%s"\nz=%s\nprint z%s(y,repr(z),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
#!/usr/bin/env python | |
def partitions(n, curtot = 0, cur = []) : | |
if curtot == n : | |
yield cur | |
t = cur[-1] if cur else 1 | |
for i in xrange(t, n - curtot + 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
#!/usr/bin/env python | |
import timeit | |
graph = {'A': ['B', 'C'], | |
'B': ['C', 'D'], | |
'C': ['D'], | |
'D': ['C'], | |
'E': ['F'], | |
'F': ['C']} |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <malloc.h> | |
#include <time.h> | |
#include <gmp.h> | |
long int NAIVE = 30; | |
typedef unsigned long int ulong; |
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
.section .data | |
output: | |
.ascii "The processor Vendor ID is: " | |
vendor_id: | |
.ascii "xxxxYYYYzzzz\n" | |
.section .bss | |
.section .text |
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
/* | |
* y += A*x | |
* | |
* Matrix-Vector multiplication optimization experiment | |
* TODO: Benchmark against the following: | |
* eigen2: ourselves, with the default options (SSE2 vectorization enabled). | |
* eigen2_novec: ourselves but with Eigen's explicit vectorization disabled. However, gcc's auto-vectorization was enabled. | |
* INTEL_MKL: The Intel Math Kernel Library, which includes a BLAS/LAPACK (11.0). Closed-source. | |
* ACML: The AMD's core math library, which includes a BLAS/LAPACK (4.2.0). Closed-source. |
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 <stdio.h> | |
#include <cblas.h> | |
double m[] = { | |
3, 1, 3, | |
1, 5, 9, | |
2, 6, 5 | |
}; | |
double x[] = { |
OlderNewer