Skip to content

Instantly share code, notes, and snippets.

😁
Focusing

YieldNull

😁
Focusing
Block or report user

Report or block YieldNull

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@YieldNull
YieldNull / sock_fork.py
Last active Apr 15, 2020
Fork processes to handle TCP requests.
View sock_fork.py
import os
import socket
def main():
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind(('127.0.0.1', 9999))
sock.listen()
@YieldNull
YieldNull / readme.md
Last active Sep 29, 2019
爬取新浪微博中指定用户所有相册图片,并保存到本地
View readme.md

功能

给定用户的ID(微相册的数字ID,非昵称),下载用户相册中所有图片到本地

所需模块

rsa,threadpool

登陆

请先更改login_weibo中的用户名及密码

用法

@YieldNull
YieldNull / multithread_logging.py
Last active Jan 4, 2019
multithread_logging.py
View multithread_logging.py
import sys
import logging
from multiprocessing.pool import Pool
logging.basicConfig(stream=sys.stdout, level=logging.INFO,
format='%(asctime)s - %(processName)s %(threadName)s - %(name)s - %(levelname)s - %(message)s')
if __name__ == "__main__":
def job(name):
logger = logging.getLogger(name)
View ScalaInMemoryCompiler.scala
import scala.tools.nsc.{Global, Settings}
import scala.reflect.internal.util.BatchSourceFile
import tools.nsc.io.{VirtualDirectory, AbstractFile}
import scala.reflect.internal.util.AbstractFileClassLoader
import java.security.MessageDigest
import java.math.BigInteger
import collection.mutable
import java.io.File
object CompileTest {
@YieldNull
YieldNull / multi_downloader.py
Created Nov 8, 2018
A Multithread Downloader
View multi_downloader.py
import os
import logging
import requests
from multiprocessing.pool import ThreadPool
from multiprocessing import Queue
def download(task_file, repository, pool_size=8):
logger = logging.getLogger('downloader')
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
@YieldNull
YieldNull / readme.md
Created Nov 17, 2015
备份QQ空间说说
View readme.md

#功能 备份QQ空间说说(先用浏览器登陆获取Cookie)

#用法 先将Cookie及用户写入config.json中,格式如下

{
	"shuoshuo":"<shuoshuo_cookie>",
	"friends":"<friends_cookie>",
@YieldNull
YieldNull / R2LParser.c
Created Nov 1, 2015
Recognize C Pointer Declaration(识别C语言指针表达式)
View R2LParser.c
/*
* R2LParser.c
*
* Recognize C declaration use Right-Left Method(from http://ieng9.ucsd.edu/~cs30x/rt_lt.rule.html)
*
* The "right-left" rule is a completely regular rule for deciphering C
* declarations. It can also be useful in creating them.
*
* First, symbols. Read
* * as "pointer to" - always on the left side
@YieldNull
YieldNull / CParser.jj
Created Oct 27, 2015
C grammar defintion for use with JavaCC.(Copied from https://java.net/downloads/javacc/contrib/grammars/C.jj)
View CParser.jj
/*
C grammar defintion for use with JavaCC
Contributed by Doug South (dsouth@squirrel.com.au) 21/3/97
This parser assumes that the C source file has been preprocessed : all
#includes have been included and all macros have been expanded. I accomplish
this with "gcc -P -E <source file> > <output file>".
There is a problem with compiler specific types, such as __signed, __const,
@YieldNull
YieldNull / WHU.java
Last active Apr 14, 2017
登陆武汉大学教务系统
View WHU.java
package whu;
import java.awt.*;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.HashMap;
View msdn.py
#!/usr/bin/env python
# coding:utf-8
"""
A 'Crawler' for http://msdn.itellyou.cn/
"""
import re
import urllib
import urllib2
You can’t perform that action at this time.