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
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 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 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 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 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 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 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 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 |
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
class api_route(object): | |
"""api的包装器 | |
Attributes: | |
_api_methods: 字典,key是路径名,value是函数对象 | |
""" | |
_api_methods = {} | |
def __init__(self, uri): |
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
""" | |
Scrapy Item | |
See documentation in docs/topics/item.rst | |
""" | |
from pprint import pformat | |
from UserDict import DictMixin | |
from scrapy.utils.trackref import object_ref |
NewerOlder