text
stringlengths
7.05k
33.9k
use crate::video; use crate::keypad::Keypad; use std::fs::File; use std::io::prelude::*; use rand::random; const STARTADDR: u16 = 0x200; // Memory map from 0x200 to 0xfff used to stor rom and work ram static CHIP8_FONTSET: [u8;80] = [ 0xF0, 0x90, 0x90, 0x90, 0xF0, // 0 0x20, 0x60, 0x20, 0x20, 0x70, // 1 ...
//! This file contains code for parsing JMDict XML files. //! //! The `Parser` type takes a buffered reader, and acts as an iterator //! that yields a `WordEntry` for each entry in the dictionary, parsing //! the input as it goes. use std::collections::HashSet; use std::io::BufRead; use quick_xml::events::Event; ///...
//! This module contains structs and enums that represent dom types, and their parts. //! These are the types used internally by our virtual dom. use std::collections::HashMap; use web_sys; use wasm_bindgen::{prelude::*, JsCast}; use crate::vdom::Mailbox; // todo temp // todo cleanup enums vs &strs for restrictin...
#![allow(warnings, unused)] #![deny(clippy::all)] use std::fmt; use std::fs::*; use std::io::{BufWriter, Write}; use std::process::Command; use std::str::FromStr; use std::{collections::HashMap, unimplemented}; use log::{error, info, trace}; use rand::{thread_rng, Rng}; use regex::Regex; use simplelog::*; /// Helper ...
//! The test runner is used to run the integration tests for the kernel. use clap::{crate_authors, crate_version, value_t, App, Arg}; use std::{ env::current_dir, fmt, fs::{copy, create_dir_all, read_dir, File}, io::{Read, Write}, path::PathBuf, process::{exit, Command, Stdio}, str::from_ut...
use indexmap::IndexSet; //use regex_to_nfa::regex_to_nfa; use super::byteclass::{ByteClass, ByteClassId}; use super::stateid::StateId; use std::{ collections::{BTreeSet, HashSet}, convert::TryInto, fmt::Debug, hash, iter, mem::{self}, ops::{Index, IndexMut, Range}, usize, }; #[derive(Debug,...
// This file is part of Substrate. // Copyright (C) <NAME> // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICE...
use font_kit::canvas::{Canvas, Format, RasterizationOptions}; use font_kit::metrics::Metrics; use font_kit::outline::OutlineSink; use font_kit::{hinting::HintingOptions, source::SystemSource}; use image::{GenericImage, GenericImageView, ImageBuffer, RgbImage}; use lerp::Lerp; use pathfinder_geometry::rect::RectF; use p...
#![allow(clippy::wildcard_imports, clippy::enum_glob_use)] use crate::utils::ast_utils::{eq_field_pat, eq_id, eq_pat, eq_path}; use crate::utils::{over, span_lint_and_then}; use rustc_ast::mut_visit::*; use rustc_ast::ptr::P; use rustc_ast::{self as ast, Pat, PatKind, PatKind::*, DUMMY_NODE_ID}; use rustc_ast_pretty::...
/// ShardSpec describes a shard and its configuration, and is the long-lived unit /// of work and scaling for a consumer application. Each shard is allocated to a /// one "primary" at-a-time selected from the current processes of a consumer /// application, and is re-assigned on process fault or exit. /// /// ShardSpec...
use super::{Dictionary, Object, ObjectId, Stream, StringFormat}; use crate::content::*; use crate::reader::Reader; use crate::xref::*; use std::str::{self, FromStr}; use nom::IResult; use nom::bytes::complete::{tag, take, take_while, take_while1, take_while_m_n}; use nom::branch::alt; use nom::error::{ParseError, Erro...
use crate::model; use crate::texture; use crate::asset; use crate::shader; use cgmath::prelude::*; pub struct HeadRenderInfo { pub hair: usize, pub face: usize, pub nose: usize, pub beard: usize, pub glass: usize, pub eye: usize, pub eyebrow: usize, pub beard_plain: usize, pub wrin...
//! The input needed by egui. use crate::emath::*; /// What the integrations provides to egui at the start of each frame. /// /// Set the values that make sense, leave the rest at their `Default::default()`. /// /// You can check if `egui` is using the inputs using /// [`crate::Context::wants_pointer_input`] and [`cr...
use crate::texture::Texture; use crate::{DrawCommand, DrawCommandData, DrawRange, QuadDrawCommand, Vertex}; use nalgebra::{Matrix4, Vector2, Vector3, Vector4}; use num_traits::identities::Zero; use std::collections::HashMap; use tuber_core::asset::AssetStore; use tuber_core::transform::{IntoMatrix4, Transform2D}; use t...
//! A plugin-able system of passes made over the composition [`Graph`], in order to modify or //! optimise the graph. use std::{ cmp::Reverse, collections::{BinaryHeap, HashMap}, fmt::Debug, ops::Not, }; use crate::{layout::ChunkId, utils::FrontierItem, Query}; use super::{Chunk, Graph, Link, LinkId}...
#[cfg(test)] mod config_tests; #[cfg(test)] mod tests; use hyper::{Body, Request, Response, StatusCode}; use ic_crypto_tls_interfaces::TlsHandshake; use ic_interfaces::{ certified_stream_store::{CertifiedStreamStore, EncodeStreamError}, registry::RegistryClient, }; use ic_logger::{debug, info, warn, ReplicaLog...
#![crate_name = "voca_rs"] #![deny( warnings, unused_variables, missing_docs, unsafe_code, unused_extern_crates )] #![cfg_attr(all(test, feature = "nightly"), feature(test))] //! Voca_rs is the ultimate Rust string library inspired by Voca.js and string.py //! //! Using functions: //! ```rust //! u...
#[cfg(not(target_arch = "wasm32"))] mod main_native; #[cfg(not(target_arch = "wasm32"))] pub use main_native::*; #[cfg(target_arch = "wasm32")] mod main_web; #[cfg(target_arch = "wasm32")] pub use main_web::*; use rafx::api::*; use winit::{ event::{Event, WindowEvent}, event_loop::ControlFlow, }; pub fn upda...
use crate::dist::Toolchain; use lru_disk_cache::Result as LruResult; use lru_disk_cache::{LruDiskCache, ReadSeek}; use std::fs; use std::io; use std::path::{Path, PathBuf}; use crate::errors::*; #[cfg(feature = "dist-client")] pub use self::client::ClientToolchains; use crate::util::Digest; use std::io::Read; #[cfg(...
// This file is part of Substrate. // Copyright (C) 2019-2021 Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // ht...
#[cfg(test)] mod tests; use crate::consumer::{Consumer, ConsumerId, ConsumerOptions}; use crate::data_consumer::{DataConsumer, DataConsumerId, DataConsumerOptions, DataConsumerType}; use crate::data_producer::{DataProducer, DataProducerId, DataProducerOptions, DataProducerType}; use crate::data_structures::{AppData, S...
// Copyright 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. #![cfg(test)] use std::{collections::HashMap, convert::TryFrom as _}; use fuchsia_async::{DurationExt as _, TimeoutExt as _}; use anyhow::anyhow; use fu...
// tim_sort_without_gallop.rs /* * ๆƒ…ๅ†ต1: A > B๏ผŒๆ‰€ไปฅไธๅˆๅนถ ๆƒ…ๅ†ต2: A < B๏ผŒๆ‰€ไปฅ B ๅ’Œ A ๅˆๅนถ * | | | | * B -> | [xxxxxxxxx] | B -> | [xxxxxxxxxxxxx] | * | | | ...
use std::collections::{HashMap, HashSet}; use std::convert::{TryFrom, TryInto}; type Pos = (i64, i64); type TileMap = HashMap<Pos, Tile>; #[derive(Debug)] enum Mode { Pos, Im, Rel, } #[derive(Debug)] enum Intcode { Add(Mode, Mode, Mode), Mult(Mode, Mode, Mode), In(Mode), Out(Mode), Ji...
use bytes::Bytes; use h2; use http::header::HeaderValue; use http::{self, HeaderMap}; use log::{debug, trace, warn}; use percent_encoding::{percent_decode, percent_encode, EncodeSet, DEFAULT_ENCODE_SET}; use std::{error::Error, fmt}; const GRPC_STATUS_HEADER_CODE: &str = "grpc-status"; const GRPC_STATUS_MESSAGE_HEADER...
use crate::{CVBytes, CVWords, IncrementCounter, BLOCK_LEN, CHUNK_LEN, OUT_LEN}; use arrayref::array_ref; use arrayvec::ArrayVec; use core::usize; use rand::prelude::*; // Interesting input lengths to run tests on. pub const TEST_CASES: &[usize] = &[ 0, 1, CHUNK_LEN - 1, CHUNK_LEN, CHUNK_LEN + 1, ...
#![allow(dead_code)] use crate::room::Room; use crate::rooms_registry::ServerState; use axum::extract::ws::{Message, WebSocket}; use event_listener_primitives::HandlerId; use mediasoup::prelude::*; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::fmt; use tokio::sync::mpsc::unbounded_channe...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Battery Backup Memory 0"] pub bakmem0: BAKMEM0, #[doc = "0x02 - Battery Backup Memory 1"] pub bakmem1: BAKMEM1, #[doc = "0x04 - Battery Backup Memory 2"] pub bakmem2: BAKMEM2, #[doc = "0x06 - Battery Backup Memo...
// Copyright 2018 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. mod slice; mod tuple; use std::fmt::{self, Display}; use std::mem::{size_of, transmute_copy, MaybeUninit}; use std::result; use std::sync::Arc; use b...
use crate::characters::{JungseongCharacter::*, *}; use crate::constants::*; use crate::syllable::*; use std::convert::TryFrom; #[derive(Clone, Debug, PartialEq, PartialOrd)] pub enum Jungseong { Normal(JungseongCharacter), Compat(JungseongCharacter), } fn to_code(code: u32) -> u32 { if code.is_syllable() ...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { _reserved0: [u8; 4usize], #[doc = "0x04 - Stops PWM pulse generation on all channels at the end of current PWM period, and stops sequence playback"] pub tasks_stop: TASKS_STOP, #[doc = "0x08 - Description collection\\[n\\]: Loads the first...
#![warn( // Harden built-in lints missing_copy_implementations, missing_debug_implementations, missing_docs, unreachable_pub, // Harden clippy lints clippy::cargo_common_metadata, clippy::clone_on_ref_ptr, clippy::dbg_macro, clippy::decimal_literal_representation, clippy::fl...
use std::collections::{HashSet, HashMap}; use ldap3::{SearchEntry, Mod}; type CreateLdapAttrs<'a> = Vec<(&'a str, HashSet<&'a str>)>; use crate::helpers::{before_and_after, before_and_between_and_after, generalized_time_to_iso8601, iso8601_to_generalized_time}; use crate::my_err::{Result, MyErr}; use crate::ldap_wrapp...
//! Types module. pub mod read; use self::read::ClassData; use crate::error; use bitflags::bitflags; use std::{fmt, ops::Deref, str::FromStr}; #[derive(Debug, Clone)] /// Basic built-in types. pub enum Type { /// Void type. Void, /// Boolean. Boolean, /// Byte (8 bits). Byte, /// Short (16...
#[cfg(target_arch = "x86")] use core::arch::x86::*; #[cfg(target_arch = "x86_64")] use core::arch::x86_64::*; use super::reference; const K32: [u32; 64] = reference::K32; // takes 32 bits word from four data 64 bytes block and pack it into one simd u32x4 // // | block 3 | block 2 | block 1 | block 0 | // // x86 a...
use super::{PhaseEquilibrium, SolverOptions, Verbosity}; use crate::density_iteration::pressure_spinodal; use crate::equation_of_state::EquationOfState; use crate::errors::{EosError, EosResult}; use crate::state::{Contributions, DensityInitialization, State, TPSpec}; use crate::EosUnit; use ndarray::{arr1, Array1...
use std::fmt; use std::path::PathBuf; use log::{error, info, warn}; use serde::Deserialize; use serde_yaml; use simplelog::{ConfigBuilder, LevelFilter, WriteLogger}; // Constants const DEFAULT_ERROR: &str = "BAT Error!\nBAT Error!\n#FF0000"; // Traits pub trait I3Block { fn format_i3(&self) -> String; } /// Con...
/*! [`RedisListener`]ๆŽฅๅฃ็š„ๅ…ทไฝ“ๅฎž็Žฐ [`RedisListener`]: trait.RedisListener.html */ use std::cell::RefCell; use std::io::{BufRead, BufReader, Error, ErrorKind, Read, Result, Write}; use std::net::TcpStream; use std::ops::DerefMut; use std::rc::Rc; use std::result::Result::Ok; use std::sync::atomic::{AtomicBool, AtomicI64, Ord...
use lexer::*; use std::collections::HashMap; use std::sync::Mutex; macro_rules! unexpected { ($expected:expr, $got:expr) => {Err(format!("expected {}, fount {:?}", $expected, $got))}; } lazy_static! { static ref PRECEDENCE_TABLE: Mutex<HashMap<char, u8>> = { let mut m = HashMap::new(); m....
use codespan_reporting::term::{emit, termcolor::NoColor, Config}; use g_code::parse::{into_diagnostic, snippet_parser}; use gloo_file::futures::read_as_text; use gloo_timers::callback::Timeout; use paste::paste; use roxmltree::Document; use std::num::ParseFloatError; use web_sys::{FileList, HtmlElement}; use yew::prelu...
use std::{collections::HashMap, mem::size_of}; use glow::HasContext; use glutin::{event::WindowEvent, event_loop::ControlFlow, PossiblyCurrent}; use imgui::{BackendFlags, ConfigFlags, DrawData, DrawVert, ViewportFlags}; fn main() { let event_loop = glutin::event_loop::EventLoop::new(); let mut imgui = imgui:...
use crate::file::File; use crate::memlist::*; use crate::parts::*; use crate::reference::*; use crate::{serializer::*, storage::Storage}; use anyhow::{ensure, Result}; trace::init_depth_var!(); const MEM_BLOCK_SIZE: usize = 600 * 1024; //600kb total memory consumed (not taking into account stack and static heap) str...
// Copyright 2020-2021 <NAME> under the terms of the MIT License as detailed // in the accompanying file README.md or <https://opensource.org/licenses/MIT>. use cgmath::{EuclideanSpace as _, InnerSpace as _, MetricSpace as _, Point3, Vector3, Zero as _}; use ordered_float::OrderedFloat; use std::convert::TryInto; use ...
// // mc ไบŒ่ฟ›ๅˆถๅ่ฎฎๅŒ…๏ผŒ็”จไบŽๆž„ๅปบๅ„็งๅ่ฎฎๆŒ‡ไปค๏ผŒๆ‰€ๆœ‰mcๅ่ฎฎๆž„ๅปบๅ‡้œ€ๆ”พๅœจ่ฟ™้‡Œ fishermen // cmd็š„็ฌฌไธ€ไธชๅญ—่Š‚๏ผŒ็”จไบŽๆ ‡็คบrequest or response #[allow(dead_code)] pub enum Magic { Request = 0x80, Response = 0x81, } pub const CAS_LEN: usize = 8; // ๆ€ปๅ…ฑๆœ‰48ไธชopcode๏ผŒ่ฟ™้‡Œๅ…ˆๅช้ƒจๅˆ†ๆ”ฏๆŒ #[allow(dead_code)] pub enum Opcode { Get = 0x00, Set = 0x01, Add = 0x02, Rep...
// 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. use { anyhow::{format_err, Error}, bt_a2dp::{media_types::*, peer::ControllerPool, peer::Peer, stream}, bt_avdtp::{self as avdtp, ServiceCapabi...
extern crate libbpf; extern crate libc; extern crate nix; extern crate regex; extern crate structopt; mod bindings; mod generated_bytecode; mod pstree; use generated_bytecode::generate_execve_entry; use generated_bytecode::generate_exit_group_entry; use generated_bytecode::generate_trace_entry; use generated_bytecode...
mod spec; const OPENAPI_VERSION: &str = "3.0.0"; /// A number rule to set up an enum for a given numeric type. macro_rules! number_rule { ($variants:ident, $name:ident, $convert:ident) => {{ let mut __number = spec::$name::default(); for n in $variants { let n = n.value.$convert().ok_...
mod drawer; mod simulating; use ahash::AHashMap; use cogs_gamedev::{ controls::InputHandler, grids::{Direction4, ICoord}, }; use macroquad::prelude::info; use crate::{ assets::{Assets, Level}, boilerplates::{FrameInfo, Gamemode, GamemodeDrawer, Transition}, controls::{Control, InputSu...
use crate::error::RollingError; use crate::level::Level; use ini::Ini; use rand::distributions::Alphanumeric; use rand::{thread_rng, Rng}; use std::collections::HashMap; use std::error::Error; use std::io::Read; use std::path::Path; use std::process::exit; use std::time::{Duration, Instant, SystemTime}; use std::{fs, i...
// 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. use { anyhow::{format_err, Error}, fidl_fuchsia_input as input, fidl_fuchsia_ui_input3 as ui_input3, fidl_fuchsia_ui_shortcut as ui_shortcut, f...
use fxhash::FxHashMap; use std::fmt::Display; use serde::export::Formatter; use serde::export::fmt::Error; use itertools::Itertools; use crate::intcode::{InputDevice, OutputDevice, Hal}; #[aoc_generator(day11)] pub fn generator(input: &str) -> Vec<isize> { serde_scan::from_str_skipping(",", input).expect("input") ...
/* Copyright 2013 <NAME> * * Use of this source code is governed by a MIT-style license that can be * found in the LICENSE file. * * Portions Copyright 2006 The Android Open Source Project * * Use of that source code is governed by a BSD-style license that can be * found in the LICENSE.skia file. */ use type...
use crate::evaluator::environment::Environment; use crate::evaluator::internal::InternalEnvironment; use crate::value::{Closure, InternalFunctionClosure, Numeric, Value}; use brucket_analyzer::variables_analyzer::{Variables, VariablesError}; use brucket_ast::constant_value::{Boolean, ConstantVariant, Number}; use bruck...
// Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 //! This module provides an abstraction for positioning a node in a binary tree, //! A `Position` uniquely identifies the location of a node //! //! In this implementation, `Position` is represented by the in-order-traversal sequence n...
use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] pub struct PartyDetailGrp { /// NoPartyDetails #[serde(skip_serializing_if = "Option::is_none")] #[serde(rename = "1671")] pub party_details: Option<fix_common::RepeatingValues<PartyDetail>>, } #[derive(Seria...
use futures::sync::mpsc::UnboundedReceiver; use futures::{Async, Future, Poll, Stream}; use log::{error, info, trace, warn}; use sha1::{Digest, Sha1}; use std::env; use std::io::{self, stderr, Write}; use std::mem; use std::path::PathBuf; use std::process::exit; use std::str::FromStr; use std::time::Instant; use tokio_...
//! stm32ral module for stm32h743v /// Number of priority bits implemented by the NVIC pub const NVIC_PRIO_BITS: u8 = 4; /// Interrupt-related magic for this device pub mod interrupts; pub use self::interrupts::Interrupt; pub use self::interrupts::Interrupt as interrupt; pub use super::instances::ac; pub use super::...
//! Types and traits for easily getting a message's arguments, or appening a message with arguments. //! //! Also see the arguments guide (in the examples directory). //! //! A message has `read1`, `read2` etc, and `append1`, `append2` etc, which is your //! starting point into this module's types. //! //! **Append a*...
use bitvec::{view::BitView, field::BitField, prelude as bv}; use bytes::{Buf, Bytes}; use enumflags2::{BitFlags, bitflags}; #[bitflags] #[repr(u32)] #[derive(Copy, Clone, Debug, PartialEq)] pub enum ServiceClass { Positioning = 1 << 16, Networking = 1 << 17, Rendering = 1 << 18, Capturing = 1 << 19, ...
use std::borrow::Cow; use std::collections::HashSet; use std::error::Error; use std::ffi::OsStr; use std::path::{Path, PathBuf}; use std::process; use std::{env, fs}; use console::{set_colors_enabled, style, Key, Term}; use ignore::{Walk, WalkBuilder}; use insta::{print_snapshot_diff, Snapshot}; use serde::Serialize; ...
// Copyright 2020 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. //! A crate for abstracting the underlying kernel hypervisor used in crosvm. #[cfg(any(target_arch = "arm", target_arch = "aarch64"))] pub mod aarch64;...
use std::collections::BTreeMap; use std::iter::Peekable; use std::sync::Arc; use camp_ast::{ tok::Star, CampResult, CampsiteId, EnumId, Item as AstItem, ModDecl, ModId, Path, PathSegment, Span, Use as AstUse, }; use camp_util::bail; use maplit::btreemap; use crate::items::{CampsiteItems, ItemPath, Items, Unre...
use std::cell::{Cell, RefCell}; use std::rc::Rc; use wayland_client as wlc; use wayland_client::protocol::wl_surface; use wayland_protocols::xdg_shell::client::xdg_popup; use wayland_protocols::xdg_shell::client::xdg_positioner; use wayland_protocols::xdg_shell::client::xdg_surface; use crate::kurbo; use crate::window...
/* Portions Copyright 2019-2021 ZomboDB, LLC. Portions Copyright 2021-2022 Technology Concepts & Design, Inc. <<EMAIL>> All rights reserved. Use of this source code is governed by the MIT license that can be found in the LICENSE file. */ use crate::{pg_config::PgConfig, sql_entity_graph::PositioningRef}; use eyre::{...
use backend_state::BackendState; use buffer_state::BufferState; use cgmath::{perspective, Deg, Matrix4, Point3, Vector3}; use color::Color; use cube::{Cube, CUBE_INDICES}; use desc_set_layout::DescSetLayout; use device_state::DeviceState; use dims::DIMS; use framebuffer_state::FramebufferState; use hal; use hal::buffer...
//! AWS Regions and helper functions. //! //! Mostly used for translating the Region enum to a string AWS accepts. //! //! For example: `UsEast1` to "us-east-1" use crate::credential::ProfileProvider; use serde::ser::SerializeTuple; use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; use std; use std::e...
use log::info; use n18catalogue::Catalogue; use n18hex::{Hex, Orientation}; use n18map::{Coordinates, Map}; use n18route::{Bonus, ConflictRule, Routes, Train, Trains}; use n18tile::Tile; use n18token::{Token, Tokens}; pub mod _1830; pub mod _1861; pub mod _1867; pub mod _1889; /// Creates a new game of 1830: Railways...
// SPDX-License-Identifier: Apache-2.0 //! syscall interface layer between assembler and rust use crate::addr::{HostVirtAddr, ShimPhysUnencryptedAddr}; use crate::allocator::ALLOCATOR; use crate::asm::_enarx_asm_triple_fault; use crate::attestation::SEV_SECRET; use crate::hostcall::{HostCall, HOST_CALL_ALLOC}; use cr...
// Crossover: clean crossovers as a multi-out plugin // Copyright (C) 2022 <NAME> // // This program 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) an...
use std::collections::VecDeque; use super::{Bezier, Evaluate, Piecewise, Vector, GlyphBuilder}; use super::consts::SMALL_DISTANCE; use glifparser::{Glif, JoinType, Outline, PointData, VWSContour, glif::{CapType, InterpolationType, VWSHandle}}; #[derive(Debug)] pub struct VWSSettings<PD: PointData> { pub cap_custo...
// Unless explicitly stated otherwise all files in this repository are licensed under the // MIT/Apache-2.0 License, at your convenience // // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2020 // Datadog, Inc. // //! # Glommio - asynchronous thread per core applications in...
use std::cell::RefCell; use std::rc::Rc; use gdnative::api::{ File, GlobalConstants, ImageTexture, InputEventMouseButton, InputEventMouseMotion, VisualServer, }; use gdnative::nativescript::property::{EnumHint, StringHint}; use gdnative::prelude::*; /// Contains conversion tables between Godot and egui input cons...
use crate::Tile; use cairo::Context; use n18hex::consts::PI; use n18hex::{ Colour, Coord, Hex, HexColour, HexCorner, HexFace, HexPosition, Orientation, }; /// The different types of labels that may appear on a tile. #[derive(Clone, Debug, PartialEq, Eq)] pub enum Label { /// A unique identifier for tiles t...
#![allow( // need to test cloning, these are deliberate. clippy::redundant_clone, // yep, we create owned instance just for comparison, to test comparison // with owned instacnces. clippy::cmp_owned, // Deliberate clippy::redundant_slicing, )] #![cfg(feature = "substr")] use arcstr::{ArcStr,...
#![allow(non_snake_case)] use super::*; use codec::{Decode, Encode, MaxEncodedLen}; use enumflags2::BitFlags; use frame_support::{ traits::{ConstU32, Get}, BoundedVec, CloneNoBound, PartialEqNoBound, RuntimeDebugNoBound, }; use scale_info::{ build::{Fields, Variants}, meta_type, Path, Type, TypeInfo, TypeParamete...
// This file is part of Substrate. // Copyright (C) 2020-2021 Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License") // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // htt...
use camera::Camera; use camera_controller::*; use cgmath::{InnerSpace, Zero}; use futures::executor::block_on; use model::Model; use rendering::gpu_resources::GpuResources; use voxel_tools::chunks::Chunks; use wgpu::util::DeviceExt; use winit::{ event::*, event_loop::{ControlFlow, EventLoop}, window::{Windo...
// Copyright 2017-2019 Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) a...
#![cfg_attr(not(feature = "std"), no_std)] //! Scheduling Execution use sp_std::prelude::*; use sp_runtime::{traits::Zero, RuntimeDebug}; use frame_support::{ codec::{Decode, Encode}, decl_event, decl_module, decl_storage, dispatch::{DispatchResult, DispatchError}, ensure, traits::Get, }; use frame_...
#![warn( clippy::explicit_iter_loop, clippy::semicolon_if_nothing_returned, clippy::wildcard_imports, clippy::too_many_lines, clippy::redundant_else )] #![feature(try_trait_v2)] mod aabb; mod accumulator; mod algorithm; mod annotations; mod app; mod bool_poll; mod button; mod camera; mod capture; m...
// Diopser: a phase rotation plugin // Copyright (C) 2021-2022 <NAME> // // This program 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 later vers...
/* This tool is part of the WhiteboxTools geospatial analysis library. Authors: Dr. <NAME> Created: 07/07/2017 Last Modified: 03/09/2020 License: MIT */ use whitebox_raster::Raster; use crate::tools::*; use num_cpus; use std::env; use std::f64; use std::io::{Error, ErrorKind}; use std::path; use std::sync::mpsc; use s...
// Copyright 2017 Parity Technologies (UK) Ltd. // // 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, mer...
//! The parser that transform expressions into a `Term`. use std::{ fmt::{self, Display}, iter::IntoIterator, mem, }; use crate::term::{app, lam, var, Term}; use self::{ParseErrorKind::*, Token::*}; /// Parses a `str` slice into `Term`. /// /// This is a wrapper function of the more general `parse` func...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { _reserved0: [u8; 0x08], #[doc = "0x08 - "] pub conf: crate::Reg<conf::CONF_SPEC>, #[doc = "0x0c - "] pub int_raw: crate::Reg<int_raw::INT_RAW_SPEC>, #[doc = "0x10 - "] pub int_st: crate::Reg<int_st::INT_ST_SPEC>, #[doc = "0...
use self::Component::*; use crate::sys::unity::component as component_impl; use crate::unity::{Version, Localization}; use crate::unity::urls::DownloadURL; use std::fmt; use std::path::{Path, PathBuf}; use std::slice::Iter; use std::str::FromStr; use reqwest::Url; mod error; mod category; pub use self::category::Categ...
// use std::collections::HashMap; fn main() { println!("Hello, world!"); let s = "aa"; print_typename(s); // 5-2-1 let t1 = (3, "birds".to_string()); let mut b1 = Box::new(t1); (*b1).0 += 1; assert_eq!(*b1, (4, "birds".to_string())); // 5-2-2 let _v1 = vec!(false, true, false)...
#![deny(unsafe_code)] #![no_main] #![no_std] // Global Logger use defmt_rtt as _; // Define Panic behaivior use panic_probe as _; // Used traits from the HAL crate extern crate stm32f3xx_hal as hal; use hal::prelude::*; // Logger macros use defmt::debug; // Message Passing between Idle, Interrupt and Periodic use h...
use log::{debug, trace}; use serde::Deserialize; use serde_repr::*; /// The maximum travel before a tap is considered a swipe, in millimeters. const MAX_TAP_DISTANCE: f64 = 100f64; /// The maximum number of tools (fingers) that are tracked and reported on simultaneously. const MAX_SLOTS: usize = 5; /// How long before...
use qtrack::scene::{Participant, Scene}; use qtrack::Detection; use opencv::{ core::{self, Mat}, highgui, prelude::*, videoio, }; use nalgebra as na; use clap::{Clap, AppSettings}; pub struct VideoWriter { writer: Option<opencv::videoio::VideoWriter>, size: Option<(i32, i32)>, out_file: Str...
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // // Portions Copyright 2017 The Chromium OS Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the THIRD-PARTY file. use std::fs::File; us...
use crate::syn_ext::*; use call2_for_syn::call2_strict; use proc_macro2::Span; use quote::quote_spanned; use std::{iter, mem}; use syn::{ parse2, parse_quote, punctuated::Punctuated, spanned::Spanned as _, token::{Brace, Paren}, AngleBracketedGenericArguments, Attribute, Binding, Constraint, Expr, Field, FieldsNam...
use crate::core::{strings::*, UndefinedStruct}; use crate::SMBiosStruct; use serde::{ser::SerializeStruct, Serialize, Serializer}; use std::{ array::TryFromSliceError, convert::{TryFrom, TryInto}, fmt, ops::Deref, }; /// # System Information (Type 1) /// /// The information in this structure defines at...
use crate::acl::{Acl, Engine, Permission}; use crate::crdt::{Causal, CausalContext, Crdt}; use crate::crypto::Keypair; use crate::cursor::Cursor; use crate::id::{DocId, PeerId}; use crate::lens::LensesRef; use crate::path::Path; use crate::radixdb::{BlobMap, BlobSet, Storage}; use crate::registry::{Expanded, Hash, Regi...
use crate::Error; #[cfg(feature = "tmux_2_5")] use crate::SessionStack; #[cfg(feature = "tmux_1_6")] use std::time::Duration; pub const SESSION_ACTIVITY: u32 = 1; pub const SESSION_ACTIVITY_STRING: u32 = 1 << 1; pub const SESSION_ALERTS: u32 = 1 << 2; pub const SESSION_ATTACHED: u32 = 1 << 3; pub const SESSION_ATTACHE...
use core::convert::TryInto; use core::ops::Deref; #[cfg(not(feature = "std"))] use alloc::{boxed::Box, vec, vec::Vec}; use ethereum_types::H256; use lazy_static::lazy_static; use sha2::Digest; const HASH_LENGTH: usize = 16; // bytes. const WORD_LENGTH: usize = 128; // bytes. const BRANCH_ELEMENT_LENGTH: usize = 32; ...
use crate::{ TARGET, StorageAlloc, StorageTelemetry, db_impl_serializable, db::traits::KvcWriteable, node_state_db::NodeStateDb, traits::Serializable, types::BlockMeta }; use adnl::{ declare_counted, common::{ add_counted_object_to_map, add_unbound_object_to_map_with_update, CountedOb...
//! Runs ``diesel`` tests efficiently using a live Postgres connection. //! //! This test runner takes advantage of the highly transactional nature of Postgres to //! quickly restore the database to a well-known state before each test. //! Once the database schema is initialized, it can take only a fraction of a second...
use std::collections::{HashMap, HashSet}; // All values are in ln-space unless otherwise specified pub fn sample(dist: &[f64]) -> usize { let selector = rand::random::<f64>(); let mut cdf = 0.0; for (value, &prob) in dist.iter().enumerate() { cdf += prob; if selector < cdf { re...
//! GLTF format use std::collections::HashMap; use std::error::Error as StdError; use std::fmt; use std::sync::Arc; use self::importer::{get_image_data, import, Buffers, ImageFormat}; use animation::{AnimationOutput, InterpolationType, Sampler}; use assets::{Error as AssetError, Format, FormatValue, Result as AssetRe...