Skip to content

Instantly share code, notes, and snippets.

View SylvanasSun's full-sized avatar

SylvanasSun SylvanasSun

  • Tianjin,China
View GitHub Profile
@SylvanasSun
SylvanasSun / girl_face_match.c
Created July 16, 2017 16:30
The algorithms from the movie <<The Social Network>>.
#include <stdio.h>
#include <math.h>
typedef struct {
const char *name;
int rank;
double expect_rate;
} girl;
const int K = 10;
@SylvanasSun
SylvanasSun / PackageScanner.java
Created October 14, 2017 12:15
Package Scanner
/**
* 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.
*/
@SylvanasSun
SylvanasSun / SkipList.java
Last active March 25, 2024 03:00
A simple implementation of the Skip List.
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
@SylvanasSun
SylvanasSun / simhash.py
Created January 30, 2018 10:57
In computer science, SimHash is a technique for quickly estimating how similar two sets are. The algorithm is used by the Google Crawler to find near duplicate pages. It was created by Moses Charikar.
# 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.
@SylvanasSun
SylvanasSun / http_utils.py
Created February 6, 2018 09:48
Some utils in common use of python
import requests
import logging
METHOD_GET = 'GET'
METHOD_POST = 'POST'
RETURN_TEXT = 'TEXT'
RETURN_BINARY = 'BINARY'
RETURN_JSON = 'JSON'
RETURN_RAW = 'RAW'