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 std::collections::BTreeMap; | |
#[macro_use] | |
extern crate bma_benchmark; | |
// here Arc<String> is wanted to be used but for small depth Arc provides additional overhead and | |
// results are lower | |
#[derive(Default)] | |
struct Tree(BTreeMap<String, Tree>); |
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 bma_benchmark import benchmark | |
def tags_to_tree(tags): | |
def fill_tags_tree_recursive(tag, tree): | |
ch = tag.split('.', maxsplit=1) | |
if len(ch) == 1: | |
tree[tag] = {} | |
else: |
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
import { useMemo } from "react"; | |
import { | |
get_engine, | |
useEvaStateHistory, | |
generateStateHistoryCSV, | |
StateHistoryOIDColMapping | |
} from "@eva-ics/webengine-react"; | |
import { Eva, StateProp } from "@eva-ics/webengine"; | |
import { Timestamp } from "bmat/time"; | |
import { downloadCSV } from "bmat/dom"; |
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 cargo_metadata::{CargoOpt, MetadataCommand}; | |
use std::path::Path; | |
fn main() { | |
let mut manifest = Path::new(&std::env::var("CARGO_MANIFEST_DIR").unwrap()).to_owned(); | |
manifest.push("Cargo.toml"); | |
let metadata = MetadataCommand::new() | |
.manifest_path(manifest) | |
.features(CargoOpt::AllFeatures) | |
.exec() |
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
extern crate clap; | |
extern crate openssl; | |
use clap::{App, Arg}; | |
use openssl::hash::{Hasher, MessageDigest}; | |
use std::error::Error; | |
use std::fs::File; | |
use std::io::{BufReader, Read}; | |
fn main() -> Result<(), Box<Error>> { |
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
// Full article: https://medium.com/@disserman/api-call-tracing-in-high-loaded-asynchronous-rust-applications-bc7b126eb470 | |
// | |
// Cargo.toml: | |
// [package] | |
// name = "rct" | |
// version = "0.1.0" | |
// edition = "2021" | |
// | |
// [dependencies] | |
// hyper = { version = "0.14.23", features = ["server", "tcp", "http1"] } |
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
--- drivers/platform/x86/thinkpad_acpi.c.bak 2021-06-28 00:21:11.000000000 +0200 | |
+++ drivers/platform/x86/thinkpad_acpi.c 2022-05-18 04:07:06.814390699 +0200 | |
@@ -8883,31 +8883,22 @@ | |
quirks = tpacpi_check_quirks(fan_quirk_table, | |
ARRAY_SIZE(fan_quirk_table)); | |
- if (gfan_handle) { | |
- /* 570, 600e/x, 770e, 770x */ | |
- fan_status_access_mode = TPACPI_FAN_RD_ACPI_GFAN; | |
- } else { |
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
/* [dependencies] | |
tokio = { version = "1.15.0", features = ["full"] } | |
bma-benchmark = "0.0.18" | |
async-nats = "0.10.1" | |
elbus = { version = "", features = ["full"] } | |
*/ | |
#[macro_use] | |
extern crate bma_benchmark; |
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
#[macro_use] | |
extern crate bma_benchmark; | |
use hyper::{client::connect::HttpConnector, Body, Client, Method, Request, StatusCode}; | |
#[tokio::main] | |
async fn main() { | |
let iters = 1_000_000; | |
//let iters = 10; | |
let workers = 4; |
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 rand::{thread_rng, Rng}; | |
use std::fmt; | |
struct MineField { | |
field: Vec<u16>, | |
x: usize, | |
y: usize, | |
} | |
impl MineField { |
NewerOlder