text stringlengths 7.05k 33.9k |
|---|
/* tag::catalog[]
Title:: Subnet makes progress despite one third of the nodes being stressed.
Runbook::
0. Instantiate an IC with one System and one Application subnet.
1. Install NNS canisters on the System subnet.
2. Build and install one counter canister on each subnet.
3. Instantiate and start one workload per su... |
use std::borrow::Cow;
use std::fs::File;
use std::io::{Cursor, Seek};
use std::mem;
use std::path::Path;
use std::sync::Arc;
use std::time::Duration;
use crossbeam_channel::RecvTimeoutError;
use fst::IntoStreamer;
use grenad::CompressionType::Snappy;
use heed::{RoTxn, RwTxn};
use obkv::{KvReaderU32, KvWriterU32};
use ... |
#![allow(non_snake_case)]
use anyhow::{Context, Error, Result};
use dotenv::dotenv;
use log::{error, info, warn};
// use markov::Chain;
use rand::distributions::Uniform;
use rand::prelude::*;
use redis::aio::MultiplexedConnection;
use redis::AsyncCommands;
use regex::{Regex, RegexSet};
use serde::{Deserialize, Serializ... |
//! The MessagePack data format.
use std::error::Error;
use std::fmt::{self, Display};
use std::io::{self, BufRead, BufReader, Read, Write};
use rmp::Marker;
use rmp_serde::decode::Error::{InvalidDataRead, InvalidMarkerRead};
use serde::Deserialize;
use crate::input::{self, Input};
use crate::transcode;
/// The max... |
use kernel::common::volatile_cell::VolatileCell;
#[repr(C, packed)]
struct PmRegisters {
mcctrl: VolatileCell<u32>,
cpusel: VolatileCell<u32>,
_reserved1: VolatileCell<u32>,
pbasel: VolatileCell<u32>,
pbbsel: VolatileCell<u32>,
pbcsel: VolatileCell<u32>,
pbdsel: VolatileCell<u32>,
_rese... |
#![cfg_attr(not(feature = "std"), no_std)]
use codec::{Decode, Encode};
use frame_support::{dispatch::DispatchResult, ensure, RuntimeDebug, traits::{Currency, ExistenceRequirement, Get, Randomness}};
#[cfg(feature = "std")]
use frame_support::traits::GenesisBuild;
use frame_system::offchain::{SendTransactionTypes, Sub... |
// 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 ... |
use rustc_data_structures::svh::Svh;
use rustc_hir as hir;
use rustc_hir::def::DefKind;
use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE};
use rustc_infer::traits::util;
use rustc_middle::hir::map as hir_map;
use rustc_middle::ty::subst::{InternalSubsts, Subst};
use rustc_middle::ty::{self, ToPredicate,... |
/*
* Copyright (C) 2016 <NAME> <<EMAIL>>
*
* 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 a... |
use std::{
cmp,
fmt::{self, Display, Write},
str::FromStr,
};
use actix_http::{error::ParseError, header, HttpMessage};
use super::{Header, HeaderName, HeaderValue, IntoHeaderValue, InvalidHeaderValue, Writer};
/// `Range` header, defined
/// in [RFC 7233 §3.1](https://datatracker.ietf.org/doc/html/rfc72... |
use crate as cincinnati;
use crate::plugins::internal::dkrv2_openshift_secondary_metadata_scraper::gpg;
use crate::plugins::internal::release_scrape_dockerv2::registry;
use reqwest::{Client, ClientBuilder};
use std::path::{Path, PathBuf};
use std::time::Duration;
use tempfile::TempDir;
use url::Url;
use self::cincinna... |
// Copyright 2019 The xi-editor Authors.
//
// 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... |
use std::marker::PhantomData;
use blake2s_simd::Params as Blake2s;
use merkletree::merkle::FromIndexedParallelIterator;
use merkletree::store::DiskStore;
use paired::bls12_381::Fr;
use rayon::prelude::*;
use crate::drgraph::Graph;
use crate::error::Result;
use crate::hasher::{Domain, Hasher};
use crate::merkle::{Merk... |
mod time_marker;
mod timestamp_finder;
use crate::timestamp_finder::TimestampFinder;
use anyhow::*;
use sparkline::*;
use std::io::{prelude::*, BufReader};
pub fn build_sparkline(timestamps: &[i64], length: usize) -> Result<String, anyhow::Error> {
let timestamps_per_bucket = timestamp_frequency_distribution(time... |
// This file is part of Substrate.
// Copyright (C) 2017-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// 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
//
// ht... |
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#![recursion_limit = "512"]
use {
anyhow::{format_err, Context as _, Error},
argh::FromArgs,
async_helpers::component_lifecycle::ComponentLife... |
// Copyright 2013-2014 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-MI... |
use std::cell::Cell;
use std::rc::Rc;
use glow::HasContext;
use crate::drawing::Uniforms;
use crate::{Canvas, Color, EventCtx, GeomBatch, ScreenDims, ScreenRectangle};
#[cfg(feature = "native-backend")]
pub use crate::backend_glow_native::setup;
#[cfg(feature = "wasm-backend")]
pub use crate::backend_glow_wasm::set... |
use super::abi;
use crate::{
cmp,
ffi::CStr,
io::{self, ErrorKind, IoSlice, IoSliceMut},
mem,
net::{Shutdown, SocketAddr},
ptr, str,
sys_common::net::{getsockopt, setsockopt, sockaddr_to_addr},
sys_common::{AsInner, FromInner, IntoInner},
time::Duration,
};
use self::netc::{sockaddr... |
//! Top-level Pool type, methods, and tests
use super::component::TxEntry;
use crate::callback::Callbacks;
use crate::component::pending::PendingQueue;
use crate::component::proposed::ProposedPool;
use crate::error::Reject;
use crate::util::verify_rtx;
use ckb_app_config::TxPoolConfig;
use ckb_logger::{error, trace};
u... |
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use {
crate::model::{
component::{ComponentInstance, InstanceState},
error::ModelError,
events::synthesizer::{EventSynthesisPro... |
// Copyright (c) 2017-2018, The rav1e contributors. All rights reserved
//
// This source code is subject to the terms of the BSD 2 Clause License and
// the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
// was not distributed with this source code in the LICENSE file, you can
// obtain it at ... |
//! Utility crate for easily building CUDA crates using rustc_codegen_nvvm. Derived from rust-gpu's spirv_builder.
pub use nvvm::*;
use serde::Deserialize;
use std::{
borrow::Borrow,
env,
ffi::OsString,
fmt,
path::{Path, PathBuf},
process::{Command, Stdio},
};
#[derive(Debug)]
#[non_exhaustive... |
use std::borrow::Cow;
use std::fmt::Display;
use std::io::{Read, Write};
use std::ops::Deref;
use std::path::{Path, PathBuf};
use std::{fs, io};
use byte_unit::Byte;
use clap::{clap_app, crate_authors, crate_description, crate_name, crate_version, ArgMatches};
use console::{style, Color, Term};
use futures::prelude::*... |
//! An `unsegen` widget for viewing files with additional features.
//!
//! # Examples:
//! ```no_run
//! extern crate unsegen;
//!
//! use std::io::{stdin, stdout};
//! use unsegen::base::Terminal;
//! use unsegen::input::{Input, Key, ScrollBehavior};
//! use unsegen::widget::{RenderingHints, Widget};
//!
//! use unse... |
use std::collections::VecDeque;
use super::noise::Noise;
use super::point::*;
use core::f64::consts::PI;
pub fn color(r: u8, b: u8, g: u8) -> String {
format!("rgb({},{},{})", r, g, b)
}
pub fn red() -> String {
color(255, 0, 0)
}
pub fn blue() -> String {
color(0, 255, 0)
}
pub fn green() -> String {
... |
use std::collections::VecDeque;
use ahash::{AHashMap, AHashSet};
use enum_map::Enum;
use hex2d::{Angle, Coordinate, Direction, Spin};
use quad_rand::compat::QuadRand;
use rand::Rng;
use serde::{Deserialize, Serialize};
pub const SCORE_TIMER: u32 = 30;
/// Board full of marbles to play on
#[derive(Debug)]
pub struct ... |
// Copyright 2017 <NAME>.
//
// 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 in writing,... |
use crate::base::*;
// OUTPUT PROTOCOL
pub const EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL_GUID: EFI_GUID = EFI_GUID(0x387477c2, 0x69c7, 0x11d2, [0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b]);
pub const BOXDRAW_HORIZONTAL: UINTN = 0x2500;
pub const BOXDRAW_VERTICAL: UINTN = 0x2502;
pub const BOXDRAW_DOWN_RIGHT: UINTN = 0x250... |
use std::{fmt, path::PathBuf};
use azul_css::{LayoutPoint, LayoutSize};
use {
FastHashMap, FastHashSet,
ui_solver::{ResolvedTextLayoutOptions},
display_list::GlyphInstance
};
pub type CssImageId = String;
pub type CssFontId = String;
// since it's repr(C), can be casted directly from a `hb_glyph_info_t`
#... |
//! LiteX UART core
//!
//! Hardware source and documentation available at
//! [`litex/soc/cores/uart.py`](https://github.com/enjoy-digital/litex/blob/master/litex/soc/cores/uart.py).
use core::cell::Cell;
use kernel::common::cells::{OptionalCell, TakeCell};
use kernel::common::dynamic_deferred_call::{
DeferredCal... |
// This file is part of Substrate.
// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// 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
//
// ht... |
use ncurses::cbreak;
use ncurses::constants::ALL_MOUSE_EVENTS;
use ncurses::constants::ERR;
use ncurses::constants::KEY_MOUSE;
use ncurses::constants::REPORT_MOUSE_POSITION;
use ncurses::constants::{
KEY_F1, KEY_F10, KEY_F11, KEY_F12, KEY_F13, KEY_F14, KEY_F15, KEY_F2, KEY_F3, KEY_F4, KEY_F5,
KEY_F6, KEY_F7, KE... |
use arrow::datatypes::{DataType, Schema};
use arrow::record_batch::RecordBatch;
use datafusion;
use crate::client;
use crate::error::{BallistaError, Result};
use crate::logicalplan::{
exprlist_to_fields, translate_plan, Expr, LogicalPlan, Operator, ScalarValue,
};
use std::collections::HashMap;
use std::sync::Ar... |
/*
Copyright 2021 Picovoice Inc.
You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE"
file accompanying this source.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an ... |
// Copyright 2018 <NAME>
use crate::emulator_common::disassembler::Disassembler;
use crate::emulator_common::Intel8080Register;
use crate::game_boy_emulator::debugger::{fmt_lcdc, fmt_stat};
use crate::game_boy_emulator::disassembler::RGBDSInstructionPrinterFactory;
use crate::game_boy_emulator::memory_controller::Game... |
use glfw::{Action, Key};
use nalgebra_glm as glm;
use resurs::{Async, Handle};
use buffer::{
BufferHandle, BufferMutability, DeviceIndexBuffer, DeviceUniformBuffer, DeviceVertexBuffer,
};
use trekanten::buffer;
use trekanten::descriptor::DescriptorSet;
use trekanten::pipeline::{
GraphicsPipeline, GraphicsPipel... |
// Copyright (c) 2019 Intel Corporation
//
// 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... |
use std::fmt::Display;
use druid::{
piet::{PietTextLayout, Text, TextLayout, TextLayoutBuilder},
Modifiers, PaintCtx, Point, Rect,
};
use crate::{
config::{Config, LapceTheme},
keypress::paint_key,
};
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct KeyPress {
pub key: druid::KbKey,
pu... |
use std::{
io::{Cursor, Read, Write},
path::{Path, PathBuf},
};
use fs_extra::{dir::copy as copy_directory, file::copy as copy_file};
use owo_colors::OwoColorize;
use remove_dir_all::remove_dir_all;
use semver::{Version, VersionReq};
use serde::{Deserialize, Serialize};
use zip::ZipArchive;
use super::Depende... |
// E32-TTL-100 Lora radio driver
#![crate_type = "lib"]
#![crate_name = "lora_driver"]
// STD includes
use std::io::Write;
use std::io::Read;
use std::io::{Error, ErrorKind};
use std::string::String;
use std::thread::sleep;
use std::time::Duration;
use std::env;
// sysfs_gpio crate includes
extern crate sysfs_gpio;
... |
use crate::input::Input;
use crate::lib::intcode::{Code, Machine};
use std::cmp;
use std::collections::{HashMap, HashSet};
use std::error::Error;
use std::fmt;
use std::iter;
use std::ops;
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
struct Vec2<T> {
x: T,
y: T,
}
impl<T> Vec2<T> {
fn new(x: T, y: T... |
//! This implements the Safekeeper protocol, picking up immediately after the "START_WAL_PUSH" message
//!
//! FIXME: better description needed here
use anyhow::{bail, Context, Result};
use bincode::config::Options;
use bytes::{Buf, Bytes};
use log::*;
use postgres::{Client, Config, NoTls};
use serde::{Deserialize, Se... |
use crate::pipe::{self, PipeArbiter, PipeReader, PipeWriter};
use id_pool::IdPool;
use std::{
cmp,
collections::HashMap,
error::Error,
io,
sync::{atomic::AtomicUsize, Arc},
};
use tokio::{
io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt},
select,
sync::{
mpsc::{self, Rece... |
//! Implements the `paper` application logic for converting an [`Input`] into [`Output`]s.
pub(crate) mod translate;
use {
crate::{
io::{Dimensions, DocEdit, File, Input, Output, RowText, Style, StyledText, Unit},
orient,
},
core::{
convert::{TryFrom, TryInto},
num::TryFromI... |
use rusoto_core::Region;
use rusoto_core::ProvideAwsCredentials;
use rusoto_core::credential::{AwsCredentials, DefaultCredentialsProvider, ChainProvider};
use rusoto_kinesis::*;
use rusoto_sts::{StsClient, StsAssumeRoleSessionCredentialsProvider};
use dynamo_db::dynamo_db_library::DynamoDbLibrary;
use std::collections:... |
use std::collections::HashSet;
use std::{ffi, fmt, mem, str};
use gl;
use hal::{Features, Limits};
/// A version number for a specific component of an OpenGL implementation
#[derive(Copy, Clone, Eq, Ord, PartialEq, PartialOrd)]
pub struct Version {
pub is_embedded: bool,
pub major: u32,
pub minor: u32,
... |
//! # Building tari-based applications CLI
//!
//! To help with building tari-enabled CLI from scratch as easy as possible this crate exposes
//! [`ConfigBootstrap`] struct. ConfigBootstrap implements [`structopt::StructOpt`] trait, all CLI options
//! required for initializing configs can be embedded in any StructOpt ... |
use crate::colorscheme::ToForeground;
use crate::langs;
use crate::settings::TestSummary;
use crate::settings::TypingTestConfig;
use std::time::{Duration, Instant};
use tui::{style::Color, text::Span};
/// 0.05s tiny time offset appllied when pressed the first key
/// 0.05s delay between chars corresponds to 240wpm
//... |
use crate::common::{Map, Set};
use crate::scheduler::graph::{assign_task_to_worker, create_task_assignment, SchedulerGraph};
use crate::scheduler::protocol::{
SchedulerRegistration, TaskStealResponse, TaskUpdate, TaskUpdateType,
};
use crate::scheduler::metrics::BLevelMetric;
use crate::scheduler::metrics::NodeMet... |
// Copyright (c) 2021 <NAME> <<EMAIL>>. All rights reserved.
// Use of this source is governed by Apache-2.0 License that can be found
// in the LICENSE file.
//! From sys/sys/mount.h
use crate::uid_t;
/// filesystem id type
#[repr(C)]
#[derive(Debug, Default, Clone)]
pub struct fsid_t {
pub val: [i32; 2],
}
//... |
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use {
fidl_fuchsia_posix_socket::{ProviderMarker, ProviderProxy},
fuchsia_async::{self, net},
fuchsia_component::client::connect_to_service,
... |
use crate::choice::Choice;
use crate::config::Config;
use crate::environment::Environment;
use crate::files;
use crate::keyvalue::KeyValue;
use crate::{colors::Colors, request_definition::RequestDefinition};
use std::fs::OpenOptions;
use std::io::{self, Write};
use std::path::{Path, PathBuf};
use std::sync::{Arc, RwLoc... |
// Copyright (c) The Dijets Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{
core_mempool::{
index::{
AccountTransactions, ParkingLotIndex, PriorityIndex, PriorityQueueIter, TTLIndex,
TimelineIndex,
},
transaction::{MempoolTransaction, TimelineSt... |
// Copyright © 2021 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0
extern crate log;
use byteorder::{ByteOrder, LittleEndian, ReadBytesExt};
use remain::sorted;
use std::collections::btree_map::BTreeMap;
use std::convert::TryInto;
use std::fs::File;
use std::io::{self, Read, Seek, SeekFrom, Write};
use s... |
// See doc.rs for documentation.
mod doc;
use rustc_codegen_ssa::mir::debuginfo::VariableKind::*;
use self::metadata::{file_metadata, type_metadata, TypeMap, UNKNOWN_LINE_NUMBER};
use self::namespace::mangled_name_of_instance;
use self::type_names::compute_debuginfo_type_name;
use self::utils::{create_DIArray, is_nod... |
//! Parsing implementation. `pub` contents are low-level error details.
use enso_profiler as profiler;
use std::collections;
use std::error;
use std::fmt;
use std::mem;
use std::str;
// ===========================
// === parse and interpret ===
// ===========================
impl<M: serde::de::DeserializeOwned> st... |
//! Implements the segmented output port area.
use crate::prelude::*;
use ensogl::display::traits::*;
use enso_frp as frp;
use enso_frp;
use ensogl::animation::hysteretic::HystereticAnimation;
use ensogl::application::Application;
use ensogl::data::color;
use ensogl::display;
use ensogl::display::shape::StyleWatch;
u... |
/*!
ffprobe wrapper
This module is a wrapper for the [ffprobe](https://ffmpeg.org/ffprobe.html) tool.
It gathers relevant information needed for ScriptX function, for example, it is charged
with collecting and returning chapter information such as the *start* and *end* time
stamps of each verse that is later used by [... |
use std::collections::HashSet;
use std::env;
use std::error::Error;
use std::fs;
use std::fs::File;
use std::io;
use std::io::BufWriter;
use std::io::ErrorKind;
use std::io::Write;
use std::path::Path;
use std::result::Result;
use tensorflow_op_codegen::parser;
use tensorflow_op_codegen::protos::OpDef;
#[derive(Clone)... |
//! Patterns telling us certain facts about current syntax element, they are used in completion context
//!
//! Most logic in this module first expands the token below the cursor to a maximum node that acts similar to the token itself.
//! This means we for example expand a NameRef token to its outermost Path node, as ... |
//! Welcome to the API documentation for the `rust-gpu` project, this API is
//! unstable and mainly intended for developing on the project itself. This is
//! the API documentation for `rustc_codegen_spirv` which is not that useful on
//! its own. You might also be interested in the following crates. There's also
//! ... |
//! Protocol logic specific to ICS4 messages of type `MsgChannelOpenTry`.
use crate::events::IbcEvent;
use crate::handler::{HandlerOutput, HandlerResult};
use crate::ics03_connection::connection::State as ConnectionState;
use crate::ics04_channel::channel::{ChannelEnd, Counterparty, State};
use crate::ics04_channel::c... |
extern crate gtk;
extern crate gtk_sys;
extern crate gdk;
extern crate glib;
extern crate cairo;
use gtk::prelude::*;
const WINDOW_DEFAULT_WIDTH: i32 = 80;
const WINDOW_DEFAULT_HEIGHT: i32 = 80;
const DEFAULT_DPI: i32 = 96;
fn make_window_draggable(window: >k::Window) {
let mouse_position = std::rc::Rc::new(st... |
// Copyright 2020-2021 The NATS Authors
// 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 ... |
//! A crate that holds a logging implementation that logs to standard error and
//! standard out. It uses standard error for all regular messages and standard
//! out for requests.
//!
//! This crate provides only a logging implementation. To do actual logging use
//! the [`log`] crate and it's various macros.
//!
//!
... |
use super::*;
use log::debug;
use quaint::prelude::Queryable;
use std::collections::{BTreeMap, HashMap};
use std::sync::Arc;
pub struct SqlSchemaDescriber {
conn: Arc<dyn Queryable + Send + Sync + 'static>,
}
#[async_trait::async_trait]
impl super::SqlSchemaDescriberBackend for SqlSchemaDescriber {
async fn l... |
#![allow(clippy::mutable_key_type)]
#![allow(clippy::unnecessary_unwrap)]
//! MemPool
//!
//! MemPool does not guarantee that tx & withdraw is fully valid,
//! the block producer need to verify them again before put them into a block.
//!
//! The main function of MemPool is to sort txs & withdrawls in memory,
//! so we... |
//! Colorful and clean backtraces on panic.
//!
//! This library aims to make panics a little less painful by nicely colorizing
//! them, skipping over frames of functions called after the panic was already
//! initiated and printing relevant source snippets. Frames of functions in your
//! application are colored in a... |
// Copyright (c) 2018 The gdpr_consent authors
//
// 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 http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// exc... |
use chrono::{DateTime, Utc};
use core::{
convert::Infallible,
fmt::{self, Display, Formatter},
str::FromStr,
};
use ethers_core::{types::H160, utils::to_checksum};
use http::uri::{Authority, InvalidUri};
use iri_string::types::UriString;
use thiserror::Error;
pub mod nonce;
pub mod rfc3339;
pub use rfc333... |
//! Output artifact handling
use crate::{
artifacts::{CompactContract, CompactContractBytecode, Contract, FileToContractsMap},
contracts::VersionedContracts,
error::Result,
utils, HardhatArtifact, ProjectPathsConfig, SolcError,
};
use ethers_core::{abi::Abi, types::Bytes};
use semver::Version;
use serd... |
use crate::http as profiles;
use futures::{try_ready, Async, Future, Poll, Stream};
use http;
use linkerd2_addr::{Addr, NameAddr};
use linkerd2_dns as dns;
use linkerd2_error::{Error, Never, Recover};
use linkerd2_proxy_api::destination as api;
use regex::Regex;
use std::sync::Arc;
use std::time::{Duration, Instant};
u... |
// Copyright 2015-2016 <NAME>.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL... |
// Copyright 2018 Grove Enterprises LLC
//
// 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 ... |
mod state;
mod util;
mod widgets;
use std::io;
use std::path::PathBuf;
use std::sync::Arc;
use ckb_util::RwLock;
use termion::event::Key;
use termion::input::MouseTerminal;
use termion::raw::IntoRawMode;
use termion::screen::AlternateScreen;
use tui::backend::{Backend, TermionBackend};
use tui::layout::{Alignment, Co... |
use crate::transform::{MirPass, MirSource};
use crate::util::patch::MirPatch;
use rustc_data_structures::fingerprint::Fingerprint;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_hir::lang_items;
use rustc_middle::hir;
use rustc_middle::ich::StableHashingContext;
use rustc_middle::mir;
u... |
// -*- mode: rust; -*-
//
// This file is part of `fancy-garbling`.
// Copyright © 2019 Galois, Inc.
// See LICENSE for licensing information.
//! Tools useful for interacting with `fancy-garbling`.
//!
//! Note: all number representations in this library are little-endian.
#[cfg(feature = "nightly")]
use core::arch:... |
// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//! An interface for interacting with the `fuchsia.bluetooth.bredr.Profile` protocol.
//! This interface provides convenience methods to register service s... |
// Copyright 2020-2021, The Tremor Team
//
// Licensed under the Apache trace_id: (), span_id: (), trace_state: () 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
//
... |
//! Circuits for the [SHA-512] hash function and its internal compression
//! function.
//!
//! [SHA-512]: https://tools.ietf.org/html/rfc6234
use super::boolean::Boolean;
use super::multieq::MultiEq;
use super::uint64::UInt64;
use crate::{ConstraintSystem, SynthesisError};
use ff::ScalarEngine;
#[allow(clippy::unrea... |
// Descriptor wallet library extending bitcoin & miniscript functionality
// by LNP/BP Association (https://lnp-bp.org)
// Written in 2020-2021 by
// Dr. <NAME> <<EMAIL>>
//
// To the extent possible under law, the author(s) have dedicated all
// copyright and related and neighboring rights to this software to
// t... |
#![allow(clippy::similar_names)]
use chrono::{format::ParseError as ChronoParseError, Utc};
use clap::{App, Arg, ArgGroup};
use nom::Err as NomErr;
use rcgen::{
Certificate, CertificateParams, CustomExtension, DistinguishedName, KeyPair, RcgenError,
SignatureAlgorithm,
};
use rsa::errors::Error as RsaError;
us... |
// Copyright 2019 The vault713 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 a... |
use basis_universal_sys as sys;
use std::ffi::CStr;
/// The type of data stored
#[derive(Copy, Clone, Debug, PartialEq)]
#[repr(u32)]
pub enum BasisTextureType {
/// An arbitrary array of 2D RGB or RGBA images with optional mipmaps, array size = # images, each image may have a different resolution and # of mipmap ... |
// Authenticated Encryption with Associated Data (AEAD) Parameters
// https://www.iana.org/assignments/aead-parameters/aead-parameters.xhtml
pub use crate::blockmode::{
Aes128Gcm, Aes128Gcm8, Aes128Gcm12,
Aes256Gcm, Aes256Gcm8, Aes256Gcm12,
Aes128GcmSiv, Aes256GcmSiv,
Aes128Ccm, Aes128CcmShort, Aes128... |
// Copyright 2020-2022 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0
use std::fmt::Debug;
use std::ops::Deref;
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering;
use std::sync::Arc;
use identity_account_storage::crypto::RemoteEd25519;
use identity_account_storage::crypto::RemoteKey;
use serde... |
use std::rc::Rc;
use regex::Regex;
use crate::compile;
use crate::machine::{AccessorQuery, KeyAccessor};
use crate::parser::parse;
use crate::value::{parse_num, Value};
type Data = &'static str;
const DATA: &[Data] = &[
"abc",
"cde",
"ahi",
"10a",
"0x100",
"0x200",
"0o12",
"0b101",
... |
//! Módulo de Contrato.
//!
//!
use near_sdk::{
AccountId,
BorshStorageKey,
borsh::{self, BorshDeserialize, BorshSerialize},
collections::{
Vector,
LookupMap,
UnorderedSet,
},
env,
json_types::ValidAccountId,
near_bindgen,
};
near_sdk::setup_alloc!();
use ... |
//! Tagger client
//!
//! This crate contains the Tagger client, a single-page web application allowing users to browse a photo and video
//! collection hosted on a Tagger server.
//!
//! The UI is split into the following submodules, each of which contains one or more
//! [Sycamore](https://crates.io/crates/sycamore) ... |
use std::fmt;
use std::path::Path;
use std::cell::RefCell;
use std::collections::HashMap;
use regex::Regex;
use crate::JvmValue;
use crate::InterpLocalVars;
use crate::otfield::OtField;
use crate::otmethod::OtMethod;
use crate::otklass::OtKlass;
use ocelotter_util::file_to_bytes;
use ocelotter_util::ZipFiles;
/////... |
// Copyright (c) 2021 <NAME>
//
// 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 http://opensource.org/licenses/MIT>, at your
// option. All files in the project carrying such notice may not be copied,
// modified, ... |
//! # Game logic
//! Primary rules:
//! * Bullet meets Enemy => Both destroyed
//! * Bullet meets Wall => Bullet destroyed
//! * Enemy meets Wall => Enemy bounces/reverses
//! * All enemies destroyed => level ends
//! * Enemy meets player => Player health decreases + enemy destroyed
//! * Player health decreases to 0 =... |
// Copyright (c) 2021 Quark Container Authors / 2018 The gVisor Authors.
//
// 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 ... |
mod value;
mod wrappers;
use crate::{
comment_gen::DocCommentGen,
declaration::Type,
items::functions::{ExtensionType, Function, Requirement},
name::{Name, TypeName},
origin::Origin,
source::Source,
};
use indexmap::IndexMap;
use proc_macro2::{Ident, Literal, TokenStream};
use quote::{format_id... |
//! String processing algorithms.
use std::cmp::{max, min};
use std::collections::{hash_map::Entry, HashMap, VecDeque};
/// Prefix trie, easily augmentable by adding more fields and/or methods
pub struct Trie<C: std::hash::Hash + Eq> {
links: Vec<HashMap<C, usize>>,
}
impl<C: std::hash::Hash + Eq> Default for Tri... |
mod functions;
mod models;
use crate::functions::new_clause::*;
use crate::functions::solve::*;
use crate::models::lit::*;
use crate::models::solverstate::*;
use simplelog::*;
use std::env;
use std::fs::File;
use std::io::prelude::*;
#[macro_use]
extern crate log;
fn main() {
let _args: Vec<String> = env::args().... |
//! wow-srp
//!
//! This crate implements the SRP variation that is used in
//! the World of Warcraft authentication protocol. It provides
//! currently only provides a [`WowSRPServer`].
#![deny(
missing_docs,
missing_debug_implementations,
missing_copy_implementations,
trivial_casts,
trivial_numer... |
/*
* Copyright <NAME>, Minter Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
* https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
* <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
* opti... |
use super::*;
use graphs::{tygraph::Knowledge, *};
use std::convert::TryInto;
// ###### ARG BUILDER ##########################################################
pub struct ArgBuilder<'a> {
node: ArgNode,
in_ty: Kn,
out_ty: Kn,
compiler: &'a Compiler<'a>,
blk_in_ty: Option<Type>,
chgs: Chgs<'a>,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.