text
stringlengths
3.09k
13.9k
// Copyright 2019 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 // disclaim...
#[cfg(feature = "alloc")] use alloc::{ borrow::Cow, boxed::Box, collections::{btree_map::Entry::Vacant, BTreeMap}, vec, vec::Vec, }; #[cfg(not(feature = "alloc"))] use std::{ borrow::Cow, collections::{btree_map::Entry::Vacant, BTreeMap}, }; use serde::ser::Serialize; use serde_derive::{De...
use crate::rita_exit::database::ip_increment::increment; use crate::rita_exit::database::secs_since_unix_epoch; use crate::SETTING; use ::actix_web::Result; use althea_kernel_interface::ExitClient; use althea_types::ExitClientIdentity; use diesel; use diesel::dsl::{delete, exists}; use diesel::prelude::{ExpressionMetho...
use crate::syscall::files::File; use crate::syscall::{ create_task, get_child_return_value, get_pid, set_pipe_read_on_pid, yield_cpu, }; use crate::{euprintln, uprint, uprintln}; use alloc::string::String; use alloc::vec::Vec; #[derive(Debug)] enum ParseError { UnknownProgram(String), QuoteUnclosed, } type...
// 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 those terms. // // Simple Prometheus suppo...
// Copyright (c) SimpleStaking, Viable Systems and Tezedge Contributors // SPDX-License-Identifier: MIT use std::convert::TryFrom; use std::pin::Pin; use futures::task::{Context, Poll}; use futures::Stream; use serde::Serialize; use slog::{error, Logger}; use crypto::hash::{BlockHash, ProtocolHash}; use shell_integra...
// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>...
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MI...
// use crate::codec; #[cfg(feature = "bitintr")] use bitintr::{Bzhi, Popcnt}; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; use std::convert::From; use std::fmt; use std::iter::FromIterator; use std::iter::Iterator; pub type Label = u8; #[cfg(feature = "bitintr")] #[inline(always)] fn count_ones(n: u...
use crate::pack::{self, index}; use git_features::{ parallel, progress::{self, Progress}, }; use git_object::owned; mod indexed; mod lookup; mod reduce; pub(crate) use reduce::Reducer; mod error; pub use error::Error; mod types; pub use types::{Algorithm, Options, Outcome, SafetyCheck}; /// Verify and valid...
use crate::compound::State; use crate::powers::Powers; use crate::prefix::Prefix; use crate::rational::Rational; use serde::de; use serde::{Deserialize, Serialize}; use std::cmp; use std::fmt; use std::hash; /// A base unit. #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] pu...
use alloc::boxed::Box; use bitflags::bitflags; use crate::{NullSerialTransport, SerialTransport}; const N_BIT_CYCLES: u8 = 8; const CPU_CYCLES: u8 = (4194304 / 4 / 8192) as u8; const CPU_CYCLES_FAST: u8 = (4194304 / 4 / 262144) as u8; #[cfg(feature = "true_flag")] const FLAG2: &[u8; 39] = b"FLAG-{802936b9628adb0e9e6...
use async_trait::async_trait; use std::collections::VecDeque; use std::ops::AddAssign; use std::process::Stdio; use std::time::{Duration, SystemTime}; use tokio::io::{AsyncBufReadExt, BufReader}; use tokio::process; use tokio::sync::mpsc as channel; const COOLDOWN: u64 = 4; /// Create your own listener to capture eac...
use heck::*; use lazy_static::lazy_static; use serde::Deserialize; use crate::*; pub const DATA_STR: &str = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/declarations/Book.toml")); lazy_static! { pub static ref DATA: BookDeclarations = toml::from_str(DATA_STR).unwrap(); } #[derive(Deserialize, Debug)] #[serd...
use crate::compile::engine::provider::CubeContext; use crate::compile::rewrite::analysis::LogicalPlanAnalysis; use crate::compile::rewrite::rewriter::RewriteRules; use crate::compile::rewrite::LogicalPlanLanguage; use crate::compile::rewrite::OrderAsc; use crate::compile::rewrite::OrderMember; use crate::compile::rewri...
use std::sync::{Arc, RwLock}; use cgmath::{Vector3, Point3, Matrix4, Transform, InnerSpace, SquareMatrix, Vector2}; use std::sync::atomic::{AtomicBool, Ordering}; /// A camera is the lens through which your scene can be viewed. This tells covalent how to map the /// scene in 2D/3D space onto your screen, a 2D window. ...
use geom::{Angle, Circle, Distance, Duration, PolyLine, Pt2D, Time}; use crate::widgets::plots::{make_legend, Axis, PlotOptions, Series}; use crate::{ Color, Drawable, EventCtx, GeomBatch, GfxCtx, ScreenDims, ScreenPt, Text, TextExt, Widget, WidgetImpl, WidgetOutput, }; // The X is always time pub struct Scat...
use chrono::{Datelike, Duration, TimeZone, Timelike}; use chrono_tz::Europe::Zurich; use soup::{prelude::*, QueryBuilderExt, Soup}; #[path = "./creds.rs"] mod creds; /** * How this works: * This Webhook bot is split into 3 steps: * 1. Login into Nesa * 1.1 Getting the login hash required for the login * 1.2 Login...
use std::borrow::Cow; use rosu_pp::Mods; use rosu_v2::prelude::{Beatmap, Beatmapset, GameMode, GameMods, Score}; use crate::{ custom_client::OsuTrackerCountryScore, embeds::{calculate_ar, calculate_od}, util::CowUtils, }; use super::FilterCriteria; pub trait Searchable { fn matches(&self, criteria: ...
//! Representation of graphs of compile-time constant values. use std::cmp::Ordering; use enumset::{EnumSetType, EnumSet}; use enum_map::{Enum, EnumMap}; use std::iter::{FromIterator, once}; use rayon::iter::{ParallelIterator, FromParallelIterator, IntoParallelIterator}; /// Represents a directed graph with unlabeled...
//! This provides wrappers around the `StdoutTerminal` and `StderrTerminal` types //! that does not fail if `StdoutTerminal` etc can't be constructed, which happens //! if TERM isn't defined. use std::io; use std::ops::Deref; use std::sync::Mutex; use lazy_static::lazy_static; pub(crate) use term::color; pub(crate) u...
use gir_core::primitives::*; use gir_core::graph::*; use gir_core::backend::*; use function::*; use ocl::{Platform, Device, Context, Queue, Buffer}; use ocl::core::DeviceInfo; use ocl::flags::{MEM_ALLOC_HOST_PTR, MEM_READ_WRITE, CommandQueueProperties}; use std::io; use std::collections::HashMap; use tera::Tera; ///...
#![cfg_attr(not(feature = "std"), no_std)] /// configurable pallet constants in substrate use runtime_primitives::traits::Zero; use support::traits::Get; use support::{ decl_event, decl_module, decl_storage, dispatch::{DispatchResult, DispatchError}, ensure, StorageValue }; use system::ensure_s...
//use domain::base::record::Record; //use domain::master::entry::MasterRecord; use domain::rdata::MasterRecordData; use async_trait::async_trait; use cloudflare::endpoints::dns; use cloudflare::endpoints::dns::CreateDnsRecordParams; use cloudflare::framework::async_api; use cloudflare::framework::{async_api::ApiClien...
use std::{ fmt::{Debug, Formatter}, mem::size_of, sync::Arc, }; use bytes::{Buf, BufMut, Bytes, BytesMut}; use lz4::block::{compress, decompress}; use pretty_hex::*; use tokio_util::codec::{Decoder, Encoder}; use tracing::{debug, error, trace}; use crate::crypto::{decrypt_with_aes, decrypt_with_blowfish, ...
//-------------------------------------------------------------------- // quadratic-bezier.rs //-------------------------------------------------------------------- // Represents a quadratic Bézier curve //-------------------------------------------------------------------- use crate::derive_more::*; use crate::roots...
use egg::{rewrite as rw, *}; use std::str::FromStr; use crate::{config::*, searchutils::*, veclang::VecLang}; #[derive(Debug, PartialEq, Clone)] pub struct MacSearcher { pub acc_var: String, pub left_var: String, pub right_var: String, pub full_mac_pattern: Pattern<VecLang>, pub vec_pattern: Patt...
#![doc(html_root_url = "https://docs.rs/tower/0.4.3")] #![warn( missing_debug_implementations, missing_docs, rust_2018_idioms, unreachable_pub )] #![deny(broken_intra_doc_links)] #![allow(elided_lifetimes_in_paths, clippy::type_complexity)] #![cfg_attr(test, allow(clippy::float_cmp))] #![cfg_attr(docsrs...
use crate::error::{Error, Result}; use crate::server::middleware::RequestLogger; use crate::server::time_submissions::get_time_submissions; use crate::server::user_info::get_user_info; use crate::server::user_submissions::{ get_recent_submissions, get_user_submissions, get_users_time_submissions, }; pub(crate) mod...
use std::collections::BTreeMap; use ::value::Value; use vrl::prelude::*; use crate::log_util; fn parse_common_log(bytes: Value, timestamp_format: Option<Value>, ctx: &Context) -> Resolved { let message = bytes.try_bytes_utf8_lossy()?; let timestamp_format = match timestamp_format { None => "%d/%b/%Y:...
use crate::partial_signature::PARTIAL_SIGNATURE_BYTES; use crate::{PartialSignature, PublicKey, SecretKey}; use bls12_381_plus::{ multi_miller_loop, ExpandMsgXmd, G1Affine, G1Projective, G2Affine, G2Prepared, Scalar, }; use core::{ fmt::{self, Display}, ops::{BitOr, Neg, Not}, }; use ff::Field; use group::{...
use crate::core::*; use crate::renderer::*; /// /// Used for debug purposes. /// #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum DebugType { POSITION, NORMAL, COLOR, DEPTH, ORM, UV, NONE, } /// /// Deferred render pipeline which can render objects (implementing the [Geometry] trait) w...
//! Configuration settings for the BMI160 // Mask definitions const ACCEL_BW_MASK: u8 = 0x70; const ACCEL_ODR_MASK: u8 = 0x0F; const ACCEL_UNDERSAMPLING_MASK: u8 = 0x80; const ACCEL_RANGE_MASK: u8 = 0x0F; const GYRO_BW_MASK: u8 = 0x30; const GYRO_ODR_MASK: u8 = 0x0F; const GYRO_RANGE_MASK: u8 = 0x07; #[derive(Copy, C...
use std::error; use std::fmt; use std::io; use de; /// The errors that can arise while parsing a JSON stream. #[derive(Clone, PartialEq)] pub enum ErrorCode { EOFWhileParsingList, EOFWhileParsingObject, EOFWhileParsingString, EOFWhileParsingValue, ExpectedColon, ExpectedConversion, Expecte...
//! An SPSC queue for data channel PDUs. //! //! Data channel PDUs are received and transmitted in time-critical code, so they're sent through //! this queue to be processed at a later time (perhaps in the application's idle loop). use { crate::{ bytes::*, link::data::{self, Llid}, Error, ...
// Copyright 2022 Pal<NAME>, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
use anyhow::Context; use bb8_postgres::bb8::{Pool, PooledConnection}; use bb8_postgres::tokio_postgres::config::Config as PgConfig; use bb8_postgres::tokio_postgres::{types::ToSql, NoTls, Row, SimpleQueryMessage}; use bb8_postgres::PostgresConnectionManager; use log::trace; use rpc::query_service::query_service_server:...
use glium::glutin; use pixel_canvas::{ canvas::CanvasInfo, input::{Event, WindowEvent}, Canvas, Color, }; use std::sync::{Arc, Mutex}; pub const WIDTH: usize = 320; pub const HEIGHT: usize = 240; pub const FRAME_SELECT: usize = 0x20_0604; pub const FRAME_0: usize = 0; pub const FRAME_1: usize =...
use super::errors; use super::eval; use super::model; /// Return a subprocess::Exec instance from a command vector. pub fn run<S>(cmd: &[S]) -> Result<(), errors::GardenError> where S: AsRef<std::ffi::OsStr>, { let mut exit_status: i32 = 1; if let Ok(mut p) = subprocess::Popen::create(cmd, subprocess::Pop...
use std::collections::{BinaryHeap}; use num_traits::{Float, One, Zero}; use crate::heap_element::HeapElement; use crate::util::distance_to_space; #[derive(Clone, Debug)] pub struct KdTree<A, const K: usize> { size: usize, min_bounds: [A; K], max_bounds: [A; K], content: Node<A, K>, } #[derive(Cl...
// Copyright 2019-2022 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT use std::collections::HashMap; use std::env::var; use std::fs::File; use std::io::BufReader; use std::iter; use std::path::{Path, PathBuf}; use anyhow::{anyhow, Context as _}; use async_std::{stream, sync, task}; use colored::*; use ...
use super::{PrincipalId, PrincipalIdError, SubnetId}; use crate::ic_types::PrincipalError; use candid::CandidType; use ic_protobuf::{proxy::ProxyDecodeError, types::v1 as pb}; use serde::de::Error; use serde::{Deserialize, Serialize}; use std::{convert::TryFrom, fmt}; /// A type representing a canister's [`PrincipalId...
use std::path::PathBuf; use std::sync::Arc; use std::time::{Duration, Instant}; use actix_web::{http::header, web::Bytes, HttpMessage}; use futures::{future, future::Either, Future, Stream}; use parking_lot::Mutex; use serde::Deserialize; use tokio_retry::strategy::{jitter, ExponentialBackoff}; use tokio_retry::Retry;...
use core::convert::TryInto; use core::fmt::Debug; use core::iter::FromIterator; use core::mem; use core::mem::MaybeUninit; /// Allocation-free fixed size array with non-contiguous indices. #[derive(Debug, Clone)] pub struct Array<I, V, const N: usize> { len: usize, buckets: [Option<(I, V)>; N], } pub trait Ar...
//! This module implements `World`, the main object responsible for handling what you see on the //! screen. pub mod stats; pub use crate::display::symbol::types::*; use crate::prelude::*; use crate::animation; use crate::control::callback; use crate::data::dirty::traits::*; use crate::data::dirty; use crate::debug...
//! The Wasmtime Functions metadata crate. //! //! This crate is responsible for reading the metadata present in a WebAssembly module created by the //! Wasmtime Functions procedural macros. //! //! The data structures defined here should correspond to those in the `wasmtime-functions-codegen` crate. //! //! See the do...
#[doc = "Reader of register STATUS"] pub type R = crate::R<u32, super::STATUS>; #[doc = "Reader of field `VMONRDY`"] pub type VMONRDY_R = crate::R<bool, bool>; #[doc = "Reader of field `VMONAVDD`"] pub type VMONAVDD_R = crate::R<bool, bool>; #[doc = "Reader of field `VMONALTAVDD`"] pub type VMONALTAVDD_R = crate::R<boo...
// Copyright 2015 <NAME> (IRCAM) // 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 wri...
// Copyright Kamu Data, 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 th...
use tracing_subscriber::{EnvFilter, FmtSubscriber}; use crate::{ settings::{MaskSettings, ModelSettings, PetSettings}, state_machine::{ coordinator::CoordinatorState, events::{EventPublisher, EventSubscriber, ModelUpdate}, phases::{PhaseName, Shared}, requests::{RequestReceiver,...
// Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 use crate::counters::{STRUCT_LOG_CONNECT_ERROR_COUNT, STRUCT_LOG_TCP_CONNECT_COUNT}; use serde::Serialize; use serde_json::Value; use std::{ collections::HashMap, fmt::Display, io, io::Write, marker::PhantomData, ...
use rusqlite::Connection; use crate::entities::{AbilityData, AmuletData, CharaData, DragonData, WeaponData}; use crate::push_if_exists; use crate::simulation::AbilityHandler; #[derive(Debug)] pub struct Player { chara: CharaData, dragon: DragonData, weapon: WeaponData, amulets: [AmuletData; 2], p...
#![allow(dead_code)] #![allow(non_snake_case)] #![allow(non_camel_case_types)] #![no_std] #![no_main] use k210_console::console::{Console, ScreenImage}; use k210_console::cp437; use k210_console::cp437_8x8::{FONT, GLYPH_BY_FILL}; use k210_hal::Peripherals; use k210_hal::prelude::*; use k210_hal::stdout::Stdout; use k2...
//! Controllers are responsible for handling requests and returning responses to the client. //! //! More specifically a Controller defines a list of endpoint (Handlers) that handle a request and //! return a Future of a [`Responder`](../responder/trait.Responder.html). //! The [`Responder`](../responder/trait.Responde...
//! Data plane `host` API /* * Copyright (c) 2021 Arm Limited. * * SPDX-License-Identifier: MIT * * 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 withou...
extern crate piston_window; use piston_window::*; struct Ball { x: f64, y: f64, r: f64, c: f64, s: f64, angle: f64, speed: f64, } struct Player { y: f64, key_move: f64, score: u8, } fn main() { // 640, 480 let window_x = 1300; let window_y = 800; let pi = 3.14; let two_pi = 2.0*pi; let mut window:...
use std::future::Future; use std::sync::Arc; use futures::FutureExt; use std::sync::mpsc; use crate::data::AtomicTake; use crate::data::{global_injector, Receiver, Sender}; use crate::executor::worker::Worker; use crate::executor::ExecutorMessage; use crate::executor::Task; use crate::io::context; use log::trace; ...
use prettytable::{color, format, Attr, Cell, Row, Table}; use std::fs::File; use std::io::Read; use std::path::PathBuf; use structopt::StructOpt; fn pure_format() -> format::TableFormat { format::FormatBuilder::new() .column_separator(' ') .borders(' ') .separators( &[format::Li...
use macroquad::prelude::*; const WINDOW_SIZE_X : i32 = 1600; const WINDOW_SIZE_Y : i32 = 900; #[derive(Clone, Copy)] enum CellState { Alive(u32), Dead(u32), } fn window_conf() -> Conf { Conf { window_title: "Connways GoL - Rule 30".to_owned(), window_width: WINDOW_SIZE_X, window_h...
//! Derive macros for Rocket forms. use crate::{EnumVariantKind, Intermediate, StructField, TypeInfo}; use heck::ToLowerCamelCase; use proc_macro::TokenStream; use proc_macro2::{Span, TokenStream as TokenStream2}; use quote::quote; use syn::{parse_macro_input, DeriveInput, Ident}; pub fn derive_elm_form(input: TokenS...
pub mod bls; pub mod cl; pub mod encryption; pub mod logger; pub mod signatures; use errors::prelude::*; use ffi_support::ByteBuffer; use std::os::raw::c_char; /// Used for receiving a ByteBuffer from C that was allocated by either C or Rust. /// If Rust allocated, then the outgoing struct is ffi_support::ByteBuffer ...
use crate::{WgpuRenderContext, WgpuRenderResourceContext}; use bevy_ecs::world::World; use bevy_render2::render_graph::{ Edge, NodeId, NodeRunError, NodeState, RenderGraph, RenderGraphContext, SlotLabel, SlotType, SlotValue, }; use bevy_utils::{tracing::debug, HashMap}; use smallvec::{smallvec, SmallVec}; use s...
// 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 std::{ collections::VecDeque, io::{Read, Result, Seek}, }; use crate::{ stab::{RangeRecord, Record, RecordBlockParsingState}, Dictionary, }; use d4_framefile::{Blob, Stream}; use super::table::SecondaryTableRef; pub struct D4TrackView<R: Read + Seek> { pub(super) chrom: String, pub(super...
use log::*; use crate::api::*; use crate::tracer::*; /* * bitstream structure for decoder. * * NOTE: Don't change location of variable because this variable is used * for assembly coding! */ #[derive(Default)] pub(crate) struct EvcdBsr { /* temporary read code buffer */ code: u32, /* left bits ...
use std::convert::TryInto; use std::{ error::Error, mem, path::Path, time::{Duration, SystemTime, UNIX_EPOCH}, }; use event::Event; use event_payload::EventPayload; use lightweight_event::LightweightEvent; use measureme::file_header::{verify_file_header, FILE_MAGIC_EVENT_STREAM}; pub mod event; pub mo...
use crate::interpreter::environment::EnvironmentId; use crate::interpreter::error::Error; use crate::interpreter::interpreter::Interpreter; use crate::interpreter::library; use crate::interpreter::value::ConsId; use crate::interpreter::value::Value; fn read_catch_clauses( interpreter: &mut Interpreter, clauses...
use std::mem::ManuallyDrop; use gfx_hal::{ adapter::{Adapter, Gpu, PhysicalDevice}, Backend, command::Level, device::Device, Features, format::{ChannelType, Format}, Instance, pool::{CommandPool, CommandPoolCreateFlags}, queue::{QueueFamily, QueueFamilyId, QueueGroup}, window::S...
//! Coordinator nodes and utilities. use std::{ future::Future, pin::Pin, task::{Context, Poll}, thread::JoinHandle, time::Duration, }; use crate::error::{Error, ResultExt}; use crossbeam_channel::Sender; use futures::channel::oneshot; use log::{error, info}; use nng::{ options::{ transport::tcp::KeepAlive, ...
pub mod token; pub mod token_type; use super::SimpleErrorHandler; use std::mem; use token::Literal; use token::Token; use token_type::TokenType; pub struct Scanner<'a> { source: Vec<char>, tokens: Vec<Token>, start: u32, current: u32, line: u32, error_handler: &'a mut SimpleErrorHandler, } imp...
// Copyright 2021 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 num::{FromPrimitive, ToPrimitive}; use num_derive::{FromPrimitive, ToPrimitive}; use openthread_sys::*; /// Type returned by OpenThread calls. pub typ...
use std::time::Duration; use rusb::UsbContext; use failure::ResultExt; use crate::{FFPError, Result}; #[derive(Copy, Clone, Debug)] #[repr(u8)] enum Command { SetCS = 1, SetFPGAReset = 2, SetMode = 3, SetTPwr = 4, SetLED = 6, Bootload = 7, } #[derive(Copy, Clone, Debug)] #[repr(u16)] enum Mode...
//! Holds definition to wrap and alter game. use error::MaeveError; use load::save; use protos::master::Conditional; use protos::master::Context; use protos::master::Game; use protos::master::State; use protos::master::branch::Branch; use protos::master::context::Content; use protos::master::context::Scope; use protos...
extern crate serde; extern crate serde_json; extern crate chrono; extern crate hyper; extern crate futures; extern crate tokio_core; extern crate hyper_tls; extern crate failure; use chrono::{Local, Date}; use tokio_core::reactor::Core; use futures::{Future, Stream}; use futures::stream::futures_unordered; use hyper_t...
use futures::{stream, StreamExt}; use indicatif::{MultiProgress, ProgressBar, ProgressStyle}; use scraper::{Html, Selector}; use std::{error::Error, fs::File, io::Write, path::PathBuf}; fn set_pb_style(pb: &ProgressBar) { pb.set_style( ProgressStyle::default_bar() .template("[{elapsed_precise}]...
use bytes::Bytes; use env_logger; use futures::{oneshot, prelude::*, sync::oneshot::Sender}; use log::info; use std::collections::HashMap; use std::{ str, time::{Duration, Instant}, }; use tentacle::{ builder::{MetaBuilder, ServiceBuilder}, context::{ProtocolContext, ProtocolContextMutRef, ServiceContex...
use schemars::{JsonSchema}; use serde::{Deserialize, Serialize}; use super::player::{Attack, Move, PLAYER_DOMMAGE, Player, PlayerState}; pub const MAP_HEIGHT : usize = 25; pub const MAP_WIDTH : usize = 25; const SPIKE_DOMMAGE : u32 = 1; #[derive(Debug, Deserialize, Serialize, Copy, Clone, JsonSchema)] pub enum Dir...
use crate::resources::common::category::MerchantCategories; use crate::resources::common::currency::Currency; use crate::resources::common::object::Object; use crate::resources::common::path::UrlPath; use crate::resources::core::balance::BalanceTransaction; use crate::util::{List, RangeQuery, Expandable}; use crate::C...
use failure::Fail; use std::rc::Rc; use dbus::ffidisp::{BusType, Connection}; use dbus::{arg, Message}; use super::DBusError; use crate::player::{Player, DEFAULT_TIMEOUT_MS, MPRIS2_PATH, MPRIS2_PREFIX}; use crate::pooled_connection::PooledConnection; use crate::PlaybackStatus; const LIST_NAMES_TIMEOUT_MS: i32 = 500...
use anyhow::{bail, Context, Result}; use log::info; use reqwest::blocking::Client; use secrecy::ExposeSecret; use std::net::IpAddr; use crate::domain_record_api::DomainRecordApi; use crate::token::SecretDigitalOceanToken; use crate::types::{api, DomainRecordToUpdate}; const DIGITAL_OCEAN_API_HOST_NAME: &str = "https:...
use crate::{command::Command, BitcoinCodec, Message, NetworkRequest, NetworkResponse}; use config::Config; use futures::{prelude::*, FutureExt}; use shared::DeserializationError; use std::time::Duration; use std::{fmt, sync::Arc}; use std::{net::SocketAddr, pin::Pin}; use tower::Service; // use tower::Service; // use t...
use anyhow::{anyhow, Error}; use std::fmt; /// Bel has four fundamental data types: /// symbols, pairs, characters, and streams. /// Instances of the four fundamental types are called objects /// https://sep.yimg.com/ty/cdn/paulgraham/bellanguage.txt #[derive(Debug, PartialEq, Eq, Clone, Hash)] pub enum Object { S...
use std::{ path::{ Path, PathBuf, }, fs::{ create_dir, read_to_string, write, }, fmt::{Display, Formatter, self}, }; use chrono::NaiveDate; use crate::{ packages::{ Package, fetch::{Month, Year}, }, manage::config::Config, }; #[der...
use crate::class::Class; use crate::classes::null_pointer_exception::NullPointerException; use crate::env::JniEnv; use crate::java_methods::FromObject; use crate::java_methods::JniSignature; use crate::object::Object; use crate::result::JavaResult; use crate::token::NoException; use std::ptr::NonNull; pub trait JavaCl...
#[allow(unused_imports)] use crate::util; use crate::ctapdef; use crate::enc_hmac_sha_256; use crate::pintoken; use crate::public_key_credential_descriptor::PublicKeyCredentialDescriptor; use crate::public_key_credential_user_entity::PublicKeyCredentialUserEntity; use serde_cbor::to_vec; use serde_cbor::Value; use std...
#[macro_use] extern crate glium; use glium::DisplayBuild; use glium::Surface; extern crate rand; use rand::distributions::{IndependentSample, Range}; #[derive(Debug, Default, Copy, Clone)] struct Vertex { position: [f64; 2], } #[derive(Debug)] struct Ball { vertex: Vertex, radius: f64, velocity: [f64...
extern crate bosun_emitter; extern crate mktemp; extern crate rustc_serialize; use bosun_emitter::*; use rustc_serialize::json::Json; use mktemp::Temp; use std::io::prelude::*; use std::fs::File; use std::net::TcpListener; use std::sync::mpsc::{Receiver, channel}; use std::thread; #[test] fn send_metadata() { let...
// Copyright 2020 ChainSafe Systems // SPDX-License-Identifier: Apache-2.0, MIT #![cfg(feature = "submodule_tests")] #[macro_use] extern crate lazy_static; use conformance_tests::*; use encoding::Cbor; use flate2::read::GzDecoder; use forest_message::{MessageReceipt, UnsignedMessage}; use regex::Regex; use std::erro...
mod game_runner; use lib_printer::{out, out_impl}; use std::fmt::{Debug, Display}; pub use game_runner::{GameRunner, GeneralGameRunner}; /// An enum representing the two possible player colors for all games. #[derive(Copy, Clone, Debug, PartialEq)] pub enum PlayerColor { Black, White, } impl PlayerColor { ...
//! Performs a compute-intensive task in multiple tasks that run in a //! round-robin fashion, and validates the output of each run. //! //! The intent of this test to detect bugs in the saving and restoring of //! registers during a context switch. To this end, the task is designed to //! utilize as many floating-poin...
use std::path::Path; use std::sync::Arc; use std::time::Duration; use anyhow::bail; use reqwest::header::{HeaderMap, HeaderValue}; use reqwest::Url; use reqwest_cookie_store::CookieStoreMutex; use serde_json::json; use tokio::fs; use tokio::sync::mpsc::Sender; use crate::constants::USER_AGENT; use crate::credential::{C...
// トレースバックをしないバージョン // トレースバックしないのはそれはそれで面倒。 // ただ意味としてはわかりやすい。 use itertools::iproduct; use ndarray::{Array, Array2}; use proconio::input; use proconio::marker::Bytes; fn read() -> (Vec<u8>, Vec<u8>) { input! { seq1: Bytes, seq2: Bytes } (seq1, seq2) } fn sim(ch1: u8, ch2: u8) -> i32 { ...
use crate::router::get_static_href; use crate::scenes::webgl::common::*; use crate::start_webgl; use awsm_web::errors::Error; use awsm_web::loaders::image; use awsm_web::webgl::{ AttributeOptions, BeginMode, BufferMask, DataType, Id, SimpleTextureOptions, TextureCubeFace, TextureTarget, VertexArray, WebGlTextur...
mod utils; use std::fmt; use wasm_bindgen::prelude::*; extern crate nalgebra as na; use na::{Vector2,vector}; use rand::prelude::*; // When the `wee_alloc` feature is enabled, use `wee_alloc` as the global // allocator. #[cfg(feature = "wee_alloc")] #[global_allocator] static ALLOC: wee_alloc::WeeAlloc = wee_alloc::W...
// Copyright © Spelldawn 2021-present // 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 // https://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to i...
// Day 4: Giant Squid use std::error::Error; use std::num::ParseIntError; use std::str::FromStr; const CARD_SIZE: usize = 5; const CARD_DELIMITER: &str = "\n\n"; #[derive(Debug, Clone, Copy)] struct Square { number: u32, is_called: bool, } #[derive(Debug, Clone, Copy)] struct Card { squares: [[Square; C...
//! Byte pattern tables from RFC 3986. //! //! The predefined tables in this module have values that are either 0 or 1. /// A table determining the byte patterns allowed in a string. /// /// It is guaranteed that the unencoded bytes allowed are ASCII and that /// an unencoded `%` is not allowed. /// /// Note that tabl...
use std::thread; use std::time::Duration; use websocket::sync::{Client, Server, Stream}; use websocket::{Message as WsMessage, OwnedMessage}; use crate::communication::{ Callback, Error, ErrorMessage, Message, RequestTable, Response, TableRequest, }; use crate::engine::Table; use std::collections::HashMap; use std...
use super::{ response::{self, Response}, Button, Device, EndpointBase, KeyEvent, Result, }; use serde::ser::{Serialize, SerializeStruct, Serializer}; use serde_json::Value; use std::result::Result as StdResult; #[derive(Debug, Copy, Clone)] pub enum RequestType { Get, Put, } #[allow(unused)] // Temp...
use crate::math::{lerp, Align, Rect}; use crate::{CtxRef, Id, LayerId, Sense, Ui}; // ---------------------------------------------------------------------------- /// The result of adding a widget to a [`Ui`]. /// /// This lets you know whether or not a widget has been clicked this frame. /// It also lets you easily ...