text stringlengths 9.08k 47.9k |
|---|
use std::collections::HashMap;
use crate::{
circuits::{
expr::{prologue::*, Column, ConstantExpr},
gate::{CircuitGate, CurrOrNext},
lookup::lookups::{
JointLookup, JointLookupSpec, JointLookupValue, LocalPosition, LookupInfo, LookupsUsed,
},
wires::COLUMNS,
}... |
// This example demostrates how to output GL textures, within an
// EGL/X11 context provided by the application, and render those
// textures in the GL application.
// {videotestsrc} - { glsinkbin }
#[macro_use]
extern crate gstreamer as gst;
use gst::prelude::*;
extern crate gstreamer_app as gst_app;
extern crate g... |
// 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.
use itertools::{EitherOrBoth::*, Itertools};
use std::{borrow::Cow, collections::HashSet, mem};
use ast_constant_folder_rust as ast_con... |
#[macro_use]
extern crate ash;
#[cfg(target_os = "windows")]
extern crate winapi;
extern crate winit;
#[cfg(target_os = "macos")]
extern crate cocoa;
#[cfg(target_os = "macos")]
extern crate metal_rs as metal;
#[cfg(target_os = "macos")]
extern crate objc;
#[cfg(target_os = "macos")]
use cocoa::appkit::{NSView, NSWind... |
// Copyright 2020 Revcore Technologies Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or... |
/*!
Everything required for specifying and creating the bytes of an image.
*/
use std::convert::{From, Into};
use std::default::Default;
use std::sync::mpsc;
use std::thread;
use ::serde_derive::{Deserialize, Serialize};
use lazy_static::lazy_static;
use crate::cx::Cx;
lazy_static! {
static ref N_THREADS: usize... |
// "Tifflin" Kernel
// - By <NAME> (thePowersGang)
//
// Core/gui/windows/mod.rs
// - GUI Window management
use kernel::prelude::*;
use super::{Dims,Pos,Rect,Colour};
use kernel::sync::mutex::{LazyMutex,Mutex};
use kernel::lib::mem::Arc;
use kernel::lib::mem::aref::{Aref,ArefBorrow};
use kernel::lib::LazyStatic;
use co... |
//! An abstraciton layer for talking to an underlying X server.
//!
//! An implementation of the [XConn] trait is required for running a [WindowManager][1]. The choice
//! of back end (e.g. xlib, xcb...) is an implementation detail that does not surface in the
//! `WindowManager` itself. All low level details of workin... |
// Copyright (C) 2022 <NAME> <<EMAIL>>
// SPDX-License-Identifier: MIT OR Apache-2.0
//! High-level interface to an Elk M1.
//!
//! ## Flow control
//!
//! The Elk's protocol specification describes a severely limited buffer.
//! Section 2 includes the following:
//!
//! > Buffer size in the M1 is limited so it is bes... |
// Copyright 2018 <NAME>.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to thos... |
use minimum_game::resources::DebugDraw3DResource;
use minimum_game::resources::DebugDraw3DDepthBehavior;
use minimum_game::resources::ViewportResource;
use minimum_math::NormalizedRay;
use minimum_game::input::InputState;
use minimum_game::input::MouseButton;
#[derive(Debug, Copy, Clone)]
pub struct PlaneConstraint {... |
use std::io::Read;
use byteorder::{LittleEndian, ReadBytesExt};
use fallible_iterator::FallibleIterator;
use log::{info, trace};
use num_derive::FromPrimitive;
use num_traits::FromPrimitive;
use openssl::{hash::hash, memcmp};
use serde::Serialize;
use thiserror::Error;
use tpmless_tpm2::{DigestAlgorithm, PcrExtender, ... |
//! UDP userspace interface for transmit and receive.
//!
//! Implements a userspace interface for sending and receiving UDP messages.
//! Processes use this driver to send UDP packets from a common interface
//! and bind to UDP ports for receiving packets.
//! Also exposes a list of interface addresses to the applicat... |
use super::guest_callback::entry_defs::EntryDefsHostAccess;
use super::guest_callback::init::InitHostAccess;
use super::guest_callback::migrate_agent::MigrateAgentHostAccess;
use super::guest_callback::post_commit::PostCommitHostAccess;
use super::guest_callback::validate::ValidateHostAccess;
use super::guest_callback:... |
//! This crate contains the Dicom pixeldata handlers and is
//! responsible for decoding pixeldata, such as JPEG-lossy and convert it
//! into a [`DynamicImage`], [`Array`] or raw [`DecodedPixelData`].
//!
//! This crate is using GDCM bindings to convert
//! different compression formats to raw pixeldata.
//!
//! # Web... |
//! Meshing code
use super::ChunkVertex;
use std::sync::Arc;
use voxel_rs_common::world::LightChunk;
use voxel_rs_common::{
block::BlockMesh,
collections::zero_initialized_vec,
world::chunk::{Chunk, ChunkPos, CHUNK_SIZE},
world::World,
};
#[derive(Clone, Copy, Default)]
pub struct Quad {
v1: u32,
... |
// 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.
//! Implementation of IGMP Messages.
use net_types::ip::Ipv4Addr;
use packet::{BufferView, ParsablePacket, ParseMetadata};
use zerocopy::{AsBytes, ByteSli... |
use std::collections::HashSet;
use proc_macro2::Ident;
use proc_macro_error::{emit_error, emit_warning};
use quote::ToTokens;
use syn::{GenericParam, Generics, LifetimeDef, parse_quote, TypeTuple};
use syn::{
Abi, Block, Expr, FnArg, ImplItemMethod, LitStr, Pat,
PatIdent, PatType, ReturnType, Signature, Type, ... |
use smallbitvec::SmallBitVec;
use smallvec::SmallVec;
use std::{f32, i32, isize, ops::*, usize};
use t3m::prelude::*;
#[derive(Clone, Debug, Default)]
pub struct HullApi {
verts: SmallVec<[V3; 64]>,
tris: SmallVec<[HullTri; 64]>,
used: SmallVec<[usize; 64]>,
map: SmallVec<[isize; 64]>,
is_extreme: ... |
use bevy::{
input::mouse::{MouseMotion, MouseWheel},
prelude::*,
sprite::{MaterialMesh2dBundle, Mesh2dHandle},
};
use crate::canvas::*;
use crate::inputs::*;
use crate::canvas::RespawnAllEvent;
use crate::util::*;
use crate::bezier::*;
use crate::plot::*;
fn spawn_axis_tick_labels(
commands: &mut Co... |
use std::collections::HashMap;
use std::sync::{
atomic::{AtomicBool, Ordering},
Arc,
};
use std::time::{Duration, Instant};
use crossbeam_channel::{Receiver, RecvError, Sender};
use parking_lot::Mutex;
use rand::{thread_rng, Rng};
use crate::{
Client, ClientIdentifier, Result, RpcOnWire, Server, ServerIde... |
use std::fmt;
use crate::bytecode::read_opcode_and_width;
use crate::mem::ptr_width;
use crate::semck::specialize::{specialize_enum_id_params, specialize_struct_id_params};
use crate::ty::{MachineMode, SourceType, SourceTypeArray};
use crate::utils::enumeration;
use crate::vm::{
get_vm, ClassDefId, ClassId, EnumId... |
#![warn(clippy::all)]
#![feature(alloc)]
#![feature(alloc_error_handler)]
#![no_std]
#![no_main]
mod gui;
mod network;
#[macro_use]
extern crate alloc;
extern crate alloc_cortex_m;
extern crate cortex_m;
extern crate cortex_m_rt as rt;
extern crate cortex_m_semihosting as sh;
extern crate stm32f7;
#[macro_use]
extern... |
pub mod parser;
pub mod eval;
pub mod print;
pub mod pretty;
use std::ops::{Deref, DerefMut};
use std::hash::Hash;
use std::sync::{Arc, Mutex, RwLock, atomic::AtomicBool};
use std::collections::HashMap;
use num::BigInt;
use owning_ref::{OwningRef, StableAddress, CloneStableAddress};
use crate::parser::ast::{Atom};
use... |
use crate::{
error::Error::*, lazy_val, push, throw, with_state, Context, ContextCreator, FuncDesc, FuncVal,
FutureWrapper, LazyBinding, LazyVal, ObjMember, ObjValue, Result, Val,
};
use closure::closure;
use jrsonnet_interner::IStr;
use jrsonnet_parser::{
ArgsDesc, AssertStmt, BinaryOpType, BindSpec, CompSpec, Expr... |
use lib::dwarf::*;
/*
* Format and debugging information
*/
pub const DW_TAG_ARRAY_TYPE : DW_TAG = DW_TAG(0x01);
pub const DW_TAG_CLASS_TYPE : DW_TAG = DW_TAG(0x02);
pub const DW_TAG_ENTRY_POINT : DW_TAG = DW_TAG(0x03);
pub const DW_TAG_ENUMERATION_TYPE : DW_TAG = DW_TAG(0x04);
pub const DW_TAG_FORMAL_PARAMETER : DW_... |
//! Base layer implementation.
//!
//! A base layer stores triple data without referring to a parent.
use futures::stream::{Peekable, Stream, StreamExt};
use futures::task::{Context, Poll};
use super::super::builder::*;
use super::super::id_map::*;
use super::super::layer::*;
use crate::layer::InternalLayer;
use crate... |
//! # PolkaBTC SLA Module
//! Based on the [specification](https://interlay.gitlab.io/polkabtc-spec/spec/sla.html).
#![deny(warnings)]
#![cfg_attr(test, feature(proc_macro_hygiene))]
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(test)]
mod mock;
#[cfg(test)]
mod tests;
#[cfg(test)]
extern crate mocktopus;
#[cfg... |
pub mod message;
#[cfg(not(target_os = "windows"))]
pub mod worker_pool;
#[cfg(not(target_os = "windows"))]
use crate::cluster::worker_pool::{MessageProcessor, WorkerPool};
use crate::cluster::message::NetworkMessage;
use crate::config::injection::DIService;
#[allow(unused_imports)]
use crate::config::{Config, Confi... |
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use anyhow::format_err;
use fidl::{endpoints::RequestStream, endpoints::ServerEnd};
use fidl_fuchsia_wlan_common as fidl_common;
use fidl_fuchsia_wlan_mlme... |
use indexmap::IndexMap;
use instant::{Duration, Instant};
use log::*;
use crate::{Analysis, EGraph, Id, Language, RecExpr, Rewrite, SearchMatches};
/** Faciliates running rewrites over an [`EGraph`].
One use for [`EGraph`]s is as the basis of a rewriting system.
Since an egraph never "forgets" state when applying a ... |
use crate::bimap::BiMap;
use crate::conn;
use crate::conn::{ChannelType, Completer, ConnEvent, Message, TuiEvent};
use crate::DFAExtension;
use log::error;
use regex_automata::DenseDFA;
use serde::Deserialize;
use std::sync::Arc;
use futures::channel::mpsc::UnboundedSender;
use futures::future::FutureExt;
use futures:... |
//! This module implements the global `JSON` object.
//!
//! The `JSON` object contains methods for parsing [JavaScript Object Notation (JSON)][spec]
//! and converting values to JSON. It can't be called or constructed, and aside from its
//! two method properties, it has no interesting functionality of its own.
//!
//... |
use clippy_utils::diagnostics::{span_lint_and_sugg, span_lint_and_then};
use clippy_utils::source::{snippet_with_applicability, snippet_with_context};
use clippy_utils::sugg::has_enclosing_paren;
use clippy_utils::ty::peel_mid_ty_refs;
use clippy_utils::{get_parent_expr, get_parent_node, is_lint_allowed, path_to_local}... |
// 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... |
/*
* Copyright <NAME>, Minter Ltd. See the COPYING
* file at the top-level directory of this distribution.
*
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
* https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
* <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
* opti... |
#![allow(non_snake_case, non_camel_case_types, non_upper_case_globals, dead_code)]
use std::ffi::c_void;
use winapi::um::winnt::{HANDLE, PLARGE_INTEGER, PWSTR, PCWSTR, PSID, PSID_AND_ATTRIBUTES, PTOKEN_GROUPS, PVOID, ACCESS_MASK, PACCESS_MASK, PACL, POBJECT_TYPE_LIST, PACE_HEADER, PSECURITY_DESCRIPTOR};
use winapi... |
use std::collections::{HashMap, HashSet};
use rustc::hir::def_id::DefId;
use rustc::ty::TyKind;
use rustc_target::spec::abi::Abi;
use syntax::ast;
use syntax::ast::*;
use syntax::attr;
use syntax::fold::{self, Folder};
use syntax::ptr::P;
use smallvec::SmallVec;
use api::*;
use command::{CommandState, Registry};
use d... |
//! Queues
//!
//! Data received from an SCTP peer must be processed before being passed to the upper-layer
//! to perform out-of-order data reordering and message reassembly. We provide specialized
//! queues in this module for performing these tasks. An OrderedDataQueue processes ordered (U=0)
//! DATA chunks and y... |
//! Higher order DCT coefficients.
use std::f32::consts::PI;
use arrayvec::ArrayVec;
use allocs::allocs;
use consts::{MIN_HARMONICS, MAX_HARMONICS};
use descramble::QuantizedAmplitudes;
use gain::Gains;
use params::BaseParams;
/// Higher order DCT coefficients vector T<sub>l</sub>, 1 ≤ l ≤ L.
pub struct Coefficient... |
use std::collections::BTreeMap;
use std::fmt;
use std::iter::FromIterator;
use async_trait::async_trait;
use bytes::Bytes;
use destream::{de, en};
use futures::stream::{self, StreamExt};
use futures::{join, try_join, TryFutureExt, TryStreamExt};
use log::{debug, error};
use safecast::*;
use tc_btree::BTreeInstance;
u... |
use Timeout;
use Timestamp;
use arrayvec::ArrayVec;
use buffer::Buffer;
use buffer::BufferRef;
use buffer::with_buffer;
use protocol::ChunksIter;
use protocol::ConnectedPacket;
use protocol::ConnectedPacketType;
use protocol::ControlPacket;
use protocol::MAX_PACKETSIZE;
use protocol::MAX_PAYLOAD;
use protocol::Packet;
... |
use std::cmp::Ordering;
const FITNESS_DEMERITS: u32 = 10_000;
const FLAGGED_DEMERITS: u32 = 30_000;
const LINE_PENALTY: u32 = 10;
pub const INFINITE_PENALTY: i32 = 10_000;
const NULL: usize = ::std::usize::MAX;
#[derive(Debug, Copy, Clone)]
pub enum Item<T> {
Box {
width: i32,
data:... |
//! # PolkaBTC Redeem Module
//! Based on the [specification](https://interlay.gitlab.io/polkabtc-spec/spec/redeem.html).
#![deny(warnings)]
#![cfg_attr(test, feature(proc_macro_hygiene))]
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(any(feature = "runtime-benchmarks", test))]
mod benchmarking;
mod default_weigh... |
use crate::register::IntRegister;
use std::convert::TryFrom;
use std::fmt;
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum InstructionFormat {
// /* | 31 25 | 24 20 | 19 15 | 14 12 | 11 7 | 6 0 | */
R, /* | ---funct7--- | -rs2- | -rs1- | funct3 | ----rd----- | opcode | */
R4, /* |... |
use std::error::Error as ErrorExt;
use std::ffi::{CString, OsStr};
use std::fmt::Debug;
use std::fs::{self, File, OpenOptions};
use std::io::{Read, Write};
use std::iter;
use std::marker::PhantomData;
use std::mem;
use std::os::unix::ffi::OsStrExt;
use std::os::unix::io::FromRawFd;
use std::path::{Path, PathBuf};
use s... |
//! Evaluation of a Nickel term.
//!
//! The implementation of the Nickel abstract machine which evaluates a term. Note that this
//! machine is not currently formalized somewhere and is just a convenient name to designate the
//! current implementation.
//!
//! # The Nickel Abstract Machine
//! The abstract machine is... |
use core_graphics;
// TODO(dustin): use only the things i need
use self::core_graphics::display::*;
use self::core_graphics::event::*;
use self::core_graphics::event_source::*;
use crate::macos::keycodes::*;
use crate::{Key, KeyboardControllable, MouseButton, MouseControllable};
use objc::runtime::Class;
use std::ff... |
#![cfg_attr(not(feature = "std"), no_std)]
use alt_serde::{Deserialize, Deserializer};
use codec::{Decode, Encode};
use core::convert::TryInto;
use frame_support::traits::{BalanceStatus, ReservableCurrency};
use frame_support::{
debug, decl_error, decl_event, decl_module, decl_storage, dispatch, ensure, traits::Ra... |
//! X.509 objects and types
//!
//! Based on RFC5280
//!
use crate::error::{X509Error, X509Result};
use crate::objects::*;
use crate::traits::FromDer;
use data_encoding::HEXUPPER;
use der_parser::ber::{parse_ber_integer, BitStringObject, MAX_OBJECT_SIZE};
use der_parser::der::*;
use der_parser::error::*;
use der_pars... |
// Copyright 2016 TiKV Project Authors. Licensed under Apache-2.0.
//! Prometheus metrics for storage functionality.
use prometheus::*;
use prometheus_static_metric::*;
use std::cell::RefCell;
use std::mem;
use std::sync::Arc;
use crate::server::metrics::{GcKeysCF as ServerGcKeysCF, GcKeysDetail as ServerGcKeysDeta... |
// Copyright 2022 pyke.io
// 2019-2021 Tauri Programme within The Commons Conservancy
// [https://tauri.studio/]
//
// 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... |
use lyon::extra::rust_logo::build_logo_path;
use lyon::path::builder::*;
use lyon::path::Path;
use lyon::math::*;
use lyon::tessellation::geometry_builder::*;
use lyon::tessellation::basic_shapes::*;
use lyon::tessellation::{FillTessellator, FillOptions};
use lyon::tessellation::{StrokeTessellator, StrokeOptions};
use ... |
#[cfg(feature = "serde")]
use serde::Serialize;
use byteorder;
use log::{debug, error, trace, warn};
use num_derive::FromPrimitive;
use num_traits::{FromPrimitive, ToPrimitive};
use rusb as libusb;
use thiserror::Error;
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use std::slice;
use std::time::Durati... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Start UART receiver"]
pub tasks_startrx: TASKS_STARTRX,
#[doc = "0x04 - Stop UART receiver"]
pub tasks_stoprx: TASKS_STOPRX,
#[doc = "0x08 - Start UART transmitter"]
pub tasks_starttx: TASKS_STARTTX,
#[doc = "0x... |
//! SD card slot access (in SPI mode) on Maix Go
use core::convert::TryInto;
use crate::soc::dmac::{dma_channel, DMAC};
use crate::soc::gpio;
use crate::soc::gpiohs;
use crate::soc::spi::{aitm, frame_format, tmod, work_mode, SPI};
pub struct SDCard<'a, SPI> {
spi: SPI,
spi_cs: u32,
cs_gpionum: u8,
dma... |
use node_types::{EntryKind, Field, NodeTypeMap, Storage, TypeName};
use std::borrow::Cow;
use std::collections::BTreeMap as Map;
use std::collections::BTreeSet as Set;
use std::fmt;
use std::io::Write;
use std::path::Path;
use tracing::{error, info, span, Level};
use tree_sitter::{Language, Node, Parser, Range, Tree};... |
// Copyright 2020-2021 <NAME>
// SPDX-License-Identifier: Apache-2.0
use core::convert::TryFrom as _;
use core::num::NonZeroUsize;
use crypto::ciphers::aes::Aes128Gcm;
use crypto::ciphers::aes::Aes192Gcm;
use crypto::ciphers::aes::Aes256Gcm;
use crypto::ciphers::aes_cbc::Aes128CbcHmac256;
use crypto::ciphers::aes_cbc:... |
#![doc(html_root_url = "https://docs.rs/fruit-salad_proc-macro-definitions/0.0.2")]
#![forbid(unsafe_code)]
#![warn(clippy::pedantic)]
#![allow(clippy::semicolon_if_nothing_returned, clippy::too_many_lines)]
extern crate proc_macro;
use call2_for_syn::call2_strict;
use debugless_unwrap::DebuglessUnwrap;
use proc_macr... |
// Copyright (c) 2016 The vulkano developers
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or
// https://www.apache.org/licenses/LICENSE-2.0> or the MIT
// license <LICENSE-MIT or https://opensource.org/licenses/MIT>,
// at your option. All files in the project carrying such
// notice may not be ... |
use ark_ec::{msm::FixedBaseMSM, PairingEngine, ProjectiveCurve};
use ark_ff::{to_bytes, Field, One, PrimeField, UniformRand, Zero};
use ark_poly::polynomial::{univariate::DensePolynomial, UVPolynomial};
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize, Read, SerializationError, Write};
use ark_std::rand::Rn... |
use super::{
connection::{DisconnectReceiver, MessageReceiver},
new_peer::{Peer, TxRelay},
peer_manager::GenericTxid,
};
use crate::{
blockchain::Chain,
mempool::{MemPool, MempoolError},
protocol::NetworkParams,
util, ChainEntry,
};
use anyhow::{anyhow, bail, Result};
use bitcoin::{
hash... |
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
// All files in the project carrying such notice may not be copied, modified, or distributed
// except according ... |
use crate::apps_item::AppsItem;
use crate::apps_registry::hash;
use crate::apps_registry::{AppsError, AppsMgmtError};
use crate::apps_storage::{validate_package, AppsStorage};
use crate::apps_utils;
use crate::downloader::Downloader as Req;
use crate::downloader::{DownloadError, Downloader};
use crate::generated::commo... |
//! Enables PMIC (AXP173), turns IMU (BNO080) on and starts to stream
//! current board's position (rotation quaternions) via Bluetooth Low Energy (BLE).
#![no_std]
#![no_main]
#![feature(trait_alias)]
#![feature(type_alias_impl_trait)]
#![feature(min_type_alias_impl_trait)]
#![feature(impl_trait_in_bindings)]
#![all... |
use algebra::{AffineCurve, ProjectiveCurve, ToConstraintField, UniformRand};
use primitives::{
crh::{bowe_hopwood::BoweHopwoodPedersenParameters, FieldBasedHash},
signature::{schnorr::field_based_schnorr::FieldBasedSchnorrPk, FieldBasedSignatureScheme},
vrf::{ecvrf::FieldBasedEcVrfPk, FieldBasedVrf},
};
us... |
//! Manages remote services.
use crate::core::{BaseMessage, GetServiceResponse};
use crate::remote_services_registrar::RemoteServicesRegistrar;
#[cfg(target_os = "android")]
use crate::selinux::SeLinux;
use crate::socket_pair::{PairedStream, SocketPair};
use crate::traits::*;
use bincode::Options;
use log::{debug, err... |
// Copyright 2020 The Exonum Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
use core::{cmp, marker::PhantomData, mem, ops::DerefMut, pin::Pin, slice};
use bitflags::bitflags;
use zerocopy::{AsBytes, FromBytes};
use crate::{
addr::{pgrounddown, pgroundup, Addr, KVAddr, PAddr, UVAddr, VAddr, MAXVA, PGSIZE},
arch::interface::{Arch, IPageTableEntry, PageTableManager},
arch::TargetArc... |
use crate::profile::buffer::{decode_string, decode_varint, Buffer, WireTypes};
use chrono::NaiveDateTime;
use rock_utils::errors::RockError;
use std::borrow::Borrow;
use std::collections::hash_map::Entry;
use std::collections::HashMap;
pub mod buffer;
mod function;
mod label;
mod line;
mod location;
mod mapping;
mod s... |
//! SQLite dialect
use phf::phf_map;
use std::str;
mod token;
pub use token::TokenType;
/// Token value (lexeme)
pub type Token = Option<String>;
impl TokenType {
// TODO try Cow<&'static, str> (Borrowed<&'static str> for keyword and Owned<String> for below),
// => Syntax error on keyword will be better
... |
/// Contains the `FTPError` struct that that defines the libunftp custom error type.
pub mod error;
pub(crate) mod commands;
pub(crate) mod reply;
pub(crate) mod password;
// Contains code pertaining to the FTP *control* channel
mod controlchan;
// Contains code pertaining to the communication between the data and... |
//! Mark-and-compact garbage collection for pruning graphs.
//!
//! This module implements a mark-and-compact garbage collector that can prune a
//! graph so that only components reachable from a set of root game states are
//! retained. Running time and memory required are linear in graph size,
//! although there is a... |
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
use super::{
stats::StatsVisitor, BoolVariable, Constant, ConstantBits, IntVarBits, IntVariable, Term,
Variable,
};
use crate::{canonicalize::Canonicalizer, int_term, Bit};
use amzn_smt_ir::{
args,
... |
pub fn primitive_types_main() {
println!("///*** Primitive Types ***\\\\\\\n");
arrays();
bools();
chars();
f32s();
i32s();
raw_pointers();
slices();
strs();
tuples();
u32s();
println!("");
}
fn arrays() {
println!("*** Arrays ***");
let mut array: [i32; 3] = ... |
#![recursion_limit = "256"]
#![type_length_limit = "4194304"]
#![cfg_attr(feature = "windows", windows_subsystem = "windows")]
#![cfg_attr(backtrace, feature(backtrace))]
use anyhow::{anyhow, bail, Context, Result};
use backoff::backoff::Backoff as _;
use oxidize::api;
use oxidize::auth;
use oxidize::bus;
use oxidize:... |
// Copyright 2019 The Gotts Developers
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agre... |
extern crate bindgen;
extern crate bzip2;
extern crate cc;
extern crate glob;
extern crate libflate;
extern crate pkg_config;
extern crate reqwest;
extern crate tar;
extern crate url;
use bzip2::read::BzDecoder;
use glob::glob;
use libflate::gzip;
use std::collections::HashMap;
use std::env;
use std::fs::File;
use std... |
// Copyright 2018 <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, softwa... |
#[macro_use]
extern crate lazy_static;
use crate::utils::OptDoc;
use chrono::{DateTime, Utc};
use iced::futures::{AsyncReadExt, AsyncWriteExt};
use iced::widget::pane_grid::Pane;
use iced::{
button, pane_grid, scrollable, text_input, Align, Application, Button, Checkbox, Column,
Command, Container, Element, Fon... |
//! this module houses the machinery for creating mesh data from world data.
//!
//! [`MeshBuilder`] holds the current mesh, and `mesh_*` functions like
//! [`mesh_cross`] and [`mesh_full_cube_side`] add to this structure. the
//! [`MeshBuilder`] is driven by the [`MeshCreationContext`], which holds all
//! the state n... |
// From http://forum.fixtrading.org/t/body-fields-ordering/209
//
// The rule-of-thumb is this: When formatting an outgoing message,
// order fields and components exactly as specified in the standard
// or as extended in your ROE. When parsing an incoming message expect and allow discrepancies.
// Even though the ... |
use crate::common::*;
use arrayvec::ArrayVec;
use ordered_float::NotNan;
use petgraph::{
prelude::*,
visit::{
IntoEdgeReferences, IntoNodeReferences, NodeIndexable, NodeRef, Topo, VisitMap, Visitable,
},
};
use slotmap::{SecondaryMap, SlotMap};
use std::{
collections::{hash_map::DefaultHasher, H... |
use atomic_refcell::AtomicRefCell;
use crossbeam::atomic::AtomicCell;
use crossbeam::channel::{self, SendTimeoutError};
use parking_lot::RwLock;
use std::collections::{HashMap, HashSet, VecDeque};
use std::mem::MaybeUninit;
use std::sync::atomic::{AtomicBool, AtomicU32, Ordering};
use std::sync::Arc;
use std::time::Dur... |
//!
//! # Spice21 Analyses
//!
use num::{Complex, Float, Zero};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::ops::Index;
use crate::circuit::{Ckt, NodeRef};
use crate::comps::{Component, ComponentSolver};
use crate::defs;
use crate::sparse21::{Eindex, Matrix};
use crate::{sperror, SpNum... |
extern crate base64;
#[macro_use]
extern crate clap;
extern crate crossbeam_utils;
extern crate env_logger;
extern crate flate2;
extern crate hyperx;
extern crate jsonwebtoken as jwt;
extern crate libmount;
#[macro_use]
extern crate log;
extern crate nix;
extern crate openssl;
extern crate rand;
extern crate reqwest;
e... |
// Copyright 2020 The Exonum Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
use crate::{kzg10, PCCommitterKey};
use crate::{BTreeMap, BTreeSet, String, ToString, Vec};
use crate::{BatchLCProof, Error, Evaluations, QuerySet};
use crate::{LabeledCommitment, LabeledPolynomial, LinearCombination};
use crate::{PCRandomness, PCUniversalParams, Polynomial, PolynomialCommitment};
use core::{convert::... |
use byteorder::{WriteBytesExt, LE};
use encoding::Encoding;
use nom::{number::complete::*, IResult};
use num_traits::{FromPrimitive, ToPrimitive};
#[derive(Debug, Serialize, Deserialize)]
pub struct VCVector {
pub x: f32,
pub y: f32,
pub z: f32,
}
impl VCVector {
pub fn to_bin(&self, buf: &mut Vec<u8>... |
extern crate consalifold;
extern crate num_cpus;
extern crate crossbeam;
use consalifold::*;
use std::env;
use std::path::Path;
use std::io::{BufRead, BufWriter};
use std::fs::File;
use std::fs::create_dir;
use crossbeam::scope;
use std::process::{Command, Output};
use std::fs::remove_file;
type MeaCssStr = MeaSsStr;... |
// Copyright 2018 The Chromium OS 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 std::collections::BTreeMap;
use std::error::Error as StdError;
use std::ffi::{CStr, CString};
use std::fmt::{self, Display};
use std::fs::File;
use... |
//! This Hexchat addon provides commands that can turn on language translation
//! in any chat window of Hexhat. The user's text is translated to the target
//! language going out, and incoming message are translated back into the user's
//! own language. The user sees both the original text and translated text in
//!... |
use std::fmt;
use std::rc::Rc;
use super::literal::LiteralIntro;
use crate::domain::{Elim, Value};
/// The name of a primitive.
#[derive(Debug, Clone, PartialEq, Hash, Eq, PartialOrd, Ord)]
pub struct Name(pub String);
impl<'a> From<&'a str> for Name {
fn from(src: &'a str) -> Name {
Name(src.to_owned())... |
use lazy_static::lazy_static;
use nipper::Document;
use nipper::Selection;
use regex::Regex;
use std::cmp::min;
use std::collections::HashMap;
use std::env;
use std::fs::File;
use std::io::Read;
use std::ops::Deref;
use std::time::Instant;
lazy_static! {
static ref RE_REPLACE_BRS: Regex = Regex::new(r#"(?is)(<br[^>... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - RTC Control 0"]
pub cr0: CR0,
_reserved1: [u8; 2usize],
#[doc = "0x04 - RTC Status 0"]
pub sr0: SR0,
_reserved2: [u8; 2usize],
#[doc = "0x08 - RTC Status 1"]
pub sr1: SR1,
_reserved3: [u8; 2usize],
#... |
use std::fmt::Write;
use rand::Rng;
use super::Cpu;
use crate::util::*;
macro_rules! instructions {
($( $byte:pat => ($mnemonic:expr, [$( $parm:ident ),*], $action:expr) ),*) => {
pub fn run_instruction(cpu: &mut Cpu, addr: usize) -> Result<(), String> {
Ok(match cpu.memory[addr] {
... |
use cairo;
use std::any::Any;
use std::boxed::Box;
use std::sync::{Arc, Mutex};
use media::sample_extractor::SampleExtractionState;
use media::{AudioBuffer, AudioChannel, DoubleAudioBuffer, SampleExtractor};
use super::WaveformImage;
pub struct DoubleWaveformBuffer {}
impl DoubleWaveformBuffer {
pub fn new_mut... |
// Copyright (c) 2021, Facebook, Inc. and its affiliates
// Copyright (c) 2022, Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
use crate::{
authority_batch::{BroadcastReceiver, BroadcastSender},
execution_engine, transaction_input_checker,
};
use move_binary_format::CompiledModule;
use move_bytecode_... |
use rand::prelude::*;
use std::{collections::VecDeque, fmt};
use colored::Colorize;
pub type SnakeId = u32;
#[derive(Debug, Copy, Clone, PartialEq)]
pub enum Cell {
Empty,
Food,
Obstacle,
Wall,
SnakeHead(SnakeId),
SnakeBody(SnakeId),
SnakeTail(SnakeId),
}
impl fmt::Display for Cell {
... |
// Copyright (c) Microsoft. All rights reserved.
#![deny(rust_2018_idioms)]
#![warn(clippy::all, clippy::pedantic)]
#![allow(
clippy::default_trait_access,
clippy::let_and_return,
clippy::let_unit_value,
clippy::missing_errors_doc,
clippy::similar_names,
clippy::too_many_lines
)]
use async_tra... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.