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
::: Query Term: Jvaa | |
@ -> 4 | |
A -> 4 | |
B -> 4 | |
C -> 4 | |
D -> 4 | |
E -> 4 | |
F -> 4 | |
G -> 4 |
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
(def h (atom (make-hierarchy))) | |
(swap! h derive ::a ::b) | |
;-> "(isa? user/a user/b), under the global hierarchy: false" | |
(println "(isa? user/a user/b), under the global hierarchy:" (isa? ::a ::b)) | |
;-> "(isa? user/a user/b), under the hierarchy, h: true" | |
(println "(isa? user/a user/b), under the hierarchy, h:" (isa? @h ::a ::b)) |
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 lombok.ExtensionMethod; | |
@ExtensionMethod(Extensions.class) | |
public class ExtensionMethodTest { | |
public static void main(final String... args) { | |
System.out.println(args.isNull()); //-> false | |
System.out.println(null.isNull()); //-> true | |
int i = 0; |
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 lombok.Validate; | |
public class ValidateTest { | |
public static void main(final String... args) { | |
foo(0); //-> Passes validation (0 is the most-even number) | |
foo(1); //-> IllegalArgumentException: The object 'i' (argument #1) is invalid | |
} | |
@Validate //-> Required for @Validate.With(*) to be detected | |
private static void foo(@Validate.With("isEven") final Integer i) { |
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 static lombok.Yield.yield; | |
public class YieldTest { | |
public static void main(final String... args) { | |
for (int i : evens()) { | |
System.out.println(i); | |
} | |
} | |
private static Iterable<Integer> evens() { |
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.util.Map; | |
import java.util.HashMap; | |
public class WeightedRandomTest { | |
private static final int NUM_CLASSIFICATIONS = 1_000_000; | |
private static Classification classify() { | |
double factor = Math.random(); | |
for (final Classification classification : Classification.values()) { | |
factor -= classification.getWeight(); |
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
# ... | |
# This is for what I would consider a standard setup, where TTY's 1 -- 6 are | |
# "linux" terminals and TTY's 7+ are reserved for X windows. You should adjust | |
# it to your setup, accordingly. | |
# | |
# ::: Important ::: You must have both fbterm and screen installed and on your | |
# path for this to work. | |
virtual_terminal="$( tty | grep -oE ....$ )" |
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
#include <stdio.h> | |
struct Foo { | |
const int baz; | |
Foo(const int baz) : baz(baz) {} | |
}; | |
struct Qux : public Foo { | |
Qux(const int baz) : Foo(baz) {} | |
}; |
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
BEGIN; | |
CREATE EXTENSION IF NOT EXISTS LTREE; | |
/*============================================================================== | |
Define the tables. | |
==============================================================================*/ | |
CREATE TABLE nodes | |
( |