text stringlengths 7.05k 33.9k |
|---|
//! D-Bus standard interfaces.
//!
//! The D-Bus specification defines the message bus messages and some standard interfaces that may
//! be useful across various D-Bus applications. This module provides their proxy.
use enumflags2::BitFlags;
use serde::{Deserialize, Serialize};
use serde_repr::{Deserialize_repr, Seri... |
use ckb_chain_spec::consensus::ConsensusBuilder;
use ckb_error::OtherError;
use ckb_hash::new_blake2b;
use ckb_jsonrpc_types as rpc_types;
use ckb_script::{TransactionScriptsVerifier, TxVerifyEnv};
use ckb_types::{
bytes::Bytes,
core::{
cell::resolve_transaction, hardfork::HardForkSwitch, Capacity, Cycl... |
//! # Redis Data Model
//!
//!```text
//! {
//! // Coordinator state
//! "coordinator_state": "...", // bincode encoded string
//! // Sum dict
//! "sum_dict": { // hash
//! "SumParticipantPublicKey_1": SumParticipantEphemeralPublicKey_1,
//! "SumParticipantPublicKey_2": SumParticipantEph... |
// Copyright © 2021 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0
//
use crate::vfio::{Interrupt, Vfio, VfioCommon, VfioError};
use crate::{BarReprogrammingParams, PciBarRegionType, VfioPciError};
use crate::{
PciBdf, PciClassCode, PciConfiguration, PciDevice, PciDeviceError, PciHeaderType, PciSubcla... |
#[cfg(test)]
mod tests;
mod boundaries;
mod command_is_executing;
mod errors;
mod input;
mod layout;
mod os_input_output;
mod pty_bus;
mod screen;
mod tab;
mod terminal_pane;
mod utils;
use std::io::Write;
use std::os::unix::net::UnixStream;
use std::path::PathBuf;
use std::sync::mpsc::{channel, sync_channel, Receive... |
// Copyright 2020 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.
// Polkadot is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any late... |
use super::controls;
use super::super::color::*;
use super::super::model::*;
use super::super::style::*;
use flo_ui::*;
use flo_canvas::*;
use flo_binding::*;
use flo_animation::*;
use flo_animation::brushes::*;
use std::f32;
use std::sync::*;
///
/// Controller used for the ink tool
///
pub struct InkMenuController... |
// 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 anyhow::{format_err, Context as _, Error};
use fidl_fuchsia_hardware_ethernet as zx_eth;
use fidl_fuchsia_inspect_deprecated as inspect;
use fidl_fuchs... |
use crate::{
compute_hash, get_rows_number, sort_numeric_edge_list_inplace, utils::get_loading_bar,
EdgeFileWriter, EdgeT, EdgeTypeT, NodeFileWriter, NodeT, NodeTypeT, Result, TypeFileWriter,
Vocabulary,
};
use indicatif::ProgressIterator;
use lazy_static::lazy_static;
use log::info;
#[cfg(target_os = "linu... |
use std::fmt;
use smallvec::SmallVec;
use regex::Regex;
use lazy_static::lazy_static;
lazy_static! {
static ref RE: Regex = Regex::new(r"([a-gA-G])([#♯♮♭b]?)(-?\d)").unwrap();
static ref RE2: Regex = Regex::new(r"([a-gA-G])(-?\d)([#♯♮♭b]?)").unwrap();
}
// Same order/value modulo 12 as MIDI
#[derive(Debug, C... |
//! The Chip-8 Instructions
//!
//! Documentation taken from [http://devernay.free.fr/hacks/chip8/C8TECH10.HTM](http://devernay.free.fr/hacks/chip8/C8TECH10.HTM)
use std::io::Read;
use std::fs::File;
use std::io;
use std::path::Path;
/// A 12bit value
///
/// Note: isn't actually 12bit because of hardware limitations... |
//! Implements filtering for events originating from legacy browsers.
use std::collections::{BTreeSet, HashMap};
use lazy_static::lazy_static;
use relay_general::protocol::Event;
use relay_general::user_agent::{self, UserAgent};
use crate::{FilterStatKey, LegacyBrowser, LegacyBrowsersFilterConfig};
/// Checks if t... |
use super::bio::*;
use super::openjpeg::*;
use ::libc;
extern "C" {
fn memset(_: *mut libc::c_void, _: libc::c_int, _: libc::c_ulong) -> *mut libc::c_void;
fn opj_calloc(numOfElements: size_t, sizeOfElements: size_t) -> *mut libc::c_void;
fn opj_realloc(m: *mut libc::c_void, s: size_t) -> *mut libc::c_void;
... |
use math::*;
use julian::*;
use delta_time::*;
use core::ops::Rem;
#[cfg(not(feature = "std"))]
use num_traits::Float;
#[repr(usize)]
#[derive(Clone, Copy)]
enum MoonPhase {
NewMoon,
FirstQuarterMoon,
FullMoon,
LastQuarterMoon
}
// From "Astronomical Algorithms"
// By <NAME>
fn get_time_of(phase: Moo... |
mod database;
pub(crate) mod s3;
pub(crate) use self::database::DatabaseBackend;
pub(crate) use self::s3::S3Backend;
use crate::db::Pool;
use chrono::{DateTime, Utc};
use failure::{err_msg, Error};
use path_slash::PathExt;
use std::{
collections::{HashMap, HashSet},
ffi::OsStr,
fmt, fs,
io::Read,
p... |
//! Sending and receiving serde-serialized structs.
//!
//! Currently structs are serialized with [`ssmarshal`][ssmarshal],
//! but this is an implementation detail that may change without
//! warning. `ssmarshal` uses a straightforward, compact serialization
//! format that doesn't support compatibility between versio... |
use std::{cmp, mem, ptr, slice, thread};
use std::collections::BTreeMap;
use netutils::setcfg;
use syscall::error::{Error, EACCES, EBADF, EINVAL, EWOULDBLOCK, Result};
use syscall::flag::O_NONBLOCK;
use syscall::io::Dma;
use syscall::scheme::SchemeBlockMut;
const CTRL: u32 = 0x00;
const CTRL_LRST: u32 = 1 << 3;
const... |
// 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 parking_lot::{RwLock, RwLockWriteGuard};
use std::collections::btree_map::Entry;
use std::collections::BTreeMap;
use std::sync::{Arc, Weak};
use crate... |
use amcl_wrapper::field_elem::{FieldElement, FieldElementVector};
use amcl_wrapper::group_elem::{GroupElement, GroupElementVector};
use coconut_sig::errors::CoconutError;
use coconut_sig::signature::*;
use crate::{SignatureGroup, SignatureGroupVec};
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct JSMessag... |
use ethers::{
abi::{Abi, Event, Function, RawLog, Token},
types::{H160, H256, U256},
};
use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;
use ansi_term::Colour;
use foundry_utils::format_token;
#[cfg(feature = "sputnik")]
use crate::sputnik::cheatcodes::{
cheatcode_handler::{CHEATCODE_... |
// This file is part of Gafi Network.
// Copyright (C) 2021-2022 CryptoViet.
// 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... |
use std::io;
use std::net::SocketAddr;
use std::sync::Arc;
use std::time::Duration;
use std::collections::{HashSet, HashMap, BTreeMap, BTreeSet};
use crossbeam::sync::ArcCell;
use futures::{Future, Stream, Async};
use futures::sync::mpsc::UnboundedReceiver;
use rand::{thread_rng, Rng};
use rand::seq::sample_iter;
use ... |
extern crate yaml_rust;
extern crate regex;
extern crate rusqlite;
extern crate chrono;
extern crate libc;
extern crate nfqueue;
extern crate pnet;
use std::fmt;
use std::fs::File;
use std::fs::OpenOptions;
use std::io;
use std::io::prelude::*;
use std::net::{TcpListener, IpAddr};
use std::process::exit;
use std::sync... |
mod utils;
use serde_json::{
// SerdeMap by default backed by BTreeMap (see https://docs.serde.rs/serde_json/map/index.html)
Map as SerdeMap,
Value as SerdeValue,
};
use std::collections::{BTreeMap, BTreeSet};
use wasm_bindgen::prelude::{wasm_bindgen, JsValue};
#[macro_use]
extern crate serde_derive;
//... |
// Copyright (c) 2019 10x Genomics, Inc. All rights reserved.
use debruijn_mapping::{config, pseudoaligner, utils};
use failure::Error;
use itertools::Itertools;
use std::cmp::max;
use std::collections::{HashMap, HashSet};
use std::fs::File;
use std::io::{BufWriter, Write};
use std::path::PathBuf;
use crate::config:... |
// SPDX-License-Identifier: MIT
// use std::collections::HashMap;
use advent_of_code::parse::StrParser;
use clap::{Arg, App};
use regex::Regex;
type RulePath = Vec<(usize, u8)>;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Node {
Char(char),
Match1(usize),
Match2(usize, usize),
Match3(usize, us... |
use assert_matches::assert_matches;
use base64ct::{Base64UrlUnpadded, Encoding};
use chrono::{Duration, TimeZone, Utc};
use hex_buffer_serde::{Hex as _, HexForm};
use rand::{seq::index::sample as sample_indexes, thread_rng};
use serde::{Deserialize, Serialize};
use serde_json::json;
use core::convert::TryFrom;
use jw... |
// Copyright 2021 Parity Technologies (UK) Ltd.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, mer... |
/*!
# Rust bindings to OpenJPEG
Supports loading JPEG2000 images into `image::DynamicImage`.
Forked from https://framagit.org/leoschwarz/jpeg2000-rust before its GPL-v3 relicensing, with some additional features:
* Specify decoding area and quality layers in addition to reduction factor
* Improved OpenJPEG -> Dynam... |
//! ChiselStore server module.
use crate::errors::StoreError;
use async_notify::Notify;
use async_trait::async_trait;
use derivative::Derivative;
use sqlite::{Connection, OpenFlags};
use std::collections::HashMap;
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::{Arc, Mutex};
use std::time::Duration;
use ... |
use chrono::NaiveTime;
use chrono::{DateTime, Duration, Local};
use chrono::{Datelike, NaiveDate};
use core::str::FromStr;
use itertools::Itertools;
use std::collections::{BTreeMap, HashMap};
use std::io::{BufRead, Write};
use std::fmt;
use std::result::Result;
use std::str;
use structopt::StructOpt;
// use crate::Su... |
use crate::background::Background;
use crate::config::Config;
use crate::droplets::Droplets;
use crate::quad::Quad;
use crate::render_gl::buffer::ArrayBuffer;
use crate::render_gl::{
ColorBuffer, Error, FrameBuffer, Program, Shader, Texture, TextureLoadOptions, Viewport,
};
use nalgebra as na;
use nalgebr... |
//! Physics port of the original game. Most closely described by the following documents:
//! - https://people.eecs.berkeley.edu/~jfc/mirtich/thesis/mirtichThesis.pdf
use vangers::{config, level, render::debug::LineBuffer, space};
use cgmath::prelude::*;
use std::f32::EPSILON;
mod rigid;
mod terrain;
pub use terra... |
#![allow(non_snake_case)]
#[macro_use]
extern crate log;
use byteorder::LittleEndian;
use std::io::Cursor;
mod camera;
mod data_type;
mod error;
mod read;
pub use self::camera::Camera;
pub use self::data_type::{DataType, FormData};
pub use self::error::Error;
pub use self::read::Read;
pub type ResponseCode = u16;
... |
//! Creating, switching to, and other functions related to process management (both kernel and user)
use alloc::{
boxed::Box,
collections::BTreeMap,
string::String,
sync::{Arc, Weak},
vec::Vec,
};
use core::{
arch::asm,
future::Future,
pin::Pin,
sync::atomic::AtomicUsize,
task::{... |
use crate::Error;
use crate::Layout;
use crate::WindowFlag;
#[cfg(feature = "tmux_2_1")]
use std::time::Duration;
pub const WINDOW_ACTIVE: u64 = 1;
pub const WINDOW_ACTIVE_CLIENTS: u64 = 1 << 1;
pub const WINDOW_ACTIVE_CLIENTS_LIST: u64 = 1 << 2;
pub const WINDOW_ACTIVE_SESSIONS: u64 = 1 << 3;
pub const WINDOW_ACTIVE_... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - ETM Main Control Register"]
pub cr: crate::Reg<cr::CR_SPEC>,
#[doc = "0x04 - ETM Configuration Code Register"]
pub ccr: crate::Reg<ccr::CCR_SPEC>,
#[doc = "0x08 - ETM Trigger Event Register"]
pub trigger: crate::Reg... |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
/*
Copyright 2021 JFrog Ltd
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 writi... |
//! TODO Documentation
use std::{panic, ptr};
use std::cell::Cell;
use std::ffi::CStr;
use std::mem::ManuallyDrop;
use std::rc::{Rc, Weak};
use std::time::Duration;
use libc::{c_float, c_int};
use wayland_sys::server::WAYLAND_SERVER_HANDLE;
use wlroots_sys::{timespec, wl_list, wl_output_subpixel, wl_output_transform,... |
// SPDX-License-Identifier: Apache-2.0
// Copyright 2021 Keylime Authors
use crate::algorithms::{EncryptionAlgorithm, HashAlgorithm, SignAlgorithm};
use crate::error::{Error, Result};
use ini::Ini;
use log::*;
use serde::{Deserialize, Serialize};
use std::convert::TryFrom;
use std::env;
use std::ffi::CString;
use std:... |
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... |
// Code that generates a test runner to run all the tests in a crate
#![allow(dead_code)]
#![allow(unused_imports)]
use HasTestSignature::*;
use std::iter;
use std::slice;
use std::mem;
use std::vec;
use log::debug;
use smallvec::{smallvec, SmallVec};
use syntax_pos::{self, DUMMY_SP, NO_EXPANSION, Span, SourceFile,... |
use crate::{
app::{
context::{AppContext, Context},
endpoint::prelude::*,
error::Error as AppError,
http::AuthExtractor,
service_utils::{RequestParams, Response},
},
authz::AuthzObject,
backend::janus::client::upload_stream::{
UploadStreamRequest, UploadSt... |
// 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.
//! Job Handling Support
//!
//! # Summary
//!
//! [Jobs] are basic units of work that interfaces in the setting service can specify. In addition
//! to th... |
use nalgebra as na;
use std::f32;
use std::u32;
/// A 2 dimensional point representing a location
pub type Point2 = na::Point2<f32>;
/// A 2 dimensional vector representing an offset of a location
pub type Vector2 = na::Vector2<f32>;
/// A 4 dimensional matrix representing an arbitrary 3d transformation
pub type Matri... |
pub(crate) mod common;
use zeekoe::{
amount::Amount,
customer::{self, database::StateName as CustomerStatus, zkchannels::Command},
merchant::{self, zkchannels::Command as _},
protocol::ChannelStatus as MerchantStatus,
TestLogs,
};
use zkabacus_crypto::{CustomerBalance, MerchantBalance};
use anyhow... |
//! Store and manipulate Kafka messages.
use std::ffi::{CStr, CString};
use std::fmt;
use std::marker::PhantomData;
use std::os::raw::c_void;
use std::ptr;
use std::str;
use std::time::SystemTime;
use rdkafka_sys as rdsys;
use rdkafka_sys::types::*;
use crate::error::{IsError, KafkaError, KafkaResult};
use crate::ut... |
//! `udp_lowpan_test.rs`: Kernel test suite for the UDP/6LoWPAN stack
//!
//! This file tests port binding and sending and receiving messages from kernel space.
//! It has several different test modes. Each test uses the same radio initialization code,
//! but is started with a different function. A description of thes... |
// This would be nice once it stabilizes:
// https://github.com/rust-lang/rust/issues/44732
// #![feature(external_doc)]
// #![doc(include = "../README.md")]
//! This is a Rust crate which can take a [json schema (draft
//! 4)](http://json-schema.org/) and generate Rust types which are
//! serializable with [serde](ht... |
use serde::Deserialize;
use yew_router::{route::Route, switch::Permissive};
use yew::{
format::{Json, Nothing},
prelude::*,
services::fetch::{FetchService, FetchTask, Request, Response},
};
use wasm_bindgen::{JsValue, prelude::*};
use crate::{
switch::{AppAnchor, AppRoute},
js::caller
... |
use crate::assets::ldtk::{
LdtkAssetData, LdtkLayerData, LdtkLayerDrawCallData, LdtkLevelData, LdtkTileSet, LevelUid,
TileSetUid,
};
use crate::features::tile_layer::TileLayerVertex;
use distill::importer::{ImportedAsset, Importer, ImporterValue};
use distill::{core::AssetUuid, importer::ImportOp};
use fnv::Fnv... |
// Inference.
use std::collections::HashMap;
use std::collections::HashSet;
use crate::ast;
use crate::algorithms;
pub struct UnificationContext {
unions: algorithms::UnionFind<ast::TypeExpr>,
union_concrete_app: HashMap<ast::TypeExpr, ast::TypeExpr>,
}
impl UnificationContext {
pub fn new() -> UnificationContext... |
//! This contains the logic for the long range (batch) sync strategy.
//!
//! The general premise is to group peers by their self-proclaimed finalized blocks and head
//! blocks. Once grouped, the peers become sources to download a specific `Chain`. A `Chain` is a
//! collection of blocks that terminates at the specifi... |
#![allow(non_snake_case)]
#![cfg_attr(
target_arch = "spirv",
no_std,
feature(register_attr),
register_attr(spirv)
)]
#[cfg(not(target_arch = "spirv"))]
#[macro_use]
pub extern crate spirv_std_macros;
use glam::UVec3;
// Rotation right: u32.rotate_right(n: u32)
fn rot_r(x: u32, n: u32) -> u32 {
x... |
// Magical Bitcoin Library
// Written in 2020 by
// <NAME> <<EMAIL>>
//
// Copyright (c) 2020 Magical Bitcoin
//
// 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, in... |
//! Handling for arti's configuration formats.
use arti_client::config::{
circ,
dir::{self, DownloadScheduleConfig, NetworkConfig},
ClientAddrConfig, ClientAddrConfigBuilder, StorageConfig, StorageConfigBuilder,
StreamTimeoutConfig, StreamTimeoutConfigBuilder, SystemConfig, SystemConfigBuilder,
Tor... |
use ash::prelude::VkResult;
use ash::version::DeviceV1_0;
use ash::vk;
use crossbeam_channel::{Receiver, Sender};
use fnv::FnvHashMap;
use rafx_api_vulkan::VkDeviceContext;
use std::collections::BTreeMap;
use std::sync::{Arc, Mutex};
/// Info we hash across to identify equivalent command pools, allowing us to share th... |
// Copyright Materialize, Inc. and contributors. All rights reserved.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by ... |
#![allow(non_snake_case)]
extern crate rand;
use rand::Rng;
use rand::distributions::{IndependentSample, Range};
mod energy;
use energy::*;
use std::io::prelude::*;
extern crate argparse;
use argparse::{ArgumentParser, Store, StoreFalse, StoreTrue};
mod trajectory;
use trajectory::*;
// LJ params
const LJ_EPS : f64 =... |
// Copyright (C) 2020, Cloudflare, Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list... |
//! # Conf module.
//!
//! The Conf module provides the beamium configuration.
//! It set defaults and then load config from '/etc', local dir and provided path.
use std::collections::HashMap;
use std::convert::TryFrom;
use std::net::SocketAddr;
use std::path::PathBuf;
use std::sync::mpsc::{channel, Receiver, Sender};
... |
// Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0.
use std::collections::HashMap;
use std::fmt;
use std::marker::PhantomData;
use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
use std::sync::{Arc, Mutex};
use concurrency_manager::ConcurrencyManager;
use engine_traits::{KvEngine, Snapshot};
use... |
// Copyright (c) 2020 DDN. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
use crate::{
components::{
action_dropdown, alert_indicator, font_awesome::*, lock_indicator, paging, progress_circle, resource_links,
stratagem, t... |
pub(super) fn run() -> Result<(), super::Error> {
let line = super::read_input_lines::<String>("day11")?.next().ok_or("file is empty")??;
let ram: crate::intcode::Ram = line.parse()?;
{
let mut cells: std::collections::BTreeMap<(isize, isize), Color> = Default::default();
execute(&ram, &mut cells)?;
let re... |
use crate::helpers::{rotating_color, ColorScheme, ID};
use crate::render::area::DrawArea;
use crate::render::building::DrawBuilding;
use crate::render::bus_stop::DrawBusStop;
use crate::render::extra_shape::{DrawExtraShape, ExtraShapeID};
use crate::render::intersection::DrawIntersection;
use crate::render::lane::DrawL... |
#![allow(clippy::manual_range_contains)]
use alloc::{borrow::ToOwned, string::String, vec, vec::Vec};
use core::fmt::{self, Display};
#[cfg(feature = "serde_support")]
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use crate::{const_for, utils::BITS, U256};
#[derive(Debug, Clone)]
pub enum FromStrRa... |
use fp::vector::FpVector;
use once::OnceVec;
use fp::prime::{minus_one_to_the_n, Binomial, ValidPrime};
use fp::{const_for, MAX_MULTINOMIAL_LEN, NUM_PRIMES, PRIMES, PRIME_TO_INDEX_MAP};
pub const MAX_XI_TAU: usize = MAX_MULTINOMIAL_LEN;
/// If p is the nth prime, then `XI_DEGREES[n][i - 1]` is the degree of $ξ_i$ at... |
use super::{ClockType, Event, StateOp};
use combine::error::{ParseError, StreamError};
use combine::parser::{char, repeat};
use combine::stream::{Stream, StreamErrorFor};
use combine::{attempt, choice, one_of, optional, value, Parser};
// Takes numeric text and an optional suffix character and computes
// the microsec... |
use itertools::Itertools;
use plonky2_field::extension_field::Extendable;
use plonky2_util::{log2_strict, reverse_index_bits_in_place};
use crate::fri::proof::{
FriChallengesTarget, FriInitialTreeProofTarget, FriProofTarget, FriQueryRoundTarget,
FriQueryStepTarget,
};
use crate::fri::structure::{FriBatchInfoTa... |
// Copyright 2018 The Exonum Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
pub mod alias;
pub mod brush;
pub mod deferred;
pub mod particle;
pub mod postprocess;
pub mod sprite;
use std::{cell::RefCell, mem::size_of};
use crate::{
client::{
entity::particle::Particle,
render::{
pipeline::{Pipeline, PushConstantUpdate},
uniform::{DynamicUniformBuff... |
use data_structures::indexed_vec::Idx;
use mir::*;
use std::collections::BTreeMap;
use std::iter;
use super::builder::Builder;
use super::local_stack::LocalStack;
use syntax::ast;
use syntax::codemap::Span;
impl<'a, 'b: 'a> Builder<'a, 'b> {
pub fn block(&mut self, block: BasicBlock) -> Vec<ast::Stmt> {
le... |
use crate::{
block::{BlockStuff, convert_block_id_ext_api2blk}, block_proof::BlockProofStuff,
engine_traits::{ChainRange, EngineOperations},
error::NodeError,
validator::validator_utils::{calc_subset_for_workchain, check_crypto_signatures},
};
use std::{sync::Arc, mem::drop};
use tokio::task::JoinHand... |
#[cfg(target_os = "windows")]
extern crate winapi;
#[cfg(any(target_os = "linux", target_os = "macos"))]
extern crate libc;
extern crate minifb;
extern crate rdp;
extern crate hex;
extern crate clap;
extern crate hmac;
use minifb::{Key, Window, WindowOptions, MouseMode, MouseButton, KeyRepeat};
use std::net::{SocketAd... |
use std::cmp;
use std::fmt;
use std::marker::PhantomData;
use std::mem;
use std::ops::Range;
use std::usize;
/// A trait for representing types as `usize` (useful for enums).
///
/// Note that this should be implemented for types that need to be passed to `BitsVec`.
/// This is implemented for integer types, `bool` an... |
// 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 writi... |
//
// Copyright (c) 2017 10x Genomics, Inc. All rights reserved.
//
use std::alloc::System;
#[global_allocator]
static A: System = System;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
extern crate docopt;
extern crate fastq;
extern crate rayon;
extern crate tempdir;
extern crate lz4;
extern crat... |
// Ignore this macro, it is black magic
macro_rules! vec_to_arr_box {
(
$vec_expr:expr, $size_expr:expr
) => {{
const N: usize = $size_expr;
let vec_expr = $vec_expr;
{
use std::prelude::v1::*;
#[inline]
fn with_ty<T>(v: Vec<T>) -> Box<[T; N]> {
... |
use std::convert::TryInto;
use std::collections::{VecDeque, HashSet};
use std::cell::RefCell;
use failure_derive::*;
use num_enum::{TryFromPrimitive, IntoPrimitive};
use super::datatype::DataType;
use super::parse::ast::*;
use super::globals::*;
use super::Scope;
#[derive(Debug, Clone)]
pub struct Bytecode {
data:... |
#![feature(rustc_private)]
#![allow(clippy::too_many_lines)]
extern crate rustc_session;
use cargo::core::{Package, PackageId, Source, SourceId, Workspace};
use cargo::sources::RegistrySource;
use curl::easy::Easy;
use log::debug;
use rustc_session::getopts;
use serde::Deserialize;
use std::collections::HashSet;
use ... |
//! Describes the properties of items.
use std::{
collections::BTreeMap,
fs::{self, File},
io::Write,
};
use bytes::{Buf, Bytes};
use path_macro::path;
#[cfg(feature = "pyo3")]
use pyo3::prelude::*;
use serde::Serialize;
use crate::{
cache::{buf::BufExtra, error::CacheResult, index::CacheIndex, index... |
//! Radio/BLE Driver for nrf51dk
//!
//! Sending BLE advertisement packets
//! Possible payload is 30 bytes
//!
//! Currently all fields in PAYLOAD array are configurable from user-space
//! except the PDU_TYPE.
//!
//! Author: <NAME> <<EMAIL>>
//! Author: <NAME> <<EMAIL>>
//! Date: June 6, 2017
use chip;
use core::ce... |
#[macro_use] extern crate proptest;
use {
std::{rc::Rc, fmt},
fxhash::FxHashMap,
batsmt_core::{ast::{self, HasManager, },AstView,backtrack::*, ast_u32::{self, AST}},
batsmt_cc::{*, Ctx as CC_ctx},
batsmt_hast::*,
batsmt_pretty as pp,
batsmt_theory::{BoolLit, self as theory, },
};
type M =... |
//! Build system & asset pipelines.
use std::ffi::OsString;
use std::path::PathBuf;
use std::sync::Arc;
use anyhow::{anyhow, bail, ensure, Context, Result};
use async_process::{Command, Stdio};
use async_std::task::{spawn, spawn_blocking, JoinHandle};
use async_std::{fs, path};
use cargo_metadata::{Metadata, Metadata... |
use crate::repository::backend::common::files::LockedFile;
use crate::repository::backend::common::segment::Segment;
use crate::repository::backend::{BackendError, Result, SegmentDescriptor};
use crate::repository::{Chunk, ChunkSettings, Key};
use futures::channel::mpsc;
use futures::channel::oneshot;
use futures::sin... |
//! HAL for Flexible memory controller (FMC)
/// FMC banks
///
/// For example, see RM0433 rev 7 Figure 98.
#[derive(Clone, Copy, Debug, PartialEq)]
#[allow(unused)]
pub enum FmcBank {
/// Bank1: NOR/PSRAM/SRAM
Bank1,
/// Bank2:
Bank2,
/// Bank3: NAND Flash
Bank3,
/// Bank4:
Bank4,
... |
// Copyright 2016 Mozilla
//
// 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, software... |
use inflector::Inflector;
use proc_macro::TokenStream;
use proc_macro2::TokenStream as TokenStream2;
use quote::{format_ident, quote};
use syn::{
parse::{Parse, ParseStream, Result},
parse_macro_input, Attribute, ExprPath, Ident, LitInt, Token, Visibility,
};
struct Vtable {
thr: ExprPath,
sv: Option<E... |
/*
* Copyright 2022 Collabora, Ltd.
*
* SPDX-License-Identifier: MIT
*/
use std::collections::BTreeMap;
use std::fs::{self, File};
use std::io::{Seek, Write};
use std::os::unix::fs::PermissionsExt;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
use atari_bundle::{BundleConfig, BundleError};
us... |
/*!
Suffix Array Construction
worst time: O(N)
worst space: N bytes (for input) + N words (for suffix array) + N/4 words (extra)
# Credit
Based on the work by Ge Nong team:
https://code.google.com/p/ge-nong/
*/
use log::LogLevel;
use num::ToPrimitive;
/// Symbol type
pub type Symbol = u8;
/// Suffix type = index ... |
#![allow(unused)]
use crate::{WindowCanvas, OsPackage};
use crate::rendertools::*;
use crate::inputhandler::*;
use crate::misc::*;
use std::ptr::{null, null_mut};
//NOTE this is not thread safe.
//Every thing is in global space, not too nice when working with canvases of multiple sizes
//TODO offsets are needed if... |
use super::NativeManager;
use std::sync::atomic::{AtomicU32, AtomicUsize, AtomicBool, Ordering};
/// Allow the up to the ridiculous number of 64 physical joysticks.
pub const CONTROLLER_MAX: usize = 64;
#[repr(C)]
struct TimeVal {
tv_sec: isize,
tv_usec: isize,
}
#[repr(C)]
struct Event {
ev_time: TimeV... |
mod git;
mod helpers;
use crate::git::clone;
use std::{
collections::BTreeMap,
env,
fs::{self, File},
io::{Read, Write},
path::{Path, PathBuf},
process::Command,
string::ToString,
};
use anyhow::{anyhow, Context, Result};
use console::{Emoji, Style};
use dialoguer::{Confirm, Input, MultiS... |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
use crate::internal_prelude::*;
/// This ensures that `sys::statfs` is the same size as `libc::statfs`.
const _STATFS_SIZE_CHECK: sys::statfs =
unsafe { core::mem::transmute([0u8; core::mem::size_of::<libc::statfs>()]) };
#[allow(non_camel_case_types)]
#[cfg_attr(docsrs, doc(cfg(not(target_os = "netbsd"))))]
#[cf... |
use crate::client::pool_connection::PoolConnection;
#[cfg(feature = "metrics-collection")]
use crate::client::pool_connection::ReportedConnectionState;
use crate::config::ClientConfig;
use crate::connection::event_loop::ConnectionLoopCommand;
use crate::connection::{Connection, ConnectionIncomingMessage};
use crate::er... |
use crate::arch::x86_64::kernel::pci_ids::{CLASSES, VENDORS};
use crate::arch::x86_64::mm::{PhysAddr, VirtAddr};
use crate::collections::irqsave;
use crate::drivers::net::rtl8139::{self, RTL8139Driver};
use crate::drivers::net::virtio_net::VirtioNetDriver;
use crate::drivers::net::NetworkInterface;
use crate::drivers::... |
// Copyright 2017-2019 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
// Substrate is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) a... |
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use enum_primitive::FromPrimitive;
use std::borrow::BorrowMut;
use std::io::{self, Cursor, Read, Write};
use std::net::{Shutdown, TcpStream, ToSocketAddrs};
use std::time::Duration;
use {binary, Client, Coil, Error, ExceptionCode, Function, Reason, Result};
#[c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.