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
<canvas id="canvas" width="500" height="500"></canvas> | |
<script> | |
Object.assign(new Image(), { | |
src: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAAXNSR0IArs4c6QAAADdJREFUCJlVzLENwCAMAMEjosL7D+DNzCRORUS+Pv3o7nYVESZUFchM8Byx9/70vMVprLV+T3gB2s0OUOHHM2YAAAAASUVORK5CYII=', | |
onload: function () { | |
var ctx = canvas.getContext('2d') | |
ctx.fillStyle = '#a0a0a0' | |
ctx.fillRect(0, 0, canvas.width, canvas.height) |
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
public static int getInternalFormat(BufferedImage image) { | |
switch (image.getType()) { | |
case BufferedImage.TYPE_3BYTE_BGR: | |
return GL_RGB; | |
case BufferedImage.TYPE_4BYTE_ABGR: | |
return GL_RGBA; | |
default: | |
throw new UnsupportedOperationException(); | |
} | |
} |
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
function newBuckets (size) { | |
let buckets = [] | |
for (let i = 0; i < size; i++) { | |
buckets.push(null) | |
} | |
return buckets | |
} | |
function getBucket (key, buckets) { | |
return key.hashCode() % buckets.length |
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
public class ByteBitmask { | |
public static final byte MASK_0 = 1 << 0; | |
public static final byte MASK_1 = 1 << 1; | |
public static final byte MASK_2 = 1 << 2; | |
public static final byte MASK_3 = 1 << 3; | |
public static final byte MASK_4 = 1 << 4; | |
public static final byte MASK_5 = 1 << 5; | |
public static final byte MASK_6 = 1 << 6; | |
public static final byte MASK_7 = (byte) (1 << 7); |
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
public class Node { | |
public Node getParentNode() { | |
return parentNode; | |
} | |
public Node getPreviousSibling() { | |
return previousSibling; | |
} |
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
/* | |
SSAO GLSL shader v1.2 | |
assembled by Martins Upitis (martinsh) (devlog-martinsh.blogspot.com) | |
original technique is made by Arkano22 (www.gamedev.net/topic/550699-ssao-no-halo-artifacts/) | |
changelog: | |
1.2 - added fog calculation to mask AO. Minor fixes. | |
1.1 - added spiral sampling method from here: | |
(http://www.cgafaq.info/wiki/Evenly_distributed_points_on_sphere) | |
*/ |
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 com.example; | |
import java.io.InputStream; | |
import java.net.URLClassLoader; | |
import java.util.jar.Manifest; | |
public class Foo { | |
public void bar() { | |
} |
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
function closest (result, p, a, b, c) { | |
var px = p[0] | |
var py = p[1] | |
var pz = p[2] | |
var ax = a[0] | |
var ay = a[1] | |
var az = a[2] | |
var bx = b[0] | |
var by = b[1] | |
var bz = b[2] |
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.io.*; | |
import java.net.*; | |
abstract class Client | |
{ | |
Socket socket; | |
ObjectOutputStream out; | |
boolean closed; | |
void init(final Socket newSocket) { |
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 com.example.notification; | |
import android.app.Activity; | |
import android.app.Notification; | |
import android.app.NotificationManager; | |
import android.app.PendingIntent; | |
import android.content.Intent; | |
import android.os.Bundle; | |
import android.view.*; | |
import android.widget.*; |