text
stringlengths
7.05k
33.9k
//! This module provides naming analysis for a given Lola AST. use crate::ast::*; use crate::parse::{Ident, NodeId, Span}; use crate::reporting::{Handler, LabeledSpan}; use crate::stdlib; use crate::stdlib::FuncDecl; use crate::ty::ValueTy; use crate::FrontendConfig; use std::{collections::HashMap, rc::Rc}; // These ...
use std::fs::remove_file; use std::path::{Path, PathBuf}; use std::sync::Arc; use heed::types::{DecodeIgnore, OwnedType, SerdeJson}; use heed::{Database, Env, EnvOpenOptions}; use parking_lot::RwLock; use serde::{Deserialize, Serialize}; use std::fs::File; use tokio::sync::mpsc; use uuid::Uuid; use crate::index_contr...
use std::net::{Ipv4Addr, UdpSocket}; use std::str::{self, FromStr}; use std::time::{Duration, SystemTime, UNIX_EPOCH}; struct ByteBuffer { buf: [u8; 512], pos: usize, } impl ByteBuffer { fn new() -> Self { ByteBuffer { buf: [0; 512], pos: 0, } } fn seek(&mu...
// Copyright Materialize, Inc. All rights reserved. // // Use of this software is governed by the Business Source License // included in the LICENSE file. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by the Apache License...
#![feature(type_alias_impl_trait)] #![feature(associated_type_defaults)] #![allow(unused_unsafe)] use input::input; use math::{AsLine, Point, Rect, Vec2}; use canvas::Canvas; use tree::{NodeId, SocketId, SocketKind}; use ui::*; use wasm_bindgen::{prelude::*, JsCast}; mod canvas; mod capabilities; mod function; mod i...
use crate::crh::TwoToOneCRHGadget; use crate::merkle_tree::Config; use crate::{CRHGadget, Path}; use ark_ff::Field; use ark_r1cs_std::alloc::AllocVar; use ark_r1cs_std::boolean::Boolean; use ark_r1cs_std::eq::EqGadget; #[allow(unused)] use ark_r1cs_std::prelude::*; use ark_r1cs_std::ToBytesGadget; use ark_relations::r1...
mod utils; use wasm_bindgen::prelude::*; use std::fmt; use web_sys::console; // When the `wee_alloc` feature is enabled, use `wee_alloc` as the global // allocator. #[cfg(feature = "wee_alloc")] #[global_allocator] static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; #[wasm_bindgen] pub fn init_panic_hook()...
/* Prod Copyright 2021-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 writing, softwa...
pub type int8_t = i8; pub type int16_t = i16; pub type int32_t = i32; pub type int64_t = i64; pub type uint8_t = u8; pub type uint16_t = u16; pub type uint32_t = u32; pub type uint64_t = u64; pub type c_schar = i8; pub type c_uchar = u8; pub type c_short = i16; pub type c_ushort = u16; pub type c_int = i32; pub type c...
pub use crate::ast::{expression::*, semantic::*, statement::*, Ast}; pub use crate::ir::*; pub use std::collections::HashMap; pub struct CfgBuilder<'env> { cfg_graph: CfgGraph, env: &'env mut Environment, current_proc_id: SymbolId, proc_jmp_table: HashMap<SymbolId, CfgProc>, } impl<'env> CfgBuilder<'e...
use std::prelude::v1::*; use std::ptr; use crate::bytes; use crate::error::{Error, Result}; use crate::tag; use crate::MAX_INPUT_SIZE; /// A lookup table for quickly computing the various attributes derived from a /// tag byte. const TAG_LOOKUP_TABLE: TagLookupTable = TagLookupTable(tag::TAG_LOOKUP_TABLE); /// `WORD...
use super::Capabilities; use crate::{ arena::{Arena, BadHandle, Handle, UniqueArena}, proc::Alignment, }; bitflags::bitflags! { /// Flags associated with [`Type`]s by [`Validator`]. /// /// [`Type`]: crate::Type /// [`Validator`]: crate::valid::Validator #[repr(transparent)] pub struct ...
use std::sync::Arc; use std::sync::Mutex; use std::collections::HashMap; use std::fs::File; use std::io::BufWriter; use std::io::{Seek, SeekFrom, Write}; use std::path::{Path, PathBuf}; #[allow(unused_imports)] use slog::{debug, info}; use itertools::{iproduct, Itertools}; use crossbeam::thread; use crate::coverage:...
#![allow(unknown_lints)] #![allow(bare_trait_objects)] use codec::helpers::codecs::ChunkedDecoder; use codec::helpers::codecs::PaddedDecoder; use codec::helpers::codecs::PaddedEncoder; use codec::helpers::codecs::StatelessEncoder; use codec::CodecSettings; use codec::CodecTransform; use codec::Direction; use codec::Er...
/* Things this doesn't currently support that it might need to later: - Import parsing is unfinished and so is currently disabled - When import parsing is enabled: - Import renames (use a::b as c) - these are silently ignored - Imports that start with two colons (use ::a::b) - these are als...
// Copyright (c) 2021 Quark Container Authors / 2018 The gVisor Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless ...
//! Example 04. User Interface //! //! Difficulty: Easy //! //! This example shows how to use user interface system of engine. It is //! based on framework example because UI will be used to operate on //! model. extern crate rg3d; pub mod shared; use crate::shared::create_camera; use rg3d::engine::resource_manager:...
use ark_ec::{msm::VariableBaseMSM, PairingEngine, ProjectiveCurve}; use ark_ff::{Field, One, PrimeField, UniformRand, Zero}; use ark_poly::polynomial::{ univariate::DensePolynomial as UnivariatePolynomial, Polynomial, UVPolynomial, }; use ark_std::{end_timer, start_timer}; use std::marker::PhantomData; use ark_st...
// Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. //! The "Action" concept represents an asynchronous activity on a component that should eventually //! complete. //! //! Actions decouple the "what" of wha...
/* * I/O core tools. */ use std::cell::RefCell; use std::collections::HashSet; use std::fs::File; use std::io::prelude::*; use std::io::BufReader; use std::path::PathBuf; use num_bigint::ToBigInt; use num_traits::ToPrimitive; use super::os; use crate::function::PyFuncArgs; use crate::import; use crate::obj::objbyt...
use frame_support::{assert_ok, parameter_types, traits::{EnsureInherentsAreFirst, Hooks, OnRuntimeUpgrade, StorageMapShim}, weights::{Weight, IdentityFee, GetDispatchInfo, DispatchInfo}}; use pallet_transaction_payment::{CurrencyAdapter}; use sp_runtime::{ KeyTypeId, CryptoTypeId, traits::{ self, BlakeTwo256, ...
// Copyright Materialize, Inc. All rights reserved. // // Use of this software is governed by the Business Source License // included in the LICENSE file. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by the Apache License...
/* artifact: the requirements tracking tool made for developers * Copyright (C) 2018 <NAME> <@vitiral, <EMAIL>> * * The source code is Licensed under either of * * * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or * http://www.apache.org/licenses/LICENSE-2.0) * * MIT license ([LICENSE-MIT](L...
use crate::avm1::{opcode::OpCode, types::*}; use crate::error::{Error, Result}; use crate::extensions::ReadSwfExt; use std::num::NonZeroU8; pub struct Reader<'a> { input: &'a [u8], #[allow(dead_code)] version: u8, } impl<'a> ReadSwfExt<'a> for Reader<'a> { #[inline(always)] fn as_mut_slice(&mut se...
use crate::{AgentMetadata, CarID, CarStatus, DrawCarInput, ParkedCar, ParkingSpot, Vehicle}; use abstutil::{ deserialize_btreemap, deserialize_multimap, serialize_btreemap, serialize_multimap, MultiMap, Timer, }; use geom::{Distance, Duration, Pt2D}; use map_model; use map_model::{BuildingID, Lane, LaneID, Lane...
extern crate mesh_simulator; use mesh_simulator::master::test_specification::*; use mesh_simulator::master::MobilityModels; use mesh_simulator::backend::*; use mesh_simulator::worker; use mesh_simulator::worker::protocols::Protocols; use mesh_simulator::worker::worker_config::*; use crate::mesh_simulator::mobility::{P...
//! `Registers` for executing commands and closely related types. use hashbrown::HashMap; use crate::{ alloc::{vec, Box, Rc, String, ToOwned, Vec}, arith::OrdArithmetic, error::{Backtrace, CodeInModule, EvalResult, TupleLenMismatchContext}, executable::command::{Atom, Command, CompiledExpr, FieldName,...
const SBOX: [u8; 256] = [ 0x63,0x7c,0x77,0x7b,0xf2,0x6b,0x6f,0xc5,0x30,0x01,0x67,0x2b,0xfe,0xd7,0xab,0x76, 0xca,0x82,0xc9,0x7d,0xfa,0x59,0x47,0xf0,0xad,0xd4,0xa2,0xaf,0x9c,0xa4,0x72,0xc0, 0xb7,0xfd,0x93,0x26,0x36,0x3f,0xf7,0xcc,0x34,0xa5,0xe5,0xf1,0x71,0xd8,0x31,0x15, 0x04,0xc7,0x23,0xc3,0x18,0x96,0x05,...
use byteorder::{LittleEndian, ReadBytesExt}; use num_derive::FromPrimitive; use serde::{Deserialize, Serialize}; use std::{io, str}; #[macro_use] pub mod error; use error::Error; // The header size is usually 9 bytes in LZMA, but because OpenCTM deduces the unpacked size in // a non-standard way, the unpacked size i...
//! //! The mighty triangle example. //! This examples shows colord triangle on white background. //! Nothing fancy. Just prove that `rendy` works. //! #![cfg_attr( not(any(feature = "dx12", feature = "metal", feature = "vulkan")), allow(unused) )] use { genmesh::generators::{IndexedPolygon, SharedVertex},...
// Licensed under the Apache License, Version 2.0 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option. // All files in the project carrying such notice may not be copied, modified, or distributed // except according ...
use rand::Rng; use sdl2::audio::AudioDevice; use sdl2::event::Event; use sdl2::keyboard::Keycode; use sdl2::pixels::{Color, PixelFormatEnum}; use sdl2::render::Canvas; use sdl2::video::Window; use sdl2::EventPump; use std::time::{Duration, Instant}; use crate::config; use audio::SquareWave; use character::{Character, ...
#![warn(unused_imports)] #![warn(unused_extern_crates)] #![feature(bench_black_box)] #![feature(panic_unwind)] #![feature(c_variadic)] #[macro_use] extern crate log; #[macro_use] extern crate lazy_static; extern crate phactory_pal as pal; extern crate runtime as chain; use rand::*; use serde::{ de::{self, Deseria...
use legion::Resources; pub use crate::daemon_args::AssetDaemonArgs; use crate::time::TimeState; use rafx::assets::distill_impl::AssetResource; #[cfg(feature = "egui")] use rafx_plugins::features::egui::EguiContextResource; #[cfg(feature = "basic-pipeline")] use rafx_plugins::pipelines::basic::AntiAliasMethodBasic as...
use core::fmt; use core::hash::{Hash, Hasher}; use core::marker::PhantomData; use crate::internal_prelude::*; #[inline] fn init_bufsize() -> usize { crate::sysconf(crate::SysconfName::GETGR_R_SIZE_MAX).unwrap_or(1024) } const MAX_BUFSIZE: usize = 32768; macro_rules! osstr_getters { ($($(#[$attr:meta])* $nam...
use crate::nu_style::{color_from_hex, color_string_to_nustyle}; use nu_ansi_term::{Color, Style}; use nu_protocol::Config; use nu_table::{Alignment, TextStyle}; use std::collections::HashMap; pub fn lookup_ansi_color_style(s: &str) -> Style { if s.starts_with('#') { match color_from_hex(s) { Ok...
// Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use crate::internal::core::{ Address, MessengerClient as RegistryMessengerClient, MessengerFactory as RegistryMessengerFactory, Payload, }; use crat...
//! Radio driver, Bluetooth Low Energy, nRF51 //! //! Sending Bluetooth Low Energy advertisement packets with payloads up to 31 bytes //! //! Currently all fields in PAYLOAD array are configurable from user-space //! except the PDU_TYPE. //! //! ### Authors //! * <NAME> <<EMAIL>> //! * <NAME> <<EMAIL>> //! * Date: June...
// 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...
use crate::auto_generated_core_binding::*; /// [Engine](struct.Engine.html)初期化時の設定を表します。 #[derive(Debug, PartialEq, Eq, Clone)] pub struct Config { /// 全画面モードかどうか。 pub fullscreen: bool, /// 画面サイズ可変かどうか。 pub resizable: bool, /// ログをコンソールに出力するかどうか。 pub log_console: bool, /// ログファイル名。 pub ...
use std::convert::TryFrom; use super::*; use crate::{ collections::{FillVecMap, HoleVecMap, Subset, TypedUsize, VecMap}, gg20::{ keygen::{tests::execute_keygen, KeygenPartyShareCounts, KeygenShareId, SecretKeyShare}, sign::api::{new_sign, SignShareId}, }, sdk::implementer_api::{decode_m...
// Copyright 2019 Zhizhesihai (Beijing) Technology Limited. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by a...
#[cfg(not(target_os = "linux"))] pub fn main() {} #[cfg(target_os = "linux")] extern crate glium; #[cfg(target_os = "linux")] use glium::glutin::{self, platform::unix::HeadlessContextExt}; #[cfg(target_os = "linux")] use std::{ sync::{Arc, Barrier}, time::Instant, }; #[cfg(target_os = "linux")] use vulkano::{...
use crate::{ annostorage::ValueSearch, errors::{GraphAnnisCoreError, Result}, graph::{ update::{GraphUpdate, UpdateEvent}, Graph, ANNIS_NS, NODE_NAME, NODE_NAME_KEY, NODE_TYPE, NODE_TYPE_KEY, }, types::{AnnoKey, Annotation, Component, ComponentType, Edge}, util::{join_qname, spli...
use chainpack::{RpcValue, Decimal}; use std::mem::size_of; /// Setup function that is only run once, even if called multiple times. fn init_log() { let _ = env_logger::builder().is_test(true).try_init(); // INIT.call_once(|| { // env_logger::init(); // }); } fn from_chainpack(data: &[u8]) -> RpcVa...
/* * Copyright (c) 2021, <NAME>. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following discla...
//! Main API entry point for reading and manipulating Metamath databases. //! //! A variable of type `Database` represents a loaded database. You can //! construct a `Database` object, then cause it to represent a database from a //! disk file using the `parse` method, then query various analysis results //! which wil...
//! Account deposit is information per user about their balances in the exchange. use std::collections::HashMap; use near_sdk::collections::UnorderedMap; use near_contract_standards::fungible_token::core_impl::ext_fungible_token; use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize}; use near_sdk::json_types:...
use super::*; #[derive(Clone, Debug, Eq, PartialEq)] struct ComponentTest { link: Option<Ethernet2Header>, vlan: Option<VlanHeader>, ip: Option<IpHeader>, transport: Option<TransportHeader>, payload: Vec<u8> } static VLAN_ETHER_TYPES: &'static [u16] = &[ EtherType::VlanTaggedFrame as u16, ...
use colored::*; use std::net; use std::str; use std::collections::HashMap; use ring::rand::*; const MAX_DATAGRAM_SIZE: usize = 1350; struct PartialResponse { body: Vec<u8>, written: usize, } struct Client { conn: std::pin::Pin<Box<quiche::Connection>>, partial_responses: HashMap<u64, PartialResp...
fn to_format(opcode: u8, funct3: u8, funct7: u8) -> InstFmt { match opcode { 0b011_0111 => InstFmt::U, 0b001_0111 => InstFmt::U, 0b110_1111 => InstFmt::J, 0b110_0111 => InstFmt::I, 0b110_0011 => InstFmt::B, 0b000_0011 => InstFmt::I, 0b010_0011 => InstFmt::S, ...
use{ crate::{ *, heatmap::{gnuplot_write_helper_plot, gnuplot_write_output} }, std::{ io::Write, borrow::*, convert::* }, transpose::* }; #[cfg(feature = "serde_support")] use serde::{Serialize, Deserialize}; /// # Heatmap /// * stores heatmap in row-major o...
// This was originally based on example code for https://github.com/alexheretic/glyph-brush // the code is licensed under the Apache 2.0 license, as described in the license file in the // opengl folder, to the extent that the code remains as it was // (at commit 90e7c7c331e9f991e11de6404b2ca073c0a09e61) use gl_layer::...
/* ***************************************************************************** MIT License Copyright (c) 2020 trindadegm 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 restricti...
// Copyright 2019 <NAME> // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE-2.0 or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your // option. This file may not be copied, modified, or distributed // except according to t...
// -*- mode: rust; -*- // // This file is part of curve25519-dalek. // Copyright (c) 2016-2019 <NAME>, <NAME> // See LICENSE for licensing information. // // Authors: // - <NAME> <<EMAIL>> // - <NAME> <<EMAIL>> //! Field arithmetic modulo \\(p = 2\^{255} - 19\\). //! //! The `curve25519_dalek::field` module provides a...
use prometrics::metrics::MetricBuilder; use std::io::{BufReader, Read, Seek, SeekFrom}; use super::record::{EMBEDDED_DATA_OFFSET, END_OF_RECORDS_SIZE}; use super::{JournalEntry, JournalNvmBuffer, JournalRecord}; use crate::lump::LumpId; use crate::metrics::JournalQueueMetrics; use crate::nvm::NonVolatileMemory; use cr...
#![cfg_attr(feature = "cargo-clippy", allow(many_single_char_names))] use consts::{BLOCK_LEN, K0, K1, K2, K3}; use block_buffer::byteorder::{BE, ByteOrder}; use simd::u32x4; use digest::generic_array::GenericArray; use digest::generic_array::typenum::U64; type Block = GenericArray<u8, U64>; /// Not an intrinsic, but...
use itertools::Itertools; use std::hash::Hash; use super::util::{self, ComboBoxExt}; use crate::app::App; use crate::commands::{ Command, PuzzleCommand, SelectHow, SelectThing, PARTIAL_SCRAMBLE_MOVE_COUNT_MAX, PARTIAL_SCRAMBLE_MOVE_COUNT_MIN, }; use crate::gui::util::BasicComboBox; use crate::preferences::{Key...
use std::path::Path; use bracket_pathfinding::prelude::{ a_star_search, Algorithm2D, BaseMap, DistanceAlg, Point, SmallVec, }; use crate::prelude::*; use crate::json::TiledMap; #[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "snake_case")] pub enum ObjectLayerKind { None,...
use crate::ir::value_storage::ValueId; use crate::ir::value_storage::ValueStorage; use crate::ir::ControlFlowGraph; use crate::ir::IRModule; use crate::ir::Phi; use crate::ir::Statement; use crate::ir::Value; use core::fmt::Write; use itertools::Itertools; use petgraph::graph::NodeIndex; use std::fmt; use std::fs::File...
//! Structured representations of SPIR-V types. use std::fmt; use std::hash::Hash; use crate::error::*; use crate::walk::Walk; use spirv_headers::Dim; pub use spirv_headers::{ImageFormat}; #[derive(PartialEq, Eq, Hash, Clone)] pub enum ScalarType { // Be careful with booleans. Booleans is NOT allowed to be expose...
use super::super::capabilities::Capabilities; use super::super::class::{ClassId, ClassSignature, JavaType}; use super::super::error::{wrap_error, NativeError}; use super::super::event::{EventCallbacks, VMEvent}; use super::super::event_handler::*; use super::super::mem::MemoryAllocation; use super::super::method:...
//! # Pico SD Card Example //! //! Reads and writes a file from/to the SD Card that is formatted in FAT32. //! This example uses the SPI0 device of the Raspberry Pi Pico on the //! pins 4,5,6 and 7. If you don't use an external 3.3V power source, //! you can connect the +3.3V output on pin 36 to the SD card. //! //! SD...
use std::{ marker::PhantomData, sync::{ atomic::{AtomicUsize, Ordering}, Arc, Weak, }, }; use crossbeam_queue::SegQueue; use derivative::Derivative; use log::{debug, error, trace, warn}; use rayon::ThreadPool; use amethyst_core::{ ecs::{ hibitset::BitSet, prelude::{Comp...
/* Copyright 2021 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 writing, software di...
use crate::{ brush::Brush, core::{ algebra::{Matrix3, Point2, Vector2}, color::Color, curve::{Curve, CurveKey, CurveKeyKind}, math::{cubicf, lerpf, wrap_angle, Rect}, pool::Handle, }, curve::key::CurveKeyView, draw::{CommandTexture, Draw, DrawingContext}, ...
use termion::event::Key; use std::collections::HashMap; use std::ffi::{OsStr, OsString}; use crate::coordinates::{Coordinates}; use crate::widget::{Widget, WidgetCore}; use crate::fail::{HResult, HError, ErrorLog}; use crate::term::ScreenExt; type HMap = HashMap<String, Vec<String>>; #[derive(Debug)] struct History...
#![no_std] #![no_main] use bsp::{ led::{Led, Red}, pb::{Pb3, PushButton}, RfSwitch, }; use core::{ convert::{TryFrom, TryInto}, mem::size_of, }; use defmt::unwrap; use defmt_rtt as _; // global logger use hal::{ adc::{self, Adc}, aes::Aes, chrono::{NaiveDate, NaiveDateTime}, cortex_...
use iced::{ button, scrollable, text_input, Align, Application, Button, Checkbox, Column, Command, Container, Element, Font, HorizontalAlignment, Length, Row, Scrollable, Settings, Text, TextInput, }; use serde::{Deserialize, Serialize}; pub fn main() { Todos::run(Settings::default()) } #[derive(Debug...
// Copyright (c) Facebook, Inc. and its affiliates. // // This source code is licensed under the MIT license found in the // LICENSE file in the "hack" directory of this source tree. use crate::reason::{self, Reason}; use crate::utils::core::Ident; use eq_modulo_pos::EqModuloPos; use hcons::Hc; use oxidized::{aast, as...
//! C# backend for reproto use codegen::{ ClassAdded, EndpointExtra, EnumAdded, InterfaceAdded, ServiceAdded, TupleAdded, TypeField, TypeFieldAdded, }; use core::errors::*; use core::{self, Handle, Loc, RpContext, RpSubTypeStrategy}; use csharp_field::CsharpField; use csharp_file::CsharpFile; use flavored::{ ...
#![cfg(test)] #[cfg(not(feature = "std"))] use alloc::{ format, vec, vec::Vec, }; use core::{ borrow::{ Borrow, BorrowMut, }, cmp::Ordering, convert::TryInto, iter, }; #[cfg(feature = "std")] use std::panic::catch_unwind; use crate::prelude::*; #[test] fn from_vec() { let mut bv = BitVec::<Msb0, u8>::fr...
mod bind; mod box_expression; mod bump_format_shorthand; mod capture_definition; mod component; mod defer; mod event_binding; mod html_comment; mod html_definition; //TODO: Renamed module and struct to `element_expression` / `ElementExpression`, factor out text expressions and value expressions. //TODO: Rust expressio...
//! Functions and types relating to rendering. //! //! This module implements a (hopefully!) efficent quad renderer, which will queue up //! drawing operations until it is absolutely necessary to send them to the graphics //! hardware. This allows us to minimize the number of draw calls made, speeding up //! rendering....
// // zhtta.rs // // Starting code for PA3 // Revised to run on Rust 1.0.0 nightly - built 02-21 // // Note that this code has serious security risks! You should not run it // on any system with access to sensitive files. // // Brandeis University - cs146a Spring 2015 // <NAME> and <NAME> // Version 1.0 // To see d...
// from: https://github.com/Maktm/FLIRTDB/blob/1f5763535e02d7cccf2f90a96a8ebaa36e9b2495/cmt/windows/libcmt_15_msvc_x86.pat#L355 // // 3B0D........F27502F2C3F2E9...................................... 00 0000 // 0011 :0000 @__security_check_cookie@4 :000B@ $failure$4 ^0002 // ___security_cookie ^000D ___report_gsfailu...
#![cfg(test)] use super::*; use crate::{self as pallet_dkg_proposals, Config}; use frame_support::{ assert_ok, ord_parameter_types, parameter_types, traits::{GenesisBuild, OnFinalize, OnInitialize}, PalletId, }; use frame_system::{self as system}; pub use pallet_balances; use sp_core::{sr25519::Signature, H256}; u...
#![allow(warnings)] use cssparser::{Parser, ParserInput, RuleListParser}; use std::collections::hash_map::DefaultHasher; use std::collections::HashSet; use std::hash::{Hash, Hasher}; use crate::entity::Entity; use crate::hierarchy::Hierarchy; use crate::state::storage::animatable_storage::AnimatableStorage; use crate...
//! Simple bitwise pattern testing for integers. //! //! Provides functionality to compare integers against patterns of bits which include wildcards. //! Patterns can be declared with convenient macros, the generated code is incredibly small and //! efficient, `no_std`, and the crate depends only on its `bitpatterns-pr...
// SPDX-FileCopyrightText: 2021 The thiol developers // // SPDX-License-Identifier: EUPL-1.2 use id_arena::Id; use thiol_hir as hir; use thiol_syntax::{ast, FileLocation, Loc}; pub fn lower( ctx: &mut hir::Context, file: &ast::File, ) -> core::result::Result<hir::Module, Vec<Error>> { let mut t = Translat...
// Copyright Materialize, Inc. and contributors. All rights reserved. // // Use of this software is governed by the Business Source License // included in the LICENSE file. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by ...
//! Module related to managing, drawing, and colliding with terrain. mod mesh_gen; mod voxel; mod world_gen; use std::collections::{HashMap, VecDeque}; use std::mem; use std::sync::{Arc, Mutex}; use std::sync::mpsc::{self, Receiver, Sender}; use std::thread; use std::time::{Duration, Instant}; use luminance::framebuf...
// Copyright 2019-2022 PureStake Inc. // This file is part of Moonbeam. // Moonbeam 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 version....
const A__: u16 = 0; const A00: u16 = 1; const A01: u16 = 1 << 1; const A02: u16 = 1 << 2; const A03: u16 = 1 << 3; const A04: u16 = 1 << 4; const A05: u16 = 1 << 5; const A06: u16 = 1 << 6; const A07: u16 = 1 << 7; const A08: u16 = 1 << 8; const A09: u16 = 1 << 9; const A10: u16 = 1 << 10; const A11: u16 = 1 << 11; con...
// Generated by gir (https://github.com/gtk-rs/gir @ 1bef39f) // from gir-files (https://github.com/gtk-rs/gir-files @ 7d95377) // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git @ 831b444) // DO NOT EDIT use gstreamer_tag_sys::*; use std::env; use std::error::Error; use std::ffi::OsStrin...
extern crate serde_urlencoded; use serde_urlencoded::de::Error as UrlEncodeError; use std::fmt; use std::str::FromStr; const SCHEME: &str = "magnet:?"; pub(self) mod field_name { pub const NAME: &str = "dn"; pub const LENGTH: &str = "xl"; pub const TOPIC: &str = "xt"; pub const ACCEPTABLE_SOURCE: &st...
use std::cell::Cell; use std::mem; use std::ptr::null_mut; use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; use std::sync::Mutex; use lazy_static::lazy_static; use libc::c_void; use winapi::shared::minwindef::{ATOM, HINSTANCE}; use winapi::shared::windef::{HMENU, HWND}; use winapi::um::wingdi::DEVMODEW; use...
use component_ipfs::{IpfsClient, IpfsConfig}; use std::{collections::BTreeMap, str::FromStr}; use web3::{signing::SecretKeyRef, types::U64}; use crate::{ config::{KiltConfig, MoonbeamConfig}, error::{Error, Result}, }; pub async fn run_worker( start_number: Option<U64>, moonbeam: MoonbeamConfig, ipfs: IpfsConfig...
/* Copyright (C) 2021-present by <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, distribut...
use crate::persistence::{ batch_serializer::BatchIndexedSerializer, batch_serializer_local::{BatchSerializerLocal, StateSerializerLocal}, }; use gol_core::{ util::grid_util::Shape2D, Board, BoardCallback, BoardNeighborManager, BoardSpaceManager, BoardStateManager, BoardStrategyManager, DecayLifeLikeStra...
#![allow(unused)] // TODO: Check for duplicate keys in configuration file use anyhow::{anyhow, Context, Result}; use colored::Colorize; use indexmap::IndexMap; use serde::{Deserialize, Serialize}; use std::{ borrow::Cow, env, ffi::OsString, fs, io::Write, path::{Path, PathBuf}, str::FromSt...
use crate::ai::rulespecific::airufspiel::*; use crate::primitives::*; use crate::rules::{payoutdecider::*, trumpfdecider::*, *}; use crate::util::*; use std::{cmp::Ordering, fmt}; pub trait TRufspielPayout : Clone + Sync + fmt::Debug + Send + 'static { fn payout(&self, rules: &SRulesRufspielGeneric<Self>, rulestat...
// Copied and adapted from x11rb (https://github.com/psychon/x11rb/) /* * Dear future guys. * Please forgive me. * I can't even begin to * express how sorry I am! * For making this trash... * * - <NAME> */ extern crate x11rb; use std::cmp::Reverse; use std::collections::{BinaryHeap, HashSet}; use std::proces...
use std::{fs, env, ops}; use std::{rc::Rc, cell::RefCell}; use std::io::{self, Error, ErrorKind}; use regex::Regex; use mrusty::*; use crate::lib::repl; use crate::lib::cmd; use crate::lib::term; use crate::lib::dsl; pub fn read(listdir: &str, alias_name: &str) -> io::Result<String> { fs::read_to_string(format!(...
use std::collections::{HashMap, HashSet}; use std::fmt::{self, Display, Formatter}; const ROOM_SIZE: u8 = 4; const ROOM_SIZE_M1: u8 = ROOM_SIZE - 1; #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] enum Position { Hallway(u8), RoomA(u8), RoomB(u8), RoomC(u8), RoomD(u8), } impl Display for Posit...
//! Implementation of a 4x4 Matrix and its associated functions and methods. use std::ops; use super::Vec4; /// A 4x4 Matrix with elements arraged in row-major order. /// /// A Mat4 is laid out as follows: /// /// ```plaintext /// [ a b c d ] /// A = [ e f g h ] /// [ i j k l ] /// [ m n o p ...
use anyhow::Result; use clap::Clap; use kiss3d::{ camera::Camera, event::{Action, MouseButton, WindowEvent}, light::Light, scene::SceneNode, window::Window, }; use nalgebra as na; use pose_publisher::{ commands::Command, point_cloud::PointCloud2, pose::{Color, Shape}, CommandPublishe...
use core::ops::{Index, IndexMut}; use core::slice::{Iter, IterMut}; use super::node::{Node, NodeGetHelper, NodeSwapHistHelper}; use super::node_dispatch::SmallNode; use smallnum::SmallUnsigned; use tinyvec::ArrayVec; /* Note: Structures in this file generic for `U` in a *subset* of the set `(u8, u16, u32, u64, u128...
// Copyright (c) Microsoft Corporation. // Licensed under the MIT license. //============================================================================== // Imports //============================================================================== pub use super::{ config::MemoryConfig, dpdkbuf::DPDKBuf, m...