Skip to content

Instantly share code, notes, and snippets.

public class Test {
static int a;
public static boolean f(int b) {
while(true) {
if( a==3 ) {
return true;
}
try {
<html>
<head>
<script>
function put(data, callback) {
request("PUT", "https://api.myjson.com/bins/4wq17", JSON.stringify(data), callback)
}
function get(callback) {
request("GET", "https://api.myjson.com/bins/4wq17", null, callback)
}
function request(method, url, data, callback) {
package dependencies;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct {
int len;
char *s;
} string_t;
typedef string_t string;
#include <vector>
#include <iostream>
#include <dmtx.h>
#include <opencv2/opencv.hpp>
void decode(const cv::Mat& image){
int width = image.cols;
int height = image.rows;
#include <stdio.h>
int main(int argc, char* argv[]) {
FILE * filePointer = NULL;
filePointer = stdin;
char inputText[300];
if (fgets(inputText, sizeof(inputText), filePointer) != NULL ) //!= EOF
{
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import javax.swing.JFrame;
public class PerlinChunks {
private static int hash32shift(int key) {
key = ~key + (key << 15);
key = key ^ (key >>> 12);
key = key + (key << 2);
@banthar
banthar / browser.py
Last active December 31, 2015 18:59
#!/usr/bin/python
import gtk, webkit, sys, time, gobject
class Browser:
def __init__(self, window, url):
self.window = window
self.view = (webkit.WebView(), webkit.WebView())
self.url = url
@banthar
banthar / R.java
Created September 22, 2013 08:22
import java.util.Random;
public class R {
private static long doRead(final Random r, final long rangeStart,
final long rangeEnd) {
long retVal = 0;
final long range = rangeEnd - rangeStart;
// Fill until we get to range
@banthar
banthar / go-gl.patch
Created September 11, 2013 17:36
golang + OSMesa
diff --git a/gl.go b/gl.go
index 89581f3..8ba19cb 100644
--- a/gl.go
+++ b/gl.go
@@ -4,13 +4,8 @@
package gl
-// #cgo darwin LDFLAGS: -framework OpenGL -lGLEW
-// #cgo windows LDFLAGS: -lglew32 -lopengl32