text
stringlengths
3.09k
13.9k
use std::io; use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4}; use std::str; use std::time::Duration; use futures::future; use futures::{Future, IntoFuture, Stream}; use hyper; use tokio::prelude::FutureExt; use tokio::net::UdpSocket; use xml::reader::XmlEvent; use xml::EventReader; use regex::Regex; use crate::err...
use std::cell::RefCell; use std::cmp; use std::env::args; use std::fs; use std::io::{Read, Write}; use std::path::PathBuf; use std::rc::Rc; use tuikit::attr::*; use tuikit::event::{Event, Key}; use tuikit::term::{Term, TermHeight}; mod stats; use stats::Stats; mod cursor; use cursor::Cursor; type RR<T> = Rc<RefCell...
use super::find_root; use std::ops::Index; /// Find all children of a node in constant time. /// /// # Example /// /// Have a rooted tree (root is 0) whereby nodes 1 and 2 have parent /// 0, node 3 has parent 2: /// /// ```rust /// use graphidx::tree::ChildrenIndex; /// let cidx = ChildrenIndex::from_parent(&[0, 0, 0,...
fn panic() { //use env var RUST_BACKTRACE=0|1|full //panic!("bla"); } fn option() { //Option: Some(T) | None let x: Option<i32> = Some(42); let y: Option<i32> = None; //unsafe: .unwrap => panic! // y.unwrap(); assert_eq!(x.unwrap(), 42); //safe: pattern matching or ? operator ...
use crate::utils::span_lint; use rustc::hir; use rustc::lint::{LateContext, LateLintPass, LintArray, LintPass}; use rustc::{declare_lint_pass, declare_tool_lint}; use syntax::ast; use syntax::source_map::Span; declare_clippy_lint! { /// **What it does:** it lints if an exported function, method, trait method with ...
//! Display a widget over another. use std::hash::Hash; use iced_core::Rectangle; use crate::event; use crate::layout; use crate::mouse; use crate::renderer; use crate::text; use crate::widget::container; use crate::widget::text::Text; use crate::{ Clipboard, Element, Event, Hasher, Layout, Length, Padding, Point...
// Copyright 2021 Datafuse Labs. // // 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 ...
use super::*; use crate::infer::{CombinedSnapshot, PlaceholderMap}; use crate::ty::error::TypeError; use crate::ty::relate::RelateResult; impl<'tcx> RegionConstraintCollector<'tcx> { /// Searches region constraints created since `snapshot` that /// affect one of the placeholders in `placeholder_map`, returning...
#[macro_use] extern crate structopt; extern crate welder; use std::{env, process}; use std::io::{self, Write}; use std::hash::{Hash, Hasher}; use std::collections::hash_map::DefaultHasher; use std::path::Path; use structopt::StructOpt; use welder::Welder; // Don't forget to update the Command enum const SUBCOMMANDS: ...
// 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 2017 TiKV Project Authors. Licensed under Apache-2.0. use super::{Json, JsonRef, JsonType}; use crate::codec::{Error, Result}; use std::collections::BTreeMap; impl Json { /// `merge` is the implementation for JSON_MERGE in mysql /// <https://dev.mysql.com/doc/refman/5.7/en/json-modification-funct...
use crate::message_signatures::encode_valset_confirm_hashed; use crate::utils::{encode_valset_struct, get_valset_nonce, GasCost}; use clarity::PrivateKey as EthPrivateKey; use clarity::{Address as EthAddress, Uint256}; use gravity_utils::error::GravityError; use gravity_utils::types::*; use std::{cmp::min, time::Durati...
//! This module defines the function pointers for supported traits from the standard library. //! //! `CloneFromFn` and `DropFn` enable the use of `VecClone`. //! //! The remaining traits improve compatibility with the rest of the standard library. use crate::bytes::*; use dyn_derive::dyn_trait_method; use std::fmt; u...
use super::{ decoder::{GqnDecoder, GqnDecoderOutput}, encoder, params, rnn::{GqnDecoderCellState, GqnNoise}, }; use crate::{ common::*, dist::{Normal, Rv}, objective, }; // input type #[derive(Debug, TensorLike)] pub struct GqnModelInput { pub context_frames: Tensor, pub target_frame:...
// Copyright 2015-2018 Capital One Services, 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 // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law o...
use crate::attributes::{FieldAttributes, FieldVisibility}; use crate::builder::{ builder_decl::BuilderDecl, builder_functions::BuilderFunctions, builder_impl::BuilderImpl, }; use crate::field::Field; use crate::struct_impl::StructImpl; use core::str::FromStr; use proc_macro2::{Ident, Span, TokenStream}; use quote:...
use crate::{ draw_at, entry::{Entry, EntrySpaceLvl, EntryType, HiddenStatus}, ui::{ util::{get_style, Rect}, widgets::{VolumeWidgetBorder, Widget}, }, RSError, }; use std::{cmp::min, io::Write}; use pulse::volume; use crossterm::{cursor::MoveTo, execute}; impl<W: Write> Widget<W>...
use chrono::prelude::Utc; use ring::hmac::{self, HMAC_SHA1_FOR_LEGACY_USE_ONLY}; pub const SHORT_DATE: &str = "%Y%m%d"; pub const LONG_DATETIME: &str = "%Y%m%dT%H%M%SZ"; pub const GMT_DATETIME: &str = "%a, %d %b %Y %T GMT"; //aliyun date format pub fn get_date_gmt() -> String { Utc::now().format(GMT_DATETIME).to_...
// Copyright (c) 2017-2018 <NAME>, RWTH Aachen University // // Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or // http://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 distribute...
//! # Tests the Embedded SDMMC Library //! ```bash //! $ cargo run --example create_test -- /dev/mmcblk0 //! $ cargo run --example create_test -- /dev/sda //! ``` //! //! If you pass a block device it should be unmounted. No testing has been //! performed with Windows raw block devices - please report back if you try /...
#[doc = r"Enumeration of all the interrupts."] #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[repr(u16)] pub enum Interrupt { #[doc = "18 - UART0"] UART0 = 18, #[doc = "19 - UART1"] UART1 = 19, #[doc = "20 - UART2"] UART2 = 20, #[doc = "21 - UART3"] UART3 = 21, #[doc = "22 - UART4"] ...
//! Switches between [Visual Studio Code](https://code.visualstudio.com/) themes //! //! ## Usage: Windows & macOS //! Since [version //! 1.42](https://code.visualstudio.com/updates/v1_42#_auto-switch-theme-based-on-os-color-scheme), //! Visual Studio Code can listen to Windows and macOS color scheme changes and switch...
extern crate cargo; use cargo::core::compiler::RustcTargetData; use cargo::core::resolver::{ForceAllTargets, HasDevUnits}; use cargo::core::Workspace; use cargo::core::{resolver::ResolveOpts, shell::Shell}; use cargo::ops::{self, Packages}; use cargo::util::{CargoResult, CliError, Config}; use cargo::CliResult; extern...
use totsu::prelude::*; use totsu::operator::MatBuild; use totsu::linalg::F64LAPACK; use totsu::problem::ProbQCQP; use std::io::prelude::*; use std::io::BufWriter; use std::fs::File; use std::str::FromStr; extern crate intel_mkl_src; type AMatBuild = MatBuild<F64LAPACK, f64>; type AProbQCQP = ProbQCQP<F64LAPACK, f64>...
use embassy::interrupt::InterruptExt; use embassy::util::Forever; use embassy_nrf::gpio::{Input, Level, NoPin, Output, OutputDrive, Pull}; use embassy_nrf::gpiote::InputChannel; use embassy_nrf::usb::UsbBus; use embassy_nrf::{interrupt, peripherals}; use futures_intrusive::sync::LocalMutex; use nrf_softdevice::Softdevi...
extern crate roog; #[macro_use] extern crate vst; use std::sync::Arc; use vst::api::{Events, Supported}; use vst::buffer::AudioBuffer; use vst::event::Event; use vst::plugin::{CanDo, Category, Info, Plugin, PluginParameters}; use vst::util::AtomicFloat; fn midi_pitch_to_freq(pitch: u8) -> f64 { const A4_PITCH: i8 ...
use crate::ppu::Ppu; use save_state::Savable; #[derive(Default, Savable)] pub struct Hdma { source_addr: u16, dest_addr: u16, length: u8, /// `true` if transfere during hblank only hblank_dma: bool, master_dma_active: bool, hblank_dma_active: bool, cached_ppu_hblank: bool, } impl Hdma ...
//! Interpreting user leaderboard page results. use std::collections::HashMap; use serde::{Deserialize, Serialize}; use super::find_rank; use crate::data; use crate::error::{ApiError, Result}; use crate::EndpointResult; /// Raw list results. #[derive(Deserialize, Clone, Debug)] #[doc(hidden)] pub(crate) struct Respo...
mod automata; mod drunkard; mod empty; mod prefab; mod rooms; mod themes; use crate::prelude::*; use automata::CellularAutomataArchitect; use drunkard::DrunkardsWalkArchitect; use prefab::apply_prefab; use rooms::RoomsArchitect; use themes::*; const NUM_ROOMS: usize = 20; pub trait MapTheme: Sync + Send { fn til...
use std::collections::BTreeSet; use git_hash::ObjectId; use crate::{ packed, peel, raw::Reference, store_impl::{file, file::log}, Target, }; pub trait Sealed {} impl Sealed for crate::Reference {} /// A trait to extend [Reference][crate::Reference] with functionality requiring a [file::Store]. pub t...
use crate::{ StableAbi, abi_stability::abi_checking::{AbiInstability,check_layout_compatibility}, type_layout::TypeLayout, }; #[cfg(any(feature="const_params",all(nightly_rust,feature="nightly_const_params")))] mod with_const_params{ pub(super) mod single_integer { #[repr(C)] #[derive(...
use super::environment::Environment; use std::fmt::Display; use std::fmt::Result; use std::fmt::Formatter; #[derive(Debug,PartialEq,Clone)] pub enum Node { Number(i64), Add(Box<Node>, Box<Node>), Subtract(Box<Node>, Box<Node>), Multiply(Box<Node>, Box<Node>), Boolean(bool), LT(Box<Node>, Box<N...
#![recursion_limit = "128"] #![deny(missing_docs)] #![deny(rust_2018_idioms)] #![deny(warnings)] //! Crate for internal use by other graphql-client crates, for code generation. //! //! It is not meant to be used directly by users of the library. use failure::*; use lazy_static::*; use proc_macro2::TokenStream; use qu...
#![doc="Defines the loop algebraic structure. A quasigroup with an identity element is called a loop. Existence of identity element also implies the existence of inverse element. We define four kinds of loops. * Loop with an addition operation with partial equivalence * Loop with an addition operation with full e...
use std::env; use rand::distributions::Distribution; fn update_weights(weights: &mut Vec<f32>, width: u32, sigma: f32, index: usize, sign: f32) { let x = ((index as u32) % width) as i32; let y = ((index as u32) / width) as i32; for iy in 0..width { let mut dist_y = ((iy as i32) - y).abs() as u...
use crate::NarrowStackedExpander; use crate::{Config, GPUContext, LayerOutput, NSEResult, Sealer, SealerInput, TreeOptions, GPU}; use log::*; use ocl::Device; use std::sync::mpsc; use std::sync::{Arc, Condvar, Mutex}; use std::thread; use std::time::Duration; struct SealerWorker { died: bool, busy: Arc<Mutex<b...
use std::sync::mpsc::{channel, Sender}; use threadpool::ThreadPool; use packed_simd::f64x4; use rug::{Complex, Float}; use mandelbrot::bounded::{Bound, BoundsChecker, BoundsSettings}; use ui::events::ComputeEvent; #[allow(dead_code)] #[derive(Clone, Copy)] pub enum ComputeEngine { Single, Double, MPC, ...
use crate::data::Data; use crate::ws::Model as WebSocket; use crossbeam::{channel, Receiver, Sender}; use std::time::Duration; use stdweb::traits::*; use stdweb::web::document; use yew::prelude::*; use yew::services::interval::IntervalService; use yew::services::Task; use yew::*; pub struct Model { chart: Option<s...
pub struct ReadWrapper<R> { reader: R, tokens: Vec<String>, } impl<R> ReadWrapper<R> { pub fn new(reader: R) -> Self { Self { reader, tokens: vec![] } } } impl<R: std::io::BufRead> ReadWrapper<R> { pub fn read<T: std::str::FromStr>( &mut self, ) -> Result<T, <T as std::str::FromStr>::Err> ...
use std::cmp::Ordering; use std::path::{Path, PathBuf}; use anyhow::Context; use structopt::StructOpt; use parse_display::{Display, FromStr}; #[derive(Debug, StructOpt)] struct Args { #[structopt(subcommand)] cmd: Command, } #[derive(Debug, StructOpt)] enum Command { Add { year: u32, day: u32, }, } #[derive...
use winapi::{ um::{ d3d11::{ D3D11CreateDevice, D3D11_CREATE_DEVICE_BGRA_SUPPORT, D3D11_SDK_VERSION, }, d3dcommon::{ D3D_DRIVER_TYPE_HARDWARE, }, }, winrt::roapi::{ RoInitialize, RO_INIT_MULTITHREADE...
pub use snapshot_proc_macro::snapshot; use serde_derive::{Deserialize, Serialize}; use fs2::FileExt; use serde::de::DeserializeOwned; use serde::Serialize; use std::collections::BTreeMap; use std::fmt::Debug; use std::fs::{create_dir_all, File, OpenOptions}; use std::io::prelude::*; use std::io::SeekFrom; use std::io...
use sdl2; use sdl2::event::{Event, WindowEvent}; use sdl2::pixels; use sdl2::mouse::MouseButton; use error::{Result}; use window::{RuneWindow, RuneWindowInternal}; use canvas::{RuneCanvas}; #[derive(Clone, Copy)] pub enum RuneAction { ApplicationQuit, WindowHide, RedrawNeeded, } #[derive(Clone, Copy)] p...
use super::{Open, Sink, SinkError, SinkResult}; use crate::config::AudioFormat; use crate::convert::Converter; use crate::decoder::AudioPacket; use crate::{NUM_CHANNELS, SAMPLE_RATE}; use portaudio_rs::device::{get_default_output_index, DeviceIndex, DeviceInfo}; use portaudio_rs::stream::*; use std::process::exit; use ...
use super::*; pub(crate) struct GengImpl { window: Window, #[cfg(feature = "audio")] #[allow(dead_code)] pub(crate) audio: AudioContext, shader_lib: ShaderLib, pub(crate) draw_2d: Rc<draw_2d::Helper>, #[cfg(not(target_arch = "wasm32"))] pub(crate) asset_manager: AssetManager, defaul...
use crate::path_builder::*; use crate::Point; use lyon_geom::LineSegment; /// /// True modulo, always returns positive. /// fn modulo(lhs: f32, rhs: f32) -> f32 { (lhs % rhs + rhs) % rhs } pub fn dash_path(path: &Path, dash_array: &[f32], mut dash_offset: f32) -> Path { let mut dashed = PathBuilder::new(); ...
use wgpu:: { Instance, Backends, DeviceType, ComputePassDescriptor, ComputePipelineDescriptor, CommandEncoderDescriptor, ShaderSource, ShaderModuleDescriptor, BindGroupEntry, BindGroupDescriptor, BufferUsages, BufferDescriptor, util:: { DeviceExt, ...
use anyhow::Error; use dialoguer::{Confirm, Select}; use gumdrop::Options; use semver::Version; use std::{ collections::{BTreeMap, BTreeSet}, path::PathBuf, }; use toml_edit::Document; use tracing::*; #[derive(Debug, Options)] pub struct Versions {} impl Versions { pub fn run(self, project_root: PathBuf) ...
use crate::router::get_static_href; use crate::scenes::webgl::common::*; use crate::start_webgl; use awsm_web::loaders::image; use awsm_web::webgl::{ BeginMode, BlendFactor, BufferMask, GlToggle, Id, PixelFormat, SimpleTextureOptions, TextureTarget, WebGlTextureSource, WebGlVersion, ShaderType }; use lo...
use regex::Regex; use std::fs; use std::fs::File; use std::io::{self, BufRead}; use std::path::Path; #[macro_use] extern crate lazy_static; enum CodeBlockKind { NotInCodeBlock, Backticks, Tildes, } #[derive(Clone)] struct HeadingItem { title: String, level: u8, } impl HeadingItem { fn split(...
use crate::error::Result; use rbatis::DateTimeNative; use rbatis::core::value::DateTimeNow; use rbatis::crud::CRUD; use rbatis::plugin::page::{Page, PageRequest}; use crate::domain::domain::{SysRes, SysRole, SysRoleRes, SysUserRole}; use crate::domain::dto::{RoleAddDTO, RoleEditDTO, RolePageDTO}; use crate::domain::vo...
//! Configuration file support. use crate::lint_warn; use heck::{CamelCase, KebabCase}; use rslint_core::{ get_group_rules_by_name, get_rule_by_name, get_rule_suggestion, CstRule, CstRuleStore, RuleLevel, }; use serde::de::{ value::MapAccessDeserializer, DeserializeSeed, Error, IntoDeserializer, MapAccess,...
use crate::*; use dbus::Message; use std::cell::RefCell; use dbus::arg::{Variant, RefArg}; use std::collections::HashMap; #[test] fn test_send() { fn is_send<T: Send>(_: &T) {} let c = Crossroads::new(); dbg!(&c); is_send(&c); } fn dispatch_helper2(cr: &mut Crossroads, mut msg: Message) -> Vec<Message...
use bevy_ecs::system::ResMut; use bevy_utils::{Duration, Instant}; /// Tracks elapsed time since the last update and since the App has started #[derive(Debug, Clone)] pub struct Time { delta: Duration, last_update: Option<Instant>, delta_seconds_f64: f64, delta_seconds: f32, seconds_since_startup: ...
use bevy::{ asset::LoadState, prelude::*, render::texture::TextureFormat, sprite::TextureAtlasBuilder, window::WindowMode, }; use bevy_tilemap::{ chunk::{Chunk, WorldChunk}, dimensions::Dimensions2, map::{TileMap, WorldMap}, tile::{Tile, TileSetter}, ChunkTilesPlugin, }; use rand::Rng; #[de...
use std::collections::HashMap; use std::env; use std::fs::{self, File}; use std::io::prelude::*; use std::path::{Path, PathBuf}; use semver; use git2; use serde_json; use app::App; use dependency::Kind; use util::{CargoResult, internal}; #[derive(Serialize, Deserialize, Debug)] pub struct Crate { pub name: Strin...
use std::io::File; use std::io::BufferedReader; use std::{str,vec,fmt,path}; pub mod scopes; pub mod ast; pub mod typeinf; pub mod nameres; pub mod codeiter; pub mod codecleaner; pub mod testutils; pub mod util; pub mod matchers; #[cfg(test)] pub mod test; #[deriving(Show,Clone,PartialEq)] pub enum MatchType { S...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - OSCCON register"] pub osccon: crate::Reg<osccon::OSCCON_SPEC>, #[doc = "0x04 - OSCCONCLR register"] pub oscconclr: crate::Reg<oscconclr::OSCCONCLR_SPEC>, #[doc = "0x08 - OSCCONSET register"] pub oscconset: crate::Re...
use std::convert::TryInto; mod chunks_exact; mod merge; pub use crate::types::BitChunk; pub use chunks_exact::BitChunksExact; use crate::{trusted_len::TrustedLen, types::BitChunkIter}; pub(crate) use merge::merge_reversed; /// Trait representing an exact iterator over bytes in [`BitChunk`]. pub trait BitChunkIterEx...
use std::sync::Arc; use clap::{ArgEnum, Parser}; use log::{debug, error, info, warn}; use wirepact_translator::{ run_translator, CheckRequest, EgressResult, IngressResult, Status, Translator, TranslatorConfig, }; use crate::repository::{KubernetesSecretRepository, LocalCsvRepository, Repository}; mod repository;...
use crate::{address::UserVAddr, handler}; use core::fmt; use super::{apic::ack_interrupt, ioapic::VECTOR_IRQ_BASE, serial::SERIAL0_IRQ, PageFaultReason}; use x86::{ controlregs::cr2, current::rflags::{self, RFlags}, irq::*, }; /// The interrupt stack frame. #[derive(Copy, Clone)] #[repr(C, packed)] struc...
//! //! ACPI Embedded Controller Driver //! use super::super::aml::aml_variable::AmlVariable; use super::super::aml::AmlInterpreter; use super::super::aml::{ConstData, NameString}; use super::super::device::AcpiDeviceManager; use crate::arch::target_arch::device::acpi::{read_io_byte, write_io_byte}; use crate::kerne...
#[macro_use] extern crate anyhow; use anyhow::{Context, Result}; // std library use std::convert::TryInto; use std::fmt::Debug; use std::str::FromStr; fn parse_nums_from_str<T: FromStr + Debug, const N: usize>(data: String) -> Result<[T; N]> { // Parse a vector of floats from a file. let nums: std::result::Res...
//! For incoming visits (attacks) use crate::net::state::current_village; use crate::prelude::*; use crate::{gui::utils::colors::LIGHT_BLUE, net::game_master_api::RestApiState}; use crate::{ gui::z::*, resolution::{MAIN_AREA_H, MAIN_AREA_W}, }; use chrono::NaiveDateTime; use mogwai::prelude::*; use paddle::Nut...
//! Module that deals with requests to /api/v2/canister/.../call use crate::{common, IngressFilterService}; use hyper::{Body, Response, StatusCode}; use ic_interfaces::crypto::IngressSigVerifier; use ic_interfaces::{p2p::IngressIngestionService, registry::RegistryClient}; use ic_logger::{error, info_sample, warn, Repl...
//! Description: //! //! Simple SVG interface. Mostly this is a simplified path type, so each layer //! can be rerpresented. Functionality, to genenerate a mesh for rendering, //! using Lyon, is provided, and outputing an SVG file representing the 3 layers. //! //! Copyright © 2020 <NAME>. All rights reserved. us...
use crate::config::ValueScaling; use crate::device::{EventStream, HardwareDevice, OutputHardwareDevice, OutputPort}; use crate::device_core::{DeviceRWCore, SynchronizedDeviceRWCore}; use crate::{prom, Result}; use alloy::OutputValue; use embedded_hal as hal; use mcp23017 as mcpdev; use serde::{Deserialize, Serialize}; ...
#[doc = "Reader of register PRSSTAT"] pub type R = crate::R<u32, super::PRSSTAT>; #[doc = "Reader of field `CMDINHIBITCMD`"] pub type CMDINHIBITCMD_R = crate::R<bool, bool>; #[doc = "Reader of field `CMDINHIBITDAT`"] pub type CMDINHIBITDAT_R = crate::R<bool, bool>; #[doc = "Reader of field `DATLINEACTIVE`"] pub type DA...
#![feature(path_file_prefix)] #![feature(exit_status_error)] #[macro_use] extern crate clap; use clap::Parser; use std::{fs::read_to_string, net::Ipv4Addr}; #[cfg(not(target_arch = "riscv64"))] mod dump; mod arch; mod build; mod command; mod errors; mod linux; use arch::{Arch, ArchArg}; use build::{AsmArgs, GdbArg...
/* * Copyright <NAME>, Minter Ltd. See the COPYING * file at the top-level directory of this distribution. * * Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or * https://www.apache.org/licenses/LICENSE-2.0> or the MIT license * <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your * opti...
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or // http://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. use std::rc::Rc; use term...
// plotters use plotters::prelude::*; // DenseMatrix wrapper around Vec use smartcore::linalg::naive::dense_matrix::DenseMatrix; use smartcore::linalg::BaseMatrix; use smartcore::math::num::RealNumber; // Polars for reading the csv file and returning a dataframe use polars::prelude; use polars::prelude::SerReader; pu...
extern crate steel; extern crate steel_derive; extern crate steel_repl; use steel_derive::Steel; use steel::steel_vm::engine::Engine; use steel_repl::repl::repl_base; use std::cell::RefCell; use std::cmp::{max, min}; use std::collections::HashMap; use std::process; use std::rc::Rc; use steel::steel_vm::register_fn::...
// 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 in writ...
use ast::*; use std::collections::HashMap; use std::fmt::*; use sym_tab::*; #[derive(Clone, Debug, PartialEq)] pub enum OutputValue<'a> { Nat(usize), Bool(bool), Func(String, Box<ASTNode<'a>>, SymbolTable<OutputValue<'a>>), Record(HashMap<String, OutputValue<'a>>), Variant(String, Box<OutputValue<'...
use std::env::consts::{ARCH, OS}; use std::{collections::BTreeSet, path::Path, vec}; use crate::{helpers, manifest, pipelines, Config, Context, Result}; pub struct Helipad { opts: Config, } impl Helipad { pub fn new(opts: Config) -> Self { Self { opts } } // Read all pipeline manifests avail...
use gio::prelude::*; use glib::IsA; use serde::{ de, ser::{self, SerializeSeq}, Deserialize, Deserializer, Serialize, Serializer, }; use std::marker::PhantomData; pub mod file { use super::*; #[derive(Serialize, Deserialize)] #[serde(rename = "gio::File")] struct FileUri<'f>(&'f str); p...
use crate::command_type::CommandType; use crate::{Parser, ParserPublicAPI}; use std::convert::TryFrom; use std::fs::File; use std::io::{BufRead, BufReader}; impl Parser { pub fn new(file: File) -> Self { let buf_reader = BufReader::new(file); let mut stream = separate_line(buf_reader); // T...
use runestick::{SourceId, Span}; mod error; mod warning; pub use self::error::{Error, ErrorKind}; pub use self::warning::{Warning, WarningKind}; /// A single diagnostic. #[derive(Debug)] pub enum Diagnostic { /// An error diagnostic. Error(Error), /// A warning diagnostic. Warning(Warning), } /// Th...
pub mod channel; pub mod edge; pub mod mode; pub use self::channel::Channel; pub use self::edge::Edge; pub use self::mode::Mode; use crate::color::Colorable; use crate::widget::radio::Msg::*; use gtk::prelude::*; type ChannelWidget = crate::widget::RadioGroup<Channel>; type EdgeWidget = crate::widget::RadioGroup<Edg...
extern crate ncurses; extern crate rand; use self::ncurses::*; use objects::{Snek, Pill}; use self::rand::{thread_rng, Rng}; use super::game::Score; use std::cmp::max; use std::char; pub type WindowSize = i32; pub struct Display { pub max_x: WindowSize, // TODO: Keep if I need to handle resise, otherwise drop. ...
// wengwengweng use std::collections::HashSet; use once_cell::sync::Lazy; pub type Col = i32; static BREAK_CHARS: Lazy<HashSet<char>> = Lazy::new(|| { return hset![' ', ',', '.', ';', ':', '"', '(', ')', '{', '}', '[', ']', '<', '>', '_', '-', '@', '/', '\\', '\'', '\t' ]; }); #[derive(Clone)] pub struct Input { ...
use std::cmp; // tag::image[] /// structure storing image data /// /// * ``data`` is a list of all set pixels /// * ``bbox = (x_min, x_max, y_min, y_max)`` is the bounding box of set pixels /// with exclusive upper bounds /// * ``neg`` is a flag indicating whether pixels are inverted (i.e., this is a /// negative ...
// Copyright Rivtower Technologies 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 // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed ...
use yew::prelude::*; pub struct Table { link: ComponentLink<Self>, props: Props, sort_column: Option<SortColumn>, } pub struct TableData { pub headers: Vec<String>, pub data: Vec<Vec<serde_json::Value>>, } impl TableData { pub fn new(headers: Vec<String>, data: Vec<Vec<serde_json::Value>>) ->...
use crate::{model::*, youtube::Request}; use chrono::{Datelike, Duration, Utc}; use persian::english_to_persian_digits; use ptime::from_gregorian_date; use serde::de; use std::{collections::HashMap, convert::TryInto, fs::File, io::Write, path::PathBuf}; use structopt::StructOpt; use tokio::fs; #[derive(StructOpt, Debu...
use neovim_lib::*; use rusqlite::*; fn main() { let mut event_handler = EventHandler::new(); event_handler.recv(); } struct Discusser { connection: Connection, } const COMMENT_DB: &'static str = ".comment_code.db"; impl Discusser { fn init_connection() -> Result<Connection> { let connection...
use bellperson::gadgets::{ boolean::Boolean, sha256::sha256 as sha256_circuit, {multipack, num}, }; use bellperson::{ConstraintSystem, SynthesisError}; use ff::PrimeField; use fil_sapling_crypto::jubjub::JubjubEngine; use log::trace; use crate::circuit::uint64; /// Key derivation function. pub fn create_l...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { _reserved0: [u8; 4104usize], #[doc = "0x1008 - Flash Module Identification Register"] pub id: ID, _reserved1: [u8; 4usize], #[doc = "0x1010 - Flash Status Register"] pub fsr: FSR, #[doc = "0x1014 - Flash Configuration Register"...
//! # Test suite of tendermock AVL Tree. use ics23::commitment_proof::Proof; use ics23::verify_membership; use sha2::{Digest, Sha256}; use crate::app::store::avl::node::{as_node_ref, NodeRef}; use crate::app::store::avl::tree::AvlTree; use crate::app::store::avl::*; #[test] fn insert() { let data = [42]; let...
use crate::bitcoin::consensus::Decodable; use crate::bitcoin::{Block, BlockHash, Network}; use crate::{periodic_log_level, FsBlock}; use bitcoin::Error; use log::{error, info, log}; use std::collections::HashSet; use std::convert::TryInto; use std::fs::File; use std::io::{BufReader, Read, Seek}; use std::path::PathBuf;...
extern crate notify; extern crate base64; use notify::{Watcher, RecursiveMode, RawEvent, raw_watcher}; use std::sync::mpsc::channel; use std::sync::{Arc, Mutex, Condvar}; use std::{thread, time}; use std::net::TcpListener; use std::thread::spawn; use serde_json::{Value}; // also see: https://crates.io/crates/tungsten...
/* * Copyright (c) 2015-2021, SALT. * This file is part of HashtagBlessedII and is distributed under the 3-clause BSD license. * See LICENSE.md for terms of use. */ #![allow(warnings, unused)] use crate::util::*; const CAR_PADDR: u32 = 0x60006000; const CAR_VADDR: u32 = 0x60006000; pub const CLK_RST_CONTROLLE...
use x86::{Reg, X86Arg, X86, CALLEE_SAVE_REGS}; use ast::CC; fn display_reg(reg: &Reg) -> String { match reg { Reg::AL => "al", Reg::RAX => "rax", Reg::RBX => "rbx", Reg::RBP => "rbp", Reg::RDX => "rdx", Reg::RCX => "rcx", Reg::RDI => "rdi", ...
#[derive(Clone, PartialEq, ::prost::Message)] pub struct C2s { ///统计数据类型,DelayStatisticsType #[prost(int32, repeated, packed="false", tag="1")] pub type_list: ::prost::alloc::vec::Vec<i32>, ///行情推送统计的区间,行情推送统计时有效,QotPushStage #[prost(int32, optional, tag="2")] pub qot_push_stage: ::core::option:...
use crate::float_near; use crate::vector::{Vec2, Vec3}; use std::cmp; use std::ops; #[repr(C)] #[derive(Debug, Default, Clone, Copy)] pub struct Vec4 { pub x: f32, pub y: f32, pub z: f32, pub w: f32, } impl Vec4 { pub fn new(x: f32, y: f32, z: f32, w: f32) -> Vec4 { Vec4 { x, y, z, w } ...
// Copyright 2020 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. //! The Archivist collects and stores diagnostic data from components. #![warn(clippy::all)] #![warn(missing_docs)] use { anyhow::{format_err, Contex...
use std::io; use std::io::prelude::*; use crate::compile::rust::{Const, Item, Module, RtType, StructType, Term, Type, TypeAlias}; pub fn emit_module(writer: &mut impl Write, module: &Module) -> io::Result<()> { let pkg_name = env!("CARGO_PKG_NAME"); let pkg_version = env!("CARGO_PKG_VERSION"); writeln!( ...
// Copyright 2020 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. //! Safe wrapper to talk to USB devices from a host. //! //! # Supports //! - OS backends: Linux and MacOS. //! - Bulk only interfaces with a single IN a...
use crate::account::VeSyncAccount; use serde::Deserialize; const TK: &str = "tk"; const ACCOUNTID: &str = "accountid"; #[derive(Deserialize, Debug, Copy, Clone)] pub enum Status { Unknown, #[serde(rename = "on")] On, #[serde(rename = "off")] Off, } #[derive(Deserialize, Debug, Copy, Clone)] pub e...