text stringlengths 7.05k 33.9k |
|---|
use crate::draw;
use crate::frame::Frame;
use crate::math::{BaseFloat, NumCast};
use crate::wgpu;
/// A helper type aimed at simplifying the rendering of conrod primitives via wgpu.
#[derive(Debug)]
pub struct Renderer {
_vs_mod: wgpu::ShaderModule,
_fs_mod: wgpu::ShaderModule,
render_pipeline: wgpu::Rende... |
#![cfg(target_os = "redox")]
extern crate orbclient;
use os::redox::orbclient::Renderer;
use error::Error;
use Result;
use mouse_handler;
use buffer_helper;
use key_handler::KeyHandler;
use InputCallback;
use {CursorStyle, MouseButton, MouseMode};
use {Key, KeyRepeat};
use {Scale, WindowOptions};
use {MenuItem, MenuI... |
// Copyright 2015-2021 Swim Inc.
//
// 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 ... |
// The following code is from (scipr-lab's zexe)[https://github.com/scipr-lab/zexe] and thanks for their work
//! This module contains an `EvaluationDomain` abstraction for
//! performing various kinds of polynomial arithmetic on top of
//! the scalar field.
//!
//! In pairing-based SNARKs like GM17, we need to calcul... |
// This file is part of Substrate.
// Copyright (C) 2019-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... |
#![allow(warnings)]
use std::{future::Future, path::PathBuf};
use std::sync::Arc;
use dotenv::dotenv;
use simplelog::*;
use structopt::StructOpt;
use std::fs::{self, File};
use std::io::{BufReader, Write};
use ::transcode::{
src_manifest::*,
};
use serde::Deserialize;
use shared::domain::jig::module::ModuleBody;
u... |
use super::*;
use crate::{
abi_stability::{
abi_checking::{AbiInstability,push_err},
},
const_utils::log2_usize,
std_types::{RSlice,RVec,RString},
};
///////////////////////////
/// The parts of the layout of an enum,that don't depend on generic parameters.
#[repr(C)]
#[derive(Copy, Clone, ... |
use std::fmt;
use std::iter;
use std::mem;
use std::ptr;
use std::collections::BTreeMap;
use rand::{thread_rng, Rng};
#[cfg(test)]
use quickcheck::quickcheck;
const DEFAULT_LEVEL: usize = 4;
type Link<T> = Option<Box<T>>;
#[derive(Debug)]
struct Rawlink<T> {
p: *mut T,
}
impl<T> Clone for Rawlink<T> {
fn... |
use rand::Rng;
use tcod::colors::*;
use tcod::console::*;
use tcod::input::{self, Event, Key, Mouse};
const SCREEN_WIDTH: i32 = 80;
const SCREEN_HEIGHT: i32 = 40;
const PLAN_WIDTH: i32 = 60;
const PLAN_HEIGHT: i32 = 30;
const BAR_WIDTH: i32 = 20;
const PANEL_HEIGHT: i32 = 7;
const PANEL_Y: i32 = SCREEN_HEIGHT - PANEL... |
// Copyright (c) Microsoft. All rights reserved.
//! This subcommand takes the super-config file, converts it into the individual services' config files,
//! writes those files, and restarts the services.
use std::path::Path;
use aziotctl_common::config as common_config;
use super::super_config;
const AZIOT_EDGED_... |
// 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.
//! library for host-side of filesystem integrity host-target interaction tests.
#![deny(missing_docs)]
use {
failure::{self, Fail},
rand::random... |
use std::{
cmp::{Eq, Ordering, PartialEq, PartialOrd},
ffi::CString,
fmt,
hash::{Hash, Hasher},
os::raw::{c_int, c_void},
panic::catch_unwind,
ptr,
sync::{Arc, Mutex},
};
use crate::{
aio::Aio,
error::{Error, Result, SendResult},
message::Message,
pipe::{Pipe, PipeEvent},
protocol::Protocol,
util::valida... |
#![doc(
html_logo_url = "https://raw.githubusercontent.com/rusoto/rusoto/master/assets/logo-square.png"
)]
#![cfg_attr(feature = "nightly-testing", feature(plugin))]
#![cfg_attr(not(feature = "unstable"), deny(warnings))]
#![deny(missing_docs)]
//! Types for loading and managing AWS access credentials for API requ... |
//! Curl agent that executes multiple requests simultaneously.
//!
//! The agent is implemented as a single background thread attached to a
//! "handle". The handle communicates with the agent thread by using message
//! passing. The agent executes multiple curl requests simultaneously by using a
//! single "multi" han... |
use bevy::{
app::{App, Events, Plugin, CoreStage},
ecs::prelude::*,
tasks::{IoTaskPool, TaskPool, Task},
core::FixedTimestep,
};
#[cfg(not(target_arch = "wasm32"))]
use crossbeam_channel::{unbounded, Receiver, Sender, SendError as CrossbeamSendError};
#[cfg(not(target_arch = "wasm32"))]
use std::sync::... |
use crate::config::dfinity::Config;
use crate::lib::builders::{
BuildConfig, BuildOutput, BuilderPool, CanisterBuilder, IdlBuildOutput, WasmBuildOutput,
};
use crate::lib::canister_info::CanisterInfo;
use crate::lib::environment::Environment;
use crate::lib::error::{BuildError, DfxError, DfxResult};
use crate::lib:... |
use std::{
fmt,
fs::File,
io::{BufReader, BufWriter, Error, ErrorKind, Read, Result, Seek, SeekFrom},
str::from_utf8,
};
use byteorder::{BigEndian, ByteOrder, LittleEndian, ReadBytesExt, WriteBytesExt};
use nalgebra::{Vector4, U3};
#[cfg(feature = "nifti_images")]
use crate::Affine;
use crate::{
o... |
use {
crate::{
settings_utils::{parse_settings, JsonAuctionManagerSettings},
vault_utils::{activate_vault, add_token_to_vault, combine_vault, initialize_vault},
AUCTION_PROGRAM_PUBKEY, PROGRAM_PUBKEY, TOKEN_PROGRAM_PUBKEY, VAULT_PROGRAM_PUBKEY,
},
clap::ArgMatches,
solana_clap_ut... |
use std::array::IntoIter;
use std::borrow::Cow;
use std::collections::HashSet;
use std::fmt::{Display, Formatter};
use std::str::FromStr;
use std::time::Duration;
use chrono::{DateTime, Utc};
use serde_json::{Map, Value};
use ton_block::{Block, Message, Transaction};
use ton_block_json::{BlockSerializationSet, Message... |
#![cfg_attr(docsrs, feature(doc_cfg))]
//! Coin CBC Rust bindings
//!
//! This crate exposes safe and efficient bindings to the Coin CBC C
//! API.
//!
//! For more information on how to install the `Cbc` library dependencies,
//! see [the respective README section](https://github.com/KardinalAI/coin_cbc/README.md#prer... |
// This module should use `config` to read `config.json`, then create a
// `stores` vector from the returned `Config` struct, containing all
// specified sites and their settings for the monitor to more easily and
// efficiently work with.
use crate::{alternative::Alternative as Alt, config, default, hidden, warning};... |
use fenris_geometry::proptest::half_plane;
use fenris_geometry::{assert_line_segments_approx_equal, prop_assert_line_segments_approx_equal};
use fenris_geometry::{ConvexPolygon, HalfPlane, Line2d, LineSegment2d, Triangle};
use nalgebra::{point, vector, Point2, Unit, Vector2};
use proptest::prelude::*;
use util::assert_... |
use crate::{
gpu::{BackgroundAndWindowDataSelect, InterruptRequest, ObjectSize, TileMap, GPU},
interrupt_flags::InterruptFlags,
joypad::{self, Joypad},
timer::{Frequency, Timer},
utils::bit,
};
pub const BOOT_ROM_BEGIN: usize = 0x00;
pub const BOOT_ROM_END: usize = 0xFF;
pub const BOOT_ROM_SIZE: us... |
use crate::command::Command;
use crate::error::Result;
use crate::options::{CopyOption, Direction, ScrollArea};
use crate::widgets::SelectableList;
#[cfg(feature = "clipboard")]
use copypasta_ext::{display::DisplayServer, prelude::ClipboardProvider};
use std::str::FromStr;
use std::time::Instant;
use systeroid_core::sy... |
// This file is part of Substrate.
// Copyright (C) 2019-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... |
#![doc = include_str!("../README.md")]
mod some;
pub mod hmac;
pub mod eddsa;
pub mod ecdsa;
pub mod rsa;
pub mod jwk;
use std::{
borrow::Cow,
fmt,
io::Write,
string::FromUtf8Error,
time::{Duration, SystemTime, UNIX_EPOCH},
};
use jwk::Jwk;
use openssl::error::ErrorStack;
use serde::{de::Dese... |
mod assignments;
mod completer;
mod flow;
mod fork;
mod history;
mod job;
pub mod flags;
pub mod fork_function;
pub mod status;
pub mod variables;
pub(crate) mod binary;
pub(crate) mod colors;
pub(crate) mod directory_stack;
pub(crate) mod flow_control;
pub(crate) mod pipe_exec;
pub(crate) mod plugins;
pub(crate) mod s... |
use libc::{c_int, c_uint};
pub const DW_TAG_array_type: c_int = 0x01;
pub const DW_TAG_class_type: c_int = 0x02;
pub const DW_TAG_entry_point: c_int = 0x03;
pub const DW_TAG_enumeration_type: c_int = 0x04;
pub const DW_TAG_formal_parameter: c_int = 0x05;
pub const DW_TAG_imported_declaration: c_int = 0x08;
pub const D... |
//! [`lazy_id::Id`](Id) is a thread-safe 64-bit id that only initializes itself
//! to a specific value when you use it rather than when you create it.
//!
//! Why would this be helpful? If you need a unique per-instance `Id` for your
//! type, usually the approach is a global atomic that you increment each time
//! yo... |
// Copyright 2015-2017 <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 std::ops::Neg;
use crate::{
collections::TypedUsize,
crypto_tools::{
constants, k256_serde,
paillier::{
secp256k1_modulus, to_bigint, to_scalar,
utils::{member_of_mod, member_of_mul_group},
zk::ZkSetup,
Ciphertext, EncryptionKey, Plaintext, Ra... |
//! This provides the logic for the finalized and head chains.
//!
//! Each chain type is stored in it's own map. A variety of helper functions are given along with
//! this struct to simplify the logic of the other layers of sync.
use super::chain::{ChainId, ChainSyncingState, ProcessingResult, SyncingChain};
use sup... |
use std::{mem, ptr};
use std::ops::Range;
use std::marker::PhantomData;
use gl;
use gl::types::*;
use super::*;
/// A GPU buffer which holds a list of a custom vertex type. This struct also has utility methods
/// for rendering the vertices as primitives.
///
/// # Deriving [`Vertex`](trait.Vertex.html)
/// A custo... |
use std::mem;
use libc::c_void;
use bw_dat::{tech, unit, upgrade, Game, TechId, Unit, UnitId, UpgradeId};
use crate::ai::{self, PlayerAi};
use crate::ai_spending::{DatReqSatisfyError, RequestSatisfyError};
use crate::aiscript::Town;
use crate::bw;
use crate::globals::Globals;
use crate::list::ListIter;
use crate::un... |
//! Functions for parallel processing of record sets and records.
//!
//! Sequences are read and processed in batches (`RecordSet`) because sending
//! data across channels has a performance impact. The process works as follows:
//!
//! * Sequence parsing is done in a background thread
//! * Record sets are sent to wor... |
use super::TriangleVertex;
use crate::{
math::*, Bounded, BoundingBox, DefaultPrimitive, DefaultSkinnable, DefaultTransformable,
GeometryHitResult, Intersectable, KDTree, Ray,
};
use anyhow::{anyhow, Result};
use std::iter::FromIterator;
pub const TRIANGLE_MESH_GROUP_SIZE: usize = 128;
#[derive(Debug, Clone)]... |
#![allow(unused_assignments)]
#![allow(clippy::not_unsafe_ptr_arg_deref)]
use cgmath::prelude::*;
use exr::prelude::rgba_image::*;
use rayon::prelude::*;
use std::{
ffi::CStr,
mem,
os::raw::{c_char, c_int, c_void},
ptr,
};
#[repr(C)]
#[derive(Debug)]
struct ImageData {
data: Vec<f32>,
offset: i... |
//! Yet another axis-aligned bounding box (AABB), biased towards ray tracing.
//!
//! The design is loosely based on the `BBox` class from the second edition of *Physically
//! based rendering: From theory to implementation* by <NAME> and <NAME>.
//! Consequently, it is geared to the demands of ray tracing and similar ... |
use instrs::Instr;
use state::State;
use process::Process;
#[inline]
pub fn run<'a>(process: &mut Process<'a>) {
process.set_state(State::Running);
while process.get_state() != State::Terminated {
if let Some(instr) = process.next() {
evaluate_instr(process, Process::to_instr(instr));
... |
extern crate tokio;
use super::resp::*;
use tokio::prelude::*;
use tokio::io::copy;
use tokio::net::{TcpListener, TcpStream};
use tokio::codec::Framed;
use futures::prelude::*;
use futures::future::*;
use futures::{Stream, Future};
use futures::stream::SplitSink;
use raft::errors::*;
use std::sync::{Mutex, Arc};
use... |
/*
* Copyright 2018-2020 TON DEV SOLUTIONS LTD.
*
* Licensed under the SOFTWARE EVALUATION License (the "License"); you may not use
* this file except in compliance with the License.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS I... |
//! io_uring interface.
/// IO submission data structure (Submission Queue Entry)
#[repr(C)]
pub struct io_uring_sqe {
pub opcode: IoRingOp, /* type of operation for this sqe */
pub flags: libc::__u8, /* IOSQE_ flags */
pub ioprio: libc::__u16, /* ioprio for the request */
pub fd: libc::__s32, ... |
//! # IPFS sqlite block store
//!
//! A block store for a rust implementation of [ipfs](https://ipfs.io/).
//!
//! # Concepts
//!
//! ## Aliases
//!
//! An alias is a named pin of a root. When a root is aliased, none of the leaves of the dag pointed
//! to by the root will be collected by gc. However, a root being alia... |
use super::elfxx::*;
use super::parser::*;
use std::convert::TryInto;
type Elf32Addr = u32;
type Elf32Half = u16;
type Elf32Off = u32;
type Elf32Word = u32;
pub struct Elf32Ehdr {
e_ident: [u8; 16],
e_type: Elf32Half,
e_machine: Elf32Half,
e_version: Elf32Word,
e_entry: Elf32Addr,
e_phoff: Elf... |
use std::collections::HashMap;
use std::path::PathBuf;
use thiserror::Error;
use crate::CryptoError;
use crate::parser::file::{FileParseError, FileReconstructionError};
use crate::parser::library::{LibraryParseError, LibraryReconstructionError};
use crate::parser::logic::{LogicParseError, LogicReconstructionError};
use... |
//! Bidirectional type checking of the core syntax.
//!
//! This is used to verify that the core syntax is correctly formed, for
//! debugging purposes.
use std::error::Error;
use std::fmt;
use crate::nbe::{self, NbeError};
use crate::syntax::core::{Item, RcTerm, Term};
use crate::syntax::domain::{RcType, RcValue, Va... |
extern crate clap;
extern crate impostor;
use clap::{App, Arg};
use impostor::adapter::BusAdapter;
use impostor::audio::Piano;
use impostor::memcontroller::MemoryControllerSmart;
use impostor::mos6502::MOS6502;
use impostor::ram::Ram;
use impostor::random::Random;
use impostor::rom::Rom;
use impostor::unixterm::UnixT... |
use {Instruction, Error};
use {inst, math};
pub fn read<I>(mut bytes: I) -> Result<Instruction, Error>
where I: Iterator<Item=u8> {
let b1 = bytes.next().unwrap();
let b2 = bytes.next().unwrap();
// must reverse endianess
let bits16 = ((b2 as u16)<<8) | (b1 as u16);
if let Some(i) = self::tr... |
use core::fmt;
use std::convert::TryInto;
use std::sync::Arc;
use anyhow::{anyhow, Error, Result};
use hashbrown::HashMap;
use serde::de::value::{MapAccessDeserializer, SeqAccessDeserializer};
use serde::de::{MapAccess, SeqAccess, Visitor};
use serde::{Deserialize, Deserializer};
use tantivy::collector::TopDocs;
use t... |
use crate::filesystem;
use crate::Configuration;
use crate::EngineName;
use crate::engines::get_sql_engine;
use crate::filesystem::{File, get_sql, get_file_path_without_migration_path};
use crate::commands::up::process_up_sql;
use crate::commands::down::process_down_sql;
use crate::helpers::{limit_number, limit_per_dat... |
use core::fmt::{self, Write};
use core::mem::{size_of, transmute};
use core::slice::from_raw_parts;
use libc::c_char;
extern "C" {
// dl_iterate_phdr takes a callback that will receive a dl_phdr_info pointer
// for every DSO that has been linked into the process. dl_iterate_phdr also
// ensures that the dy... |
//! Collections of flashcards.
use std::collections::HashMap;
use std::{num, mem, fmt, error};
use chrono;
use crate::cards;
use crate::settings;
/// A collection of flashcards, without any data about learning state.
#[derive(Debug)]
pub struct Deck {
/// The global settings.
pub settings: settings::GlobalS... |
//! Configs for all 0L apps.
use anyhow::{bail, Error};
use diem_config::config::NodeConfig;
use diem_global_constants::{CONFIG_FILE, NODE_HOME};
use diem_types::{
account_address::AccountAddress, transaction::authenticator::AuthenticationKey,
waypoint::Waypoint,
};
use dirs;
use once_cell::sync::Lazy;
use req... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - System ROM configuration register 0"]
pub rom_ctrl_0: crate::Reg<rom_ctrl_0::ROM_CTRL_0_SPEC>,
#[doc = "0x04 - System ROM configuration register 1"]
pub rom_ctrl_1: crate::Reg<rom_ctrl_1::ROM_CTRL_1_SPEC>,
#[doc = "0x08... |
#![cfg_attr(not(feature = "std"), no_std)]
// Make the WASM binary available.
#[cfg(feature = "std")]
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
/// Wasm binary unwrapped. If built with `SKIP_WASM_BUILD`, the function panics.
#[cfg(feature = "std")]
pub fn wasm_binary_unwrap() -> &'static [u8] {
WASM_BIN... |
pub mod canned_histories;
mod history_builder;
mod history_info;
pub(crate) use history_builder::{TestHistoryBuilder, DEFAULT_WORKFLOW_TYPE};
use crate::{
pollers::{
BoxedActPoller, BoxedPoller, BoxedWFPoller, MockManualPoller, MockPoller,
MockServerGatewayApis,
},
task_token::TaskToken,
... |
/***********************************************************************
* proto-system/src/panel.rs
* Prototype for development of an initial Elliott 503 operator
* control panel with pushbottons and lamps.
* Copyright (C) 2020, <NAME>.
* Licensed under the MIT License, see
* http://www.opensource.org/licens... |
use crate::{format_url, upload_file_to_bucket, Error};
use chrono::{DateTime, Utc};
use daedalus::download_file;
use daedalus::minecraft::{Argument, ArgumentType, Library, VersionManifest, VersionType};
use daedalus::modded::{LoaderVersion, Manifest, PartialVersionInfo, Processor, SidedDataEntry};
use lazy_static::lazy... |
//! A build dependency for running the correct autotools commands to build a native library
//!
//! This crate provides the facilities to setup the build system and build native libraries
//! that leverage `autotools` or `configure & make` workalike scripts.
//!
//! ## Installation
//!
//! Add to your `Cargo.toml` a bu... |
//! Datatypes to represent diagnostics emitted by smetamath analysis passes.
//!
//! This includes an enum-based representation suited for programmatic
//! interpretation and testing, as well as a mostly-text representation which
//! can be used for various human-readable outputs.
use parser::as_str;
use parser::Compa... |
//!
//! # Consume CLI
//!
//! CLI command for Consume operation
//!
use std::{io::Error as IoError, path::PathBuf};
use std::io::{self, ErrorKind, Read, Stdout};
use std::collections::{BTreeMap};
use flate2::Compression;
use flate2::bufread::GzEncoder;
use fluvio_controlplane_metadata::tableformat::{TableFormatSpec};
... |
// remove this after dependencies has been added
#![allow(dead_code)]
use std::mem::swap;
/// # Arguments
/// * `m` `1 <= m`
///
/// # Returns
/// x mod m
/* const */
pub(crate) fn safe_mod(mut x: i64, m: i64) -> i64 {
x %= m;
if x < 0 {
x += m;
}
x
}
/// Fast modular by barrett reduction
/// ... |
// Copyright 2020 TiKV Project Authors. Licensed under Apache-2.0.
use std::cell::RefCell;
use std::ops::{Bound, Deref};
use std::sync::{Arc, RwLock};
use collections::HashMap;
use engine_rocks::RocksEngine;
use engine_traits::{
IterOptions, KvEngine, ReadOptions, CF_DEFAULT, CF_WRITE, DATA_KEY_PREFIX_LEN,
};
use... |
//! A connector to directly consume Nakadi Streams
use std::error::Error as StdError;
use std::fmt;
use std::time::{Duration, Instant};
use futures::stream::{BoxStream, StreamExt};
use http::StatusCode;
use tokio::time::{sleep, timeout};
pub use crate::components::{
streams::{EventStream, EventStreamBatch, EventS... |
use std::ffi::CString;
use ash::version::DeviceV1_0;
use ash::prelude::VkResult;
use std::mem::ManuallyDrop;
use ash::vk;
use super::VkInstance;
use super::VkCreateInstanceError;
use super::VkDevice;
use super::VkSkiaContext;
use super::VkSwapchain;
use super::VkSkiaRenderPass;
use super::MAX_FRAMES_IN_FLIGHT;
use ... |
#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#![allow(dead_code)]
use std::{slice, ffi::c_void, ptr};
use num_derive::{
FromPrimitive,
ToPrimitive
};
use crate::utils::to_widestring;
use crate::types::{
mdToken,
mdTypeDef,
COR_SIGNATURE,
ULONG,
LPWSTR,
DWORD,
... |
//! インタプリタ Node を順に実行する
// 走者 - Vec<Node>を順に実行
use crate::{tokenizer, parser};
use crate::node::*;
use crate::sys_function_debug;
use crate::sys_function;
pub fn run_node(ctx: &mut NodeContext, cur: &Node) -> Option<NodeValue> {
let mut result = NodeValue::Empty;
match cur.kind {
NodeKind::Nop => {},
... |
//! Implementation of the SAM4L CRCCU.
//!
//! See datasheet section "41. Cyclic Redundancy Check Calculation Unit (CRCCU)".
//!
//! The SAM4L can compute CRCs using three different polynomials:
//!
//! * `0x04C11DB7` (as used in "CRC-32"; Atmel calls this "CCIT8023")
//! * `0x1EDC6F41` (as used in "CRC-32C"; Atmel... |
//! Here we handle incoming connections and communication on the RPC socket.
//! Actual JSONRPC2 commands are handled in the `api` mod.
use crate::{
jsonrpc::{
api::{JsonRpcMetaData, RpcApi, RpcImpl},
UserRole,
},
threadmessages::RpcMessageIn,
};
use common::assume_some;
use std::{
col... |
#![deny(missing_docs)]
//!
//! Bitcoind
//!
//! Utility to run a regtest bitcoind process, useful in integration testing environment
//!
//! ```no_run
//! use core_rpc::RpcApi;
//! let bitcoind = bitcoind::BitcoinD::new("/usr/local/bin/bitcoind").unwrap();
//! assert_eq!(0, bitcoind.client.get_blockchain_info().unwrap... |
use std::fs;
use std::sync::Arc;
use std::io::{Error, Result, ErrorKind};
use std::path::{Path, PathBuf, Component};
use futures::future::FutureExt;
use toml;
use r#async::rt::AsyncRuntime;
use async_file::file::{create_dir, remove_file, AsyncFileOptions, WriteOptions, AsyncFile};
use bytes::{BufMut};
us... |
// 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.
use {at_commands as at, core::fmt::Debug, tracing::warn};
use crate::peer::{
calls::types::{Call, CallHeld, CallSetup},
update::AgUpdate,
};
/// ... |
use std::time::Instant;
use glutin::{
event::{
ElementState,
Event,
KeyboardInput,
VirtualKeyCode,
WindowEvent,
},
event_loop::{
ControlFlow,
EventLoop,
},
window::WindowBuilder,
ContextBuilder,
};
use vg::{
renderer::OpenGl,
Alig... |
use crate::common::{BinarySerializable, VInt};
use crate::directory::ReadOnlySource;
use crate::fieldnorm::FieldNormReader;
use crate::postings::compression::{
AlignedBuffer, BlockDecoder, VIntDecoder, COMPRESSION_BLOCK_SIZE,
};
use crate::postings::{BlockInfo, FreqReadingOption, SkipReader};
use crate::query::BM25... |
use std::{
net::SocketAddr,
sync::Arc,
time::{Duration, Instant},
};
use byteorder::{LittleEndian, ReadBytesExt};
use futures::{self, Async, AsyncSink, Future, Sink, Stream};
use parking_lot::Mutex;
use tokio::net::TcpStream;
use tokio::prelude::*;
use tokio::runtime::TaskExecutor;
use tokio::timer::Delay;... |
//! An interface to the DHT Digital Humidity and Temperature sensors.
//!
//! # Design
//! The design of this crate is inspired by:
//! - The [Adatfruit DHT cpp](https://github.com/adafruit/DHT-sensor-library/blob/master/DHT.cpp) code
//! - The [dht-hal-drv](https://crates.io/crates/dht-hal-drv) crate
//! - The [dht-ha... |
//! Periodic Interrupt Timer (PIT)
//!
//! # Example
//!
//! ```no_run
//! use imxrt_hal;
//! use embedded_hal::timer::CountDown;
//!
//! let mut peripherals = imxrt_hal::Peripherals::take().unwrap();
//!
//! let (_, ipg_hz) = peripherals.ccm.pll1.set_arm_clock(
//! imxrt_hal::ccm::PLL1::ARM_HZ,
//! &mut periph... |
//! Local APIC implementation providing support to access the APIC in either
//! xapic or x2apic mode depending on what is supported
use core::mem::size_of;
use core::convert::TryInto;
use crate::mm::alloc_virt_addr_4k;
use crate::interrupts::{InterruptFrame, AllRegs};
use page_table::{PageType, PAGE_NX, PAGE_WRITE,... |
// main.rs
//
// Copyright (C) 2019-2020 Minnesota Department of Transportation
//
use clap::{App, AppSettings, Arg, ArgMatches, SubCommand};
use env_logger::Env;
use log::{debug, error, info, warn};
use serde::{Deserialize, Serialize};
use std::fs::{create_dir_all, File};
use std::io::{BufRead, BufReader, ErrorKind};... |
// Copyright 2020 <NAME>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE-2.0 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
// except according to t... |
use failure;
use gl;
use nalgebra as na;
use crate::render_gl::{self, buffer, data};
use crate::resources::Resources;
#[derive(VertexAttribPointers, Copy, Clone, Debug)]
#[repr(C, packed)]
struct Vertex {
#[location = "0"]
pos: data::f32_f32_f32,
#[location = "1"]
clr: data::u2_u10_u10_u10_... |
use std::collections::{HashMap, HashSet};
use std::pin::Pin;
use std::sync::{Arc, Mutex};
use std::task::{Context, Poll};
use std::time::Duration;
#[cfg(feature = "tls")]
use crate::exop_impl::StartTLS;
use crate::ldap::Ldap;
use crate::protocol::{ItemSender, LdapCodec, LdapOp, MaybeControls, ResultSender};
use crate:... |
use std::{
borrow::Borrow,
collections::HashMap,
cell::{ RefCell, RefMut },
marker::PhantomData,
rc::{ Rc, Weak }
};
use raw_window_handle::{
HasRawWindowHandle,
RawWindowHandle
};
use winit::{
dpi::{
LogicalPosition,
LogicalSize,
Pixel
},
error::{
... |
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct TrdRegTimestamps {
/// NoTrdRegTimestamps
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(rename = "768")]
pub trd_reg_timestamps: Option<fix_common::RepeatingValues<TrdRegTimestamp>>,
}
... |
/* ************************************************************************ **
** This file is part of rsp2, and is licensed under EITHER the MIT license **
** or the Apache 2.0 license, at your option. **
** **
** ... |
use std::collections::{HashMap, HashSet};
use std::fmt::{Display, Formatter};
use std::fs::File;
use std::hash::{Hash, Hasher};
use std::io;
use std::io::{BufRead, BufReader, ErrorKind};
use std::path::PathBuf;
use std::sync::Arc;
use anyhow::anyhow;
use hdrhistogram::Histogram;
use itertools::Itertools;
use metrohash... |
/*!
Functions to produce a compilation artifact from source code input.
Accepts a program and/or query as a string and turns it into a sequence
of operations, an in-memory representation, and/or assembly source code.
The compilation pipeline is this:
```
text -> [`parser::parse`] -> `Term`s ->⋯
┌───... |
/*
* enums.rs - Enumerators containing OpenCL Constants.
*
* Copyright 2020-2021 <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... |
//! DSP-n cartridge coprocessor handling types
//!
//! # Literature
//!
//! - https://www.caitsith2.com/snes/dsp/
//! - https://datasheet.datasheetarchive.com/originals/scans/Scans-003/Scans-0079458.pdf
//! - SNES book 2 - Section 3
use crate::timing::Cycles;
use save_state::{InSaveState, SaveStateDeserializer, SaveSt... |
// Copyright (c) 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 www.a... |
use dust::*;
use dust::objects::*;
use dust::window::{event::*, Window};
use geo_proc::*;
use tri_mesh::mesh::Mesh;
use tri_mesh::prelude::Vec3 as Vec3;
use tri_mesh::prelude::vec3 as vec3;
use tri_mesh::MeshBuilder;
fn main() {
let mut window = Window::new_default("Geometry visualiser").unwrap();
let (width,... |
use core::fmt::Write;
use embedded_graphics::mono_font::{ascii::FONT_10X20, MonoTextStyle};
use embedded_graphics::pixelcolor::Rgb565;
use embedded_graphics::prelude::*;
use embedded_graphics::primitives::{Circle, PrimitiveStyle, PrimitiveStyleBuilder, Rectangle};
use embedded_graphics::text::{Alignment, Text};
use hea... |
#![cfg_attr(docsrs, feature(doc_cfg))]
//! A fast, asynchronous terminal paging library for Rust. `minus` provides high
//! level functions to easily embed a pager for any terminal application.
//!
//! `minus` can be used in asynchronous mode or in a blocking fashion
//!
//! * In asynchronous mode, the pager's data as... |
use std::collections::HashMap;
use std::str::FromStr;
use std::env;
use std::path::Path;
use crate::common::defs::*;
use crate::config::GemBS;
mod lex;
mod find_var;
mod gembs_json;
use lex::{Lexer, LexToken};
use find_var::{find_var, Segment};
#[derive(Debug, Clone)]
struct PrepConfigVar {
var: DataValue,
vtype... |
use super::*;
use crate::block::Block;
use crate::serialization::ZcashDeserialize;
use color_eyre::eyre::Report;
use proptest::prelude::*;
use std::sync::Arc;
// Alias the struct constants here, so the code is easier to read.
const PRECISION: u32 = CompactDifficulty::PRECISION;
const SIGN_BIT: u32 = CompactDifficult... |
//! This malloc frequency profiler helps detect program hotspots that perform a large number of
//! memory allocations. Many small allocations can slow down your application
//! and lead to memory fragmentation. Typical symptoms include seeing `malloc` at the top of the
//! application's CPU profile, as well as obser... |
use std::cell::RefCell;
use crate::scanner::{StringInContext, Token, TokenInContext};
use crate::scanner::Token::{GREATER, GREATER_EQUAL, LESS, LESS_EQUAL, PLUS, SLASH, MULT, LITERAL, LPAREN, RPAREN, BANG_EQUAL, EQUAL_EQUAL, VAR, SEMICOLON, LBRACE};
use crate::source_ref::{Source, SourceRef};
use std::rc::Rc;
use crate... |
///! Stabilizer ADC management interface
///!
///! # Design
///!
///! Stabilizer ADCs are connected to the MCU via a simplex, SPI-compatible interface. The ADCs
///! require a setup conversion time after asserting the CSn (convert) signal to generate the ADC
///! code from the sampled level. Once the setup time has ela... |
#![allow(non_snake_case, dead_code, unused_imports, unused_macros)]
use rand::prelude::*;
use std::io::prelude::*;
use proconio::{input, marker::*};
use svg::node::element::{Rectangle, Circle, Path, path::Data};
pub trait SetMinMax {
fn setmin(&mut self, v: Self) -> bool;
fn setmax(&mut self, v: Self) -> bool;
}
im... |
use std::fmt::Display;
use common::{parse::unsigned_number, prelude::*};
use log::debug;
use nom::{
branch::alt,
bytes::complete::tag,
character::complete::multispace0,
combinator::{all_consuming, into, map, value},
multi::{many1, separated_list1},
sequence::terminated,
IResult,
};
pub fn ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.