text
stringlengths
7.05k
33.9k
/// Wraps u32 that represents a packed RGBA color. Mostly used by types in the /// low level custom drawing API, such as [`DrawListMut`](crate::DrawListMut). /// /// The bits of a color are in "`0xAABBGGRR`" format (e.g. RGBA as little endian /// bytes). For clarity: we don't support an equivalent to the /// `IMGUI_USE...
use crate::common::params::InnerHashParameters; use franklin_crypto::bellman::pairing::ff::{PrimeFieldRepr, ScalarEngine}; use franklin_crypto::bellman::pairing::Engine; extern crate num_bigint; extern crate num_integer; extern crate num_traits; use crate::common::utils::biguint_to_u64_array; use crate::traits::{Custom...
/* This tool is part of the WhiteboxTools geospatial analysis library. Authors: Dr. <NAME> Created: 19/02/2020 Last Modified: 20/02/2020 License: MIT */ use whitebox_raster::*; use crate::tools::*; use whitebox_vector::*; use std::env; use std::f64; use std::io::{Error, ErrorKind}; use std::path; /// This tool can be...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Control Register"] pub cr: CR, #[doc = "0x04 - Mode Register"] pub mr: MR, _reserved2: [u8; 8usize], #[doc = "0x10 - Channel Enable Register"] pub cher: CHER, #[doc = "0x14 - Channel Disable Register"] pub chdr: CHDR, ...
//! Draw 2D graphics to the screen //! //! The main type is [`Graphics`], which is provided to your application by [`run`]. It handles //! drawing shapes via methods like [`Graphics::fill_rect`] and [`Graphics::stroke_rect`]. If the //! existing drawing methods don't fit your needs, try [`Graphics::draw_elements`] for ...
// Copyright © 2021 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT use alloc::format; use alloc::string::String; use alloc::vec::Vec; use core::mem::transmute; use core::pin::Pin; use fallible_collections::{FallibleVec, FallibleVecGlobal}; use log::info; use x86::controlregs; use x86:...
#![allow(clippy::map_entry)] use super::{Pair, WithFirstLastIterator, Word, BPE}; use crate::tokenizer::{Model, Result, Trainer}; use indicatif::{ProgressBar, ProgressStyle}; use std::collections::{HashMap, HashSet}; struct Config { min_frequency: u32, vocab_size: usize, show_progress: bool, special_t...
// Copyright 2018-2020 argmin developers // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or // http://opensource.org/licenses/MIT>, at your option. This file may not be // copied, modified, or distributed except according...
pub mod data; use crate::data::tokens::Span; use crate::data::{position::Position, Interval}; use nom::{ error::{ErrorKind, ParseError}, *, }; pub use crate::data::error_info::ErrorInfo; pub use data::CustomError; // TODO: add link to docs // Parsing Errors pub const ERROR_PARENTHESES: &str = "list elem typ...
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #![allow(clippy::single_match)] use std::{ collections::hash_map, fs, path::{Path, PathBuf}, }; use anyhow::Result; use log::{error, trace}; use rand::{thread_rng, Rng}; use win_util::{file, handle::Handle, last_os_error, process}...
//! Lower //! use crate::collections::{map, Map}; use crate::grammar::consts::CFG; use crate::grammar::parse_tree as pt; use crate::grammar::parse_tree::{ read_algorithm, GrammarItem, InternToken, Lifetime, MatchMapping, Name, NonterminalString, Path, TerminalString, }; use crate::grammar::pattern::{Pattern, P...
use std::cell::RefCell; use std::cmp::{max, min}; use std::fmt; use std::ops::FnMut; use std::str::{from_utf8, FromStr}; use strum_macros::{Display, EnumString}; #[cfg(test)] #[cfg_attr(tarpaulin, skip)] mod tests; pub type Result<T> = std::result::Result<T, LexError>; #[derive(Debug, Clone, PartialEq, Eq, Hash)] pu...
mod cluster; mod loader; use crate::{cluster::*, loader::*}; use bytemuck::{Pod, Zeroable}; use caldera::prelude::*; use imgui::Key; use spark::vk; use std::{ mem, path::{Path, PathBuf}, slice, }; use structopt::StructOpt; use strum::VariantNames; use winit::{ dpi::{LogicalSize, Size}, event_loop::...
// Copyright 2021 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use { anyhow::{format_err, Error}, at_commands::{self as at, SerDe}, bitflags::bitflags, bt_profile_test_server_client::{MockPeer, ProfileT...
//! The `inline_proc` attribute macro. use proc_macro::TokenStream as TokenStream1; use proc_macro2::{Delimiter, Group, Spacing, Span, TokenStream, TokenTree}; use std::collections::HashMap; use std::fmt::{self, Display, Formatter, Write}; use std::io::BufReader; use std::path::PathBuf; use std::process::{Command, Std...
//! The parser. use std::rc::Rc; use crate::ast::{Ast, NodeId, NodeKind}; use crate::common::{Error, ErrorKind}; use crate::lexer::{Lexer, Token, TokenKind}; /// The parser's state. pub struct Parser { lexer: Lexer, ast: Ast, } impl Parser { /// Constructs a new parser from a lexer. pub fn new(lexer: Le...
/******************************************************************************* * * kit/kernel/terminal.rs * * vim:ft=rust:ts=4:sw=4:et:tw=80 * * Copyright (C) 2015-2021, <NAME> * Redistribution of this file is permitted under the terms of the simplified * BSD license. See LICENSE for more information. * ***...
// This file is part of Sulis, a turn based RPG written in Rust. // Copyright 2018 <NAME> // // Sulis 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 opt...
// Copyright © 2021 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT //! Generic process traits use alloc::boxed::Box; use alloc::string::String; use alloc::sync::Arc; use alloc::vec::Vec; use core::convert::{TryFrom, TryInto}; use core::fmt::Debug; use arrayvec::ArrayVec; use cstr_core...
//! # OysterPack STAKE Token NEAR Smart Contract //! > With the OysterPack NEAR STAKE token "You can have your STAKE and TRADE it too" //! //! The OysterPack STAKE token is backed by staked NEAR. This contract enables you to delegate your //! NEAR to stake, and in return you are issued STAKE tokens. This enables you to...
#![no_std] #![no_main] #![feature(min_type_alias_impl_trait)] #![feature(impl_trait_in_bindings)] #![feature(pin_static_ref)] #![feature(type_alias_impl_trait)] #![feature(generic_associated_types)] #![feature(const_fn_trait_bound)] #![allow(incomplete_features)] use core::fmt::Write; use core::pin::Pin; use core::syn...
mod pixel_fifo; use crate::gameboy::ppu::color; use gb_cpu::{CpuInputPins, CpuOutputPins}; use self::pixel_fifo::Pixel; use super::{ frame::Frame, registers::{OamEntry, OamEntryFlags, LCDC, STAT}, }; use std::{ops::Generator, pin::Pin}; pub struct PpuState { pub tile_data: [u8; 0x9800 - 0x8000], pu...
use cgmath::{Point2, Vector4}; use image::GenericImageView; use rusttype::{Font, Scale}; use std::collections::HashMap; use std::mem; use wgpu::util::DeviceExt; // The characters that are pre-rendered by the game. const FONT_CHARACTERS: &'static str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ\ abcdefghijklmnopqrstuvwxyz\ 12...
use std::{ collections::HashMap, fmt::{Debug, Formatter}, }; use ast::*; use statistics::{ColumnStatistics, NotNan}; use crate::search_space::*; #[derive(Clone)] pub struct LogicalProps { // cardinality contains the estimated number of rows in the query. pub cardinality: f64, // columns contains ...
// Copyright 2014 The syscall.rs Project Developers. See the // COPYRIGHT file at the top-level directory of this distribution. // // 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>...
use glutin::{ self, event::{Event, WindowEvent}, event_loop::{ControlFlow, EventLoop}, window::WindowBuilder, ContextBuilder, PossiblyCurrent, }; use gl::types::*; use std::mem; use std::mem::MaybeUninit; use std::ptr; pub mod gl { #![allow(clippy::all)] include!(concat!(env!("OUT_DIR"), ...
/* * Guiter tuner for wio-terminal with Rust * Main file * * Rust 2018 0.1.0 * * @auther <NAME> <<EMAIL>> * @copylight 2021 <NAME> * @license https://opensource.org/licenses/MIT MIT license * @version 0.2 2nd version. All function implemented * @version 0.1 1st version. Only frequency mete...
use error::Result; use joint::Joint; use may::sync::Mutex; use rusqlite::Connection; use spec; use storage; use witness_proof; lazy_static! { static ref CATCHUP_MUTEX: Mutex<()> = Mutex::new(()); static ref HASHTREE_MUTEX: Mutex<()> = Mutex::new(()); } #[derive(Serialize, Deserialize)] pub struct CatchupReq {...
use super::graph_explorer::GraphExplorer; use std::collections::HashSet; use algorithm::data_structure::graph::*; #[derive(Debug, Serialize, Deserialize, PartialEq, Eq)] pub struct IntegrationPoint { // all the id is local (not the final id we get after merge 2 graph together) // either source_id or target_id...
//! The bot module use crate::objects; //use functions::FunctionGetMe; use crate::error::{ErrorKind, TelegramError}; use crate::file::File; use std::{str, time::{Duration, Instant}, collections::HashMap, sync::Arc}; use std::sync::atomic::{AtomicUsize, Ordering}; use tokio::timer::Interval; use hyper::{Body as Body2...
// 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...
use super::*; #[derive(Debug, Serialize, Deserialize, Clone, Hash, PartialEq, Eq, Copy)] pub struct Id(usize); impl Id { pub fn raw(&self) -> usize { self.0 } } #[derive(Debug, Serialize, Deserialize, Clone)] pub struct IdGen { next_id: usize, } impl IdGen { pub fn new() -> Self { Se...
use super::{Backend, Probe}; use crate::common::*; use yup_oauth2::GetToken; use google_bigquery2::{ GetQueryResultsResponse, Job as BigQueryJob, TableListTables, TableReference, }; use bigquery_storage::client::{Client as BigQueryStorageClient, Error as ClientError}; use bigquery_storage::proto::bigquery_storag...
//! Implementation of the `Synth` struct for basic multi-voice, multi-oscillator envelope //! synthesis. use instrument::{self, Instrument, NoteFreq, NoteFreqGenerator}; use instrument::unit::NoteVelocity; use oscillator::{self, Amplitude, Frequency, FreqWarp, Oscillator, Waveform}; use panning::stereo; use pitch; u...
use std::io; pub fn encode_zigzag_i16(v: i16) -> u16 { encode_zigzag_i64(v as i64) as u16 } pub fn encode_zigzag_i32(v: i32) -> u32 { encode_zigzag_i64(v as i64) as u32 } pub fn encode_zigzag_i64(v: i64) -> u64 { ((v << 1) ^ (v >> 63)) as u64 } pub fn decode_zigzag_i16(v: u16) -> i16 { decode_zigzag...
//! A table wraps a [crate::ig::docs::Doc] together with an [Trie] as index to support InfoGraphDB queries. //! //! Note that a table consumes a given doc to ensure it is immutable, as the index is built //! up on creation of the table and then kept as long as the table lives. use crate::idb::trie::{PrefixIter, Trie}; ...
use std::cell::{Cell, RefCell}; use std::path::PathBuf; use std::rc::Rc; use std::sync::Arc; use anyhow::Context; use gtk; use gtk::prelude::*; use crate::frame_export::{self, LayerExportMode}; use crate::int_entry::{self, TextEntry}; use crate::select_dir; use crate::ui_helpers::*; use crate::{ Error, error_from...
/* ---------------------------------------------------------------------------- Copyright (c) 2018, Microsoft Research, <NAME> This is free software; you can redistribute it and/or modify it under the terms of the MIT license. A copy of the license can be found in the file "LICENSE" at the root of this distribution. --...
use crate::comm::CommRef; use crate::comm::Notifications; use crate::common::{Map, Set}; use crate::protocol::clientmsg::{task_spec_to_memory, UpdateGraphMsg}; use crate::server::client::ClientId; use crate::server::core::CoreRef; use crate::protocol::generic::{ProxyMsg, ScatterMsg, ScatterResponse, WhoHasMsgResponse}...
use crate::http as profiles; use api::destination_client::DestinationClient; use futures::{future, ready, Stream, TryStreamExt}; use http; use http_body::Body as HttpBody; use linkerd2_addr::{Addr, NameAddr}; use linkerd2_dns as dns; use linkerd2_error::{Error, Recover}; use linkerd2_proxy_api::destination as api; use ...
// 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 // disclai...
#![deny(warnings)] extern crate cargo_registry; extern crate chrono; extern crate conduit; extern crate conduit_middleware; extern crate conduit_test; extern crate curl; extern crate diesel; #[macro_use] extern crate diesel_codegen; extern crate dotenv; extern crate flate2; extern crate git2; extern crate s3; extern c...
use ethers_core::types::{ transaction::{eip2718::TypedTransaction, eip2930::AccessListWithGasUsed}, Address, BlockId, Bytes, Signature, U256, }; use ethers_providers::{maybe, FromErr, Middleware, PendingTransaction}; use ethers_signers::Signer; use async_trait::async_trait; use thiserror::Error; #[derive(Clon...
//! Types that specify what is contained in a ZIP. #[derive(Clone, Copy, Debug, PartialEq)] pub enum System { Dos = 0, Unix = 3, Unknown, } impl System { pub fn from_u8(system: u8) -> System { use self::System::*; match system { 0 => Dos, 3 => Unix, ...
use std::collections::{HashMap, HashSet}; use std::fs; use std::iter::FromIterator; use std::path::{Path, PathBuf}; use std::str::FromStr; use std::sync::Arc; use failure::ResultExt; use itertools::Itertools; use log::info; use snips_nlu_ontology::{BuiltinGazetteerEntityKind, GrammarEntityKind}; use snips_nlu_parsers:...
#![unstable(issue = "none", feature = "windows_stdio")] use crate::char::decode_utf16; use crate::cmp; use crate::io; use crate::os::windows::io::{FromRawHandle, IntoRawHandle}; use crate::ptr; use crate::str; use crate::sys::c; use crate::sys::cvt; use crate::sys::handle::Handle; use core::str::utf8_char_width; // D...
use std::fmt; use std::fmt::Write; use ast::{MaybeTokenPosition, KeywordData}; use ast; #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum Punctuator { Eq, EqEq, EqEqEq, Neq, NeqEq, CurlyR, CurlyL, ParenR, ParenL, SquareR, SquareL, AngleR, AngleL, Semic...
use baseview::{Event, Window, WindowHandler, WindowScalePolicy}; use iced_futures::futures; use iced_futures::futures::channel::mpsc; use iced_graphics::Viewport; use iced_native::{Cache, UserInterface}; use iced_native::{Debug, Executor, Runtime, Size}; use raw_window_handle::{HasRawWindowHandle, RawWindowHandle}; use...
use headers::{Header, HeaderName, HeaderValue}; use lazy_static::lazy_static; use log::{error, warn}; use parser::{all_string, elements, full_string, values_list}; use std::{ fmt::Display, iter, net::{AddrParseError, IpAddr, Ipv6Addr, SocketAddr, SocketAddrV6}, str::Utf8Error, }; mod parser; lazy_stat...
#![cfg_attr(feature = "auto-sequence", feature(proc_macro_span))] use nom::{ branch::alt, combinator::{map, opt, verify}, error::{make_error, ErrorKind}, multi::many0, sequence::tuple, IResult, }; use pratt::{Affix, Associativity, PrattError, PrattParser, Precedence}; use proc_macro2::{Group, I...
extern crate chrono; extern crate crossterm; mod found_word; mod options; mod window; use chrono::Local; use crossterm::event::{self, DisableMouseCapture, EnableMouseCapture, Event, KeyCode, KeyEvent}; use crossterm::terminal::{self, ClearType}; use crossterm::{cursor, execute, style}; use found_word::Word; use optio...
use crate::data::MaybeSerializableData; use crate::dynamics::BodyPair; use crate::geometry::contact_generator::{ContactGeneratorWorkspace, ContactPhase}; use crate::geometry::{Collider, ColliderPair, ColliderSet}; use crate::math::{Isometry, Point, Vector}; #[cfg(feature = "simd-is-enabled")] use { crate::math::{Si...
/* This tool is part of the WhiteboxTools geospatial analysis library. Authors: Dr. <NAME> Created: 30/01/2018 Last Modified: 12/10/2018 License: MIT */ use crate::raster::*; use crate::rendering::html::*; use crate::rendering::LineGraph; use crate::tools::*; use std::env; use std::f64; use std::fs::File; use std::io:...
mod acl_stream; mod peripheral; use libc; use std; use std::ffi::CStr; use nom; use bytes::{BytesMut, BufMut}; use std::collections::{HashSet, HashMap}; use std::sync::{Arc, Mutex}; use std::sync::atomic::{AtomicBool, Ordering}; use std::thread; use ::Result; use api::{CentralEvent, BDAddr, Central}; use bluez::uti...
// Copyright 2020 The Matrix.org Foundation C.I.C. // // 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...
/* * SPDX-License-Identifier: BlueOak-1.0.0 * Copyright (c) <NAME> <<EMAIL>> */ //! Interrupt handling //! //! The base address is given by VBAR_ELn and each entry has a defined offset from this //! base address. Each table has 16 entries, with each entry being 128 bytes (32 instructions) //! in size. The table eff...
//! This module implements the double generic gate. //~ The double generic gate contains two generic gates. //~ //~ A generic gate is simply the 2-fan in gate specified in the //~ vanilla PLONK protocol that allows us to do operations like: //~ //~ * addition of two registers (into an output register) //~ * or multipl...
//! Implements the HS ntor key exchange, as used in v3 onion services. //! //! The Ntor protocol of this section is specified in section //! [NTOR-WITH-EXTRA-DATA] of rend-spec-v3.txt. //! //! The main difference between this HS Ntor handshake and the standard Ntor //! handshake in ./ntor.rs is that this one allows eac...
//! Native FFI bindings to libfuse. //! //! This is a small set of bindings that are required to mount/unmount FUSE filesystems and //! open/close a fd to the FUSE kernel driver. #![warn(missing_debug_implementations)] #![allow(missing_docs)] use super::is_mounted; use super::mount_options::{option_to_string, MountOp...
//! Core KafkaServer //! core/src/main/scala/kafka/server/KafkaServer.scala //! Rafka Changes: //! - All fields that were initially null have been coverted to Option<T>, This is probably a bad //! idea, let's see how far we can go //! - In the original code, KafkaServer has a field of type KafkaConfig that contains a...
use crate::{err::*, machine, mem::Mem, rout, *}; pub struct State { stack: Vec<Vec<u16>>, pub pc: usize, call: Vec<Frame>, vars: u16, interrupt: Option<usize>, } pub struct Saved { pub mem: Vec<u8>, pub stack: Vec<Vec<u16>>, pub pc: usize, pub call: Vec<Frame>, } #[derive(Clone)] ...
//! Route Origin Authorizations. //! //! For details, see RFC 6482. use std::mem; use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; use std::sync::Arc; use bcder::{decode, encode}; use bcder::{Captured, Mode, OctetString, Oid, Tag, xerr}; use bcder::encode::{PrimitiveContent, Values}; use super::oid; use super::cert::{Cert,...
#[cfg(test)] #[path = "../../../../tests/unit/construction/clustering/vicinity/estimations_test.rs"] mod estimations_test; use super::*; use crate::construction::constraints::ConstraintPipeline; use crate::models::common::*; use crate::models::problem::{Place, Single, TransportCost}; use crate::models::solution::Commu...
use rand::{CryptoRng, RngCore}; /// Gadget to prove that 2 merkle trees have only few leaves different. /// The leaves that are chosen different is based on value of the nonce /// It is known to verifier which leaves are distorted. /// The circuit should take the original data root, distorted data and the original data...
use super::{Detect, Location}; use std::cmp::min; use std::iter::repeat; use std::iter::Iterator; use crate::util::qr::QRLocation; use crate::util::Point; use image::{GrayImage, Pixel}; #[cfg(feature = "debug-images")] use image::{DynamicImage, Rgb}; #[cfg(feature = "debug-images")] use std::{env::temp_dir, fs::cr...
// Copyright 2020 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. use { anyhow::{format_err, Context as _, Error}, fidl::{ client::QueryResponseFut, endpoints::{ClientEnd, Proxy}, }, fidl_f...
use std::collections::HashMap; use std::mem::take; use unicode_normalization::char; use crate::chunk::{Chunk, Chunks}; use crate::types::get_month_for_abbr; /// Fully parse a value, resolving abbreviations and LaTeX commands. pub fn resolve(value: &str, abbreviations: &HashMap<&str, &str>) -> Option<Chunks> { le...
extern crate bmfa; extern crate freetype; extern crate image; extern crate structopt; use bmfa::{BitmapFontAtlas, BitmapFontAtlasMetadata, GlyphMetadata}; use freetype::Library; use std::collections::HashMap; use std::error; use std::fmt; use std::mem; use std::path::PathBuf; use structopt::StructOpt; /// The atlas...
use super::events::{ConfigType, Event, EventBody, EventProvider, Result}; use crate::config::Config; use chrono::prelude::*; use std::collections::HashMap; use std::fs::File; use std::io::*; const BUF_SIZE: u64 = 4096; // let mut separator_bytes = "\nFrom ".to_string().into_bytes(); // separator_bytes.reverse(); // c...
#[macro_use] extern crate clap; extern crate failure; extern crate handlebars; extern crate itertools; extern crate serde; #[macro_use] extern crate serde_derive; extern crate serde_json; #[macro_use] extern crate structopt; #[macro_use] extern crate lazy_static; extern crate pretty; extern crate pulldown_cmark; extern...
// Copyright 2018-2020, Wayfair GmbH // // 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...
#![allow(dead_code)] #![allow(clippy::all)] // Clippy crashes on #[derive(FromPrimitive)]: Issue https://github.com/rust-lang-nursery/rust-clippy/issues/2910 use num::FromPrimitive; use regex::{Match, Regex}; use std::fmt; use std::fs::File; use std::io::{BufRead, BufReader}; #[derive(PartialEq, Debug, Clone)] pub str...
/* * Ported from mozjpeg to rust * * This file was part of the Independent JPEG Group's software: * Copyright (C) 1991-1996, <NAME>. * libjpeg-turbo Modifications: * Copyright (C) 2015, 2020, <NAME>. * * Conditions of distribution and use: * In plain English: * * 1. We don't promise that this software works....
use crate::util::{self, sub_chars}; use crate::{Range, Span}; use anyhow::{bail, Result}; use fancy_regex::Regex; use proc_macro2::LineColumn; use std::convert::TryFrom; use std::fmt; /// Track what kind of comment the literal is #[derive(Debug, Clone, Hash, Eq, PartialEq)] #[non_exhaustive] pub enum CommentVariant {...
// Crossover: clean crossovers as a multi-out plugin // Copyright (C) 2022 <NAME> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) an...
#![allow(clippy::needless_return)] #[macro_use] extern crate shadow_rs; mod backward; mod data; mod dlpack; mod forward; mod metrics; mod nats; mod optim; mod rpc; mod tensor; mod utils; #[cfg(feature = "cuda")] mod cuda; use crate::data::{PersiaBatchData, PyPersiaBatchData}; use crate::forward::{forward_directly, ...
use core::{fmt, mem, ptr, slice}; use crate::{BLOCK_SIZE_BYTES, ceil_to, div_ceil, floor_to}; use crate::color_map::{BlockRange, BLOCKS_PER_COLORMAP_BYTE, Color, ColorMap}; use crate::free_list::{FreeBlock, FreeList, FreeListSpan}; use crate::memory::Memory; use crate::string_buffer::StringBuffer; #[derive(Clone, Co...
/* * Copyright 2019 The Starlark in Rust Authors. * Copyright (c) Facebook, Inc. and its affiliates. * * 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/lic...
use macroquad::audio::*; use macroquad::rand::gen_range; use macroquad::prelude::*; use viewport::*; const WINDOW_WIDTH: f32 = 800.0; const WINDOW_HEIGHT: f32 = 600.0; fn window_conf() -> Conf { Conf { window_title: "Minesweeper".to_string(), window_width: WINDOW_WIDTH as i32, window_height: WINDOW_HEIGHT as ...
// Copyright 2019 CoreOS, 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...
use super::DelayData; use super::EnvelopeData; use super::FilterData; use super::Float; use super::LfoData; use super::ModData; use super::{OscData, OscType, OscRouting}; use super::synth::*; use super::voice::*; use super::{Parameter, ParameterValue, ParamId, SynthParam}; use serde::{Serialize, Deserialize}; // TODO...
use crate::{ bcs::{simulation_transcript::SimulationTranscript, transcript::Transcript}, iop::{ bookkeeper::{BookkeeperContainer, NameSpace}, message::{MessagesCollection, MsgRoundRef, ProverRoundMessageInfo}, oracles::RoundOracle, }, ldt::LDT, Error, }; use ark_crypto_primit...
//! Handling of [Uniforum Portable Objects][PO] //! //! This format is used by the well known [gettext] suite and also supported by the //! [translate-toolkit][tt] suite. It is a simple text format storing translation units with //! optional context and plural variants. //! //! For modern translation work it's disadvan...
use idl::analyzer::Analyzer; use idl::idl_nodes::*; use idl::ids; use crate::rust::con_idl::{get_rust_ty_name, get_rust_ty_ref}; use super::{create_hash_idents, BytesTypeName}; use crate::rust::string_pros::{StringPros, StringRustFmt}; use proc_macro2::{self, Literal, Punct, Spacing, TokenStream}; use quote::format_i...
/* MIT License Copyright (c) 2021 <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, distrib...
/* This tool is part of the WhiteboxTools geospatial analysis library. Authors: Dr. <NAME> Created: 24/04/2018 Last Modified: 22/10/2019 License: MIT */ use crate::raster::*; use crate::structures::Array2D; use crate::tools::*; use crate::vector::{ShapeType, Shapefile}; use num_cpus; use std::env; use std::f64; use st...
use super::connection::{Floating, Idle, Live}; use crate::connection::ConnectOptions; use crate::connection::Connection; use crate::database::Database; use crate::error::Error; use crate::pool::{deadline_as_timeout, CloseEvent, PoolOptions}; use crossbeam_queue::ArrayQueue; use futures_intrusive::sync::{Semaphore, Sem...
//! Binary implementing the CLI in `cli.rs` use core::convert::TryFrom; use std::io::{self, Write as _}; use anyhow::{anyhow, Context as _}; use delog::hex_str; use log::{info, trace}; mod cli; mod logger; fn main() { let args = cli::app().get_matches(); if let Err(err) = try_main(args) { eprintln!(...
use crate::certificate::PoolId; use crate::date::Epoch; use crate::value::*; use imhamt::HamtIter; use super::{LastRewards, LedgerError}; /// Set the choice of delegation: /// /// * No delegation /// * Full delegation of this account to a specific pool /// * Ratio of stake to multiple pools #[derive(Clone, PartialEq,...
#[cfg(not(feature = "std"))] use na::ComplexField; // for .abs() use na::{RealField, Unit}; use crate::math::{Point, Real, Vector}; use crate::query::{self, ClosestPoints, NonlinearRigidMotion, QueryDispatcher, TOIStatus, TOI}; use crate::shape::{Shape, SupportMap}; use crate::utils::WCross; use crate::query::gjk::Co...
// Copyright 2017 Pants project contributors (see CONTRIBUTORS.md). // Licensed under the Apache License, Version 2.0 (see LICENSE). use std::ffi::OsStr; use std::ffi::OsString; use std::mem; use std::os::raw; use std::os::unix::ffi::{OsStrExt, OsStringExt}; use std::string::FromUtf8Error; use core::{Failure, Functio...
use std::ops::{Add, Mul}; use std::clone::Clone; use serde::{Serialize, Deserialize}; use std::collections::HashMap; use pyo3::prelude::*; use super::utils::{calculate_displacement, calculate_new_velocity}; pub const G: f32 = 6.67e-11f32; #[pyclass] #[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] pub st...
//! The CoreGraphics backend for the Piet 2D graphics abstraction. #![deny(clippy::trivially_copy_pass_by_ref)] mod ct_helpers; mod gradient; mod text; use std::borrow::Cow; use std::sync::Arc; use core_graphics::base::{ kCGImageAlphaLast, kCGImageAlphaPremultipliedLast, kCGRenderingIntentDefault, CGFloat, }; u...
use crate::checker::Inst as CheckerInst; use crate::checker::{CheckerContext, CheckerErrors}; use crate::data_structures::{ BlockIx, InstIx, InstPoint, RangeFrag, RealReg, RealRegUniverse, SpillSlot, TypedIxVec, VirtualReg, Writable, }; use crate::{reg_maps::VrangeRegUsageMapper, Function, RegAllocError}; use l...
//! `sixlowpan_dummy.rs`: 6LoWPAN Compression Test Suite //! //! This file implements a simple testing framework for 6LoWPAN compression. //! A single Imix board can run this code, with either another Imix or another //! platform (such as a computer running Wireshark) receiving the packets and //! verifying they were t...
use std::sync::Arc; use crate::core::pbrt::{Float, consts::PI, radians}; use crate::core::shape::Shape; use crate::core::geometry::{Bounding3, Bounds3f, Ray, Point2f, Point3f, Normal3f, Vector3f}; use crate::core::transform::Transform; use crate::core::material::Material; use crate::core::interaction::*; use crate::cor...
//! A board support library for the TI Stellaris Launchpad // **************************************************************************** // // Imports // // **************************************************************************** // **************************************************************************** //...
use std; use num::*; use std::rc::Rc; pub type Int = i128; #[derive(Clone, PartialEq, Eq, Debug)] pub enum E { Ap(Rc<E>, Rc<E>), Num(Int), Pair(Rc<E>, Rc<E>), Nil, T, F, Cons, Function(usize), Other(String), Cloned(Rc<E>, usize), } impl E { fn count_thunk(&self) -> usize { match self { E::Cloned(a, _...
// Copyright 2018 Parity Technologies (UK) Ltd. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, mer...
use crate::config::*; use crate::errors::RunError; use crate::path_utils::get_source_walker; use cargo_metadata::{diagnostic::DiagnosticLevel, CargoOpt, Message, Metadata, MetadataCommand}; use serde::{Deserialize, Serialize}; use std::collections::{HashMap, HashSet}; use std::env; use std::fs::{read_dir, remove_dir_al...