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
def countdown(a): | |
for i in a: | |
print a - i | |
if i == 3: | |
print "blast off!" | |
break | |
i+=1 | |
countdown(3): |
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
shorewall: | |
pkg: | |
- installed | |
cmd.wait: | |
- name: service shorewall reload | |
- require: | |
- pkg: shorewall | |
- pkg: ulogd | |
- file: shorewall_files | |
- file: /etc/default/shorewall |
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
val map = { | |
type Dict = Map[Char, Char] | |
val initial = Map[Char, Char]() | |
(for(c <- List('A', 'a'); i <- 0 until 26) yield { | |
((i + c).toChar, ((i + 13) % 26 + c).toChar) | |
}).foldLeft[Dict](initial)({ (map, kv) => | |
val (k, v) = kv | |
map.updated(k, v) |
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
! Internal server error, for request [GET /tasks/1/delete?] -> | |
sbt.PlayExceptions$CompilationException: Compilation error [could not find implicit value for parameter om: org.scalaquery.ql.OptionMapper2[Int,Int,Boolean,Int,Long,R]] | |
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12$$anonfun$apply$13.apply(PlayReloader.scala:236) ~[na:na] | |
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12$$anonfun$apply$13.apply(PlayReloader.scala:236) ~[na:na] | |
at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.11.3] | |
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12.apply(PlayReloader.scala:236) ~[na:na] | |
at sbt.PlayReloader$$anon$2$$anonfun$reload$3$$anonfun$4$$anonfun$apply$12.apply(PlayReloader.scala:233) ~[na:na] | |
at scala.Option.map(Option.scala:133) ~[scala-library.jar:0.11.3] |
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
diff --git a/project/Build.scala b/project/Build.scala | |
index eb28dac..cf9cb1a 100644 | |
--- a/project/Build.scala | |
+++ b/project/Build.scala | |
@@ -10,6 +10,7 @@ object ApplicationBuild extends Build { | |
val appDependencies = Seq( | |
// Add your project dependencies here, | |
"org.xerial" % "sqlite-jdbc" % "3.7.2" | |
+ , "org.scalaquery" % "scalaquery_2.9.0-1" % "0.9.5" | |
) |
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
Sources: | |
- http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way/ | |
- http://www.raspberrypi.org/phpBB3/viewtopic.php?f=66&t=22975 | |
- http://www.thomaskho.com/blog/2006/02/qemu-and-the-network-bridge/ | |
- http://toast.djw.org.uk/qemu.html | |
- http://wiki.debian.org/QEMU#Host_and_guests_on_same_network | |
Files needed: | |
- http://downloads.raspberrypi.org/images/raspbian/2013-02-09-wheezy-raspbian/2013-02-09-wheezy-raspbian.zip.torrent | |
- http://xecdesign.com/downloads/linux-qemu/kernel-qemu |
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 <string> | |
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <cstdlib> | |
#include <ctime> | |
#include <iomanip> | |
#define MNAMES 4 | |
#define FNAMES 4 |
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
class Email: | |
name = None | |
email = None | |
def __init__(self, name, email): | |
self.name = name | |
self.email = email | |
def __str__(self): | |
return "%s <%s>" % (self.name, self.email) |
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
adjust_size() { | |
size=$1 | |
shift | |
if [ "x" = "x$size" -o -f "$size" ]; then | |
echo "Usage: adjust_size size_spec file [file2 [file3...]]" | |
return 1 | |
fi | |
for P in "$@"; do |
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
recurse_image_resize() { | |
for f in "$@"; do | |
if [ ! -d "$f" ]; then | |
echo "recurse_image_resize: '$f' is not a directory" | |
fi | |
for ff in "$f"/*.png; do | |
echo "resizing $ff to half size" | |
convert "$ff" -resize 50% "$ff"; | |
done |
OlderNewer