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
;; to create the test file: | |
;; java slurptest.clj makewords 100 | |
;; | |
;; to run the test | |
;; java -Xmx3G -Xms3G clojure.main slurptest.clj slurp|slurp2 | |
(import '[java.io BufferedReader InputStreamReader]) | |
(ns slurptest | |
(:require [clojure.java.io :as jio])) |
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
<lift:surround with="default" at="content"> | |
<lift:comet type="Chat"> | |
<h3>welcome to lift chat</h3> | |
<ul id="ul_dude"> | |
<chat:line></chat:line> | |
</ul> | |
<lift:form> | |
<chat:input/> | |
<input type="submit" value="chat"/> |
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
package code.comet | |
import net.liftweb._ | |
import http._ | |
import actor._ | |
import js._ | |
import JsCmds._ | |
import js.jquery.JqJsCmds.{AppendHtml, FadeOut, Hide, FadeIn} | |
import java.util.Date | |
import scala.xml._ |
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
package code.comet | |
import net.liftweb._ | |
import http._ | |
import actor._ | |
import js._ | |
import JsCmds._ | |
import js.jquery.JqJsCmds.{AppendHtml, FadeOut, Hide, FadeIn} | |
import java.util.Date | |
import scala.xml._ |
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
#!/usr/bin/env python | |
import os, re, sys | |
from xml.etree.ElementTree import ElementTree | |
def hash_style(s): | |
s = re.split(r";\s+", s) | |
s = [re.split(r":", x) for x in s] | |
s = [(x[0], re.sub(r"[^0-9]", "", x[1])) for x in s if re.match(r"^\d", x[1])] | |
return dict(s) |
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
// photoshop knob generation script | |
// This script assumes your source document contains a layer group | |
// called "indicator" that can be successively rotated around its | |
// center to generate a series of rotation state images. | |
// - Miles Egan January 2011 | |
// change this to the number of discrete rotations you want | |
var numRotations = 65; | |
var rotAngle = 270; | |
var step = rotAngle / (numRotations - 1); |
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
// the old way: | |
int calculate_z(int a, int b) | |
{ | |
int *buffer = malloc(a * sizeof(int)); | |
// ... | |
free(buffer); | |
} | |
// the new way: | |
int calculate_z(int a, int b) |
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
AudioStreamBasicDescription fmt = (AudioStreamBasicDescription) { | |
.mChannelsPerFrame = 1, | |
.mBytesPerFrame = sizeof(int16_t), | |
.mBytesPerPacket = sizeof(int16_t), | |
.mFramesPerPacket = 1, | |
.mBitsPerChannel = sizeof(int16_t) * 8, | |
.mFormatID = kAudioFormatLinearPCM, | |
.mSampleRate = 44100.0, | |
.mFormatFlags = kAudioFormatFlagIsBigEndian | | |
kAudioFormatFlagIsPacked | |
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
float imag[size_2]; | |
float real[size_2]; | |
DSPSplitComplex comp = (DSPSplitComplex) { .imagp = imag, .realp = real }; | |
vDSP_ctoz((DSPComplex *)windowedSamples, 2, &comp, 1, size_2); | |
vDSP_fft_zrip(self.fftSetup, &comp, 1, logSize, kFFTDirection_Forward); |
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
# Provides an "embed_youtube" tag for Jekyll's Liquid templates. | |
# Much cleaner than pasting in <object> tags. | |
require 'uri' | |
module Jekyll | |
class EmbedYouTubeTag < Liquid::Tag | |
def initialize(tag_name, text, tokens) |
OlderNewer