text
stringlengths
7.05k
33.9k
/// filestorage2 use std::io::prelude::*; use anyhow::{Context, Result}; use byteorder::{ByteOrder, BigEndian, ReadBytesExt}; use crate::errors; use crate::index; use crate::lock; use crate::pool; use crate::records; use crate::tid; use crate::transaction; use crate::util; const INDEX_SUFFIX: &'static str = ".inde...
use std::collections::{BTreeSet, HashMap, VecDeque}; use serde::{Deserialize, Serialize}; use abstutil::FixedMap; use geom::{Distance, Time}; use map_model::{Map, Position, Traversable}; use crate::mechanics::car::{Car, CarState}; use crate::{CarID, VehicleType, FOLLOWING_DISTANCE}; /// A Queue of vehicles on a sin...
use std::io::SeekFrom; use std::rc::Rc; use crate::{AddrBase, BuiltInIdent, Error, Span, SymbolTable}; use super::error::{EErrorKind, EResult, SError, SErrorKind, SResult}; use super::eval::{Eval, IntVal, Val}; use super::scope::{Name, Namespace, Scopes}; use super::*; pub(super) fn parse<SR: SeekRead>( f: &mut ...
// This file is part of Substrate. // Copyright (C) 2020 Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://...
//! Driver for the MX25R6435F flash chip. //! //! <http://www.macronix.com/en-us/products/NOR-Flash/Serial-NOR-Flash/Pages/spec.aspx?p=MX25R6435F> //! //! From the datasheet: //! //! > MX25R6435F is 64Mb bits Serial NOR Flash memory, which is configured as //! > 8,388,608 x 8 internally. When it is in four I/O mode, th...
//! `Formula` stores the result of a parsing as the tree of its "syntactic proof" //! The formula nodes are the equivalent of MMJ2's `ParseNode`s, and the formula //! itself the equivalent of MMJ2's `ParseTree` // There are several improvements which could be made to this implementation, // without changing the API: /...
pub type Address = u16; pub type Register = usize; pub struct Opcode(u16); impl Opcode { /// OPCODE üzerinde 0x0X00 değerini döner fn oxoo(&self) -> usize { ((self.0 & 0x0F00) >> 8) as usize } /// OPCODE üzerinde 0x00Y0 değerini döner fn ooyo(&self) -> usize { ((self.0 & 0x00F0) >...
use ic_artifact_pool::consensus_pool::ConsensusPoolImpl; use ic_artifact_pool::dkg_pool::DkgPoolImpl; use ic_config::artifact_pool::ArtifactPoolConfig; use ic_consensus::consensus::pool_reader::PoolReader; use ic_consensus_message::{make_genesis, ConsensusMessageHashable}; use ic_interfaces::state_manager::StateManager...
//! Three-dimensional penetration depth queries using the Expanding Polytope Algorithm. use crate::math::{Isometry, Point, Vector}; use crate::query::algorithms::special_support_maps::ConstantOrigin; use crate::query::algorithms::{gjk, CSOPoint, VoronoiSimplex}; use crate::query::PointQueryWithLocation; use crate::sha...
/* Copyright 2017 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, softw...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Start comparator"] pub tasks_start: TASKS_START, #[doc = "0x04 - Stop comparator"] pub tasks_stop: TASKS_STOP, #[doc = "0x08 - Sample comparator value"] pub tasks_sample: TASKS_SAMPLE, _reserved3: [u8; 244usize]...
//! A polyphonic subtractive synthesizer. //! //! This synthesizer uses building blocks from `oxcable` to perform basic //! subtractive synthesis. The synth is controlled via MIDI and packaged as an //! `AudioDevice`. //! //! # Signal Chain //! //! The synthesizer is polyphonic. The signal chain is composed of: //! //!...
pub mod event; pub mod generic_proto; pub mod message; use crate::protocol::generic_proto::{GenericProto, GenericProtoOut, NotificationsSink}; use crate::protocol::message::generic::Status; use crate::utils::interval; use crate::{errors, DiscoveryNetBehaviour, Multiaddr}; use bcs_ext::BCSCodec; use bytes::Bytes; use f...
//! Runs a user-supplied reconciler function on objects when they (or related objects) are updated use self::runner::Runner; use crate::{ reflector::{ reflector, store::{Store, Writer}, ObjectRef, }, scheduler::{self, scheduler, ScheduleRequest}, utils::{try_flatten_applied, try...
//! A level-triggered `Poller` for V4L2 devices that allows a user to be notified //! when a CAPTURE or OUTPUT buffer is ready to be dequeued, or when a V4L2 //! event is ready to be dequeued. //! //! It also provides a `Waker` companion that allows other threads to interrupt //! an ongoing (or coming) poll. Useful to ...
use icfpc2021::{*, util::*}; use std::collections::*; #[derive(Debug)] enum Node { Leaf(usize), Forget(Vec<usize>, usize, Box<Node>), Introduce(Vec<usize>, usize, Box<Node>), Join(Vec<usize>, Box<Node>, Box<Node>), } fn construct_rec(bags: &Vec<Vec<usize>>, g: &Vec<Vec<usize>>, i: usize, parent: usize) -> Node { ...
//! Functions whose purpose is to encode a planning problem (represented with chronicles) //! into a combinatorial problem from Aries core. use crate::encoding::{conditions, effects, refinements_of, refinements_of_task, TaskRef, HORIZON, ORIGIN}; use anyhow::*; use aries_model::assignments::Assignment; use aries_model...
//! Diagnostic reporting and emission. //! //! There are two kinds of diagnostics: [raw diagnostics](RawDiagnostic) and //! [rendered diagnostics](RenderedDiagnostic). //! //! Raw diagnosics are what users construct through [`Reporter`] and [`DiagnosticBuilder`]. These //! diagnostics contain [fragmented source ranges]...
// Copyright 2021 <NAME>. 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::{Context as _, Error}; use fidl_fuchsia_stardock as fstardock; use fuchsia_async as fasync; use futures::io::AsyncReadExt; use log::info; use serde::{Deseri...
#![cfg_attr(feature = "cargo-clippy", allow(cyclomatic_complexity, trivial_regex))] use std::collections::BTreeMap; use std::io::Write; use std::io::BufWriter; use std::fs::File; use std::str; use std::path::{PathBuf, Path}; use regex::Regex; use bio::data_structures::interval_tree::IntervalTree; use bio::utils::Inte...
//! Implementation of font shaping for Arabic scripts //! //! Code herein follows the specification at: //! <https://github.com/n8willis/opentype-shaping-documents/blob/master/opentype-shaping-arabic-general.md> use crate::error::{ParseError, ShapingError}; use crate::gsub::{self, FeatureMask, GlyphData, GlyphOrigin, ...
// See the README in this directory for an explanation of the Teddy algorithm. use std::cmp; use std::collections::BTreeMap; use std::fmt; use crate::packed::pattern::{PatternID, Patterns}; use crate::packed::teddy::Teddy; /// A builder for constructing a Teddy matcher. /// /// The builder primarily permits fine gra...
use std::time::SystemTime; use crate::server::autoalloc::state::{Allocation, AllocationEvent, AllocationStatus}; use crate::server::autoalloc::DescriptorId; use crate::server::state::StateRef; macro_rules! get_or_return { ($e:expr) => { match $e { Some(v) => v, _ => return, ...
use std::collections::HashMap; use std::rc::Rc; use moniker::FreeVar; use moniker::Ignore; use crate::cdsl::CDecl; use crate::cdsl::CExpr; use crate::cdsl::CStmt; use crate::cdsl::CType; use crate::lifted_expr::LExpr; use crate::lifted_expr::LiftedLambda; use crate::literals::Literal; pub struct CodegenCtx<'a> { ...
/*! Playing field. */ use ::std::{fmt}; use ::std::str::{FromStr}; use ::{Point, Sprite}; /// Row in the well. /// /// The well represents its internal structure in bit masks. // // Keep in sync with `SIZE_OF_WIDTH` and `MAX_WIDTH`. pub type Line = u16; const SIZE_OF_WIDTH: usize = 16; /// Maximum well height. /// ...
//! [Rust][1] simulations using input/output examples to learn [typed][2] first-order [term rewriting systems][3] that perform list routines. //! //! [1]: https://www.rust-lang.org //! "The Rust Programming Language" //! [2]: https://en.wikipedia.org/wiki/Hindley%E2%80%93Milner_type_system //! "Wikipedia - Hindley-Miln...
#![windows_subsystem = "windows"] #![allow(clippy::type_complexity)] use bevy::{ asset::{AssetLoader, LoadContext, LoadedAsset}, prelude::*, reflect::TypeUuid, utils::BoxedFuture, }; use tract_onnx::prelude::*; #[derive(Debug, TypeUuid)] #[uuid = "578fae90-a8de-41ab-a4dc-3aca66a31eed"] pub struct Onnx...
//! The inbound service handles requests from Zebra's peers. //! //! It downloads and verifies gossiped blocks and mempool transactions, //! when Zebra is close to the chain tip. //! //! It also responds to peer requests for blocks, transactions, and peer addresses. use std::{ collections::HashSet, future::Fut...
/*! A submodule that contains the different categories each node type might belong to. Copyright © 2020 <NAME> */ /// /// An enumeration of the different kinds of categories a node might belong to. #[derive(Debug, PartialEq, Eq, Hash)] pub enum NodeCategory { /// This property only belongs to the document itself...
// Copyright 2021 Chiral Ltd. // Licensed under the Apache-2.0 license (https://opensource.org/licenses/Apache-2.0) // This file may not be copied, modified, or distributed // except according to those terms. use crate::core; use super::mapping_ops; use super::case_breakable; use super::case_cyclic; const MAX_REDUCIB...
/// Create or load wikit dictionary use crate::error::{WikitError, Context, WikitResult, AnyResult, NomResult}; use crate::elog; use crate::index; use crate::mdict; use crate::util; use crate::reader; use crate::config; use std::path::{Path, PathBuf}; use std::fs::File; use std::io::{BufWriter, Write, Seek, SeekFrom,...
#![allow(unused)] // temporary use crate::direct::constraints::DirectLDTGadget; use crate::domain::Radix2CosetDomain; use crate::fri::FRIParameters; use ark_ff::PrimeField; use ark_r1cs_std::bits::boolean::Boolean; use ark_r1cs_std::eq::EqGadget; use ark_r1cs_std::fields::fp::FpVar; use ark_r1cs_std::fields::FieldVar; ...
use crate::engines; use crate::pixels; use crate::producer; use crossbeam_channel::select; use glob::glob; use log::{debug, error, info}; use notify::{EventKind, Watcher}; use rusty_v8 as v8; use serde_v8; use std::borrow::Borrow; use std::convert::TryFrom; use std::fs; use std::sync::Arc; use thiserror::Error; pub st...
use std::{rc::Rc, str::FromStr, cell::RefCell}; use glib::{ObjectExt, StaticType}; use gtk4::{ traits::{ WidgetExt, BoxExt, GtkWindowExt, ButtonExt, FlowBoxChildExt, GestureSingleExt, GridExt }, SpinButton, Orientation, Align, gdk, prelude::{DrawingAreaExtManual, GdkCairoContextExt}, SelectionMode, PropertyExpression,...
use std::{fs, os::unix::fs::PermissionsExt}; use super::Status; use crate as ion_shell; use crate::{ shell::{Shell, Value}, types, }; use builtins_proc::builtin; #[builtin( desc = "check whether items exist", man = " SYNOPSIS exists [EXPRESSION] DESCRIPTION Checks whether the given item exist...
extern crate libc; extern crate pty; extern crate regex; extern crate ws; #[macro_use] extern crate lazy_static; extern crate qstring; extern crate serde; #[macro_use] extern crate serde_derive; extern crate serde_json; mod terminal; mod variables; use pty::fork::*; use regex::{Captures, Regex, RegexBuilder}; use std...
#![deny(unsafe_code)] #![no_main] #![no_std] // Local modules mod atten; mod bsp; mod calibration; mod log_det; mod m_c; mod tmp100; // External Imports use atsamd_hal as hal; use core::cell::RefCell; use embedded_hal::digital::v2::OutputPin; use embedded_hal::prelude::*; use hal::adc::Adc; use hal::clock::{ClockGenI...
use parity_wasm::builder; use parity_wasm::elements::{ BlockType, FuncBody, GlobalEntry, GlobalType, InitExpr, Instruction, Instructions, Internal, Local, Module, Section, ValueType, ImportCountType, }; use std::collections::HashMap; use std::error::Error; use std::iter::FromIterator; // Converts a Wasm i...
// rpc-perf - RPC Performance Testing // Copyright 2015 Twitter, 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 // // Unle...
use crate::{ core::{ camera::CameraDt, geometry::{ Bounds2i, Bounds3f, Normal3f, Point2f, Point2i, Point3f, Point3i, RayDifferentials, Union, Vector3f, }, integrator::{ compute_light_power_distribution, uniform_sample_one_light, Integrator, ...
use alloc::collections::btree_map::BTreeMap as HashMap; use alloc::sync::Arc; use core::convert::Infallible; use core::ops::Deref; use core::time::Duration; use std::sync::RwLock; use crossbeam_channel::{unbounded, Receiver, Sender}; use itertools::Itertools; use tracing::{debug, error, error_span, info, trace, warn};...
// Copyright 2019-2021 Parity Technologies (UK) Ltd. // This file is part of Parity Bridges Common. // Parity Bridges Common 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, ...
//! UART peripheral control //! //! Controls the 3 uart peripherals (UART0, UART1, UART2) //! //! **It currently depends on GPIO pins and clock to be configured with default settings.** //! (Tested for UART 0) //! //! # TODO //! - Automatic GPIO configuration //! - Add all extra features esp32 supports (eg rs485, etc. ...
#![feature(iter_advance_by)] mod config; mod devices; mod dummy_keyboard; mod numpad_layout; mod touchpad_i2c; mod util; use std::fmt::Display; use std::hint::unreachable_unchecked; use std::os::unix::io::AsRawFd; use std::process::Command; use crate::config::{Config, CustomCommand}; use crate::devices::{get_touchpa...
use futures::channel::mpsc as async_mpsc; use gettextrs::{gettext, ngettext}; use gtk::prelude::*; use log::{debug, error}; use std::{borrow::ToOwned, cell::RefCell, collections::HashSet, path::PathBuf, rc::Rc, sync::Arc}; use application::{CommandLineArguments, APP_ID, CONFIG}; use media::{MediaEvent, PlaybackStat...
/// This module contains most of the internals of actors. /// /// It is used to handle messages, system messages, termination, initialization, restarting and /// creation of actors. use std::any::Any; use std::collections::{HashMap, VecDeque}; use std::mem; use std::sync::{Arc, Mutex, RwLock, Weak}; use actors::{Acto...
#![cfg_attr(all(test, feature = "nightly"), feature(test))] // we only need test feature when testing #[macro_use] extern crate log; extern crate syntex_syntax; extern crate toml; extern crate env_logger; #[macro_use] extern crate clap; extern crate racer; #[cfg(not(test))] use racer::core; #[cfg(not(test))] use ra...
// Copyright 2020 WHTCORPS INC. Licensed under Apache-2.0. //! EinsteinDB key building #[macro_use] extern crate derive_more; #[macro_use] extern crate failure; #[allow(unused_extern_crates)] extern crate edb_alloc; use byteorder::{BigEndian, ByteOrder}; use ekvproto::meta_timeshare::Brane; use std::mem; pub mod r...
use crate::array::*; use crate::data::CData; use crate::error::CError; use crate::int::CInt128; use crate::linear_fee::Coin; use crate::option::COption; use crate::panic::*; use crate::pool_registration::UnitInterval; use crate::ptr::*; use crate::transaction_body::Epoch; use crate::transaction_builder::BigNum; use car...
use crate::{err::Error, SafeHandle}; use winapi::{ ctypes::c_void, um::{ errhandlingapi as ehapi, fileapi::{CreateFileW, OPEN_EXISTING}, handleapi::INVALID_HANDLE_VALUE, ioapiset::DeviceIoControl, winbase::FILE_FLAG_BACKUP_SEMANTICS, winioctl::{ FSCTL...
use std::cmp::{max, min}; use std::fmt::Debug; use std::marker::PhantomData; use crate::{BitWriter, Flags, huffman_encoding}; use crate::bits::*; use crate::chunk_metadata::{ChunkMetadata, PrefixMetadata}; use crate::constants::*; use crate::delta_encoding; use crate::delta_encoding::DeltaMoments; use crate::errors::{...
use core::cmp::min; use std::error::Error; use clap::ArgMatches; use regex::Regex; pub trait ModuloSignedExt { fn modulo(&self, n: Self) -> Self; } macro_rules! modulo_signed_ext_impl { ($($t:ty)*) => ($( impl ModuloSignedExt for $t { #[inline] fn modulo(&self, n: Self) -> Self...
// Copyright 2014 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::AsyncResult; use async_trait::async_trait; use bytes::{BufMut, BytesMut}; use futures::{executor, SinkExt}; use log::{error, info}; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::fmt; use std::marker::PhantomData; use std::net::SocketAddr; use std::result::Result; use std::sync:...
//! This is a binary running in the local environment //! //! You have to provide all needed configuration attributes via command line parameters, //! or you could specify a configuration file. The format of configuration file is defined //! in mod `config`. use std::time::Duration; use clap::{clap_app, Arg}; use fut...
// Copyright (c) 2017-present PyO3 Project and Contributors //! Exception types defined by Python. use crate::{ffi, PyResult, Python}; use std::ffi::CStr; use std::ops; use std::os::raw::c_char; /// The boilerplate to convert between a Rust type and a Python exception. #[macro_export] macro_rules! impl_exception_boi...
// Unless explicitly stated otherwise all files in this repository are licensed under the // MIT/Apache-2.0 License, at your convenience // // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2020 Datadog, Inc. // use nix::poll::PollFlags; use std::cell::RefCell; use std::coll...
use crate::{ comms::playercomm::{PlayerComm, PlayerMessage}, component::{ action::Action, effect::{Effect, EffectType}, }, engine::{ bomb::{BombRange, BombTime}, position::{MapPosition, PixelPositionF64, PositionOffset}, world::World, }, error::{ZError, ZR...
//! SAM/BAM header. use std::io::{Write, Read, Result, Error}; use std::io::ErrorKind::InvalidData; use std::string::String; use std::collections::{hash_map, HashMap}; use byteorder::{ReadBytesExt, WriteBytesExt, LittleEndian}; pub type TagName = [u8; 2]; /// A single tag in a line. #[derive(Clone, Debug)] pub stru...
// * This file is part of the uutils coreutils package. // * // * For the full copyright and license information, please view the LICENSE // * file that was distributed with this source code. // spell-checker:ignore (vars) zlines use clap::{crate_version, App, Arg}; use std::convert::TryFrom; use std::ffi::OsStri...
// This file is part of Substrate. // Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // ht...
use admin_controlled::Mask; use borsh::{BorshDeserialize, BorshSerialize}; use eth_types::*; use near_sdk::collections::UnorderedMap; use near_sdk::AccountId; use near_sdk::{env, near_bindgen, PanicOnDefault}; near_sdk::setup_alloc!(); #[cfg(not(target_arch = "wasm32"))] #[cfg(test)] mod tests; #[derive(Default, Deb...
use glow::*; use smallvec::SmallVec; use spine::{ self as spine, animation::{AnimationState, AnimationStateData, TrackIndex}, atlas::Atlas, enums::BlendMode, skeleton::{Skeleton, SkeletonData}, }; use std::{path::PathBuf, time::Instant}; #[repr(C)] struct Vertex { position: [f32; 2], uv: [f...
use std::collections::{BTreeMap, HashMap}; use super::super::utils::{convert_timestamp, http_get}; use crypto_market_type::MarketType; use crypto_msg_type::MessageType; use crate::{Order, OrderBookMsg, TradeMsg, TradeSide}; use once_cell::sync::Lazy; use serde::{Deserialize, Serialize}; use serde_json::Value; use si...
//! A syn parser for `macro_rules!`. //! //!> MacroRulesDefinition : //!> macro_rules ! IDENTIFIER MacroRulesDef //!> MacroRulesDef : //!> ( MacroRules ) ; //!> , \[ MacroRules \] ; //!> , { MacroRules } //!> MacroRules : //!> MacroRule ( ; MacroRule )\* ;\? //!> MacroRule :...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - LEDC_LSCH0_CONF0."] pub lsch0_conf0: crate::Reg<lsch0_conf0::LSCH0_CONF0_SPEC>, #[doc = "0x04 - LEDC_LSCH0_HPOINT."] pub lsch0_hpoint: crate::Reg<lsch0_hpoint::LSCH0_HPOINT_SPEC>, #[doc = "0x08 - LEDC_LSCH0_DUTY."] ...
use std::{ convert::TryFrom, fmt, fs::OpenOptions, io::{ErrorKind, Read, Write}, net::IpAddr, os::unix::io::AsRawFd, path::Path, str::FromStr, }; use error::{ConnectError, DiscoveryError, FileIoError, NvmeError}; use nix::libc::ioctl as nix_ioctl; use num_traits::FromPrimitive; use snaf...
use std::{ array::TryFromSliceError, collections::HashMap, fmt::{Debug, Display}, ops::RangeBounds, }; use byteorder::{BigEndian, ByteOrder, ReadBytesExt, WriteBytesExt}; use super::{ btree::BTreeEntry, by_id::{ByIdStats, VersionedByIdIndex}, by_sequence::{BySequenceIndex, BySequenceStats}...
//! Thread-safe, shared (asynchronous) stream buffer designed to lock only on accessing and storing new data. //! //! Streamcatcher is designed to allow seeking on otherwise one-way streams (*e.g.*, command output) //! whose output needs to be accessed by many threads without constant reallocations, //! contention over...
#![cfg(feature = "rpi")] #![allow(dead_code)] mod debounce; mod pull; use std::sync::{mpsc, Mutex, Arc, atomic::{AtomicBool, Ordering}}; use std::time::{Instant, Duration}; use std::thread; use std::rc::Rc; use log::{info, warn}; use rppal::gpio::*; use crate::config::*; use crate::phone::*; use debounce::*; use pull...
use crate::{ CubicCurve, InnerProductSpace, LinearCurve, Scalar, roots::solve_cubic, }; pub struct QuadraticCurve<T: InnerProductSpace> { x0: T, x1: T, x2: T, } impl<T: InnerProductSpace> QuadraticCurve<T> { pub fn new(x0: T, x1: T, x2: T) -> QuadraticCurve<T> { QuadraticCu...
use async_trait::async_trait; use futures::TryFutureExt; use interledger_errors::BalanceStoreError; use interledger_packet::{ErrorCode, RejectBuilder}; use interledger_service::*; use interledger_settlement::core::{ types::{SettlementAccount, SettlementStore}, SettlementClient, }; use std::marker::PhantomData; ...
//! Principal ID encoding and decoding, with integrity checking use crate::mem_utils::memcpy_bytes; use crate::memory::{alloc_blob, Memory}; use crate::rts_trap_with; use crate::text::{blob_compare, blob_of_text}; use crate::types::{Bytes, Value, TAG_BLOB}; use motoko_rts_macros::ic_mem_fn; // CRC32 for blobs. Loose...
//! This crate contains the metric abstraction for IOx //! //! # Background //! //! Prior to this crate, IOx used a custom shim on top of OpenTelemetry. Over time, however, this //! shim grew as bugs and limitations were worked around, resulting in an incredibly complex crate //! with questionable performance, an incon...
// Copyright <NAME>, Inc. and contributors. All rights reserved. // // Use of this software is governed by the Business Source License // included in the LICENSE file. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by the A...
extern crate meval; use gtk; use gtk::prelude::*; pub fn launch () { gtk::init().unwrap_or_else( |_| panic!("Não iniciou gtk!")); let builder = gtk::Builder::new_from_string(include_str!("po2.glade")); let tabeladata :gtk::ListStore = builder.get_object("TabelaData").unwrap(); ...
use crate::{package::{self, Identifiable}, tls::{ctl_gateway::Error as CtlGatewayTls, rustls_wrapper::Error as RustlsReaderError}}; use std::{env, error, ffi, fmt, io, num, num::ParseIntError, resul...
// Copyright 2020, The Tari Project // // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the // following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following // disclai...
use futures::prelude::*; use futures::*; use futures::stream::*; use futures::sink::*; use futures::sync::mpsc; use futures_cpupool::CpuPool; use std::{self, fmt, io}; use std::collections::HashMap; use std::clone::Clone; use std::ops::Deref; use std::sync::{Arc, Mutex}; use super::{codec, user}; use super::messages::M...
use std::env; use std::fs::File; use std::io; use std::path::{Path, PathBuf}; use tempfile::Builder as TempFileBuilder; use rustc::session::config::{self, CrateType, DebugInfo, RUST_CGU_EXT}; use rustc::session::search_paths::PathKind; use rustc::session::Session; use rustc_codegen_ssa::back::command::Command; use ru...
//! Glue for the Xterm.js types. use super::xterm::{Disposable, Terminal, TerminalAddon, TerminalOptions}; use wasm_bindgen::convert::{FromWasmAbi, IntoWasmAbi}; use wasm_bindgen::JsCast; // The `object` macro and the `IntoJsInterface` trait are good candidates for // being spun off into their own crate, along with ...
// Check requirements and presence of reference, index files and index_dir // Make gemBS reference if required // Make asset list for refererences, indices and other associated files use crate::common::defs::{Section, Metadata, DataValue, Command}; use crate::config::GemBS; use crate::common::utils::Pipeline; use crat...
//! This module contains an `EvaluationDomain` abstraction for //! performing various kinds of polynomial arithmetic on top of //! the scalar field. //! //! In pairing-based SNARKs like GM17, we need to calculate //! a quotient polynomial over a target polynomial with roots //! at distinct points associated with each c...
use crate::{Keyboard, Mouse}; use std::ptr; use std::sync::atomic::{AtomicPtr, Ordering}; use std::sync::{Arc, Mutex, MutexGuard}; use std::time::Duration; use uinput::event::keyboard::Key; use uinput::event::Code; use x11::xlib; enum KeybdAction { Press, Release, Click, } pub(crate) mod kimpl { use c...
use{ crate::{*, wang_landau::WangLandauMode}, rand::Rng, std::{marker::PhantomData, mem::*, num::*, sync::*} }; #[cfg(feature = "sweep_time_optimization")] use std::time::*; #[cfg(feature = "serde_support")] use serde::{Serialize, Deserialize}; #[derive(Debug, Clone, Copy)] #[cfg_attr(feature = "serde_su...
//! @brief Solana Rust-based BPF program utility functions and types extern crate heapless; use self::heapless::consts::*; use self::heapless::String; // fixed capacity `std::Vec` // type level integer used to specify capacity #[cfg(test)] use self::tests::process; use core::mem::size_of; use core::slice::from_raw_pa...
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // // Portions Copyright 2017 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 THIRD-PARTY file. use std::mem; use vm_...
use std::collections::HashMap; use libeir_diagnostics::{Diagnostic, Label, SourceSpan, ToDiagnostic}; use libeir_intern::Ident; use libeir_util_datastructures::hashmap_stack::HashMapStack; use libeir_util_number::ToPrimitive; use libeir_util_parse::ErrorReceiver; use snafu::Snafu; use crate::text::ast; use crate::{B...
//! Code generation for a [`hyper`](https://hyper.rs)-based server that exposes humblespec `service`s. //! //! The entrypoint to this module is the `generate_services` function. //! It generates: //! //! - a `pub struct Builder` that users of the generated code use to instantiate an HTTP server, //! - a `pub trait $Ser...
//! Multivariate normal distribution using [nalgebra](https://nalgebra.org). //! //! # Example of usage //! //! ``` //! use nalgebra::{ Vector2, Matrix2, OMatrix, U2, U3}; //! use nalgebra_mvn::MultivariateNormal; //! //! // specify mean and covariance of our multi-variate normal //! let mu = Vector2::from_row_slice(&[...
//! Color palettes and options for flame graph generation. mod palette_map; mod palettes; use std::borrow::Cow; use std::fmt; use std::str::FromStr; use rgb::RGB8; pub use self::palette_map::PaletteMap; /// A re-export of `RGB8` from the [`rgb` crate](https://docs.rs/rgb). pub type Color = RGB8; pub(super) const ...
use proc_macro2::{Span, TokenStream}; use quote::{format_ident, quote, ToTokens}; use syn::parse::{Parse, ParseStream}; use syn::punctuated::Punctuated; use syn::{Error, Result}; mod tests; #[proc_macro_derive(Xylem, attributes(xylem))] pub fn xylem(ts: proc_macro::TokenStream) -> proc_macro::TokenStream { match ...
#![warn(missing_docs)] /*! Generates a parser at compile-time for handling commands similar in structure to those of Minecraft. Using a custom-designed syntax, one can efficiently specify the format of a number of commands within our [`module`](crate::module) macro. This crate is the standalone command handler for [Q...
/// This work is a port of Sensirion VOC indexing algorithm from /// https://github.com/Sensirion/embedded-sgp/tree/master/sgp40_voc_index /* * Copyright (c) 2020, Sensirion AG * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that...
//! Module for the dynamic state of the game. //! //! This module defines the `State` type and its entourage. The data needed to //! run an RBattle game is split into three categories: //! //! - `State` holds all the significant varying state of a game. What changes as the game proceeds //! are the amount of goop in ...
use std::usize; pub fn dijkstra(start: u16, goal: u16) -> Result<(Vec<u16>, usize), String> { if start == goal { return Err("input start and goal is same point.".into()); } let virtual_infinity = 9999; let size = 1000; let mut via: Vec<i32> = vec![-1; size]; let mut cost: Vec<u16> = vec![virtual_infinity; siz...
use std::io::{BufReader, Read}; #[derive(Debug, Copy, Clone)] pub enum Instruction { AALoad, AAStore, AConstNull, ALoad(u8), ALoad0, ALoad1, ALoad2, ALoad3, ANewArray(u16), AReturn, ArrayLength, AStore(u8), AStore0, AStore1, AStore2, AStore3, AThrow, ...
//! High level safe bindings to the NVVM compiler (libnvvm) for writing CUDA GPU kernels with a subset of LLVM IR. use std::{ ffi::{CStr, CString}, fmt::Display, mem::MaybeUninit, ptr::null_mut, str::FromStr, }; #[allow(warnings, clippy::warnings)] pub mod sys; /// Get the major and minor NVVM IR...
#![allow(incomplete_features)]#![feature(format_args_capture,default_free_fn,if_let_guard)] use {std::default::default, iter::{list, map}, ast::*, ::spirv::{*, Decoration::*, BuiltIn}, ::rspirv::dr::{self as rspirv, *, Operand::IdRef}}; type Type= Word; type Value = Word; //use num_traits::cast::ToPrimitive; type R32 ...
use super::*; use rand::distributions::WeightedIndex; use std::collections::VecDeque; use std::thread; use std::sync::mpsc; use std::sync::{Mutex, Arc}; use std::time::Instant; use std::cmp; use std::collections::HashMap; use std::cmp::Ordering; extern crate savefile; const KOMI: i32 = 5; const BOARD_SIZE: BoardSize...