Rails 4.0.4
- There's some compatibility issues between Rails 4.1 and PgSearch which I might use for steps 2-3, so sticking with 4.0.4.
Validations
- Does not validate against whitespace-only fields or fields beginning with whitespace.
module Security | |
module Bouncer | |
THE_LIST = %w(john) | |
def enter(name) | |
raise "Sorry #{name}, you're not on the list" unless THE_LIST.include?(name) | |
puts "Hey #{name}, come on through." | |
super(name) | |
end | |
end |
class NotOnTheListError < StandardError; end | |
module Security | |
module Bouncer | |
THE_LIST = %w(john disco_stu) | |
def enter(name) | |
unless THE_LIST.include?(name) | |
raise NotOnTheListError.new("Sorry #{name}, you're not on the list") | |
end |
<?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 />"; |
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/ |
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++; |
/** | |
* Main class | |
* @author Susanna Kempe | |
* @version 10th October 2011 | |
*/ | |
public class Main { | |
/** | |
* @param args the command line arguments | |
*/ |
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()); |
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 |