This file contains hidden or 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 de.zh32.slp; | |
import com.google.gson.Gson; | |
import java.io.ByteArrayOutputStream; | |
import java.io.DataInputStream; | |
import java.io.DataOutputStream; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.OutputStream; |
This file contains hidden or 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
# coding: utf-8 | |
from objc_util import ObjCClass | |
UITextChecker = ObjCClass('UITextChecker') | |
def check_word(word, lang='en_US'): | |
c = UITextChecker.new().autorelease() | |
check = c.rangeOfMisspelledWordInString_range_startingAt_wrap_language_ | |
misspelled_range = check(word, (0, len(word)), 0, False, lang) | |
return (misspelled_range.location != 0) |
This file contains hidden or 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
#covert an image in the clipboard to a 57x57 rgb icon and store base64 version of it into the clipboard. | |
#if an image is not in the clipboard the base64 string 'b64str' will be loaded and displayed. | |
#after running the 1st time replace the contents of b64str with the clipboard. | |
from PIL import Image | |
import clipboard | |
from StringIO import * | |
import base64 | |
b64str=""" |
This file contains hidden or 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
# turtle.py | |
# Basic Turtle graphics module for Pythonista | |
# | |
# When run as a script, the classic Koch snowflake is drawn as a demo. | |
# The module can also be used interactively or from other scripts: | |
# >>> from turtle import * | |
# >>> right(30) | |
# >>> forward(100) | |
# ... |
This file contains hidden or 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 python3 | |
from ctypes import * | |
from objc_util import ObjCClass | |
NSProcessInfo = ObjCClass('NSProcessInfo') | |
NSByteCountFormatter = ObjCClass('NSByteCountFormatter') | |
class c_vm_statistics(Structure): | |
_fields_ = [('free_count', c_uint), | |
('active_count', c_uint), |
This file contains hidden or 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
# coding: utf-8 | |
import urllib | |
import shutil | |
import zipfile | |
from jawa import ClassFile | |
import hashlib | |
import jawa | |
import json | |
import os | |
import sys |
This file contains hidden or 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
------------------------------------------------------------ | |
C:\Python27\Scripts\pip run on 09/14/16 12:31:52 | |
Downloading/unpacking Pillow | |
Getting page https://pypi.python.org/simple/Pillow/ | |
URLs to search for versions for Pillow: | |
* https://pypi.python.org/simple/Pillow/ | |
Analyzing links from page https://pypi.python.org/simple/pillow/ | |
Skipping link https://pypi.python.org/packages/00/15/e776f42afb6d79f27710aded08fd50998174f772621f1cda5d44701be1ed/Pillow-2.1.0-py2.6-win32.egg#md5=0a85404ffb50fff762615a47e6d363e9 (from https://pypi.python.org/simple/pillow/); unknown archive format: .egg | |
Skipping link https://pypi.python.org/packages/00/5a/1807a6341c47d04211ae71e2bdf339ef42bea99429d0fc5f61cf7f57d53d/Pillow-2.8.0-py2.7-win-amd64.egg#md5=48a7745755452bd606d86f951782258b (from https://pypi.python.org/simple/pillow/); unknown archive format: .egg | |
Skipping https://pypi.python.org/packages/00/8b/855afd7da1bb8ec8fb02886834ebb37b766e9ecbc6abe000ae7960ddcaf5/Pillow-2.8.1-cp34-cp34m-macosx_10_6_intel. |
This file contains hidden or 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
{ | |
"types": { | |
"u8": ["native", { | |
"type": "integer" | |
}], | |
"test": ["container", { | |
"virtual": true, | |
"fields": [ | |
{ | |
"name": "tag", |
This file contains hidden or 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 | |
def fix(pixel,d): | |
r =pixel[0] | |
g=pixel[1] | |
b=pixel[2] | |
factor=d/((r+b+g)/4.0) | |
return (int(r*factor),int(g*factor),int(b*factor)) | |
def make(bw,color,size,scale): |
This file contains hidden or 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
morseAlphabet ={ | |
"A" : ".-", | |
"B" : "-...", | |
"C" : "-.-.", | |
"D" : "-..", | |
"E" : ".", | |
"F" : "..-.", | |
"G" : "--.", | |
"H" : "....", | |
"I" : "..", |
OlderNewer