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 | |
print dirname(__FILE__).'\n'; | |
function mk($path){ | |
print 'tpath = ' .$path . '\n'; | |
if (!file_exists($path)) | |
if (mkdir($path, 0777)) | |
print 'Success!\n'; | |
else | |
print 'Fail!\n'; | |
} |
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 | |
function checkName($fname) | |
{ | |
if ($fname == "20031128ab.jpg") | |
return "20031128.jpg"; | |
return $fname; | |
} | |
function checkPath($pathToImages, $fname) | |
{ |
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 os, sys, re, shutil | |
from os.path import join | |
os.chdir(sys.argv[1]) | |
# Walk the directory structure looking for folders/files with a ":" in the name | |
for root, subfolders, files in os.walk('.'): | |
for foldername in subfolders: | |
if re.search(":",foldername,re.IGNORECASE): | |
print "Renaming ", foldername , " -> ", foldername.replace(":","-") |
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
<html> | |
<head> | |
<title>Templatefile</title> | |
<style type="text/css"> | |
body {margin-left: 4%; margin-right: 4%; background-color: #000;} | |
p {text-indent: 1.5em} | |
p.c1 {text-align: center} | |
p.c2 {color: #0D0; font-family: fixedsys, monopoint, terminal} | |
h1.c1 {color: #0D0; font-family: fixedsys, monopoint, terminal} | |
h2.mid {margin-top: 3em; margin-bottom:.4em; text-align: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
# Take r, g and b channels from separate images. Python randomises the list for extra fun. | |
from PIL import Image | |
import os, math, sys, random | |
os.chdir(sys.argv[1]) | |
fileList = os.listdir(".") | |
random.shuffle(fileList) | |
(width, height) = Image.open(fileList[0]).size | |
nPhotos = len(fileList) | |
dst = Image.new("RGB", (width, height)) | |
fileNum = 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
for x in [3,4,6]: | |
if x == 3: | |
y = 8 | |
z = 4 | |
if x == 4: | |
y = 6 | |
z = 3 | |
if x == 6: | |
y = 4 | |
z = 2 |
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 <math.h> | |
#include <assert.h> | |
//c99 removed M_PI, so check if it's defined, if not, define it | |
#ifndef M_PI | |
#define M_PI acos(-1.0) | |
#endif | |
void triangles(double a, double b, double h){ |
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
#!/bin/bash | |
if [ $# -lt 3 ]; then | |
echo "Usage: marmoset_submit course project file [...]" | |
exit 1 | |
fi | |
if [ $# -eq 3 ]; then | |
zip "$3" >& /dev/null | |
if [ $? -eq 12 ]; then | |
/u8/cs_build/bin/marmoset_submit "$@" | |
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
今天我发现你的javascript想一个中文字是一个ASCII字。 | |
所以我现在用中文写比较多的东西。 | |
但是,我没有特别好的东西写。 | |
所以我希望你会以为写中文是一个非常独特的东西。 | |
Translated, it's: | |
Today I found out your javascript code is thinking one chinese character is equivalent to one standard ASCII character. | |
So I'm using Chinese to write more than I would otherwise be able to. | |
Unfortunately, I can't think of anything really interesting to write. | |
So I'm hoping you will think writing Chinese is a very unique thing. |
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
MOV r0, #0 | |
LDR r1, =N; N is label in memory, assuming it's +/- 4096 | |
MOV r2, #0; r2 is the counter | |
LOOP; just a label | |
MUL r3, r2, r2; i * i | |
ADD r0, r0, r3; total += i*i | |
ADD r2, r2, #1; i++ | |
CMP r2, r1; break out of loop when i = N | |
BNE LOOP |
OlderNewer