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
--Project Euler problem 38 | |
-- What is the largest 1 to 9 pandigital 9-digit number that can be formed as | |
-- the concatenated product of an integer with (1,2, ... , n) where n > 1? | |
import Data.List | |
pandigital9 = map (\x -> read x :: Integer) $ permutations "123456789" | |
main = print $ last $ sort $ takeWhile (<987654321) $ concat $ map (\y -> filter (`elem` pandigital9) $ takeWhile (<987654321) $ map (\x -> read (concat $ map (show) $ map (y*) [1..x]) :: Integer) [1..]) [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
P0 = 0x20000000; // P0 aligned on 32 bit boundary | |
R0.H = [P0++]; // P0 is 16 bit aligned, a 32 bit load would ... | |
R1 = [P0]; // awwwwww maaan! |
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
void dump_image() { | |
beginShape(POINTS); | |
int i; | |
for(i=0; i<cols.length; i++) { | |
stroke(cols[i]); | |
vertex(xs[i], ys[i], zs[i]); | |
if(numPoints != 0 && i%numPoints ==0) { | |
endShape(); | |
beginShape(POINTS); |
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 hypermedia.video.*; | |
OpenCV opencv; | |
PImage frame; | |
void setup() { | |
size( 640, 360 ); | |
frameRate(30); | |
opencv = new OpenCV( this ); | |
opencv.movie( "mymovie.mov", width, height ); |
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 random | |
import oauth2 as oauth | |
import sys | |
import twitter | |
class Markov(object): | |
def __init__(self): |
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 Py_PYTHON_H | |
#define Py_PYTHON_H | |
/* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */ | |
/* Include nearly all Python header files */ | |
/* Sean's changes go here */ | |
#include "patchlevel.h" | |
/* etc ... */ |
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
/* Removed the GPL notice. Hopefully RMS won't come after me... */ | |
#ifndef GREP_GREP_H | |
#define GREP_GREP_H 1 | |
/* Sean's changes go here */ | |
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 6) || __STRICT_ANSI__ | |
# define __attribute__(x) | |
#endif |
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
/* Deleted GPL header - again hopefully RMS won't attack me with a Katana */ | |
/* | |
* Define symbols to identify the version of Unix this is. | |
* Define all the symbols that apply correctly. | |
*/ | |
#define BSD4_2 | |
/* BSD4_3 and BSD4_4 are already defined in sys/param.h */ | |
#define BSD_SYSTEM |
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
--- configure 2012-09-30 11:28:14.000000000 +0200 | |
+++ configure 2012-09-30 11:21:55.000000000 +0200 | |
@@ -16031,14 +16031,16 @@ | |
$as_echo "$XFT" >&6; } | |
if test "x$XFT" = "xyes"; then | |
- PKG_CHECK_MODULES(xft, | |
- xft >= 2.0.0, | |
- XFT="-DXFT" | |
- XFT_PKGCONFIG="xft >= 2.0.0" | |
- CXXFLAGS="$CXXFLAGS $xft_CFLAGS" |
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
install_tar_gz () | |
{ | |
curl -LO $1/$2.tar.gz | |
tar -xzf $2.tar.gz | |
cd $2 | |
./configure | |
make | |
sudo make install | |
cd .. | |
} |
OlderNewer