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; | |
public final class Madness { | |
public static void main(final String[] args) { | |
final Stack<Integer> stack = new Stack<>(); | |
stack.add(1); | |
stack.add(2); | |
stack.add(3); | |
stack.push(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
import java.util.concurrent.ExecutionException; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.Future; | |
/** | |
* | |
*/ | |
public final class StackBlur { | |
private static final int PARALLEL_THRESHOLD = 2048 * 2048; |
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 brutus.compiler.util; | |
/** | |
* import static Unchecked.unchecked | |
* unchecked(() -> throw new IOException()); | |
*/ | |
public final class Unchecked { | |
@FunctionalInterface | |
public static interface UncheckedFunction { | |
public void apply() throws Throwable; |
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
static int[] t = {0, 5, 1, 6, 4, 3, 2, 7}; | |
int foo(final byte value) { | |
int x = value & 0xff; | |
x |= x >> 1; | |
x |= x >> 2; | |
x |= x >> 4; | |
x *= 0x1d; | |
x &= 0xff; | |
x >>= 5; |
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
class Shadowing { | |
private float x; | |
public Shadowing(float x) { | |
this.x = x; | |
} | |
public void foo() { | |
if(x < 0.5f) { | |
x = Math.round(x); |
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
class Base { | |
void meth() { | |
System.out.println("Base::meth"); | |
} | |
} | |
class Derived extends Base { | |
public static void main(String[] args) { | |
Base x = new Derived(); | |
x.meth(); |
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
class Main { | |
public static void main(final String[] args) { | |
System.out.println("Hello World!"); | |
} | |
} |
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
server { | |
listen 80; | |
server_name konklone.com; | |
return 301 https://$host$request_uri; | |
} | |
# optional: the 'spdy' at the end of the listen command below turns on SPDY support. | |
server { | |
listen 443 ssl spdy; |
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 will optimize-deoptimize leading to v8 giving | |
// up on the function | |
String.prototype.hashCode = function() { | |
var n = this.length; | |
var hash = 0; | |
if(n != 0) { | |
for(var i = 0; i < n; ++i) | |
hash = Math.imul(31, hash) + this.charCodeAt(i) | 0; | |
return hash; |
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
// what does the following code print? | |
// | |
// a) false, true | |
// b) true, true | |
// c) true, false | |
// d) none of the above | |
console.log(new Option() instanceof HTMLOptionElement) | |
console.log(new HTMLOptionElement() instanceof HTMLOptionElement) |