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
nmap <silent> <leader>/ :call Commentify()<cr> | |
vmap <silent> <leader>/ :call Commentify()<cr> | |
"Commentify config | |
if !exists("b:commentType") | |
let b:commentType="#" | |
endif | |
augroup Commentify |
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/python | |
from os import system as s | |
import sqlite3,datetime | |
s('rm -f ./test.sqlite'); | |
conn = sqlite3.connect('test.sqlite'); | |
c = conn.cursor(); | |
c.execute('CREATE TABLE foo(bar STRING PRIMARY KEY, baz STRING,bin);'); | |
c.execute('CREATE INDEX index_bar ON foo(bar);'); | |
c.execute('CREATE INDEX index_baz ON foo(baz);'); |
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
console.time('creation'); | |
var array = []; | |
for (var i = 0; i < 100000; i++) { | |
array.push({i:i}); | |
} | |
console.timeEnd('creation'); | |
console.group('for index'); |
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
LINK = ln -f | |
BUILD_DIR = ./build | |
MODULE_DIR = ./lib | |
RES_FILE = reddit_enhancement_suite.user.js | |
MODULES = $(MODULE_DIR)/$(RES_FILE) | |
BUILT_FILE = $(BUILD_DIR)/$(RES_FILE) |
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
- (id)initWithResArchiver:(ResUnarchiver *)coder { | |
if (self) { | |
[coder skip:1u];//type | |
reflexive = (BOOL)[coder decodeSInt8]; | |
[inclusiveFilter setHex:[coder decodeUInt32]]; | |
[exclusiveFilter setHex:[coder decodeUInt32]]; | |
owner = [coder decodeSInt16]; | |
delay = [coder decodeSInt32]; | |
subjectOverride = [coder decodeSInt16]; | |
directOverride = [coder decodeSInt16]; |
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
#define SLICE(value, shift) (int16_t)((value & (0xff << shift)) >> shift) | |
static inline uint32_t pixel_magnitude(uint32 pixel, uint32 color) { | |
int16_t r = SLICE(pixel, 24) - SLICE(color, 24); | |
int16_t g = SLICE(pixel, 16) - SLICE(color, 16); | |
int16_t b = SLICE(pixel, 8) - SLICE(color, 8); | |
return (r*r+g*g+b*b); | |
} | |
#undef SLICE |
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
static uint32_t pixel_magnitude(uint32 pixel, uint32 color) { | |
_m_empty(); | |
__m64 null_ = _m_from_int(0x00000000); | |
__m64 pixel_ = _m_from_int(pixel); | |
pixel_ = _mm_unpacklo_pi8(pixel_, null_); | |
__m64 color_ = _m_from_int(color); | |
color_ = _mm_unpacklo_pi8(color_, null_); | |
pixel_ = _mm_sub_pi16(color_, pixel_); | |
pixel_ = _mm_madd_pi16(pixel_, pixel_); | |
color_ = _mm_srli_si64(pixel_, 32); |
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
// | |
// main.cpp | |
// pictdecoder | |
// | |
// Created by Scott McClaugherty on 9/30/11. | |
// Copyright 2011 __MyCompanyName__. All rights reserved. | |
// | |
#include <iostream> | |
#include <fstream> |
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
//gcc -framework Cocoa ./hdsize.m && ./a.out | |
#import <Cocoa/Cocoa.h> | |
int main(int argc, char *argv[]) { | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
const int width = 100+75; | |
const int height = 400000+100; | |
CGColorSpaceRef cs = CGColorSpaceCreateDeviceRGB(); | |
CGContextRef ctx = CGBitmapContextCreate(NULL, width, height, 5, 2 * width, cs, kCGImageAlphaNoneSkipFirst); | |
CGContextSetRGBFillColor(ctx, 0.0f, 0.0f, 0.0f, 1.0f); |
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
Athena --base/file [--force-dl] [-l/--list] [-c/--check] [--format ares/xsera/lua/dump/antares outfile] | |
Conversion: | |
infile: optional may use base data, may need retrieve from web [forceable] | |
outformat | |
ares | |
xsera | |
lua | |
antares | |
dump |