This file contains hidden or 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
| import tiktoken | |
| import langdetect | |
| T = tiktoken.get_encoding("o200k_base") | |
| length_dict = {} | |
| for i in range(T.n_vocab): | |
| try: | |
| length_dict[i] = len(T.decode([i])) | |
| except: |
This file contains hidden or 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
| —– BEGIN LICENSE —– | |
| Mifeng User | |
| Single User License | |
| EA7E-1184812 | |
| C0DAA9CD 6BE825B5 FF935692 1750523A | |
| EDF59D3F A3BD6C96 F8D33866 3F1CCCEA | |
| 1C25BE4D 25B1C4CC 5110C20E 5246CC42 | |
| D232C83B C99CCC42 0E32890C B6CBF018 | |
| B1D4C178 2F9DDB16 ABAA74E5 95304BEF | |
| 9D0CCFA9 8AF8F8E2 1E0A955E 4771A576 |
This file contains hidden or 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
| // Tutorial: https://weilson.medium.com/go-send-ethereum-transaction-programmatically-infura-io-263d76bfbc50 | |
| package main | |
| import ( | |
| "context" | |
| "encoding/hex" | |
| "fmt" | |
| "log" | |
| "math" |
This file contains hidden or 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
| # Credit for this: Nicholas Swift | |
| # as found at https://medium.com/@nicholas.w.swift/easy-a-star-pathfinding-7e6689c7f7b2 | |
| from warnings import warn | |
| import heapq | |
| class Node: | |
| """ | |
| A node class for A* Pathfinding | |
| """ |
This file contains hidden or 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
| [{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"maxNftSupply","type":"uint256"},{"internalType":"uint256","name":"saleStart","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"in |
This file contains hidden or 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
| [{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"uint256","name":"maxNftSupply","type":"uint256"},{"internalType":"uint256","name":"saleStart","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"in |
This file contains hidden or 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
| // SPDX-License-Identifier: MIT | |
| pragma solidity =0.7.6; | |
| pragma abicoder v2; | |
| import "https://github.com/Uniswap/uniswap-v3-periphery/blob/main/contracts/interfaces/ISwapRouter.sol"; | |
| import "https://github.com/Uniswap/uniswap-v3-periphery/blob/main/contracts/interfaces/IQuoter.sol"; | |
| import {IERC20, SafeERC20} from "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.4-solc-0.7/contracts/token/ERC20/SafeERC20.sol"; | |
| interface IUniswapRouter is ISwapRouter { |
This file contains hidden or 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
| { | |
| "description": "<Your company here>", | |
| "states": [ | |
| { | |
| "name": "Trigger", | |
| "type": "InitialState", | |
| "properties": { | |
| "offset": { | |
| "x": 20, | |
| "y": -170 |
This file contains hidden or 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
| :%s/r//g 删除DOS方式的回车^M | |
| :%s= *$== 删除行尾空白 | |
| :%s/^(.*)n1/1$/ 删除重复行 | |
| :%s/^.{-}pdf/new.pdf/ 只是删除第一个pdf | |
| :%s/<!--_.{-}-->// 又是删除多行注释(咦?为什么要说「又」呢?) | |
| :g/s*^$/d 删除所有空行 :这个好用有没有人用过还有其他的方法吗? |
This file contains hidden or 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
| import numpy as np | |
| import cvxpy as cp | |
| import itertools | |
| # Problem data | |
| global_indices = list(range(4)) | |
| # 0 = TOKEN-0 | |
| # 1 = TOKEN-1 | |
| # 2 = TOKEN-2 |