This file contains 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 openclscala; | |
import com.chemikadze.scalacl._ | |
import java.lang.Float | |
object addOne extends JavaCLFunction11Impl[Float, Float]( | |
"addOne", | |
""" | |
__kernel void addOne(__global const float* in, __global float* out, int n) |
This file contains 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
data LegHealth = Healthy | Broken deriving (Show) | |
data HumanLegs a = Legs a deriving (Show) | |
instance Functor HumanLegs where | |
fmap f (Legs st) = Legs $ f st | |
barbell :: LegHealth -> LegHealth | |
barbell _ = Broken -- playing with iron always ends very bad |
This file contains 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
case class Foo(id: Key = genKey) | |
case class Bar(x: String, foo: Key = null, id: Key = genKey) | |
// in tests | |
Bar(testData, testFoo.id, testBarId) | |
// somewhere in logic | |
Bar(sensitiveData, foo.id) |
This file contains 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
public initializing.WithNull(); | |
Code: | |
0: aload_0 | |
1: invokespecial #19; //Method java/lang/Object."<init>":()V | |
4: aload_0 | |
5: aconst_null | |
6: pop | |
7: aconst_null | |
8: putfield #11; //Field x:Ljava/lang/Object; | |
11: return |
This file contains 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
public class structural.C extends java.lang.Object implements scala.ScalaObject{ | |
public static {}; | |
Code: | |
0: iconst_0 | |
1: anewarray #8; //class java/lang/Class | |
4: putstatic #14; //Field reflParams$Cache1:[Ljava/lang/Class; | |
7: new #16; //class java/lang/ref/SoftReference | |
10: dup | |
11: new #18; //class scala/runtime/EmptyMethodCache | |
14: dup |
This file contains 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
trait Test { | |
trait A | |
trait B | |
implicit def a2b(a: A): B | |
trait X[T] | |
trait Y[+T] | |
implicit def rewrapX[U, T <% U](x: X[T]): X[U] | |
implicit def rewrapY[U, T <% U](x: Y[T]): Y[U] |
This file contains 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
// create new task | |
lazy val myPlugin = TaskKey[Unit]("my-plugin") | |
lazy val myPluginTask = Seq( | |
myPlugin := (), | |
myPlugin <<= myPlugin.dependsOn(someTask in someProject), | |
) | |
// depend one task on another | |
xxx | |
.settings( |
This file contains 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
# Simple hierarchical application | |
# Here we accept parameter, pass it through genesis component and return back | |
application: | |
interfaces: | |
input: | |
in: bind(child_app#input.in) | |
result: | |
out: bind(child_app#result.out) | |
This file contains 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
# Simple hierarchical application | |
# Here we accept parameter, pass it through genesis component and return back | |
application: | |
interfaces: | |
child_in: | |
app_input: bind(child_app#input.in) | |
child_out: | |
app_output: bind(child_app#result.out) | |
child_output: bind(child_app#result.own) |
This file contains 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
chemikadze ~/programming/java $ javac unicode.java | |
unicode.java:4: unclosed string literal | |
private static String s = "\u000d"; | |
^ | |
unicode.java:4: unclosed string literal | |
private static String s = "\u000d"; | |
^ | |
unicode.java:4: <identifier> expected | |
private static String s = "\u000d"; | |
^ |
OlderNewer