text stringlengths 7.05k 33.9k |
|---|
extern crate serde_json;
extern crate indy_crypto;
use self::serde_json::Value;
use errors::common::CommonError;
use errors::pool::PoolError;
use errors::crypto::CryptoError;
use errors::indy::IndyError;
use services::pool::PoolService;
use services::crypto::CryptoService;
use services::crypto::types::{Did, Key};
us... |
//! This is a library to display simple errors in colorful, rustc-like way.
//! It can't show multi-line errors or draw arrows between parts of code, but its interface
//! is simple and easy to use. If you want something more complex, you probably should use
//! [annotate-snippets](https://docs.rs/annotate-snippets), w... |
//! Holding data which are serialized and stored to disk.
use uuid::Uuid;
use serde::{Serialize, Deserialize};
use super::tasks::*;
use super::clock::*;
use super::error::*;
use std::io::Write;
use std::fs::File;
use std::collections::HashMap;
use std::rc::Rc;
use std::path::Path;
use snafu::ResultExt;
use chrono::pre... |
use rand::random;
use {DISPWIDTH, DISPSIZE, MEMSIZE, STACKSIZE, NUM_KEYS, NUM_REGS};
const FONTSET: [u8; 80] =
[
0xF0, 0x90, 0x90, 0x90, 0xF0, // 0
0x20, 0x60, 0x20, 0x20, 0x70, // 1
0xF0, 0x10, 0xF0, 0x80, 0xF0, // 2
0xF0, 0x10, 0xF0, 0x10, 0xF0, // 3
0x90, 0x90, 0xF0, 0x10, 0x10, // 4
0xF0, 0x80, 0xF0, ... |
use core::convert::TryInto;
use embedded_hal::blocking::delay::DelayMs;
use embedded_hal::blocking::spi::Transactional;
use embedded_hal::digital::v2::OutputPin;
use crate::cs::{CsGuard, NoCs};
use crate::error::{Error, Result};
use crate::registers::{
ContinuousDagc, DioMapping, DioPin, FifoMode, LnaConfig, Mode... |
//! A Bluetooth Library
//!
//! The primary purpose of bo-tie is to provide a middling layer between the architecture specific
//! and user friendly libraries for Bluetooth. bo-tie is also intended to be used in environments
//! where only [`core`](https://doc.rust-lang.org/core/) and
//! [`alloc`](https://doc.rust-lan... |
// For fast decoding and cache friendly, RISC-V instruction is decoded
// into 64 bit unsigned integer in the following format:
//
// +-----+-----+-----+-----+-----+-----+-----+-----+
// | | rs1 | rs2 | res | | rd | op | R-type
// +-----------+-----------------------------------+
// | immediate | ... |
// Copyright 2019 The Exonum Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
pub mod day_18 {
use std::cmp::max;
#[derive(Debug)]
pub enum PairEntry {
Number(u8),
Pair((usize, usize)),
}
#[derive(Debug)]
pub struct Pair {
pairs: Vec<PairEntry>,
first: usize,
}
// It makes no sense to clone a PairEntry, so do it manually.
im... |
use std::fs;
use std::path::{Path, PathBuf};
use std::sync::{mpsc, Arc, Mutex};
use filecoin_proofs::error::ExpectWithBacktrace;
use filecoin_proofs::types::{PoRepConfig, PoStConfig, SectorClass};
use filecoin_proofs::Candidate;
use storage_proofs::sector::SectorId;
use crate::constants::*;
use crate::disk_backed_sto... |
use crate::cli::config::{
validate_jpeg_quality, Config, ConfigBuilder, InputOutputModeType, SelectedLicenses,
};
use anyhow::{anyhow, bail};
use arg_names::*;
use clap::{App, AppSettings, Arg, ArgGroup, ArgMatches};
use sic_cli_ops::create_image_ops;
use sic_cli_ops::operations::OperationId;
use sic_io::load::Fram... |
use super::{ConstructContext, DeconstructContext};
use crate::data::ExporterTarget;
use crate::{
controller::ControllerConfig,
data::{DittoAppSpec, DittoTopic, Exporter, ExporterMode},
ditto::{
self,
devops::{
Connection, ConnectionStatus, ConnectivityResponse, DevopsCommand, Enf... |
use crate::convert::TryInto;
use crate::fmt;
use crate::io::{self, Error, ErrorKind};
use crate::ptr;
use crate::sys;
use crate::sys::cvt;
use crate::sys::process::process_common::*;
use libc::{c_int, gid_t, pid_t, uid_t};
////////////////////////////////////////////////////////////////////////////////
// Command
///... |
//! Handles outbound requests from our node to the network.
use std::{
collections::HashSet,
future::Future,
iter,
net::SocketAddr,
pin::Pin,
task::{Context, Poll},
};
use futures::{
channel::{mpsc, oneshot},
future, ready,
stream::{Stream, StreamExt},
FutureExt,
};
use tokio::... |
//! Display fields that can only be filled with numeric type.
//!
//! A [`NumberInput`] has some local [`State`].
use iced_native::{
column, container,
event::{self, Event},
keyboard,
layout::{Limits, Node},
mouse, row, text,
text_input::{self, cursor, Value},
Align, Clipboard, Column, Conta... |
// Copyright 2020-2022 <NAME>
// SPDX-License-Identifier: Apache-2.0
use std::collections::BTreeSet;
use async_trait::async_trait;
use futures::executor;
use iota_stronghold::procedures;
use iota_stronghold::procedures::ProcedureError;
use iota_stronghold::sync::MergePolicy;
use iota_stronghold::sync::SyncClientsConf... |
// module for generating the LR finite state machine
#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(non_snake_case)]
#![allow(non_camel_case_types)]
#![allow(unused_parens)]
#![allow(unused_mut)]
#![allow(unused_assignments)]
#![allow(unused_doc_comments)]
#![allow(unused_imports)]
use std::collections::{Has... |
use crate::prelude::*;
use nu_ansi_term::*;
use nu_engine::WholeStreamCommand;
use nu_errors::ShellError;
use nu_protocol::{Signature, SyntaxShape, UntaggedValue, Value};
use nu_source::Tagged;
pub struct Command;
impl WholeStreamCommand for Command {
fn name(&self) -> &str {
"ansi"
}
fn signatur... |
use std::fs::{create_dir_all, File, OpenOptions};
use std::io::{BufWriter, Read, Seek, SeekFrom, Write};
use std::path::Path;
use std::sync::{Mutex, MutexGuard};
use anyhow::Result;
use byteorder::{ReadBytesExt, WriteBytesExt};
use thiserror::Error;
use super::*;
// TODO Implement handling of read-only files
// TODO... |
use super::SESSION_ID_LENGTH;
use crate::{database::DatabaseGuard, utils, ConduitResult, Database, Error, Result, Ruma};
use rocket::futures::{prelude::*, stream::FuturesUnordered};
use ruma::{
api::{
client::{
error::ErrorKind,
r0::{
keys::{
claim... |
// Copyright 2015-2016 <NAME> <<EMAIL>>
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according... |
use super::scan::ScanType;
use super::*;
use crate::{
config::OutputLevel,
progress::PROGRESS_PRINTER,
progress::{add_bar, BarType},
scan_manager::{MenuCmd, MenuCmdResult},
scanner::RESPONSES,
traits::FeroxSerialize,
SLEEP_DURATION,
};
use anyhow::Result;
use reqwest::StatusCode;
use serde::... |
use bio::io::fasta::IndexedReader;
use bird_tool_utils::command;
use rust_htslib::errors::Error;
use rust_htslib::{bcf, bcf::Read};
use std;
use std::collections::{HashMap, HashSet};
use std::fs::File;
use coverm::bam_generator::*;
use coverm::FlagFilter;
use estimation::variant_matrix::*;
use external_command_checker... |
#![allow(clippy::needless_doctest_main)]
#![warn(clippy::nursery, clippy::must_use_candidate, clippy::pedantic)]
use std::cmp::{Ord, Ordering, PartialOrd};
mod position;
/// Lazy string buffer that fills up on demand.
pub mod lazy;
/// Source code formatter with span highlights and notes.
///
/// Here are the kind o... |
use num_enum::{IntoPrimitive, TryFromPrimitive};
use std::convert::TryFrom;
/// The primary processor of the Game Boy Advance. This is the CPU used to run
/// Game Boy Advance Games.
pub struct Arm7Tdmi {
pub halt: bool,
pub registers: Registers,
}
/// The secondary processor of the Game Boy Advance. It is th... |
#[cfg_attr(test, macro_use)]
extern crate structopt;
use crate::gdrive::{FileInfo, FolderInfo, ScanResult};
use crate::logging::LogLevel::{Debug, Info, Trace};
use crate::token::{TinfoilToken, TokenFile};
use anyhow::Error;
use compression::CompressionFlag;
use encryption::EncryptionFlag;
use error::RustfoilError;
use... |
// Copyright Materialize, Inc. and contributors. All rights reserved.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by ... |
use super::stream;
use super::stream::Stream;
use super::Error;
use inflate::inflate_bytes;
use rand::Rng;
use slog::Logger;
use std::fmt;
use std::str;
use tokio;
use tokio::prelude::*;
use tokio::spawn;
use tokio::sync::mpsc;
use tokio::sync::mpsc::{Receiver, Sender};
#[derive(Debug)]
// Message for communication wi... |
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License in the LICENSE-APACHE file or at:
// https://www.apache.org/licenses/LICENSE-2.0
//! `Window` and `WindowList` types
use log::{debug, error... |
//! The compiler module that transforms [CaoIr](CaoIr) into bytecode.
//!
mod card;
mod compilation_error;
mod compile_options;
mod lane;
pub mod card_description;
#[cfg(test)]
mod tests;
use crate::{
bytecode::{encode_str, write_to_vec},
collections::key_map::{Handle, KeyMap},
instruction::instruction_s... |
/// CLI based todo app, for linux, windows and mac
extern crate app_dirs;
extern crate serde_derive;
use app_dirs::*;
use serde_derive::{Deserialize, Serialize};
use std::fs;
use std::ops::Range;
use std::path::PathBuf;
const APP_INFO: AppInfo = AppInfo {
name: "todo",
author: "<NAME>",
};
/// Command enum Er... |
use glam::*;
use spirv_builder::{MetadataPrintout, SpirvBuilder};
use winit::{
event::{ElementState, Event, MouseButton, MouseScrollDelta, VirtualKeyCode, WindowEvent},
event_loop::{ControlFlow, EventLoop},
platform::run_return::EventLoopExtRunReturn,
};
use std::{collections::HashMap, fs::File, path::Pat... |
use clap::{Clap};
#[macro_use]
extern crate log;
use regex::Regex;
use lazy_static::lazy_static;
use std::path::PathBuf;
use std::time::Instant;
use std::env;
use std::sync::atomic::Ordering;
use tonic::transport::Server;
use bazelfe_protos::*;
use bazelfe_core::bazel_runner;
use bazelfe_core::build_events::build_... |
pub mod processing;
#[cfg(feature = "monstermos")]
pub mod monstermos;
#[cfg(feature = "putnamos")]
pub mod putnamos;
use crate::gas::Mixture;
use auxtools::*;
use crate::constants::*;
use crate::GasArena;
use dashmap::DashMap;
use fxhash::FxBuildHasher;
use rayon;
use rayon::prelude::*;
const NORTH: u8 = 1;... |
//! Collection of tools for scanning Git repos for secrets.
//!
//! `GitScanner` acts as a wrapper around a `SecretScanner` object to provide helper functions for
//! performing scanning against Git repositories. Relies on the
//! [git2-rs](https://github.com/rust-lang/git2-rs) library which provides lower level access... |
//! Fixtures for testing Raft.
#![allow(dead_code)]
use std::collections::{BTreeMap, HashSet};
use std::sync::Arc;
use anyhow::{anyhow, Result};
use async_raft::async_trait::async_trait;
use async_raft::error::{ChangeConfigError, ClientReadError, ClientWriteError};
use async_raft::raft::ClientWriteRequest;
use async... |
#![allow(dead_code)]
use actix::Recipient;
use log::info;
use ansi_term::Colour::Yellow;
use specs::shred::{Fetch, FetchMut, Resource};
use std::io::Write;
use std::time::Instant;
use std::{collections::VecDeque, fs::File};
use specs::{Builder, DispatcherBuilder, World as ECSWorld, WorldExt};
use serde::{Deserial... |
use chrono::{Datelike, Duration, NaiveDate};
use std::{
cmp::{max, min},
ops::Add,
};
use crate::{
config::get_configuration,
date_utils::{get_current_date, get_month},
error::{InquireError, InquireResult},
formatter::{self, DateFormatter},
terminal::{get_default_terminal, Terminal},
ui... |
//! Provides detection and access to System Management BIOS (SMBIOS) and
//! Desktop Management Interface (DMI) data and structures.
extern crate bytes;
use bytes::Buf;
use std::error;
use std::fmt;
use std::fs;
use std::io;
use std::io::prelude::*;
use std::path;
use std::result;
/// Specifies the different classes... |
extern crate num_traits;
use num_traits::Signed;
use std::fs::File;
use std::io::Write;
use std::collections::HashMap;
use std::ffi::OsStr;
use super::super::{Brainfuck, BrainfuckInteger, Instruct};
use super::generate_c_write_str::generate_c_write_str;
use super::generate_asm_str::generate_asm_str;
use super::generat... |
//! 单线程运行时
//!
use std::sync::Arc;
use std::cell::RefCell;
use std::future::Future;
use std::cell::UnsafeCell;
use std::task::{Waker, Context, Poll};
use std::io::{Error, Result, ErrorKind};
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use parking_lot::{Mutex, Condvar};
use crossbeam_channe... |
use crate::{
messagebus::{AdvertiseLink, MessageBus},
InvocationResponse,
};
use actix::prelude::*;
use crate::auth::Authorizer;
use crate::control_interface::ctlactor::{ControlInterface, ControlOptions, PublishEvent};
use crate::dispatch::Invocation;
use crate::hlreg::HostLocalSystemService;
use crate::hos... |
use scroll::Pread;
use crate::common::*;
use crate::modi::{constants, FileChecksum, FileIndex, FileInfo, LineInfo, LineInfoKind};
use crate::FallibleIterator;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[repr(u32)]
#[allow(unused)]
enum DebugSubsectionKind {
// Native
Symbols = 0xf1,
Lines = 0xf2,
S... |
//! Contains types related to ICE's projected data representation.
use crate::{
common::*,
data::{Data, Sample},
};
/// Projected data to classify.
///
/// Used by the learner to reason on a single predicate.
#[derive(Clone)]
pub struct CData {
/// Positive samples.
pos: Vec<VarVals>,
/// Negative... |
use bincode;
use bytes::Bytes;
use futures::{
future::{self, loop_fn, Loop},
stream,
stream::futures_unordered::FuturesUnordered,
Async, Future, IntoFuture, Sink, Stream,
};
use igd::{tokio::search_gateway, PortMappingProtocol};
use net2::UdpBuilder;
use rand;
use rustun::client::UdpClient;
use rustun::... |
use crate::dep_types::Version;
use crate::util;
use crossterm::{Color, Colored};
use flate2::read::GzDecoder;
use regex::Regex;
use ring::digest;
use std::{fs, io, io::BufRead, path::PathBuf, process::Command};
use tar::Archive;
#[derive(Copy, Clone, Debug)]
pub enum PackageType {
Wheel,
Source,
}
/// Extract... |
// utils.rs
//
// Copyright (c) 2019 All The Music, LLC
//
// This work is licensed under the Creative Commons Attribution 4.0 International License.
// To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send
// a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
... |
// Copyright 2021-2021, <NAME> and the wireshark_dissector_rs contributors
// SPDX-License-Identifier: GPL-2.0-or-later
// https://www.wireshark.org/docs/wsdg_html/#ChDissectDetails
// /usr/include/wireshark/epan
// https://github.com/wireshark/wireshark/blob/ebfbf958f6930b2dad486b33277470e8368dc111/epan/dissectors/p... |
use proc_macro2::{Span, TokenStream};
use proc_macro_error::{abort, emit_warning, ResultExt};
use syn::punctuated::Punctuated;
use syn::{Field, Fields, Ident, Meta, MetaNameValue, Token, Type};
use quote::{format_ident, quote, ToTokens, TokenStreamExt};
use crate::parse_string_meta;
use crate::struct_gen::struct_buil... |
//! Package solver used by `fac-rs`.
//!
//! Takes a set of packages and requirements and produces a solution of packages to be installed.
#![deny(rust_2018_idioms, warnings)]
#![deny(clippy::all, clippy::pedantic)]
#![allow(
clippy::default_trait_access,
clippy::missing_errors_doc,
clippy::missing_panics_doc,
cl... |
//! Module dealing with actually running all the tests.
use crate::elm_json::{Config, Dependencies};
use glob::glob;
use pretty::RcDoc;
use std::collections::HashSet;
use std::convert::TryFrom;
use std::ffi::OsStr;
use std::io::Write;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
// Has some wei... |
use super::{
encoding::{Decode, Encode},
*,
};
use bulletproofs::r1cs::{R1CSProof, Verifier};
use bulletproofs_gadgets::{
fixed_deposit_tree::mixer_verif_gadget,
poseidon::{allocate_statics_for_verifier, builder::Poseidon},
utils::AllocatedScalar,
};
use curve25519_dalek::{ristretto::CompressedRistretto, scalar::S... |
use chrono::{Duration, Utc};
use dotenv::dotenv;
use failure::{format_err, Error};
use log::{error, info, warn};
use reqwest::{Client, Identity};
use serde::{Deserialize, Serialize};
use std::collections::{BTreeMap, BTreeSet};
use std::env::var;
use std::net::SocketAddr;
use std::sync::Arc;
use warp::filters::path::Tai... |
use crate::{
constraint,
constraint::Padding,
layout::{
centered::CenteredLayout,
linear::{ItemAlignment, LinearLayout, LinearLayoutData, Spacing},
ExactFrame, Layout, VarType
},
prefab::{CalculatedDimensions, DynamicLayout, DynamicLayoutData, ExtraButtonData, Tinted},
so... |
use crate::{
cairo::lang::{
compiler::program::Program,
instances::CairoLayout,
vm::{
builtin_runner::{BuiltinRunner, Error as BuiltinRunnerError},
memory_dict::{Error as MemoryDictError, MemoryDict},
memory_segments::{Error as MemorySegmentError, MemorySe... |
use crate::{
eval::eval,
hir::{
self, Bind, Binding, Cond, CondBranch, Const, HirKind, HirNode, If, Intrinsic, Mem, Proc,
TopLevel, While,
},
iconst::IConst,
types::{self, StructIndex, Type},
};
#[derive(Debug)]
pub enum Op {
Push(IConst),
PushStr(usize),
PushMem(String)... |
// Edge Operation L-System Genome
// NOTES:
//
// * When we need a value within [0, 1), we simply cut off the integral part und use fractional part
// only.
//
// * We start out with a simple Genome, which gets more and more complex through mating.
pub mod edgeop;
#[cfg(feature = "expr_num")]
#[path = "expr_num_o... |
use env_logger;
use log::info;
use std::time::Instant;
use zkp_macros_decl::field_element;
use zkp_primefield::{FieldElement, Root, SquareInline, One, Zero};
use zkp_stark::{Constraints, Provable, RationalExpression, TraceTable, Verifiable};
use zkp_u256::U256;
use zkp_elliptic_curve::BETA;
#[derive(Clone, Debug)]
str... |
//! # Installation
//!
//! Precompiled binaries for `apkeep` on various platforms can be downloaded
//! [here](https://github.com/EFForg/apkeep/releases).
//!
//! To install from `crates.io`, simply [install rust](https://www.rust-lang.org/tools/install) and
//! run
//!
//! ```shell
//! cargo install apkeep
//! ```
//!... |
/* Copyright (C) 2020 <NAME> - All Rights Reserved. */
use pid::Pid;
use rosrust_msg::std_msgs::{Float64, Header};
use rosrust_msg::nav_msgs::Path;
use rosrust_msg::geometry_msgs::{Point, Pose, PoseStamped, Quaternion};
use rustros_tf::msg::geometry_msgs::TransformStamped;
#[derive(Debug, Clone, PartialEq)]
pub st... |
use std::collections::{BTreeMap, BTreeSet};
use quill_common::{
diagnostic::{Diagnostic, ErrorMessage, HelpMessage, HelpType, Severity},
location::{Range, SourceFileIdentifier},
};
use quill_mir::mir::{
ArgumentIndex, BasicBlockId, ControlFlowGraph, DefinitionBodyM, DefinitionM, LocalVariableName,
Plac... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - MCU Clock Management This register contains bitfields related to the MCU clock."]
pub mcuclk: MCUCLK,
#[doc = "0x04 - AUX Clock Management This register contains bitfields that are relevant for setting up the clock to the AUX d... |
// Copyright (c) 2017 <NAME>
use std::cmp::Ordering;
use std::ptr;
// ----------------------------------------------------------------------------
/// This speeds up well-ordered input by quite a lot.
const DOUBLE_COMPARISONS: bool = true;
/// Low RECENCY = faster when there is low disorder (a lot of order).
/// Hi... |
use std::marker::PhantomData;
use data::{Tuple, VMBox, Closure, CodePtr, Record, ForeignPtr, ForeignFn};
const BYTE_MASK: u32 = (1 << 8) - 1;
const ATOM_INDEX_SHIFT: usize = 1;
const ATOM_TAG_MASK: u8 = (1 << ATOM_INDEX_SHIFT) - 1;
pub const MOV : u8 = 0x00;
pub const SWAP: u8 = 0x01;
pub const IEQ: u8 = 0x10;
pub ... |
mod buffered_byte_stream;
mod limited_copy;
use async_std::fs::File;
use async_std::io::prelude::*;
use async_std::io::{BufReader, BufWriter};
use limited_copy::copy as limited_copy;
use buffered_byte_stream::BufferedBytesStream;
use libflatterer::{flatten, FlatFiles};
use std::collections::HashMap;
use std::fs::File a... |
use crate::errors::{ErrorLocation, RuntimeError};
use crate::bits::*;
use crate::bytes::Address;
use crate::instr::*;
use crate::mem::*;
use crate::version::*;
pub struct InstructionDecoder<'a> {
mem: &'a Memory,
start_addr: Address,
next_addr: Address,
}
impl<'a> InstructionDecoder<'a> {
pub fn new(m... |
// SPDX-License-Identifier: Apache-2.0 OR MIT
use std::{
convert::TryFrom,
io::Write,
net::{IpAddr, Ipv4Addr, Ipv6Addr},
process::exit,
result::Result as StdResult,
str::FromStr,
thread::sleep,
time::Duration,
};
use argh::FromArgs;
use async_std::{
channel,
prelude::FutureExt,
task::{block_on, spawn, spaw... |
use std::collections::HashMap;
use ast::*;
use scanner::*;
type VariableMap = HashMap<String, isize>; // name, location on stack
/// Gives priority to map2. map2 should always be the current scope.
fn merge_maps<'a>(map1: &'a VariableMap, map2: &'a VariableMap) -> VariableMap {
let mut new_map = map1.clone();
... |
use glfw::{Action, Key, Modifiers, MouseButton, WindowEvent};
use num::Bounded;
use std::cell::RefCell;
use std::collections::HashMap;
use std::env;
use std::path::Path;
use std::rc::Rc;
use time;
use engine::{GraphicsManager, GraphicsManagerHandle};
use kiss3d::light::Light;
use kiss3d::loader::obj;
use kiss3d::text:... |
// See RFC 5348: "TCP Friendly Rate Control (TFRC): Protocol Specification"
// This is a constant-time overhead implementation of the loss rate computation, where only the
// most recent loss interval is updated each time a new frame is acked or nacked. Currently, no
// attempt is made to fill holes in the loss histo... |
//
// I cheated a bit on this one
// No way I was doing the sea monter part without external help
//
const INPUT: &str = include_str!("../input/day20.txt");
use std::collections::{HashMap, HashSet, VecDeque};
use std::ops::{Add, Not};
const TILE_SIZE: i32 = 10;
const CROPPED_TILE_SIZE: i32 = TILE_SIZE - 2;
type Pixe... |
#[cfg(feature = "quic")]
use crate::conn::Protocol;
use crate::conn::{ConnectionCommon, ConnectionRandoms};
use crate::error::Error;
use crate::hash_hs::HandshakeHash;
#[cfg(feature = "logging")]
use crate::log::{debug, trace};
use crate::msgs::enums::{AlertDescription, ExtensionType};
use crate::msgs::enums::{CipherSu... |
//! Implement thread-local storage.
use std::collections::BTreeMap;
use std::collections::btree_map::Entry as BTreeEntry;
use std::collections::hash_map::Entry as HashMapEntry;
use log::trace;
use rustc_data_structures::fx::FxHashMap;
use rustc_middle::ty;
use rustc_target::abi::{Size, HasDataLayout};
use crate::*;... |
use meta::{FileType, Name};
use std::collections::HashMap;
pub struct Icons {
display_icons: bool,
icons_by_name: HashMap<&'static str, &'static str>,
icons_by_extension: HashMap<&'static str, &'static str>,
}
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub enum Theme {
NoIcon,
Default,
}
const ... |
//! The sandbox manager provides the actual functionality of the sandbox
//! process. It allows the replica controller process to manage
//! everything required in order to execute code. It holds three
//! kinds of resources that it manages on behalf of the replica
//! controller process:
//!
//! - CanisterWasm: The (w... |
use crate::Inspect;
use ipnet::{Ipv4Net, Ipv6Net};
use linkerd2_proxy_api::net::ip_address;
use linkerd2_proxy_api::tap::observe_request;
use std::{boxed::Box, collections::BTreeMap, net, str::FromStr};
use thiserror::Error;
#[derive(Clone, Debug)]
pub enum Match {
Any(Vec<Match>),
All(Vec<Match>),
Not(Box... |
// Code generated by mksysnum_linux.py; DO NOT EDIT.
use crate::syscalls::Sysno;
pub const SYS_IO_SETUP: Sysno = 0;
pub const SYS_IO_DESTROY: Sysno = 1;
pub const SYS_IO_SUBMIT: Sysno = 2;
pub const SYS_IO_CANCEL: Sysno = 3;
pub const SYS_IO_GETEVENTS: Sysno = 4;
pub const SYS_SETXATTR: Sysno = 5;
pub const SYS_LSETX... |
mod inet;
pub use self::inet::*;
mod inet6;
pub use self::inet6::*;
mod af_spec;
pub use self::af_spec::*;
mod link_infos;
pub use self::link_infos::*;
mod map;
pub use self::map::*;
mod stats;
pub use self::stats::*;
mod stats64;
pub use self::stats64::*;
#[cfg(test)]
mod tests;
use std::mem::size_of;
use byt... |
//! # Data Description Structure
//!
//! DDS responses describe the data type, size, and its coordintes. A [data response](crate::dods) is always
//! accompanied by a DDS response prepended.
//!
//! This module takes [constraints](crate::constraint) and turns them into a [DDS
//! response](DdsResponse) with [constraine... |
use cargo_rls_install::{
commands::{
command_rust_default, command_rust_multiple_uninstall, command_rust_uninstall,
component_add, component_add_and_get_output, print_rust_and_rls_install,
rust_and_rls_install, select_channel,
},
options::{help, parse_args, Channel, SubCommandsEnum},... |
use std::collections::BTreeMap;
use std::str::FromStr;
use std::sync::{Arc, RwLock};
use std::time::{Duration, UNIX_EPOCH};
use client_common::tendermint::types::BlockResultsResponse;
use secstr::SecUtf8;
use signatory::ed25519;
use signatory::public_key::PublicKeyed;
use signatory_dalek::Ed25519Signer;
use signature:... |
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... |
//! MRF24J40
//!
//! # References
//!
//! - [MRF24J40 data sheet][ds]
//! - [IEEE 802.15.4-2003 standard][standard]
//!
//! [ds]: http://ww1.microchip.com/downloads/en/DeviceDoc/39776C.pdf
//! [standard]: https://www.iith.ac.in/~tbr/teaching/docs/802.15.4-2003.pdf
#![deny(rust_2018_compatibility)]
#![deny(rust_2018_id... |
#![deny(
clippy::all,
clippy::missing_inline_in_public_items,
clippy::ptr_as_ptr,
clippy::print_stdout,
missing_docs,
nonstandard_style,
unused,
warnings
)]
//! Cross-platform virtual memory API.
//!
//! This crate provides a cross-platform Rust API for querying and manipulating
//! virtual memory. It i... |
// Copyright 2016 The Gfx-rs Developers.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
#![allow(clippy::precedence, clippy::verbose_bit_mask)]
//! Code for reading, writing, and using bit arrays.
//!
//! A bit array is a contiguous sequence of N bits contained in L words. By choosing L as the
//! minimal number of words required for N bits, the sequence is compressed and yet aligned on a
//! word bounda... |
// Copyright 2015-2020 Parity Technologies (UK) Ltd.
// This file is part of Parity Ethereum.
// Parity Ethereum is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at yo... |
//! Definitions of network messages.
use std::error::Error;
use std::{fmt, sync::Arc};
use zebra_chain::{
block::{self, Block},
transaction::Transaction,
};
use super::inv::InventoryHash;
use super::types::*;
use crate::meta_addr::MetaAddr;
mod version;
pub use version::Version;
mod get_blocks;
pub use get... |
//! Ed25519 signature and verification key support
use core::{
convert::{TryFrom, TryInto},
fmt::{self, Debug, Formatter},
};
use curve25519_dalek::edwards::CompressedEdwardsY;
use ed25519_dalek::{ExpandedSecretKey, PublicKey, SecretKey, Signature};
use sha2::Digest;
use subtle::ConstantTimeEq;
use x25519_dal... |
// Copyright 2020-2021, The Tremor Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agr... |
// Useful references:
// https://www.reddit.com/r/gamedev/comments/13ksu3/article_on_particle_systems_and_an_online_cocos2d/
// Unity3D's particle system
// Cocos2d's plist file format
// Oh, love2d's particle system parameters, derp.
// I think this could be simplified.
// For each particle property, take an easing f... |
#![warn(missing_docs)]
//! A simplistic & configurable Markov chain text generator
//!
//! Give it a vec of strings and generate random results.
//! Works best with tweets, chat history, news headlines...
//!
//! Minimal example:
//! ```no_run
//! use markov_strings::*;
//!
//! let data: Vec<InputData> = vec![/* a lot... |
use crate::rm::{ResourceManager, RmError, RmRc, RmResult};
use crate::tm::{TmStatus, TransactionManager, XaError, XaResult, XaTransactionId};
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use log::{debug, trace};
use std::collections::hash_map::DefaultHasher;
use std::collections::HashMap;
use std::hash::... |
//! The command line interface of the matchtigs crate.
//! This interface allows convenient access to the implemented algorithms without writing any code of your own.
//! Supported file formats are fasta and GFA.
#![warn(missing_docs)]
use crate::implementation::{
compute_greedytigs, compute_matchtigs, compute_pa... |
// Copyright 2019 Cargill Incorporated
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agre... |
mod acknowledgements;
mod key;
mod reader;
mod writer;
#[cfg(test)]
mod tests;
use std::{
collections::VecDeque,
error::Error,
fmt::Debug,
io,
marker::PhantomData,
num::NonZeroU64,
path::{Path, PathBuf},
sync::{
atomic::{AtomicU64, AtomicUsize},
Arc,
},
};
use asyn... |
/*
MIT License
Copyright (c) 2021 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribut... |
//! RTR client units.
//!
//! There are two units in this module that act as an RTR client but use
//! different transport protocols: [`Tcp`] uses plain, unencrypted TCP while
//! [`Tls`] uses TLS.
use std::io;
use std::convert::TryFrom;
use std::fs::File;
use std::future::Future;
use std::pin::Pin;
use std::sync::Arc... |
use crate::configuration::Column;
use log::info;
use rustc_hash::FxHashMap;
use std::collections::hash_map;
use std::mem;
/// Creates combinations of column pairs as sparse matrices.
/// Let's say that we have such columns configuration: complex::a reflexive::complex::b c. This is provided
/// as `&[Column]` after par... |
use std::{
fmt::{Binary, Debug},
marker::PhantomData,
};
use crate::af::Zero;
use crate::node_id::SortableNodeId;
use crate::prefix_record::InternalPrefixRecord;
pub use crate::stride::*;
use crate::synth_int::{U256, U512};
use crate::local_vec::tree::{NewNodeOrIndex, SizedStrideNode};
use crate::af::Address... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.