Skip to content

Instantly share code, notes, and snippets.

View smatthewenglish's full-sized avatar
🙌

Sean Matt smatthewenglish

🙌
View GitHub Profile
This file has been truncated, but you can view the full file.
time="2024-05-29T14:10:36-04:00" level=info msg="starting tps monitor"
time="2024-05-29T14:10:36-04:00" level=info msg="prometheus service created."
time="2024-05-29T14:10:36-04:00" level=info msg="consensus is ibft"
time="2024-05-29T14:10:36-04:00" level=info msg="prometheus service started"
time="2024-05-29T14:10:36-04:00" level=info msg="tps monitor started"
time="2024-05-29T14:10:36-04:00" level=info msg="tps monitor waiting to stop"
time="2024-05-29T14:10:36-04:00" level=info msg="started tps monitor server at port 7575"
time="2024-05-29T14:10:37-04:00" level=info msg="received new block block{ number:224, txns:0, time:1717006236, gasLimit:700000000, gasUsed:0}"
time="2024-05-29T14:10:37-04:00" level=info msg="received new block block{ number:225, txns:0, time:1717006237, gasLimit:700000000, gasUsed:0}"
time="2024-05-29T14:10:38-04:00" level=info msg="received new block block{ number:226, txns:0, time:1717006238, gasLimit:700000000, gasUsed:0}"
This file has been truncated, but you can view the full file.
time="2024-05-29T17:53:57-04:00" level=info msg="starting tps monitor"
time="2024-05-29T17:53:57-04:00" level=info msg="prometheus service created."
time="2024-05-29T17:53:57-04:00" level=info msg="consensus is ibft"
time="2024-05-29T17:53:57-04:00" level=info msg="prometheus service started"
time="2024-05-29T17:53:57-04:00" level=info msg="tps monitor started"
time="2024-05-29T17:53:57-04:00" level=info msg="tps monitor waiting to stop"
time="2024-05-29T17:53:57-04:00" level=info msg="started tps monitor server at port 7575"
time="2024-05-29T17:53:58-04:00" level=info msg="received new block block{ number:75, txns:0, time:1717019637, gasLimit:700000000, gasUsed:0}"
time="2024-05-29T17:53:58-04:00" level=info msg="received new block block{ number:76, txns:0, time:1717019638, gasLimit:700000000, gasUsed:0}"
time="2024-05-29T17:53:59-04:00" level=info msg="TPS:0 txnsCnt:0 blkCnt:2"
{
"nonce": "0x0",
"timestamp": "0x58ee40ba",
"extraData": "0xf87aa00000000000000000000000000000000000000000000000000000000000000000f854942ab6b63f2e24b547b0fa1e02be14c2f875062d34946a26cbb8613fa1d646c09db5084323800ce1054d947aba92ee9e8557746ddff5327d9b21bccc7a498794a4738a8987ea927ebb6ed61ab698d2b5a5ef80ebc080c0",
"gasLimit": "0x29b92700",
"gasUsed": "0x0",
"number": "0x0",
"difficulty": "0x1",
"coinbase": "0x0000000000000000000000000000000000000000",
"mixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365",
{
"nonce": "0x0",
"timestamp": "0x58ee40ba",
"extraData": "0xf87aa00000000000000000000000000000000000000000000000000000000000000000f85494bac71bb015b84916f145549a873a980b9720c11094ae2620ccf5b852e2208c82810e40a834b128cf6e94bcb5bf13ce033a21459397d12a9e7b46066a02e39452351cad346ab2f1599b494bf8f4c6ea44c77563c080c0",
"gasLimit": "0x29b92700",
"gasUsed": "0x0",
"number": "0x0",
"difficulty": "0x1",
"coinbase": "0x0000000000000000000000000000000000000000",
"mixHash": "0x63746963616c2062797a616e74696e65206661756c7420746f6c6572616e6365",
/**
* The time complexity of the code is O(n^2), due to the nested stream operation.
*/
class Solution {
@Test
void test() {
List<Integer> departures = new ArrayList<>(Arrays.asList(26, 19, 19, 4, 4));
List<Integer> returns = new ArrayList<>(Arrays.asList(29, 26, 28, 19, 25));
from matplotlib import pyplot as plt
import matplotlib
from matplotlib.patches import Rectangle, Arrow
import matplotlib.lines as mlines
# UML Sequence Diagram for NFT Transaction Broadcast System
# Configurations
fig, ax = plt.subplots(figsize=(12, 8))
ax.set_xlim(0, 10)
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode() {}
* TreeNode(int val) { this.val = val; }
* TreeNode(int val, TreeNode left, TreeNode right) {
* this.val = val;
/**
* Definition for a binary tree node.
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode() {}
* TreeNode(int val) { this.val = val; }
* TreeNode(int val, TreeNode left, TreeNode right) {
* this.val = val;
@smatthewenglish
smatthewenglish / 0.java
Created November 1, 2023 16:14
501. Find Mode in Binary Search Tree
Given the root of a binary search tree (BST) with duplicates, return all the mode(s) (i.e., the most frequently occurred element) in it.
If the tree has more than one mode, return them in any order.
Assume a BST is defined as follows:
The left subtree of a node contains only nodes with keys less than or equal to the node's key.
The right subtree of a node contains only nodes with keys greater than or equal to the node's key.
Both the left and right subtrees must also be binary search trees.
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.7.6;
pragma abicoder v2;
import {Test, console2} from "forge-std/Test.sol";
import {UniswapV3Twap, IUniswapV3Pool} from "../src/UniswapV3Twap.sol";
import {TickMath} from "@uniswap/v3-core/contracts/libraries/TickMath.sol";
import {FullMath} from "@uniswap/v3-core/contracts/libraries/FullMath.sol";
import {FixedPoint96} from "@uniswap/v3-core/contracts/libraries/FixedPoint96.sol";