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
/** | |
* Created with IntelliJ IDEA. | |
* User: dacc | |
* Date: 8/27/13 | |
* Time: 10:01 AM | |
* To change this template use File | Settings | File Templates. | |
*/ | |
package main | |
import ( |
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
/** | |
* Created with IntelliJ IDEA. | |
* User: dacc | |
* Date: 8/27/13 | |
* Time: 10:01 AM | |
* To change this template use File | Settings | File Templates. | |
*/ | |
package main | |
import ( |
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
postgres=# create table bar(id serial primary key); | |
NOTICE: CREATE TABLE will create implicit sequence "bar_id_seq" for serial column "bar.id" | |
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "bar_pkey" for table "bar" | |
CREATE TABLE | |
postgres=# create table foo(bar_id int not null references bar deferrable initially deferred); | |
CREATE TABLE | |
postgres=# insert into bar values(1); | |
INSERT 0 1 | |
postgres=# insert into foo values(1); | |
INSERT 0 1 |
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
scala> case class Foo(bars: Seq[Int]) | |
defined class Foo | |
scala> val foos = Seq( | |
| Foo(bars=Seq(1, 2, 3)), | |
| Foo(bars=Seq(4, 5, 6)) | |
| ) | |
foos: Seq[Foo] = List(Foo(List(1, 2, 3)), Foo(List(4, 5, 6))) | |
scala> foos.map(_.bars).flatten |
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 mkArrayRep(list: List[String]): String = | |
list.map(_.replace("\"", "\\\"").replace("\\", "\\\\")) | |
.mkString("{\"", "\", \"", "\"}") | |
def mkList(string: String): List[String] = { | |
val commaSeparated = string.substring(1, string.length - 1) | |
StringUtil.parseCsvLine(commaSeparated).toList | |
} | |
implicit def stringArrayMapper = MappedTypeMapper.base[List[String], String](mkArrayRep _, mkList _) |
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
[0m[[0minfo[0m] [0mLoading project definition from /Users/dacc/src/sbt-example/project[0m | |
[0m[[0minfo[0m] [0mSet current project to root (in build file:/Users/dacc/src/sbt-example/)[0m | |
[0m[[0minfo[0m] [0mCompiling 1 Scala source to /Users/dacc/src/sbt-example/core/target/scala-2.10/classes...[0m | |
[0m[[31merror[0m] [0msymbol value $u does not exist in Test$delayedInit$body.apply[0m | |
[0m[[31merror[0m] [0m[0m | |
[0m[[31merror[0m] [0m while compiling: /Users/dacc/src/sbt-example/core/src/main/scala/Test.scala[0m | |
[0m[[31merror[0m] [0m during phase: icode[0m | |
[0m[[31merror[0m] [0m library version: version 2.10.0[0m | |
[0m[[31merror[0m] [0m compiler version: version 2.10.0[0m | |
[0m[[31merror[0m] [0m reconstructed args: -bootclasspath /Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.7.0_09.jdk/Contents/Home/j |
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
getrev() { | |
echo `hg log -r $1` | awk '{print $2}' | awk 'BEGIN {FS=":"} {print $2}' | |
} | |
hgbranchdiff() { | |
from=$(getrev "parents(min(branch(.)))") | |
to=$(getrev "max(branch(.))") | |
hg diff -r $from -r $to | |
} |
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
#!/usr/bin/python | |
# | |
# Trims a PDF made from a Powerpoint presentation, removing slides that share all | |
# non-whitespace pixels with the one in front of them. i.e. Only retains "key" | |
# slides, dropping transitional ones whose content is redundant. | |
# | |
from sys import argv | |
from numpy import array, fromstring | |
from itertools import islice |
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
> drop 3 | |
No instance for (GHC.Show.Show ([a] -> [a])) | |
arising from a use of `M619304151.show_M619304151' | |
at <interactive>:(2,0)-(4,31) | |
Possible fix: | |
add an instance declaration for (GHC.Show.Show ([a] -> [a])) | |
> |
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
<appender name="FILE" class="ch.qos.logback.core.FileAppender"> | |
<file>sesosh.log</file> | |
<append>true</append> | |
<encoder> | |
<pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</pattern> | |
</encoder> | |
</appender> | |
<root level="info"> | |
<appender-ref ref="FILE" /> |
NewerOlder