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 java.lang.annotation.Retention; | |
import java.lang.annotation.RetentionPolicy; | |
import java.lang.annotation.Target; | |
import java.lang.annotation.ElementType; | |
@Retention(RetentionPolicy.RUNTIME) | |
@Target({ElementType.TYPE, ElementType.METHOD}) | |
public @interface Foo { } | |
//@Retention(value = RetentionPolicy.RUNTIME) |
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 bench | |
import org.openjdk.jmh.annotations._ | |
import org.openjdk.jmh.infra.Blackhole | |
import java.util.concurrent.TimeUnit; | |
@State(Scope.Thread) | |
class ArrayOpBench { | |
val arrays: Array[Array[_]] = | |
Array( |
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] Referring to non-existent class Ljava_nio_file_Paths$ | |
[error] called from Lmjis_Config$.apply$default$10__Ljava_nio_file_Path | |
[error] called from Lmjis_eval_Interpreter$.$$lessinit$greater$default$2__Lmjis_Config | |
[error] called from Lmjis_web_Editor$.runInterpreter__V | |
[error] called from Lmjis_web_Editor$.init___ | |
[error] exported to JavaScript with @JSExport | |
[error] involving instantiated classes: | |
[error] Lmjis_Config$ | |
[error] Lmjis_eval_Interpreter$ | |
[error] Lmjis_web_Editor$ |
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
WITH role_oids AS ( | |
INSERT INTO pg_authid SELECT concat('Role', id), false, false, false, false, false, true, false, -1, md5(id::text), NULL FROM person RETURNING oid | |
) | |
INSERT INTO pg_auth_members | |
SELECT | |
(SELECT oid FROM pg_authid WHERE rolname = 'enduser'), | |
role_oids, | |
10, | |
false | |
FROM role_oids; |
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
CREATE OR REPLACE FUNCTION create_user_roles() | |
RETURNS void | |
AS $$ | |
DECLARE | |
row RECORD; | |
role_name TEXT; | |
role_password TEXT; | |
BEGIN | |
FOR row IN (SELECT id FROM person) LOOP | |
role_name := concat('Role', row.id); |
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
INSERT INTO pg_auth_members | |
SELECT( | |
(SELECT oid FROM pg_authid WHERE rolname = 'enduser'), | |
(INSERT INTO pg_authid SELECT concat('Role', id), false, false, false, false, false, true, false, -1, md5(id::text), NULL FROM person RETURNING oid), | |
10, | |
false | |
); | |
ERROR: syntax error at or near "INTO" | |
ZEILE 6: (INSERT INTO pg_authid SELECT concat('Role', id), false,... |
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
-- A.hs | |
module A where | |
data U = X | Y deriving (Eq, Show) | |
-- B.hs | |
module B where | |
import Data.Set | |
import A | |
instance Ord U where |
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: java.lang.StackOverflowError | |
at scala.reflect.internal.Types$Type.baseTypeIndex(Types.scala:891) | |
at scala.reflect.internal.Types$CompoundType.baseType(Types.scala:1401) | |
at scala.reflect.internal.Types$ClassTypeRef$class.baseType(Types.scala:1968) | |
at scala.reflect.internal.Types$ClassNoArgsTypeRef.baseType(Types.scala:2331) | |
at scala.reflect.internal.tpe.TypeComparers$class.firstTry$1(TypeComparers.scala:405) | |
at scala.reflect.internal.tpe.TypeComparers$class.isSubType2(TypeComparers.scala:552) | |
at scala.reflect.internal.tpe.TypeComparers$class.isSubType1(TypeComparers.scala:320) | |
at scala.reflect.internal.tpe.TypeComparers$class.isSubType(TypeComparers.scala:278) | |
at scala.reflect.internal.SymbolTable.isSubType(SymbolTable.scala:16) |
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
./run.sh ../../../mj-test/neg/MissingCommaInParameterList.mj | |
9:90 ERROR: expected primary expression, found ')' | |
x[null][true][!false] = (m1(expr1, expr2, (a = b) == 0, new Ident(), /* error */ )); | |
^ |
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
case class Person(firstName: String, lastName: String, age: Int) | |
object Person extends App { | |
// Convert Strings like "Hans Maier, 23" into a Person instance. | |
def apply(value: String): Person = { | |
import java.util.regex._ | |
val pattern = Pattern.compile("""(\w+) (\w+), (\d+)""") | |
val matcher = pattern.matcher(value) | |
new Person(matcher.group(1), matcher.group(2), matcher.group(3).toInt) | |
} |