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 requests | |
import logging | |
METHOD_GET = 'GET' | |
METHOD_POST = 'POST' | |
RETURN_TEXT = 'TEXT' | |
RETURN_BINARY = 'BINARY' | |
RETURN_JSON = 'JSON' | |
RETURN_RAW = 'RAW' |
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
# Created by SylvanasSun in 2017.10.17 | |
# !/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import collections | |
import jieba | |
from jieba import analyse | |
# TODO: Change default hash algorithms to the other algorithms of high-performance. |
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 java.util.Iterator; | |
import java.util.NoSuchElementException; | |
import java.util.Random; | |
/** | |
* A skip list is a data structure that allows fast search within | |
* an ordered sequence of elements. Fast search is made possible | |
* by maintaining a linked hierarchy of subsequences, with each | |
* successive subsequence skipping over fewer elements than the | |
* previous one. Searching starts in the sparsest subsequence until |
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
/** | |
* Interface PackageScanner is the basic interface for package scanning. | |
* | |
* Created by SylvanasSun on 10/13/2017. | |
*/ | |
public interface PackageScanner { | |
/** | |
* Scanning specified package then return a class list of the after the scan. | |
*/ |
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
#include <stdio.h> | |
#include <math.h> | |
typedef struct { | |
const char *name; | |
int rank; | |
double expect_rate; | |
} girl; | |
const int K = 10; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "log4j.dtd"> | |
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> | |
<!-- 输出日志到控制台 ConsoleAppender --> | |
<appender name="console" | |
class="org.apache.log4j.ConsoleAppender"> | |
<param name="encoding" value="UTF-8"/> | |
<layout class="org.apache.log4j.TTCCLayout"> | |
<param name="ConversionPattern" value="TTCCLayout"/> |
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 java.util.*; | |
/** | |
* The {@code RedBlackTree} class represents an ordered symbol table of generic | |
* key-value pairs. | |
* This implements uses a left-leaning red-black Binary Search Tree. | |
* | |
* Created by SylvanasSun on 2017/6/1. | |
* | |
* @author SylvanasSun |
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 java.util.Iterator; | |
import java.util.NoSuchElementException; | |
import java.util.concurrent.atomic.AtomicInteger; | |
import java.util.concurrent.atomic.AtomicReference; | |
/** | |
* This class represents a thread-safe stack and use CAS instruction to ensure thread safe. | |
* | |
* Created by SylvanasSun on 2017/5/29. | |
* |
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 java.util.*; | |
/** | |
* The {@code LinearProbingHashST} class represents a symbol table of generic | |
* key-value paris. | |
* This implementation uses a linear probing hash table. | |
* It requires that the key type overrides the {@code equals()} and {@code hashCode()} methods. | |
* <p> | |
* Created by SylvanasSun on 2017/4/11. | |
*/ |
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 chapter3_searching.C3_3_BalancedSearchTrees; | |
import edu.princeton.cs.algs4.Queue; | |
import java.util.NoSuchElementException; | |
import java.util.Scanner; | |
/** | |
* The {@code AvlTree} class represents an ordered symbol table of generic | |
* key-value pairs. |
NewerOlder