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
# [Created by task 1.9.4 4/26/2011 23:22:06] | |
# Taskwarrior program configuration file. | |
# For more documentation, see http://taskwarrior.org or try 'man task', 'man task-faq', | |
# 'man task-tutorial', 'man task-color', 'man task-sync' or 'man taskrc' | |
# Here is an example of entries that use the default, override and blank values | |
# variable=foo -- By specifying a value, this overrides the default | |
# variable= -- By specifying no value, this means no default | |
# #variable=foo -- By commenting out the line, or deleting it, this uses the default |
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 MineSweeper(val input:String) { | |
val grid = input.split("\n").map(_.toArray) | |
def isCellBomb(cell:(Int, Int)) = { | |
for{ | |
row <- grid.lift(cell._1) | |
cell <- row.lift(cell._2) | |
if(cell == '*') | |
} yield 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
class MineSweeper(val input:String) { | |
val grid = input.split("\n").map(_.toArray) | |
def isCellBomb(cell: Tuple2[Int,Int]) = { | |
for{ | |
row <- grid.lift(cell._1) | |
cell <- row.lift(cell._2) | |
if(cell == '*') | |
} yield 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 input = "..*\n...\n*.."; | |
val grid = input.split("\n").map(_.toArray) | |
def bomb(coord: Tuple2[Int,Int]) = { | |
for{ | |
row <- grid.lift(coord._1) | |
cell <- row.lift(coord._2) | |
if(cell == '*') | |
} yield 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 input = "..*\n...\n*.."; | |
val grid = input.split("\n").map(_.toArray) | |
def bomb(coord: Tuple2[Int,Int]) = grid.lift(coord._1).flatMap(_.lift(coord._2)) match { | |
case Some('.') => 0; | |
case Some('*') => 1; | |
case None => 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
copy paste this into a shell | |
/Users/bjartek/.vim-addons/vim-addon-async/C/vim-addon-async-helper mvim 'VIM' '1' '/Users/bjartek/tmp/vcnZGwR/3' '/Users/bjartek/tmp/vcnZGwR/5' '2000' '/Users/bjartek/.vim-addons/ensime/dist/bin/server.sh '\''/Users/bjartek/tmp/vcnZGwR/2'\'' '\''vim'\''' | |
pid: 33882, bufnr: 4 | |
VIM LOG : sent: [1,"swank:init-project","sexp-string"," ( :project-package \"synonyms\" :use-sbt t )","/Users/bjartek/foo"] | |
server : s shell | |
server : using json protocol | |
server : Project waiting for init... | |
server : Server listening on 55957.. | |
server : Wrote port 55957 to /Users/bjartek/tmp/vcnZGwR/2. |
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
~ λ /Users/bjartek/.vim-addons/vim-addon-async/C/vim-addon-async-helper mvim 'VIM' '2' '/Users/bjartek/tmp/vHx9uCJ/7' '/Users/bjartek/tmp/vHx9uCJ/9' '2000' '/bin/bash -i' | |
arg 0 mvim | |
arg 1 --servername | |
arg 2 VIM | |
arg 3 --remote-expr | |
arg 4 async#Receive("2","pid",["22667"]) | |
0 | |
got data | |
sending bytes: bash: no job control in this shell | |
, len 35 |
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
package scalaexamples.quiz.console | |
import scalaexamples.quiz.{Answer, Question, Quiz} | |
import annotation.tailrec | |
class ConsoleGame(quiz: Quiz) { | |
println("Welcome to our faboulus quiz called '" + quiz.title + "'") | |
val answers = quiz.questions.map { | |
question => |
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 annotation.tailrec | |
object Input { | |
def main(args: Array[String]) { | |
println(askInput) | |
} | |
@tailrec | |
private def askInput: String = { | |
lazy val input = try readLine.toInt -1 catch {case _ => -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
#!/bin/bash | |
(ssh bjartka@pvv -o PermitLocalCommand=no \ | |
": > ~/.irssi/fnotify ; tail -f ~/.irssi/fnotify " | \ | |
while read heading message; do \ | |
growlnotify -t "${heading}" -m "${message}"; \ | |
done)& | |