Skip to content

Instantly share code, notes, and snippets.

View liu246542's full-sized avatar
🤓
Excited!

FengLiu liu246542

🤓
Excited!
  • China
View GitHub Profile
weights => [87, 100, 91, 93, 91, 96, 92, 80, 89, 81, 90, 98, 81, 89, 89, 91, 89, 95, 82, 83, 98, 83, 95, 86, 84, 40, 70, 3, 65, 66, 40, 4, 80, 71, 35, 32, 14, 45, 100, 37, 90, 96, 12, 46, 30, 14, 55, 8, 46, 18, 74, 38, 76, 73, 70, 3, 16, 93, 48, 15, 53, 96, 9, 47, 43, 46, 95, 37, 59, 22, 10, 18, 11, 60, 9, 41, 77, 6, 49, 80, 15, 6, 6, 92, 42, 79, 82, 3, 70, 65, 16, 49, 68, 12, 52, 52, 74, 77, 72, 64]
values => [85, 82, 38, 91, 71, 69, 95, 75, 76, 11, 56, 87, 50, 42, 52, 58, 100, 29, 21, 72, 4, 31, 81, 40, 39, 55, 67, 74, 83, 86, 56, 37, 57, 41, 1, 100, 78, 20, 1, 35, 48, 58, 42, 7, 92, 42, 62, 28, 83, 48, 44, 93, 72, 13, 68, 88, 68, 94, 39, 44, 96, 98, 64, 60, 43, 59, 37, 22, 99, 7, 88, 7, 34, 18, 27, 38, 50, 38, 32, 37, 31, 31, 28, 75, 27, 27, 62, 20, 25, 13, 11, 44, 6, 32, 4, 100, 71, 34, 63, 45]
init_result => {'solution': 3883, 'choice': [1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1
// ==UserScript==
// @name FRDS
// @namespace http://tampermonkey.net/
// @version 0.1
// @description fix the FRDS download link
// @author Cao
// @include https://pt.keepfrds.com/details.php?id=*
// @grant none
// ==/UserScript==
@liu246542
liu246542 / note.md
Created March 17, 2019 19:47
与弹幕相关

弹幕转换

danmaku2ass -f Bilibili -s 1280x720 -fn "FZHei-B01" -fs 32 -a 0.8 -dm 10 -ds 5 -o ./output.ass ./input.xml

ffmpeg 转码

ffmpeg -i foo.flv -vf output.ass -vcodec libx264 -acodec copy output.flv

@liu246542
liu246542 / test_pair.py
Created March 22, 2019 06:48
论文里面测试代码
from charm.toolbox.pairinggroup import PairingGroup,ZR,G1,G2,GT,pair
def test_pair():
trials = 10
group = PairingGroup("SS512")
h = group.random(G1)
i = group.random(G2)
assert group.InitBenchmark(), "failed to initialize benchmark"
group.StartBenchmark(["CpuTime","RealTime","Pair"])
@liu246542
liu246542 / HW_02.py
Last active March 25, 2019 09:20
第二题的代码参考
import re
import sys
def findChar(string):
upChar = re.compile('[A-Z]')
lowChar = re.compile('[a-z]')
ABCStr = ''.join(sorted(upChar.findall(string)))
abcStr = ''.join(sorted(lowChar.findall(string)))
totalStr = ABCStr + abcStr
@liu246542
liu246542 / 02.py
Created March 27, 2019 14:21
求最短路径的算法
import math
import copy
n = [int(x) for x in input().split(' ')]
#---TEST CASE-----------------------------
# str = '200 0 200 10 200 50 200 30 200 25'
# str = '1 2 2 2 3 1'
# n = [int(x) for x in str.split(' ')]
#---TEST CASE-----------------------------
@liu246542
liu246542 / background.css
Created April 3, 2019 15:28
本科时候的一段代码
background: #58a;
background-image:
linear-gradient(white 2px,transparent 0),
linear-gradient(90deg,white 2px,transparent 0),
linear-gradient(hsla(0,0%,100%,.3) 1px,transparent 0),
linear-gradient(90deg,hsla(0,0%,100%,.3) 1px,transparent 0);
background-size: 75px 75px,75px 75px,15px 15px ,15px 15px;
@liu246542
liu246542 / sublime-extensions.md
Created May 4, 2019 15:01
sublime 上安装的一些插件
  • A file Icon
  • Anaconda
  • Blocak Cursor Everywhere
  • BracketHighlighter
  • HTML-CSS-JS Prettify
  • LaTeXTools
  • MarkdownEditing
  • OmniMarkupPreviewer
  • SublimeGit
  • Gravity
@liu246542
liu246542 / nine_template.html
Last active May 4, 2019 15:03
守序善良-混乱邪恶 九宫格模板
<!DOCTYPE html>
<html>
<head>
<title>九宫图</title>
<meta charset="utf-8">
<style type="text/css">
#content {
background-color: black;
margin: 0 auto 0 auto;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.