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.util.Random | |
object S99_P23 { | |
def removeAt[T](n: Int, ts: Seq[T]) = (ts.take(n) ++ ts.drop(n + 1), ts(n)) | |
def randomSelect[T](count: Int, ts: Seq[T]): Seq[T] = { | |
val r = new Random | |
def go(count: Int, ts: Seq[T], acc: Seq[T]): Seq[T] = { | |
if (count > 0) { | |
val (next, elem) = removeAt(r.nextInt(ts.length), ts) |
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.annotation.tailrec | |
object S99_P17 { | |
def split_1l[T](n: Int, ts: Seq[T]) = ts.splitAt(n) | |
def split_tr[T](n: Int, ts: Seq[T]): (Seq[T], Seq[T]) = { | |
@tailrec | |
def go(n: Int, lists: (Seq[T], Seq[T])): (Seq[T], Seq[T]) = (n, lists) match { | |
case (n, (heads, e +: tails)) if (n > 0) => go(n - 1, (e +: heads, tails)) | |
case (_, (heads, tails)) => (heads.reverse, tails) |
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 p8[T](list: Seq[T]): Seq[T] = | |
list.foldRight(Seq[T]())((e, l) => | |
if (l.isEmpty || e != l.head) e +: l | |
else l) | |
def p9[T](list: Seq[T]): Seq[Seq[T]] = | |
list.foldRight(Seq[Seq[T]]())((e, l) => | |
if (l.isEmpty || e != l.head.head) Seq(e) +: l | |
else (e +: l.head) +: l.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
<project xmlns='http://maven.apache.org/POM/4.0.0' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' | |
xsi:schemaLocation='http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd'> | |
<modelVersion>4.0.0</modelVersion> | |
<parent> | |
<groupId>biz.aQute.bnd</groupId> | |
<artifactId>parent</artifactId> | |
<version>2.0.0</version> | |
</parent> |
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
------------------------------------------------------------------------------- | |
Test set: org.fusesource.scalate.japi.TemplateEngineFacadeTest | |
------------------------------------------------------------------------------- | |
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 3.773 sec <<< FAILURE! | |
using TemplateEngine from Java(org.fusesource.scalate.japi.TemplateEngineFacadeTest) Time elapsed: 3.246 sec <<< ERROR! | |
org.fusesource.scalate.TemplateException: assertion failed: originalOwner is not kept in presentation compiler runs. | |
at org.fusesource.scalate.TemplateEngine.compileAndLoad(TemplateEngine.scala:728) | |
at org.fusesource.scalate.TemplateEngine.compileAndLoadEntry(TemplateEngine.scala:695) | |
at org.fusesource.scalate.TemplateEngine.liftedTree1$1(TemplateEngine.scala:415) | |
at org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:409) |
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
[ERROR] error: | |
[INFO] while compiling: /home/rafal/workspaces/scala/scalate-scala-2.10/scalate/scalate-core/src/test/scala/org/fusesource/scalate/scuery/LoopTest.scala | |
[INFO] during phase: icode | |
[INFO] library version: version 2.10.0-M7 | |
[INFO] compiler version: version 2.10.0-M7 | |
[INFO] reconstructed args: -d /home/rafal/workspaces/scala/scalate-scala-2.10/scalate/scalate-core/target/test-classes -deprecation -classpath /home/rafal/workspaces/scala/scalate-scala-2.10/scalate/scalate-core/target/test-classes:/home/rafal/workspaces/scala/scalate-scala-2.10/scalate/scalate-core/target/classes:/home/rafal/.m2/repository/org/fusesource/scalate/scalate-util/1.6.0-SNAPSHOT/scalate-util-1.6.0-SNAPSHOT.jar:/home/rafal/.m2/repository/org/scala-lang/scala-library/2.10.0-M7/scala-library-2.10.0-M7.jar:/home/rafal/.m2/repository/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar:/home/rafal/.m2/repository/org/scala-lang/scala-compiler/2.10.0-M7/scala-compiler-2.10.0-M7.jar:/home/rafal/.m2/repository/org |
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
osgi> ss | |
"Framework is launched." | |
id State Bundle | |
0 ACTIVE org.eclipse.osgi_3.8.0.v20120529-1548 | |
1 ACTIVE org.eclipse.equinox.simpleconfigurator_1.0.300.v20110815-1744 | |
2 ACTIVE com.ibm.icu_4.4.2.v20110823 | |
3 RESOLVED com.jcraft.jsch_0.1.46.v201205102330 | |
4 RESOLVED com.sun.el_2.2.0.v201108011116 |
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: Wednesday, June 20, 2012 11:43:08 PM Central European Summer Time | |
*** Platform Details: | |
*** System properties: | |
eclipse.application=org.eclipse.ui.ide.workbench | |
eclipse.buildId=M20120208-0800 | |
eclipse.commands=-os | |
linux | |
-ws |
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
Unexpected error while trying to get the bundles from pl.caltha.osgi.bndtools-scala.impl;resolution=file:/home/rafal/workspaces/osgi-bndtools-scala/enterprise-osgi-examples/bndtools-scala/pl.caltha.osgi.bndtools-scala.impl/target/bnd/pl.caltha.osgi.bndtools-scala.impl.jar;version=latest, | |
org.apache.felix.fileinstall;resolution=file:/home/rafal/workspaces/osgi-bndtools-scala/enterprise-osgi-examples/bndtools-scala/cnf/repo/org.apache.felix.fileinstall/org.apache.felix.fileinstall-3.1.10.jar;version='[3.1.10,3.1.11)', | |
org.apache.felix.http.whiteboard;resolution=file:/home/rafal/workspaces/osgi-bndtools-scala/enterprise-osgi-examples/bndtools-scala/cnf/repo/org.apache.felix.http.whiteboard/org.apache.felix.http.whiteboard-2.2.0.jar;version='[2.2.0,2.2.1)', | |
pl.caltha.osgi.bndtools-scala.api;resolution=file:/home/rafal/workspaces/osgi-bndtools-scala/enterprise-osgi-examples/bndtools-scala/cnf/releaserepo/pl.caltha.osgi.bndtools-scala.api/pl.caltha.osgi.bndtools-scala.api-1.0.0.jar;version='[1.0.0,1.0.1)', | |
org.apac |
NewerOlder