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
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons" /v 29 /d "%systemroot%\system32\imageres.dll,197" /t reg_sz /f | |
taskkill /f /im explorer.exe | |
attrib -s -r -h "%userprofile%\AppData\Local\iconcache.db" | |
del "%userprofile%\AppData\Local\iconcache.db" /f /q | |
start explorer |
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
Apache License | |
Version 2.0, January 2004 | |
http://www.apache.org/licenses/ | |
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | |
1. Definitions. | |
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. |
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 codecs | |
sql = 'insert into fml(id, author, gender, address, content, date) values(%s, \'%s\', \'%s\', \'%s\', \'%s\', \'%s\');\n' | |
def getPrefix(tx): | |
return tx[tx.rfind('-') + 1: tx.rfind('.')] | |
def getDate(tx): | |
return tx[tx.rfind('/') + 1:tx.rfind('-')].replace('-', '/') |
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
''' | |
@author: John Smith | |
''' | |
class Classifier(object): | |
''' base classifier ''' | |
def __init__(self, **kwargs): | |
pass | |
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
import urllib, urllib2, json | |
def seg(text): | |
data = { 'data': text, 'respond': 'json', 'charset': 'utf-8', 'ignore': 'yes', 'multi': 3 } | |
parm = urllib.urlencode(data) | |
post = urllib2.urlopen(url = 'http://www.ftphp.com/scws/api.php', data = parm, timeout = 10000) | |
response = post.read() | |
data = json.loads(response) | |
return [i['word'] for i in data['words']] |
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 hashlib import md5 | |
def digest(text): | |
h = md5() | |
h.update(text.encode('utf-8')) | |
return h.hexdigest().upper() |
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 sys, math, random | |
import numpy | |
import operator | |
from abstract_classifier import Classifier | |
def shuffle(ary): |
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
# Back-Propagation Neural Networks | |
# | |
# Written in Python. See http://www.python.org/ | |
# Placed in the public domain. | |
# Neil Schemenauer <[email protected]> | |
import math | |
import random | |
import string |
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
/** | |
* Get sorting of query. | |
* | |
* @param {HttpRequest} req | |
* @param {Object} options | |
* - {Boolean} [customizable] | |
* whether the sorting is customizable | |
* i.e. can be pass from query string with the key $sort | |
* e.g. $sort=id,-key | |
* - {String} [defaults] |
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
/** | |
* Get filters of query. | |
* | |
* @param {HttpRequest} req | |
* @param {Object} [options] | |
* - {Boolean} [customizable] | |
* whether the filter is customizable | |
* i.e. can be pass from query string with the key $filter | |
* e.g. $filter=id,key,value | |
* - {Object} [allow] |
NewerOlder