text
stringlengths
3.09k
13.9k
extern crate camera_capture; #[macro_use] extern crate failure; #[macro_use] extern crate glium; extern crate image; use std::time::Duration; use std::sync::mpsc::{self, Receiver}; use std::thread::{self, JoinHandle}; use failure::{Error, SyncFailure}; use glium::texture::{CompressedSrgbTexture2d, RawImage2d}; use g...
//! A [twelve-factor application][1] reads [its configuration][2] from the environment. //! //! In many cases, "read" directly maps to the target binary inspecting the //! OS-provided environment dictionary. This module provides supporting tools //! for reading configuration data from the environment, via `std::env`, a...
use pulldown_cmark::{html, CowStr, Event, Options, Parser, Tag}; use regex::Regex; #[derive(Debug, PartialEq, Eq, Hash, Clone)] pub(crate) struct HashTag(pub String); fn parse_hash_tag(mut callback: impl FnMut(HashTag)) -> impl FnMut(Event) -> Vec<Event> { let mut in_a_link = false; move |event| match (event,...
extern crate advent_of_code_2017; use advent_of_code_2017::*; use std::str::FromStr; use std::collections::HashMap; use std::sync::mpsc::*; fn main() { let args = AdventArgs::init(); let instructions: Vec<Instruction> = args.input.iter() .map(|line| line.parse().unwrap()) .collect(); let...
use crate::noise::{Cipher, HandshakeResult}; use futures::io::AsyncRead; use futures::stream::{FusedStream, Stream}; use futures_timer::Delay; use std::future::Future; use std::io::{Error, ErrorKind, Result}; use std::pin::Pin; use std::task::{Context, Poll}; use crate::constants::{DEFAULT_TIMEOUT, MAX_MESSAGE_SIZE}; ...
/* Day 15: Chiton The 2d square grid represents a risk level due to the walls being covered with Chitons. You can move from one grid to the next up, down, left, or right (not diagonal). For the total cost in risk starting at 0,0 (the start space risk doesn't count), and ending in the botton right corner of the grid if...
// Copyright 2020 The BitcoinMW Developers // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ...
use std::io::Write; use flatbuffers::{FlatBufferBuilder, WIPOffset}; use serde::{Deserialize, Serialize}; use crate::{Result, Variables}; use crate::zkinterface_generated::zkinterface as fb; use std::convert::TryFrom; use std::error::Error; #[derive(Clone, Default, Debug, Eq, PartialEq, Deserialize, Serialize)] pub st...
use criterion::{black_box, criterion_group, criterion_main, Criterion}; use criterion::measurement::WallTime; mod model_checking; use model_checking::helper_methods::*; use model_checking::decomp_team_mdp::*; use model_checking::dfa::*; use model_checking::mdp::*; use std::fs::File; use std::io::Write; use petgraph::{...
use aes_gcm_siv::Aes256GcmSiv; use aes_gcm_siv::aead::{Aead, NewAead}; use core_lib::errors::*; use core_lib::model::crypto::{KeyEntry, KeyMap}; use generic_array::GenericArray; use hkdf::Hkdf; use openssl::rand::rand_bytes; use sha2::Sha256; use std::collections::HashMap; use crate::model::doc_type::DocumentType; use ...
use crate::msg::Msg; use crate::SimpleModuleLoader; use crossbeam::channel::{select, Receiver, Sender}; use deno_core::anyhow::Error; use deno_core::error::AnyError; use deno_core::futures::{FutureExt, TryFutureExt}; use deno_core::RuntimeOptions; use deno_core::{v8, FsModuleLoader}; use deno_core::{JsRuntime, ModuleSp...
//! `NcSelector` widget. //! ╭──────────────────────────╮ //! │This is the primary header│ //! ╭──────────────────────this is the secondary header──────╮ //! │ ↑ │ //! │ option1 Long text #1 ...
use std::fs; use std::fs::File; use std::path::Path; use tempfile::tempdir; use crate::blobstore::BlobStore; use crate::digest; use crate::docker_saved_manifest::{DockerSavedManifest, ImageManifest}; use crate::error::Result; use crate::registry::{Manifest, ManifestDescriptor}; /// A tarball that has been generated ...
/* MIT License Copyright (c) 2021 <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, distrib...
//! Cargo-specific structures. use std::env; use std::fs::File; use std::io::{Read, Write}; use std::path::{Path, PathBuf}; use toml; use ekiden_common::error::{Error, Result}; /// Abstract crate source. pub trait CrateSource { /// Write a Cargo-compatible dependency spec to a given writer. Includes newline. ...
extern crate k8s_openapi; use anyhow::anyhow; pub mod cluster_context; pub mod logging; pub mod metadata; pub mod request; pub mod response; pub mod settings; pub mod test; use crate::metadata::ProtocolVersion; use crate::response::*; /// Create an acceptance response pub fn accept_request() -> wapc_guest::CallResu...
use crate::ffi; use std::os::raw::c_uint; /// Structure defining the settings of the OpenGL context attached to a window. /// /// `ContextSettings` allows to define several advanced settings of the OpenGL context attached /// to a window. /// /// All these settings with the exception of the compatibility flag and anti...
//! The `data` model is responsible for creation and evaluation of data in the //! moon lander domain. //! //! The center piece is [`ast::data::SensorData`](struct.SensorData.html) that //! gets evaluated by a //! [`ast::structure::Program`](../structure/enum.Program.html) to produce a //! [`ast::structure::Command`](....
use super::Transform; use crate::{ event::{self, Event}, runtime::TaskExecutor, topology::config::{DataType, TransformConfig, TransformDescription}, types::{parse_check_conversion_map, Conversion}, }; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::str; use string_cache::Def...
// Bitcoin Hashes Library // Written in 2018 by // <NAME> <<EMAIL>> // // To the extent possible under law, the author(s) have dedicated all // copyright and related and neighboring rights to this software to // the public domain worldwide. This software is distributed without // any warranty. // // You should have r...
use std::io::{self, Read}; use std::collections::BTreeMap; extern crate combine; use combine::*; use combine::char::{char, digit, spaces, string}; type Vec3 = (i64, i64, i64); fn abs_sum(p: Vec3) -> i64 { p.0.abs() + p.1.abs() + p.2.abs() } #[derive(Debug, Clone)] struct Particle { index: usize, positi...
use crate::buckets::bucket_writer::BucketItem; use crate::buckets::readers::compressed_binary_reader::CompressedBinaryReader; use crate::buckets::readers::lock_free_binary_reader::LockFreeBinaryReader; use crate::buckets::readers::BucketReader; use crate::memory_fs::RemoveFileMode; use crossbeam::channel::*; use parkin...
// We *mostly* avoid unsafe code, but `map::core::raw` allows it to use `RawTable` buckets. #![deny(unsafe_code)] #![warn(rust_2018_idioms)] #![doc(html_root_url = "https://docs.rs/indexmap/1/")] #![no_std] //! [`IndexMap`] is a hash table where the iteration order of the key-value //! pairs is independent of the hash...
use crate::keys::{Verkey, Params}; use crate::{VerkeyGroup, SignatureGroup}; use crate::amcl_wrapper::group_elem::GroupElement; use crate::signature::Signature; use crate::signature_2018::Signature as Signature18; use amcl_wrapper::field_elem::FieldElement; use crate::errors::PSError; /// PS multi-signatures using the...
//! `store` contains logic around fetching and storing modules. pub mod composite; pub mod fs; pub mod oci; use oci_distribution::client::ImageData; use oci_distribution::secrets::RegistryAuth; use std::collections::HashMap; use std::sync::Arc; use tokio::sync::Mutex; use tokio::sync::RwLock; use async_trait::async_t...
//! Types to represent HCL structures. //! //! The main types in this module are: //! //! - [`Attribute`]: represent an HCL attribute //! - [`Block`]: represent an HCL block //! - [`BlockBuilder`]: provides functionality for building `Block`s //! - [`Body`]: represent the body of an HCL configuration or block //! - [`B...
include!(concat!(env!("OUT_DIR"), "/bindings.rs")); pub type CChar = u8; use std::ffi::CString; use std::str; pub struct Scanner { data: CString, ps: *const CChar, p: *const CChar, pe: *const CChar, eof: *const CChar, checkpoint: *const CChar, token: TOK, ts: u32, te: u32, lin...
use crate::prelude::HashSet; const H3: u64 = 0xBF58_476D_1CE4_E5B9; const ARITY: usize = 3; const SEGMENT_COUNT: usize = 100; pub const SLOTS: usize = SEGMENT_COUNT + ARITY - 1; pub const FUSE_OVERHEAD: f64 = 1.0 / 0.879; impl HashSet { #[inline] pub const fn fuse_from(key: u64, segment_length: usize, seed: u...
pub(crate) mod clock; pub(crate) mod fd; pub(crate) mod osdir; pub(crate) mod osfile; pub(crate) mod oshandle; pub(crate) mod osother; pub(crate) mod path; pub(crate) mod poll; pub(crate) mod stdio; use crate::handle::HandleRights; use crate::sys::AsFile; use crate::wasi::{types, RightsExt}; use crate::{Error, Result}...
use crate::{EP_PKG_SIZE, USB_CLASS_CDC}; use usb_device::{ bus::{InterfaceNumber, StringIndex, UsbBus, UsbBusAllocator}, class::{ControlIn, ControlOut, UsbClass}, control::{Recipient, Request, RequestType}, descriptor::DescriptorWriter, endpoint::{EndpointIn, EndpointOut}, Result as UsbResult, }...
use std::{ fs::File, io::{BufReader, BufWriter}, path::PathBuf, process::Command, }; #[cfg(target_os = "linux")] use inferno::collapse::perf::{ Folder, Options as CollapseOptions, }; #[cfg(not(target_os = "linux"))] use inferno::collapse::dtrace::{ Folder, Options as CollapseOptions, }; use i...
use structopt::StructOpt; #[derive(Debug, StructOpt)] #[structopt(name = "cargo")] #[structopt( setting = structopt::clap::AppSettings::UnifiedHelpMessage, setting = structopt::clap::AppSettings::DeriveDisplayOrder, setting = structopt::clap::AppSettings::DontCollapseArgsInUsage )] pub enum Command { #...
use clap::Arg; use csv::ReaderBuilder; use failure::Error; use std::collections::HashMap; use std::io::Read; use crate::errors::EachError; use crate::formats::Format; pub const ID: &'static str = "csv"; #[derive(Default)] pub struct Csv { delimiter: Option<u8>, quote: Option<u8>, escape: Option<u8>, } impl Csv {...
use std::collections::VecDeque; use num_complex::Complex64; #[cfg(feature = "fftrust")] use num_complex::Complex; use crate::freqs::{InverseCosineTransform, ForwardRealFourier}; use crate::ringbuffer::Ringbuffer; #[cfg(feature = "fftextern")] use fftw::array::AlignedVec; #[cfg(feature = "fftrust")] type AlignedVec<T...
use bevy::prelude::*; use crate::scaling::{GraphingView, GraphingBounds}; use crate::gen_mesh::{mid_axis_count, mid_axis_diff}; #[derive(Copy, Clone, Debug)] pub struct MidAxisInfo { pub separation: f32, pub xline_count: usize, pub yline_count: usize, pub rounded_xcentre: f32, pub rounded_ycentre: ...
// Copyright 2018 Google LLC // // 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 in ...
// Author : SkwalExe // Github : https://github.com/SkwalExe use rand::Rng; use std::io::{self, BufRead}; use std::process; const RED: &str = "\x1b[91m"; const GREEN: &str = "\x1b[92m"; const YELLOW: &str = "\x1b[93m"; const BLUE: &str = "\x1b[94m"; const MAGENTA: &str = "\x1b[95m"; const CYAN: &str = "\x1b[96m"; con...
use async_trait::async_trait; use axum::{ extract::{Form, FromRequest, RequestParts}, handler::Handler, http::Method, http::StatusCode, http::Uri, response::{Html, IntoResponse, Response}, routing::{get, post}, BoxError, Json, Router, }; use serde::de::DeserializeOwned; use serde::{Deser...
use num_complex::Complex; use num_traits::{Float, One, Zero}; use rand::distributions::{uniform::SampleUniform, Distribution, Uniform}; use rand::{rngs::StdRng, SeedableRng}; use crate::{algorithm::Dft, Direction, FftNum, Length}; use crate::{Fft, FftDirection}; /// The seed for the random number generator used to g...
use std::env; use std::fs; use std::io::Write; use std::path::{Path, PathBuf}; use std::process::Command; use std::sync::atomic::{AtomicUsize, Ordering::SeqCst}; pub fn target_tests() -> PathBuf { let mut path = env::current_exe().unwrap(); path.pop(); // chop off exe name path.pop(); // chop off 'deps' ...
use crate::{ parser::scanner::{ error::ScanError, identifier::{is_valid_identifier_start, is_valid_identifier_tail, LOX_KEYWORDS}, }, span::Span, token::{Token, TokenKind}, }; pub mod error; mod identifier; pub struct Scanner<'src> { src: &'src str, chars: Vec<(usize, char)>, /...
use super::iface::{Tap, TapPayload, TapResponse}; use super::registry::Registry; use super::Inspect; use futures::ready; use hyper::body::HttpBody; use linkerd_proxy_http::HasH2Reason; use linkerd_stack::{layer, NewService}; use pin_project::{pin_project, pinned_drop}; use std::future::Future; use std::pin::Pin; use st...
use super::*; use crate::{ensure_xml_tag_is, value::NumWithUnit, widgets::widget_node}; use derive_more::*; use serde::{Deserialize, Serialize}; use smart_default::SmartDefault; use std::{collections::HashMap, str::FromStr}; #[derive(Debug, Clone, PartialEq)] pub enum EwwWindowType { Dock, Dialog, Toolbar,...
// Copyright 2017 <NAME> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writi...
extern crate ws; extern crate hyper; extern crate config; use std::fs; use ws::{Sender, Handler, Handshake, Result}; use ws::util::Token; use std::thread; use std::sync::{Arc, Mutex}; use serde_json::json; use std::time::{SystemTime, UNIX_EPOCH}; use hyper::{Body, Response, Server}; use hyper::rt::Future; use hyper...
trait FloatIterExt { fn float_min(&mut self) -> f64; fn float_max(&mut self) -> f64; } impl<T> FloatIterExt for T where T: Iterator<Item = f64>, { fn float_max(&mut self) -> f64 { self.fold(f64::NAN, f64::max) } fn float_min(&mut self) -> f64 { self.fold(f64::NAN, f64::min) ...
use bls_sigs_ref::BLSSigCore; use domain_sep; use pairing::{bls12_381::Fr, CurveProjective}; use param::{PubParam, VALID_CIPHERSUITE}; use pixel_err::*; use prng::PRNG; use crate::{PixelG1, PixelG2, ProofOfPossession, PublicKey, SecretKey, SerDes}; /// The keypair is a pair of public and secret keys, /// and a proof...
use crate::dynamics::{RawImpulseJointSet, RawIslandManager, RawMultibodyJointSet}; use crate::geometry::RawColliderSet; use crate::math::{RawRotation, RawVector}; use rapier::dynamics::{MassProperties, RigidBody, RigidBodyBuilder, RigidBodySet, RigidBodyType}; use wasm_bindgen::prelude::*; #[wasm_bindgen] pub enum Raw...
//! OSX specific extensions to certificate functionality. use core_foundation::array::{CFArray, CFArrayIterator}; use core_foundation::base::TCFType; use core_foundation::base::ToVoid; use core_foundation::dictionary::CFDictionary; use core_foundation::error::CFError; use core_foundation::string::CFString; use libc::c...
#[macro_use] extern crate ubend; use ubend::IntoPipeSetup; use std::fs::File; use std::fs::OpenOptions; use std::io::{Write, Read, Seek, SeekFrom}; use std::path::Path; use std::fs::remove_file; macro_rules! assert_output { ($chain:expr, $stdout:expr, $stderr:expr) => { let out = $chain.expect("spawn failed"). o...
use std::sync::Arc; use crate::{ common::{ action::{ActionSource, KeyAction, PointerAction, PointerActionType}, command::{Actions, Command}, keys::TypingData, types::SessionId, }, error::WebDriverResult, sync::{RemoteConnectionSync, WebElement}, }; /// The ActionChain s...
use data::*; use gb::*; use instruction_walker; use std::collections::HashMap; use std::collections::HashSet; use std::slice; use Cartridge; pub fn collect_instructions(cart: &Cartridge, data: &Data, address: usize) -> Vec<Instruction> { let mut instructions = Vec::new(); instruction_walker::walk(car...
use serde::{Deserialize, Serialize}; use std::fs::{create_dir_all, File, OpenOptions}; use std::io::prelude::*; use std::io::{BufRead, BufReader}; use std::path::Path; pub const DEFAULT_FLOW: &[u8] = b"start: say \"Hello World!\" "; #[derive(Debug)] pub enum DataBase { MongoDB { uri: String, }, ...
//! Unit conversions for computer science. /// Binary Prefixes (e.g. kibi, mebi). pub enum BinaryPrefix<T> { /// x · 2⁰. Unity(T), /// x · 2¹⁰. Kibi(T), /// x · 2²⁰. Mebi(T), /// x · 2³⁰. Gibi(T), /// x · 2⁴⁰. Tebi(T), /// x · 2⁵⁰. Pebi(T), /// x · 2⁶⁰. Exbi(T), ...
use super::super::{ command::CommandBuffer, fixed_timestepper::{FixedTimestepper, Stepper}, timestamp::{Timestamp, Timestamped}, world::World, }; use std::fmt::Debug; /// Whether the [`Simulation`] needs to wait for a snapshot to be applied before its display /// state can be considered usable. #[deriv...
use std::time::Duration; use std::time::Instant; use graph::prelude::*; use graph::web3::types::*; pub struct BlockIngestor<S, E> where S: ChainStore, E: EthereumAdapter, { chain_store: Arc<S>, eth_adapter: Arc<E>, ancestor_count: u64, logger: Logger, polling_interval: Duration, } impl<S,...
use jni_sys::{ jboolean, jbyte, jchar, jdouble, jfloat, jint, jlong, jobject, jshort, jvalue, JNIEnv, JNI_CreateJavaVM, JavaVM, JavaVMInitArgs, JavaVMOption, JNI_EDETACHED, JNI_EEXIST, JNI_EINVAL, JNI_ENOMEM, JNI_ERR, JNI_EVERSION, JNI_FALSE, JNI_OK, JNI_VERSION_1_8, }; use std::ffi::CString; use std::os::r...
use glifrenderer::guidelines::draw_guideline; use super::prelude::*; use crate::editor::Editor; use crate::tool_behaviors::{ move_glyph::MoveGlyph, move_guideline::MoveGuideline, zoom_scroll::ZoomScroll, }; use crate::user_interface::Interface; use crate::util::MFEKGlifPointData; use flo::Coordinate; use flo_curv...
use std::cmp; use std::fs::File; use std::io::{self, BufRead}; use regex::Regex; #[derive(Clone)] struct Pair { left: u64, right: u64, } impl Pair { fn from_str(s: &String) -> Self { let pair_numbers: Vec<u64> = s .replace("[", "") .replace("]", "") .split(",") .map(|x|u64::from_str_radix(x,...
#![no_main] #![no_std] use core::convert::Infallible; use bsp::hal::{self, usb::UsbBus}; use cortex_m::{asm, prelude::*}; use cortex_m_rt::entry; use defmt_rtt as _; use embedded_hal::digital::v2::{InputPin, OutputPin}; use embedded_time::duration::Extensions as _; use hal::pac; use panic_probe as _; use rp_pico as b...
use core::fmt; use lazy_static::lazy_static; use spin::Mutex; use volatile::Volatile; // disable warnings for unused enum variants #[allow(dead_code)] #[derive(Debug, Clone, Copy, PartialEq, Eq)] // each enum variant stored as u8 #[repr(u8)] pub enum Color { Black = 0, Blue = 1, Green = 2, Cyan = 3, ...
// Built-in deps use std::sync::Mutex; // Workspace deps use zksync_config::ChainConfig; use zksync_crypto::proof::{AggregatedProof, PrecomputedSampleProofs, SingleProof}; use zksync_crypto::Engine; use zksync_prover_utils::aggregated_proofs::{gen_aggregate_proof, prepare_proof_data}; use zksync_prover_utils::api::{Job...
use crate::{ internal::{ epoch::{EpochClock, ParkStatus, QuiesceEpoch, EPOCH_CLOCK}, thread::{Logs, ParkPinMutRef, PinMutRef, PinRw}, }, stats, }; use parking_lot_core::{FilterOp, ParkResult, ParkToken, DEFAULT_UNPARK_TOKEN}; use swym_htm::{BoundedHtxErr, HardwareTx}; const MAX_HTX_RETRIES:...
use http::status::StatusCode; use serde::Deserialize; use std::{env, error::Error}; use uuid::Uuid; const USAGE: &str = "Usage: `dawaclient <street name> <house number>`"; /// Parses CLI arguments, sends a request to [DAWA](https://dawa.aws.dk/) and prints the results. The /// expected CLI args are `street name` and ...
// Copyright 2022 <NAME>. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to i...
use std::collections::HashMap; fn parse(s: &str) -> (&str, HashMap<&str, &str>) { let mut lines = s.lines(); let first_line = lines.next().unwrap(); assert_eq!(lines.next().unwrap(), ""); let rules = lines .map(|line| { let mut words = line.split(" "); match ( ...
mod adts; mod flv; mod nalu; mod ts; use rml_rtmp::chunk_io::Packet; use rml_rtmp::sessions::{ServerSession, ServerSessionConfig, ServerSessionEvent, ServerSessionResult}; use rml_rtmp::time::RtmpTimestamp; use std::sync::{Arc, Mutex}; use std::{fs, thread}; use bytes::Bytes; use ts::TransportStream; use flv::{Flv, Da...
use std::collections::HashSet; use crate::{Rocket, Request, Response, Data, Build, Orbit}; use crate::fairing::{Fairing, Info, Kind}; use crate::log::PaintExt; use yansi::Paint; #[derive(Default)] pub struct Fairings { // NOTE: This is a push-only vector due to the index-vectors below! all_fairings: Vec<Box<...
use algorithm::Scheduler; use riscv::register::sstatus::{self, SPP}; use super::*; use crate::{ process::interface::TaskContext, schedule::SCHEDULE_THREAD, trap::interface::TrapFrame, }; /// 线程退出 /// 如果是进程中的最后一个线程,进程也退出,向父进程发送消息 pub(super) fn sys_exit(status: i32) -> ! { unsafe { // 1. unmap 当前线程的用户栈 ...
//! The arena module. //! //! Includes the `Arena` trait, which represents a type that can be used as an arena. //! For types that `impl Arena`, you can allocate a thread safe `Rc` (reference counted pointer) from it. //! //! This module also includes pre-built arenas, such as `ArrayArena`(array based arena) or `MruAre...
use core::cell::RefCell; use nb; use heapless::{consts, Vec}; use super::{net, NetworkInterface}; use minimq::embedded_nal; #[derive(Debug)] pub enum NetworkError { NoSocket, ConnectionFailure, ReadFailure, WriteFailure, } // TODO: The network stack likely needs a time-tracking mechanic here to supp...
//! Named constants for NVIC ids #![allow(non_upper_case_globals)] pub const WWDG: u32 = 0; pub const PVD: u32 = 1; pub const TAMP_STAMP: u32 = 2; pub const RTC_WKUP: u32 = 3; pub const FLASH: u32 = 4; pub const RCC: u32 = 5; pub const EXTI0: u32 = 6; pub const EXTI1: u32 = 7; pub const EXTI2: u32 = 8; pub const EXTI...
use crate::analysis::{reaching_definitions, LocationSet}; use crate::error::*; use crate::il; use std::collections::HashMap; #[allow(dead_code)] /// Compute use definition chains for the given function. pub fn use_def(function: &il::Function) -> Result<HashMap<il::ProgramLocation, LocationSet>> { let rd = reaching...
// plugin-system // Copyright (C) SOFe // // 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 agre...
use std::fs::File; use std::io::Write; use std::path::Path; use std::io; pub fn write( s:String ){ // 書き込み先 let mut log_file = File::create(Path::new("warizan.txt")).unwrap(); print!( "{}", s ); match log_file.write_all( s.as_bytes() ) { Err(_why) => {}, Ok(_) => {}, } } pu...
#[derive(Debug, Clone, Copy, PartialEq)] pub enum Token { Number(u64), OpenParen, CloseParen, Asterisk, Plus, } impl std::fmt::Display for Token { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { Token::Number(n) => write!(f, "{}", n), Token::Plus => write!(f, "+"), Token:...
//! Router Component. use crate::agent::{RouteAgentBridge, RouteRequest}; use crate::route::Route; use crate::router::RouterState; use crate::Switch; use std::fmt::{self, Debug, Error as FmtError, Formatter}; use std::rc::Rc; use yew::{ virtual_dom::VNode, Callback, Component, ComponentLink, Html, ...
#![allow(dead_code, unused_variables, unused_imports, unreachable_code)] use std::error::Error; use diesel::pg::PgConnection; use lambda_http::{lambda, Body, IntoResponse, Request, Response}; use lambda_runtime::{error::HandlerError, Context}; use once_cell::sync::OnceCell; use r2d2_diesel::ConnectionManager; use rege...
// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0. use std::{ fs::File as StdFile, io, marker::Unpin, path::{Path, PathBuf}, sync::Arc, }; use async_trait::async_trait; use futures::io::AllowStdIo; use futures_io::AsyncRead; use futures_util::stream::TryStreamExt; use rand::Rng; us...
// Copyright 2020 Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot 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) any late...
// cmoran, 2018 mod algorithms_lib; mod controls_lib; mod physics_lib; mod tests; use crate::controls_lib::{ControlParams, Point, SMD}; use crate::physics_lib::{DoF, Environment, Object, State}; use core::f32; //for writing to log file use std::fs::File; use std::io::{BufWriter, Write}; // Time step the kinematics ...
use super::{ConditionCode, Literal, Register}; use crate::util::opcode::*; use crate::vm::Address; /// Mask defines the bits used to access specific data from an instruction. pub type Mask = u32; // Offset defines the bits needed to right shift data to the least significant bit. pub type Offset = u8; /// Payload lis...
//! Proxy mode entry point use anyhow::{Context as _, Result}; use clap::Clap; use crate::bencher::protocol; mod ccfront; mod dumbfront; mod formatter; mod targetlink; mod targets; #[doc(hidden)] #[tokio::main] pub async fn main() { env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("farc...
use std::collections::HashMap; use std::fmt; use std::time::SystemTime; use adsb_deku::adsb::{AirborneVelocity, Identification}; use adsb_deku::{cpr, Altitude, CPRFormat, ICAO}; use tracing::{debug, info}; #[derive(Debug)] pub struct AirplaneState { // TODO: rename to coor pub coords: AirplaneCoor, pub sq...
/* SPDX-License-Identifier: BSD-3-Clause * Copyright (c) 2020-2022 Intel Corporation. */ use std::mem::MaybeUninit; use std::os::raw::c_void; use std::sync::{Arc, Mutex, MutexGuard}; use cne_sys::bindings::{ _pktdev_rx_burst, _pktdev_tx_burst, _pktmbuf_alloc_bulk, _xskdev_rx_burst, _xskdev_tx_burst, lport_s...
//! Structures that can be passed into Weld. //! //! This currently defines the type layout specified for the single threaded backend. In general, //! type layouts vary from backend to backend especially for builders. //! //! # Primitives //! //! Primitives in Weld match their Rust counterparts, _except for booleans_. ...
use crate::version::GFAB_VERSION_REQ; use io::BufRead; use log::{debug, warn}; use std::path::Path; use std::{fs, io}; use thiserror::Error; // helpful: https://nick.groenen.me/posts/rust-error-handling/ #[derive(Error, Debug)] pub enum Error { #[error(transparent)] IoError(#[from] std::io::Error), #[erro...
mod merge; pub use crate::types::BitChunk; use merge::merge_reversed; #[derive(Debug)] pub struct BitChunks<'a, T> { buffer: &'a [u8], /// offset inside a byte bit_offset: u32, remainder_bytes_len: usize, len: usize, phantom: std::marker::PhantomData<T>, } #[inline] fn remainder_bytes(offset:...
use crate::model::clustering::Clustering; use crate::model::encryption_configuration::EncryptionConfiguration; use crate::model::external_data_configuration::ExternalDataConfiguration; use crate::model::materialized_view_definition::MaterializedViewDefinition; use crate::model::model_definition::ModelDefinition; use cr...
#[link(name = "windows")] extern "system" { #[doc = "*Required features: `\"Win32_Storage_Xps_Printing\"`, `\"Win32_Foundation\"`, `\"Win32_System_Com\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] pub fn StartXpsPrintJob(printername: ::windows_sys::core::PCWSTR, jobname: ::wi...
/* Copyright 2021 Integritee AG and Supercomputing Systems AG 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...
use crate::homography; use crate::Model; use nannou::math::Matrix4; use nannou::prelude::*; use std::cell::RefCell; use std::sync::Arc; pub struct Warp { render_pass: Arc<dyn vk::RenderPassAbstract + Send + Sync>, pipeline: Arc<dyn vk::GraphicsPipelineAbstract + Send + Sync>, view_fbo: RefCell<ViewFbo>, ...
use ggez; use ggez::{graphics, timer, GameError}; use ggez_goodies::scene; use crate::round::{GameState, Round}; use crate::shaders::GlowParams; use crate::types::Point2; use crate::world::World; use crate::{input, scenes, utils}; pub struct GamePlayScene { game_round: Round, landscape_image: Option<graphics:...
use glob::glob; use super::super::whisper::cache::Cache; use std::path::{ Path, PathBuf }; use std::fs::{ PathExt, read_dir }; // use std::collections::BTreeMap; // use rustc_serialize::json::{self, ToJson, Json}; #[derive(Debug)] pub enum QueryResultNode { WspNode(PathBuf, PathBuf), // path to dir, has childr...
use crate::{RegisterBits, Register}; use core::marker; /// A 8-bit timer. pub trait Timer8 : Sized { /// The first compare register. /// For example, OCR0A. type CompareA: Register<T=u8>; /// The second compare register. /// For example, OCR0B. type CompareB: Register<T=u8>; /// The count...
use crate::{ cpu::Stats, inst::Tag, util::{Addr, CacheCapacity}, }; use associative_cache::*; const L1_CAPACITY_BYTES: usize = 16_000; const L2_CAPACITY_BYTES: usize = 32_000; const L3_CAPACITY_BYTES: usize = 128_000; const DRAM_CAPACITY_BYTES: usize = 1_024_000; pub const STACK_TOP: usize = DRAM_CAPACITY...
use std::{env, fs}; #[allow(unused_imports)] use itertools::Itertools; fn main() { let args: Vec<String> = env::args().collect(); let mut reversed_args: Vec<_> = args.iter().map(|x| x.as_str()).rev().collect(); reversed_args .pop() .expect("Expected the executable name to be the first arg...
use std::os::raw::c_void; use std::ptr; use super::binding::avformat::{ self, AVMediaType_AVMEDIA_TYPE_AUDIO, AVMediaType_AVMEDIA_TYPE_VIDEO, AVStream, }; use super::error::*; use super::format::Format; use super::wrapper::stream_wrapper::*; #[derive(Debug, PartialEq, Clone, Copy)] pub enum Orientation { Top,...
//! Lets compare various CRC implementations use criterion::criterion_group; use criterion::criterion_main; use criterion::Criterion; use criterion::Throughput; use criterion::measurement::Measurement; use criterion::measurement::ValueFormatter; use flate2::Compression; use flate2::write::DeflateEncoder; use std::io::...
mod auth; use auth::{Authenticate, Credential}; use crate::image::Image; use reqwest::{Client, StatusCode}; use ttl_cache::TtlCache; #[derive(Debug, Fail)] #[allow(clippy::large_enum_variant)] pub enum RegistryError { #[fail(display = "Request Error: {:?}", _0)] ReqwestError(#[cause] reqwest::Error), #[...