text
stringlengths
7.05k
33.9k
use super::super::{bscript, BSCtx}; use super::{util::TwoColGrid, OnChange}; use glib::{clone, idle_add_local, prelude::*, subclass::prelude::*}; use gtk::{self, prelude::*}; use netidx::{ chars::Chars, subscriber::{Typ, Value}, }; use netidx_bscript::expr; use std::{ cell::{Cell, RefCell}, rc::Rc, ...
use crate::leema::lstr::Lstr; use crate::leema::msg::{AppMsg, IoMsg, MsgItem, WorkerMsg}; use crate::leema::program; use crate::leema::rsrc::{self, Event, IopCtx, Rsrc}; use crate::leema::struple::Struple2; use crate::leema::val::{Fref, MsgVal, Val}; use std; use std::cell::RefCell; use std::cmp::min; use std::collect...
use std::cmp::Ordering; use std::collections::HashSet; use std::fmt; use std::fmt::Debug; use num_bigint::BigUint; use num_traits::ToPrimitive; use simulator::Environment; use simulator::metrics::Metrics; use crate::actors::Timing; use crate::datastructures::block::*; use crate::datastructures::hash::*; use crate::d...
//! Main writer API to write record batches to delta table use super::{ stats::{apply_null_counts, create_add, Add, NullCounts}, *, }; use crate::error::{AreaStoreError, Result}; use arrow_deps::arrow::{ self, array::{as_primitive_array, Array, UInt32Array}, compute::{lexicographical_partition_range...
#![no_main] #![no_std] pub mod error; mod safemem; use core::convert::TryInto; use error::{ErrStringType, WalletErr}; use bip39::{Language, Mnemonic, Seed}; use hex_literal::hex; // use numtoa::NumToA; use panic_halt as _; // panic handler use stm32f4xx_hal as hal; use hal::flash::FlashExt; use k256::{ ecdsa:...
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MIT or ...
//! TODO: There is potential need for `fsck` use core::convert::TryFrom; use trussed::{ client, syscall, types::{ DirEntry, Location, }, }; use ctap_types::{ Bytes32, authenticator::{ Error, ctap2::{ self, credential_management::{ ...
//! A simple web-app monitoring chain heights from various sources use anyhow::Result; use axum::{ async_trait, extract::{ ws::{Message, WebSocket, WebSocketUpgrade}, Extension, TypedHeader, }, http::StatusCode, middleware, response::{Headers, Html, IntoResponse}, routing::{g...
// wengwengweng use std::collections::HashMap; use std::rc::Rc; use std::io::Cursor; use std::path::Path; use serde::Serialize; use serde::Deserialize; use crate::*; use math::*; use gfx::*; use geom::*; #[derive(Clone, Serialize, Deserialize)] pub struct NodeData { pub id: usize, pub children: Vec<usize>, pub t...
use super::Intersector; use crate::raytracer::{intersect, Hit}; use crate::scene::Scene; use crate::vecmath::{cross, dot, Ray, Vec3}; pub struct OctTreeIntersector { cubes: Vec<Cube>, nodes: Vec<OctNode>, trunk: usize, } pub const DEFAULT_TRIANGLES_PER_LEAF: usize = 70; #[derive(Clone, Copy)] struct Tria...
/// Run a test where a Muse headset collects EEG data based on a series of /// images presented to the wearer. Push that raw collected data to a Postgresql database. #[macro_use] extern crate log; // Draw some multi-colored geometry to the screen #[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))] extern c...
extern crate libc; extern crate rand; extern crate rand_distr; extern crate rayon; pub mod raw; pub mod ball_descend; pub mod vectorizable; pub use vectorizable::Vectorizable; use libc::{c_double, c_int, c_void}; use std::sync::{Arc, Mutex, RwLock}; /// This structure contains some metadata about learning in last ...
use std::collections::{HashSet, HashMap, VecDeque}; use std::hash::{Hash, Hasher}; use std::fmt::{Debug, Formatter}; use std::time::Instant; #[derive(Clone, Eq, PartialEq)] struct FloorGroups { pairs: HashSet<i32>, single_gens: HashSet<i32>, single_chips: HashSet<i32>, } impl FloorGroups { fn new() ->...
use crate::error::{ decode_buffer_smaller_than_ecc, decode_buffer_too_big, decode_buffer_wrong_size, invalid_bits, invalid_ecc_len, too_many_errors, HumancodeError, }; use crate::smallbytebuf::SmallByteBuf; use crate::EncodedChunk; use core::fmt::{Debug, Formatter}; use libzbase32::low_level_decode::{ chara...
use crate::FieldBytes; use elliptic_curve::{ subtle::{Choice, ConditionallySelectable, ConstantTimeEq, CtOption}, zeroize::Zeroize, }; #[derive(Clone, Copy, Debug)] pub struct FieldElement5x52(pub(crate) [u64; 5]); impl FieldElement5x52 { pub const fn zero() -> Self { Self([0, 0, 0, 0, 0]) } ...
// Rust-oracle - Rust binding for Oracle database // // URL: https://github.com/kubo/rust-oracle // //----------------------------------------------------------------------------- // Copyright (c) 2017-2019 <NAME> <<EMAIL>>. All rights reserved. // This program is free software: you can modify it and/or redistribute it...
use std::fmt; use anyhow::{anyhow, Result}; use async_trait::async_trait; use chrono::{DateTime, Utc}; use crate::operations::Operation; use crate::{AssetPair, AssetsInfo}; #[derive(Debug)] pub struct Sale { pub asset: String, pub amount: f64, pub datetime: DateTime<Utc>, } #[derive(Debug)] pub struct P...
use crate::columnar; use crate::columnar::{ ColumnEncoder, KeyIterator, ObjIterator, OperationIterator, PredIterator, ValueIterator, }; use crate::encoding::{Decodable, Encodable}; use crate::error::AutomergeError; use crate::op::Operation; use automerge_protocol as amp; use core::fmt::Debug; use serde::{Deserializ...
use diesel::dsl::sql; use diesel::pg::PgConnection; use diesel::*; use regex::Regex; use std::collections::HashMap; use crate::helpers::TaskStatus; use crate::models::{Corpus, Service, Task}; use crate::reports::{AggregateReport, TaskDetailReport}; use crate::schema::tasks; lazy_static! { static ref ENTRY_NAME_REGE...
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MI...
use crate::accounts_index::{ AccountMapEntry, AccountMapEntryInner, IndexValue, SlotList, WriteAccountMapEntry, }; use crate::bucket_map_holder::{Age, BucketMapHolder}; use crate::bucket_map_holder_stats::BucketMapHolderStats; use solana_measure::measure::Measure; use solana_sdk::{clock::Slot, pubkey::Pubkey}; use ...
// Copyright 2021 Databricks, Inc. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writi...
// lib.rs // // Copyright (c) 2019 All The Music, LLC // // This work is licensed under the Creative Commons Attribution 4.0 International License. // To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send // a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. //...
use byteorder::{BigEndian, WriteBytesExt}; use bytes::{Bytes, ByteOrder, BytesMut}; use ring::rand::{SecureRandom, SystemRandom}; use ring::signature::{VerificationAlgorithm, ED25519}; use ring::agreement::{X25519, agree_ephemeral, EphemeralPrivateKey}; use ring::hkdf::extract_and_expand; use ring::hmac::{SigningKey, ...
//! TickGrinder Instance Spawner and Manager //! //! Responsible for spawning, destroying, and managing all instances of the bot4 //! platform's modules and reporting on their status. #![feature(plugin, test, conservative_impl_trait, custom_derive)] extern crate uuid; extern crate redis; extern crate tickgrinder_util...
use greenwasm_structure::types::*; use greenwasm_structure::modules::*; use greenwasm_validation::ValidatedModule; use std::result::Result as StdResult; use std::iter; use runtime_structure::*; use instructions::*; use DEBUG_EXECUTION; use frounding; // TODO: more central definition pub const WASM_PAGE_SIZE: usize =...
#![feature(decl_macro)] use std::thread; extern crate env_logger; extern crate mio; extern crate sgx_types; extern crate sgx_urts; #[macro_use] extern crate lazy_static; #[macro_use] extern crate log; #[macro_use] extern crate rocket; #[macro_use] extern crate rocket_contrib; extern crate rocket_cors; extern crate ...
use nom::bytes::complete::{tag, take_until, take_while1}; use nom::combinator::{all_consuming, map, cut, opt, rest, peek, value}; use nom::multi::separated_nonempty_list; use nom::branch::alt; use crate::rules::parser::{Span, var_name, ParserError, var_name_access, IResult, parse_value, type_name}; use nom::sequence::{...
//! Parses a series of `lexer` tokens into a code expression. use std::borrow::Cow::{self, Borrowed, Owned}; use std::collections::HashMap; use std::fmt; use std::path::PathBuf; use crate::bytes::Bytes; use crate::error::Error; use crate::exec::Context; use crate::integer::{Integer, Ratio}; use crate::lexer::{Lexer, ...
mod kw; #[cfg(feature = "script")] mod script; mod url; #[cfg(feature = "script")] use script::EffectScriptEntry; use crate::url::{LibraryUrl, UrlInput}; use itertools::{izip, Either}; use proc_macro::TokenStream; use proc_macro2::Span; use quote::quote; use syn::parse::{Parse, ParseStream}; use syn::{ parse_ma...
use crate::{EventIter, Result as MidlyResult, TrackEvent}; use std::{fs, path::Path, time::Instant}; /// Open and read the content of a file. macro_rules! open { {$name:ident : $file:expr} => { let $name = fs::read(AsRef::<Path>::as_ref("test-asset").join($file)).unwrap(); }; {$name:ident : [$parse...
#[cfg(feature = "rt")] extern "C" { fn PVD(); fn TAMP_STAMP(); fn RTC_WKUP(); fn FLASH(); fn RCC(); fn EXTI0(); fn EXTI1(); fn EXTI2(); fn EXTI3(); fn EXTI4(); fn DMA1_Stream0(); fn DMA1_Stream1(); fn DMA1_Stream2(); fn DMA1_Stream3(); fn DMA1_Stream4(); f...
// Copyright © 2021 // Author: <NAME> <<EMAIL>> // SPDX-License-Identifier: MIT use super::*; use nalgebra as na; use std::collections::HashMap; pub struct Renderer { /// Delta time used as a uniform in shaders pub delta: f32, gui_res: GuiRes, /// List of shaders available for rendering custom_...
use core::convert::TryFrom; #[allow(unused_imports)] use log::{debug, error, info, trace, warn}; /// An enum representing 35 possible opcodes of chip-8 architecture /// /// Based on [chip8 mastering](http://mattmik.com/files/chip8/mastering/chip8.html) /// /// Examples: /// ``` /// use core::convert::TryInto; /// use...
#![allow(non_upper_case_globals)] #![allow(non_snake_case)] extern crate glfw; use self::glfw::{Context, Key, Action}; extern crate gl; use self::gl::types::*; use std::ptr; use std::mem; use std::os::raw::c_void; use std::path::Path; use std::ffi::{CStr, CString}; use image; use image::GenericImage; use image::D...
use std::sync::Arc; use std::collections::HashMap; use tracing::instrument; use siphasher::sip::SipHasher; use async_lock::Mutex; use dataplane::ReplicaKey; use dataplane::produce::DefaultProduceRequest; use dataplane::produce::DefaultPartitionRequest; use dataplane::produce::DefaultTopicRequest; use dataplane::batch:...
use byteorder::{LittleEndian, ReadBytesExt}; use std::{ fs::OpenOptions, io::{self, Error, ErrorKind, Read, Seek, SeekFrom, Write}, }; mod avail; mod bucket; mod dir; mod hashutil; mod header; mod ser; use avail::{AvailBlock, AvailElem}; use bucket::{Bucket, BucketCache, BucketElement, BUCKET_AVAIL}; use dir::...
use crate::ast; use crate::ptr::P; use crate::token::{Delim, Keyword as K, Kind as T, Token}; use super::{PResult, Parser}; impl<'a, I> Parser<'a, I> where I: Iterator<Item = Token>, { /// Parse a block until EoF pub fn parse_block(&mut self) -> PResult<'a, ast::Block> { self.parse_block_with_term...
use crate::internal_prelude::*; use core::fmt; use core::marker::PhantomData; use core::sync::atomic::{AtomicUsize, Ordering}; #[cfg(any(target_os = "linux", target_os = "dragonfly"))] pub use libc::__errno_location as errno_ptr; #[cfg(any(target_os = "freebsd", target_os = "macos"))] pub use libc::__error as errno_...
mod ddskk; mod dictionary; mod echo_server; mod encoding; mod jisyo; mod miscellaneous; pub(in crate::skk) mod setup; mod yaskkserv; mod yaskkserv2; mod yaskkserv2_benchmark; use rand::seq::SliceRandom; use rand::Rng; use std::fs::File; use std::io::{BufRead, BufReader, Read, Write}; use std::net::TcpStream; use std::...
#[macro_use] extern crate concat_with; extern crate clap; extern crate terminal_size; #[macro_use] extern crate serde_json; #[macro_use] extern crate execute; extern crate image_convert; extern crate scanner_rust; extern crate slash_formatter; extern crate tera; extern crate validators; extern crate favicon_generat...
use crate::*; use fen4::{Board, Color, TurnColor}; use std::num::ParseIntError; use thiserror::Error; /// Possible errors while extracting a Variant from pgn4 tags #[derive(Error, PartialEq, Debug, Clone)] pub enum VariantError { #[error("A bracketed value is repeated")] RepeatedBracket, #[error("Variant ...
pub trait Ratio { fn to_0n_clamped(self, width: usize) -> usize; } impl Ratio for f32 { fn to_0n_clamped(self, width: usize) -> usize { let n = width as Self; if self.is_nan() { 0 } else { (self * n).clamp(0.0, n) as _ } } } impl Ratio for f64 { fn to_0n_clamped(self, width: us...
//! # Map //! //! This module contains structures that correspond to the map API responses //! //! [API documentation here](https://docs.beatsaver.com/responses/beatmap.html) use crate::BeatSaverUser; use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; /// This structure specifies whether or not a diffic...
use apt_release_file::*; use apt_sources_lists::*; use async_fetcher::{AsyncFetcher, CompletedState, FetchError, FetchEvent}; use deb_architectures::{Architecture, supported_architectures}; use failure; use flate2::write::GzDecoder; use futures::{self, stream::futures_unordered, IntoFuture, Future, Stream}; use gpgrv::...
pub mod archived; pub mod daily; pub mod experimental; pub mod installed; pub mod lts; pub mod stable; use self::{ archived::Archived, daily::Daily, experimental::Experimental, installed::Installed, lts::Lts, stable::Stable, }; use crate::{ helpers::{get_document, get_file_stem, ReturnOption}, package::...
mod command_ext; mod network; mod utils; use std::{ convert::AsRef, fs::File, io::{BufReader, Error as IoError}, path::Path, process::Command, time::{SystemTime, UNIX_EPOCH}, }; use crate::filesystem::{prefixed_destination, Mountable}; use anyhow::{anyhow, Error}; pub use baustelle::runtime_co...
use crate::private::bits::log2; use crate::{BuildingBlock, Concurrent, Get, GetMut, Prefetch}; use std::cmp::Ordering; use std::hash::{Hash, Hasher}; use std::marker::Sync; use std::ops::{Deref, DerefMut}; /// Hasher wrapper that returns a subset of the hash bits shifted to the /// right. /// /// The purpose of this s...
use crate::{ progress::{self, Key, Step, Task, Value}, render::tui::{ draw::State, utils::{ block_width, draw_text_nowrap_fn, draw_text_with_ellipsis_nowrap, rect, sanitize_offset, GraphemeCountWriter, VERTICAL_LINE, }, InterruptDrawInfo, }, time::...
use ndarray::{prelude::*, s}; use num_traits::{Bounded, Num, NumCast}; use rustfft::{num_complex::Complex, FFTplanner}; use std::f32::consts::PI; /// Padding mode for the audio signal #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] pub enum PadMode { /// Don't apply any padding NoPad, /// Reflect the si...
//! All the sorting tools used by the command-line interface. Contains the main //! sorting algorithm. use crate::structs::File; use super::messages::{error_messages, DryRunMessage, ProgressBar}; use std::fs; /// The main sorting algorithm, and all the functions it needs to operate. pub mod sort { // use super:...
/* * Copyright 2020 <NAME> * https://github.com/mikechambers/dcli * * 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...
#![allow(unused_imports)] #![allow(unused_variables)] #![allow(dead_code)] #![cfg_attr(not(feature = "std"), no_std)] /// Edit this file to define custom logic or remove it if it is not needed. /// Learn more about FRAME and the core library of Substrate FRAME pallets: /// <https://substrate.dev/docs/en/knowledgebase/...
//! Safe bindings to FFI. #![allow(dead_code)] use std::convert::TryInto; use std::ffi::{c_void, CString}; extern "C" { // Saving OggOpus files. fn ope_comments_create() -> *mut c_void; fn ope_comments_add( comments: *mut c_void, tag: *const c_void, // TEXT val: *const c_void, // ...
// Copyright (c) 2014, 2015 <NAME> <<EMAIL>> // // 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. This file may not be copied, modified, or distributed // excep...
#![allow(dead_code)] //! The `ParallelIterator` module makes it easy to write parallel //! programs using an iterator-style interface. To get access to all //! the methods you want, the easiest is to write `use //! rayon::prelude::*;` at the top of your module, which will import //! the various traits and methods you ...
use async_recursion::async_recursion; use async_std; use async_trait::async_trait; use dashmap::DashMap; use futures::future::FutureExt; use futures::future::Shared; use futures::Future; use futures::StreamExt; use futures::{future::BoxFuture, ready}; use pin_project::pin_project; use serde::Deserialize; use serde_jso...
/* This tool is part of the WhiteboxTools geospatial analysis library. Authors: Prof. <NAME> Created: 11/10/2018 Last Modified: 09/03/2020 License: MIT */ use crate::tools::*; use whitebox_vector::{AttributeField, FieldData, FieldDataType, Shapefile}; use std::collections::HashMap; use std::env; use std::fs::File; use...
//! Code for talking directly (over a TLS connection) to a Tor client or relay. //! //! Channels form the basis of the rest of the Tor protocol: they are //! the only way for two Tor instances to talk. //! //! Channels are not useful directly for application requests: after //! making a channel, it needs to get used to...
//! The internal representation of a book and infrastructure for loading it from //! disk and building it. //! //! For examples on using `MDBook`, consult the [top-level documentation][1]. //! //! [1]: ../index.html #[allow(clippy::module_inception)] mod book; mod init; mod summary; pub use self::book::{load_book, Bo...
// 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 in the LICENSE-APACHE file or at: // https://www.apache.org/licenses/LICENSE-2.0 //! Gallery of all widgets //! //! This is a test-bed to de...
#![forbid(unsafe_code)] #![warn( clippy::all, clippy::doc_markdown, clippy::dbg_macro, clippy::todo, clippy::empty_enum, clippy::enum_glob_use, clippy::pub_enum_variant_names, clippy::mem_forget, //clippy::use_self, // disabled for now due to https://github.com/rust-lang/rust-clipp...
use crate::gc::{Gc, Handle}; use crate::js_std; use crate::vm::value::function::Constructor; use crate::vm::value::object::Object; use super::value::function::NativeFunction; use super::value::object::ExoticObject; use super::value::symbol::Symbol; use super::value::Value; /// Static data used by the VM pub struct St...
// Copyright 2015 The Gfx-rs Developers. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
//! Requires the 'framework' feature flag be enabled in your project's //! `Cargo.toml`. //! //! This can be enabled by specifying the feature in the dependency section: //! //! ```toml //! [dependencies.serenity] //! git = "https://github.com/serenity-rs/serenity.git" //! features = ["framework", "standard_framework"]...
use std::convert::TryInto; use std::fs::File; use std::io; use std::path::Path; use std::rc::Rc; use clap::{load_yaml, App}; use eyre::{eyre, Result}; use log::{error, info, warn, LevelFilter}; use serde::ser::SerializeStruct; use serde::{Serialize, Serializer}; use sourmash::cmd::{prepare, ComputeParameters}; use s...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Control 0 Controls clock source selects"] pub ctl0: CTL0, #[doc = "0x04 - Control 1 This register contains OSC_DIG configuration"] pub ctl1: CTL1, #[doc = "0x08 - RADC External Configuration"] pub radcextcfg: RADCEX...
// This is a part of rust-encoding. // Copyright (c) 2013-2015, <NAME>. // See README.md and LICENSE.txt for details. /*! * Interface to the character encoding. * * # Raw incremental interface * * Methods which name starts with `raw_` constitute the raw incremental interface, * the lowest-available API for encod...
use std::io::Write; use CompletionStatus::*; // Rules // Game has 10 frames. // Each frame starts with 10 pins. // Max 2 rolls per frame. // Last frame only: spare OR strike -> exactly 3 rolls. const LAST_FRAME: usize = 9; const MAX_PINS: T = 10; const FRAME_SIZE: usize = 2; const FRAME_SIZE_LAST: usize = FRAME_SIZE +...
mod line; mod map; mod points; mod rectangle; mod world; pub use self::line::Line; pub use self::map::{Map, MapResolution}; pub use self::points::Points; pub use self::rectangle::Rectangle; use crate::{ buffer::Buffer, layout::Rect, style::{Color, Style}, symbols, widgets::{Block, Widget}, }; use ...
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; use rocksdb::{self, Writable}; use std::io::Write; use std::path::Path; use std::sync::Arc; use std::{mem, str}; use utils::*; struct U16BeSuffixTransform; impl rocksdb::SliceTransform for U16BeSuffixTransform { fn transform<'a>(&mut self, key: &'a [u8]) ->...
use std::time::Duration; use std::process; use std::io::Error as IoError; use std::sync::Arc; use log::info; use log::trace; use log::error; use log::debug; use log::warn; use types::print_cli_err; use futures::channel::mpsc::Receiver; use futures::channel::mpsc::Sender; use futures::channel::mpsc::channel; use futur...
use crate::mem; // // Video // const MODE0_CYCLES: usize = 204; // H-Blank const MODE1_CYCLES: usize = 4560; // V-Blank const MODE2_CYCLES: usize = 80; // Transfer to LCD const MODE3_CYCLES: usize = 172; // Transfer to LCD const MODE2_START: usize = 0; const MODE2_END: usize = MODE2_START + MODE2_CYCLES - 1; const M...
// 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...
use std::mem; use crate::utils::CopyInto; use crate::math::{ field, polynom, quartic }; use crate::crypto::{ MerkleTree, BatchMerkleProof }; use crate::stark::{ ProofOptions, utils::QueryIndexGenerator }; mod proof; pub use proof::{ FriProof, FriLayer }; // CONSTANTS // ===============================================...
use std::io::{Read, Write}; use std::cmp::min; /// Language to parse and execute. pub struct Language { inc: char, dec: char, inc_ptr: char, dec_ptr: char, put_char: char, get_char: char, loop_start: char, loop_end: char, } impl Language { pub fn is_token(&self, ch: char) -> bool {...
#![allow(non_camel_case_types)] use super::lauxlib::luaL_newstate; use libc::{c_double, c_int, c_schar, c_uchar, c_void, ptrdiff_t, size_t}; use std::ptr; pub const LUA_VERSION: &'static [c_uchar] = b"Lua 5.1\x00"; pub const LUA_RELEASE: &'static [c_uchar] = b"Lua 5.1.4\x00"; pub const LUA_VERSION_NUM: c_int = 501; p...
use serde::{Deserialize, Serialize}; pub use super::exception::Exception; use super::{arm::ArmCond, psr::RegPSR, Addr, CpuMode, CpuState}; use crate::util::{Shared, WeakPointer}; use super::memory::{MemoryAccess, MemoryInterface}; use MemoryAccess::*; use cfg_if::cfg_if; #[cfg(feature = "debugger")] use super::th...
use std::io::{ Write }; use std::io::Result as IoResult; use byteorder::{ LittleEndian, WriteBytesExt }; use ::{ InstructionEncodingError, Mode, SegmentReg }; use ::instruction::MergeMode; pub const PREFIX_LOCK: u8 = 0xF0; pub const PREFIX_REPNE: u8 = 0xF2; // REPNE/REPNZ pub const PREFIX_REP: u8 = 0xF3; // REP/REPE/R...
/// Copyright https://github.com/ruben2020/tags2uml @ruben2020 // from file: https://github.com/ruben2020/tags2uml/blob/master/tagsparser.go // // 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 ...
#![warn(clippy::float_cmp)] use crate::color::{color_blend, color_dist, Color}; use crate::console::*; use crate::file::FileLoader; use image; /// An easy way to load PNG images and blit them on the console pub struct Image { file_loader: FileLoader, img: Option<image::RgbaImage>, } impl Image { /// Creat...
//! The chat coordinator. //! Configuration is performed via the public configure function. This is the only public exposure. //! //! The theory of operation is that this component cooperates with other components to form a chat service. //! This is the coordinator component, which is wired before the consumer and afte...
/* * Copyright 2020 Oxide Computer Company */ use std::borrow::Borrow; use std::error::Error; use std::str::FromStr; use clap::{App, Arg}; use disc_v::*; use colored::Colorize; mod tockilator; use tockilator::*; macro_rules! fatal { ($fmt:expr) => ({ eprint!(concat!("tockilator: ", $fmt, "\n")); ...
use num_traits::{Float, NumAssignOps}; /// ROTMG /// Note the version of ROTMG equal to [OpenBlas](https://github.com/xianyi/OpenBLAS/pull/1480) /// based on an algorithm proposed by <NAME> in 1998. /// CONSTRUCT THE MODIFIED GIVENS TRANSFORMATION [T] H WHICH ZEROS /// THE SECOND COMPONENT OF THE 2-VECTOR (SQRT(D1)*X...
//! the main **version** struct. use std::fmt; use std::cmp::Ordering; use serde; use std::marker::PhantomData; use crate::versionpart::VersionPart; #[derive(Hash)] pub struct Version { parts : Vec<VersionPart> } impl PartialEq for Version { fn eq(&self, other: &Version) -> bool { //! in order for...
#[macro_use] extern crate log; #[macro_use] extern crate serde; use clap::{App, Arg}; use failure::{ensure, err_msg, ResultExt}; use futures_util::future::try_join_all; use futures_util::{StreamExt, TryFutureExt}; use multiaddr::Multiaddr; use std::collections::{HashMap, HashSet}; use std::io::stdout; use std::str::Fr...
use std::{ any::Any, cell::{RefCell, UnsafeCell}, marker::PhantomData, mem, sync::Arc, }; use wgpu::{ CommandBuffer, CommandEncoder, CommandEncoderDescriptor, LoadOp, Operations, RenderPass, RenderPassColorAttachment, RenderPassDepthStencilAttachment, RenderPassDescriptor, TextureView, Text...
use std::collections::HashMap; use std::io::{stderr, Write}; pub struct ParseOutput { pub str_proto: String, pub str_request: String, pub str_rpc: String, pub model_list: Vec<String>, pub str_model: String, pub str_from_proto: String, pub str_into_proto: String, pub type_nd: bool, p...
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license // <LICENSE-MI...
//! Ported to Rust from <https://www.shadertoy.com/view/XsBSRV> //! //! Original comment: //! ```glsl //! // On/Off Spikes, fragment shader by movAX13h, oct 2014 //! ``` use shared::*; use spirv_std::glam::{ const_vec3, vec2, vec3, Mat2, Mat3, Vec2, Vec2Swizzles, Vec3, Vec3Swizzles, Vec4, Vec4Swizzles, }; // Note...
// Copyright 2022 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::message::{PublisherRequest, PublisherRequestMessage, VmoMessage}; use anyhow::Error; use fidl::endpoints::{ControlHandle, Responder}; use fidl_f...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Interrupt Register. The IR can be written to clear interrupts, or read to identify which PWM interrupt sources are pending."] pub ir: IR, #[doc = "0x04 - Timer Control Register. The TCR is used to control the Timer Counter func...
use cargo::core::dependency::Kind; use cargo::core::manifest::ManifestMetadata; use cargo::core::maybe_allow_nightly_features; use cargo::core::package::PackageSet; use cargo::core::registry::PackageRegistry; use cargo::core::resolver::ResolveOpts; use cargo::core::shell::Shell; use cargo::core::{Package, PackageId, Re...
/// All code related to loading and running each day use std::fmt; use std::fs; use std::fs::File; use std::io::{BufRead, BufReader, Cursor, Seek, SeekFrom, Write}; use reqwest::{ blocking::Client, header::{HeaderMap, HeaderName, HeaderValue}, }; use select::document::Document; use select::node::Node; use sel...
use std::fs::File; use std::rc::Rc; use rand::{self,Rng}; use clap::{Arg, App}; use raytracer::vec3::{Point3, Color, Vec3}; use raytracer::hittable::{Hittable, BVH}; use raytracer::sphere::{Sphere, AnimatedSphere}; use raytracer::camera::Camera; use raytracer::material::{Lambertian, Metal, Dielectric, DiffuseLight}; us...
use std::collections::BTreeMap; use std::fs; use std::io; use std::marker::PhantomData; use std::os::unix::process::CommandExt; use std::process::{Child, Command}; use nix::sys::{ ptrace, wait::{self, WaitPidFlag, WaitStatus}, }; use crate::error::{Error, Result}; pub use nix::unistd::Pid; pub use nix::sys:...
use super::Result; use core::fmt; use core::mem::size_of; use core::ops::Deref; // use log::info; use super::common::*; use super::internal::*; use super::reader::*; pub const MAX_BOOTARGS_LEN: usize = 200; pub const MAX_STRINGS_BLOCK_LEN: usize = 5000; /// A vector with a fixed capacity of `M` elements allocated on...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Enable Register"] pub ier: IER, #[doc = "0x04 - Receiver Block Enable Register"] pub irer: IRER, #[doc = "0x08 - Transmitter Block Enable Register"] pub iter: ITER, #[doc = "0x0c - Clock Generation enable"] ...
use crate::context::ColorClosure; use crate::prompt::Prompt; use crate::{util, Buffer, Cursor}; use sl_console::{clear, color, cursor}; use std::cmp::Ordering; use std::fmt::Write; use std::io; #[derive(Clone, Copy, Debug)] pub struct Metrics { width: usize, prompt_width: usize, new_total_width: usize, ...
/// This module contains code for the following: /// (Windows only) Getting list of drives via winapi /// Managing the file-tree, i.e. state of the file-browser /// Logic for operating on the file-tree /// Serialization and deserialization of the file-tree state use std::path::{Path, PathBuf}; use std::fs; #[cfg(wind...