ReZero's Utopia.

ReZero's Utopia.

Everything is permitted.

如何写一个简易的爬虫
如何写一个简易的爬虫基本概念有言在先本文只是新手文,望各位指正 本文图片之类链接打不开,可直接科学上网走外链,参考 原博文 啥是爬虫按一定规则,遵循协议实现的请求模拟接口。 学会爬虫的好处 了解一些法律常识 吃牢饭 学习 web 相关的基础知识 推荐阅读robots 协议 Requests 官网文档 大才哥的 Blog Scrapy 官网文档 基础12with open('/usr/bin/ls', 'w') as f: f.write(parse(request.get("http://api.com?id=1' or 1='1))) 上面是一个基础爬虫的所有内容,包括了...
如何写一个简易的chrome插件
如何写一个简易的chrome插件推荐阅读https://developer.chrome.com/extensions/getstarted 推荐阅读官方文档,本文只做简单的演示。 本文图片之类链接打不开,可直接科学上网走外链,参考 原博文 概念介绍基本配置 manifest.json 可以类比 AndroidManifest,几乎所有的项目都会有一个主配置文件,用来配置全局的基本信息和属性来保证系统的基本启动运行,该文件为 chrome plugin 主配置文件。基于浏览器插件考虑所占体积这个特性,几乎所有关键的配置属性信息都可以在此找到,除了名称,版本等必要的信息,尤为值得关注...
Request record
https://github.com/ReZeroS/request-record This post is used to explain how to write the plugin: request-record.I got a mission this week to record all api from function requests in our system. I have finished it, but I still wanna to write a plugin to simplify this work. Well, it maybe does not w...
KMP
How to calc the next array. Calc the max length of suffix and prefix as follows: string a b a a b c a b a length 0 0 1 1 2 0 1 2 3 next -1 0 0 1 1 2 0 1 2 As you can see, the next array is the suffix equals prefix length array move on one step and init the first values as -1. 1234567...
Mybatis collection mapping
123456789101112131415161718192021222324252627282930313233343536373839<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" ><mapper namespace="com.hand.persistence.AttachmentTypeLjMapper">...
liquibase
As Liquibase executes the databaseChangeLog, it reads the changeSets in order and, for each one, checks the “databasechangelog” table to see if the combination of id/author/filepath has been run. If it has been run, the changeSet will be skipped unless there is a true “runAlways” tag. After all ...
Add Digits
Since 10^{i}$ \equiv 1(mod 9) ,then =>(a_{i}$ * 10^{i}$ + a_{i-1}$ * 10^{i-1}$ + …) mod 9 = (a_{i}$ * 10^{i}$ mod 9 + a_{i-1}$ * 10^{i-1}$ mod 9 + …) mod 9= (a_{i}$ + a_{i-1}$ + …) mod 9 https://leetcode.com/problems/add-digits/discuss/68580/Accepted-C%2B%2B-O(1)-time-O(1)-space-1-Line-Solutio...
Power of Two
Given an integer, write a function to determine if it is a power of two. 123bool isPowerOfTwo(int n) { return n > 0 && !(n&(n-1));} Explain: 100 & 011 = 0 Try think about power of 4: return num > 0 && (num & (num - 1)) == 0 && (num - 1) % 3 ...
Implement Stack using Queues
Implement the following operations of a stack using queues. 1234567891011121314151617181920212223242526272829303132333435363738394041424344class MyStack {public: queue<int> q; /** Initialize your data structure here. */ MyStack() { } /** Push element x ...
reverse the bits
Input: 00000010100101000001111010011100 Output: 00111001011110000010100101000000 Explanation: The input binary string 00000010100101000001111010011100 represents the unsigned integer 43261596, so return 964176192 which its binary representation is 00111001011110000010100101000000. https://l...
avatar
ReZero
大屁水饺的理想国.