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
"allow creation of new entries" >> setupData { | |
val datum = data.insert(new Datum(0, Some(1),Some(""), Some("ftp.example.org"), Some("username"), Some("password"), Some(new java.util.Date))) | |
datum.id must_== 1 | |
} |
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
val l = Seq(Seq(1,2), Seq(3,4), Seq(5,6)) | |
val l2 = l.map(_.map(Seq(_))) | |
l2.reduceLeft((xs, ys) => for {x <- xs; y <- ys} yield 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
su root | |
# Don't you hate when you need to root to fix dumb issues? | |
service network-manager stop | |
rm /var/lib/NetworkManager/NetworkManager.state | |
service network-manager start | |
reboot -h now |
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
atom_WM_TAKE_FOCUS :: | |
X Atom | |
atom_WM_TAKE_FOCUS = | |
getAtom "WM_TAKE_FOCUS" | |
takeFocusX :: | |
Window | |
-> X () | |
takeFocusX w = | |
withWindowSet . const $ do |
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
import scala.math.{E, pow} | |
// Vector length | |
def vecLength(implicit values: List[Double]) = pow(values.sum, .5) | |
// Radial basis function | |
def rbf(v1: List[Double], v2: List[Double], gamma:Int = 20) = { | |
val dv = { for(i <- (0 to v1.length)) yield (v1(i)-v2(i)) }.toList | |
val l = vecLength(dv) | |
pow(E, (-gamma*l)) |
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
// fb_init.php | |
require_once('facebook.php'); | |
$facebook = new Facebook(array( | |
'appId'=>'1234567', // replace with your value | |
'secret'=>'123abc456def' // replace with your value | |
)); | |
// reveal.php | |
include_once('fb_init.php'); |
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
val critics = Map( | |
"Lisa Rose" -> Map( | |
"Lady in the Water" -> 2.5, | |
"Snakes on a Plane" -> 3.5, | |
"Just My Luck" -> 3.0, | |
"Superman Returns" -> 3.5, | |
"You,Me and Dupree" -> 2.5, | |
"The Night Listener" -> 3.0), | |
"Gene Seymour" -> Map( | |
"Lady in the Water" -> 3.0, |
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
name := "My Project" | |
version := "0.0.1" | |
scalaVersion := "2.9.0-1" | |
libraryDependencies ++= Seq( | |
// Include dependencies | |
"org.specs2" %% "specs2" % "1.4" | |
) |
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
# Install Erlang | |
$ sudo apt-get install autoconf | |
$ curl -O https://raw.github.com/dreverri/kerl/master/kerl; chmod a+x kerl | |
$ ./kerl build R14B03 r14b03 | |
$ ./kerl install r14b03 /opt/erlang/r14b03 | |
$ . ~/.kerl/installs/r14b03/activate | |
# Build Riak from source | |
$ git clone git://github.com/basho/riak.git | |
$ cd riak |
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/sh | |
# dumb ass Xfce | |
xrandr --auto --output VGA1 --mode 1920x1080 --right-of LVDS1 | |
Broadcom wireless troubles: | |
I had success getting this to work by marking these five packages for reinstallation in the synaptic package manager: | |
bcmwl-kernel-source |