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
$ python appcfg.py update gaetalk/ | |
07:13 PM Host: appengine.google.com | |
2013-05-20 19:13:18,426 WARNING appinfo.py:1158 The datastore_admin builtin is deprecated. You can find information on how to enable it through the Administrative Console here: http://developers.google.com/appengine/docs/adminconsole/datastoreadmin.html | |
07:13 PM Application: nii-chinese; version: v3 | |
07:13 PM | |
Starting update of app: nii-chinese, version: v3 | |
07:13 PM Getting current resource limits. | |
Email: YOUR_ADMIN_EMAIL | |
Password for YOUR_ADMIN_EMAIL: |
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 python | |
#coding:utf-8 | |
import os,time,socket | |
import urllib,re | |
urlList = ['http://jandan.net/ooxx/page-%d' % i for i in range(1, 911)] | |
globnum = 1 |
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
#!/user/bin/python | |
#-*-coding:utf8-*- | |
import os, sys, time | |
import pygame, pygame.camera, pygame.font | |
from pygame.locals import * | |
resolution = (640, 480) | |
devicePath = "/dev/video0" | |
IMG = './shot.jpg' |
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
http://www.oschina.net/translate/integrating-ext-js-with-3rd-party-libraries?print | |
http://stackoverflow.com/questions/16514883/expand-collapse-a-div-element | |
http://jsfiddle.net/Xotic750/FLUKR/ | |
http://www.showframework.com/2012/06/extjs-4-getting-started/ | |
http://docs.sencha.com/extjs/4.2.1/#!/guide/mvc_pt3 |
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
SELECT deviceTable.ID, ed.measure_time, ed.value | |
FROM ( | |
SELECT (CASE WHEN d2.id IS NULL THEN d1.id ELSE d2.id END) AS ID | |
FROM device d1 | |
LEFT JOIN device d2 ON d2.owner=d1.id | |
WHERE d1.parent=11 AND d1.owner IS NULL AND d1.is_active=1 AND d1.is_excluded=0 ) AS deviceTable | |
JOIN electricity_data ed ON ed.device_id = deviceTable.ID | |
Where ed.measure_time BETWEEN '2013-05-18 00:00:00' AND '2013-05-20 23:59:59' | |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
// Compile list of tokens based on deletions, and respecting max edit distance | |
// Original implementation would concatenate left/right string segments using memcpy() etc, but that didn't seem right | |
// The idea is, to instead partition S into 1+ segments and build hash from them, no need for memory copies etc. | |
// This is almost x8 times faster compared to that - but it's still in the 10s of microseconds range. | |
// | |
// ( for a 31 characters long string, with max edit distance = 2, it takes 24 microseconds, including the cost for computing the FNV rolling hash ) | |
#include <switch.h> | |
#include <switch_print.h> | |
#include <ansifmt.h> |
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
<?php | |
define('APP_PATH', dirname(__FILE__)); | |
define('DATA_FILE', APP_PATH. '/sms.htdata'); | |
if ($_SERVER['REQUEST_METHOD'] == 'POST') { //tasker提交 | |
if (!isset($_POST['c'])) { | |
die('Invalid Request!'); | |
} else { | |
$data = ''; | |
if (file_exists(DATA_FILE)) { //读入已有数据 |
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
func createGIF(with images: [UIImage], loopCount: Int = 0, frameDelay: Double, callback: (data: NSData?, error: NSError?) -> ()) { | |
let fileProperties = [kCGImagePropertyGIFDictionary as String: [kCGImagePropertyGIFLoopCount as String: loopCount]] | |
let frameProperties = [kCGImagePropertyGIFDictionary as String: [kCGImagePropertyGIFDelayTime as String: frameDelay]] | |
let documentsDirectory = NSTemporaryDirectory() | |
let url = NSURL(fileURLWithPath: documentsDirectory)?.URLByAppendingPathComponent("animated.gif") | |
if let url = url { | |
let destination = CGImageDestinationCreateWithURL(url, kUTTypeGIF, UInt(images.count), nil) | |
CGImageDestinationSetProperties(destination, fileProperties) |