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
command Prose set background=light wrap linebreak |
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
def powerSet[A](xs: List[A]): List[List[A]] = | |
xs.foldLeft(List(Nil: List[A]))((accum, elem) => accum.flatMap(l => Seq(l, elem :: 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
def countChange(money: Int, coins: List[Int]): Int = | |
if (money < 0 || coins.isEmpty) | |
0 | |
else if (money == 0) | |
1 | |
else | |
countChange(money - coins.head, coins) + countChange(money, coins.tail) |
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
def fetch[R : Fetchable](s: SQLCursor): R = implicitly[Fetchable[R]].fetch(s) | |
trait Fetchable[R] { | |
def fetch(s: SQLCursor): R | |
} | |
implicit object IntIsFetchable extends Fetchable[Int] { | |
def fetch(s: SQLCursor): Int = s.getInt | |
} |
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
scala> val params = (1, "Dan", "H") | |
params: (Int, String, String) = (1,Dan,H) | |
scala> case class Person(id: Int, name: String, initial: String) | |
defined class Person | |
scala> Person.tupled(params) | |
res0: Person = Person(1,Dan,H) |
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
digraph { | |
node [shape=box,fontname=Sans] | |
edge [fontname=Sans,fontsize=6] | |
Catalog | |
subgraph { | |
OWSDispatcher | |
WebMapService | |
WebFeatureService | |
WebCoverageService | |
WebProcessingService |
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
abstract class Printer { | |
public static String message; | |
} | |
class FormalPrinter extends Printer { | |
static { | |
message = "Why hello good sir!"; | |
} | |
} |
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 | |
set -e # Bail out as soon as any command fails | |
git for-each-ref --format='%(objectname) %(refname)' refs/remotes | | |
# sort | uniq -w20 | # uncomment for deduplication, but this doesn't account for multiple branches pointing to the same commit | |
while read line; | |
do | |
ref=${line%\ *} | |
count=$(git log --oneline --since="-1week" $ref | wc -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
org.neo4j.graphdb.TransactionFailureException: Index creation failed for identifiers, {provider=lucene, type=exact} | |
at org.neo4j.kernel.IndexManagerImpl.getOrCreateIndexConfig(IndexManagerImpl.java:233) | |
at org.neo4j.kernel.IndexManagerImpl.getOrCreateNodeIndex(IndexManagerImpl.java:312) | |
at org.neo4j.kernel.IndexManagerImpl.forNodes(IndexManagerImpl.java:300) | |
at org.neo4j.kernel.IndexManagerImpl.forNodes(IndexManagerImpl.java:294) | |
at org.geogit.storage.Neo4JGraphDatabase.getOrAddNode(Neo4JGraphDatabase.java:209) | |
at org.geogit.storage.Neo4JGraphDatabase.put(Neo4JGraphDatabase.java:169) | |
at org.geogit.storage.ObjectDatabasePutInterceptor.putRevObjectInterceptor(ObjectDatabasePutInterceptor.java:112) | |
at org.geogit.storage.ObjectDatabasePutInterceptor.invoke(ObjectDatabasePutInterceptor.java:47) | |
at org.geogit.api.porcelain.CommitOp.call(CommitOp.java:300) |
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
[dwins@localhost dst]$ geogit remote list -v | |
osm http://localhost:8080/geogit/repo (fetch) | |
osm http://localhost:8080/geogit/repo (push) | |
[dwins@localhost dst]$ geogit fetch osm master | |
java.lang.IllegalStateException: Remote could not be resolved. | |
at com.google.common.base.Preconditions.checkState(Preconditions.java:149) | |
at org.geogit.api.porcelain.FetchOp.addRemote(FetchOp.java:94) | |
at org.geogit.api.porcelain.FetchOp.addRemote(FetchOp.java:84) | |
at org.geogit.cli.porcelain.Fetch.runInternal(Fetch.java:70) |