text
stringlengths
7.05k
33.9k
use rand::Rng; use std::sync::Arc; use crate::pairing::{ Engine, Wnaf, CurveProjective, CurveAffine }; use crate::pairing::ff::{ PrimeField, Field }; use super::{ Parameters, VerifyingKey }; use crate::{ SynthesisError, Circuit, ConstraintSystem, LinearCombinatio...
// Copyright 2017 Parity Technologies (UK) Ltd. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, mer...
// //! Copyright 2020 Alibaba Group Holding Limited. //! //! 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 appl...
use crate::{ information_element::{Header, InformationElement, SbdHeader}, mo::LocationInformation, Result, }; #[cfg(feature = "serde-derive")] use serde::{Deserialize, Serialize}; use std::{ fmt, io::{Read, Write}, path::Path, }; const PROTOCOL_REVISION_NUMBER: u8 = 1; /// A Iridium SBD messa...
//! Draw random samples from a chosen probability distribution. // std use std::f32::consts::PI; use std::sync::Arc; // pbrt use crate::core::geometry::{Point2f, Vector2f, Vector3f, XYEnum}; use crate::core::pbrt::clamp_t; use crate::core::pbrt::Float; use crate::core::pbrt::{INV_2_PI, INV_4_PI, INV_PI, PI_OVER_2, PI_...
mod gradient; mod pico_svg; mod render_ctx; pub mod test_scenes; mod text; use std::convert::TryInto; pub use render_ctx::PietGpuRenderContext; use rand::{Rng, RngCore}; use piet::kurbo::{BezPath, Circle, Point, Rect, Shape, Vec2}; use piet::{ Color, FixedGradient, FixedLinearGradient, GradientStop, ImageFormat...
use crate::config::Config; use crate::cpp_checks::CppChecksItem; use crate::cpp_code_generator::{all_include_directives, write_include_directives}; use crate::cpp_data::{CppItem, CppPath}; use crate::cpp_ffi_data::CppFfiItem; use crate::cpp_type::CppType; use crate::database::{DatabaseClient, DbItem, ItemId}; use crate...
/// @copyright /// Copyright (C) 2020 Assured Information Security, Inc. /// /// @copyright /// 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 limita...
#![windows_subsystem = "windows"] mod states; mod steps; mod streams; mod styles; mod widgets; use { iced::{ button, executor, image::Handle, window, Application, Column, Command, Container, Element, Length, Row, Settings, Space, Subscription, Text, }, iced_native::subscription, image:...
use std::borrow::Cow; use std::collections::HashMap; use console::{measure_text_width, Style}; use regex::{Captures, Regex}; #[cfg(feature = "improved_unicode")] use unicode_segmentation::UnicodeSegmentation; use crate::format::{BinaryBytes, DecimalBytes, FormattedDuration, HumanBytes, HumanDuration}; use crate::stat...
///! This module contains constants for 64-bit architectures used by the term ///! implementation. ///! ///! Currently, both 32-bit and 64-bit architectures rely on a minimum of 8 byte ///! alignment for all terms, as this provides 3 bits for a primary tag in the low ///! end of the pointer/integer value. This is the n...
// Puberty Simulator: the next generation in voice change simulation technology // Copyright (C) 2022 <NAME> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License...
//! Provides low-level access to RocksDB using some database-specific types. //! //! This module makes sure that: //! - all disk writes happen inside a RocksDB transaction ([`WriteBatch`]), and //! - format-specific invariants are maintained. //! //! # Correctness //! //! The [`crate::constants::DATABASE_FORMAT_VERSION...
use crate::internal::unordered_load3; use crate::internal::{Filled, HashPacket, PACKET_SIZE}; use crate::key::Key; use crate::traits::HighwayHash; use crate::v2x64u::V2x64U; use core::arch::x86_64::*; /// SSE empowered implementation that will only work on `x86_64` with sse 4.1 enabled at the CPU /// level. #[derive(D...
//! Simple process pool to help implementing [crate::manager::Manager]. //! //! This module provides a simple wrapper around `std::process` //! to launch a number of processes and multiplex their outputs //! into a single channel. //! //! A good place to start is the [process_pool_with_pipeline] function, //! which is ...
use super::error::Error; #[cfg(feature = "userio")] use super::io::UserIO; use log::*; use models::*; use num_bigint::BigUint; use rand::{thread_rng, Rng}; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::time::SystemTime; pub mod models { use serde::{Deserialize, Serialize}; use st...
//! //! # SPSC # //! //! Single producer, single consumer, async-compatible ring buffer / queue / channel use bitflags::bitflags; use futures::task::AtomicWaker; use std::{ future::Future, marker::PhantomData, mem::MaybeUninit, ops::{Deref, DerefMut}, pin::Pin, sync::{ atomic::{AtomicU8...
/// Actix WebSocket and HTTP server use crate::global_context::GlobalContext; use crate::session::Session; use actix::{Actor, Addr, AsyncContext, Handler, StreamHandler}; use actix_cors::Cors; use actix_http::ws::Codec; use actix_web::http::header; use actix_web::middleware::{Compress, Logger}; use actix_web::web::{Byt...
/*! Transmission handles the transmission of events to Honeycomb */ use std::collections::HashMap; use std::sync::Arc; use std::time::{Duration, Instant}; use tokio::sync::mpsc::{channel as bounded, Receiver as ChannelReceiver, Sender as ChannelSender}; use log::{debug, error, info, trace}; use reqwest::{header, Sta...
use futures::future::{loop_fn, Loop}; use futures::sync::mpsc::{channel, Receiver, Sender}; use std::collections::HashMap; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::RwLock; use std::time::Duration; use uuid::Uuid; use graph::data::subgraph::schema::{ DynamicEthereumContractDataSourceEntity, Sub...
use crate::WSClient; use std::collections::HashMap; use std::sync::{Arc, Mutex}; use log::*; use serde_json::Value; use tungstenite::Message; use super::ws_client_internal::{MiscMessage, WSClientInternal}; use super::{Candlestick, OrderBook, OrderBookSnapshot, Ticker, Trade, BBO}; pub(super) const EXCHANGE_NAME: &st...
use bitcoincash::blockdata::transaction::Transaction; use bitcoincash::consensus::encode::serialize; use bitcoincash::hash_types::{BlockHash, TxMerkleNode, Txid}; use bitcoincash::hashes::hex::ToHex; use bitcoincash::hashes::sha256d::Hash as Sha256dHash; use bitcoincash::hashes::Hash; use bitcoincash::network::constant...
// RGB standard library // Written in 2020 by // Dr. <NAME> <<EMAIL>> // // To the extent possible under law, the author(s) have dedicated all // copyright and related and neighboring rights to this software to // the public domain worldwide. This software is distributed without // any warranty. // // You should ha...
// Copyright 2020-2021 <NAME> // SPDX-License-Identifier: Apache-2.0 use super::{ command::{Command, CommandReceiver, CommandSender}, error::Error, event::{Event, EventSender, InternalEvent, InternalEventReceiver, InternalEventSender}, }; use crate::{ alias, init::global::{self, reconnect_interval...
use crate::crh::MMRTwoToOneCRHSchemeGadget; use crate::mmr::{Config, IdentityDigestConverter, VecDeque, get_peaks, take_while_vec, pos_height_in_tree, parent_offset, sibling_offset}; use crate::{CRHSchemeGadget, MMRPath}; use crate::mmr::error::{Result as MMRResult, Error as MMRError}; use ark_ff::Field; use ark_...
/* * Copyright (C) 2020 <NAME> (<EMAIL>) */ use std::any::Any; use std::ops::Deref; use std::collections::{ HashMap, LinkedList }; use std::mem::take; use std::time::Duration; use crate::module::*; use crate::config::{ CommandContext, CommandContextType }; use crate::error::{ *, Code::* }; use crate::keyval::*; use...
// Copyright (c) 2018-2020 <NAME> <<EMAIL>> // Distributed under the MIT License // (See acoompanying LICENSE file or a copy at http://opensource.org/licenses/MIT) use std::{convert::TryFrom, error::Error, fmt::Display}; use serde::{Deserialize, Serialize}; use crate::utils::normalize; /// Condiciones de contorno d...
/// What we are drawing on. use std::ops; use std::convert::TryInto; use kurbo::{ BezPath, PathEl, ParamCurve, ParamCurveArclen, PathSeg, Point, Rect, TranslateScale, Vec2 }; use crate::import::eval::SymbolSet; use crate::features::path::{CANVAS_ACCURACY, SegTime}; //------------ Configurable Constants ------...
use std::cell::RefCell; use anyhow::Result; use unsafe_unwrap::UnsafeUnwrap; use crate::algorithms::determinize::determinize_with_distance; use crate::algorithms::queues::AutoQueue; use crate::algorithms::tr_filters::AnyTrFilter; use crate::algorithms::{ connect, reverse, shortest_distance_with_config, Queue, Sho...
// Copyright (c) <NAME> // // Permission is hereby granted, free of charge, to any // person obtaining a copy of this software and associated // documentation files (the "Software"), to deal in the // Software without restriction, including without // limitation the rights to use, copy, modify, merge, // publish, distr...
//! Victron VE-Direct interface use anyhow::Result; use bytes::{Buf, BytesMut}; use serial_io::{build, AsyncSerial}; use std::num::Wrapping; use std::str; use tokio_stream::StreamExt; use tokio_util::codec::{Decoder, FramedRead}; use tokio::time::{sleep, Duration}; use std::sync::{Arc, Mutex}; use serde::Serialize; use...
use crate::cpu::decode::Instructions::*; use std::fmt::{Debug, Formatter}; use crate::cpu::REG_NAMES; use std::convert::TryFrom; use strum::IntoEnumIterator; use strum_macros::EnumIter; pub enum Instructions { Add{rd: usize, rs1: usize, rs2: usize}, Addw{rd: usize, rs1: usize, rs2: usize}, Addi{rd: usize, ...
use crate as sylt_std; use std::cell::RefCell; use std::collections::HashMap; use std::collections::hash_map::Entry; use std::io::Write; use std::net::{Shutdown, SocketAddr, TcpListener, TcpStream}; use std::ops::DerefMut; use std::rc::Rc; use std::str::FromStr; use std::sync::{Arc, Mutex}; use std::thread; use sylt_c...
//! Aardwolf analysis driver. use std::cmp::Ordering; use std::collections::{BTreeMap, HashMap}; use std::env; use std::fmt; use std::fs::{self, File}; use std::io::{self, BufReader, Write}; use std::path::{Path, PathBuf}; use std::process::{self, Command}; use crate::api::Api; use crate::config::{Config, LoadConfigE...
pub struct Matrix { value: [f32; 16], } #[allow(dead_code)] impl Matrix { pub fn new() -> Self { Self { value: [ 1., 0., 0., 0., 0., 1., 0., 0., 0., 0., 1., 0., 0., 0., 0., 1., ] as [f32; 16], } } ...
use wasc::aot_generator; use wasc::code_builder; use wasc::compile; use wasc::context; use wasc::gcc; mod misc; fn test_single_test<P: AsRef<std::path::Path>>( wasm_path: P, commands: Vec<serde_json::Value>, ) -> Result<(), Box<dyn std::error::Error>> { let mut config = wasc::context::Config::default(); ...
use crate::backend::crosscurses::constants; use crate::{ backend::{ crosscurses::{current_style::CurrentStyle, mapping::find_closest}, Backend, }, error, Action, Attribute, Clear, Color, Event, KeyCode, KeyEvent, KeyModifiers, MouseButton, Retrieved, Value, }; use crosscurses::{ToChtype,...
use crate::sim2::timeline::Timeline; use crate::sim2::attack::CharacterAttack; use crate::sim2::record::{CharacterRecord}; pub mod pyro; pub mod hydro; pub mod electro; pub mod cryo; pub mod anemo; pub mod geo; pub mod version_1_1; pub mod version_1_2; pub mod version_1_3; pub mod version_1_4; pub mod version_1_5; pub...
// // Sysinfo // // Copyright (c) 2021 <NAME> // use std::ffi::CStr; use std::mem::{self, MaybeUninit}; use std::ops::Deref; use std::path::{Path, PathBuf}; use std::borrow::Borrow; use libc::{c_int, c_void, gid_t, kill, size_t, uid_t}; use crate::{DiskUsage, Pid, ProcessExt, ProcessStatus, Signal}; use crate::sys...
use std::cell::RefCell; use lyon_geom::math::F64Point; use lyon_geom::{CubicBezierSegment, QuadraticBezierSegment}; use geom::{Angle, ArrowCap, Circle, Distance, InfiniteLine, Line, PolyLine, Polygon, Pt2D}; use map_model::{BufferType, Direction, DrivingSide, Lane, LaneID, LaneType, Map, Road, TurnID}; use widgetry::...
// Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 use crate::{ executor_proxy::ExecutorProxyTrait, tests::mock_storage::MockStorage, PeerId, StateSyncClient, StateSynchronizer, SynchronizerState, }; use anyhow::{bail, Result}; use config_builder; use executor::ExecutedTrees; u...
use anyhow::{format_err, Result}; use io::Error as IoError; use thiserror::Error; use rustfmt_nightly as rustfmt; use std::collections::HashMap; use std::env; use std::fs::File; use std::io::{self, stdout, Read, Write}; use std::path::{Path, PathBuf}; use std::str::FromStr; use getopts::{Matches, Options}; use cra...
// Copyright 2017-2019 Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) a...
extern crate ncurses; use self::ncurses::mmask_t; use self::super::{find_closest, split_i32}; use backend; use event::{Event, Key, MouseButton, MouseEvent}; use std::cell::{Cell, RefCell}; use std::collections::HashMap; use std::io::{stdout, Write}; use theme::{Color, ColorPair, Effect}; use utf8; use vec::Vec2; pub ...
// Copyright 2019 The Grin Developers // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agree...
#![cfg(any( target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd", target_os = "openbsd" ))] mod dnd; mod event_processor; mod events; pub mod ffi; mod ime; mod monitor; pub mod util; mod window; mod xdisplay; pub use self::{ monitor::{MonitorHandle, VideoMo...
// Copyright 2019-2020 <NAME> // Dual licensed under the Apache 2.0 and MIT licenses. use core::convert::TryFrom; use stm32ral::usb; use stm32ral::{read_reg, write_reg}; use super::{USBStackRequest, Endpoint, stat_stall, stat_nak, stat_valid}; use super::packets::{*, ToBytes}; use super::buffers::*; use super::descr...
#![allow(non_snake_case)] use crate::request::Request; use crate::streamcheckerror::StreamCheckError; use playlist_decoder; use url::Url; use hls_m3u8::MasterPlaylist; use crate::streamdeepscan; use log::{debug}; #[derive(Debug,Serialize,Clone)] pub struct StreamInfo { pub Server: Option<String>, pub Public...
use std::collections::hash_map::{Entry, HashMap, Keys}; use std::convert::AsRef; use std::slice; use std::u32; use crate::error::Result; use crate::protocol; #[derive(Debug)] pub struct ClientState { // ~ the last correlation used when communicating with kafka // (see `#next_correlation_id`) correlation: ...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - UHCI configuration register"] pub conf0: crate::Reg<conf0::CONF0_SPEC>, #[doc = "0x04 - Raw interrupt status"] pub int_raw: crate::Reg<int_raw::INT_RAW_SPEC>, #[doc = "0x08 - Masked interrupt status"] pub int_st: cr...
// 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 depgraph::reader::{Dep, DepGraph, DepGraphOpener}; use ocamlrep::{FromError, FromOcamlRep, Value}; use ocamlrep_custom::{caml_serial...
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
//! Traits and structs for `#[pyclass]`. use crate::class::methods::{PyMethodDefType, PyMethodsProtocol}; use crate::conversion::{AsPyPointer, FromPyPointer, ToPyObject}; use crate::pyclass_init::PyClassInitializer; use crate::pyclass_slots::{PyClassDict, PyClassWeakRef}; use crate::type_object::{type_flags, PyObjectLa...
#![cfg_attr(not(feature = "std"), no_std)] #[cfg(feature = "camo")] pub use camo::*; use core::fmt; /// Zero-width characters pub const CHARS: [char; 6] = [ '\u{200C}', '\u{200D}', '\u{2060}', '\u{2062}', '\u{2063}', '\u{2064}', ]; const CHAR0: char = CHARS[0]; const CHAR1: char = CHARS[1]; const CHAR2: char = ...
use actix_service::{Service, ServiceFactory}; use actix_web::{ dev::{AppService, HttpServiceFactory, ResourceDef, ServiceRequest, ServiceResponse}, error::Error, http::{header, Method, StatusCode}, HttpMessage, HttpRequest, HttpResponse, ResponseError, }; use failure::Fail; use futures::future::{ok, Fut...
//! The workflow and queue consumer for sys validation use std::convert::TryInto; use std::sync::Arc; use super::error::WorkflowResult; use super::sys_validation_workflow::validation_query; use crate::conductor::ConductorHandle; use crate::core::queue_consumer::TriggerSender; use crate::core::queue_consumer::WorkComp...
extern crate sdl2; extern crate street_code_fighter; use crate::street_code_fighter::*; use sdl2::image::{self, LoadTexture}; // InitFlag, use sdl2::render::{WindowCanvas, Texture, TextureCreator}; use sdl2::rect::{Point, Rect}; use sdl2::pixels::Color; // use std::fs; use sdl2::event::Event; use sdl2::keybo...
//! # Organize sequencing batches and other bulk data //! Functions and methods to handle folders of raw sequencing data, right off the sequencer. use chrono::Local; use indoc::indoc; use regex::Regex; use std::collections::HashMap; use std::fmt; use std::fs::{create_dir, rename, File}; use std::io::prelude::*; use st...
/* Copyright (C) 2018-2019 <EMAIL> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, su...
use crate::collect_points::ResultCollector; use anyhow::{anyhow, Result}; use byteorder::{LittleEndian, ReadBytesExt}; use memmap::MmapOptions; use pasture_core::{ containers::{ PerAttributePointBufferExt, PerAttributeVecPointStorage, PointBufferExt, PointBufferWriteable, }, layout::{attribu...
#![allow(clippy::from_over_into)] use std::{ collections::BTreeMap, env, path::{Path, PathBuf}, str::from_utf8, time, }; use acme_lib::{create_p384_key, persist::FilePersist, Directory, DirectoryUrl}; use anyhow::Result; use async_bb8_diesel::AsyncRunQueryDsl; use async_trait::async_trait; use chro...
use crate::{ chart::{ChartImpl, DrawChartOptions, DrawChartOutput, DrawOverlayOptions, HoverRegion}, common::{ compute_rects, draw_rounded_rect, draw_x_axis, draw_x_axis_title, draw_y_axis_grid_lines, draw_y_axis_labels, draw_y_axis_title, ComputeRectsOptions, ComputeRectsOutput, DrawRoundedRectOptions, DrawXAx...
// Copyright (c) 2020 E.S.R.Labs. All rights reserved. // // NOTICE: All information contained herein is, and remains // the property of E.S.R.Labs and its suppliers, if any. // The intellectual and technical concepts contained herein are // proprietary to E.S.R.Labs and its suppliers and may be covered // by German a...
//! Worker Manager only stores tasks and is not going to scheduling. //! If worker manager checks itself is free, it will start the steal thread //! that steals the task from another server in FastJob Cluster. However, //! if don't have enough space that will reject task request and respond a full error message. //! so...
extern crate lru_time_cache; extern crate pnet; extern crate pnet_macros_support; use self::backend::{health_checker, ServerPool}; use self::lb::LB; use self::utils::find_interface; use crate::config::{BaseConfig, Config}; use crate::stats::StatsMssg; use pnet::datalink::Channel::Ethernet; use pnet::datalink::{linux,...
use crate::ast::{CombineOp, Comp}; use crate::types::{Item, KindTest, Occurrence, SequenceType}; use crate::xpath_functions_31::{ boolean_compare, decimal_compare, double_compare, integer_compare, string_compare, }; use crate::StaticContext; use itertools::Itertools; use num_traits::cast::FromPrimitive; use rust_de...
/// 2 Level of randomly chosen hard derivation indexes Wallet /// use std::{ops::Deref, iter}; use cbor_event; use cryptoxide; use cryptoxide::digest::{Digest}; use bip::bip39; use hdwallet::{self, XPrv, XPub, DerivationScheme}; use hdpayload; use fee::{self, FeeAlgorithm}; use coin::{self, Coin}; use txutils::{self, ...
use crate::components::light::LightType; use crate::managers::resource::mesh::{Primitive, PrimitiveAttribute}; use crate::managers::resource::texture::{Texture, TextureUnit}; use crate::managers::{details_ui::DetailsUI, resource::shaders::*}; use crate::utils::gl::GL; use egui::Ui; use na::Matrix4; use std::collections...
use std::cmp::Ordering; use std::collections::{HashMap, HashSet}; use crate::{chunk_location_map::ChunkLocationMap, chunk_location_map::OffsetSize, HashSum}; /// Represents a single chunk re-ordering operation. #[derive(Debug, Clone, PartialEq)] pub enum ReorderOp<'a> { /// The `Copy` operation says we should cop...
//! Utilities used for serializing/deserializing sequencer REST API related data. use crate::core::{ CallParam, CallSignatureElem, ConstructorParam, EthereumAddress, EventData, EventKey, L1ToL2MessagePayloadElem, L2ToL1MessagePayloadElem, TransactionSignatureElem, }; use num_bigint::BigUint; use pedersen::{Hex...
// Copyright 2019-2020 PolkaX. Licensed under MIT or Apache-2.0. use std::fs; use cid::{Cid, Codec, IntoExt}; use either::Either; use maplit::btreemap; use multihash::Code; use block_format::{BasicBlock, Block}; use ipld_core::{IpldNode, IpldValue}; use ipld_format::{Node, Resolver}; #[test] fn test_non_object() { ...
use std::ops::Add; use std::str::from_utf8; use std::time::{Duration, Instant}; use time::OffsetDateTime; use log::{error, info}; use mio_extras::timer::Timeout; use crossbeam_channel::unbounded; use ws::util::Token; use ws::{CloseCode, Error, ErrorKind, Frame, Handler, Handshake, Message, OpCode, Result, Sender}; ...
//! //! COM library parse model. //! //! Defines the items constructed from the various COM attributes. //! //! Should unify COM attribute expansion and crate parsing for IDL/Manifest/etc. //! purposes in the future. //! use super::*; use ::ast_converters::*; use ::builtin_model; use ::std::path::{Path, PathBuf}; use...
/////////////////////////////////////////////////////////////////////////////// // // Copyright 2018-2020 Airalab <<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 // // ...
use std::collections::BTreeMap; use std::fs::File; use std::future::Future; use std::io::prelude::*; use std::pin::Pin; use std::sync::{Arc, Mutex}; use std::sync::atomic::{self, AtomicUsize}; use std::{io, mem, task, thread}; use std::os::unix::io::AsRawFd; use crossbeam_channel::{Sender, Receiver}; use log::{debug,...
//! Main type for the game. `Game::new().run()` runs the game. extern crate parking_lot; extern crate log; extern crate crossbeam; extern crate serde; extern crate serde_json; use self::parking_lot::Mutex; use std::sync::Arc; use std::sync::atomic::Ordering; use std::thread; use std::time::{Instant, Duration}; use std...
//! NNTP command parsing. use std::collections::{HashMap, HashSet}; use std::str; use once_cell::sync::Lazy; use regex::Regex; use crate::util::Buffer; /// Capabilities. #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum Capb { Never = 0x00000, Always = 0x00001, Basic = 0...
use std::collections::HashSet; use std::error::Error; use std::fs::{self, File}; use std::io; use std::io::prelude::*; use std::path::{Path, PathBuf}; use std::rc::Rc; use cryptographic_message_syntax::{SignedData, SignerInfo}; use futures_util::StreamExt; use openssl::x509::X509; use openssl::hash::MessageDigest; use...
use crate::jwt; use crate::protocols::Protocol; use crate::rpc::{Error, Request, Response}; use crate::urls; use anyhow::{bail, Result}; use futures::{FutureExt, StreamExt}; use jwt::JwtError; use reqwest::StatusCode; use serde::Deserialize; use std::env; use std::str::FromStr; use warp::{Filter, Reply}; /// Serve JSO...
#![allow(unused_imports)] use actix::{Actor, ActorContext, AsyncContext, Handler, Message, Recipient, StreamHandler}; use actix_server::Server; use actix_service::{fn_service, ServiceFactoryExt as _}; use actix_web::web::BytesMut; use actix_web::{web, App, HttpRequest, HttpResponse, HttpServer}; use actix_web_actors::...
extern crate rand; pub use self::rand::distributions; use self::rand::distributions::IndependentSample; use self::rand::{thread_rng, Rng}; extern crate num; use self::num::{Num, Zero, One}; use self::num::traits::pow; use std::fmt; use std::cmp; use std::ops::{Add, Sub, Mul}; use std::collections::HashSet; use std::...
use core::ops::FnOnce; use std::{ alloc::{alloc, Layout}, cell::{Cell, RefCell, RefMut}, collections::HashMap, sync::{Mutex, RwLock}, thread, thread::ThreadId, }; use lazy_static; use wasmer::{Exports, Function, ImportObject, Memory, MemoryView, Val, WasmerEnv}; use crate::{ handler::*, ...
extern crate rltk; extern crate serde; extern crate specs; pub use components::*; use damage_system::DamageSystem; use gamelog::GameLog; use gui::MainMenuSelection; use inventory_system::{ItemCollectionSystem, ItemDropSystem, ItemRemoveSystem, ItemUseSystem}; pub use map::*; use map_indexing_system::MapIndexingSystem;...
/* * An emulator for the Chip8 interpreted programming language. Written in Rust and * compiled to WebAssembly! * * Hosted here: * * https://jarrodboone.info/Projects/Chip8 * * To get it running on your machine, you'd need to load the ROM into the Chip8's * memory through the get_memory() ptr. Then you'd n...
use std::{ cmp, mem, }; use crate::{ CapStone, BitGrid, geometry, identify::{ match_capstones::CapStoneGroup, }, Point, prepare::{ AreaFiller, ImageBuffer, PixelColor, ColoredRegion, Row, }, prepare::PreparedImage, version_...
/* * Copyright (C) 2015 <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 a...
use std::f32; use std::sync::atomic::Ordering; use anyhow::Result; use atomic::Atomic; use log::{info, warn}; use parking_lot::Mutex; use crate::bounds::{Bounds2f, Bounds2i}; use crate::filter::Filter; use crate::imageio; use crate::paramset::ParamSet; use crate::spectrum::Spectrum; use crate::{clamp, Point2f, Point2...
//! Parsing of RISC-V instructions. use super::{Instruction, Kind, Variant}; use crate::{cpu::XRegister, Base}; use std::collections::HashMap; use std::lazy::SyncLazy; macro_rules! kind_table { ($($key:expr => $kind:ident),*$(,)?) => { ::std::lazy::SyncLazy::new(|| { let mut map = ::std::colle...
#![cfg_attr(not(feature = "std"), no_std)] #![recursion_limit = "256"] extern crate alloc; pub mod opaque; #[cfg(feature = "std")] include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); use alloc::{boxed::Box, vec::Vec}; use frame_support::{ construct_runtime, parameter_types, traits::{ConstU128, ConstU16, Cons...
use crate::util::{bootnodes::bootnodes, ipinfo::lookup_ipinfo, multiaddr::addr_to_ip}; use ckb_testkit::connector::message::build_discovery_get_nodes; use ckb_testkit::{ ckb_types::{packed, prelude::*}, compress, connector::SharedState, decompress, Node, SupportProtocols, }; use p2p::{ builder::Meta...
// 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. //! Parsing and serialization of Ethernet frames. use std::ops::Range; use byteorder::{ByteOrder, NetworkEndian}; use zerocopy::{AsBytes, ByteSlice, From...
#[macro_use] extern crate conrod; extern crate find_folder; extern crate yaml_rust; extern crate toml; //for main loop use std::collections::{HashMap, BTreeMap}; use conrod::backend::piston::{OpenGL, window, WindowEvents}; use conrod::backend::piston::event::UpdateEvent; use conrod::{UiBuilder}; use std::path::PathBuf...
use icarus::color; use icarus::input::{InputState, KeyId}; use icarus::math::{Rect, Vec2}; use icarus::platform::{Config, Platform}; use icarus::rand::Rand; use icarus::vk_util::{self, RenderCommand, VkContext}; use std::collections::VecDeque; use std::mem; use std::time::Instant; // TODO: Encapsule AI agent logic in...
extern crate nalgebra_glm as glm; mod util; use glm::vec2; use plox::atlas::Atlas; use plox::font; use plox::gpu::{ circle::{CircleElement, CircleRenderer, CircleShader}, shader::Shader, text::{TextElement, TextRenderer, TextShader}, typeset::Typeset, Transform, }; use plox::line::{LineElement, Lin...
#![allow(non_snake_case)] use merlin::Transcript; use bytes::Bytes; use curve25519_dalek::ristretto::{CompressedRistretto, RistrettoPoint}; use curve25519_dalek::scalar::Scalar; use curve25519_dalek::traits::{MultiscalarMul, VartimeMultiscalarMul}; use core::iter; use serde::{Serialize, Deserialize}; use curve25519_dal...
use core::fmt; use core::marker::PhantomData; use core::ops::Deref; use core::ops::DerefMut; use core::pin::Pin; use core::ptr; use as_slice::{AsMutSlice, AsSlice}; use crate::dma; use crate::hal::prelude::*; use crate::hal::serial; use crate::pac; use crate::rcc::{BusClock, Enable, Reset}; use crate::state; use nb::...
//! The weldr command-line tool for LDraw format management. mod convert; mod error; mod gltf; #[cfg(test)] mod testutils; #[macro_use] extern crate log; extern crate atty; use convert::ConvertCommand; use error::Error; use ansi_term::Color::{Blue, Purple, Red, Yellow}; use log::{Metadata, Record}; use ordered_fl...
use crate::filter::Filterable; use actix_web::http::StatusCode; use async_trait::async_trait; use chrono::Local; use rand::Rng; use sar_types::MyFilter; use serde::{Deserialize, Serialize}; use std::borrow::BorrowMut; use std::collections::BTreeMap; use std::fmt::{Debug, Display, Formatter}; use std::io::BufWriter; use...
use crate::dataset::{DatasetRef, RankingDataset}; use crate::evaluators::SetEvaluator; use crate::model::{ModelEnum, TreeNode, WeightedEnsemble}; use crate::normalizers::FeatureStats; use crate::sampling::DatasetSampling; use crate::stats; use crate::Scored; use crate::{FeatureId, InstanceId}; use oorandom::Rand64; use...
// Copyright 2015-2016 <NAME>. // // Permission to use, copy, modify, and/or distribute this software for any // purpose with or without fee is hereby granted, provided that the above // copyright notice and this permission notice appear in all copies. // // THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL...