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
int main(int argc, char const *argv[]) | |
{ | |
/* Declare variables */ | |
int i; | |
int a[10]; | |
int b[10] = {1,2,3,4,5,6,7,8,9,10}; | |
int c[10] = {11,12,13,14,15,16,17,18,19,20}; | |
/* The actual loop */ | |
for (i = 9; i >= 0; --i) { |
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
use v6; | |
my @tape = map { 0 }, 0..10; | |
my $state = 1; | |
#my @rules = (1,0,2,1,'r', 1,1,2,1,'l', 2,0,1,1,'l', 2,1,'h',1,'r'); | |
my @rules = (1,0,2,1,'r', 1,1,'h',1,'r', 2,0,2,1,'l', 2,1,3,0,'r', | |
3,0,3,1,'l', 3,1,1,1,'l'); | |
my $position = +@tape div 2; | |
my $halt = 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
use v6; | |
grammar Math::Grammar { | |
token NonZeroDigit { <[1..9]> } | |
token Digit { <[0..9]> } | |
token Sign { <[+\-]> } | |
token OptionalSign { <Sign>? } | |
token Integer { <NonZeroDigit><Digit>* } | |
token Float { <Integer> \. <Digit>+ } | |
proto token Atom { <...> } |
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
\[ | |
A = \begin{bmatrix} 1 & 3 \\ 0 & 1 \end{bmatrix},\; | |
A^2 = \begin{bmatrix} 1 & 6 \\ 0 & 1 \end{bmatrix},\; | |
A^3 = \begin{bmatrix} 1 & 9 \\ 0 & 1 \end{bmatrix} | |
\] | |
\begin{prop} | |
\(A^n = \begin{bmatrix} 1 & 3n \\ 0 & 1 \end{bmatrix}\) | |
\begin{proof} |
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 is James' and Toms awesome game! | |
# | |
# This program creates a ball moving to the right, which bounces | |
# off a wall. It demonstrates the while loop and if statements. | |
# | |
# Import the Visual Python library | |
from visual import * | |
from random import randrange | |
from time import clock |
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
<?php | |
/* | |
Plugin Name: Easy Comment Uploads | |
Plugin URI: http://wordpress.org/extend/plugins/easy-comment-uploads/ | |
Description: Allow your users to easily upload images and files with their comments. | |
Author: Tom Wright | |
Version: 1.01 | |
Author URI: http://gplus.to/twright/ | |
License: GPLv3 | |
*/ |
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/perl | |
####################################################################### | |
#Basic perl script to update <lastmod> in an XML sitemap. # | |
#Works by seaching for .html files nested in <loc> and then comparing # | |
#to the file. It then inserts the date in the <lastmod> tag. # | |
# # | |
#This code is not subject to copyright and is free to use # | |
# # | |
#Eliot Brown 25/10/2011 # |
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 <QtGui/QApplication> | |
#include "mainwindow.h" | |
int main(int argc, char *argv[]) | |
{ | |
QApplication a(argc, argv); | |
MainWindow w; | |
w.show(); | |
return a.exec(); |
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> | |
int main (int argc, char *argv[]) | |
{ | |
const MAX = 1000000; | |
int i; int j; | |
short isPrime[MAX]; | |
for (i = 0; i <= MAX; ++i) | |
isPrime [i] = 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
program Quiz; | |
{$mode objfpc} | |
uses sysutils, crt; | |
const | |
SEQ_LEN = 5; | |
NUM_FORMULAE = 4; | |
GUESSES = 2; |