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
class User extends MongoRecord[User] with MongoId[User] { | |
def meta = User | |
protected def valUnique(msg: String)(value: String): | |
List[FieldError] = { | |
Console.println("Not the overloaded.") | |
Nil | |
} | |
object userName extends StringField(this, "") { |
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
class Monad m where | |
(>>=) :: m a -> (a -> m b) -> m b | |
return :: a -> m a | |
class Comonad w where | |
(=>>) :: w a -> (w a -> b) -> w b | |
extract :: w a -> a |
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
DATE AND TIME FORMAT CODES | |
%a Abbreviated weekday name | |
%A Full weekday name | |
%b Abbreviated month name | |
%B Full month name | |
%c Date and time representation for your locale | |
%d Day of month as a decimal number (01-31) | |
%H Hour in 24-hour format (00-23) | |
%I Hour in 12-hour format (01-12) |
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 |
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
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
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
// 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
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
atom_WM_TAKE_FOCUS :: | |
X Atom | |
atom_WM_TAKE_FOCUS = | |
getAtom "WM_TAKE_FOCUS" | |
takeFocusX :: | |
Window | |
-> X () | |
takeFocusX w = | |
withWindowSet . const $ do |