Skip to content

Instantly share code, notes, and snippets.

# coding: utf-8
# # 读取并整理txt
# # 读取txt
# In[15]:
@goldengrape
goldengrape / decorate_with_jit.py
Last active November 24, 2017 07:21
对py使用numba 的@jit进行修饰, 将每一个函数定义之前加入@jit
# coding: utf-8
# # 给所有函数修饰
#
# Numba是一个python的加速器, 最简单的加速方式仅仅是在导入numba以后, 在函数定义之前增加@jit.
#
# 本程序是为了测试简单增加或者消除所有函数前@jit
# In[1]:

Keybase proof

I hereby claim:

  • I am goldengrape on github.
  • I am goldengrape (https://keybase.io/goldengrape) on keybase.
  • I have a public key ASDJ1ImsAzB5_hBAL2UokE8ZOEGUxO_Q3ywvYNraSrKC8go

To claim this, I am signing this object:

{"sig":"82fd2d33255aad1ec54fb69b5a746963c0bd9e8582b636fb86aae26718299352eee3cd6a8573d961031f3604912854918a358411ea5c732f8faf713cc3f0626d0","msghash":"b3e8afaa86b700e272fccefbc03907614e3f8ba581bc28613722f294acad2656"}
@goldengrape
goldengrape / learnmusic.py
Created December 9, 2018 21:17
learnmusic.py
#! python2
# NOTE: The first line in this script specifies that it should always be run using Python 2.7.
# The `midiutil` module is currently not available for Python 3.
'''Generates a MIDI file with 12 random notes in C major, using the midiutil module. The instrument is also picked randomly. The result is then played with the sound.MIDIPlayer class.
If nothing happens, make sure that your device isn't muted.
'''
from midiutil.MidiFile import MIDIFile
@goldengrape
goldengrape / learnmusic.py
Created December 9, 2018 20:43
learnmusic.py
#! python2
# NOTE: The first line in this script specifies that it should always be run using Python 2.7.
# The `midiutil` module is currently not available for Python 3.
'''Generates a MIDI file with 12 random notes in C major, using the midiutil module. The instrument is also picked randomly. The result is then played with the sound.MIDIPlayer class.
If nothing happens, make sure that your device isn't muted.
'''
from midiutil.MidiFile import MIDIFile
import webvtt
import pandas as pd
filename="en.vtt"
time_epsilon=pd.Timedelta('00:00:00.1')
vtt=webvtt.read(filename)
df=pd.DataFrame([[pd.to_datetime(v.start),
pd.to_datetime(v.end),
@goldengrape
goldengrape / test.m3u
Last active July 12, 2019 07:05
a m3u8 test file to play youtube video
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-TARGETDURATION:4000
#EXTINF:15.000000000000002,
https://r5---sn-nx5s7n7s.googlevideo.com/videoplayback?expire=1562934199&ei=VycoXYLZGOKDsfIPo8uAwAM&ip=35.233.227.153&id=o-AN1T-Q-PR_Y7K870UX0sJIWDG0dpcA-orWehY5zAM29t&itag=22&source=youtube&requiressl=yes&mm=31%2C26&mn=sn-nx5s7n7s%2Csn-n4v7knlz&ms=au%2Conr&mv=m&mvi=4&pl=17&initcwndbps=1561250&mime=video%2Fmp4&ratebypass=yes&dur=1024.348&lmt=1538116774878707&mt=1562912515&fvip=5&c=WEB&txp=5531332&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cmime%2Cratebypass%2Cdur%2Clmt&sig=ALgxI2wwRAIgE3G5-ooT4Yv0xd4WsGdywURNcf5LRBY-iQxgaP-EPTgCIBmPwD2o0xjmf2gK7G0nYWhllG8TOt0PStoI034v-wq9&lsparams=mm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AHylml4wRQIhAMvOwuc9rYmecPPPH4Z264CmWw7uks5LRuQ-BeppsOdMAiANyl_afrFXtoC8YTnd55mAwQjVBxk2HLSL6vWXrmBOhg%3D%3D
#EXTINF:29.876600000000003,
https://r3---sn-nx5e6nez.googlevideo.com/videoplayback?expire=1562934200&ei=WCcoXbL2CqKEsfIPnOKR8AE&ip=35.233.227.153&id=o-ANEpAzLGAZD3IyUl-zJ1e2qljkrHGVp
//题目描述
//给定一个数组a[0,...,n-1],求其最大子数组(长度>=1)和
//
//输入描述
//第一行一个整数n(1<=n<=5000),然后依次输入n个整数(每个整数范围[-5000, 5000])
//
//输出描述
//输出一个整数表示最大子数组和
#include <iostream>
#include <assert.h>
Instruction manual
Three-stage, four-stage glass oil diffusion pump
The diffusion pump is an important part of the vacuum system, and it has a wide range of applications in the field of electric light sources.
I. Concept and division of vacuum
II. The state of a gas below 1 atmosphere is usually called vacuum, and the pressure is usually used to indicate the degree of vacuum (vacuum). The unit is Pa (Pa), millimeters of mercury (mmHg), or Torr. It is 1 Torr = 1 mmHg = 1.33x10^2Pa.