text
stringlengths
9.08k
47.9k
//! This module implements performance monitoring utils. use crate::prelude::*; use crate::debug::stats::Stats; use crate::system::web; use crate::system::web::StyleSetter; use js_sys::ArrayBuffer; use js_sys::WebAssembly::Memory; use std::collections::VecDeque; use std::f64; use wasm_bindgen::JsCast; use wasm_bindg...
/*! Direct2D backend for the plotters control */ use winapi::shared::windef::HWND; use winapi::um::d2d1::*; use winapi::um::dwrite::{IDWriteFactory, IDWriteTextFormat, DWriteCreateFactory, DWRITE_FACTORY_TYPE_SHARED}; use winapi::shared::winerror::{S_OK, D2DERR_RECREATE_TARGET}; use super::base_helper::to_utf16; u...
#![recursion_limit = "512"] use std::cell::RefCell; use anyhow::{anyhow, Context as _, Error}; use chat_common::{Peer, WsMessage, WsResponse}; use laplace_yew::{MsgError, RawHtml}; use libp2p_core::{identity::ed25519::Keypair, PeerId, PublicKey}; use pulldown_cmark::{html as cmark_html, Options, Parser}; use wasm_web...
//! A DeltaLayer represents a collection of WAL records or page images in a range of //! LSNs, and in a range of Keys. It is stored on a file on disk. //! //! Usually a delta layer only contains differences, in the form of WAL records //! against a base LSN. However, if a relation extended or a whole new relation //! i...
use super::def::*; use super::picman::*; use super::tbl::*; use crate::api::*; use std::ops::Neg; /* clipping within min and max */ #[inline] pub(crate) fn EVC_CLIP3<T: PartialOrd>(min_x: T, max_x: T, value: T) -> T { if value < min_x { min_x } else if value > max_x { max_x } else { ...
//! Transcodes videos stored in Moodle to more common formats. It especially //! targets converting MOV so students don't require QuickTime. // Copyright 2021 <NAME> <<EMAIL>> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // Yo...
use super::buffer::Buffer; use crate::gl33::GL33; use gl::{self, types::*}; use luminance::{ backend::shader::{Shader, ShaderData, Uniformable}, pipeline::{ShaderDataBinding, TextureBinding}, pixel::{SamplerType, Type as PixelType}, shader::{ types::{Arr, Mat22, Mat33, Mat44, Vec2, Vec3, Vec4}, ProgramE...
use assembling::models::mrr::MRRModel; use rdb2rdf::models::semantic_model::*; use algorithm::prelude::*; use rayon::prelude::*; use settings::{ Settings, conf_search, conf_predicting }; use assembling::searching::*; use im::OrdSet as IOrdSet; use std::cmp::Ordering; use assembling::searching::beam_search::*; use assem...
use crate::{bytes, error::MpcError, AdditiveShare, AuthAdditiveShare, InMessage, OutMessage}; use bench_utils::{timer_end, timer_start}; use neural_network::{ layers::{Layer, LayerInfo, NonLinearLayer, NonLinearLayerInfo}, NeuralArchitecture, NeuralNetwork, }; use async_std::io::{Read, Write}; use rand::{Crypt...
use for_any::ForAny; #[derive(ForAny)] enum EmptyEnum {} #[derive(ForAny)] enum EmptyVariants { A, B, C, } #[derive(ForAny)] enum EmptyTupleVariants { A(), B(), C(), } #[derive(ForAny)] enum SingleTypeTupleVariants { A(&'static str), B(&'static str), C(&'static str), } #[derive(...
use std::{ ffi::CString, os::unix::{ io::{FromRawFd, IntoRawFd}, net::UnixStream, }, sync::Arc, }; use crate::{ core_interfaces::{WL_CALLBACK_INTERFACE, WL_DISPLAY_INTERFACE, WL_REGISTRY_INTERFACE}, protocol::{ check_for_signature, same_interface, same_interface_or_anony...
#[cfg(test)] mod tests; use crate::consumer::{Consumer, ConsumerId, ConsumerOptions}; use crate::data_consumer::{DataConsumer, DataConsumerId, DataConsumerOptions, DataConsumerType}; use crate::data_producer::{DataProducer, DataProducerId, DataProducerOptions, DataProducerType}; use crate::data_structures::{AppData, S...
// 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...
// Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 use crate::{ account_address::AccountAddress, account_state_blob::AccountStateBlob, ledger_info::LedgerInfo, proof::{ verify_account_state, verify_event, verify_signed_transaction, verify_sparse_merkle_e...
use crate::participant::ParticipantConnection; use crate::room::RoomId; use crate::rooms_registry::RoomsRegistry; use actix_web::web::{Data, Payload, Query}; use actix_web::{web, App, Error, HttpRequest, HttpResponse, HttpServer}; use actix_web_actors::ws; use mediasoup::prelude::*; use serde::Deserialize; use std::num...
//! A somewhat higher level GPU abstraction. //! //! This layer is on top of the lower-level layer that multiplexes different //! back-ends. It handles details such as managing staging buffers for creating //! buffers with initial content, deferring dropping of resources until command //! submission is complete, and a ...
//! Provides a framework and interfaces to various components that are used for implementing //! the chase. It also implements entrypoints for running the chase. //! //! ## Background //! Razor implements a variant of [the chase] algorithm to construct models for first-order theories with //! equality. The chase operat...
// Copyright 2016 The xi-editor Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
#![allow(safe_extern_statics)] extern crate bitstream_io; extern crate byteorder; extern crate clap; extern crate libc; extern crate rand; extern crate y4m; #[macro_use] extern crate enum_iterator_derive; use std::fs::File; use std::io::prelude::*; use bitstream_io::{BE, BitWriter}; use byteorder::*; use clap::{App,...
pub mod aedat_utilities { extern crate image; extern crate clap; use std::io::prelude::*; use std::fs::File; use std::convert::TryInto; use std::io::ErrorKind; use std::fs; use std::process::Command; use image::ImageBuffer; use image::Rgb; use clap::ArgMatches; mod co...
use app::constants::*; use backend::messagebus::{Inbox, Message, Outbox, PubSub, ReceiveDrain, Whiteboard}; use backend::obj; use backend::obj::*; use backend::systems; use backend::world; use backend::world::agent; use backend::world::segment; use cgmath; use cgmath::Matrix4; use core::clock::*; use core::geometry::Tr...
use borsh::BorshDeserialize; use ethabi::{encode, Token as ABIToken}; use logos::Logos; use rlp::{Decodable, DecoderError, Rlp}; use crate::parameters::MetaCallArgs; use crate::prelude::{vec, Address, Box, HashMap, String, ToOwned, ToString, Vec, H256, U256}; use crate::types::{keccak, u256_to_arr, InternalMetaCallArg...
// 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. #![warn(missing_docs)] //! Library for resolving and encoding the runtime configuration values of a component. use cm_rust::{ ConfigChecksum, ConfigD...
use crate::{ arith::*, discrete_gaussian::*, gadget::*, number_theory::*, params::*, poly::*, util::*, }; use rand::{Rng, SeedableRng}; use rand_chacha::ChaCha20Rng; use std::{iter::once, mem::size_of}; fn new_vec_raw<'a>( params: &'a Params, num: usize, rows: usize, cols: usize, ) -> Vec<PolyMatri...
use doc::*; use merge::common_urls::*; use merge::common_docids::*; use merge::util::*; use index_reader::*; use terms::*; use types::*; use byteorder::{LittleEndian, WriteBytesExt}; use itertools::Itertools; use std::fs; use std::fs::File; use std::io::{BufWriter, Write}; use write_to_buf::WriteToBuf; #[derive(Debu...
//! # C code generator. //! //! This generator performs multiple things: //! //! ## Cleanup the types to compile properly. //! //! This cleanup is more substantial than in C++ side. Specifically, additional monomorphization //! happens to replace all `Context` types with context structures that we find actually used. Z...
use super::Field; use core::fmt; use core::ops::{Add, AddAssign, Mul, MulAssign, Neg, Sub, SubAssign}; use byteorder::{ByteOrder, LittleEndian}; use subtle::{Choice, ConditionallySelectable, ConstantTimeEq, CtOption}; use crate::util::{adc, mac, sbb}; // The internal representation of this type is four 64-bit unsig...
use std::collections::{BTreeMap, HashSet}; use std::fs::File; use std::io::{self, BufRead}; use std::iter::repeat; use std::str; use std::time::Duration; use std::{cmp, env}; use anyhow::{bail, format_err}; use crates_io::{self, NewCrate, NewCrateDependency, Registry}; use curl::easy::{Easy, InfoType, SslOpt, SslVersi...
use std::cmp::{max, Ordering, Reverse}; use std::collections::BinaryHeap; use std::collections::HashSet; #[cfg(feature = "indicatif")] use std::sync::atomic::{self, AtomicUsize}; #[cfg(feature = "indicatif")] use indicatif::ProgressBar; use ordered_float::OrderedFloat; use parking_lot::{Mutex, RwLock}; use rand::rngs:...
//! This module implements the ChaCha constraints. //~ There are four chacha constraint types, corresponding to the four lines in each quarter round. //~ //~ ``` //~ a += b; d ^= a; d <<<= 16; //~ c += d; b ^= c; b <<<= 12; //~ a += b; d ^= a; d <<<= 8; //~ c += d; b ^= c; b <<<= 7; //~ ``` //~ //~ or, written without...
use laythe_core::chunk::Encode; use std::mem; #[cfg(any(test, feature = "debug"))] use std::convert::TryInto; /// Space Lox virtual machine byte codes #[derive(Debug, PartialEq, Clone, Copy)] pub enum AlignedByteCode { /// Return from script or function Return, /// Negate a value Negate, /// Add the top t...
//! Implements mm0/mm1 file AST components //! //! An [`Ast`] is the result of parsing an mm0/mm1 file. The core of the AST is a //! `Vec<Stmt>`, where a [`Stmt`] holds both the element's "data" as a [`StmtKind`], //! and the element's [`Span`]. //! The actual [`Ast`] type also contains data about the source file, an...
use crate::{ Arena, ArraySize, BinaryOperator, BuiltIn, Constant, ConstantInner, DerivativeAxis, Expression, FastHashMap, Function, FunctionOrigin, GlobalVariable, Handle, ImageFlags, IntrinsicFunction, LocalVariable, Module, ScalarKind, Statement, StorageClass, Type, TypeInner, UnaryOperator, }; use std::{...
/* * Licensed to Elasticsearch B.V. under one or more contributor * license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright * ownership. Elasticsearch B.V. licenses this file to you under * the Apache License, Version 2.0 (the "License"); you may * not u...
/* * Copyright 2018-2020 TON DEV SOLUTIONS LTD. * * Licensed under the SOFTWARE EVALUATION License (the "License"); you may not use * this file except in compliance with the License. * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASI...
//! This module contains definitions and metadata for builtin functions and builtin variables. use crate::ast; #[allow(unused_imports)] use crate::common::Either; use crate::common::{NodeIx, Result}; use crate::compile; use crate::runtime::{Int, IntMap, Str, StrMap}; use crate::types::{self, SmallVec}; use smallvec::sm...
//! Phases of our custom derive compiler, and passes that perform phase changes. use std::collections::{HashMap, HashSet}; use std::fmt; use std::hash::{BuildHasher, Hash}; use std::iter::FromIterator; use std::rc::Rc; use darling; use darling::usage::{ CollectLifetimes, CollectTypeParams, GenericsExt, IdentR...
//! # A Simple Public-Key Implementation //! //! IMPORTANT - This should not be used for anything important! //! The goal of this program is to teach you the basics of public-key cryptography //! but it has not been audited or protected against other attacks. Additionally, //! it is trivially crackable due to the rela...
#![allow(non_camel_case_types, non_snake_case, dead_code)] type h8 = u8; type h32 = u32; type uint8_p = [u8]; type chacha_ctx = [h32; 16]; fn load32_le (k:&[h8]) -> h32 { let k0 = k[0] as u32; let k1 = k[1] as u32; let k2 = k[2] as u32; let k3 = k[3] as u32; let z = k0 | (k1 << 8) | (k2 << 16) | (k3 <...
#![no_main] #![no_std] #![feature(alloc_error_handler)] #![feature(clamp)] #![feature(const_fn)] #![feature(integer_atomics)] //extern crate panic_halt; #[macro_use(block)] extern crate nb; //use no_std_compat::prelude::v1::*; extern crate alloc; extern crate alloc_cortex_m; extern crate cortex_m_rt as rt; // v0....
// Copyright (c) 2021 Quark Container Authors / 2018 The gVisor Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless ...
// This file is part of Substrate. // Copyright (C) 2020-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...
//! The bytecode representation of Mica. use std::collections::HashMap; use std::fmt::{self, Debug}; use std::mem::size_of; use std::rc::Rc; use crate::common::{ErrorKind, Location}; use crate::gc::{Gc, GcRaw, Memory}; use crate::value::{Closure, RawValue}; /// A 24-bit integer encoding an instruction operand. #[der...
use super::{event_util::*, FlufflError, TouchTracker, WindowManager}; use crate::audio::{init_audio_threads, FlufflAudioContext}; use crate::{console::*, *}; pub use js_sys; pub use wasm_bindgen; pub use wasm_bindgen::{prelude::*, JsCast}; pub use web_sys::*; use std::{ cell::{Cell, RefCell}, mem, rc::R...
use std::cell::RefCell; use std::rc::Rc; use fxhash::FxHashMap; use std::fs::File; use std::io::{LineWriter, Write}; const START_NODE_ID: usize = 0; //const END_NODE_ID: usize = 1; pub type Alignment = Vec<(Option<usize>, Option<usize>)>; pub struct POEdge { pub begin_node_id: usize, pub end_node_id: usize...
use anyhow::{format_err, Error}; use chrono::{DateTime, Duration, Local, NaiveDate, Utc}; use futures::future::try_join_all; use itertools::Itertools; use postgres_query::{query, query_dyn, FromSqlRow}; use rayon::iter::{IntoParallelIterator, IntoParallelRefIterator, ParallelIterator}; use serde::{Deserialize, Serializ...
#![allow(clippy::type_complexity)] mod body_handler; mod request_maker; mod response_handler; use self::body_handler::BodyHandler; use self::request_maker::RequestMaker; use log::debug; use request_maker::ProviderDelays; use bytes::Bytes; use ether::{Either, Either3, EitherExt}; use for_each_parallel::ForEachParalle...
//! Reset and Clock Control use crate::stm32::{rcc, RCC}; use cast::u32; use crate::flash::ACR; use crate::pwr::Pwr; use crate::time::Hertz; #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum MsiFreq { #[doc = "range 0 around 100 kHz"] RANGE100K = 0, #[doc = "range 1 around 200 kHz"] RANGE200K = 1...
//! The wheel format is (mostly) specified in PEP 427 use crate::build_context::ProjectLayout; use crate::PythonInterpreter; use crate::Target; use crate::{BridgeModel, Metadata21}; use anyhow::{anyhow, bail, Context, Result}; use flate2::write::GzEncoder; use flate2::Compression; use sha2::{Digest, Sha256}; use std::...
use crate::error::TizenError; use clap::ArgMatches; use std::collections::HashMap; use std::fs; use std::fs::read_to_string; use std::path::{Path, PathBuf}; use sxd_document::{parser, Package}; use sxd_xpath::Context; use sxd_xpath::Factory; use toml::Value; pub struct TizenEnv { pub raw_config_values: Vec<ConfigV...
use self::addon::{Addon, AddonType}; use self::curse::{CurseAPI, WOW_GAME_ID}; use self::lockfile::Lockfile; use fancy_regex::Regex; use getset::{Getters, Setters}; use rayon::prelude::*; use std::collections::{HashMap, HashSet, VecDeque}; use std::fs::File; use std::io::{BufRead, BufReader, Write}; use std::path::{Pat...
use clap::Clap; use genomicsqlite::ConnectionMethods; use log::{debug, info, log_enabled, warn}; use rusqlite::{params, OpenFlags, OptionalExtension}; use std::collections::{BinaryHeap, HashMap}; use std::{cmp, io}; use crate::util::Result; use crate::{bad_command, connectivity, load, util, view}; #[derive(Clap)] pub...
//! This crate provides a builder to make it easier to use the correct binaries for [nlprule](https://github.com/bminixhofer/nlprule). //! See `README.md` for details. use flate2::bufread::GzDecoder; use fs::File; use fs_err as fs; use nlprule::{compile, rules_filename, tokenizer_filename}; use std::fs::Permissions; u...
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you ...
use position::*; use r#move::*; use types::*; use numpy::PyArray1; use pyo3::prelude::*; use rand::distributions::Distribution; use rand::Rng; #[derive(Clone)] pub struct Node { pub n: u32, pub v: f32, pub p: f32, pub w: f32, pub m: Move, pub parent: usize, pub children: std::vec::Vec<usiz...
use byteorder::{ReadBytesExt, WriteBytesExt, LE}; use itertools::Itertools; use std::{ io, io::{Cursor, Read, Result, Write}, }; /// adds padding to a byte vector until its len is a multiple of `to` /// no padding is added if the len is already a multiple of `to` fn pad_to_nearest(v: &mut Vec<u8>, to: usize) {...
#![warn( clippy::all, clippy::pedantic, clippy::restriction, clippy::nursery, clippy::cargo )] #![allow(clippy::multiple_crate_versions, clippy::cargo_common_metadata)] #![allow( clippy::integer_arithmetic, clippy::float_arithmetic, clippy::blanket_clippy_restriction_lints, clippy::i...
#![allow(unstable_name_collisions)] use serenity::client::Context; use serenity::prelude::TypeMapKey; use serenity::framework::standard::macros::{help, hook}; use serenity::framework::{ standard::{help_commands, Args, CommandGroup, CommandResult, Configuration, HelpOptions}, Framework, StandardFramework, }; us...
// Copyright 2017-2020 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...
use akropolisos_runtime::types::Token; use akropolisos_runtime::{ constants::currency::*, AccountId, AuthorityDiscoveryConfig, BabeConfig, Balance, BalancesConfig, Block, BridgeConfig, ContractsConfig, CouncilConfig, DemocracyConfig, GenesisConfig, GrandpaConfig, ImOnlineConfig, IndicesConfig, SessionConfig...
mod instructions; use std::collections::HashMap; use std::convert::TryFrom; use std::borrow::Cow; const MOD_DIRECT: u8 = 0b11; #[derive(Copy, Clone, PartialEq, Eq)] enum RexwMode { ExplicitRequired, Implicit, Usable, Unneeded, } #[derive(Copy, Clone, PartialEq, Eq)] enum Prefix66Mode { Unusable,...
use std::{ fmt::{self, Debug, Formatter}, path::Path, str::FromStr, }; use csv::ReaderBuilder; use datasize::DataSize; use num::rational::Ratio; use num_traits::Zero; #[cfg(test)] use rand::Rng; use semver::Version; use serde::{Deserialize, Serialize}; use tracing::{error, warn}; use casper_execution_engi...
// Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use { crate::collection::*, crate::selector_evaluator, crate::selectors, failure::{self, err_msg, format_err, Error}, fidl_fuchsia_diagn...
//! The ADC Interface //! //! The ADC is disabled at startup and must be enabled (by calling //! [Adc<Disabled>::enable]) before any of its registers can be accessed //! (read or write). Attempts to access these registers will trigger a hardware //! generated HardFault, which by default resets the microcontroller. //! ...
use arrow::{record_batch::RecordBatch, util::pretty::print_batches}; use hashbrown::HashMap; use std::{ collections::{BTreeMap, BTreeSet}, iter, string::FromUtf8Error, sync::Arc, }; use generated_types::{ read_response::{frame::Data, DataType, SeriesFrame}, Tag, }; use schema::{builder::SchemaB...
// 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. // Encoding and dec...
// Overall Design // ============== // // The generate-bitcode command will execute the specified build // command (e.g. make) within a process tracing mechanism (provided by // the "pete" package). Each trace event is examined to see if it is // of interest relative to the generation of a bitcode file: // // Event: /...
// Copyright © 2018 <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, // distribu...
use std::sync::Mutex; use std::collections::HashMap; use std::thread; use std::thread::JoinHandle; use std::marker::Send; use std::sync::Arc; use std::clone::Clone; use std::ops::Deref; use ws; use ws::{CloseCode, Handler, Request, Sender, Message}; use ring::agreement; use ring::rand::{SystemRandom, SecureRandom}; us...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ use super::completion_record::*; use super::function::*; use super::operations::*; use super::runtime::*; use crate::eval::jsvalu...
use crypto_box::{ PublicKey, ChaChaBox, SecretKey, aead::Aead, }; use blake2::{Blake2b, Digest}; use std::convert::TryInto; use generic_array::GenericArray; use crate::Error; pub fn make_channel( their_public: &PublicKey, our_secret: &SecretKey, ) -> ChaChaBox { ChaChaBox::new(their_pu...
#![allow(unused_imports)] #![feature(vec_into_raw_parts)] #![feature(str_internals)] #![feature(shrink_to)] use nix::fcntl::{ fcntl, FcntlArg, OFlag, }; use termion::{ self, event::Key, input::TermRead, raw::{ RawTerminal, IntoRawMode, }, clear, cursor, }; use ...
mod alu; mod cb; mod jp; mod ld; mod misc; use self::Flag::*; use self::Instr::*; use self::Location::*; use self::Register::*; use crate::{ bus::Bus, cpu::{value::Value, CPU}, }; #[derive(Debug, PartialEq, Copy, Clone)] pub enum Register { A, B, C, D, E, F, //FLAGS H, L, SP...
use crate::channel::CONNECTION_FROM_BASE; use crate::data::*; use crate::debug::trace::Tracer; use crate::internal::*; use crate::LocalOrNot; use crate::{Tagged, Tagger}; use async_bincode::{AsyncBincodeStream, AsyncDestination}; use futures::stream::futures_unordered::FuturesUnordered; use nom_sql::CreateTableStatemen...
mod utils; use wasm_bindgen::prelude::*; use std::collections::VecDeque; // 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::WeeAlloc::INIT; const F9TH: f64 = 4.0/9.0; const O9TH: f64 ...
use cgmath; use cgmath::*; use gfx; use gfx::Device; use gfx::traits::FactoryExt; use gfx_window_glutin; use glutin; use glutin::{ElementState, MouseButton, MouseScrollDelta, VirtualKeyCode, TouchPhase, WindowEvent}; use image; use imgui::{ImGui, Ui, ImGuiKey}; use imgui_gfx_renderer::Renderer; use std::time::Instant...
/* This tool is part of the WhiteboxTools geospatial analysis library. Authors: Dr. <NAME> Created: 21/07/2017 Last Modified: 30/01/2020 License: MIT */ use whitebox_raster::*; use whitebox_common::structures::Array2D; use crate::tools::*; use num_cpus; use std::env; use std::f64; use std::io::{Error, ErrorKind}; use ...
use std::sync::Arc; use alacritty_terminal::{ ansi, event::EventListener, grid::{Dimensions, Scroll}, index::{Direction, Side}, selection::{Selection, SelectionType}, term::{search::RegexSearch, SizeInfo, TermMode}, vi_mode::ViMotion, Term, }; use druid::{ keyboard_types::Key, Appli...
use crate::behaviour::*; use crate::board_simulator::*; use crate::event::*; use crate::direction::*; use rand::Rng; use zzt_file_format::*; use crate::zzt_behaviours::monster_interactions::*; struct HeadStepContext<'l> { new_step_x: i16, new_step_y: i16, actions: Vec<Action>, continuation: Option<Box<dyn Actio...
use tab_organizer::{px, theme_color, colors}; use futures_signals::signal::SignalExt; use dominator::{class, pseudo, HIGHEST_ZINDEX}; use lazy_static::lazy_static; // "chrome://mozapps/skin/places/defaultFavicon.svg" pub(crate) const DEFAULT_FAVICON: &'static str = "favicons/default.svg"; pub(crate) const LOADING_ME...
use super::{metrics::Gauge, scheduler::ScheduleClient, scheduler2::Scheduler}; use crate::{bldr_core::{self, job::Job, metrics::GaugeMetric, socket::DEFAULT_CONTEXT}, config::Config, data_store::Data...
use atomic_immut::AtomicImmut; use byteorder::{BigEndian, ByteOrder}; use cannyls::deadline::Deadline; use cannyls::device::{Device, DeviceHandle}; use cannyls::lump::LumpId; use cannyls_rpc::DeviceId; use cannyls_rpc::DeviceRegistryHandle; use fibers::sync::oneshot; use fibers::Spawn; use fibers_rpc::client::ClientSer...
use crate::chip::*; use crate::database::*; use std::convert::TryInto; use std::fs::File; use std::io::Read; pub struct BitstreamParser { data: Vec<u8>, index: usize, crc16: u16, ecc14: u16, verbose: bool, metadata: Vec<String>, } // Magic sequences const COMMENT_START: [u8; 2] = [0xFF, 0x00]...
/* ********************************************************************** ** ** This file is part of rsp2. ** ** ** ** rsp2 is free software: you can redistribute it and/or modify it under ** ** the term...
use std::collections::{HashMap, HashSet}; use stepflow_base::{ObjectStore, ObjectStoreContent, ObjectStoreFiltered, IdError, generate_id_type}; use stepflow_data::{StateData, StateDataFiltered, var::{Var, VarId}, value::Value}; use stepflow_step::{Step, StepId}; use stepflow_action::{Action, ActionResult, ActionId}; us...
use std::io::{Cursor, SeekFrom, Seek}; use byteorder::{LittleEndian, ReadBytesExt}; use std::fmt::{Debug, Formatter}; use crate::errors::*; use crate::read_string::*; fn is_reader_at_end(reader: &mut Cursor<&[u8]>) -> bool { let current_pos = reader.position(); if let Err(_) = reader.seek(SeekFrom::End...
// Copyright (c) 2016-2020 Memgraph Ltd. [https://memgraph.com] // // 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 ...
use crate::common::Result; use crate::native::mbuf::MBuf; use crate::packets::checksum::PseudoHeader; use crate::packets::ip::v6::Ipv6Packet; use crate::packets::ip::{IpPacket, ProtocolNumber}; use crate::packets::{buffer, CondRc, Fixed, Header, Packet, ParseError}; use failure::Fail; use std::fmt; use std::net::{IpAdd...
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may...
use std::cmp::Ordering; // TODO consider porting version from https://github.com/JuliaMath/openlibm // Do some performance testing on the erf functions // because for some reason it's still about 5ns slower // than the C version on my computer /* origin: FreeBSD /usr/src/lib/msun/src/s_erf.c */ /* * ===============...
// SPDX-License-Identifier: Apache-2.0 // Copyright 2021 Keylime Authors use std::convert::{TryFrom, TryInto}; use std::io::prelude::*; use std::str::FromStr; use crate::{ common::config_get, quotes_handler::KeylimeIdQuote, Error as KeylimeError, QuoteData, Result, }; use actix_web::web::Data; use openssl::...
use cranelift::codegen::ir::{condcodes, types, MemFlags}; use cranelift::prelude::{FunctionBuilder, InstBuilder, Type as IrType, Value as IrValue}; use cranelift_module::Backend; use log::debug; use super::{Compiler, Id}; use crate::data::prelude::*; use crate::data::{ lex::{AssignmentToken, ComparisonToken, Liter...
// Copyright 2018-2019 <NAME> <<EMAIL>> // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in...
//! //! This crate helps writing [extcap][wireshark-extcap] plugins for [Wireshark][wireshark]. //! //! See [Extcap: Developer Guide][wireshark-extcap-dev] also. //! //! [wireshark]: https://www.wireshark.org/ //! [wireshark-extcap]: https://www.wireshark.org/docs/man-pages/extcap.html //! [wireshark-extcap-dev]:https:...
// Copyright (c) 2018-2021 The MobileCoin Foundation //! A wrapper for sgx_report_body_t use crate::{ _macros::FfiWrapper, attributes::{Attributes, ATTRIBUTES_SIZE}, config_id::{ConfigId, CONFIG_ID_SIZE}, cpu_svn::{CpuSecurityVersion, CPU_SECURITY_VERSION_SIZE}, ext_prod_id::{ExtendedProductId, EX...
//! The home of the [`Pipeline`]. //! //! The high level overview of what a [`Pipeline`] is and how it works is in the //! [`fragment`][crate::fragment] module. //! //! The rest of the things here is mostly support plumbing and would optimally be hidden out of the //! public interface, but it needs to be public due to ...
use std::collections::{HashMap, HashSet}; use std::convert::TryInto; #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)] struct Point { x: i32, y: i32, } impl Point { fn new(x: i32, y: i32) -> Self { Self { x: x, y: y } } fn manhattan_distance(&self, other: &Point) -> i32 { (other....
use std::collections::BTreeSet; use std::io::Write; use std::num::NonZeroUsize; use anyhow::Error; use metagoblin::pe; use metagoblin::pe::characteristic::*; use metagoblin::pe::data_directories::DataDirectories; use metagoblin::pe::export::{Export, Reexport}; use metagoblin::pe::header::*; use metagoblin::pe::import:...
mod db; mod records; pub use db::Key; pub use records::{BlockRecord, FileRecord, RecordType}; use crate::{ coins::UndoCoins, db::{Batch, Database, DiskDatabase, IterMode}, error::DBError, }; use bitcoin::{ consensus::serialize, consensus::{deserialize, Decodable, Encodable}, hashes::Hash, ...
use std::ops::Range; use crate::float::{Fallback, Float, Inside, Interval}; use crate::prob::Prob; use itertools::Itertools; /// Cubic spline modeling 1D function. /// /// - Build a `CubicSpline` from samples using `from_samples()`, /// - `evaluate()` the spline at any x-value. pub struct CubicSpline { m: Vec<f32...