View table_function_no_errors.sql
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 TABLE foo( | |
some_id SERIAL PRIMARY KEY, | |
another INT, | |
stuff VARCHAR(20) | |
); | |
CREATE OR REPLACE FUNCTION insert_crap_into_foo() RETURNS INTERVAL AS | |
$$ | |
DECLARE | |
counter INT := 0; |
View table_function_instead_of_view.sql
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 TABLE foo( | |
some_id SERIAL PRIMARY KEY, | |
another INT, | |
stuff VARCHAR(20) | |
); | |
CREATE OR REPLACE FUNCTION insert_crap_into_foo() RETURNS INTERVAL AS | |
$$ | |
DECLARE | |
counter INT := 0; |
View issue_with_postgres_views.sql
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 TABLE foo( | |
some_id SERIAL PRIMARY KEY, | |
another INT, | |
stuff VARCHAR(20) | |
); | |
CREATE OR REPLACE FUNCTION insert_crap_into_foo() RETURNS INTERVAL AS | |
$$ | |
DECLARE | |
counter INT := 0; |
View PlainThreads.java
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 PlainThreads { | |
public static void main(String... args) { | |
for (int i = 0; i < 100; i++) { | |
new Thread(new Task1()).start(); | |
} | |
} | |
} |
View root types.ceylon
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
//Anything can only have two subtypes: Object and Null | |
shared abstract class Anything() of Object | Null {} | |
shared class Object() extends Anything() {} | |
//Null can only have one instance, called null | |
shared abstract class Null() | |
of null | |
extends Anything() {} |
View module.ceylon
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
module test "0.1" { | |
import "npm:uuid" "2.0.2"; | |
} |
View BraindeadServer.groovy
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
class BraindeadServer { | |
int port | |
private ServerSocket server | |
String response | |
void start() { | |
server = new ServerSocket(port) | |
byte[] buf = new byte[128] | |
new Thread({-> |
View Skip.java
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
import java.lang.reflect.*; | |
public class Skip { | |
public final String s; | |
public Skip(String s) { | |
this.s=s; | |
} | |
public static void main(String... args) throws Exception { | |
Skip me = new Skip("Initial"); |
View Zurg.ceylon
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
class Toy(shared String name, shared Integer time) { | |
string="``name`` (takes ``time``m)"; | |
} | |
Comparison sortFast(Toy a, Toy b) | |
=> a.time<=>b.time; | |
Toy[2] fastestPair([Toy*] gang) { | |
assert(nonempty g=gang.sort(sortFast), | |
nonempty r=g.rest); |
View Permutator.ceylon
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
shared class Permutator<out Element>({Element*} source) satisfies Iterable<{Element*}> { | |
shared actual Iterator<{Element*}> iterator() { | |
value elems = source.sequence(); | |
if (elems.size>1) { | |
value arr = Array(source); | |
value idxs = Array(0..arr.size); | |
void swap(Integer i, Integer j) { | |
if (exists ei=arr[i], exists ej=arr[j]) { | |
arr.set(i,ej); |
NewerOlder