text
stringlengths
7.05k
33.9k
use gtk::prelude::*; use log::{debug, trace}; use std::{ boxed::Box, cell::RefCell, collections::Bound::Included, rc::Rc, sync::{Arc, Mutex}, }; use media::{DoubleAudioBuffer, Timestamp, QUEUE_SIZE}; use metadata::{Duration, MediaInfo}; use renderers::{DoubleWaveformRenderer, ImagePositions, Wavef...
const DEFAULT_NO_MANS_LAND: [Tile; 10] = [Tile::Empty, Tile::Empty, Tile::Terrain, Tile::Terrain, Tile::Empty, Tile::Empty, Tile::Terrain, Tile::Terrain, Tile::Empty, Tile::Empty]; const TERRAIN_DISP_CHAR: &str = "~"; const HIDDEN_DISP_CHAR: &str = "▇"; #[derive(Copy, Clone, Eq, PartialEq, Debug)] pub en...
use {Task, TaskBox}; use state::{AtomicState, Lifecycle, CAPACITY}; use two_lock_queue::{self as mpmc, SendError, SendTimeoutError, TrySendError, RecvTimeoutError}; use num_cpus; use std::{fmt, thread, usize}; use std::sync::{Arc, Mutex, Condvar}; use std::sync::atomic::AtomicUsize; use std::sync::atomic::Ordering::Re...
/************************************************ File Name: gadu:server Author: <NAME> <<EMAIL>> Date: 2019-02-17:15:15 License: Apache 2.0 **************************************************/ use mio::*; use mio::net::TcpListener; use mio_uds::UnixListener; //#[cfg(feature = "tls")] use openssl::error:...
use std::collections::{BTreeMap, HashSet}; use serde::{Deserialize, Serialize}; use abstutil::Timer; use geom::{Circle, Distance, Duration, FindClosest, PolyLine}; use map_gui::tools::ChooseSomething; use map_model::{Path, PathStep, NORMAL_LANE_THICKNESS}; use sim::{TripEndpoint, TripMode}; use widgetry::{ Choice...
use crate::errors; use crate::parse_util; use chrono; use lyon_geom; use lyon_path; use serde::{de, Deserialize, Serialize}; pub mod units { pub struct Meter; } //pub mod types; pub use crate::types; #[derive(Debug, Serialize, Deserialize)] #[serde(rename = "OpenDRIVE")] pub struct Root { pub header: Header...
use std::collections::HashMap; use std::fmt::{self, Debug}; use std::time::Duration; use log::{debug, info, warn}; use reqwest::{Client as HttpClient, ClientBuilder, RequestBuilder}; use serde::{Deserialize, Serialize}; const NOMAD_AUTH_HEADER: &str = "X-Nomad-Token"; const NOMAD_INDEX_HEADER: &str = "X-Nomad-Index";...
// Copyright (c) 2021 <NAME> <<EMAIL>>. All rights reserved. // Use of this source is governed by Apache-2.0 License that can be found // in the LICENSE file. //! from sys/sys/signal.h use core::fmt; use crate::{lwpid_t, pid_t, sigset_t, size_t, uid_t, __MINSIGSTKSZ}; /// System defined signals. /// hangup pub cons...
use crate::*; use datamodel::{dml, DefaultValue, Ignorable, WithDatabaseName}; use itertools::Itertools; pub struct DatamodelConverter<'a> { datamodel: &'a dml::Datamodel, relations: Vec<TempRelationHolder>, } impl<'a> DatamodelConverter<'a> { pub fn convert_string(datamodel: String) -> InternalDataModelT...
use crate::hir::place::{ Place as HirPlace, PlaceBase as HirPlaceBase, ProjectionKind as HirProjectionKind, }; use crate::ty; use rustc_data_structures::fx::{FxHashMap, FxIndexMap}; use rustc_hir as hir; use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_hir::lang_items::LangItem; use rustc_span::Span; use sup...
use anyhow::{anyhow, bail, ensure, Context, Error, Result}; use blindai_common::SgxCollateral; use der_parser::{ der::*, error::{self, BerError, BerResult}, nom::combinator::map, }; use sgx_quote::{QeCertificationData::CertChain, Quote}; use sgx_types::*; use std::{convert::TryInto, ffi::CString, fmt::Debug...
#![allow(clippy::integer_arithmetic)] use bincode::serialized_size; use log::*; use rayon::prelude::*; use rayon::{ThreadPool, ThreadPoolBuilder}; use serial_test::serial; use solana_core::cluster_info; use solana_core::contact_info::ContactInfo; use solana_core::crds_gossip::*; use solana_core::crds_gossip_error::Crds...
// Copyright 2017 Mozilla Foundation // // 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...
use std::{ collections::{BTreeMap, HashMap}, net::IpAddr, path::PathBuf, str::FromStr, sync::{Arc, RwLock, RwLockWriteGuard}, time::Duration, }; use ipnetwork::IpNetwork; use log::{error, info, warn}; use tokio::sync::RwLockReadGuard; use trust_dns_resolver::{ config::NameServerConfigGroup,...
use libc::c_char; use crate::{backends, key::Key, Backend, KeyPair, PeerConfigBuilder}; use std::{ borrow::Cow, ffi::CStr, fmt, io, net::{IpAddr, SocketAddr}, str::FromStr, time::SystemTime, }; /// Represents an IP address a peer is allowed to have, in CIDR notation. #[derive(PartialEq, Eq, C...
use std::io; use std::io::Read; use std::io::Seek; use std::io::SeekFrom::Start; use std::fs::File; use std::fmt; use std::str::from_utf8; use crate::lsdj::err; const TITLE_TABLE_ADDRESS : u64 = 0x8000; const TITLE_LENGTH : usize = 8; const SONG_SLOTS : usize = 0x20; const _TITLE_TABLE_LENGTH :...
// 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...
//! The `point` module defines the `Point` struct, which represents an N-dimensional point. //! These `Points` are suitable for the Hilbert Transformation, because they do not have negative values //! and the total number of bits required to represent each coordinate is controlled by the construction process. //! //! ...
/*! Mapping complex text to a sequence of positioned glyphs. */ pub mod cluster; mod aat; mod at; mod buffer; mod cache; mod engine; mod feature; use cluster::*; use super::{ cache::FontCache, charmap::Charmap, internal, metrics::Metrics, setting::TagAndValue, FontRef, NormalizedCoord, }; use crate::text::{...
use std::{ fmt, fs::File, iter, }; use failure::{Error, ResultExt}; use term_painter::{Color, ToStyle, Style, Painted}; use lox::{ prelude::*, algo::bounding::BoundingBox, fat::AnyMesh, io::{ stl, ply, ColorType, FileFormat, FileEncoding, PrimitiveType, PrimitiveColorChannel...
use anyhow::{ensure, Result}; use std::fmt; use std::fs::File; use std::io::prelude::*; fn main() -> Result<()> { let mut content = String::new(); let mut file = File::open("input.txt")?; file.read_to_string(&mut content)?; let (mut asteroid_map, xsize, ysize) = parse_map(content)?; // dump_map(&...
extern crate regex; #[macro_use] extern crate lazy_static; extern crate utils; use std::fmt; use std::error::Error; use std::io::{self, BufReader}; use std::io::prelude::*; use std::fs::File; use regex::Regex; use utils::*; fn parse_input(input: &Vec<String>) -> (usize, Vec<Instruction>) { lazy_static! { ...
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 use std::str::from_utf8; use common::ascii::{CR, CRLF_LEN, LF, SP}; pub use common::RequestError; use common::{Body, Method, Version}; use headers::Headers; // Helper functions used for parsing the HTTP ...
//! The Token module defines the different lexical tokens in the Arvo //! programming language, and defines some basic operations on these tokens. // External crate dependencies use regex; use std::char; use std::fmt; use std::str::FromStr; use super::span::{Span, Spanned}; #[derive(Clone, Debug, Eq, Ord, PartialEq...
//! The ic-starter provides a minimal functioning environment for a single //! replica to be used with the SDK. //! //! Minimal example use, from the rs/ directory: //! cargo run --bin ic-starter //! This will: //! - compile the replica with the default cargo build options //! - start the built replica, listeni...
use std::marker::PhantomData; use bellperson::{Circuit, ConstraintSystem, SynthesisError}; use ff::Field; use fil_sapling_crypto::circuit::boolean::Boolean; use fil_sapling_crypto::circuit::num::{AllocatedNum, Num}; use fil_sapling_crypto::circuit::{boolean, num, pedersen_hash}; use fil_sapling_crypto::jubjub::JubjubE...
//! # DFU bootloader //! //! Example DFU bootloader for "Bluepill" board. //! //! There are two modes of operation: minimal and DFU. //! //! After reset, bootloader starts in a minimal mode, //! it's goal is to determine if bootloader must switch //! to DFU mode, and if not, try to jump to a main //! firmware. //! //! ...
#[doc = "Reader of register BAUDRATE"] pub type R = crate::R<u32, super::BAUDRATE>; #[doc = "Writer for register BAUDRATE"] pub type W = crate::W<u32, super::BAUDRATE>; #[doc = "Register BAUDRATE `reset()`'s with value 0x0400_0000"] impl crate::ResetValue for super::BAUDRATE { type Type = u32; #[inline(always)]...
use crate::log; use crate::state::State; use std::io::prelude::*; use std::io::BufReader; use std::path::Path; use std::process::{Command, Stdio}; use anyhow::{bail, Context, Result}; use convlog::mjai::Event; use convlog::Pai; use serde::{Deserialize, Serialize}; use serde_json as json; use serde_with::{serde_as, Dis...
use crate::bot::logic; use crate::bot::logic::{DeleteSubscriptionError, SubscriptionError}; use crate::bot::telegram_client::Api; use crate::bot::telegram_client::Error; use crate::db; use crate::db::telegram::NewTelegramChat; use frankenstein::Chat; use frankenstein::ChatIdEnum; use frankenstein::Message; use frankens...
/*! Asset management [`Asset<T>`] is a shared reference of an asset item. Any type of `Asset` is stored in [`AssetCache`]. # Asset path Asset directory is assumed to be at `manifest_dir/assets`. [`AssetKey`] is either of the two: * "relative/path/from/the/asset/directory" * "scheme:relative/path/from/the/scheme/dir...
// The rustc-cfg emitted by the build script are *not* public API. #![warn(rust_2018_idioms, single_use_lifetimes)] use std::{ env, io::Write, process::{Command, Stdio}, str, sync::atomic::{AtomicUsize, Ordering}, }; include!("no_atomic.rs"); // rustc +stable -Vv | grep -E '^(commit-date|release...
// "Tifflin" Kernel // - By <NAME> (thePowersGang) // // Core/gui/input/mod.rs //! GUI input managment #[allow(unused_imports)] use kernel::prelude::*; use self::keyboard::KeyCode; use core::sync::atomic::{Ordering,AtomicUsize,AtomicU8}; use kernel::sync::Mutex; pub mod keyboard; pub mod mouse; #[derive(Debug)] pub e...
use byteorder::WriteBytesExt; use memmap::{Mmap, Protection}; use regex::bytes::Regex; use std::env; use std::ffi::{OsStr, OsString}; use std::fmt; use std::fs; use std::fs::{File, OpenOptions}; use std::io; use std::io::{BufReader, Cursor}; use std::io::prelude::*; use std::path::{MAIN_SEPARATOR, Path, PathBuf}; use s...
// Copyright 2020 <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 wri...
//! Utility functions. use std::collections::{HashMap, HashSet}; use std::convert::TryInto; use std::env; use std::io::{stderr, stdout, Write}; use std::path::PathBuf; use std::process::{Command, ExitStatus, Stdio}; use std::str::FromStr; use anyhow::Context; use fn_error_context::context; use git2::ErrorCode; use lo...
use imgui::{ Context, DrawCmd::Elements, DrawData, DrawIdx, DrawList, DrawVert, TextureId, Textures, }; use smallvec::SmallVec; use std::mem::size_of; use wgpu::util::{BufferInitDescriptor, DeviceExt}; use wgpu::*; pub type RendererResult<T> = Result<T, RendererError>; #[repr(transparent)] #[derive(Debug, Copy, C...
use anyhow::{anyhow, Result}; use clap::arg_enum; use log::{debug, info}; use rayon::prelude::*; use reqwest::blocking::Client; use reqwest::{self}; use serde::{Deserialize, Serialize}; use std::convert::TryInto; use std::fs::OpenOptions; use std::io::{BufWriter, Write}; use std::path::Path; use std::time::{Duration, I...
//! This module optimises the model to best match crack growth measurements. //! use std::error::Error; use std::f64; use std::fs::File; use std::io::{BufRead, BufReader}; use std::path::Path; use std::process; use nelder; use options; use options_clap::get_options_clap; use fatigue::{beta, cycle, dadn, grow, plastic,...
//! Text related stuff for the coregraphics backend use std::marker::PhantomData; use core_foundation_sys::base::CFRange; use core_graphics::base::CGFloat; use core_graphics::context::CGContextRef; use core_graphics::geometry::{CGPoint, CGRect, CGSize}; use core_graphics::path::CGPath; use core_text::font::{self, CTF...
// Copyright (c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 // Analysis pass which analyzes how to injects global invariants into the bytecode. use crate::{ function_target::{FunctionData, FunctionTarget}, function_target_pipeline::{ FunctionTargetProcessor, FunctionTargetsHolde...
use crate::engine::timeout; use async_trait::async_trait; use error_chain::bail; use fxhash::FxHashMap; use std::ops::Deref; use std::ops::DerefMut; use std::ops::Rem; use std::sync::Mutex as StdMutex; use std::sync::RwLock as StdRwLock; use std::time::Duration; use std::time::Instant; use std::{sync::Arc, sync::Weak};...
//! Port of https://github.com/styled-components/babel-plugin-styled-components/blob/a20c3033508677695953e7a434de4746168eeb4e/src/visitors/transpileCssProp.js use inflector::Inflector; use once_cell::sync::Lazy; use regex::Regex; use swc_atoms::{js_word, JsWord}; use swc_common::{util::take::Take, Spanned, DUMMY_SP}; ...
// 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 { anyhow::{format_err, Error}, fidl::encoding::Decodable as FidlDecodable, fidl::endpoints::{create_proxy, create_request_stream}, fidl...
use std::fmt; use std::io::{self, Read}; use cpu; // TODO: Enable speed switch for gbc const HIGH_RAM_BASE: u16 = 0xfe00; #[derive(Copy, Clone, PartialEq)] enum MbcType { MbcNone, Mbc1, Mbc2, Mbc3, } // TODO: Support other cartridge types. Only suppors mbc1 now. struct Cartridge { // 0000-3FFF ...
use std::env; // use std::io::prelude::*; use std::io::prelude::*; use std::path::{Path, PathBuf}; use std::process::Command; use zip; use bindgen; fn main() { let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap(); let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); let (tfversion, version) = ...
#![allow(dead_code)] use super::vcpu::GuestState; use alloc::vec::Vec; use bit_field::BitField; use core::convert::TryFrom; use lazy_static::lazy_static; use numeric_enum_macro::numeric_enum; use raw_cpuid::CpuIdResult; pub fn cpuid(sel: u32, guest_state: &mut GuestState) { let res = raw_cpuid::cpuid!(sel); g...
extern crate hal; extern crate arrayfire as af; extern crate itertools; extern crate rand; #[macro_use] extern crate timeit; use std::env; use af::{Array, Dim4, Backend, DType}; use itertools::Zip; use rand::distributions::{IndependentSample, Range}; use hal::{utils, activations, initializations, loss}; use hal::laye...
use crate::elaborate::*; use crate::error::*; use crate::pretty::Style; use crate::term::*; use std::collections::HashSet; use std::sync::{Arc, Mutex}; macro_rules! intern_id { ($name:ident, $doc:expr) => { #[doc=$doc] #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] pub ...
// Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 use admission_control_proto::proto::{ admission_control::{ SubmitTransactionRequest, SubmitTransactionResponse as ProtoSubmitTransactionResponse, }, admission_control_grpc::AdmissionControlClient, }; use client::{Ac...
use kernel::common::StaticRef; use kernel::common::registers::{ReadOnly, ReadWrite, register_bitfields}; use crate::cgu; /// Clock Control Unit (CCU) #[repr(C)] struct Ccu1Registers { /// CCU1 power mode register pm: ReadWrite<u32>, /// CCU1 base clocks status register base_stat: ReadOnly<u32, BASE_STAT::Register...
//! Provides parsing and manipulation for DNS packets mod character_string; mod name; mod packet; mod packet_header; mod question; pub mod rdata; mod resource_record; use std::{collections::HashMap, convert::TryFrom}; pub use character_string::CharacterString; pub use name::Name; pub use packet::{Packet, PacketBuf, ...
use rustednes_common::debugger::{DebugEmulator, Debugger}; use rustednes_common::emulation_mode::EmulationMode; use rustednes_common::state::StateManager; use rustednes_common::time::TimeSource; use rustednes_core::cartridge::Cartridge; use rustednes_core::cpu::CPU_FREQUENCY; use rustednes_core::input::Button; use rus...
mod addressing; mod instructions; mod registers; use self::addressing::*; use bus::{Addressable, Bus, IO_IE_ADDR, IO_IF_ADDR}; use byteorder::{ByteOrder, LittleEndian}; use enum_primitive::FromPrimitive; use self::instructions as inst; use self::registers::*; use std::fmt; pub use self::instructions::{decode, Instruc...
use std::collections::HashMap; use std::fmt::{Display, Formatter}; use legion::{Entity, EntityStore, IntoQuery}; use legion::world::SubWorld; use rand::{thread_rng, Rng}; use scion::{ core::{ components::{ material::Material, maths::{ collider::{Collider, ColliderMas...
// Copyright 2015 <NAME> // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to those...
use std::io::Cursor; use std::io::{Seek, SeekFrom}; use super::arm7tdmi::{Addr, Bus}; use super::ioregs::consts::*; use super::palette::{Palette, PixelFormat, Rgb15}; use super::*; use crate::bit::BitIndex; use crate::byteorder::{LittleEndian, ReadBytesExt}; use crate::num::FromPrimitive; const VRAM_ADDR: Addr = 0x0...
use std::{ collections::HashMap, convert::TryInto, sync::{Arc, RwLock}, }; use anyhow::{bail, Context}; use crate::{alien::send, log}; mod galaxy; pub use self::galaxy::GalaxyProtocol; mod statelessdraw; pub use statelessdraw::StatelessdrawProtocol; mod statefuldraw; pub use statefuldraw::StatefuldrawP...
/* * 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...
// Copyright 2019 Zhizhesihai (Beijing) Technology 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 a...
//! Slow, fallback cases where we cannot unambiguously round a float. //! //! This occurs when we cannot determine the exact representation using //! both the fast path (native) cases nor the Lemire/Bellerophon algorithms, //! and therefore must fallback to a slow, arbitrary-precision representation. #![doc(hidden)] ...
use crate::db::{ DBTransactionSerde, DatabaseValueID, DatabaseValueRead, DatabaseValueWrite, KeyValueDBSerde, KeyValueDBStore, }; use crate::error::CostingError; use crate::expense::{Expense, ExpenseCategory}; use crate::settlement::Settlement; use crate::{ actions::TabUserActionType, user::{User, UserI...
//! Indexing on top of a `Table`. //! //! It is anticipated that most uses cases will be covered by //! [HashIndexing](struct.HashIndexing.html), which owns a //! [Table](../struct.Table.html) and provides bidirectional mappings between //! data values and their symbols. //! //! The [Indexing](trait.Indexing.html) trai...
use crate::{ device::{DeviceError, HostMap, MissingFeatures}, hub::{Global, GlobalIdentityHandlerFactory, HalApi, Resource, Token}, id::{DeviceId, SurfaceId, TextureId, Valid}, init_tracker::BufferInitTracker, track::{TextureSelector, DUMMY_SELECTOR}, validation::MissingBufferUsageError, Lab...
use alloc::string::String; use crate::{idl::{JS_AST, JS_Schema}, pointer::NP_Cursor, schema::NP_Value_Kind}; use crate::{json_flex::JSMAP}; use crate::pointer::{NP_Value}; use crate::{memory::{NP_Memory}, schema::{NP_Schema, NP_TypeKeys, NP_Parsed_Schema}, error::NP_Error, json_flex::NP_JSON}; use alloc::string::ToStr...
use crate::lexer::Lexeme; use crate::lexer::Lexer; use crate::lexer::LexerStats; use crate::lexer::Token; use crate::semantics::FunctionType; use crate::semantics::FunctionTypeRef; use crate::semantics::Type; use crate::source::Source; use std::collections::HashMap; use std::error::Error; use std::fmt::Debug; use std::...
//! Mempool is simple in memory buffer for transactions. //! //! Its role is to: //! 1) Accept transactions from api, check signatures and basic nonce correctness(nonce not too small). //! To do nonce correctness check mempool stores mapping `AccountAddress -> Nonce`, this mapping is updated //! when new block is commi...
//! The "MNIST" database of handwritten digits from mldata.org. use std::fs; use std::path; use app_dirs::*; use ndarray::{Array1, Array2, Array3, ArrayView2, Axis, Zip}; use utils::downloader::assure_file; use utils::error::Error; use utils::hdf5; use utils::hdf5::DynamicArray; use canonical::CanonicalData; use co...
use serde::{Deserialize, Serialize}; use std::{ collections::{HashMap, VecDeque}, ops::{Deref, DerefMut}, sync::{ mpsc::{channel, Receiver, RecvError, SendError, Sender, TryRecvError}, Arc, Mutex, }, thread::JoinHandle, time::Instant, }; use crate::{ camera::{Camera, CameraP...
#![deny(rust_2018_idioms)] #![allow( clippy::too_many_arguments, clippy::expect_fun_call, clippy::or_fun_call )] // TODO: choose story beat time in tags (or at least a multiplier or something) // maybe the top tag is the default, but it can be overwritten by knot tags? // maybe there's a discor...
use crate::catch_up_package_provider::CatchUpPackageProvider; use crate::error::{OrchestratorError, OrchestratorResult}; use crate::registry_helper::RegistryHelper; use crate::replica_process::ReplicaProcess; use crate::utils; use ic_http_utils::file_downloader::FileDownloader; use ic_interfaces::registry::RegistryClie...
#[cfg(feature = "tilemap_json")] pub mod pyxeledit; #[cfg(feature = "tilemap_xml")] pub mod tiled; pub mod tile_animation; use std::collections::HashMap; use log::{info,debug,error}; use tetra::graphics::{Texture, Color, Rectangle, Drawable, DrawParams}; use tetra::Context; use tetra::math::Vec2; #[cfg(feature = "tile...
// Copyright Materialize, 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 ...
use consts::*; use error::*; use libwhp::instruction_emulator::*; use libwhp::*; use std; use std::borrow::BorrowMut; use vm::VirtualCPU; use x86::controlregs::*; const CPUID_EXT_HYPERVISOR: UINT32 = 1 << 31; fn handle_cpuid_exit(vp: &mut VirtualProcessor, exit_context: &WHV_RUN_VP_EXIT_CONTEXT) { let cpuid_access =...
// 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. //! TCP state machine per [RFC 793](https://tools.ietf.org/html/rfc793). use super::{ segment::{Payload, Segment}, seqnum::SeqNum, Control, Us...
//! # Graph Module //! //! Combine different tokens together. //! //! ### Terminology //! //! * **Link:** Link a token to another token and the linked token must be NFT. //! * **Parent NFT:** Linked NFT. //! * **Child Token:** Link to the parent's token. //! * **Ancestor NFT:** NFT located before parent NFT or parent N...
#![cfg_attr(not(feature = "std"), no_std)] extern crate alloc; mod mint_provider; mod queue; mod queue_provider; mod runtime_provider; mod stakes; mod stakes_provider; use types::{ account::{PublicKey, PurseId}, system_contract_errors::pos::{Error, Result}, AccessRights, TransferredTo, URef, U512, }; pu...
use std::cmp::min; use crate::{ config::{self, get_configuration}, error::{InquireError, InquireResult}, formatter::{StringFormatter, DEFAULT_STRING_FORMATTER}, input::Input, list_option::ListOption, terminal::get_default_terminal, type_aliases::{Completer, Suggester}, ui::{Backend, Key...
use std::iter; use swc_atoms::js_word; use swc_common::{util::take::Take, Mark, Span, DUMMY_SP}; use swc_ecma_ast::*; use swc_ecma_transforms_base::helper; use swc_ecma_utils::{alias_ident_for, is_rest_arguments, private_ident, quote_ident, ExprFactory}; use swc_ecma_visit::{noop_visit_mut_type, VisitMut, VisitMutWith...
/* * Copyright (c) 2021 gematik GmbH * * 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 agr...
#![allow(non_snake_case)] use crate::math_utils::inner_product; use crate::multiproof::CRS; use crate::transcript::{Transcript, TranscriptProtocol}; use ark_ec::group::Group; use ark_ec::{AffineCurve, ProjectiveCurve}; use ark_ff::Field; use ark_ff::PrimeField; use ark_ff::{One, Zero}; use ark_serialize::{CanonicalDese...
//! Data flow analysis. use std::collections::HashMap; use std::io::{self, Write}; use std::rc::Rc; use crate::x86_64::Register; use crate::math::{SymCondition, Integer, Symbol, SharedSolver, Solver}; use crate::sym::{SymState, Event, MemoryStrategy, TypedMemoryAccess, SymbolMap, StdioKind}; use super::*; /// Conta...
use std::{ any::Any, collections::{HashMap, HashSet}, fmt::Display, io::{Read, Write}, mem::ManuallyDrop, net::SocketAddr, net::{TcpListener, TcpStream, ToSocketAddrs}, sync::{ atomic::{AtomicBool, Ordering}, Arc, }, thread, thread::JoinHandle, time::{Dura...
use std::ops::Index; use crate::{grain::Grain, matrix::Matrix}; use halo2curves::FieldExt; /// `State` is structure `T` sized field elements that are subjected to /// permutation #[derive(Clone, Debug, PartialEq)] pub struct State<F: FieldExt, const T: usize>(pub(crate) [F; T]); impl<F: FieldExt, const T: usize> Def...
/// "solve" ast-based expressions by converting to another form. /// /// the tests in this module use command line options to show or hide diagrams. /// -a show AST (problem statement) /// -r show result (BDD, ANF, etc) /// /// note that you need to use two '--' parameters to pass arguments to a test. /// /// s...
#![deny(warnings)] #![allow(non_camel_case_types)] #![allow(clippy::all)] #![no_std] mod generic; pub use generic::*; #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Timer Channel Compare Register 1"] pub comp10: COMP1, #[doc = "0x02 - Timer Channel Compare Register 2"] ...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Data Out 0 to 3 Alias register for byte access to each bit in DOUT31_0"] pub dout3_0: DOUT3_0, #[doc = "0x04 - Data Out 4 to 7 Alias register for byte access to each bit in DOUT31_0"] pub dout7_4: DOUT7_4, #[doc = "0x08...
// Copyright (c) 2018-2020 MobileCoin Inc. //! The entity that manages cached transactions on the untrusted side. use crate::counters; use attest_enclave_api::{EnclaveMessage, PeerSession}; use common::{ logger::{log, Logger}, HashMap, HashSet, }; use consensus_enclave::{ ConsensusEnclaveProxy, Error as C...
#![cfg_attr(target_os = "none", no_std)] #![cfg_attr(target_os = "none", no_main)] use log::{error, info}; mod api; use api::{Opcode, ClipObject, ClipObjectType}; use core::pin::Pin; use rkyv::{archived_value, Unarchive, archived_value_mut}; mod backend; use backend::XousDisplay; mod op; use core::convert::TryFro...
use std::fmt::{Debug, Display}; use std::hash::Hash; use std::iter::{Product, Sum}; use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign}; use num::bigint::BigUint; use num::{Integer, One, ToPrimitive, Zero}; use plonky2_util::bits_u64; use rand::Rng; use serde::de::DeserializeOwned; use ...
// Copyright 2014-2016 <NAME>. // Licensed under the MIT license (http://opensource.org/licenses/MIT) // This file may not be copied, modified, or distributed // except according to those terms. //! A pair Hidden Markov Model for calculating the probability that two sequences are related to //! each other. Depending o...
//! A parser for the WebAssembly Interface Types binary section. //! //! This crates is intended to provide the low-level parsing support for //! WebAssembly Interface Types. The official specification has no mention of //! the binary encoding, so this is currently an invented format. This will only //! work when paire...
extern crate dirs; extern crate toml; #[macro_use] extern crate serde_derive; extern crate interactor; extern crate reqwest; extern crate base64; extern crate chrono; #[macro_use] extern crate clap; extern crate crypto; extern crate hmac; extern crate hyper; extern crate rustc_serialize; extern crate sha2; extern crat...
/* SPDX-License-Identifier: Apache-2.0 OR MIT */ use crate::errors::{BulletproofError, BulletproofErrorKind}; use crate::transcript::TranscriptProtocol; use amcl_wrapper::field_elem::{FieldElement, FieldElementVector}; use amcl_wrapper::group_elem::{GroupElement, GroupElementVector}; use amcl_wrapper::group_elem_g...
use super::*; use crate::util::*; use core::convert::TryFrom; use core::mem; use gdnative::core_types::*; use rapier3d::geometry::{Collider, ColliderBuilder, SharedShape}; use rapier3d::math::Point; use rapier3d::na::{DMatrix, Dynamic, Isometry3, Matrix, Matrix3x1, Point3}; #[derive(Copy, Clone, Debug)] enum Type { P...
use rustc::mir; use rustc::ty::layout::{HasDataLayout, LayoutOf, TyLayout}; use rustc::ty::{self, Ty, TyCtxt}; use rustc_data_structures::indexed_vec::Idx; use error::{EvalError, EvalResult}; use eval_context::{EvalContext, ValTy}; use memory::{MemoryPointer}; use value::{PrimVal, PrimValKind, Value}; #[derive(Copy, ...
use std::fmt; use rand::Rng; use crate::game::{Game, Player, Infoset}; /// no rng can make some analyses easier, but it's not accurate to the real game const FORCE_NO_RNG: bool = false; #[derive(Copy, Clone, Debug, PartialEq)] pub enum Card { Skull, Flower, } #[derive(Copy, Clone, Debug, PartialEq)] pub enu...
//! **Experimental** meshlet building and cluster bounds generation use crate::quantize::quantize_snorm; use crate::util::zero_inverse; use crate::vertex::Position; use std::convert::TryInto; /// Bounds returned by `compute_cluster/meshlet_bounds`. /// /// `cone_axis_s8` and `cone_cutoff_s8` are stored in 8-bit SNOR...
mod structs; use structs::*; use crate::util::{Matrix, MessageExt}; use serenity::{ cache::Cache, client::Context, framework::standard::{ macros::help, Args, CheckResult, Command as InternalCommand, CommandGroup, CommandOptions, CommandResult, CommonOptions, HelpBehaviour, HelpOptions, On...
//! APIs for working with the source code associated with a `Project`'s //! Docker images. use compose_yml::v2 as dc; use std::collections::btree_map; use std::collections::BTreeMap; #[cfg(test)] use std::fs; use std::path::{Path, PathBuf}; #[cfg(test)] use crate::command_runner::TestCommandRunner; use crate::command...