text stringlengths 9.08k 47.9k |
|---|
use core::cmp;
use std::cmp::min;
use std::cmp::Ordering::Equal;
use std::collections::VecDeque;
use std::iter::FromIterator;
use std::ops::Range;
use bio::data_structures::interval_tree::*;
use float_cmp::approx_eq;
//use rayon::prelude::*;
use crate::index::Index;
use crate::io::QuerySequence;
use crate::kmer::{Seq... |
use std::collections::{HashMap, HashSet};
use std::borrow::Borrow;
use num::traits::{One};
use num::bigint::{BigUint};
use bit_set::BitSet;
use native::Instruction;
#[derive(Clone)]
pub struct MemoryDefinition {
memory: Vec<u8>
}
#[derive(Clone)]
pub struct RegDefinition {
// The offset in the memory defini... |
use super::event_query::query_events_from_client;
use super::handler_registry::{HandlerRegistry, SubscriptionHandle, TheHandlerRegistry};
use super::{axon_serialize, ApplicableTo, AxonServerHandle, VecU8Message};
use crate::axon_server::command::command_provider_outbound;
use crate::axon_server::command::command_servic... |
use rustc::lint as lint;
use rustc::hir;
use rustc::hir::def::Def;
use rustc::hir::def_id::DefId;
use rustc::ty;
use syntax;
use syntax::ast::{self, Ident};
use syntax::feature_gate::UnstableFeatures;
use syntax::symbol::Symbol;
use syntax_pos::DUMMY_SP;
use std::ops::Range;
use crate::core::DocContext;
use crate::fo... |
use std::cmp::Ordering;
use std::ops::{Add, Mul};
use std::vec;
#[macro_use]
extern crate lazy_static;
use serde::Deserialize;
pub mod math;
pub mod png;
pub mod ppm;
mod shape;
pub mod wavefront;
mod partition;
use crate::math::*;
pub use crate::shape::*;
pub use partition::binary_partition;
pub use partition::fla... |
// 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 ... |
//! A no_std FAT12/FAT16/FAT32 compatible crate.
//! This crate currently supports FAT12/FAT16/FAT32 with a sector size >= 512 bytes.
#![no_std]
pub mod attribute;
mod cluster;
mod datetime;
pub mod directory;
pub mod filesystem;
mod name;
mod offset_iter;
mod table;
mod utils;
use cluster::Cluster;
use core::convert... |
//! A [Glyph Data Table](
//! https://docs.microsoft.com/en-us/typography/opentype/spec/glyf) implementation.
use core::num::NonZeroU16;
use crate::parser::{Stream, F2DOT14, LazyArray16, NumFrom};
use crate::{loca, GlyphId, OutlineBuilder, Rect, BBox};
pub(crate) struct Builder<'a> {
pub builder: &'a mut dyn Out... |
use std::fs;
use std::io::Write;
use std::path::PathBuf;
use colored::*;
mod scales;
pub struct Setup <'a> {
pub scale: Option<&'a str>,
pub position: usize,
}
#[derive(Debug)]
pub struct ChromaticScale {
pub root: String,
pub notes: Vec<String>
}
#[derive(Debug, PartialEq, Clone)]
pub struct Tuning... |
use crate::{
config::{car::CarPhysics, common::Common, settings},
freelist::{self, FreeList},
model::VisualModel,
render::{collision::GpuRange, GpuTransform, Shaders},
space::Transform,
};
use bytemuck::{Pod, Zeroable};
use cgmath::SquareMatrix as _;
use futures::{executor::LocalSpawner, task::Loca... |
//! Tests specified to the Veracruz proxy attestation service
//!
//! ## Authors
//!
//! The Veracruz Development Team.
//!
//! ## Licensing and copyright notice
//!
//! See the `LICENSE.markdown` file in the Veracruz root directory for
//! information on licensing and copyright.
extern crate psa_attestation;
extern c... |
use core;
pub use super::ir_interpret::{IRInterpreter, Context, push_base};
use super::super::alloc;
use super::super::alloc::{SliceWrapper, SliceWrapperMut, Allocator};
use super::interface;
use super::input_pair::{InputPair, InputReference, InputReferenceMut};
use super::util::{floatX, FastLog2u16};
use super::find_s... |
//! The module with all handlers required by uploading dragged and dropped files on IDE.
use crate::prelude::*;
use crate::controller::graph::LocationHint;
use crate::controller::graph::NewNodeInfo;
use crate::model::module::NodeMetadata;
use crate::model::module::Position;
use crate::model::module::UploadingFile;
u... |
// This file is part of Substrate.
// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the F... |
#![allow(unused_parens)]
#![allow(non_snake_case)]
use std::process;
use rand::prelude::*;
use std::option::Option;
pub const INT_SIZE: u64 = 64;
#[derive(Clone)]
pub struct TsetlinSub {
pub ta_state: Vec<u64>
,pub clause_output: Vec<u64>
,pub feedback_to_la: Vec<u64>
,pub feedback_to_clauses: Vec<u... |
use crate::diffbase;
use crate::dispatch::{communicate, dispatch_to, run_command, run_editor};
use crate::github;
use crate::Error;
use crate::Result;
use chrono::{Local, NaiveDate, TimeZone};
use git2;
use std::collections::{HashMap, HashSet};
use std::io::Write;
use std::path::{Path, PathBuf};
use std::str;
use webbr... |
// `error_chain!` can recurse deeply
#![recursion_limit = "1024"]
//
//#[macro_use]
extern crate error_chain;
#[macro_use]
extern crate lazy_static;
use crate::hash::hash_sha256;
use crate::key_utils::{check_decode, check_encode};
use regex::Regex;
use secp256k1::{Message, PublicKey, Secp256k1, SecretKey, Signature};... |
use anyhow::{anyhow, bail, ensure};
use hibitset::BitSet;
use once_cell::sync::Lazy;
use parking_lot::Mutex;
use rspirv::{
binary::{Disassemble, Parser},
dr::{Loader, Operand},
spirv::{Decoration, ExecutionMode, ExecutionModel, Op, StorageClass, Word},
sr::Constant,
};
use serde::{de::Error as _, Deseri... |
extern crate pitch_calc as pitch;
extern crate portaudio;
extern crate rand;
extern crate sample;
extern crate synth;
extern crate music_tools;
mod single_part_constraints;
mod two_part_constraints;
use crate::single_part_constraints as cf;
use crate::two_part_constraints as cp;
use std::cmp::Ordering;
use std::coll... |
//! Standalone runtime for WebAssembly using Cranelift. Provides functions to translate
//! `get_global`, `set_global`, `current_memory`, `grow_memory`, `call_indirect` that hardcode in
//! the translation the base addresses of regions of memory that will hold the globals, tables and
//! linear memories.
//!
//! Pretty... |
mod bluetooth;
mod utils;
mod wifi;
mod wired;
use bluetooth::get_bluetooth_cmd;
use utils::handle_cmdline_parsing_error;
use wifi::get_wifi_cmd;
use wired::get_wired_cmd;
use crate::options::clear::ClearOptions;
use crate::options::command::RuwiCommand;
use crate::options::GlobalOptions;
use crate::prelude::*;
use c... |
#![deny(missing_docs)]
//! An entity component system supporting mutation tracking and access from
//! Lua scripting through the sludge Lua API.
//!
//! See [the `api` module](crate::api) for more information on integrating
//! entities and components with Lua scripting.
//!
//! This module contains an ECS [`World`](W... |
// Copyright (c) 2020, <NAME> <<EMAIL>>. All rights reserved.
/*
Analyze cribbage hands.
Given a cribbage hand (six cards), which two cards should you discard
to the crib to maximize your chances of getting the best score?
*/
use std::fmt;
use itertools::Itertools;
#[derive(Copy, Clone)]
#[derive(PartialEq)]
enu... |
// This file is part of Acala.
// Copyright (C) 2020-2021 Acala Foundation.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// This program 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 Fou... |
// Copyright 2020 The Grin Developers
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
//! A general interface for Tor client usage.
//!
//! To construct a client, run the `TorClient::bootstrap()` method.
//! Once the client is bootstrapped, you can make anonymous
//! connections ("streams") over the Tor network using
//! `TorClient::connect()`.
use crate::address::IntoTorAddr;
use crate::config::{Clien... |
#![feature(asm)]
use ::keys::{b58encode_check, Address, KeyPair};
use chain::BlockBuilder;
use chain::{IndexedBlock, IndexedBlockHeader, IndexedTransaction};
use chrono::Utc;
use config::{Config, GenesisConfig};
use log::{debug, info, trace, warn};
use prost::Message;
use proto::chain::transaction::Result as Transacti... |
//! Statistics generator for [`slog`].
//!
//! This crate allows for statistics - counters and gauges - to be automatically calculated and
//! reported based on logged events. The logged events MUST implement the [`ExtLoggable`] trait.
//!
//! To support this, the [`slog-extlog-derive'] crate can be used to link logs ... |
use std::io;
#[cfg(any(all(feature = "serde", feature = "strum"), test))]
use std::str::FromStr;
#[cfg(feature = "serde")]
use serde::Deserialize;
use crate::error;
use crate::Int;
#[cfg(target_os = "netbsd")]
use crate::constants;
// Work around GNU not implementing the POSIX standard correctly
#[cfg(all(target_o... |
extern crate piston_window;
#[macro_use(make_slot_pit, make_slot_spawner)]
extern crate swarm_it;
extern crate chrono;
extern crate rand;
extern crate time;
use chrono::prelude::*;
use piston_window::*;
use rand::Rng;
use std::char;
use std::collections::HashMap;
use std::fs::File;
use std::io::{BufRead, BufReader, Re... |
use iced_graphics::window::Compositor;
pub use iced_native::Rectangle;
use iced_native::{keyboard, mouse, Cache, Damage, Point, Size, UserInterface};
use iced_wgpu::window::Compositor as WgpuCompositor;
use std::{
cell::RefCell,
io::{Read, Write},
pin::Pin,
sync::Arc,
time::Duration,
};
pub use as... |
use std::collections::HashSet;
use generational_arena::Arena;
pub use generational_arena::Index;
pub use node::Node;
use crate::geometry::{
IntoPoint, IntoRegion, LineSegment, Point, Region, Shape, Shapelike, ShapelikeError,
};
mod node;
pub mod rendering;
#[cfg(test)]
mod tests;
#[derive(Debug)]
pub struct RT... |
#![feature(collections)]
#![feature(plugin)]
#![plugin(regex_macros)]
extern crate regex;
#[macro_use]
extern crate clap;
#[cfg(not(test))] use clap::{Arg, App};
extern crate glob;
use glob::Pattern;
#[macro_use]
extern crate log;
extern crate env_logger;
extern crate ansi_term;
use ansi_term::Colour::{Green, Red,... |
// Copyright 2019-2021 Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus 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 l... |
use crate::render::*;
use luminance::backend::tess::InstanceSlice;
use luminance::{
backend::{
framebuffer::Framebuffer as FramebufferBackend,
pipeline::{Pipeline as PipelineBackend, PipelineTexture},
render_gate::RenderGate as RenderGateBackend,
shader::{Shader as ShaderBackend, Uni... |
//! The `EnvelopeEditor` widget and related items.
use {Color, Colorable, Borderable, FontSize, Labelable, Positionable, Sizeable, Widget};
use num::Float;
use position::{Direction, Edge, Point, Rect, Scalar};
use std;
use text;
use utils::{clamp, map_range, percentage, val_to_string};
use widget;
/// Used for editi... |
// MEG-OS Kernel
// (c) 2020 Nerry
// License: MIT
#![no_std]
#![no_main]
use alloc::string::*;
use alloc::vec::*;
use bootprot::*;
use core::fmt::Write;
use core::num::NonZeroU8;
use kernel::bus::pci::Pci;
use kernel::bus::usb::*;
use kernel::fs::*;
use kernel::mem::*;
use kernel::rt::*;
use kernel::system::*;
use k... |
// keyboard and joystick support
extern crate minifb;
use minifb::*;
use c64::cia;
/*
C64 keyboard map:
Bit | 7 6 5 4 3 2 1 0
-----+------------------------------------------------------
7 | RUNSTOP Q C= SPACE 2 CTRL <- 1
6 | / ^ = RSHIFT ... |
extern crate arrayvec;
#[macro_use] extern crate common;
extern crate datafile;
extern crate event_loop;
extern crate gamenet_teeworlds_0_6 as gamenet;
extern crate hexdump;
extern crate itertools;
#[macro_use] extern crate log;
extern crate logger;
extern crate map;
#[macro_use] extern crate matches;
extern crate ndar... |
macro_rules! modifier_raw {
($name:ident, $field:ident, $mask:expr) => {
pub fn $name(&self) -> bool {
self.$field & $mask == $mask
}
}
}
macro_rules! modifier {
($name:ident, $mask:expr) => { modifier_raw!($name, access_flags, $mask); }
}
macro_rules! modifier_inner {
($na... |
use crate::context::*;
use crate::context::{PropU16, PropU32};
use crate::ident::*;
use crate::utils::*;
use crate::{Class, Data, Version};
#[derive(Debug, Clone)]
pub enum ParseElfError {
FromIdent(ParseIdentError),
FromVariant(ParseVariantError),
}
#[derive(Debug, Clone)]
pub enum ParseVariantError {
Br... |
#![allow(clippy::zero_prefixed_literal)]
//! Parachain runtime mock.
use crate as pallet_xanchor;
use codec::{Decode, Encode};
use frame_support::{
construct_runtime,
dispatch::DispatchResult,
ord_parameter_types, parameter_types,
traits::{Everything, Nothing, SortedMembers},
weights::{constants::WEIGHT_PER_SECON... |
/// @todo Draw 3 windows
/// @todo Make the GUI mode immediate
/// @todo Make window content scrollable
/// @todo Make window resizable
/// @todo Draw the scene using the select pipeline onto a texture
/// @todo Show that texture within a window
use super::*;
use nalgebra::Matrix4;
use std::ops::Deref;
use std::{conve... |
use std::cmp::{max, min};
use std::fs::File;
use std::io::{self, Read, Write};
use std::mem::replace;
use std::path::PathBuf;
use std::time::Duration;
use dirs::config_dir;
use mortal::{Cursor, Key, Screen, Size, Style};
use serde::{Deserialize, Serialize};
use serde_json as json;
use term_game::{Game, GameImpl};
us... |
#![no_std]
extern crate alloc;
use alloc::vec::Vec;
use core::convert::TryInto;
/// SHA-1 Errors
#[derive(Debug)]
pub enum Error {
InvalidLength,
FullPad,
}
/// Digest length in bytes (160-bits)
pub const DIGEST_LEN: usize = 20;
// Word length in bits
pub const WORD_BITS_LEN: usize = 32;
// Word length i... |
//! Fully connected overlay network
//!
//! The *small network* is an overlay network where each node participating is connected to every
//! other node on the network. The *small* portion of the name stems from the fact that this
//! approach is not scalable, as it requires at least $O(n)$ network connections and broa... |
#[macro_use]
extern crate cfg_if;
extern crate nalgebra;
extern crate rand;
extern crate wasm_bindgen;
use nalgebra::{Point2, Vector3};
use rand::rngs::OsRng;
use rand::Rng;
use std::cmp::Ordering;
use std::slice;
use wasm_bindgen::prelude::*;
// A macro to provide `println!(..)`-style syntax for `console.log` loggin... |
use wasm_encoder::SectionId;
pub mod types_interner;
use std::collections::BTreeMap;
use std::convert::TryFrom;
use types_interner::{EntityType, InstanceType, Type, TypeId, TypesInterner};
/// A collection of info about modules within a module linking bundle.
pub(crate) struct ModuleContext<'a> {
arena: Vec<Modu... |
/*
Output safe functions
=====================
Copyright (c) 2021 <NAME>
MIT licenced
https://github.com/curiousdannii/if-decompiler
*/
use std::io::prelude::*;
use std::time::Instant;
use if_decompiler::*;
use glulx::*;
use Operand::*;
use glulx::opcodes;
use relooper::*;
use BranchMode::*;
use ShapedBlock::*;
u... |
use std::net::{IpAddr, SocketAddr};
use std::ops::{Deref, DerefMut};
use std::sync::Arc;
use std::time::{Duration, SystemTime, UNIX_EPOCH};
use std::{io, str};
use bytes::{Buf, BufMut, BytesMut};
use ring::aead::quic::{HeaderProtectionKey, AES_128, AES_256, CHACHA20};
use ring::aead::{self, Aad, Nonce};
use ring::dige... |
//! Anonymous asymmetric [Authenticated
//! Encryption](https://en.wikipedia.org/wiki/Authenticated_encryption) (AE).
//!
//! This module corresponds to the [`crypto_box_seal`
//! API](https://doc.libsodium.org/public-key_cryptography/sealed_boxes) from Sodium.
//!
//! In the [`cipher`](crate::asymmetric::cipher) modul... |
use std::{
cmp::Ordering,
io::{self, ErrorKind},
marker::PhantomData,
sync::Arc,
};
use bytes::BufMut;
use crc32fast::Hasher;
use memmap2::Mmap;
use rkyv::{
ser::{
serializers::{
AlignedSerializer, AllocScratch, BufferScratch, CompositeSerializer,
CompositeSerializer... |
//! `TextBox` styling.
//!
//! Style objects and why you need them
//! ===================================
//!
//! By itself, a [`TextBox`] does not contain the information necessary to draw it on a display.
//! This information is called "style" and it is contained in [`TextBoxStyle`] objects.
//!
//! The recommended ... |
use std::collections::HashMap;
use std::io::{BufRead, Write};
use std::str::FromStr;
use itertools::Itertools;
use rand::Rng;
use scan_fmt::parse::ScanError;
use crate::bots::{ActionView, Bot, HonestCarefulRandomBot, RandomBot};
use crate::fsm::{Action, ActionType, Card, CARDS_PER_PLAYER, ConstRng, Deck, play_action,... |
use std::{cmp::Ordering, sync::Arc};
use eyre::Report;
use rosu_v2::prelude::{
GameMode, OsuError,
RankStatus::{self, Approved, Loved, Ranked},
Score,
};
use tokio::time::{sleep, Duration};
use twilight_model::{
application::interaction::{
application_command::{CommandDataOption, CommandOptionV... |
// Copyright Materialize, Inc. and contributors. All rights reserved.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by ... |
use crate::{
blockcfg::{
ApplyBlockLedger, Block, BlockVersion, Contents, HeaderBuilderNew, LeaderOutput,
Leadership, LedgerParameters,
},
blockchain::{new_epoch_leadership_from, EpochLeadership, LeadershipBlock, Ref, Tip},
intercom::{unary_reply, BlockMsg, Error as IntercomError, Transa... |
#![cfg(feature = "serde")]
mod assets;
use assets::*;
use quartz_nbt::{
compound,
io::{self, Flavor},
serde::{deserialize, deserialize_from, deserialize_from_buffer, serialize, Array},
NbtCompound,
NbtList,
NbtTag,
};
use serde::{de::Visitor, ser::SerializeStruct, Deserialize, Serialize};
use s... |
#![allow(clippy::mutable_key_type)]
use std::{collections::HashMap, convert::TryFrom, panic, sync::Arc, thread, time::Duration};
use backtrace::Backtrace;
#[cfg(all(
not(target_env = "msvc"),
not(target_os = "macos"),
feature = "jemalloc"
))]
use {
jemalloc_ctl::{Access, AsName},
jemallocator::Jem... |
#![crate_name = "cerith"]
#![crate_type = "lib"]
extern crate rand;
extern crate regex;
extern crate time;
use rand::Rng;
use regex::Regex;
use std::collections::HashSet;
use std::fmt;
use std::fs::OpenOptions;
use std::io::{Error, ErrorKind, Read, Write};
use std::net::TcpStream;
use std::thread;
use std::time::Dura... |
use crossbeam_deque::{self as deque, Pop, Steal, Stealer, Worker};
use crossbeam_queue::SegQueue;
#[cfg(rayon_unstable)]
use internal::task::Task;
#[cfg(rayon_unstable)]
use job::Job;
use job::{JobFifo, JobRef, StackJob};
use latch::{CountLatch, Latch, LatchProbe, LockLatch, SpinLatch, TickleLatch};
use log::Event::*;
... |
//! # Transaction Payment Module
//!
//! ## Overview
//!
//! Transaction payment module is responsible for charge fee and tip in
//! different currencies
#![cfg_attr(not(feature = "std"), no_std)]
#![allow(clippy::unused_unit)]
use frame_support::debug;
use frame_support::{
dispatch::{DispatchResult, Dispatchable... |
// 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 those terms.
// Tracking of sent... |
use crate::fungible_token::*;
use crate::parameters::*;
use crate::sdk;
use crate::types::{
AccountId, Balance, EthAddress, Gas, PromiseResult, Proof, SdkUnwrap, ERR_FAILED_PARSE,
};
use crate::admin_controlled::{AdminControlled, PausedMask};
use crate::deposit_event::*;
use crate::engine::Engine;
use crate::json:... |
#[allow(unused_imports)]
#[macro_use]
extern crate origen;
use pyapi_metal;
mod dut;
mod file_handler;
mod logger;
mod meta;
mod model;
#[macro_use]
mod pins;
mod registers;
mod services;
#[macro_use]
mod timesets;
mod _frontend;
mod _helpers;
mod application;
mod producer;
mod prog_gen;
mod standard_sub_blocks;
mod ... |
use std::cell::RefCell;
use std::collections::HashSet;
use std::rc::Rc;
use rustc::ty::{self, layout::Size};
use rustc::hir::{Mutability, MutMutable, MutImmutable};
use rustc::mir::RetagKind;
use crate::{
EvalResult, EvalErrorKind, MiriEvalContext, HelpersEvalContextExt, Evaluator, MutValueVisitor,
MemoryKind... |
use crate::{
config::settings,
level, model,
space::{Camera, Transform},
};
use bytemuck::{Pod, Zeroable};
use wgpu::util::DeviceExt as _;
use std::{
collections::HashMap,
fs::File,
io::{BufReader, Error as IoError, Read},
mem,
path::PathBuf,
sync::Arc,
};
#[cfg(feature = "glsl")]... |
//! Ensures that `Pod`s are configured and running for each [`KafkaCluster`]
use std::{
borrow::Cow,
collections::{BTreeMap, HashMap},
sync::Arc,
time::Duration,
};
use snafu::{OptionExt, ResultExt, Snafu};
use stackable_kafka_crd::{
KafkaCluster, KafkaRole, APP_NAME, APP_PORT, METRICS_PORT, SERVE... |
//
// Copyright (c) 2020 <NAME>
//
//! This crate implements the "FastCDC" content defined chunking algorithm in
//! pure Rust. A critical aspect of its behavior is that it returns exactly the
//! same results for the same input. To learn more about content defined
//! chunking and its applications, see "FastCDC: a Fa... |
//! The module with all handlers required by uploading dragged and dropped files on IDE.
use crate::prelude::*;
use crate::controller::graph::LocationHint;
use crate::controller::graph::NewNodeInfo;
use crate::model::module::NodeMetadata;
use crate::model::module::Position;
use crate::model::module::UploadingFile;
u... |
use ndarray::*;
use num_traits::AsPrimitive;
use crate::internal::*;
use crate::model::*;
use super::depth_wise::DepthWise;
use super::im2col::Im2Col;
use super::mat_mat::MatMat;
use super::vec_mat::VecMat;
use super::Conv;
use crate::ops::cnn::conv::KernelFormat;
use crate::ops::cnn::{PaddingSpec, Patch, PatchSpec}... |
//---------------------------------------------------------------------------//
// Copyright (c) 2017-2020 <NAME>. All rights reserved.
//
// This file is part of the Rusted PackFile Manager (RPFM) project,
// which can be found here: https://github.com/Frodo45127/rpfm.
//
// This file is licensed under the MIT license... |
// Copyright (c) Facebook, Inc. and its affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the "hack" directory of this source tree.
pub mod dump_expr_tree;
use aast_parser::{
rust_aast_parser_types::{Env as AastEnv, ParserResult},
AastParser, Error as AastErr... |
// Copyright 2021 The Grin Developers
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
use fnv::{FnvHashMap, FnvHashSet};
use smallvec::smallvec as vec;
use smallvec::SmallVec;
use std::fmt::Debug;
use std::marker::PhantomData;
use std::{borrow::Borrow, collections::VecDeque};
type Vec<T> = SmallVec<[T; 16]>;
#[derive(Debug, Clone, Copy)]
pub enum Error {
NodeDoesNotExist,
PortDoesNotExist,
... |
//! The [`Product`] iterator.
use std::mem::MaybeUninit;
use smallvec::{smallvec, SmallVec};
use crate::tuple::{CloneTuple, FieldSet, HasFieldSet, Tuple, TuplePool};
/// [`SmallVec`]s used inside [`Product`]. Most users won't have to deal with
/// n-ary products where `n >= 8`. In those cases, an allocation for a v... |
use crate::shared::{find_func_by_name, get_param_n_idx, insert_postfix, insert_prefix};
use std::error::Error;
use std::ffi::OsStr;
use wasm::highlevel::{
Function, Global, GlobalOp, Instr, LoadOp, Local, LocalOp, Module, NumericOp, StoreOp,
};
use rand::distributions::{Distribution, Uniform};
use wasm::{BlockType,... |
// #[allow(deprecated)] doesn't silence warnings on the method invocations,
// which would call the inherent methods if AsciiExt wasn't in scope.
#![cfg_attr(feature = "std", allow(deprecated))]
#[cfg(feature = "quickcheck")]
use quickcheck::{Arbitrary, Gen};
use core::mem;
use core::cmp::Ordering;
use core::{fmt, ch... |
use crate::ast::*;
use crate::error::Error;
use crate::format::format_float;
use crate::parser;
use itertools::Itertools;
use rand::{Rng, SeedableRng};
use rand_xorshift::XorShiftRng;
use std::collections::HashMap;
use std::f64;
use std::io::{self, BufRead, Write};
pub struct Interpreter<'a> {
program: &'a Progr... |
// Copyright 2018-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... |
/*
* SPDX-License-Identifier: MIT OR BlueOak-1.0.0
* Copyright (c) 2018-2019 <NAME> <<EMAIL>>
* Copyright (c) <NAME> <<EMAIL>>
* Original code distributed under MIT, additional changes are under BlueOak-1.0.0
*/
//! MMU initialisation.
//!
//! Paging is mostly based on [previous version](https://os.phil-opp.com/p... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Task starting the quadrature decoder"]
pub tasks_start: TASKS_START,
#[doc = "0x04 - Task stopping the quadrature decoder"]
pub tasks_stop: TASKS_STOP,
#[doc = "0x08 - Read and clear ACC and ACCDBL"]
pub tasks_readc... |
//! The `packet` module defines data structures and methods to pull data from the network.
use crate::cuda_runtime::PinnedVec;
use crate::erasure::ErasureConfig;
use crate::recvmmsg::{recv_mmsg, NUM_RCVMMSGS};
use crate::recycler::{Recycler, Reset};
use crate::result::{Error, Result};
use bincode;
use byteorder::{ByteO... |
//! Transactions part of API implementation.
// Built-in uses
// External uses
use actix_web::{
web::{self, Json},
Scope,
};
use serde::{Deserialize, Serialize};
// Workspace uses
use zksync_storage::{
chain::operations_ext::records::TxReceiptResponse, QueryResult, StorageProcessor,
};
use zksync_types::... |
use crate::datatype::{Dimension, Position, ChunkUnit, BlockUnit};
use crate::world::mesh::{Mesh, MeshType, MeshDataTypeFull};
use crate::world::chunk::{Chunk, CHUNK_SIZE};
use crate::world::shader::{CubeVert, cube_vs, cube_fs, IndexType};
use crate::world::ChunkID;
use crate::world::block::Block;
use crate::world::chun... |
//! The code that opens an OFF file and parses it into a polytope.
//! Also the code that writes an OFF file of a polytope.
use std::{collections::{HashMap, HashSet}, fmt::Display, io::Error as IoError, path::Path, str::FromStr};
use crate::{
abs::{AbstractBuilder, Ranked, SubelementList, Subelements},
conc::... |
use super::{framebuffer::Framebuffer, quadrender, shader_strings, GameState, Rltk, Shader};
#[cfg(not(target_arch = "wasm32"))]
use glutin::{
dpi::LogicalSize, event::Event, event::WindowEvent, event_loop::ControlFlow,
event_loop::EventLoop, window::WindowBuilder, ContextBuilder,
};
use glow::HasContext;
#... |
// Copyright 2019-2020 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... |
// 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... |
// Musium -- Music playback daemon with web-based library browser
// 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.
// A copy of the License has been included in the root of the repository.
use std::collectio... |
// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: MIT OR Apache-2.0
#![allow(clippy::used_underscore_binding)] // #20
//! Provides a `RepositoryEditor` object for building and editing TUF repositories.
mod keys;
pub mod signed;
pub mod targets;
mod test;
use crate... |
//! Structures useful for solving sudoku problems
use std::collections;
use std::hash::Hash;
use std::iter::{Rev, Take, Zip};
use std::mem;
use std::ops::Deref;
use std::rc::Rc;
use std::slice::{ChunksMut, IterMut};
use super::grid::{CaseId, CellId, FromIndex, Grid, HasGridSize, ValueId};
use super::rules::{CliqueId,... |
use crate::gbmode::GbMode;
const VRAM_SIZE: usize = 0x4000;
const VOAM_SIZE: usize = 0xA0;
pub const SCREEN_W: usize = 160;
pub const SCREEN_H: usize = 144;
#[derive(PartialEq, Copy, Clone)]
enum PrioType {
Color0,
PrioFlag,
Normal,
}
pub struct GPU {
mode: u8,
modeclock: u32,
line: u8,
l... |
// 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... |
// Copyright 2017 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... |
//! Decoding and Encoding of PNG Images
//!
//! PNG (Portable Network Graphics) is an image format that supports lossless compression.
//!
//! # Related Links
//! * <http://www.w3.org/TR/PNG/> - The PNG Specification
//!
use std::convert::TryFrom;
use std::io::{self, Read, Write};
use num_rational::Ratio;
use png::{B... |
//! Frontend logic for parsing and expanding ASTs. This code largely mimics the behavior of
//! `rustc_driver::driver::compile_input`.
use rustc::dep_graph::DepGraph;
use rustc::hir::map as hir_map;
use rustc::session::config::Options as SessionOptions;
use rustc::session::config::{Input, OutputFilenames};
use rustc:... |
//! Native gas price estimator based on the https://github.com/zsfelfoldi/feehistory/blob/main/docs/feeOracle.md
use super::{linear_interpolation, EstimatedGasPrice, GasPrice1559, GasPriceEstimating};
use anyhow::{anyhow, ensure, Result};
use std::{
convert::TryInto,
f64::consts::{E, PI},
fmt::Debug,
s... |
use rand::SeedableRng;
use rand_xorshift::XorShiftRng;
use geom::{Angle, Duration, Polygon, Pt2D, Time, UnitFmt};
use widgetry::{
lctrl, Choice, Color, ContentMode, DragDrop, Drawable, EventCtx, Fill, GeomBatch, GfxCtx,
HorizontalAlignment, Image, Key, Line, LinePlot, Outcome, Panel, PanelDims, PersistentSplit... |
// Copyright (c) 2017-present, PingCAP, Inc. Licensed under Apache-2.0.
use std::collections::VecDeque;
use std::fs;
use std::fs::File;
use std::io::BufRead;
use std::io::{Error as IoError, ErrorKind as IoErrorKind, Read, Seek, Write};
use std::path::{Path, PathBuf};
use std::sync::Arc;
use std::time::Instant;
use fs... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.