Skip to content

Instantly share code, notes, and snippets.

@c2nes
c2nes / sources.conf
Created November 11, 2011 16:19
SVR Sources Configuration
# Test source
cam0 = cam:
cam1 = file:path=/home/christopher/downloads/bright_bottom_spots2.avi
test = test:
#test = test:width=640,height=480,rate=50
@c2nes
c2nes / dumpjson.py
Created February 23, 2012 01:05
Convert Wikipedia XML dump to JSON
#!/usr/bin/env python
import os
import sys
SOURCE_FILE = "/home/cmthunes/enwiki-20120211-pages-meta-current.xml"
OUTPUT_FILE = "/mnt/reports/cmthunes/enwiki-20120211.json"
def extract_with_delims(s, start_delim, end_delim):
start_index = s.find(start_delim)
@c2nes
c2nes / VerifyLinksJob.java
Created April 18, 2012 21:26
5 Clicks to Jesus demo
package edu.ncsu.sdc.wikisearch.jobs;
import java.io.*;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.io.*;
import org.apache.hadoop.mapreduce.*;
import edu.ncsu.sdc.wikisearch.tables.*;
[cmthunes@bc1b3 wikisearch]$ ./wikisearch rpn arithmetic addition enter hp
Select done.
Categorize done.
Articles:
0.0099 HP-10
0.0093 Elementary operations
0.0076 List of WebOS devices
0.0072 HP BASIC
0.0066 HP Deskjet F300 all-in-one series
@c2nes
c2nes / emacs.el
Created May 2, 2012 23:05
.emacs
;; .emacs
;; Kill those stupid startup messages
(setq inhibit-startup-message t)
;; Disable menubar, toolbar, and scrollbars
(menu-bar-mode -1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
import sys
class Balance(object):
def __init__(self, ident):
# Balance identifer
self.ident = ident
# Left/right hand weights
self.wl = 0
@c2nes
c2nes / sync_to_player.py
Created August 26, 2012 20:28
For syncing music to a MP3 player from clementine
#!/usr/bin/env python
import hashlib
import os
import os.path
import shutil
import sys
import urllib
import sqlite3
@c2nes
c2nes / sync_to_player_pls.py
Created August 26, 2012 20:41
Sync PLS file to MP3 player
#!/usr/bin/env python
import hashlib
import os
import os.path
import shutil
import sys
import urllib
import sqlite3
@c2nes
c2nes / java_grammar.txt
Created September 18, 2012 14:26
Java grammar extracted from JavacParser.java in the OpenJDK 7
Ident:
IDENTIFIER
Qualident:
Ident { DOT Ident }
Literal:
INTLITERAL
| LONGLITERAL
| FLOATLITERAL
diff --git a/src/Makefile b/src/Makefile
index 46fa431..9a9166d 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -16,7 +16,7 @@ OBJ = $(SRC:.c=.o)
all: $(LIB_FILE)
$(LIB_FILE): $(OBJ)
- $(CC) $(LDFLAGS) $(LIB_LDFLAGS) $(OBJ) -o $(LIB_FILE)
+ $(CC) $(OBJ) -o $(LIB_FILE) $(LIB_LDFLAGS) $(LDFLAGS)