This file contains hidden or 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 | |
agent=SIMPLETON | |
port=31656 | |
trace=1 | |
SLEEP=10 | |
steps=150 | |
seed=1257360045 | |
./RunProg ./WW_Test -p ${port} -d 0 -D 1 -R 1 -s ${steps} -t 0 -S ${SLEEP} -z {seed} & |
This file contains hidden or 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
#TODO: Match the optional ".x86" extension | |
grep -Rin --after-context 1 "all:" $(find -type f -iname "Makefile") | grep -Rin "\-o\ \b\w\+-\?\w\+-\?\w\+\?\?\b" |
This file contains hidden or 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
#to find the offenders | |
find -name "*\.php" -print0 | xargs -0 grep -Rin "password" > results.txt | |
# to replace it with garbage | |
find . -name "*.php" -print0 | xargs -0 sed -i -e 's/FINDME/REPLACEWITHME/g' | |
# you can change '*.php' to the extension you want. | |
# remove the command from .bash_history | |
> ~/.bash_history |
This file contains hidden or 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
Mark Holmberg, Dixie State College of Utah | |
CS 3520, Programming Languages | |
14 Sept. 2011 | |
(defn foldl [f sofar lst] | |
(if (empty? lst) sofar | |
(foldl f(f (first lst) sofar) (rest lst)))) | |
(defn foldr [f sofar lst] |
This file contains hidden or 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
//Mark Holmberg [email protected] | |
//CS350, Programming Languages | |
//date: Mon Sep 12 09:33:11 MDT 2011 | |
//Clojure | |
//http://en.wikipedia.org/wiki/Quicksort | |
((fn [x] (* x x)) 5) | |
//calling a function with only one parameter | |
#(* % %) |
This file contains hidden or 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
Mark Holmberg, Dixie State College of Utah | |
CS 3520, Programming Languages | |
9 Sept. 2011 | |
Some help with the adventure game | |
% Lets assert some things | |
assert(bag(key)), assert(bag(candle)), assert(bag(sword)), assert(bag(bow)). | |
% do we have a candle? | |
bag(candle). |
This file contains hidden or 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
# Mark Holmberg, Dixie State College of Utah | |
# CS 3520, Programming Languages | |
# 8 Sept. 2011 | |
# http://www.sudoku-solutions.com/ | |
# Purpose: Generate 'unsolved' sudoku puzzles for the sudoku | |
# solver to solve. | |
# Step One: Go to the URL above and hit the 'Random' button. | |
# Step Two: After the board is formed hit the 'Save' button and open the |
This file contains hidden or 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
Mark Holmberg, Dixie State College of Utah | |
CS 3520, Programming Languages | |
7 Sept. 2011 | |
Some help with the Man, the Wolf, the Goat, and the Cabbage. | |
Since the solution is given on the site, but not how to invoke a solution | |
I searched through the slides to come up with this to actually test it | |
length(X,7), solution([w,w,w,w],X). |
This file contains hidden or 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
% See the Gist Here | |
% https://gist.github.com/1201748 | |
change(e,w). | |
change(w,e). | |
move([X,X,Goat,Cabbage],wolf,[Y,Y,Goat,Cabbage]) :- | |
change(X,Y). | |
move([X,Wolf,X,Cabbage],goat,[Y,Wolf,Y,Cabbage]) :- | |
change(X,Y). |
This file contains hidden or 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
Mark Holmberg, Dixie State College of Utah | |
CS 3520, Programming Languages | |
7 Sept. 2011 | |
Some help with 8-queens so you don't have to type as much. | |
If you want to test your 8-Queens predicate you can NOT write a test predicate | |
like Russ said. Although it does work, it only returns true or false NOT the | |
list of the proper queen locations. The following is the test case I used. |