text stringlengths 9.08k 47.9k |
|---|
// Copyright 2018 navx-rs Developers.
// 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 accordin... |
pub mod download;
pub mod environment;
pub mod error;
pub mod memory;
pub mod session;
pub mod sys;
pub mod tensor;
use std::{
ffi::CStr,
sync::{atomic::AtomicPtr, Arc, Mutex}
};
pub use error::{OrtApiError, OrtError, Result as OrtResult};
use lazy_static::lazy_static;
use self::sys::OnnxEnumInt;
#[macro_export]
... |
// Copyright 2021 MaidSafe.net limited.
//
// This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT
// https://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD
// https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied,
// modified, or d... |
// The `timer` module is a copy-paste from the code of `futures-timer`, but
// adjusted for WASM.
//
// Copyright (c) 2014 <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 with... |
//! `ValidatorTable` combined with merkle trie is complete state of staking and validator,
//! so many methods here needs caller to provide access to external merkle trie
//! through traits `GetStaking` and `StoreStaking`.
use std::collections::{BTreeMap, BTreeSet, HashMap};
use core::cmp::Ordering;
use itertools::It... |
use {
log::*,
rand::{seq::SliceRandom, thread_rng, Rng},
solana_client::rpc_client::RpcClient,
solana_core::validator::{ValidatorConfig, ValidatorStartProgress},
solana_download_utils::{download_snapshot_archive, DownloadProgressRecord},
solana_genesis_utils::download_then_check_genesis_hash,
... |
use crate::sys::unity::version::module::get_android_open_jdk_download_info;
use crate::sys::unity::version::module::get_android_sdk_ndk_download_info;
use crate::unity::component::Category;
use crate::unity::MD5;
use crate::unity::{
Component, IniManifest, IniData, Localization, Version, VersionType,
};
use std::i... |
// 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 no... |
use crate::rng;
use arrayvec::ArrayVec;
use brain::{Brain, Decision};
use futures::{
channel::mpsc::{self, Receiver, Sender},
prelude::*,
Future,
};
use gridsim::{moore::*, Neighborhood, SquareGrid};
use iced::Color;
use min_max_heap::MinMaxHeap;
use ndarray::Array2;
use rand::{distributions::Bernoulli, seq... |
use rayon::prelude::*;
use crate::bba_init_proof;
use crate::bba_open_proof;
use crate::bba_update_proof;
use crate::endo::EndoScalar;
use crate::fft::lagrange_commitments;
use crate::proof_system;
use crate::schnorr;
use algebra::{AffineCurve, PrimeField, ProjectiveCurve, UniformRand, VariableBaseMSM, Zero};
use array... |
use crate::error::{HandlingError, XrefError};
use crate::{
dictionary::Dictionary,
object::{Name, Object, StringFormat},
stream::{Stream, TextContent},
utils::{_name, _real, hex_char2, int1, take_until_unmatched, ws},
xref::{Xref, XrefEntry},
NomResult, ObjectId, ObjectNumber,
};
use anyhow::Res... |
//! A Wrapper for module which synchronizes opening/closing and all changes with Language Server.
use crate::prelude::*;
use enso_text::unit::*;
use crate::model::module::Content;
use crate::model::module::NodeMetadata;
use crate::model::module::Notification;
use crate::model::module::NotificationKind;
use crate::mod... |
use std;
use std::fmt;
/// Types of icon elements that can be decoded as images or masks.
///
/// This type enumerates the kinds of [`IconElement`](struct.IconElement.html)
/// that can be decoded by this library; each `IconType` corresponds to a
/// particular [`OSType`](struct.OSType.html). The non-mask `IconType` ... |
/* derived from the RSA Data Security, Inc.
* MD4 Message-Digest Algorithm
*
* See [RFC-1320](docs/rfc1320-md4.txt) and [LICENSE](LICENSE) for full license information
*/
#![no_std]
extern crate alloc;
use alloc::vec::Vec;
use core::convert::TryInto;
/// Length of the MD4 digest in bytes
pub const DIGEST_LEN: ... |
//! Bindings for emulating a MySQL/MariaDB server.
//!
//! When developing new databases or caching layers, it can be immensely useful to test your system
//! using existing applications. However, this often requires significant work modifying
//! applications to use your database over the existing ones. This crate sol... |
use bridge::TTInputFormat;
use crate::help;
use crate::text_layout_engine::{NativeFont::*, TextLayoutEngine};
use std::ptr;
use crate::{t_eprint, t_print, t_print_nl};
use std::io::Read;
use crate::xetex_ini::b16x4;
use crate::xetex_ini::nine_bits;
use crate::xetex_ini::str_number;
use crate::xetex_scaledmath::Scale... |
// Copyright (c) 2021 Quark Container Authors / 2018 The gVisor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless ... |
// mostly copied from https://github.com/arzg/eldiro/blob/f3d588f8a76e2e4317c1d77ae2758b0781bb5af3/crates/parser/src/grammar.rs
use super::*;
pub fn expr(p: &mut Parser) {
if p.at_set(super::STATEMENT_RECOVER_SET) {
return;
}
expr_binding_power(p, 0);
}
fn expr_binding_power(p: &mut Parser, minim... |
// Copyright (C) 2020 <NAME> <<EMAIL>>
//
// Licensed under the MIT license, see the LICENSE file or <http://opensource.org/licenses/MIT>
use crate::config::Config;
use crate::rooms::{Room, RoomId, Rooms};
use crate::subscriber::Subscriber;
use std::collections::HashMap;
use std::mem;
use std::sync::{Arc, Mutex};
us... |
// Copyright 2015-2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MI... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Function address"]
pub addr: ADDR,
#[doc = "0x04 - Power management and control register"]
pub pow: POW,
#[doc = "0x08 - Interrupt flags for endpoint 0 and IN endpoints 1-5"]
pub iif: IIF,
_reserved3: [u8; 4usiz... |
use super::{
candidate,
chain::{self, AppliedBlock, CheckHeaderProof, LeadershipBlock},
chain_selection::{self, ComparisonResult},
Blockchain, Error, PreCheckedHeader, Ref, Tip, MAIN_BRANCH_TAG,
};
use crate::{
blockcfg::{Block, FragmentId, Header, HeaderHash},
blockchain::Checkpoints,
inter... |
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... |
use crate::AdditiveShare;
use bench_utils::{timer_end, timer_start};
use neural_network::{
layers::{Layer, LayerInfo, NonLinearLayer, NonLinearLayerInfo},
NeuralArchitecture, NeuralNetwork,
};
use rand::{CryptoRng, RngCore};
use std::{
io::{Read, Write},
marker::PhantomData,
};
use algebra::{
fixed... |
//
// Sysinfo
//
// Copyright (c) 2018 <NAME>
//
use crate::{DiskUsage, Pid, ProcessExt, Signal};
use std::fmt::{self, Debug};
use std::mem::{size_of, zeroed, MaybeUninit};
use std::ops::Deref;
use std::path::{Path, PathBuf};
use std::process;
use std::ptr::null_mut;
use std::str;
use std::time;
use libc::{c_void, m... |
//! Utility functions for X11 things.
//!
//! The most important definitions in this module are the [`TryParse`], [`TryParseFd`] and
//! [`Serialize`] traits. These traits are used internally for parsing incoming data and producing
//! outgoing data when talking with the X11 server.
use std::convert::TryInto;
use cra... |
#![allow(unused_variables, unused_imports, dead_code)]
extern crate aws_lambda_events;
extern crate base58;
#[macro_use]
extern crate failure;
extern crate futures;
extern crate graph_descriptions;
#[macro_use]
extern crate hmap;
extern crate lambda_runtime as lambda;
#[macro_use]
extern crate log;
extern crate lru_ti... |
//! Low-level API to read the binary contents of a SAILAR module.
use crate::binary;
use crate::binary::index;
use crate::binary::instruction::{self, Instruction, Opcode};
use crate::binary::record;
use crate::binary::signature;
use crate::helper::borrow::CowBox;
use crate::identifier;
use crate::versioning;
use std::... |
use num_derive::FromPrimitive;
use crate::attribute::{Attribute, AttributeName};
use crate::character::character_common_data::CharacterCommonData;
use crate::character::character_sub_stat::CharacterSubStatFamily;
use crate::character::{CharacterConfig, CharacterName, CharacterStaticData};
use crate::character::skill_co... |
use crate::{
dataflow::{
constants::IDLE_EXTRACTION_FUEL,
operators::{DelayExt, Fuel},
utils::{granulate, Time},
worker_timeline::{process_timely_event, EventMap, EventProcessor},
ArrangedKey, ArrangedVal, ChannelId, Diff, OperatorAddr, OperatorId, TimelineEvent,
Time... |
use ash::vk;
use crate::helper::record_and_submit_command_buffer;
use gpu_allocator::vulkan::{Allocation, AllocationCreateDesc, Allocator};
use gpu_allocator::MemoryLocation;
#[repr(C)]
#[derive(Clone, Copy)]
struct ImGuiCBuffer {
scale: [f32; 2],
translation: [f32; 2],
}
pub struct ImGuiRenderer {
sample... |
use image::{
DynamicImage, GenericImageView, ImageBuffer, Pixel, Primitive, Rgba, Rgba32FImage, RgbaImage,
};
use num_traits::{clamp, NumCast, ToPrimitive};
use rayon::iter::{ParallelBridge, ParallelIterator};
// The MIT License (MIT)
//
// Copyright (c) 2014 PistonDevelopers
//
// Permission is hereby granted, fr... |
// Copyright 2016 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... |
use super::ast::{
AlternationArm, AstVisitor, Declaration, Expression, ExpressionType, MutAstVisitor, Program,
Term,
};
use std::collections::{HashMap, HashSet};
use std::ops::Deref;
mod constraint;
mod constraint_set;
mod mgu;
mod stack;
mod stack_constraint;
mod subscript;
mod type_alloc;
mod type_error;
mo... |
#![allow(non_upper_case_globals)]
use std::io::Read;
use std::{thread, time};
use std::collections::VecDeque;
use cmd_lib::{
CmdResult,
proc_var,
proc_var_get,
proc_var_set,
run_cmd,
run_fun,
};
// Tetris game converted from bash version:
// https://github.com/kt97679/tetris
// Original commen... |
use crate::{
openapi::{
generate::{
controller_info::ControllerInfo,
crate_syn_browser::{Browser, Item, ItemKind, Module, UseScope},
response_info::AnonymousType,
type_info::TypeInfo,
utils::{find_macro_attribute_flag, find_macro_attribute_named_va... |
// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// 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 ... |
use std::{
collections::VecDeque,
mem::{size_of, swap},
ptr::{null_mut, NonNull},
};
use wtf_rs::{
keep_on_stack, object_offsetof, segmented_vec::SegmentedVec, stack_bounds::StackBounds,
};
#[cfg(feature = "debug-snapshots")]
use super::freeze_cell_into;
use super::{
addr::*,
block::*,
blo... |
use crossbeam_epoch::*;
use std::hash::{Hash, BuildHasher};
use std::sync::atomic::Ordering;
use std::borrow::Borrow;
use std::mem;
use std::ptr;
use std::fmt;
/// A lock-free concurrent skiplist-based map with epoch GC memory reclamation.
///
/// This structure is based on Keir Fraser's algorithm from [his PhD thesis... |
//! Models of PDF types
use std::io;
use std::rc::Rc;
use std::collections::HashMap;
use crate as pdf;
use crate::object::*;
use crate::error::*;
use crate::content::Content;
use crate::font::Font;
use crate::file::File;
use crate::backend::Backend;
/// Node in a page tree - type is either `Page` or `PageTree`
#[der... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
//! This module implements an in-memory Sparse Merkle Tree that is similar to what we use in
//! storage to represent world state. This tree will store only a small portion of the state -- the
//! part of accounts that have been modifie... |
/**
* 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 ... |
//! Monitoring metrics.
//!
//! This module contains all types expressing metrics collected during a
//! validation run. For each such run, there is an associated value of type
//! [`Metrics`] that collects all metrics gathered during the run. Additional
//! types contain the metrics related to specific processed entit... |
use core::fmt::Write;
use std::collections::BTreeMap;
use std::collections::HashMap;
use cborg::KeyVal;
use cborg::ToValue;
use cborg::Value;
use cborg::ValueInto;
const LONG_STRING: &str = "This line is greater than 256 characters to test if lengths are encoded correctly after the major. This line is greater than 25... |
//! Contains the algorithm to determine which chunks may contain
//! "duplicate" primary keys (that is where data with the same
//! combination of "tag" columns and timestamp in the InfluxDB
//! DataModel have been written in via multiple distinct line protocol
//! writes (and thus are stored in separate rows)
use dat... |
// Copyright 2018-2020 Cargill Incorporated
//
// 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... |
use std::marker::PhantomData;
use rand::{CryptoRng, RngCore};
use crate::DecryptionException::{OutOfOrderMessage, UnknownMessageHeader};
use jester_encryption::diffie_hellman::DiffieHellmanKeyExchangeScheme;
use jester_encryption::SymmetricalEncryptionScheme;
use std::collections::HashMap;
use std::hash::Hash;
#[cfg... |
// A runtime module Groups with necessary imports
// Feel free to remove or edit this file as needed.
// If you change the name of this file, make sure to update its references in
// runtime/src/lib.rs If you remove this file, you can remove those references
// For more guidance on Substrate modules, see the example ... |
use std::default::Default;
use ansi_term::{ANSIString, Color, Style};
use config::{Config, Value};
use clap::Shell;
use utils::{Error, ErrorKind};
mod cwd;
mod exit_code;
mod generic;
mod git;
mod prompt;
pub use self::cwd::*;
pub use self::exit_code::*;
pub use self::generic::*;
pub use self::git::*;
pub use self:... |
use crate::settings::Group;
use std::ops::Range;
use std::convert::TryInto;
/** Create a new population from the given preference group. */
pub fn population(group: &Group) -> Vec<Individual> {
let init2 = ||
if group.init_to_random {
[ rand::random(), rand::random() ]
} else {
[ 0.0, 0.0 ]
};
let init14... |
//---------------------------------------------------------------------------//
// Copyright (c) 2017-2022 <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... |
use futures::prelude::*;
use std::collections::{BTreeMap, HashMap};
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::Arc;
use crate::conshash::weights::client::SMClient as WeightSMClient;
use crate::conshash::weights::DEFAULT_SERVICE_ID;
use crate::membership::client::{Member, ObserverClient as MembershipC... |
use colored::*;
use rayon::prelude::*;
use std::path::{Path, PathBuf};
use clap::Arg;
use clap::{app_from_crate, crate_authors, crate_description, crate_name, crate_version};
/// Represents a file or a directory
/// `size` for directories is computed at creation
/// `children` is a vec of nodes which are inside this ... |
use crate::error::ContractError;
use crate::helpers::{
get_and_check_limit, get_deposit_message, get_proposal_deposit_refund_message,
get_staked_balance, get_total_staked_supply, get_voting_power_at_height, map_proposal,
};
use crate::msg::{
ExecuteMsg, GovTokenMsg, InstantiateMsg, ProposeMsg, QueryMsg, Sta... |
use std::fmt;
use symbolic_common::{Arch, AsSelf, DebugId, Language, Name};
use crate::error::SymCacheError;
use crate::format;
/// A platform independent symbolication cache.
///
/// Use [`SymCacheWriter`] writer to create SymCaches, including the conversion from object files.
///
/// [`SymCacheWriter`]: struct.Sym... |
extern crate dependy;
extern crate humantime;
extern crate runny;
extern crate systemd_parser;
use std::cell::RefCell;
use std::collections::HashMap;
use std::fs::File;
use std::io::{BufRead, BufReader, Read};
use std::sync::mpsc::Sender;
use std::path::{Path, PathBuf};
use std::rc::Rc;
use std::thread;
u... |
#![allow(warnings)]
use core::convert::TryInto;
use elliptic_curve::group;
// use libc_print::libc_println;
use generic_array::GenericArray;
use num_bigint_dig::{BigInt, BigUint, ModInverse, RandBigInt, Sign};
use num_traits::Zero;
use p384::{EncodedPoint, NistP384};
use crate::HIPError;
use super::ecdh::{PkP384, Sh... |
/// Restore as stored in Platform log. It's used to log the update details of a
/// updateRestore request, so only mutable and non-output_only fields are
/// included here..
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LoggedRestore {
/// Full name of the Backup resource this Restore resource used to re... |
use nalgebra::{
DMatrix, DVector, Matrix1x2, Matrix1x3, Matrix1x4, Matrix2, Matrix2x1, Matrix2x3, Matrix2x4,
Matrix3, Matrix3x1, Matrix3x2, Matrix3x4, Matrix4, Matrix4x1, Matrix4x2, Matrix4x3, Point,
Point1, Point2, Point3, Point4, Point5, Point6, SMatrix, SVector, Vector1, Vector2, Vector3,
Vector4, Ve... |
// 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... |
#![forbid(unsafe_code)]
#[macro_use] mod macros;
#[cfg( feature = "manifest") ] mod manifest;
#[cfg(not(feature = "manifest"))] mod manifest { pub(super) fn find_cwd_installs() -> Result<Vec<crate::InstallSet>, crate::Error> { Ok(Vec::new()) } }
use std::env::ArgsOs;
use std::fmt::{self, Display, Debug, Formatter,... |
/// Module for utility functions for textures
#[macro_use]
pub mod texture;
/// Module for the lighting system
pub mod lighting;
/// Rendering post processing effects
pub mod posteffect;
/// Module for dealing with shaders
pub mod shader;
use glium::backend::Facade;
use glium::draw_parameters::{BackfaceCullingMode, De... |
// MOI remote daemon
#[macro_use] extern crate log;
#[macro_use] extern crate json;
#[macro_use] extern crate moi;
extern crate toml;
extern crate mosquitto_client;
extern crate md5;
extern crate libc;
mod plugin;
use plugin::Plugins;
const VERSION: &str = "0.1.6";
use mosquitto_client::{Mosquitto,MosqMessage};
use ... |
use std::collections::HashMap;
use std::{
borrow::BorrowMut,
fmt::{self, Debug},
};
use indexmap::IndexMap;
use log::*;
use crate::{
Analysis, AstSize, Dot, EClass, Extractor, Id, Language, Pattern, RecExpr, Searcher, UnionFind,
};
/** A data structure to keep track of equalities between expressions.
# ... |
use clap::{App, Arg};
use egg::*;
use std::collections::{HashMap, HashSet};
use std::env::*;
use std::fs::*;
use std::time::*;
use std::time::{Duration, Instant};
use tamago::benchnet;
use tamago::bert;
use tamago::model::*;
use tamago::nasneta;
use tamago::nasrnn;
use tamago::optimize::*;
use tamago::resnet50;
use tam... |
//! First-order conic linear program solver
use num_traits::Float;
use core::marker::PhantomData;
use core::fmt::{Debug, LowerExp};
use crate::linalg::LinAlg;
use crate::operator::Operator;
use crate::cone::Cone;
use crate::utils::*;
//
/// Solver errors.
#[derive(Debug, Clone, Copy, PartialEq)]
pub en... |
// region: auto_md_to_doc_comments include README.md A //!
//! # cargo-auto
//!
//! **cargo-auto - automation tasks written in Rust language for the build process of rust projects**
//! ***[repository](https://github.com/LucianoBestia/cargo-auto); version: 2021.1023.917 date: 2021-10-23 authors: <NAME>***
//!
//... |
use eyre::{bail, eyre, Result};
use std::convert::TryFrom;
use std::fmt::Debug;
use tracing::{debug, info, instrument};
#[instrument]
pub fn run() -> Result<()> {
let tileset = TileSet::parse(include_str!("../data/day20.txt"))?;
info!(t = ?tileset.tiles.len());
let corner_product = tileset.find_corner_prod... |
//! low level transport that deals with reading bytes from an underlying Io
//! handling data split accross packets, etc.
use std::collections::VecDeque;
use std::fmt;
use std::io::{self, Cursor, Write};
use std::mem;
use std::ops::{Deref, DerefMut};
use std::sync::Arc;
use std::str;
use tokio::io::{AsyncRead, AsyncWri... |
#[derive(Debug,Clone)]
pub struct RGB {
pub red: u8,
pub green: u8,
pub blue: u8,
}
#[derive(Debug,Clone)]
pub struct RGBA {
pub red: u8,
pub green: u8,
pub blue: u8,
pub alpha: u8,
}
/*
const COLOR2: [RGB;2] = [
RGB{red:0x00,green:0x00,blue:0x00}, // 0 black
RGB{red:0xff,green... |
use crate::context::{CheckLintNameResult, LintStore};
use crate::late::unerased_lint_store;
use rustc_ast as ast;
use rustc_ast::unwrap_or;
use rustc_ast_pretty::pprust;
use rustc_data_structures::fx::FxHashMap;
use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder};
use rustc_hir as hir;
use rustc_hir::... |
//! Checkpoint-based block verification for Zebra.
//!
//! Checkpoint-based verification uses a list of checkpoint hashes to speed up the
//! initial chain sync for Zebra. This list is distributed with Zebra.
//!
//! The CheckpointVerifier queues pending blocks. Once there is a chain from the
//! previous checkpoint to... |
// Copyright 2018 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 library providing simple `Color` and `Gradient` types along with useful transformations and
//! presets.
//!
//!
//! Inspiration taken from [elm-lang's color module]
//! (https://github.com/elm-lang/core/blob/62b22218c42fb8ccc996c86bea450a14991ab815/src/Color.elm)
//!
//!
//! Module for working with colors. ... |
// This file is part of Sulis, a turn based RPG written in Rust.
// Copyright 2018 <NAME>
//
// Sulis 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 opt... |
use amethyst::{
core::{Hidden, HiddenPropagate, ParentHierarchy},
ecs::{Entity, ReadExpect, System, Write, WriteExpect, WriteStorage},
network::simulation::laminar::LaminarSocketResource,
shrev::{EventChannel, ReaderId},
ui::{Interactable, UiEvent, UiEventType, UiImage, UiText},
};
use lazy_static::... |
// Copyright (c) SimpleStaking, Viable Systems and Tezedge Contributors
// SPDX-License-Identifier: MIT
// NOTE: unsafe cannot be forbidden right now because of code in systems.rs
// #![forbid(unsafe_code)]
use std::ffi::OsString;
use std::path::Path;
use std::sync::Arc;
use std::time::{Duration, Instant};
use config... |
//! # Standalone Pact Verifier
//!
//! This project provides a command line interface to verify pact files against a running provider. It is a single executable binary. It implements the [V2 Pact specification](https://github.com/pact-foundation/pact-specification/tree/version-2).
//!
//! [Online rust docs](https://doc... |
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... |
use std::borrow::Cow;
use std::collections::HashMap;
use std::io::BufReader;
use std::io::{Read, Seek};
use std::str::FromStr;
use quick_xml::events::attributes::{Attribute, Attributes};
use quick_xml::events::{BytesStart, Event};
use quick_xml::Reader as XmlReader;
use zip::read::{ZipArchive, ZipFile};
use zip::resul... |
use crate::config;
use anyhow::{anyhow, bail, Context, Result};
use chrono::{NaiveDate, NaiveDateTime};
use ex::fs;
use log::{debug, trace};
use regex::Regex;
use serde_json::json;
use std::collections::HashMap;
use std::io::Write;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
use crate::run_with... |
//! Attestation verification report handling.
use std::io::{Cursor, Read, Seek, SeekFrom};
use anyhow::{anyhow, Result};
use base64;
use byteorder::{LittleEndian, ReadBytesExt};
use chrono::prelude::*;
use pem::parse_many;
use percent_encoding;
use serde_derive::{Deserialize, Serialize};
use serde_json;
use sgx_isa::{... |
#![warn(missing_docs)]
//! Convert between pinyin forms or zhuyin.
extern crate phf;
use std::str;
use std::string::String;
use std::vec::Vec;
// MAP_P2Z and MAP_Z2P static maps
include!(concat!(env!("OUT_DIR"), "/codegen.rs"));
static PINYIN_TONES: [[char; 5]; 6] =
[['a', 'ā', 'á', 'ǎ', 'à'],
['o', 'ō', 'ó',... |
/*---------------------------------------------------------------------------------------------
* Copyright © 2016-present Earth Computing Corporation. All rights reserved.
* Licensed under the MIT License. See LICENSE.txt in the project root for license information.
*----------------------------------------------... |
pub use codec::{Decode, Encode};
pub use futures_timer::Delay;
pub use serde::{Deserialize, Serialize};
pub use sp_core::{
storage::{StorageData, StorageKey},
Bytes, H256 as Hash,
};
use std::{default::Default, time::Duration};
use web3::{
contract::{tokens::Detokenize, Error as ContractError},
ethabi::Token,
};
pu... |
extern crate minifb;
use minifb::{Key, Window, WindowOptions};
extern crate tobj;
use std::path::Path;
extern crate rand;
use rand::prelude::*;
extern crate indicatif;
mod linalg;
use linalg::Vec3;
mod brdf;
use std::sync::Arc;
extern crate threadpool;
use threadpool::ThreadPool;
extern crate num_cpus;
extern ... |
// domain knowleadge
// enemy data is from https://nethackwiki.com/wiki/Rogue_(game), thanks
use cgw::AsciiChar;
use damage::*;
use dangeon::Coord;
use std::cmp;
use std::slice;
#[macro_export]
macro_rules! default_none {
($enum:ident) => {
impl Default for $enum {
fn default()-> $enum {
... |
use crate::error::Result;
use crate::{Const, ExprKind};
use std::cmp::Ordering;
use xngin_datatype::AlignPartialOrd;
macro_rules! impl_fold_cmp {
( $fn:ident, $fnc:ident, $($e:pat),* ) => {
#[inline]
pub fn $fn(lhs: &ExprKind, rhs: &ExprKind) -> Result<Option<Const>> {
match (lhs, rhs) ... |
pub(crate) use self::super_field::SuperFieldAccessFolder;
use self::{
constructor::{
constructor_fn, make_possible_return_value, replace_this_in_constructor, ConstructorFolder,
ReturningMode, SuperCallFinder, SuperFoldingMode, VarRenamer,
},
prop_name::HashKey,
};
use fxhash::FxBuildHasher;
... |
// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// 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 ... |
use std::borrow::Cow;
use std::cmp::Ordering;
use std::collections::HashMap;
use crate::svd::{Cluster, ClusterInfo, Peripheral, Register, RegisterCluster, RegisterProperties};
use log::warn;
use proc_macro2::TokenStream;
use proc_macro2::{Ident, Punct, Spacing, Span};
use quote::{quote, ToTokens};
use svd_parser::deri... |
// Copyright (c) 2021 Quark Container Authors / 2018 The gVisor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless ... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Start the quadrature decoder."]
pub tasks_start: TASKS_START,
#[doc = "0x04 - Stop the quadrature decoder."]
pub tasks_stop: TASKS_STOP,
#[doc = "0x08 - Transfers the content from ACC registers to ACCREAD registers, and... |
//! Layout box structure
use crate::context::UpdateContext;
use crate::drawing::Drawing;
use crate::font::{EvalParameters, Font};
use crate::html::dimensions::{BoxBounds, Position, Size};
use crate::html::text_format::{FormatSpans, TextFormat, TextSpan};
use crate::shape_utils::DrawCommand;
use crate::string::utils as... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use maplit::btreemap;
use once_cell::sync::Lazy;
use regex::Regex;
use std::collections::BTreeMap;
/// The word size (in bytes) of the EVM.
pub const WORD_SIZE: usize = 32;
/// A lazy constant which defines placeholders which can be r... |
//! Space-efficient storage for `BeaconState` vector fields.
//!
//! This module provides logic for splitting the `FixedVector` fields of a `BeaconState` into
//! chunks, and storing those chunks in contiguous ranges in the on-disk database. The motiviation
//! for doing this is avoiding massive duplication in every o... |
use crate::consts::CHECK;
use crate::util::{Argument, AsOption, IdentExt2, Parenthesised};
use proc_macro2::Span;
use proc_macro2::TokenStream as TokenStream2;
use quote::{quote, ToTokens};
use syn::{
braced,
parse::{Error, Parse, ParseStream, Result},
spanned::Spanned,
punctuated::Punctuated,
Attri... |
use std::time::{Instant, Duration};
use std::path::Path;
use std::result::Result;
use std::error::Error;
use std::io::prelude::*;
use std::fs::File;
use std::fs;
use std::io;
use std::i32;
use bitboard::*;
use eval::*;
use solver::*;
use rand;
use rand::distributions::{Distribution, Gamma};
const EXPLORATION_CONST... |
// Copyright (C) 2017-2018 Baidu, 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 of condit... |
//! Type(Sort)-checking
use super::*;
lazy_static! {
/// Cache of all types
pub(super) static ref TERM_TYPES: RwLock<TypeTable> = RwLock::new(TypeTable {
map: FxHashMap::default(),
last_len: 0,
});
}
#[track_caller]
/// Type-check this term, at a surface level.
/// That is, determine its ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.