Skip to content

Instantly share code, notes, and snippets.

/**
* 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 (
/**
* 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 (
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
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
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 _)
[info] Loading project definition from /Users/dacc/src/sbt-example/project
[info] Set current project to root (in build file:/Users/dacc/src/sbt-example/)
[info] Compiling 1 Scala source to /Users/dacc/src/sbt-example/core/target/scala-2.10/classes...
[error] symbol value $u does not exist in Test$delayedInit$body.apply
[error] 
[error]  while compiling: /Users/dacc/src/sbt-example/core/src/main/scala/Test.scala
[error]  during phase: icode
[error]  library version: version 2.10.0
[error]  compiler version: version 2.10.0
[error]  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
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
}
#!/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
> 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]))
>
<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" />