Skip to content

Instantly share code, notes, and snippets.

View no1xsyzy's full-sized avatar

Xu Siyuan no1xsyzy

  • SH, China
View GitHub Profile
import re
PATTERN = r"/|(/[^.][^/]*|/[^/][^./][^/]*|/\.\.[^/]+)+/?"
assert re.fullmatch(PATTERN, "/abc/") is not None
assert re.fullmatch(PATTERN, "/abc/../") is None
assert re.fullmatch(PATTERN, "/abc/./") is None
assert re.fullmatch(PATTERN, "/abc/.123/") is not None
assert re.fullmatch(PATTERN, "/abc/a.123/") is not None
assert re.fullmatch(PATTERN, "/abc/a./") is not None
#lang racket
(define (cup volume)
(define amount 0)
(define (pour-in! d)
(let ([old-amount amount])
(if (> (+ old-amount d) volume)
(begin
(set! amount volume)
(- (+ old-amount d) volume))
(begin
# coding:utf-8
import requests
import threading
from queue import Queue, Empty
import time
c_thrd = int(input("请输入要执行的线程数:"))
# 设置队列长度
workQueue = Queue(c_thrd)
# 线程池
threads = []
#lang racket
;;; Solve <https://www.v2ex.com/t/619370>
(define (get-group ipaddr lines)
(define group-name null)
(let/cc return
(map (λ (line)
(cond
[(parse-group-name line)
=> (λ (parsed-group-name)
def deleteorder(x):
n = len(x)
if n%2 != 0:
return
if any(x.count(i) > n//2 for i in set(x)):
return
x = sorted(x)
assert all(x[i] < x[i + n//2] for i in range(n//2))
# since x[0] <= x[1] <= x[2] <= ... <= x[n-1]
# there must be x[i] <= x[i + n//2]
from mitmproxy import http
def request(flow: http.HTTPFlow) -> None:
if 'magicnumber' in flow.request.query:
print(repr(flow.request.query['magicnumber']))
flow.response = flow.response = http.HTTPResponse.make(200)
def response(flow: http.HTTPFlow) -> None:
flow.response.content = flow.response.content.replace(
b"</body>",
import itertools, functools, operator
from typing import *
class Solution:
def singleNumber(self, lst: List[int], k: int) -> int:
pattern = []
for i in itertools.count():
if k & 1 != 0:
pattern.append(i)
k >>= 1
if k == 0:
#lang racket
(define (remove-palindrome s)
(define f
(cachedproc
(lambda (i j)
(cond
[(equal? i j) 1]
[(equal? (+ i 1) j) 1]
;[(and (equal? (+ i 2) j) (equal? (list-ref s i) (list-ref s (- j 1)))) 1]
[(equal? (list-ref s i) (list-ref s (- j 1))) (f (+ i 1) (- j 1))]
((m=>`${m.replace(/([?&])name=[^&]+/, "$1name=orig")} --out=twitter${(x=>x[x.length-1])(window.location.pathname.split("/"))}.${/[&?]format=([^&]+)&/.exec(m)[1]}`)(document.querySelector(`div[data-testid="primaryColumn"] img[src^="https://pbs.twimg.com/media"]`).src))
((ms,f)=>ms.map(f(ms.length>1)).join("\n"))(Array.from(document.querySelectorAll(`div[data-testid="primaryColumn"] img[src^="https://pbs.twimg.com/media"]`)).map(x=>x.src), (l=>{var c=0;return m=>`${m.replace(/([?&])name=[^&]+/, "$1name=orig")} --out=twitter${(x=>x[x.length-1])(window.location.pathname.split("/"))}${l?"-"+("0"+(++c)).slice(-2,100):""}.${/[&?]format=([^&]+)&/.exec(m)[1]}`}))
@no1xsyzy
no1xsyzy / info.md
Created January 21, 2019 15:11
hugetiny/negibox

The project hugetiny/negibox is abusing FOSS projects

The following is a backup of https://github.com/hugetiny/negibox/issues/6 in case deleted.

Using aria2/aria2 without satifying GPLv2 or later version

default You stated that this is based on https://github.com/aria2/aria2, I suppose Negiboxc.exe is actually aria2c.exe. --version option also supports that. Is there any changes and if yes what are they? Where's your source code and license? You haven't even forked aria2. GPLv2 does require extra efforts if you want to put it into your project. GPLv3 even requires more permissions.

Using mayswind/AriaNg without satisfying MIT license