This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from langchain.agents import load_tools, initialize_agent, AgentType | |
from langchain.chat_models import ChatOpenAI | |
from functools import wraps | |
# 设置全局资源量 | |
autogpt_resources = 50 | |
# 资源限制器修饰器 | |
def resource_limiter(resource_cost): | |
global autogpt_resources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def time_threshold(): | |
t = 60 | |
tmin=5 | |
tmax=120 | |
while True: | |
value = yield t | |
if value: | |
t = max(t/2,tmin) | |
else: | |
t = min(t+10,tmax) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 | |
00:00:01.600 --> 00:00:05.640 | |
今天艾米丽将向你展示她huff咳嗽的技巧 | |
2 | |
00:00:06.080 --> 00:00:09.320 | |
huff咳嗽是清除肺部粘液的一种方法 | |
3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sympy import * | |
a,b, x = symbols('b a x') # here, swap a and b, bug | |
f = a*x**2 + b*x | |
sub_dict={a:1,b:2,x:3} | |
print(f) | |
print(f.subs(sub_dict)) | |
print(eval(f.__str__()).subs(sub_dict)) | |
# output: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TargetInvocationException: 调用的目标发生了异常。 | |
在 System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) | |
在 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) | |
在 System.Activator.CreateInstance(Type type, Boolean nonPublic) | |
在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) | |
在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) | |
在 System.Activator.CreateInstance(Type type, Object[] args, Object[] activationAttributes) | |
在 ZOSAPI.ZOSAPI_Connection.CreateApp(ZOSAPI_Connection connection, Int32 processId, Boolean wrap, Object[] args) | |
在 ZOSAPI.ZOSAPI_Connection.ConnectToAppByProcess(Int32 processId, Boolean wra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.cpp | |
// crop_video | |
// | |
// Created by GoldenGrape on 2020/6/6. | |
// Copyright © 2020 goldengrape. All rights reserved. | |
// | |
#include <iostream> | |
#include <algorithm> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
import pysubs2 | |
import re | |
from stardict import DictCsv | |
# depend on https://github.com/skywind3000/ECDICT/ | |
dict_filename="ecdict.csv" | |
sub_filename="01sub.srt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##| 经典house节奏 | |
##| 根据learningmusic.ableton.com课程 | |
##| https://learningmusic.ableton.com/zh/make-beats/make-beats.html | |
use_random_seed 10 | |
open_hat_beat= | |
[0,0,1,0, | |
0,0,0,0, | |
0,0,0,0, | |
0,0,0,0].ring |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##| modify from | |
# Band Example 2 | |
# Mehackit 2016 | |
##| http://sonic-pi.mehackit.org/exercises/chs/11-templates/03-band-example.html | |
use_bpm 120 | |
live_loop :rummut do | |
sample :drum_heavy_kick | |
sleep 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##| 五线谱字典 | |
##| 低音谱号数得恼火 | |
def look_up_staff(clef,pos) | |
ns=["C","D","E","F","G","A","B"].ring | |
s_T=scale(:C4,:major,num_octaves: 2) | |
if clef.downcase == "treble" or clef.downcase=="t" | |
idx=((pos-(-1))*2).to_i | |
octave=(idx/7).to_i+4 | |
name=ns[idx]+octave.to_s |