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
| 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 |
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
| 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]) |
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
| 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) |
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/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—————————————————————— |
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
| 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. |
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
| 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 { |
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
| 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) | |
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
| implicit class RicherDouble(d: Double) extends AnyVal { | |
| def square = ... | |
| def squareRoot = ... | |
| ... | |
| } |
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
| ./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) |
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
| object Test { | |
| def apply[T] { | |
| println("app") | |
| } | |
| def update[T](t: T) { | |
| println(t) | |
| } | |
| } |