Skip to content

Instantly share code, notes, and snippets.

View SeavantUUz's full-sized avatar
💭
I may be slow to respond.

AprocySanae SeavantUUz

💭
I may be slow to respond.
View GitHub Profile

一个本来应该很简单的单词查找树,但是这里的实现有问题,问题是我不知道错在那里,能有大神指出问题所在么?谢过~
A simple trie , but below implement is wrong . Unfortunately I don't know where the error is ... Could You Help Me?Thanks~
头文件

#include <stdlib.h>
#include <string.h>
#define ALPHA 26

typedef struct Node{
    int value;//最后的键值
#user AprocySanae
worker_processes 2;
error_log /home/AprocySanae/error/error.log;
worker_rlimit_nofile 1024;
events
{
use epoll;
worker_connections 65535;
@SeavantUUz
SeavantUUz / gist:7676900
Created November 27, 2013 14:50
tirck codes
def fill_object(items,profiles,*args):
profiles_dict = {}
for profile in profiles:
profiles_dict[profile.id] = profile
for arg in args:
items = map(lambda o:_add_attr(o,profiles_dict,arg),items)
return items
def _add_attr(item,profiles_dict,arg):
profile = profiles_dict.get(item.id)
@SeavantUUz
SeavantUUz / loliweibo.py
Last active January 4, 2016 08:49
loliweibo.py
import requests
import base64
import re
import urllib
import rsa
import json
import binascii
import time
import SocketServer
import logging
@SeavantUUz
SeavantUUz / gist:8916681
Last active August 29, 2015 13:56
fresh to network programming
import socket,select
CONNECTION_LIST = []
RECV_BUFFER = 4096
PORT = 5000
server_socket = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
server_socket.setsockopt(socket.SOL_SOCKET,socket.SO_REUSEADDR,1)
server_socket.bind(("0.0.0.0",PORT))
server_socket.listen(10)
function getPathTo(element) {
if (element.id!=='')
return 'id("'+element.id+'")';
if (element===document.body)
return element.tagName;
var ix= 0;
var siblings= element.parentNode.childNodes;
for (var i= 0; i<siblings.length; i++) {
var sibling= siblings[i];
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="http://cdn.bootcss.com/twitter-bootstrap/2.3.2/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="pull-left">
<p class="muted">向上弹出的子菜单</p>
from BasePool import BasePool
class TaskPool(BasePool):
def __init__(self, *args, **kwargs):
from gevent import spawn_raw
from gevent.pool import Pool
self.Pool = Pool
super(TaskPool, self).__init__(*args, **kwargs)
def on_start(self):
def line_resize(lines, width):
count = len(lines)
index = 0
while index < count:
line = lines[index]
line_lenth = len(line)
if line_lenth > width:
s_width = 0
while s_width < line_lenth:
yield line[s_width:s_width+width]
def func_environment():
env = dict()
def symbol(identify, bp=0, auto_commit = True):
try:
s = env[identify]
except Exception:
class s(Token):
pass
if auto_commit:
s.__name__ = 'symbol-{}'.format(identify)