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
Downloading/unpacking PIL | |
Running setup.py egg_info for package PIL | |
WARNING: '' not a valid package name; please use only.-separated package names in setup.py | |
Installing collected packages: PIL | |
Running setup.py install for PIL | |
WARNING: '' not a valid package name; please use only.-separated package names in setup.py | |
--- using frameworks at /System/Library/Frameworks | |
building '_imaging' extension | |
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/opt/local/include/freetype2 -IlibImaging -I/opt/local/include -I/Users/arthurnn/Envs/myblog/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c _imaging.c -o build/temp.macosx-10.6-universal-2.6/_imaging.o | |
_imaging.c:3017: warning: initia |
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
from PIL import Image | |
import urllib | |
import cStringIO | |
import re | |
import sys | |
URL = sys.argv[1] | |
ratio = 1 | |
size = (1440,900) |
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
/* only output for valid = true */ | |
interface FilterIterator { | |
public boolean hasNext(); | |
public Object next(); | |
} | |
interface Filter { | |
boolean valid(Object o); | |
} |
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 src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
<script> | |
$(document).ready(function(){ | |
var json_Album_URI = "https://picasaweb.google.com/data/feed/base/" | |
+ "user/" + "thewoodsmyth" | |
+ "?alt=" + "json" | |
+ "&kind=" + "album" |
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 threading,thread | |
from lxml import etree, html | |
import urllib | |
from StringIO import StringIO | |
# mapper function | |
def mapper(document): | |
words = document.split() | |
for w in words: |
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 com.arthurnn; | |
import java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.Comparator; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map.Entry; | |
import javax.xml.parsers.DocumentBuilder; |
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 | |
# encoding: utf-8 | |
""" | |
Created by @arthurnn | |
""" | |
import sys | |
import os | |
import fileinput |
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
from mmap import mmap | |
import struct | |
MMAP_OFFSET = 0x44c00000 # base address of registers | |
MMAP_SIZE = 0x48ffffff-MMAP_OFFSET # size of the register memory space | |
CM_PER_BASE = 0x44e00000 - MMAP_OFFSET | |
CM_PER_EPWMSS1_CLKCTRL = CM_PER_BASE + 0xcc | |
CM_PER_EPWMSS0_CLKCTRL = CM_PER_BASE + 0xd4 | |
CM_PER_EPWMSS2_CLKCTRL = CM_PER_BASE + 0xd8 |
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 | |
# -- must be run as root | |
import time | |
# put Port 8 Pin 3 into mode 7 (GPIO) | |
open('/sys/kernel/debug/omap_mux/gpmc_ad6', 'wb').write("%X" % 7) | |
# put Port 8 Pin 4 into mode 7 (GPIO) | |
open('/sys/kernel/debug/omap_mux/gpmc_ad7', 'wb').write("%X" % 7) | |
# Port 9 pin Pin 14 (EHRPWM1A) | |
open('/sys/kernel/debug/omap_mux/gpmc_a2', 'wb').write("%X" % 6) |
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
- (void)fetchMovies | |
{ | |
__block NSString * url = @"http://sg.media-imdb.com/suggests/h/hello.json"; | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ | |
NSMutableURLRequest* request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:url]]; | |
[request setHTTPMethod:@"GET"]; | |
NSHTTPURLResponse *response; | |
NSError *error = nil; |
OlderNewer