text
stringlengths
3.09k
13.9k
use graph_algorithms as ga; use nll_repr::repr; use std::collections::BTreeMap; use std::cell::RefCell; use std::fmt; use std::mem; use std::iter; use std::slice; pub struct FuncGraph { func: repr::Func, start_block: BasicBlockIndex, blocks: Vec<BasicBlockKind>, successors: Vec<Vec<BasicBlockIndex>>, ...
use transport::Address; use keyval::KeyVal; use utils::{ TransientOption, OneResult, unlock_one_result, }; use std::io::{ Write, Read, Result as IoResult, }; use readwrite_comp::{ ExtRead, ExtWrite, }; /// A peer is a special keyval with an attached address over the network pub trait Peer: KeyVal + 'st...
use std::net::SocketAddr; use std::sync::Arc; use futures::sink::SinkExt; use http::{Request, Response}; use openssl::pkey::{PKey, Private}; use openssl::x509::X509; use tokio_util::codec::Framed; use tokio::net::{TcpListener, TcpStream}; use tokio_native_tls::{TlsAcceptor, TlsStream}; use tokio::stream::StreamExt; u...
/** * [0636] Exclusive Time of Functions * * On a single-threaded CPU, we execute a program containing n functions. Each function has a unique ID between 0 and n-1. * Function calls are stored in a <a href="https://en.wikipedia.org/wiki/Call_stack">call stack</a>: when a function call starts, its ID is pushed onto ...
use std::ops::DerefMut; use borsh::{BorshDeserialize, BorshSchema, BorshSerialize}; use solana_generator::*; use crate::account::CryptidAccountAddress; use crate::instruction::{verify_keys, SigningKey, SigningKeyBuild}; use crate::state::{CryptidAccount, InstructionData, TransactionAccount, TransactionState}; use cr...
//! Initialize a repository of Holium objects stored on the file system. use std::io::Write; use std::path::PathBuf; use std::{env, fs}; use anyhow::Result; use clap::{App, Arg, ArgMatches, SubCommand}; use console::style; use thiserror::Error; use crate::utils::repo::constants::{HOLIUM_DIR, INTERPLANETARY_DIR, LOCA...
//! The type that stores testing configuration. //! //! Use the code in this module to tune testing behaviour. #[cfg(feature = "clap")] pub mod clap; use std::path::{Path, PathBuf}; use std::collections::HashMap; use std::fmt; use tempfile::NamedTempFile; const DEFAULT_MAX_OUTPUT_CONTEXT_LINE_COUNT: usize = 10; ///...
use super::{InterfaceApi, SignalSubscription}; use crate::conductor::{ api::error::{ConductorApiResult, ExternalApiWireError, SerializationError}, state::AppInterfaceId, }; use crate::conductor::{ interface::error::{InterfaceError, InterfaceResult}, ConductorHandle, }; use crate::core::ribosome::ZomeCal...
//! Frame Heap use std::cmp::Ordering; use std::collections::BinaryHeap; use std::fmt::Debug; use crate::{Frame, Op, Terminator}; /// Helper trait for configuring `Heap`s order. pub trait FrameOrd<'a>: From<Frame<'a>> + Iterator<Item = Op> { /// Return the first Op in the Frame. fn peek<'b>(&'b self) -> Opti...
use super::*; impl<T: ssz::Serialize, N: Unsigned> ssz::Serialize for FixedVector<T, N> { fn serialize(&self) -> Result<Vec<u8>, ssz::Error> { if T::is_variable_size() { let mut variable_parts = Vec::with_capacity(self.len()); for element in self.iter() { variable_pa...
/// Calulate the max proof length as long as the total amount isn't exceeded and the total transaction amount that can be reached with this options // Example for row = 3; section_length = 3; // Each "■" is a transaction and the arrows show where an output is consumed // One section is "■ -> ■ -> ■" // row 2: ...
//! Storage caches and trait(s) use std::borrow::Cow; use std::collections::HashMap; use borsh::{BorshDeserialize, BorshSerialize}; use exonum_crypto::Hash; use exonum_merkledb::{BinaryValue, Fork, Snapshot}; use crate::schema; /// Track changes in the cache. Assume payload is already encoded. #[derive(Debug)] pub e...
use std::fs::File; use std::io; use std::io::Read; use std::mem; use std::os::unix::io::AsRawFd; use crate::ctx::Ctx; use calloop::LoopHandle; #[derive(Debug)] #[repr(C)] pub struct InputEvent { tv_sec: isize, // from timeval struct tv_usec: isize, // from timeval struct pub type_: u16, pub code: u1...
/* --- Day 2: Bathroom Security --- You arrive at Easter Bunny Headquarters under cover of darkness. However, you left in such a rush that you forgot to use the bathroom! Fancy office buildings like this one usually have keypad locks on their bathrooms, so you search the front desk for the code. "In order to improve ...
use crate::{graph::UndirectedSparseGraph, tools::Xorshift, tree::TreeCenter}; #[codesnip::entry("tree_hash", include("Xorshift", "tree_center"))] #[derive(Default, Debug)] pub struct TreeHasher { rv: Vec<u64>, rng: Xorshift, } #[codesnip::entry("tree_hash")] impl TreeHasher { const MASK30: u64 = (1 << 30) ...
extern crate clap; extern crate tokio; use clap::{App, AppSettings, Arg, SubCommand}; use std::error::Error; use std::fs::OpenOptions; use std::io::Write; /// # client /// Module implementing the client wrapper which submits a task to the cluster mod client; /// # config /// Utilities for reading and writing applicat...
//! Font metrics. use std::collections::HashMap; use super::super::metrics::{ anchor::{self, Anchor}, Length, Point, Rect, Size, }; use serde::{Deserialize, Serialize}; // We hardcode the general layout of a font texture using the following // constants: /// The number of columns in a font. const NUM_COLS: u...
extern crate sdl2; #[macro_use] mod log; mod chip8; use sdl2::event::Event; use sdl2::keyboard::Keycode; use sdl2::pixels::PixelFormatEnum; use std::convert::TryInto; use std::time::Duration; use std::time::Instant; const IPS_CAP: u128 = 700; const TIMER_CAP: u128 = 60; const CPU_NS_PER_FRAME: u128 = 1_000_000_000 / ...
//! Tokay built-in functions use crate::_builtins::BUILTINS; use crate::value; use crate::value::{Dict, Object, RefValue, Value}; use crate::vm::{Accept, Context, Reject}; use macros::tokay_function; use std::io::{self, Write}; // Abstraction of a built-in function pub struct Builtin { pub name: &'static str, // F...
use crate::forwarder::ServiceObjectId; use crate::service::MethodId; use serde::{Deserialize, Serialize}; use std::fmt; const UNDECIDED_SLOT: u32 = 4_294_967_295; #[derive(Serialize, Deserialize, Debug, Copy, Clone)] pub struct SlotId(u32); impl fmt::Display for SlotId { fn fmt(&self, f: &mut fmt::Formatter<'_>)...
use anyhow::{anyhow, Result}; use base64_url; #[allow(unused_imports)] use ctap_hid_fido2::{nitrokey, util, Cfg}; use ihex::Record; use serde_json::Value; extern crate clap; use clap::{App, Arg}; fn set_bootloader_mode() -> Result<()> { let result = nitrokey::is_bootloader_mode(&Cfg::init())?; if result { ...
// Copyright 2020 Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any late...
#![crate_name="sponge"] #![allow(dead_code)] #[macro_use] extern crate glium; extern crate glutin; extern crate image; extern crate cgmath; use image::GrayImage; use glium::index::PrimitiveType; use glium::texture::RawImage2d; use glium::backend::glutin::DisplayCreationError; pub type SpongeResult<T> = Result<T, Sp...
#![feature(optin_builtin_traits)] extern crate d3d11; extern crate user32; extern crate winapi; pub mod com_support; mod d3d_init; mod safe_window_handle; mod wide_string; use std::cell::RefCell; use std::collections::HashMap; use std::ffi::OsStr; use std::mem; use std::ptr::{null, null_mut}; use std::rc::*; use com...
// Copyright (c) 2017-present PyO3 Project and Contributors //! Various types defined by the python interpreter such as `int`, `str` and `tuple` pub use self::boolobject::PyBool; pub use self::bytearray::PyByteArray; pub use self::complex::PyComplex; pub use self::datetime::PyDeltaAccess; pub use self::datetime::{PyD...
use std::fmt::Debug; use std::sync::Arc; use crate::address::AddressValue; use crate::deserialise::Error; use crate::disassembly::IRBuilderArena; use crate::space::{AddressSpace, AddressSpaceId, Space, SpaceKind, SpaceProperty}; #[derive(Debug, Clone)] #[derive(serde::Deserialize, serde::Serialize)] pub struct SpaceM...
//! Tracing and profiling functions. Error and warning log. use std::ffi::{CStr, CString}; use std::mem; use std::os::raw::{c_char, c_int, c_void}; use std::ptr; use std::time::Duration; use super::ffi; use crate::error::error_from_sqlite_code; use crate::{Connection, Result}; /// Set up the process-wide SQLite erro...
use std::{borrow::BorrowMut, sync::Arc}; use futures::future::BoxFuture; use goods::{Asset, AssetBuild, AssetField, AssetFieldBuild, Container, Loader}; #[cfg(feature = "graphics")] use sierra::{OutOfMemory, PrimitiveTopology}; #[cfg(feature = "graphics")] use skelly::Skelly; #[cfg(feature = "graphics")] use crate:...
#[macro_use] extern crate structopt; extern crate cpp_demangle; extern crate glob; extern crate goblin; extern crate groupable; extern crate itertools; extern crate term; use cpp_demangle::Symbol; mod libraries; mod symbols; use libraries::*; use symbols::*; use groupable::Groupable; use itertools::Itertools; use s...
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ //! `QuickCheck` support for partial IO operations. //! //! This module allows sequences of [`PartialOp`]s to be randomly generated...
#![feature(test)] #![cfg(feature = "bpf_c")] extern crate test; use byteorder::{ByteOrder, LittleEndian, WriteBytesExt}; use solana_rbpf::EbpfVm; use solana_sdk::{ account::Account, entrypoint_native::InvokeContext, instruction::{CompiledInstruction, InstructionError}, message::Message, pubkey::Pub...
use clap::ArgMatches; use rspotify::{ model::{ album::SimplifiedAlbum, artist::FullArtist, artist::SimplifiedArtist, playlist::SimplifiedPlaylist, show::FullEpisode, show::SimplifiedShow, track::FullTrack, }, senum::RepeatState, }; use crate::user_config::UserConfig; // Possible types to list or search ...
use std::env; use std::io::prelude::*; use std::io::{self, BufRead, BufReader, BufWriter}; use std::net::TcpStream; use std::sync::mpsc; use std::thread; use crate::irc::*; use log::*; type Result<T> = std::result::Result<T, Error>; #[derive(Debug)] pub enum Error { IoError(io::Error), TwitchPass, Parse...
use crate::api_core::adding_tags::{AddTagsRequestBuilder, TagAction}; use crate::api_core::common::{FileIdentifier, FileMetadataInfo, FileRecord}; use crate::error::{Error, Result}; use crate::utils::tag_list_to_string_list; use crate::wrapper::service::ServiceName; use crate::wrapper::tag::Tag; use crate::Client; use ...
fn vertex(pos: [f32; 3]) -> glam::Vec3 { glam::Vec3::from(pos) } fn create_mesh() -> rend3::datatypes::Mesh { let vertex_positions = [ // far side (0.0, 0.0, 1.0) vertex([-1.0, -1.0, 1.0]), vertex([1.0, -1.0, 1.0]), vertex([1.0, 1.0, 1.0]), vertex([-1.0, 1.0, 1.0]), ...
//! Obtain a [Uuid] uniquely representing the build of the current binary. //! //! This is intended to be used to check that different processes are indeed //! invocations of identically laid out binaries. //! //! As such: //! * It is guaranteed to be identical within multiple invocations of the same //! binary. //! * ...
//! A simple executor that runs Futures asynchronously in a separate thread use std::{ cell::UnsafeCell, future::Future, pin::Pin, sync::Arc, task::{Context, Poll, RawWaker, RawWakerVTable, Waker}, }; use crossbeam_channel::{Sender, Receiver}; /// Executes tasks in a separate thread. pub struct Ex...
pub(crate) mod piece; mod position; use self::piece::Stack; pub use self::position::Position; use crate::board::piece::Piece; use crate::board::piece::PieceKind; use crate::player::Color; use std::ops::Index; #[derive(Debug, Clone, Copy, PartialEq, Eq)] struct PiecesStash { stones: u16, caps: u16, } impl Pie...
//! everything that has to do with HTML event handling use crate::{prelude::*, Element}; use std::{cell::RefCell, mem::MaybeUninit, rc::Rc}; pub enum EventHandler { MouseEvent(Closure<dyn FnMut(web_sys::MouseEvent) + 'static>), KeyboardEvent(Closure<dyn FnMut(web_sys::KeyboardEvent) + 'static>), Event(Closure<dyn ...
// Copyright 2019 The Tari Project // // 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 // dis...
use crate::ast; use crate::parse::ResolveErrorKind; use std::iter::Peekable; use std::ops; /// Indicates if we are parsing template escapes. #[derive(Debug, Clone, Copy)] pub(crate) struct WithTemplate(pub(super) bool); impl ops::Deref for WithTemplate { type Target = bool; fn deref(&self) -> &Self::Target {...
#![crate_type = "bin"] //! A rust-compress application that allows testing of implemented //! algorithms and their combinations using a simple command line. //! Example invocations: //! echo -n "abracadabra" | ./app bwt | xxd //! echo "banana" | ./app bwt | ./app -d #[macro_use] extern crate log; extern crate compres...
// 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. pub mod emitter; // emitter is public API for mutating state pub mod iterator; pub mod jump_targets; use ast_scope_rust::{Scope, ScopeI...
use core::convert::TryInto; use armv4t_emu::reg; use gdbstub::arch; use gdbstub::arch::arm::reg::id::ArmCoreRegId; use gdbstub::target::ext::base::singlethread::{ResumeAction, SingleThreadOps, StopReason}; use gdbstub::target::ext::breakpoints::WatchKind; use gdbstub::target::{self, Target, TargetResult}; use super::...
use std::collections::HashSet; use std::fs::File; use std::io::{self, BufRead, BufReader}; use std::path::Path; #[derive(Debug, Clone, Hash, PartialEq, Eq)] struct Point { x: usize, y: usize, value: u64, } fn main() { let input = lines_from_file("input").unwrap(); let low_points = find_low_points(...
//! Runtime configuration formats. By design, this is mostly opaque - create these from tomls instead. use crate::config::*; use std::collections::*; use std::ffi::*; use std::path::*; pub(crate) struct DocPattern { pub(crate) class_url_pattern: String, pub(crate) method_url_pattern: ...
#![feature(test)] extern crate test; #[macro_use] extern crate lazy_static; use std::collections::HashSet; lazy_static! { static ref INPUT: Vec<&'static str> = include_str!("../input").lines().collect(); static ref POSITIONS: Vec<Cube> = vec![ Cube(1, 0, -1), Cube(1, -1, 0), Cube(0, -...
use alloc::boxed::Box; use crossbeam_utils::{atomic::AtomicCell, CachePadded}; use derivative::Derivative; #[derive(Derivative)] #[derivative(Debug(bound = ""))] pub(super) enum AtomicOption<T> { Small(#[derivative(Debug = "ignore")] CachePadded<AtomicCell<Option<T>>>), Large(#[derivative(Debug = "ignore")] Ca...
#![allow(unsafe_code)] //! This module encapsulates the `unsafe` access to `hashbrown::raw::RawTable`, //! mostly in dealing with its bucket "pointers". use super::{equivalent, Entry, HashValue, IndexMapCore, VacantEntry}; use core::fmt; use core::mem::replace; use griddle::raw::RawTable; type RawBucket = griddle::ra...
use anyhow::{Context, Result}; use orig_language_e2e_tests::data_store::FakeDataStore; use orig_libra_types::{ transaction::{parse_transaction_argument, TransactionArgument}, vm_error::VMStatus, write_set::WriteSet, }; use orig_move_core_types::account_address::AccountAddress; use orig_move_core_types::gas_...
//! Game of Wordle module //! use std::fmt; use std::fmt::Display; /// Enum to show a letter status /// Grey - letter not in word /// Yellow - letter in word /// Greem - letter at correct position #[derive(Debug, PartialEq, Eq, Clone, Copy)] pub enum LetterStatus { Grey(char), Yellow(char), Green(char), }...
extern crate ndarray; extern crate num_complex; extern crate tightbinding; use ndarray::Array2; use num_complex::Complex64; use tightbinding::dos::dos_from_num; use tightbinding::float::{is_near_complex, is_near_float}; use tightbinding::fourier::hk_lat; use tightbinding::qe::Scf; use tightbinding::tetra::EvecCache; u...
#![allow(unused_variables, dead_code, unused_imports)] use crate::error::EngineError; use gl::types::*; use std::{ fs, ffi::{CString, CStr} }; #[derive(Debug, Clone)] pub enum ShaderType { VertexShader = gl::VERTEX_SHADER as isize, FragmentShader = gl::FRAGMENT_SHADER as isize, GeometryShader = gl::GEOMETR...
//! A crate for parsing integers directly form ASCII (`[u8]`) without encoding them into utf8 //! first. The name is inspired by the famous C function. //! //! Using `str::from_utf8` and `str::parse` //! is likely to be more idiomatic. Use this crate if you want to avoid decoding bytes into utf8 //! (e.g. for performan...
extern crate serde_json; extern crate indy_crypto; use errors::common::CommonError; use errors::indy::IndyError; use services::anoncreds::AnoncredsService; use std::collections::{HashMap, HashSet}; use std::rc::Rc; use self::indy_crypto::utils::json::JsonDecodable; use domain::schema::{Schema, schemas_map_to_schemas...
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may n...
#![ feature( async_await, trait_alias )] wasm_bindgen_test_configure!(run_in_browser); // What's tested: // // Tests send to an echo server which just bounces back all data. // // ✔ Frame with a BytesCodec and verify that a round trip returns identical data // ✔ Send 1MB data in a custom struct serialized with cbor_c...
use super::*; use ff::PrimeField; use pairing::Engine; use std::fmt; use util::{hash_to_fr, hash_to_slice}; use zkchan_tx::fixed_size_array::{FixedSizeArray16, FixedSizeArray32}; #[derive(Clone, Serialize, Deserialize)] #[serde(bound(serialize = "<E as ff::ScalarEngine>::Fr: serde::Serialize"))] #[serde(bound(deserial...
#![deny(rust_2018_idioms, unsafe_code, missing_docs)] #![allow(clippy::needless_collect)] // the implementation of that rule is way too eager, it rejects necessary collects //! The top-level library crate for the migration engine. include!(concat!(env!("OUT_DIR"), "/methods.rs")); // exposed for tests #[doc(hidden)]...
#[cfg(not(feature = "host"))] use num_traits::float::FloatCore; use stm32g4::stm32g474::{self as device, interrupt}; use third_party::m4vga_rs::util::{ armv7m::{clear_pending_irq, enable_irq}, spin_lock::SpinLock, sync::acquire_hw, }; use crate::{block_until, block_while, led, util::interrupts::block_inter...
use std::collections::HashMap; use std::collections::hash_map::{Keys, Values}; use std::net::{TcpListener, TcpStream, SocketAddr}; use std::io::Read; use std::io; use std::process; use std::os::unix::io::{RawFd, AsRawFd}; use std::thread; use select::FdSet; use child::PersistentChild; pub struct Clients { client...
use core::marker::PhantomData; use vek::*; use crate::{ Interpolate, Pipeline, Target, }; use self::super::*; /// A rasterizer that produces straight lines from groups of 2 consecutive vertices. pub struct Lines<'a, D> { phantom: PhantomData<&'a D>, } impl<'a, D: Target<Item=f32>> Rasterizer for Lines...
use crate::{ AFSDBSubtype, Class, DomainName, QClass, QType, Question, SSHFPAlgorithm, SSHFPType, Type, }; use hex::encode as hex_encode; use std::fmt::{Debug, Display, Formatter, Result as FmtResult}; use std::net::{Ipv4Addr, Ipv6Addr}; #[derive(Debug, PartialEq, Clone)] pub enum RData { A(Ipv4Addr), NS...
// Module responsible for serializing and deserializing pub mod sbserde{ use serde::{Deserialize, Serialize}; use libp2p::multihash::{encode, Hash}; // serialize a generic type T // Needs trait Serialize to be implemented // can be done directly by using macro // #[derive(Serialize)] define...
use crate::card::Card; use crate::math::is_blackjack; use crate::player::PlayerType; /// This method displays the hands and scores /// of all players in a human-readable format. /// /// # Arguments /// /// * `scores` An array of scores obtained by /// the players and the dealer. All players must /// have at least one ...
#![warn(missing_docs)] //! The Bitcoin adapter interacts with the Bitcoin P2P network to obtain blocks //! and publish transactions. Moreover, it interacts with the Bitcoin system //! component to provide blocks and collect outgoing transactions. use bitcoin::{network::message::NetworkMessage, BlockHash, BlockHeader}...
use std::rc::Rc; use std::cell::RefCell; use std::collections::HashMap; use std::hash::Hash; use timely::ExchangeData; use timely::dataflow::{Scope, Stream, ProbeHandle}; use timely::dataflow::operators::{Operator, Probe}; use timely::dataflow::channels::pact::Exchange; use super::super::{consolidate, fnv_hash}; // u...
/* * Copyright 2019-2021 <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 ...
use std::ops::{Add, Mul, Sub}; use bevy::math::Mat2; use bevy::prelude::*; use bevy::tasks::ComputeTaskPool; use crate::components::*; use crate::defaults::*; use crate::grid::*; use crate::world::*; pub(super) fn particles_to_grid_solids( pool: Res<ComputeTaskPool>, grid: Res<Grid>, world: Res<WorldStat...
use std::borrow::Cow; use std::fs::{self, File}; use std::io::{self, Read}; use std::path::PathBuf; use crate::{matrix::MatrixClient, Error, Result}; use atty::Stream; use structopt::{ clap::{arg_enum, ArgGroup}, StructOpt, }; use matrix_sdk::{ room::Room, ruma::events::room::message::{ Emot...
// Copyright 2019-2021 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....
use crate::layout::common::{coverage_or_nah, FromLowlevel, ToLowlevel}; use otspec::layout::anchor::Anchor; use otspec::layout::coverage::Coverage; use otspec::layout::gpos3::{CursivePosFormat1, EntryExitRecord}; use otspec::tables::GPOS::GPOSSubtable; use otspec::types::*; use std::collections::BTreeMap; #[derive(De...
//! An implementation of triangulation of audio event data //! //! This demo takes in audio events in the form of a timestamp, //! GPS coordinates, and an analog rich audio sample, calculates the //! best effort triangulated location, returning the estimated location //! //! ## Authors //! //! The Veracruz Development ...
use nannou::prelude::*; use nannou::color; // use std::cmp; // use rand::seq::SliceRandom; const WIN_W:u32 = 600; const WIN_H:u32 = 600; const SPIRAL_RADIUS:f32 = 350.0; const N_ROTATIONS: u32 = 15; const MAX_LENGTH: f32 = N_ROTATIONS as f32 * TAU; struct Circle { center: Vector2, t: f32, diameter: f32, ...
#![allow(clippy::integer_arithmetic)] use { log::info, regex::{Captures, Regex}, std::{ ffi::OsStr, fs, io::{prelude::*, BufWriter}, path::PathBuf, str, }, }; /** * 1. process every inc file in syscalls header file * * 2. in every such file replace the syscal...
// Copyright (c) 2021-present, <NAME> // All rights reserved. // // This software may be modified and distributed under the terms // of the BSD license. See the LICENSE file for details. use { crate::{ buffers::{BufferSegment, ZstdBufferWithSegments, ZstdBufferWithSegmentsCollection}, compression_d...
use tokio::runtime::{Builder, Runtime}; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::time::Duration; use std::{thread}; use thread_id; use futures::future::join_all; use std::pin::Pin; // for udp use tokio::net::UdpSocket; use std::net::SocketAddr; use socket2::SockAddr; // for tcp use tokio::net::TcpList...
//! Dungeon World Moves //! //! ```text //! ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ //! ┃ Anointed Cleric ┃ //! ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫ //! ┃ Requires Chosen One ┃ //! ┠━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┨ //! ┃ Choose one spell in addition to t...
use std::{pin::Pin, sync::Arc}; use futures::Stream; use serde::Deserialize; use snafu::{OptionExt, ResultExt, Snafu}; use tonic::{Request, Response, Streaming}; use tracing::error; use arrow_deps::{ arrow, arrow_flight::{ self, flight_service_server::{FlightService as Flight, FlightServiceSer...
use failure::ResultExt; use std::collections::VecDeque; use std::io; use terminfo::errors::*; use terminfo::lang::parser::{Op, Parser}; use terminfo::lang::Argument; pub struct Executor<'a> { src: &'a [u8], env: ExecutionEnvironment, argc: usize, } pub struct ExecutionEnvironment { stack: VecDeque<Argu...
//! The backend provides abstract IO access to the real location of the data in //! the repository. #![allow(clippy::used_underscore_binding)] // TODO: Fix this after clippy and thiserror start // playing nice use crate::manifest::StoredArchive; use crate::repository::{Chunk, ...
/* * Copyright 2020 Fluence Labs 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 applicable law or a...
pub mod simple { use ::fe::ast; pub fn function(fun: &ast::Node<ast::Function>) -> String { // arguments let args = fun.node .args .iter() .map(|arg| format!("{:?} {}", arg.type_, arg.name)) .collect::<Vec<String>>() .join(", "); ...
use crate::{ DependentJoint, Distribution, ExactEllipticalParams, IndependentJoint, RandomVariable, }; use crate::{DistributionError, EllipticalParams}; use opensrdk_linear_algebra::*; use rand::prelude::*; use rand_distr::StudentT as RandStudentT; use std::marker::PhantomData; use std::{ops::BitAnd, ops::Mul}; //...
use std::{convert::TryInto, process::Command}; use anyhow::bail; use bstr::ByteSlice; use cargo_metadata::{ camino::{Utf8Component, Utf8Path}, Package, }; use git_repository::{ easy::object, hash::ObjectId, lock, prelude::ReferenceAccessExt, refs::{self, file::loose::reference::peel}, }; u...
//! Gets the list of tags for a specified stream (channel). //! [`get-stream-tags`](https://dev.twitch.tv/docs/api/reference#get-stream-tags) //! //! # Accessing the endpoint //! //! ## Request: [GetStreamTagsRequest] //! //! To use this endpoint, construct a [`GetStreamTagsRequest`] with the [`GetStreamTagsRequest::bu...
// Copyright 2019 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use anyhow::{format_err, Error}; /// Command line arguments that control component_manager's behavior. Use [Arguments::from_args()] /// or [Arguments::new...
// Copyright (c) 2018 <NAME>, RWTH Aachen University // // MIT License // // 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...
//! Coordinate axis mod grid; pub use self::grid::Gridline; use std::borrow::Cow; use std::iter::IntoIterator; use traits::Data; use {Default, Display, Script}; /// A coordinate axis #[derive(Clone, Copy)] pub enum Axis { /// X axis on the bottom side of the figure BottomX, /// Y axis on the left side o...
use std::{fs, io}; #[allow(dead_code)] pub fn day_11() -> io::Result<()> { use Direction::*; let content = fs::read_to_string("inputs/day_11")?; let matrix: Vec<Seat> = content .chars() .map(|c| match c { 'L' => Seat::FREE, '#' => Seat::OCCUPIED, '.' => ...
#[derive(Debug, Clone, derivative::Derivative)] #[derivative(Default)] pub enum Protocol { #[derivative(Default)] IPad, AndroidPhone, AndroidWatch, MacOS, QiDian, } #[derive(Debug, Clone)] pub struct Version { pub apk_sign: &'static [u8], pub apk_id: &'static str, pub sort_version_n...
use headless_chrome::{util::Wait, Browser, Tab}; use std::io::prelude::*; use std::io::stdin as ioStdin; #[cfg(feature = "debug-screenshot")] use headless_chrome::protocol::page::ScreenshotFormat; #[cfg(feature = "debug-screenshot")] use std::fs::File; const TIMEOUT_DELAY: u64 = 10; pub fn submit_from_string( sr...
use std::time::Instant; use crate::TIMEOUT; use crate::{Elf, TargetInfo}; use probe_rs::{MemoryInterface, Session}; const CANARY_VALUE: u8 = 0xAA; /// (Location of) the stack canary /// /// The stack canary is used to detect *potential* stack overflows /// /// The canary is placed in memory as shown in the diagram b...
use std::{ error::Error, path::PathBuf, pin::Pin, task::{Context, Poll}, }; use async_trait::async_trait; use futures::{ready, Stream}; use pin_project::pin_project; use tokio::sync::mpsc::{channel, Receiver}; use tokio_util::sync::ReusableBoxFuture; use crate::{ buffer_usage_data::BufferUsageHand...
// 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 fidl::encoding::Decodable; use fidl_fuchsia_media::*; use fidl_fuchsia_sysmem as sysmem; use fuchsia_zircon as zx; use std::rc::Rc; use stream_processo...
use raw_window_handle::{HasRawWindowHandle, RawWindowHandle}; use std::sync::Arc; use winit::{ dpi::{LogicalSize, PhysicalSize, Size}, event::{Event, KeyboardInput, VirtualKeyCode, WindowEvent}, event_loop::{ControlFlow, EventLoop}, window::WindowBuilder, }; use opengles::glesv2 as gl; pub const VERT_...
use super::process::{archive_activity, database_update, getbotid}; use super::validation::{check_validation, WaitingValidation}; use super::{api, slash_command}; use crate::core::process::process_message; use crate::features::{invite_action, mecleanup, project_manager, Features}; use log::{error, info}; use serenity::h...
use std::fs::File; use bevy::{prelude::*, utils::HashMap}; use glam::{Quat, Vec3, Affine3A}; use kajiya::{ camera::{CameraLens, LookThroughCamera}, frame_desc::WorldFrameDesc, world_renderer::AddMeshOptions, }; use crate::{ camera::{ExtractedCamera, KajiyaCamera}, mesh::{ MeshInstanceExtra...
use crate::{ steps::{ transformations::{parse_scaling, parse_translation}, tuples::{parse_color, parse_point}, }, MyWorld, }; use cucumber::{given, then, when}; use lab_raytracing_rs::{ patterns::{ checkers_pattern, gradient_pattern, pattern_at_shape, ring_pattern, solid_pattern,...
use super::{Entities, EntityId}; use crate::error; use crate::sparse_set::Pack; use crate::view::ViewMut; use alloc::vec::Vec; use core::any::{type_name, TypeId}; // No new storage will be created /// Adds components to an existing entity without creating new storage. pub trait AddComponent<T> { fn try_add_compone...