- 麻雀
- 风神翼龙
- 棘龙
- 智人
- 灰长臂猿
- 眼镜猴
- 日本真鲈
- 紫纹海刺水母
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
use hex_literal::hex; | |
use image::{DynamicImage, GenericImageView, Pixel}; | |
use rayon::prelude::*; | |
use std::fs; | |
use std::fs::File; | |
use std::io::{BufRead, BufReader}; | |
use std::path::Path; | |
use std::sync::atomic::{AtomicUsize, Ordering}; | |
use std::sync::mpsc::channel; | |
use std::sync::Arc; |
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
Manipulate[Module[{tFn$, edges3d$, newEdges$}, | |
tFn$ = Module[{rotated$}, rotated$ = rotate4D[#1, {{x\[Alpha], x\[Beta], x\[Gamma]}, {y\[Alpha], y\[Beta], y\[Gamma]}, {z\[Alpha], z\[Beta], z\[Gamma]}, {w\[Alpha], w\[Beta], w\[Gamma]}}]; | |
perspectiveProject4[rotated$ - {cx, cy, cz, cw}, d]] & ; newEdges$ = ({tFn$[#1[[1]]], tFn$[#1[[2]]]} & ) /@ edges; | |
Graphics3D[{Thickness[Large], (Line[#1] & ) /@ newEdges$}, PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}*Sqrt[1 + 1 + 1 + 1]]], {x\[Alpha], 0, 2*Pi}, | |
{x\[Beta], 0, 2*Pi}, {x\[Gamma], 0, 2*Pi}, {y\[Alpha], 0, 2*Pi}, {y\[Beta], 0, 2*Pi}, {y\[Gamma], 0, 2*Pi}, {z\[Alpha], 0, 2*Pi}, {z\[Beta], 0, 2*Pi}, {z\[Gamma], 0, 2*Pi}, {w\[Alpha], 0, 2*Pi}, | |
{w\[Beta], 0, 2*Pi}, {w\[Gamma], 0, 2*Pi}, {{cx, 0}, -10, 10}, {{cy, 0}, -10, 10}, {{cz, 0}, -10, 10}, {{cw, 5.65}, -10, 10}, {{d, 5.59}, 0.1, 10}, | |
Initialization :> {rotate4D[p_, {x_List, y_List, z_List, w_List}] := Module[{m1, m2, m3, m4}, m1 = r4x /. {\[Alpha] -> x[[1]], \[Beta] -> x[[2]], \[Gamma] -> x[[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
use bigdecimal::num_traits::ops::overflowing::OverflowingAdd; | |
use rand::{thread_rng, RngCore}; | |
use std::iter::{Map, Sum}; | |
use std::ops::Add; | |
pub struct OverflowingAddWrapper<T: OverflowingAdd>(pub T); | |
impl<T: OverflowingAdd> From<T> for OverflowingAddWrapper<T> { | |
fn from(value: T) -> Self { | |
Self(value) |
https://github.com/bczhc/cpp/blob/066e0c5a6dad6415a888db0600cead5cc2747572/concurrent.cpp#L92-L120
以前在C++里写的一堆一堆,在Rust里再没用到过。一切都是自造轮子,翻看以前的C++代码,也能让我甚是怀念。
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
use bigdecimal::num_traits::Euclid; | |
use bigdecimal::{ToPrimitive, Zero}; | |
use num_bigint::BigUint; | |
fn main() { | |
let mut sum = BigUint::ZERO; | |
let mut fib_fn = |n: &BigUint, fib: &BigUint| { | |
// println!("{n} {fib}"); | |
sum += fib; |
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
use bitcoin::{OutPoint, Script}; | |
use bitcoin_demo::{extract_op_return, han_char, new_parser, EncodeHex}; | |
use chrono::TimeZone; | |
use rusqlite::{params, Connection}; | |
fn main() { | |
let mut db = Connection::open("./op-return-messages.db").unwrap(); | |
db.execute( | |
r#"create table if not exists op_return_msg | |
( |
从https://gist.github.com/bczhc/0d985a8a6864d9bcb8e1d060f0fd25dd 看到一个有意思的,有位用户在链上通过OP_RETURN放入了一张AVIF图片。
https://mempool.space/address/bc1q3ez0mu6q3y59emtl2nweeevnhu7ualvu3ylapp
其中OP_RETURN内容为可打印文本的两条交易为:
- https://mempool.space/tx/9213e2aaadc2e634ae638795d3dd5cc302d4663e40bd72891acc98d7d65e81c5
按Order顺序拼接HEX(1688B),用WinHex等还原为谢芃芃20241019.avif
- https://mempool.space/tx/6ec3d8efdd81bc858685afa889718052fb04e61a1822c7c7b3d77e7e9295f02b
Order0000-61-0001-40-5F-9-B-FD0-2F-4B-8-FDB-56-1C-3-5C-14-6F-E8-E0-25-F4-1E
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
#![feature(yeet_expr)] | |
use crate::reward::LocalStorage; | |
use bitcoin::{Amount, Network, OutPoint, ScriptBuf, TestnetVersion}; | |
use bitcoin_hashes::Hash; | |
use bitcoincore_rpc::{Auth, Client, RpcApi}; | |
use log::{debug, info}; | |
use once_cell::sync::Lazy; | |
use std::io; | |
use std::ops::AddAssign; |
NewerOlder