Skip to content

Instantly share code, notes, and snippets.

object UnitExample extends App {
val mass: Mass[Double] = 4.0 kg
val longMass: Mass[Long] = (4.0 kg) asLong
val length: Length[Int] = (5 m) * 3
val time: Time[Int] = 1 s
val time2: Time[Int] = time + time
val time3 = time2 + (1 minute)
val temperature: Temperature[BigDecimal] = BigDecimal("22.22") k
val speed: Speed[Int] = length / time
val area: Area[Int] = length * length
final class SBigInt private(final val signum: Int, final private[math] val arr: Array[Int]) {
/**
* Standard Serialization would work, but we have to make sure
* that we sanitize the array to verify our invariant of no leading
* “zeroes” in our magnitude.
*
* Otherwise all methods depending on it will be broken.
*/
@throws(classOf[java.io.IOException]) @throws(classOf[java.lang.ClassNotFoundException])
diff --git a/src/library/scala/collection/mutable/ArrayBuffer.scala b/src/library/scala/collection/mutable/ArrayBuffer.scala
index bfdc085..71e3daa 100644
--- a/src/library/scala/collection/mutable/ArrayBuffer.scala
+++ b/src/library/scala/collection/mutable/ArrayBuffer.scala
@@ -44,7 +44,7 @@ import parallel.mutable.ParArray
* @define willNotTerminateInf
*/
@SerialVersionUID(1529165946227428979L)
-class ArrayBuffer[A](override protected val initialSize: Int)
+class ArrayBuffer[A : ClassManifest](override protected val initialSize: Int)
% test/partest test/files/run/t5394.scala
Testing individual files
No such file or class on classpath: Test
testing: [...]/files/run/t5394.scala [FAILED]
1 of 1 tests failed (elapsed time: 00:00:03)
test/partest test/files/run/t5394.scala 5,87s user 0,14s system 169% cpu 3,537 total
————————t5394.scala——————————————————————
Programming Language Checklist
by Colin McMillen, Jason Reed, and Elly Jones.
You appear to be advocating a new:
[ ] functional [X] imperative [ ] object-oriented [X] procedural [ ] stack-based
[ ] "multi-paradigm" [ ] lazy [ ] eager [X] statically-typed [X] dynamically-typed
[ ] pure [ ] impure [ ] non-hygienic [ ] visual [X] beginner-friendly
[X] non-programmer-friendly [ ] completely incomprehensible
programming language. Your language will not work. Here is why it will not work.
package example.dynamicxml
import language.dynamics
class DynamicXML(x: scala.xml.NodeSeq, attributeMode: Boolean = false) extends Dynamic {
def selectDynamic(name: String) = {
if (attributeMode) {
println(s"... selecting attribute $name")
new DynamicXML(x \ (s"@$name"))
} else {
package example.dynamicxml
object Main extends App {
val testXml = <test><foo><bar qux = "xyz">abc</bar></foo></test>
println((testXml \ "foo" \ "bar").text)
println((testXml \ "foo" \ "error").text)
implicit class RicherDouble(d: Double) extends AnyVal {
def square = ...
def squareRoot = ...
...
}
./fiji-linux64 -eval 'run("Bead-based restration", "select=Single-channel spim_data_directory=/data/microscopy/images/ pattern_of_spim=embryo_252+254_r={a}.btf timepoints_to_process=1 angles_to_process=0-180:180 bead_brightness=Weak xy_resolution=0.406 z_resolution=2.000 transformation_model=Rigid select_reference=Manually");'
Re-executing with correct library lookup path (/usr/lib64/:/data/microscopy/fiji/lib/linux64)
init Bead_Registration dialog: tfSpimDataDirectory.getText() =
log4j:WARN No appenders could be found for logger (loci.common.services.ServiceFactory).
log4j:WARN Please initialize the log4j system properly.
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
object Test {
def apply[T] {
println("app")
}
def update[T](t: T) {
println(t)
}
}