Skip to content

Instantly share code, notes, and snippets.

View hale's full-sized avatar

Philip Hale hale

View GitHub Profile
<?PHP
error_reporting(0);
$con = mysql_connect("trogon.csd.abdn.ac.uk","wtstudent","DyNEDurA");
mysql_select_db("webtech", $con);
$result = mysql_query("SELECT * FROM chart");
?>
<p>
<?PHP
while($row = mysql_fetch_array($result)) {
echo $row['Artist'] . " - ". $row['Title'] . "<br />";
@hale
hale / gist:964452
Created May 10, 2011 13:18
debian 6 cherokee error log
root@vps:/# apt-get install cherokee
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
file libcherokee-base0 libcherokee-client0 libcherokee-config0 libcherokee-mod-admin libcherokee-server0 libexpat1 libmagic1 libmysqlclient16 mime-support mysql-common python
python-minimal python-support python2.6 python2.6-minimal spawn-fcgi
Suggested packages:
cherokee-doc libcherokee-mod-geoip libcherokee-mod-ldap libcherokee-mod-libssl libcherokee-mod-mysql libcherokee-mod-rrd libcherokee-mod-streaming python-doc python-tk
python-profiler python2.6-doc python2.6-profiler binutils binfmt-support
http://www.cherokee-project.com/benchmarks.html
http://www.rkblog.rk.edu.pl/w/p/lighttpd-and-cherokee-benchmark/
http://www.rkblog.rk.edu.pl/w/p/pylons-benchmark-various-servers/
@hale
hale / HailstoneLengthQuick.java
Created October 9, 2011 23:35
HailstoneLengthQuick
public class HailstoneLengthQuick {
public static void main(String[] args) {
int max = 0;
int lower = Integer.parseInt(args[0]);
int upper = Integer.parseInt(args[1]);
for (long n = upper; n >= lower; n--) {
long workingN = n;
int count = 2;
while (workingN!=2) {
count++;
@hale
hale / Main.java
Created October 10, 2011 01:12
sanna3n
/**
* Main class
* @author Susanna Kempe
* @version 10th October 2011
*/
public class Main {
/**
* @param args the command line arguments
*/
@hale
hale / ClimbSort.java
Created November 8, 2011 19:04
ClimbSort
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
public class ClimbSort {
public static void main(String[] args) throws IOException{
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
ArrayList<String> output = new ArrayList<String>();
int numberOfTestCases = Integer.parseInt(input.readLine());
@hale
hale / MyFamily.java
Created November 10, 2011 22:35
MyFamily
import java.io.BufferedInputStream;
import java.util.Arrays;
import java.util.Scanner;
/**
* Created by IntelliJ IDEA.
* CS2011 Homework, Codemarker, 'My Family'
* User: Philip Hale
* ID: 50907446
* Date: 10/11/11
@hale
hale / walking_robot.ic
Created April 24, 2012 13:03
CS2508: Walking Robot program in Interactive C
#define HALF_STEP 240L
#define STEP 400L
#define Q_STEP 120L
void main() {
right_fd( HALF_STEP );
left_bk( HALF_STEP );
msleep(100L);
@hale
hale / graphviz error
Created April 30, 2012 21:35
output of brew install graphviz
➜ local git:(master) brew install graphviz
==> Downloading http://www.graphviz.org/pub/graphviz/stable/SOURCES/graphviz-2.2
Already downloaded: /Users/phil989/Library/Caches/Homebrew/graphviz-2.28.0.tar.gz
==> Downloading patches
######################################################################## 100.0%
==> Patching
patching file macosx/graphviz.xcodeproj/project.pbxproj
patching file lib/gvc/Makefile.in
patching file plugin/quartz/Makefile.in
==> ./configure --disable-debug --prefix=/usr/local/Cellar/graphviz/2.28.0 --with-qt=no --with-quartz --disable-swig --wi
@hale
hale / brew doctor output
Created April 30, 2012 21:36
brew doctor output
➜ local git:(master) brew doctor
Warning: Broken symlinks were found. Remove them with `brew prune':
/usr/local/lib/libfuse.0.dylib
/usr/local/lib/libfuse.2.7.3.dylib
/usr/local/lib/libfuse.dylib
/usr/local/lib/libfuse_ino64.2.7.3.dylib
/usr/local/lib/libfuse_ino64.dylib
/usr/local/lib/libruby.dylib
Warning: "config" scripts exist outside your system or Homebrew directories.