text stringlengths 7.05k 33.9k |
|---|
use anyhow::{bail, Result};
use clap::Clap;
// use toml::to_string;
use std::os::unix::io::{AsRawFd, FromRawFd};
use std::path::PathBuf;
use std::process::{Command, Stdio};
use std::sync::mpsc;
use std::sync::{Arc, Mutex};
use std::thread;
use std::time::{Duration, Instant};
mod fileio;
mod print_console;
pub use crat... |
//! Implementation of command line option for running server
use crate::commands::tracing;
use crate::influxdb_ioxd;
use clap::arg_enum;
use core::num::NonZeroU16;
use data_types::server_id::ServerId;
use std::{net::SocketAddr, net::ToSocketAddrs, path::PathBuf};
use structopt::StructOpt;
use thiserror::Error;
/// Th... |
// Copyright 2018 The Vault713 Developers
// Modifications Copyright 2019 The Gotts 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/LIC... |
/* This is dvipdfmx, an eXtended version of dvipdfm by <NAME>.
Copyright (C) 2002-2016 by <NAME> and <NAME>,
the dvipdfmx project team.
Copyright (C) 1998, 1999 by <NAME> <<EMAIL>>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public Li... |
//! Provides an `ObservedAggregates` struct which allows us to reject aggregated attestations or
//! sync committee contributions if we've already seen them.
use std::collections::HashSet;
use std::marker::PhantomData;
use tree_hash::TreeHash;
use types::consts::altair::{
SYNC_COMMITTEE_SUBNET_COUNT, TARGET_AGGREG... |
use std::io::{Read, Write};
use std::fs::File;
use std::error::Error;
use rand::Rng;
use rand::distributions::{Weighted, WeightedChoice, IndependentSample};
use std::cmp;
use tcod::console::*;
use tcod::colors::{self, Color};
use tcod::map::{Map as FovMap, FovAlgorithm};
use tcod::input::Key;
use tcod::input::{self... |
extern crate web_sys;
extern crate rand;
mod utils;
pub mod player;
pub mod map;
use wasm_bindgen::prelude::*;
use rand::Rng;
use rand::prelude::*;
pub use crate::map::*;
pub use crate::map::territory::*;
pub use crate::player::Player;
macro_rules! log {
( $( $t:tt )* ) => {
web_sys::console::log_1(&fo... |
use std::collections::HashMap;
type Dim = u16;
type Time = u16;
type Coord = i32;
// x and y take 5 bits; the other dimensions take in total (1 + nrounds) * log_2(dimensions).
// 54 / 7 is 7, so this could support up to 127 dimensions.
type Pos = i64;
// Since only 0, 1, 2, 3, 4+ matter, can use a u8 and saturating ad... |
use crate::cli::RunCommand;
use crate::polling::providers::{InitializationError, KubernetesOptions, Provider};
use crate::shared::{CollectionEvent, CollectionMethod, CollectionTarget};
use crate::shell::Shell;
use crate::util::{self, CgroupManager, CgroupPath, CgroupSlices, GetCgroupError, ItemPool};
use anyhow::Error;... |
use crate::error::{MetricsResult, StorageError};
use crate::ir::{TsPoint, TsValue};
use crate::IntoPoint;
use chrono::offset::Utc;
use chrono::DateTime;
use log::{error, trace};
use reqwest::header::{HeaderMap, HeaderValue, ACCEPT};
use serde::de::DeserializeOwned;
/**
* Copyright 2019 Comcast Cable Communications Mana... |
use glam::*;
use rtbvh::{Ray, RayPacket4};
use std::f32::consts::PI;
use crate::constants::DEFAULT_T_MAX;
pub mod frustrum;
pub use frustrum::*;
#[cfg(feature = "object_caching")]
use serde::{Deserialize, Serialize};
pub fn vec4_sqrt(vec: Vec4) -> Vec4 {
#[cfg(any(target_arch = "x86_64", target_arch = "x86"))]... |
use crate::{
gen::{
helpers::*,
http,
},
parse::Endpoint,
};
use syn;
/// Structure for a request type constructor associated function.
struct Constructor {
ident: syn::Ident,
doc_comment: Option<String>,
params_fields: Vec<(syn::Ident, syn::Ty)>,
body_field: Option<(syn::Id... |
//! Channel and mount space.
use crate::{
dev::Device,
error::{Error, Result},
vm::VmObject,
};
use alloc::{
sync::{Arc, Weak},
vec::Vec,
};
use core::{convert::TryFrom, fmt::Debug, iter, mem::MaybeUninit, str};
use kalloc::wrapper::vec_push;
use ksched::{
sync::{Mutex, RwLock},
task::yield... |
use regex::Regex;
use std::cmp::{Eq, PartialEq};
use std::convert::TryFrom;
use std::{fmt, ops};
use std::io::{stdin, stdout, Write};
use termion::{clear, color, cursor};
use PieceType::{King, Queen, Rook, Bishop, Knight, Pawn};
use PieceColor::{White, Black};
/// A chess game.
///
/// Stores the current board state... |
//! Implementation of concepts from chapter 10 of <NAME>'s
//! [Computer Graphics from Scratch](https://gabrielgambetta.com/computer-graphics-from-scratch/)
//! book. I am not affiliated with Gabriel or his book in any way.
//!
//! This code renders two wireframe cubes by modifying the code for the previous example to
... |
use crate::passes::dataflow::domain::bitmap_u16::{BitArray, BITS_LEN};
use std::{
mem::{size_of, transmute, MaybeUninit},
simd::{mask64x4, u64x4},
sync::atomic::{AtomicPtr, Ordering},
};
#[cfg(target_arch = "x86")]
use std::arch::x86::*;
#[cfg(target_arch = "x86_64")]
use std::arch::x86_64::*;
pub(super) ... |
#![no_std]
#![cfg_attr(feature = "alloc", feature(alloc))]
#![cfg_attr(feature = "collections", feature(collections))]
#![cfg_attr(feature = "const_fn", feature(const_fn))]
//! See documentation for the [struct AtomicRingBuffer](struct.AtomicRingBuffer.html).
#[cfg(any(test, feature = "std"))]
#[macro_use]
extern cra... |
use std::path::Path;
use std::path::PathBuf;
use std::thread;
use chrono::prelude::*;
use chrono_tz::Tz;
use directories::ProjectDirs;
use gtk::prelude::*;
use gtk::Menu;
use libappindicator::{AppIndicator, AppIndicatorStatus};
use notify_rust::Notification;
use crate::domain::Event;
use crate::CalendarMessages::{Eve... |
use std::str;
use std::vec::Vec;
use std::collections::HashMap;
use std::collections::HashSet;
use std::sync::Arc;
use std::fs::File;
use std::io::{BufWriter, Write};
use std::io::stdout;
use std::ops::Range;
use anyhow::{Result, anyhow};
use cassette_reannotation::*;
use cassette_reannotation::indexed_annotation::*;
... |
#![allow(dead_code)]
use crate::physics_lib::{DoF, State};
use crate::DT;
use core::f32;
#[derive(Clone, Copy)]
pub struct ControlParams {
pub position_smd: SMD,
pub yaw_smd: SMD,
pub z_smd: SMD,
pub yaw_allowance: f32,
pub yaw_speed_allowance: f32,
pub max_speed: f32,
pub zero_speed_allow... |
use fenris_geometry::{HalfSpace, LineSegment2d, Polygon2d, SimplePolygon2d, SimplePolygon3d, Triangle};
use matrixcompare::{assert_matrix_eq, assert_scalar_eq};
use nalgebra::{clamp, point, vector, Isometry3, Point2, Point3, Vector2, Vector3};
use fenris::eyre;
use fenris::vtkio::model::{ByteOrder, DataSet, PolyDataPi... |
use Settings;
use cart::Cart;
use memory::MemSegment;
use screen::Screen;
use std::cell::UnsafeCell;
use std::cmp;
use std::default::Default;
use std::rc::Rc;
mod ppu_reg;
use ppu::ppu_reg::*;
mod ppu_memory;
use ppu::ppu_memory::*;
mod sprite_rendering;
use ppu::sprite_rendering::*;
mod backgroun... |
use std::iter;
use proc_macro2::{self, TokenTree, Delimiter, Spacing, Span};
use crate::error::{Result, Error};
use crate::buffer::QTokens;
use crate::language::*;
type TokenStream = iter::Peekable<<proc_macro2::TokenStream as IntoIterator>::IntoIter>;
enum ContextItem {
ZeroPoint { tokens: QTokens },
If { ... |
/// License: See LICENSE file
extern crate mavlink;
use std::sync::Arc;
use std::thread;
use std::time::{Duration, SystemTime};
use sensulator::Sensulator;
const STD_PRESS: f64 = 101325.0; // static pressure at sea level (Pa)
const STD_TEMP: f64 = 288.15; // standard temperature at sea level (K)
const LAPSE_R... |
pub mod patch_cli;
use globset::Glob;
use std::fs::File;
use std::io::{Read, Write};
use std::path::{Path, PathBuf};
use svd_parser::svd::{
addressblock::AddressBlockBuilder, interrupt::InterruptBuilder, Access, AddressBlock,
AddressBlockUsage, ClusterInfo, ClusterInfoBuilder, Cpu, CpuBuilder, Endian, Enumerat... |
// async Related
use flume::{unbounded, Sender};
use pyrinas_shared::ota::{self, OtaUpdateVersioned, OtaVersion};
use std::io::Write;
use std::net::{Ipv4Addr, SocketAddrV4};
// Std
use std::fs::{self, File};
// Local lib related
use crate::{settings, Event};
use pyrinas_shared::ota::v2::{
OTAImageData, OTAImageTy... |
use c04_advanced_opengl::{process_events, process_input, Camera, Shader};
use cgmath::prelude::*;
use cgmath::{perspective, Deg, Matrix4, Point3};
use dx::{
assets,
gles::{core30::gl, enums::*},
utils::*,
Instance,
};
use image::GenericImageView;
use std::path::PathBuf;
use std::{mem, time::SystemTime};... |
// 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.
use failure::{bail, format_err, Error, ResultExt};
use fidl_fuchsia_ui_input as uii;
use fidl_fuchsia_ui_input2 as ui_input;
use fidl_fuchsia_ui_text as tx... |
use crate::{
core::{
camera::{BaseCamera, Camera, CameraSample},
film::Film,
geometry::{Bounds2f, Normal3f, Point2f, Point3f, Ray, Union, Vector3, Vector3f},
lowdiscrepancy::radical_inverse,
pbrt::{lerp, quadratic, Float},
reflection::refract,
transform::{Anim... |
// Copyright 2015 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 ... |
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (c) 2012, 2010 <NAME> <<EMAIL>>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code mus... |
//! # References
//!
//! - [RFC4944 Transmission of IPv6 Packets over IEEE 802.15.4 Networks][rfc4944]
//!
//! [rfc4944]: https://tools.ietf.org/html/rfc4944
//!
//! - [RFC6775 Neighbor Discovery Optimization for IPv6 over Low-Power Wireless Personal Area
//! Networks (6LoWPANs)][rfc6775]
//!
//! [rfc6775]: https://too... |
// Copyright 2017 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 ... |
//! Various probability distributions for sampling light sources.
// std
use std::rc::Rc;
use std::sync::Arc;
// others
use atom::AtomSetOnce;
use atomic::{Atomic, Ordering};
use strum::IntoEnumIterator;
// pbrt
use crate::core::geometry::{Bounds3f, Normal3f, Point2f, Point3f, Point3i, Vector3f, XYZEnum};
use crate::c... |
//! Sciter host application helpers.
use ::{_API};
use capi::scdef::SCITER_RT_OPTIONS;
use capi::sctypes::*;
use capi::screquest::HREQUEST;
use capi::schandler::NativeHandler;
use dom::event::EventHandler;
use eventhandler::*;
use value::{Value};
pub use capi::scdef::{LOAD_RESULT, SCN_LOAD_DATA, SCN_DATA_LOADED, SCN_... |
use crate::{error::Error, Block};
use serde_derive::{Deserialize, Serialize};
use ssz_derive::{Decode, Encode};
use std::collections::HashMap;
use types::{AttestationShufflingId, Epoch, Hash256, Slot};
#[derive(Clone, PartialEq, Debug, Encode, Decode, Serialize, Deserialize)]
pub struct ProtoNode {
/// The `slot` ... |
//! Hierarchy and transform propagation stress test.
//!
//! Running this example:
//!
//! ```
//! cargo r --release --example transform_hierarchy <configuration name>
//! ```
//!
//! | Configuration | Description |
//! | -------------------- | --------------... |
use std::collections::{BTreeMap, BTreeSet};
use std::sync::Arc;
use std::time;
use hbbft::dynamic_honey_badger::{
Batch, Change, ChangeState, DynamicHoneyBadger, Input, JoinPlan,
};
use hbbft::sender_queue::{SenderQueue, Step};
use hbbft::{util, Epoched, PubKeyMap};
use hbbft_testing::adversary::{Adversary, Reorde... |
use std::ffi::CStr;
use std::ptr::null_mut;
use arrayvec::ArrayVec;
use lazy_static::lazy_static;
use libc::c_void;
use super::{BwScr, scr};
use super::thiscall::Thiscall;
pub fn open_file_hook(
bw: &'static BwScr,
out: *mut scr::FileHandle,
path: *const u8,
params: *const scr::OpenParams,
orig: ... |
use libc::c_char;
use std::error;
use std::ffi::{CString, CStr, NulError};
use std::fmt;
use std::io;
use std::path::Path;
use crate::rwops::RWops;
use crate::GameControllerSubsystem;
use crate::get_error;
use crate::joystick;
use crate::common::{validate_int, IntegerOrSdlError};
use std::mem::transmute;
use crate::s... |
/*!
A byte string library.
Byte strings are just like standard Unicode strings with one very important
difference: byte strings are only *conventionally* UTF-8 while Rust's standard
Unicode strings are *guaranteed* to be valid UTF-8. The primary motivation for
byte strings is for handling arbitrary bytes that are most... |
use std::io::{Cursor, ErrorKind, Result, Seek, SeekFrom};
use std::fmt::Write;
use crate::constants::{AES_AUTHENTICATION_CODE_LENGTH, AES_PASSWORD_VERIFICATION_LENGTH, FLAG_LOCAL_SIZE_UNKNOWN, HEXCHARS_LC};
use crate::utils::{arch_index, ReadHelper};
use crate::ProcessingResult;
type ZipCursor = Cursor<Vec<u8>>;
#[de... |
use std::error::Error;
use std::fs::File;
use std::{mem, str};
use cgmath::prelude::*;
use cgmath::{Deg, Matrix3, Matrix4, Point3, Vector3, Vector4};
use gl::types::*;
use imgui_ext::ImGuiExt;
use serde::{Deserialize, Serialize};
use crate::math::Vec3;
#[derive(ImGuiExt, Serialize, Deserialize, Clone)]
pub struct Ca... |
use log::{debug, info};
use piston_window::{context::Context, rectangle, types, G2d};
use rand::Rng;
use serde::{Deserialize, Serialize};
use slab::Slab;
pub type GameInt = f32;
pub type EntityId = usize;
pub struct InvalidKeyError;
const PENDULUM_FORCE: Point = Point::new(54.4, 54.4);
const MOVE_VELOCITY: GameInt = ... |
use crate::entities::game_view::GameView;
use crate::input::Input;
use crate::time::Time;
use crate::types::vector2::Vector2;
use std::time::Duration;
use std::time::Instant;
use glutin::dpi::PhysicalSize;
use glutin::event::{Event, StartCause, WindowEvent};
use glutin::event_loop::{ControlFlow, EventLoop};
use gluti... |
// Copyright (c) The cargo-guppy Contributors
// SPDX-License-Identifier: MIT OR Apache-2.0
//! Compare and diff summaries.
//!
//! A diff of two summaries is a list of changes between them.
//!
//! The main entry point is `SummaryDiff`, which can be created through the `diff` method on
//! summaries or through `Summa... |
//! Code for defining values and tag sets with tags that are dependent on other tags.
use crate::now_ns;
use crate::specification::{DataSpec, ValuesSpec};
use crate::substitution::new_handlebars_registry;
use crate::tag_pair::StaticTagPair;
use handlebars::Handlebars;
use itertools::Itertools;
use serde_json::json;
us... |
#[cfg(not(feature = "library"))]
use cosmwasm_std::entry_point;
use cosmwasm_std::{
attr, to_binary, Addr, BankMsg, Binary, Coin, CosmosMsg, Deps, DepsMut, Env, MessageInfo,
Response, StdResult, WasmMsg,
};
use crate::collateral::{
liquidate_collateral, lock_collateral, query_all_collaterals, query_borrow_... |
//! # Fonterator
//! Load fonts as vector graphics in pure Rust with advanced text layout. When you want to render text, fonterator gives you an iterator over [footile](https://crates.io/crates/footile) `PathOp`s, which you can easily pass right into footile.
//!
//! # Simple Example
//! ```rust
//! use fonterator as ... |
extern crate bitreader;
extern crate byteorder;
use byteorder::{LittleEndian, ReadBytesExt};
use std::collections::HashMap;
use std::hash::Hash;
use std::io::{Cursor, Error as IoError, Read};
pub use lzxd::WindowSize;
pub mod tide;
#[derive(Debug)]
pub struct TypeReader {
name: String,
_version: i32,
}
fn ... |
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use pairing::{
bls12_381::{Bls12, Fr, FrRepr},
PrimeField, PrimeFieldRepr,
};
use sapling_crypto::{
jubjub::{edwards, Unknown},
redjubjub::{PublicKey, Signature},
};
use std::io::{self, Read, Write};
use serialize::Vector;
use JUBJUB;
// π_A ... |
use encoding::{self, DecoderTrap, EncoderTrap, Encoding};
// ========================================================================= //
/// A Windows code page.
///
/// Code pages are a legacy Windows mechanism for representing character
/// encodings, but are still used within the MSI file format.
///
/// Not all ... |
//! A wire protocol for representing Modality probe log reports.
//! A report is a section of the probe's event log prepended by
//! the most up-to-date neighbor clocks UP TO that report.
use crate::{
log::LogEntry,
time::{NanosecondResolution, WallClockId},
wire::le_bytes,
LogicalClock, ProbeId,
};
us... |
use std::env;
use std::fmt;
use std::fs;
use std::io;
use std::io::Write;
use std::net::{IpAddr, SocketAddr, ToSocketAddrs};
use std::path::{Path, PathBuf};
use std::sync::Arc;
use chrono::Duration;
use failure::{Backtrace, Context, Fail};
use log;
use semaphore_aorta::{generate_key_pair, generate_relay_id, AortaConfi... |
#![cfg_attr(not(feature = "std"), no_std)]
/// Edit this file to define custom logic or remove it if it is not needed.
/// Learn more about FRAME and the core library of Substrate FRAME pallets:
/// https://substrate.dev/docs/en/knowledgebase/runtime/frame
#[cfg(test)]
mod mock;
#[cfg(test)]
mod tests;
use core::fm... |
//! Journaling structures and procedures.
//! __NOTE: Every field here is stored as _big endian___
use std::{fmt, ops::Range};
use bitflags::bitflags;
use crc::{crc32, Hasher32};
use quick_error::quick_error;
use scroll::{Pread, Pwrite};
use uuid::Uuid;
use crate::{calculate_crc32c, superblock::Superblock, Filesyste... |
// This file is part of Darwinia.
//
// Copyright (C) 2018-2021 Darwinia Network
// SPDX-License-Identifier: GPL-3.0
//
// Darwinia 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 Lic... |
use std::collections::HashMap;
use std::fs::File;
use std::io::Read;
use std::path::PathBuf;
use indexmap::map::IndexMap;
use serde_json::Value;
use crate::{Argument, Function, Module, RuntimeType};
/// Top-level function to generate python bindings, including all modules.
pub fn generate_bindings(modules: IndexMap<... |
// TODO: documents
use ophelia::{Bytes, BytesMut, Error};
use ophelia::{Crypto, HashValue, PrivateKey, PublicKey, Signature, SignatureVerify, ToPublicKey};
use ophelia::{CryptoRng, RngCore};
use ophelia_derive::SecretDebug;
use curve25519_dalek::scalar::Scalar;
use ed25519_dalek::Verifier;
use std::convert::TryFrom;... |
mod config;
mod database;
mod helpers;
mod node;
mod prometheus;
mod secretsmanager;
mod sources;
use anyhow::{ensure, Context};
use clap::AppSettings;
use concordium_rust_sdk::{endpoints, types};
use config::MAX_TIME_CHECK_SUBMISSION;
use helpers::{compute_median, convert_big_fraction_to_exchange_rate, relative_chang... |
// This file is part of Webb.
// Copyright (C) 2021 Webb Technologies Inc.
// 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
//
// http://www.apache.o... |
use crate::server;
use crate::utils::{self, io_err, CliEnv};
use rusoto_core::Region;
use rusoto_ec2::{
AllocateAddressRequest, AssociateAddressRequest, AuthorizeSecurityGroupIngressRequest,
CreateKeyPairRequest, CreateSecurityGroupRequest, DescribeAddressesRequest, Ec2, Ec2Client,
IpPermission, IpRange, Ru... |
use std::collections::{BTreeMap, BTreeSet};
use rand::{CryptoRng, Rng};
use serde::{Deserialize, Serialize};
use crate::{Error, PublicKey, Result, SecretKey, Signature};
use core::fmt::Debug;
use log::info;
const SOFT_MAX_MEMBERS: usize = 7;
pub type Generation = u64;
#[derive(Debug)]
pub struct State {
pub sec... |
use gfx_glyph::{self, GlyphPositioner, Layout, SectionText, VariedSection};
pub use gfx_glyph::{FontId, HorizontalAlign as Align, Scale};
use mint;
use std::borrow::Cow;
use std::f32;
use std::fmt;
use std::io::Read;
use std::path;
use std::sync::{Arc, RwLock};
use super::*;
// TODO: consider adding bits from example... |
use criterion::{criterion_group, criterion_main, Criterion};
fn bench_day1(c: &mut Criterion) {
use aoc::solutions::year2020::day01::{parse, part1, part2};
let expenses = parse(aoc::input::get_input(2020, 1).unwrap());
c.bench_function("day1 part 1", |b| b.iter(|| part1(&expenses)));
c.bench_function("... |
//!# A custom derive implementation for `#[derive(new)]`
//!
//!A `derive(new)` attribute creates a `new` constructor function for the annotated
//!type. That function takes an argument for each field in the type giving a
//!trivial constructor. This is useful since as your type evolves you can make the
//!constructor ... |
#![allow(non_snake_case)]
#![allow(non_camel_case_types)]
#![allow(non_upper_case_globals)]
#![allow(clippy::unreadable_literal)]
pub const IXGBE_EIMC: u32 = 0x00888;
pub const IXGBE_CTRL: u32 = 0x00000;
pub const IXGBE_CTRL_LNK_RST: u32 = 0x00000008; /* Link ... |
//! Our main CLI tool.
#![cfg_attr(feature = "clippy", feature(plugin))]
#![cfg_attr(feature = "clippy", plugin(clippy))]
extern crate cage;
#[macro_use]
extern crate clap;
extern crate colored;
extern crate env_logger;
extern crate itertools;
#[macro_use]
extern crate log;
extern crate openssl_probe;
extern crate ya... |
#![cfg(all(test, feature = "sources-demo_logs"))]
#![allow(clippy::print_stderr)] //tests
use core::task::Context;
use std::{
collections::{HashMap, VecDeque},
fmt,
fs::{read_dir, File},
future::pending,
io::Read,
path::PathBuf,
pin::Pin,
sync::{Arc, Mutex},
task::Poll,
};
use futu... |
use std::rc::Rc;
use std::sync::Arc;
use futures::{Sink, SinkExt, Stream, StreamExt};
use orion::kdf::SecretKey;
use tako::messages::common::ProgramDefinition;
use tako::messages::gateway::{
CancelTasks, FromGatewayMessage, NewTasksMessage, StopWorkerRequest, TaskDef, ToGatewayMessage,
};
use tokio::net::{TcpListe... |
use crate::mcb_if::MCBInterface1GDDR2;
use rust_hdl_core::prelude::*;
#[derive(LogicInterface, Default)]
pub struct CommandPort {
pub clock: Signal<In, Clock>,
pub enable: Signal<In, Bit>,
pub instruction: Signal<In, Bits<3>>,
pub burst_length: Signal<In, Bits<6>>,
pub byte_address: Signal<In, Bits... |
#![allow(dead_code)]
///
/// https://aomediacodec.github.io/av1-isobmff/
///
use byteorder::{BigEndian, ByteOrder};
use std::cmp;
use std::convert;
use std::fmt;
use std::io;
use std::io::{Read, SeekFrom};
pub const BOX_FILETYPE: [u8; 4] = *b"ftyp"; // FileType Box
const BOX_MEDIADATA: [u8; 4] = *b"mdat"; // Media Dat... |
// Copyright (c) 2019 <NAME>. All rights reserved.
// 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 co... |
use crate::error::Error;
use crate::registers as regs;
use crate::STuW81300;
use embedded_hal as hal;
use hal::blocking::spi::Transfer;
use hal::digital::v2::OutputPin;
#[allow(unused_imports)]
use micromath::F32Ext;
use regs::RegisterAddr;
const MAX_MOD: u32 = 2097151;
// Public Enums
#[repr(u32)]
#[derive(PartialEq... |
use std::collections::BTreeSet;
use anyhow::bail;
use cargo_metadata::{camino::Utf8PathBuf, Dependency, DependencyKind, Metadata, Package, Version};
use git_repository::refs::packed;
use crate::command::release::Options;
mod utils;
use crates_index::Index;
use git_repository::hash::ObjectId;
use utils::{
is_depe... |
// The MIT License (MIT)
//
// Copyright (c) 2017 <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, ... |
use syntax::Name;
use syntax::ast::FunctionRef;
use util::interner::StrInterner;
use std::fmt::Write;
use std::cmp::Ordering;
use rt::JsPreferredType;
pub struct Block {
pub ir: Vec<Ir>,
pub locals: Vec<Option<Name>>,
pub try_catches: Vec<TryCatch>
}
impl Block {
fn print_local(&self, string: &mut Str... |
use std::collections::{HashMap, HashSet};
use actix::{io::SinkWrite, ActorContext, Context, Running, StreamHandler};
use actix_http::ws;
use bytes::BytesMut;
use serde::Deserialize;
use serde_json::value::RawValue;
use tokio::time::Instant;
use tracing::{error, info, warn};
use crate::{
pubsub::subscription::Sub... |
use std::collections::HashMap;
use std::fmt::{Debug, Formatter};
use std::fs::{File, OpenOptions, remove_file};
use std::io::{Result, Error, ErrorKind};
use rand::prelude::*;
use std::io::prelude::*;
use serde::{Serialize, Deserialize};
use bincode::{serialize, deserialize};
use clear_on_drop::clear::Clear;
use cor... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
_reserved0: [u8; 4usize],
#[doc = "0x04 - AUX SCE Clock Management This register contains bitfields that are relevant for setting up the clock to the AUX domain."]
pub auxsceclk: AUXSCECLK,
#[doc = "0x08 - RAM Configuration This register c... |
use crate::{
button, draw_line, get_cache_dir, get_current_file_ext, get_file_name_from_path,
is_string_numeric, new_path, render_footer, render_header, render_input,
render_input_with_label, render_section, save_inputs, unwrap_or_return, BACKGROUND, BLACK,
GREY_WHITE, MARGIN, PADDING, SECONDARY, SECOND... |
// Copyright 2018 <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. This file may not be copied, modified, or distributed
// except according to thos... |
use {
crate::{
cluster_info::Node,
gossip_service::discover_cluster,
rpc::JsonRpcConfig,
validator::{Validator, ValidatorConfig, ValidatorExit, ValidatorStartProgress},
},
solana_client::rpc_client::RpcClient,
solana_ledger::{blockstore::create_new_ledger, create_new_tmp_... |
use std::cell::{Cell, RefCell};
use std::cmp;
use std::fs;
use std::io;
use std::io::prelude::*;
use std::marker;
use std::path::Path;
use crate::entry::{EntryFields, EntryIo};
use crate::error::TarError;
use crate::other;
use crate::{Entry, GnuExtSparseHeader, GnuSparseHeader, Header};
/// A top-level representation... |
use std::io;
use super::{convert_to_bytes, ProcResult};
/// This struct reports statistics about memory usage on the system, based on
/// the `/proc/meminfo` file.
///
/// It is used by `free(1)` to report the amount of free and used memory (both
/// physical and swap) on the system as well as the shared mem... |
extern crate winit;
#[cfg(feature="use-vulkano")]
extern crate vulkano;
#[cfg(feature="use-vulkano")]
extern crate vulkano_win;
extern crate input;
extern crate window;
use winit::platform::run_return::EventLoopExtRunReturn;
use std::time::Duration;
use std::collections::VecDeque;
#[cfg(feature="use-vulkano")]
use s... |
#![allow(dead_code)]
use chain::{Transaction,TransactionInput};
use serialization::{Stream,Serializable};
use serialization::bytes::Bytes;
use script::{TransactionInputSigner, Script, SignatureVersion, verify_script
, Opcode, VerificationFlags, ScriptWitness, TransactionSignatureChecker};
use script::buil... |
use crate::borrow_check::ArtificialField;
use crate::borrow_check::Overlap;
use crate::borrow_check::{Deep, Shallow, AccessDepth};
use rustc::hir;
use rustc::mir::{
BorrowKind, Body, Place, PlaceBase, Projection, ProjectionElem, ProjectionsIter,
StaticKind
};
use rustc::ty::{self, TyCtxt};
use std::cmp::max;
/... |
use self::super::super::super::util::{BLOGUEN_VERSION, parse_date_format_specifier, parse_function_notation, normalise_datetime};
use self::super::super::{MachineDataKind, ParagraphPasser, WrappedElement, LanguageTag, TagName};
use chrono::{FixedOffset, DateTime, TimeZone, Local, Utc};
use self::super::{machine_output_... |
//! Reference Manual for the Imxrt-1052 development board
//!
//! - <https://www.nxp.com/webapp/Download?colCode=IMXRT1050RM>
#![no_std]
#![no_main]
#![deny(missing_docs)]
use capsules::virtual_alarm::VirtualMuxAlarm;
use components::gpio::GpioComponent;
use kernel::capabilities;
use kernel::common::dynamic_deferred_... |
// vim: tw=80
use super::*;
use quote::ToTokens;
use std::{
borrow::Borrow,
env
};
use syn::parse::{Parse, ParseStream};
pub(crate) struct Mock {
pub(crate) vis: syn::Visibility,
pub(crate) name: syn::Ident,
pub(crate) generics: syn::Generics,
// The Mock struct's inherent methods. The blocks ... |
// This file is part of Webb.
// Copyright (C) 2021 Webb Technologies Inc.
// 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
//
// http://www.apache.o... |
use chrono::{DateTime, Utc};
use futures_executor::block_on;
use indy_vdr::utils::Qualifiable;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use super::did::{DidUrl, LedgerObject, QueryParameter};
use super::did_document::{DidDocument, LEGACY_INDY_SERVICE};
use super::error::{DidIndyError, DidIndyResult... |
// Copyright 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-2.0
//
// Unless required by applicable law or agreed to in writ... |
#![no_std]
#![no_main]
#![feature(abi_efiapi)]
#![feature(default_alloc_error_handler)]
use core::panic::PanicInfo;
mod uefi;
use crate::uefi::*;
use core::ffi::c_void;
use core::fmt::Write;
use core::mem::transmute;
use xmas_elf::ElfFile;
static mut WRITER_PTR:u64 = 0;
#[no_mangle]
pub extern "efiapi" fn efi_main(... |
use std::cell::RefCell;
use std::ffi::CString;
use std::os::unix::io::{FromRawFd, IntoRawFd, RawFd};
use std::rc::Rc;
use std::sync::atomic::Ordering;
use std::sync::{Arc, Mutex};
use std::thread::{self, ThreadId};
use nix::Result as NixResult;
use wayland_commons::debug;
use wayland_commons::map::{Object, ObjectMap,... |
/* Legal values for p_type (segment type). */
/// Program header table entry unused
pub const PT_NULL: u32 = 0;
/// Loadable program segment
pub const PT_LOAD: u32 = 1;
/// Dynamic linking information
pub const PT_DYNAMIC: u32 = 2;
/// Program interpreter
pub const PT_INTERP: u32 = 3;
/// Auxiliary information
pub co... |
extern crate proc_macro;
use proc_macro_hack::proc_macro_hack;
use proc_macro::TokenStream;
use quote::{quote, quote_spanned, TokenStreamExt, ToTokens};
use syn::{
braced, parenthesized, parse_macro_input, parse_quote, token, Error, Expr,
Ident, LitByteStr, LitFloat, LitInt, Token, Result
};
use syn::parse::{... |
// Copyright 2019 <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 writ... |
//! This module describes a set of utilities that will be used throughout the other modules
extern crate crossbeam_deque;
extern crate digest;
extern crate hex;
extern crate md5;
extern crate regex;
extern crate sha1;
extern crate sha2;
#[cfg(unix)]
extern crate termios;
#[cfg(windows)]
extern crate winapi;
use sel... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.