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/python | |
#-*- coding=utf-8 -*- | |
"""用于和地理信息有关的数据处理 | |
""" | |
__author__ = ['"wuyadong" <wuyadong@tigerknows.com>'] | |
import math |
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/python2.7 | |
#-*- coding=utf-8 -*- | |
import shlex | |
import subprocess | |
from tornado.gen import coroutine, Task, Return | |
from tornado.process import Subprocess | |
from tornado.ioloop import IOLoop | |
@coroutine |
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
class AES { | |
public static void main(String[] args) throws NoSuchPaddingException, BadPaddingException, NoSuchAlgorithmException, IllegalBlockSizeException, IOException, InvalidKeyException, Base64DecodingException, InvalidAlgorithmParameterException { | |
String content = "this is a test"; | |
String password = "1234567812345678"; | |
System.out.println("before:" + content); | |
// encrypt | |
String encrypt = encode(content, "1234567812345678", password); | |
System.out.println("encrypt:" + encrypt); |
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 base64 | |
from Crypto.Cipher import AES | |
PADDING = '\0' | |
pad_it = lambda s: s+(16 - len(s) % 16) * PADDING | |
def encrypt(content, iv, key): | |
cipher = AES.new(key, AES.MODE_CBC, iv) |
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 com.shenbian.test; | |
import org.apache.lucene.analysis.Analyzer; | |
import org.apache.lucene.analysis.cn.smart.SmartChineseAnalyzer; | |
import org.apache.lucene.document.Document; | |
import org.apache.lucene.index.DirectoryReader; | |
import org.apache.lucene.index.IndexReader; | |
import org.apache.lucene.queryparser.classic.ParseException; | |
import org.apache.lucene.queryparser.classic.QueryParser; | |
import org.apache.lucene.search.IndexSearcher; |
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/python | |
# -*- coding: utf-8 -*- | |
import threading | |
class KbTerms(object): | |
"""singleton | |
""" | |
_instance_lock = threading.Lock() |
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 com.shenbian.service.personchange.impl.utils; | |
import java.util.*; | |
/** | |
* Trie Tree | |
* @author JobsDong | |
*/ | |
public class TrieTree { |
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 org.apache.http.Header; | |
import org.apache.http.HttpEntity; | |
import java.io.IOException; | |
import java.io.InputStream; | |
import java.nio.ByteBuffer; | |
import java.nio.charset.Charset; | |
import java.util.*; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; |
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 xml.dom import minidom | |
from collections import Mapping | |
from petl.io import RowContainer | |
from lxml import etree | |
def fromxml(source, rowmatch, *args, **kwargs): | |
return XmlView(source, rowmatch, *args, **kwargs) | |
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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: redis-server | |
# Required-Start: $syslog | |
# Required-Stop: $syslog | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: redis-server - Persistent key-value db |
NewerOlder