text stringlengths 7.05k 33.9k |
|---|
//! Parsing implementation for Tor authority certificates
//!
//! An "authority certificate" is a short signed document that binds a
//! directory authority's permanent "identity key" to its medium-term
//! "signing key". Using separate keys here enables the authorities
//! to keep their identity keys securely offline... |
// Copyright (c) 2017 <NAME>
// Modifications Copyright 2019 The Gotts Developers
//
// 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 r... |
//! The `Hir` is the "high-level IR". It is a simpified, somewhat resolved version of the bare AST.
#![feature(crate_visibility_modifier)]
#![feature(const_fn)]
#![feature(decl_macro)]
#![feature(in_band_lifetimes)]
#![feature(specialization)]
use lark_collections::{FxIndexMap, IndexVec, U32Index};
use lark_debug_der... |
use core::mem::MaybeUninit;
use bit_field::BitField;
use heapless::spsc;
pub mod ble;
mod channels;
pub mod cmd;
pub mod consts;
pub mod evt;
pub mod lhci;
pub mod mm;
pub mod shci;
pub mod sys;
mod unsafe_linked_list;
use crate::tl_mbox::cmd::{AclDataPacket, CmdPacket};
use crate::tl_mbox::evt::EvtBox;
use unsafe_l... |
#[cfg(test)]
mod tests;
pub mod event;
pub use memory::{address_space, modules};
pub use kvmi::{Action, HSToWire};
use event::*;
pub mod tracing;
pub mod memory;
use memory::address_space::{IA32eAddrT, IA32eVirtual, KVMIPhysical, PhysicalAddrT};
use memory::process::{self, PSChanT};
use memory::CR3_MASK;
use asyn... |
// Copyright 2015 Michael 'ExpHP' Lamparski
//
// Licensed under the terms of the MIT License, available at:
// http://opensource.org/licenses/MIT
// and also included in the file COPYING at the root of this distribution.
// This file may not be copied, modified, or distributed except according
// to those terms.
use... |
use atomic_float::AtomicF32;
use parking_lot::RwLock;
use raw_window_handle::RawWindowHandle;
use std::any::Any;
use std::ffi::{c_void, CStr};
use std::mem;
use std::sync::atomic::Ordering;
use std::sync::Arc;
use vst3_sys::base::{kInvalidArgument, kResultFalse, kResultOk, tresult, TBool};
use vst3_sys::gui::{IPlugFram... |
//! Format Specification
//!
//! ```ABNF
//! voicemail = recipients [schedule] SP message
//!
//! recipients = recipient-name *(recpipent-sep recipient-name)
//! recipient-name = ["@"] *ALPHA
//! recipient-sep = reci-sep-and / reci-sep-comma
//! reci-sep-and = SP ("and" / "und" / "&&") SP
//! reci-sep-comma = [SP] "," ... |
//! Characters.
use crate::spec::Spec;
/// A mask to test whether the character is continue character of `scheme`.
// `ALPHA / DIGIT / "+" / "-" / "."`
const MASK_SCHEME_CONTINUE: u8 = 1 << 0;
/// A mask to test whether the character matches `unreserved`.
// `unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"`
const... |
// MIT/Apache2 License
use breadglx::{GlConfigRule, GlContext, GlContextRule, GlDisplay, GlScreen, GlVisualType};
use breadx::{
ColormapAlloc, DisplayConnection, Event, EventMask, Pixmap, Result, Window, WindowClass,
WindowParameters,
};
use gl::types::*;
use log::LevelFilter;
use nalgebra::{Matrix4, Point3, V... |
pub struct Solution;
static DIGITS: [char; 10] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
impl Solution {
/// 36. 有效的数独 https://leetcode-cn.com/problems/valid-sudoku/
pub fn is_valid_sudoku(board: Vec<Vec<char>>) -> bool {
let mut rows = vec![vec![0; 9]; 9];
let mut columns = vec![ve... |
use std::io::prelude::{Read, Seek};
use std::io::{Cursor, IoSliceMut, SeekFrom};
use crate::errors::ReaderError;
// From mobi-python:
//
// HEADER is '>32shhIIIIII4s4sIIH'
// Meaning:
//
// > : Big-Endian
// Xs : X characters
// h : 2B - short
// I : 4B - Unsigned Int
// H : 2B - Unsigned short
#[derive(Debug)]
p... |
#![allow(dead_code)]
use crate::core::metrics;
use crate::core::neighbor::Neighbor;
use crate::core::node::{FloatElement, IdxType, Node};
use fixedbitset::FixedBitSet;
use rand::seq::SliceRandom;
use rand::Rng;
use rayon::prelude::*;
use std::collections::BinaryHeap;
use std::sync::mpsc;
use std::sync::{Arc, Mutex};
... |
#![no_std]
use atsamd_hal::target_device::SDHC0;
use bit_field::BitField;
use core::hint::unreachable_unchecked;
use embedded_error::mci::CommandOrDataError;
use embedded_error::mci::MciError;
use embedded_error::ImplError;
use mci::command_arguments::mci_command::MciCommand;
use mci::command_arguments::mmc::BusWidth;
... |
use crate::{
io::{Filesystem, WitxIo},
parser::{
CommentSyntax, DeclSyntax, Documented, EnumSyntax, ExpectedSyntax, FlagsSyntax,
HandleSyntax, ImportTypeSyntax, ModuleDeclSyntax, RecordSyntax, TupleSyntax, TypedefSyntax,
UnionSyntax, VariantSyntax,
},
Abi, BuiltinType, Case, Cons... |
// Copyright 2021 The BMW 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 agreed... |
#[macro_use]
pub mod error;
mod asm_generation;
mod asm_lang;
mod build_config;
mod concurrent_slab;
pub mod constants;
mod control_flow_analysis;
mod convert_parse_tree;
mod ir_generation;
pub mod parse_tree;
pub mod semantic_analysis;
pub mod source_map;
mod style;
pub mod type_engine;
use crate::{error::*, source_... |
// Copyright 2021 <NAME> <<EMAIL>>
//
// 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... |
//! Provides the `RustIrDatabase` implementation for `chalk-solve`
//!
//! The purpose of the `chalk_solve::RustIrDatabase` is to get data about
//! specific types, such as bounds, where clauses, or fields. This file contains
//! the minimal logic to assemble the types for `chalk-solve` by calling out to
//! either the... |
use crate::string_tools::*;
use core::num::ParseIntError;
use crate::alloc::format;
use crate::alloc::string;
use crate::alloc::string::*;
use crate::alloc::vec;
use crate::alloc::vec::Vec;
/// A struct reprensenting a DKIM-Signature header.
/// It can be build using the builder syntax.
#[derive(Debug)]
pub struct ... |
use font8x8::{legacy::BASIC_LEGACY,
legacy::CONTROL_LEGACY,
legacy::BLOCK_LEGACY,
legacy::LATIN_LEGACY, FontUnicode, UnicodeFonts};
use core::fmt;
pub const UNICODE: [FontUnicode; 288] = [
FontUnicode('\u{0000}', BASIC_LEGACY[0]),
FontUnicode('\u{0001}', BASIC_LEGACY[1]),
FontUnicode('\u{0002}'... |
/* Copyright 2022 <NAME>
*
* Licensed under the MIT License.
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... |
use super::fips202::shake256;
use super::hash::{addr_to_byte, h_msg, hash_h, prf};
use super::hash_address::{
set_chain_adrs, set_hash_adrs, set_key_and_mask, set_ltree_adrs, set_ots_adrs, set_tree_height,
set_tree_index, set_type,
};
use super::hash_functions::HashFunction;
use super::wots::{wots_pkgen, wots_s... |
use super::enemy::Enemy;
use super::enemy_base::{EnemyBase, EnemyInfo};
use super::tractor_beam::TractorBeam;
use super::{Accessor, DamageResult};
use crate::app::game::manager::EventType;
use galangua_common::app::consts::*;
use galangua_common::app::game::formation_table::{X_COUNT, Y_COUNT};
use galangua_common::ap... |
use std::collections::HashMap;
use crate::State;
use inkwell::values::{AnyValueEnum, BasicValue, FunctionValue, PointerValue};
use inkwell::FloatPredicate::{ONE, ULT};
#[derive(Debug)]
pub enum AST {
Null,
Number(NumberExprAST),
Variable(VariableExprAST),
Binary(BinaryExprAST),
Unary(UnaryExprAST)... |
//! Routing between [`Service`]s and handlers.
use self::{future::RouteFuture, not_found::NotFound};
use crate::{
body::{boxed, Body, Bytes, HttpBody},
extract::connect_info::IntoMakeServiceWithConnectInfo,
response::{IntoResponse, Redirect, Response},
routing::strip_prefix::StripPrefix,
util::try_... |
//! Program to perform instantly settled token swaps on the Serum DEX.
//!
//! Before using any instruction here, a user must first create an open orders
//! account on all markets being used. This only needs to be done once. As a
//! convention established by the DEX, this should be done via the system
//! program cre... |
use std::cmp::Ordering;
use geom::{Circle, Distance, Duration, FindClosest, PolyLine, Polygon};
use map_gui::tools::PopupMsg;
use map_model::{Path, PathStep, NORMAL_LANE_THICKNESS};
use sim::{TripEndpoint, TripMode};
use widgetry::mapspace::{ToggleZoomed, ToggleZoomedBuilder};
use widgetry::{
Color, Drawable, Even... |
use support::{
decl_module, decl_storage, decl_event, ensure, StorageValue, StorageMap,
Parameter, traits::Currency
};
use sr_primitives::traits::{SimpleArithmetic, Bounded, Member};
use codec::{Encode, Decode};
use runtime_io::blake2_128;
use system::ensure_signed;
use rstd::result;
use crate::linked_item::{LinkedLi... |
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use crate::{id::Id, services::discovery::filter::*, Result, SessionId};
use anyhow::format_err;
use fidl::endpoints::{ClientEnd, ServerEnd};
use fidl::{sel... |
//
// Sysinfo
//
// Copyright (c) 2015 <NAME>
//
use sys::component::{self, Component};
use sys::processor::*;
use sys::process::*;
use sys::Disk;
use sys::disk;
use sys::network;
use sys::NetworkData;
use ::{DiskExt, ProcessExt, RefreshKind, SystemExt};
use Pid;
use std::cell::UnsafeCell;
use std::fs::{File, read_... |
//! `anchor_client` provides an RPC client to send transactions and fetch
//! deserialized accounts from Solana programs written in `anchor_lang`.
use anchor_lang::solana_program::instruction::{AccountMeta, Instruction};
use anchor_lang::solana_program::program_error::ProgramError;
use anchor_lang::solana_program::pub... |
use crate::blocktree::{create_new_tmp_ledger, tmp_copy_blocktree};
use crate::cluster::Cluster;
use crate::cluster_info::{Node, FULLNODE_PORT_RANGE};
use crate::contact_info::ContactInfo;
use crate::fullnode::{Fullnode, FullnodeConfig};
use crate::gossip_service::discover_nodes;
use crate::replicator::Replicator;
use c... |
use std::{collections::HashMap, sync::Arc};
use tokio::{
fs::File,
io::{AsyncRead, AsyncWrite},
sync::mpsc::Sender,
};
use crate::{
config::Config, fs, fs::FileInfo, sync::file_events_buffer::FileEventsBuffer, sync::SyncEvent,
IronCarrierError,
};
use crate::network::streaming::{FileReceiver, File... |
use std::{i8, u8, u16, u32, slice};
use std::collections::{hash_map::Entry, HashMap, VecDeque};
use crate::bit_vec::BitVec;
use crate::handle_map::{Handle, HandleMap};
use crate::symbol::Symbol;
use crate::back::{ssa, analysis::*, regalloc::*};
use crate::vm::{self, code};
pub struct Codegen<'p> {
function: code:... |
pub mod command_packet;
pub mod commands;
mod descriptors;
pub mod endpoint;
mod packet_queue;
mod pma;
mod setup_packet;
pub mod usb_error;
use self::{
command_packet::CommandPacket,
descriptors::*,
endpoint::{
ControlEndpointStatus, DeviceEndpoint, EndpointDirection, EndpointStatus, EndpointType,... |
// Copyright 2020 <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 writing, ... |
use std::fmt::Write;
use std::collections::{HashMap, HashSet};
use syntect::easy::HighlightLines;
use syntect::parsing::SyntaxDefinition;
use syntect::highlighting::{Theme, Style, Color, FontStyle};
use color;
// holds command line option
#[derive(Debug)]
pub struct Config {
pub inline: bool,
pub numbers: b... |
use crate::{
graph::{
Add, Bool, Byte, EdgeKind, Eq, Gamma, InputParam, InputPort, Int, Mul, Neg, Neq, Node,
NodeExt, NodeId, Not, OutputParam, OutputPort, Rvsdg, Sub, Theta,
},
ir::Const,
passes::{
utils::{BinaryOp, Changes, UnaryOp},
Pass,
},
utils::{AssertNone,... |
extern crate simd;
use simd::f32x4;
fn mul(x: &[f32x4; 4], y: &[f32x4; 4]) -> [f32x4; 4] {
let y0 = y[0];
let y1 = y[1];
let y2 = y[2];
let y3 = y[3];
[f32x4::splat(y0.extract(0)) * x[0] +
f32x4::splat(y0.extract(1)) * x[1] +
f32x4::splat(y0.extract(2)) * x[2] +
f32x4::splat(y0.extra... |
use std::collections::HashMap;
use std::fmt;
use std::io::{self, BufRead};
use super::access::Access;
use super::consts;
use super::module::Modules;
use super::statement::{Loc, Metadata, Statement};
use super::tests::{TestStatus, TestSuite};
use super::trace::{Trace, TraceItem};
use super::types::{FileId, FuncName, St... |
use crate::{data::output, find, FindExt};
use dashmap::DashSet;
use git_features::{parallel, progress::Progress};
use git_hash::{oid, ObjectId};
use git_object::immutable;
use std::sync::Arc;
/// Generate [`Count`][output::Count] from input `objects` with object expansion based on [`options`][Options]
/// to learn whi... |
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct SettlementInstructions {
/// MsgType = T
#[serde(flatten)]
pub standard_message_header: super::super::standard_message_header::StandardMessageHeader<'T'>,
/// Unique message ID regardless of <a href... |
use crate::computations::dataflow_arranged_adaptive::differential_run_adaptive;
use crate::computations::dataflow_differential_1_stage::differential_run_1_stage;
use crate::computations::dataflow_differential_2_stages::differential_run_2_stage;
use crate::filtered_cubes::materialise::{DiffEdgesPointer, DiffIteratorPoin... |
use std::cmp::Ordering;
use std::collections::HashMap;
use chrono::prelude::*;
use protobuf::repeated::RepeatedField;
use serde_json;
use uuid::Uuid;
use errors::*;
use util::state::StateHandling;
use cerberus_proto::worker as pb;
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]
pub enum TaskStatus {
... |
/*
This tool is part of the WhiteboxTools geospatial analysis library.
Authors: Dr. <NAME>
Created: July 12, 2017
Last Modified: 12/10/2018
License: MIT
*/
use crate::raster::*;
use crate::tools::*;
use num_cpus;
use std::cmp::Ordering::Equal;
use std::env;
use std::f64;
use std::io::{Error, ErrorKind};
use std::path;... |
// Copyright © 2008-2011 <NAME>
// Copyright © 2010-2011 Intel Corporation
// Copyright © 2012-2013 Collabora, Ltd.
//
// Permission to use, copy, modify, distribute, and sell this
// software and its documentation for any purpose is hereby granted
// without fee, provided that the above copyright notice appear in
// ... |
// Copyright (c) 2021 Quark Container 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 required by applicable law ... |
use std::ops::{Add, Sub};
#[cfg(not(feature = "library"))]
use cosmwasm_std::entry_point;
use cosmwasm_std::{to_binary, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdResult, Uint128, Uint64, Order, Coin, from_slice, CosmosMsg, BankMsg};
use cw2::set_contract_version;
use cw20::{Cw20Contract, Cw20ExecuteMsg, Cw2... |
use std::{cmp::Ordering, fmt, marker::PhantomData, str::FromStr};
use chrono::{Date, Utc};
use rkyv::{Archive, Deserialize as RkyvDeserialize, Serialize};
use rosu_v2::{
model::{GameMode, GameMods},
prelude::Username,
};
use serde::{
de::{Error, MapAccess, Unexpected, Visitor},
Deserialize, Deserialize... |
use std::path::Path;
use std::io::{Read, Write, Seek, SeekFrom};
use std::ffi::{OsStr, OsString};
use std::sync::RwLock;
use std::result::Result;
use std::borrow::Cow;
use std::fmt::Debug;
use failure::Error;
use time::{get_time, Timespec};
use chrono::{DateTime, TimeZone, Timelike};
use fuse_mt::*;
use libc;
use lazy... |
#[allow(unused_imports)]
use super::backbone_sample;
#[allow(unused_imports)]
use super::side_chain_sample;
#[allow(unused_imports)]
use super::chain_builder;
#[allow(unused_imports)]
use super::pdbdata;
#[allow(unused_imports)]
use super::debug_env;
#[allow(unused_imports)]
use super::charmm_based_energy;
#[allow(un... |
use std::{collections::VecDeque, marker::PhantomData, net::SocketAddr};
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use naia_client_socket::{NaiaClientSocketError, PacketReceiver, PacketSender, Socket};
pub use naia_shared::{
ConnectionConfig, EntityType, HostTickManager, ImplRef, ManagerType, Manif... |
use std::collections::VecDeque;
use std::{iter, mem};
use itertools::Itertools;
use rustc_hash::FxHashSet;
use lex::{LexCtx, PunctKind, Symbol, Token, TokenKind};
use source::{diag::RawSubDiagnostic, DResult};
use source::{smap::ExpansionKind, FragmentedSourceRange, SourceId, SourceRange};
use crate::PpToken;
use s... |
use std::{
fmt::Debug,
hash::Hash,
marker::Sized,
ops::{Add, Range, Sub},
};
use hashbrown::HashMap;
use crate::utils::dedup;
use self::color::ColorId;
pub trait Color
where
Self: Debug
+ Eq
+ Hash
+ Default
+ Copy
+ Send
+ Sync
+ Add<Outpu... |
use std::convert::TryInto;
use std::mem;
use std::sync::Arc;
use anyhow::{ensure, Result};
use jellyfish_merkle::iterator::JellyfishMerkleIterator;
use jellyfish_merkle::{
node_type::{LeafNode, Node, NodeKey},
HashValue, JellyfishMerkleTree, StaleNodeIndex, TreeReader,
};
use kvdb::KeyValueDB;
use parity_scale... |
//! Access to a HTTP-based crate registry.
//!
//! See [`HttpRegistry`] for details.
use crate::core::{PackageId, SourceId};
use crate::ops;
use crate::sources::registry::download;
use crate::sources::registry::MaybeLock;
use crate::sources::registry::{LoadResponse, RegistryConfig, RegistryData};
use crate::util::erro... |
//! Event parsing and validation
use crate::config;
use crate::error::Error;
use crate::error::Result;
use bitcoin_hashes::{hex::ToHex, sha256, Hash};
use lazy_static::lazy_static;
use secp256k1::{schnorr, Secp256k1, VerifyOnly, XOnlyPublicKey};
use serde::{Deserialize, Serialize};
use serde_json::value::Value;
use std... |
use counters::flavors::{Counter, CounterType};
use counters::Counters;
use crossbeam_queue::ArrayQueue;
use dpdk_ffi::{
dpdk_mbuf_alloc, dpdk_mbuf_free, dpdk_rx_one, dpdk_tx_one, lcore_function_t, rte_dev_iterator,
rte_dev_probe, rte_eal_init, rte_eal_remote_launch, rte_eth_conf, rte_eth_dev_configure,
rte_... |
//! Provides the dispatcher which delegates an incoming request to the matching implementation.
//!
//! At its core, a [CommandsCommandDictionary](CommandDictionary) dictionary is simply a hash map.
//! For each known command, it contains an appropriate entry. This however, doesn't point to a trait
//! impl or the like... |
#![allow(dead_code)]
use crate::core::ann_index;
use crate::core::kmeans;
use crate::core::metrics;
use crate::core::neighbor;
use crate::core::node;
use crate::index::ssg_params::SSGParams;
use crate::vec_iter;
use fixedbitset::FixedBitSet;
use rand::prelude::*;
#[cfg(not(feature = "no_thread"))]
use rayon::prelude::*... |
//! Verify Finch's execution and semantics against Unicorn.
use error::*;
use executor::{Driver, State, StateTranslator};
use falcon::il;
use falcon::translator::TranslationMemory;
use falcon_capstone::{capstone, capstone_sys};
use platform::Platform;
use std::collections::HashSet;
use unicorn;
use unicorn::{Cpu, CpuM... |
use crate::network::packets::clientbound::{
C00DisconnectLogin, C00Response, C01Pong, C02LoginSuccess, C03SetCompression, C15WindowItems,
C19PluginMessageBrand, C26JoinGame, C34PlayerInfo, C34PlayerInfoAddPlayer,
C36PlayerPositionAndLook, C40HeldItemChange, C4FTimeUpdate, ClientBoundPacket,
};
use crate::ne... |
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
use crate::{frame::Tag, inet::ExplicitCongestionNotification, number::CheckedSub, varint::VarInt};
use core::{
convert::TryInto,
ops::{RangeInclusive, SubAssign},
};
use s2n_codec::{
decoder_paramet... |
#![allow(clippy::missing_safety_doc)]
use crate::fallback::{
decode_extra, encode_extra, STANDARD_CHARSET, STANDARD_DECODE_TABLE, URL_SAFE_CHARSET,
URL_SAFE_DECODE_TABLE,
};
use crate::utils::{empty_slice_mut, read, write};
use crate::{Base64, Base64Kind, Error, OutBuf, ERROR};
use simd_abstraction::tools::{B... |
use super::*;
use ext::ToHex;
#[cfg(unix)]
use nix::{errno, fcntl, sys::stat, unistd};
use proc_self::fd_path;
#[cfg(unix)]
use std::{
ffi::{CStr, CString}, os::unix::io::AsRawFd
};
use std::{
fs, io::{self, Read, Write}, mem, path
};
/// Maps file descriptors [(from,to)]
pub fn move_fds(fds: &mut [(Fd, Fd)]) {
loo... |
use std::collections::{HashSet, BTreeMap, BTreeSet};
use font::*;
type Adjacency = (u32, &'static [(u8, u8, u8, u8)]);
const ADJACENCY_SUBPIXEL: [Adjacency; 0x10] = [
// a b
// +--+--+
// h | | c
// + + <---+
// g | | d |
// +--+--+ (adjacency) (the line segment c... |
use std::{
collections::HashMap,
convert::TryInto,
io::{Cursor, Seek, SeekFrom, Write},
};
use anyhow::{Context, Result};
use pasture_core::{
containers::{
PerAttributePointBuffer, PerAttributeVecPointStorage, PointBuffer, PointBufferWriteable,
},
layout::{
attributes::{COLOR_RG... |
// Copyright 2021 <NAME>.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to thos... |
//! Framebuffers are used to draw to off-screen render targets
use gl;
use std::fmt;
use std::error;
use gl::types::*;
use color::Color;
use texture::TextureFormat;
use buffer::{VertexData, GlPrimitive};
use cable_math::Vec2;
/// Set to 8, which 97% of all cards support, acording to the [wildfiregames report][1]
/... |
use crate::{
circuit::vanchor::VAnchorCircuit as VACircuit,
setup::common::{
LeafCRHGadget, PoseidonCRH_x5_2, PoseidonCRH_x5_2Gadget, PoseidonCRH_x5_3Gadget,
PoseidonCRH_x5_4, TreeConfig_x5, Tree_x5,
},
};
use ark_bn254::Fr as Bn254Fr;
use ark_crypto_primitives::Error;
use ark_ff::PrimeField;
use ark_std::{error... |
//! The opcodes suported by the Chip8 achitecture.
//!
//! Largely written by staring at [the Chip8 Wikipedia article](https://en.wikipedia.org/wiki/CHIP-8#Opcode_table) for a while.
use anyhow::{anyhow, Result};
use std::{convert::TryFrom, fmt};
/// Wrapper struct with some helper methods for working with u16 values... |
use super::{Map, QualifiedName};
use crate::error::{Error, Result};
use crate::value::Value;
use crate::Story;
use serde::{Deserialize, Serialize};
pub type Attributes = Vec<AttributedSpan>;
pub type OptionalParams = Map<String, Option<Value>>;
/// Enum representing possible ways to configure an attribute.
/// If a s... |
use c05_advanced_lighting::{process_events, Camera, Camera_Movement::*, Shader};
use cgmath::prelude::*;
use cgmath::{perspective, vec3, Deg, Matrix4, Point3, Vector3};
use dx::{
assets,
gles::{core30::gl, enums::*},
utils::*,
Instance,
};
use image::{DynamicImage::*, GenericImageView};
use std::path::P... |
//! Library for strings of fixed maximum lengths that can be copied and
//! stack-allocated using const generics.
//!
//! **The structures provided by this crate are [fstr], [zstr]** and tstr.
//! However, tstr is not exported and can only be used through the type
//! aliases [str4], [str8], [str16], through [str256].
... |
use std::collections::VecDeque;
use crate::panes::selection::Selection;
use crate::panes::Row;
use crate::{
panes::terminal_character::{AnsiCode, CharacterStyles},
panes::{LinkHandler, TerminalCharacter, EMPTY_TERMINAL_CHARACTER},
ClientId,
};
use std::cell::RefCell;
use std::fmt::Write;
use std::rc::Rc;
... |
extern crate console_error_panic_hook; // !!! set when a new game is created. Move to its own initialization
use std::collections::btree_set::BTreeSet;
use std::collections::VecDeque;
use std::cmp::Ordering;
use crate::objects;
use crate::player::Player;
use crate::brick::Brick;
use crate::BrickData;
use crate::Ga... |
use alloc_crate::alloc::Layout;
use core::iter;
use core::mem;
use core::ptr;
use core::ptr::NonNull;
use super::heap_pages;
use super::AllocationError;
use crate::lock::LockedGlobal;
use crate::paging::PAGE_MASK;
use crate::structures::Bitmask64;
static KERNEL_SMA: LockedGlobal<SmallZoneAllocator> = LockedGlobal::ne... |
//! Object storage backend abstraction layer for Delta Table transaction logs and data
use std::fmt::Debug;
use std::pin::Pin;
use chrono::{DateTime, Utc};
use futures::Stream;
#[cfg(feature = "azure")]
use azure_core::HttpError as AzureError;
#[cfg(feature = "azure")]
use azure_storage::Error as AzureStorageError;
... |
use protobuf::descriptor::*;
use protobuf::descriptorx::*;
use protobuf::prelude::*;
use super::enums::*;
use super::rust_types_values::*;
use super::field::*;
use super::code_writer::*;
use super::customize::Customize;
use super::customize::customize_from_rustproto_for_message;
use oneof::OneofGen;
use oneof::OneofV... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - PWM Clock Register"]
pub clk: crate::Reg<clk::CLK_SPEC>,
#[doc = "0x04 - PWM Enable Register"]
pub ena: crate::Reg<ena::ENA_SPEC>,
#[doc = "0x08 - PWM Disable Register"]
pub dis: crate::Reg<dis::DIS_SPEC>,
#[doc... |
#![deny(rust_2018_idioms)]
#[macro_use]
extern crate log;
//extern crate lru_cache;
pub mod lru_cache;
use std::borrow::Borrow;
use std::boxed::Box;
use std::collections::hash_map::RandomState;
use std::error::Error as StdError;
use std::ffi::{OsStr, OsString};
use std::fmt;
use std::fs::{self, File};
use std::hash::... |
pub mod codec;
pub mod unpack;
use serde::{Serialize, Deserialize};
use anyhow::*;
use bincode::Options;
pub type Huffman = codec::Huffman<u32>;
#[derive(Debug, Copy, Clone, serde_repr::Serialize_repr, serde_repr::Deserialize_repr)]
#[repr(u8)]
pub enum Format {
Dxt1 = 0, Dxt3, Dxt5,
Dxt5CCxY, Dxt5xGxR, Dxt5xGBR... |
use once_cell::sync::Lazy;
use prometheus::core::Opts;
use prometheus::{
register_histogram, register_histogram_vec, register_int_counter, register_int_counter_vec,
register_int_gauge, register_int_gauge_vec, Histogram, HistogramVec, IntCounter, IntCounterVec,
IntGauge, IntGaugeVec,
};
pub fn version() -> ... |
// Copyright 2020 The Matrix.org Foundation C.I.C.
//
// 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... |
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity Ethereum.
// Parity Ethereum 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 yo... |
//! Compares the decoding results with reference renderings.
use std::fs;
use std::io;
use std::path::PathBuf;
use std::u32;
extern crate glob;
extern crate image;
const BASE_PATH: [&str; 2] = [".", "tests"];
const IMAGE_DIR: &str = "images";
const OUTPUT_DIR: &str = "output";
const REFERENCE_DIR: &str = "reference"... |
use std::{
cell::{Cell, RefCell},
collections::VecDeque,
io::Cursor,
sync::Arc,
};
use ahash::AHashSet;
use flume::{Receiver, Sender};
use slab::Slab;
use uuid::Uuid;
use base::{
BlockId, ChunkHandle, ChunkPosition, EntityKind, EntityMetadata, Gamemode, Position,
ProfileProperty, Text, ValidBl... |
// 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... |
/* origin: FreeBSD /usr/src/lib/msun/src/e_powf.c */
/*
* Conversion to float by <NAME>, Cygnus Support, <EMAIL>.
*/
/*
* ====================================================
* Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
*
* Developed at SunPro, a Sun Microsystems, Inc. business.
* Permissi... |
use std::io::{self, BufRead, BufReader, BufWriter, Read, Write};
use encoding_rs::{Encoding, UTF_8};
use encoding_rs_io::DecodeReaderBytesBuilder;
use mime::Mime;
use reqwest::blocking::{Request, Response};
use reqwest::cookie::CookieStore;
use reqwest::header::{
HeaderMap, HeaderName, HeaderValue, ACCEPT, CONTENT... |
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
//! Utilities for property-based testing.
use crate::file_format::{
AddressPoolIndex, CompiledModule, CompiledModuleMut, FieldDefinition, FieldDefinitionIndex,
FunctionHandle, FunctionSignatureIndex, IdentifierIndex, Kind, Loc... |
//! Runtime call dispatcher.
use std::{
convert::TryInto,
process,
sync::{
atomic::{AtomicBool, Ordering},
Arc, Condvar, Mutex,
},
thread,
};
use anyhow::{anyhow, Result};
use crossbeam::channel;
use io_context::Context;
use slog::Logger;
use crate::{
common::{
cbor,
... |
use super::*;
#[derive(Clone)]
pub struct Prelude {
pub add_f32_fn: Function,
pub add_f64_fn: Function,
pub add_i8_fn: Function,
pub add_i16_fn: Function,
pub add_i32_fn: Function,
pub add_i64_fn: Function,
pub add_u8_fn: Function,
pub add_u16_fn: Function,
pub add_u32_fn: Function,... |
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
// Allow KiB, MiB consts
#![allow(non_upper_case_globals, non_snake_case)]
// Allow fns to take &usize, since criterion only passes parameters by ref
#![allow(clippy::trivially_copy_pass_by_ref)]
// Allow writing 1 * KiB or 1 * MiB
#![... |
#![allow(clippy::empty_enum)]
use std::{
convert::TryFrom,
fmt,
fs::{self, File, OpenOptions},
marker::PhantomData,
ops::Deref,
path::PathBuf,
};
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use serde_state::DeserializeState;
use structopt::StructOpt;
use necsim_core::cogs::... |
use super::*;
pub mod zip_struct;
pub mod zipper_trait;
use self::{
zip_struct::ZipStruct,
zipper_trait::{CollHandlers, Inspecter, VariantHandlers, ZipperTrait},
};
pub type Infos = idx::ExprMap<Info>;
pub struct Info {
zip_struct: ZipStruct,
zipper_trait: ZipperTrait,
variant_handlers: VariantHa... |
use image::{ImageBuffer, Luma, DynamicImage, GenericImage, Primitive, Pixel};
use std::sync::Arc;
use rand::{Rng, ThreadRng, thread_rng};
use std::cell::RefCell;
// TODO: Get rid of this dependency
use hough::houghforest;
use meancov_estimation::{Mat3, Vec3, Vec2};
pub type DepthImage = ImageBuffer<Luma<u16>, Vec<u16... |
//! A generic `SourceStream` implementation for any `Iterator` of
//! shared-ownership (i.e. reference-counted) string-ish types and that provides
//! the position of each `char` relative to the start of the iteration.
use crate::{
SourceStream, SourceIterItem, TextConcat, TextChunk,
text::chunk::{PosStrish, P... |
// Copyright 2019-2020 Twitter, Inc.
// Licensed under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0
use core::convert::TryFrom;
use core::str::FromStr;
use rustcommon_metrics::*;
use serde_derive::{Deserialize, Serialize};
use strum::ParseError;
use strum_macros::{EnumIter, EnumString... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.