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
;; how to print primitive arrays | |
;; http://stackoverflow.com/questions/8390983/printing-primitive-arrays-in-clojure | |
(def a (range 10)) | |
(println (seq a)) | |
;; or use java.utils.Arrays | |
(java.util.Arrays/toString a) |
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
/* | |
# original pastbin here | |
# http://pastebin.com/raw.php?i=F8f5GHJZ | |
from math import sqrt, pow, pi | |
import Image | |
class Vector( object ): | |
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
(ns test-clj-byte-chunk-seq | |
(:import (java.io InputStream OutputStream | |
FileInputStream FileOutputStream))) | |
(set! *warn-on-reflection* true) | |
(def ^:const ONE_MEG (* 1024 1024)) | |
(deftype ByteArrayChunk [^bytes array ^int offset ^int end] | |
clojure.lang.IChunk |
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 javax.swing.*; | |
public class JL { | |
JFrame f = null; | |
JMenuBar mb = null; | |
JMenu fm = null; | |
JMenuItem mi = null; | |
private void sleep() { |
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 time, json | |
# we use python a lot | |
# to do api calls with api requests is a great way to go | |
# see here http://docs.python-requests.org/en/latest/ | |
import requests | |
# put your own auth information here, login information | |
# for cbt |
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
var Vector = (function () { | |
function Vector(x, y, z) { | |
this.x = x; | |
this.y = y; | |
this.z = z; | |
} | |
Vector.times = function (k, v) { | |
return new Vector(k * v.x, k * v.y, k * v.z); | |
}; |
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
<html> | |
<head> | |
<script type="text/javascript" | |
src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"> | |
</script> | |
<script> | |
var user = "USERNAME", pass = "PASSWORD"; | |
function mycallback(data) |
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.sql.*; | |
public class Mysqldates { | |
Connection db =null; | |
public void run() throws Exception { | |
db = DriverManager.getConnection("jdbc:mysql://localhost/test"); | |
PreparedStatement st = null; | |
PreparedStatement st2 = null; |
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 javax.swing.*; | |
import javax.swing.text.*; | |
import java.awt.*; | |
import java.awt.event.*; | |
public class Clearer { | |
public static void main(String[] args) { | |
JFrame mainframe = new JFrame("test"); | |
mainframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
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
#!/bin/bash | |
NORMAL=$(tput sgr0) | |
GREEN=$(tput setaf 2; tput bold) | |
RED=$(tput setaf 1) | |
YELLOW=$(tput setaf 3) | |
function red() { | |
echo -e "$RED$*$NORMAL" | |
} |