text stringlengths 3.09k 13.9k |
|---|
// Copyright (c) 2017, Sabre developers
//
// Licensed under the Apache License, Version 2.0 (see LICENSE.Apache in the
// root directory) or MIT license (see LICENSE.MIT in the root directory),
// at your option. This file may be copied, distributed, and modified only
// in accordance with the terms specified by the c... |
use std::borrow::Cow;
/// An entity that occupies a space in lbl representation.
/// Also the internal rep of a "block" in this library.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Block {
Background { background_type: BackgroundType },
Block,
Dark,
Empty,
Exit,
Key,
Lock,
No... |
use {
tokio::{
net::TcpStream,
io::{AsyncWriteExt, AsyncReadExt},
sync::mpsc::{Sender, Receiver, channel}
},
std::{
collections::HashMap
},
crate::{
wrapper::*, types::*,
compressor::*
},
neoproto::prelude::*
};
pub async fn handle_pkt(loc... |
use crate::action::finder::request::HashActionOptions;
use crate::fs::Entry;
use crypto::digest::Digest;
use log::warn;
use rrg_macro::ack;
use rrg_proto::file_finder_hash_action_options::OversizedFilePolicy;
use rrg_proto::Hash as HashEntry;
use std::cmp::min;
use std::fs::File;
use std::io::Read;
/// Hashes data wri... |
//! Human Interface Device (HID)
//!
//! For more details see (HID1.11)
use core::num::NonZeroU8;
use crate::bmrequesttype::{bmRequestType, Direction, Recipient};
/// HID specific requests
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct Request {
/// Interface index
pub interface: u8,
/// Kind of req... |
// Copyright (c) 2016-2017 Chef Software Inc. and/or applicable contributors
//
// 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
//
// Unl... |
use std::sync::{Arc,Mutex};
extern crate bus;
use bus::{Bus,BusReader};
#[cfg(test)]
mod tests;
/// Prerequisite trait for any struct to be the 'wrapped' value of a TcReader
pub trait TakesMessage<M> {
fn take_message(&mut self, t: &M);
}
/// A set of connected `TcWriter<M>`s have any number (initially 0) of re... |
use super::{CommandRunner, ExecuteProcessRequest, FallibleExecuteProcessResult};
use boxfuture::{BoxFuture, Boxable};
use futures::future::{err, ok, Future};
use std::sync::Arc;
use std::time::{Duration, Instant};
use tokio_timer::Delay;
use workunit_store::WorkUnitStore;
#[derive(Clone)]
pub struct SpeculatingCommand... |
extern crate narm;
mod common;
use common::*;
use narm::narmvm::*;
/*
Integration tests for ADD/SUB operators using the SP
Note that since the SP is aligned by 4 the following applies:
- When adding/diffing with register the lowest 2 bits are ignored/zeroed
- Immediate values have to be multiples of 4, but can be 2... |
// 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... |
use std::{path::Path, sync::Arc, time::Duration};
use k::nalgebra as na;
use na::RealField;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use tracing::debug;
use crate::{
collision::parse_colon_separated_pairs, errors::*, interpolate, CollisionDetector,
TrajectoryPoint,
};
pub struct SelfCol... |
use super::{Params, Grad, Loc, Covariance};
use crate::{
consts::{PI_2, PI_E_2},
fitting::{Likelihood, Score, MLE},
statistics::{FisherInformation, Modes, Quantiles, ShannonEntropy, UnivariateMoments},
ContinuousDistribution,
Convolution,
Distribution,
Probability,
};
use ndarray::Array2;
us... |
use serde::{Deserialize, Serialize};
use serde_json::Result;
use serde_json::Value;
use std::collections::HashMap;
#[serde(rename_all = "camelCase")]
#[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize)]
pub enum NodeType {
Hidden,
Array,
String,
Object,
Code,
Closure,
Regexp,
Number,... |
use crate::eval::ScopeRef;
use crate::syntax::identifiers::APPLY;
use crate::syntax::{
ErrorTermError, ExpressionBoundary, ExpressionBoundaryError, ExpressionRef, ExpressionToken,
ExpressionTreeWalker, IdentifierIndex, OperatorToken, RawErrorTermError, TermToken, Token,
};
use crate::value::implement::*;
use nu... |
use crate::{Crate, Status};
use color_eyre::Result;
use flate2::read::GzDecoder;
use fxhash::FxHashMap;
use serde::Deserialize;
use std::collections::hash_map::Entry;
use std::io::Read;
use tar::Archive;
struct PublishedCrate {
crate_id: u64,
recent_downloads: u64,
version: Version,
}
pub fn download() -... |
use std::collections::HashMap;
use std::fmt::Debug;
use std::net::IpAddr;
use async_trait::async_trait;
use tokio::sync::RwLock;
use manager::model::dto::node::{Node, NodeIdList, NodeRecord};
use manager::model::view::auction::AcceptedBid;
use manager::model::NodeId;
#[derive(Debug, thiserror::Error)]
pub enum Error... |
use crate::Signature;
use ed25519_dalek::{Keypair, PublicKey, SecretKey, SignatureError, Signer};
use rand_core::{CryptoRng, RngCore};
/// A structure for holding the public and secret keys for use within the chain.
pub struct Wallet(Keypair);
impl Wallet {
/// Constructs a new [`Wallet`].
///
/// ## Note... |
use anyhow::{anyhow, Context, Result};
#[cfg(target_os = "linux")]
use cnx::text::{Attributes, Text};
use cnx::widgets::{Widget, WidgetStream};
use regex::Regex;
use std::collections::HashMap;
use std::process::Command;
use std::time::Duration;
use tokio::time;
use tokio_stream::wrappers::IntervalStream;
use tokio_stre... |
use std::num::ParseIntError;
use clap::{App, Arg, ArgMatches, SubCommand};
use thiserror::Error;
use super::{clap_arg_puzzle_part_time_two, read_file_contents, ReadFileContentsError};
pub const SUBCOMMAND_NAME: &str = "day01";
pub fn subcommand() -> App<'static, 'static> {
SubCommand::with_name(SUBCOMMAND_NAME... |
use std::sync::Arc;
use futures::FutureExt;
use tokio::time::Duration;
use super::{Error, Result};
use crate::{
datastore::prelude::{SharedStore, Store},
experiment::controller::comms::{sim_status::SimStatusSend, simulation::SimCtlRecv},
hash_types::worker::RunnerError,
output::SimulationOutputPersist... |
use super::common::*;
use futures::prelude::*;
use serde::{Deserialize, Serialize};
use slimchain_common::{
basic::{BlockHeight, ShardId},
error::{Error, Result},
tx_req::SignedTxRequest,
};
use slimchain_utils::record_event;
use std::{iter, sync::Arc};
use warp::Filter;
const CLIENT_RPC_ROUTE_PATH: &str =... |
use crate::map::tiles::Tile;
use crate::map::{Point, Rect};
use fastrand::Rng;
use noise::*;
use std::cmp::{max, min};
pub struct Map {
pub tiles: Vec<Vec<Tile>>,
pub revealed_tiles: Vec<Vec<bool>>,
pub rooms: Option<Vec<Rect>>,
width: usize,
height: usize,
}
impl Map {
/// Creates a new map f... |
//! Execute stage.
//! Returns write back data.
use crate::decode::{AluInstr, BrInstr, CsrInstr, DecodedInstr, LsuInstr};
use crate::isa::opcode::{AluOp, BranchType, LoadStoreType, PrivOp};
use bit_field::BitField;
/// Packet to modify CPU state finally.
pub enum WriteBackData {
Gpr { target: u32, value: u32 },
... |
use crate::core::spectrum::Spectrum;
use crate::{stat_memory_counter, stat_ratio};
use crate::core::pbrt::{Float, lerp};
use crate::core::transform::Transform;
use crate::core::sampler::Sampler;
use std::sync::Arc;
use log::error;
use crate::core::medium::{Medium, PhaseFunctions, HenyeyGreenstein, Mediums, MediumInterf... |
use std::collections::HashSet;
use std::ops::Deref;
use anyhow::{anyhow, Context};
use crossbeam_epoch as epoch;
use crossbeam_epoch::Guard;
use hyper::Body;
#[allow(unused_imports)]
use log::{debug, error, info, warn};
use nanoid::nanoid;
use parking_lot::lock_api::RwLockWriteGuard;
use parking_lot::{RawRwLock, RwLoc... |
use crate::mmtk::MMTK;
use crate::plan::global::BasePlan;
use crate::plan::global::CommonPlan;
use crate::plan::global::GcStatus;
use crate::plan::global::NoCopy;
use crate::plan::marksweep::gc_work::MSGCWorkContext;
#[cfg(feature="malloc")]
use crate::plan::marksweep::gc_work::MSSweepChunks;
use crate::plan::marksweep... |
use std::f32::consts::PI;
use crate::{game::Effects, loading::TextureAssets, worms::Hp, worms::Worm};
use crate::GameState;
use crate::actions::*;
use bevy::prelude::*;
pub struct AttackPlugin;
pub struct AttackPower(f32);
pub struct Pater;
pub struct AttackDirection{pub dir: Vec2}
impl Plugin for AttackPlugin {
... |
use anyhow::Result;
use wast::parser::{self, ParseBuffer};
use wast::ModuleField;
use wast::ModuleKind;
use wast::ValType;
use std::env;
use std::fs;
use std::io::{Read, Write};
use std::path::Path;
fn main() -> Result<()> {
let args: Vec<String> = env::args().collect();
if args.len() != 2 {
println!(... |
use std::path::Path;
use std::sync::Arc;
use arc_swap::{ArcSwap, ArcSwapAny, Cache, Guard};
use compact_str::CompactStr;
use notify::{Event, RecommendedWatcher, RecursiveMode, Watcher};
use once_cell::sync::OnceCell;
use parking_lot::Mutex;
pub use models::*;
mod models;
#[macro_export]
macro_rules! gen_config {
... |
//! Harvest energy and unload it to the appropriate target
//!
use super::{
gofer::{self, try_transfer},
move_to, CreepState, Role, TARGET,
};
use crate::prelude::*;
use screeps::{
find, game,
game::get_object_erased,
objects::{Source, StructureContainer},
prelude::*,
ReturnCode,
};
use std:... |
use bitfield::bitfield;
use crate::{
pci::{PCICapabilityHeader, PCIFunction},
prelude::*,
};
#[repr(u8)]
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
pub enum TriggerMode {
Edge = 0,
Level = 1,
}
#[repr(u8)]
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
pu... |
mod generation_tests;
mod random_moves;
#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use util::*;
use moves::generation::{is_color_checkmated};
#[test]
fn test_move_debug_fmt() {
assert_eq!(format!("{:?}", Move {
origin_piece: W_BISHOP,
dest_piece: B_KNIGHT,
o... |
use core::{
slice,
fmt,
ops::{
Deref,
DerefMut,
},
};
use usize_conversions::usize_from;
use x86_64::{
VirtAddr,
PhysAddr,
structures::paging::{
PhysFrameRange,
PhysFrame,
},
};
pub struct BootInfo<'data> {
pub p4_table_addr: u64,
pub memory_map:... |
extern crate regex;
use regex::Regex;
use std::cmp::Ordering;
use std::collections::HashMap;
use std::fs;
use std::io::Error;
#[derive(Debug, PartialEq, Eq)]
enum Hour {
BeforeMidnight,
AfterMidnight,
}
#[derive(Debug, PartialEq, Eq)]
enum LogEvent {
FallAsleep,
BeginShift(i32),
WakeUp,
}
#[deri... |
//! A CRDT that stores an `i64` value that increments
use Error;
use dot::{SiteId, Counter as RCounter};
use std::borrow::Cow;
use std::collections::HashMap;
/// A Counter is an `i64` value that can be incremented and
/// decremented via the [`increment`](#method.increment) function.
///
/// Internally, Counter is a ... |
use crate::base_artifact_uploader::ContextBehavior;
use crate::base_artifact_uploader::{time_now, BaseArtifactUploaderBuilder};
use crate::{RunStageUploader, RunUploader};
use artifacts_api_rust_proto::{
ArtifactGroupUploaderData, CreateArtifactRequest, CreateRunRequest, CreateRunResponse,
};
use base64::decode;
u... |
//! The `umgap taxonomy` command.
use std::io;
use std::io::BufRead;
use std::io::Write;
use std::path::PathBuf;
use crate::errors;
use crate::rank;
use crate::taxon;
#[rustfmt::skip]
#[derive(Debug, StructOpt)]
#[structopt(verbatim_doc_comment)]
#[allow(clippy::tabs_in_doc_comments)]
/// Includes info in a stream o... |
//! This module defines the host's VM exit handlers.
//use crate::interrupt_controller;
use crate::hypercall_handler;
use crate::register_state::GeneralPurposeRegisterState;
use crate::vmcs_dump;
use crate::vmcs_fields::VmcsField;
use crate::vmexit_reasons::*;
use crate::vmx;
use crate::vmx::vmread;
use crate::vmx::vmw... |
use crate::voxel_map::VoxelMap;
use std::collections::HashMap;
pub enum WeightResult {
Maxima,
Interier(usize),
Boundary(Vec<f64>),
}
/// Steps in the density grid, from point p, following the gradient.
///
/// This should be called from [`weight()`].
///
/// Note: This function will deadlock if the point... |
use near_contract_standards::storage_management::{
StorageBalance, StorageBalanceBounds, StorageManagement,
};
use near_sdk::{
assert_one_yocto,
borsh::{self, BorshDeserialize, BorshSerialize},
collections::UnorderedMap,
env::{self},
json_types::{ValidAccountId, U128},
log, AccountId, Balanc... |
use crate::config::TextStyle;
use crate::font::{FontConfiguration, GlyphInfo};
use ::window::bitmaps::atlas::{Atlas, Sprite};
use ::window::bitmaps::{Image, ImageTexture, Texture2d};
use ::window::glium::backend::Context as GliumContext;
use ::window::glium::texture::SrgbTexture2d;
use ::window::*;
use failure::Fallibl... |
//! Paging subsystem. *Note: uses recursive mapping.*
//!
//! Was extremely ripped off from <NAME>'s tutorials, because I didn't feel like writing
//! a paging system off the top of my head. Nowadays, it's a bit more _mine_.
#![cfg_attr(feature = "cargo-clippy", allow(unreadable_literal))]
use core::ops::{Deref, Dere... |
use std::sync::{Arc, Mutex};
use eframe::{egui, epi};
#[derive(Debug, PartialEq, Copy, Clone)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
enum Method {
Get,
Post,
}
enum Download {
None,
InProgress,
Done(ehttp::Result<ehttp::Response>),
}
pub struct DemoApp {
... |
//! dep-expand
//!
//! Expand cargo dependencies during build.
//!
//! # Example expand `anyhow` dependency
//!
//! ```no_run
//! # use dep_expand::Expander;
//! let expander = Expander::default();
//! let output = expander
//! .expand("anyhow").unwrap();
//! ```
//!
use anyhow::Context;
use cargo_metadata::{C... |
#[macro_use]
extern crate clap;
use digest::{Digest, FixedOutput};
use md5::Md5;
use sha1::Sha1;
use sha2::{Sha256, Sha512};
use sha3::{Sha3_256, Sha3_512};
use std::fmt::Write;
use std::io::{BufRead, BufReader};
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
static HASH_SIZE: phf::OrderedMap<&'st... |
#![warn(missing_docs)]
#![warn(rust_2018_idioms)]
#![warn(clippy::pedantic)]
#![warn(clippy::cargo)]
#![warn(clippy::nursery)]
#![deny(unsafe_code)]
//! A library providing the written english form of a number.
//!
//! # Example
//!
//! ```rust
//! use numeral::Cardinal;
//!
//! let n = 127;
//! println!("{} is writte... |
#[macro_use]
extern crate log;
use std::panic;
use std::convert::TryFrom;
use wasm_bindgen::prelude::*;
use cfg_if::cfg_if;
use hex;
use beserial::{Serialize};
use nimiq_keys::{Address, PrivateKey, PublicKey, KeyPair};
use nimiq_utils::key_rng::SecureGenerate;
use nimiq_hash::{Blake2bHash, Hash};
use nimiq_primitives... |
use std::any::Any;
use std::fmt::Debug;
use std::ops::Range;
use gfx_hal::{Backend, MemoryTypeId};
use gfx_hal::memory::Requirements;
use {MemoryAllocator, MemoryError, MemorySubAllocator};
use arena::{ArenaAllocator, ArenaBlock};
use block::{Block, RawBlock};
use chunked::{ChunkedAllocator, ChunkedBlock};
use root::... |
/*!
This crate provides a trait-based implementation of the DOM with minimal changes to the style
and semantics defined in the Level 2 specification. The specific mapping from the IDL in the
specification is described [below](#idl-to-rust-mapping), however from a purely style point of
view the implementation has the fo... |
#![doc(
html_root_url = "https://cmsd2.github.io/rust-docs/schemamama_rusqlite/schemamama_rusqlite/"
)]
#[allow(unused_imports)]
use log::warn;
use rusqlite::{
Connection as SqliteConnection, Error as SqliteError, Result as SqliteResult, Row as SqliteRow,
};
use schemamama::{Adapter, Migration, Version};
use s... |
use std::collections::BTreeMap;
use rustc_serialize::json::{Json, ToJson};
pub struct Payload {
/// The standard APNS payload data.
pub aps: APS,
/// Custom data to be handled by the app.
pub custom: Option<CustomData>,
}
pub struct CustomData {
/// The JSON root key for app specific custom data.... |
use std::collections::{BTreeMap, VecDeque};
use std::io;
use std::net::{IpAddr, SocketAddr};
use std::rc::Rc;
use std::time::{Duration, Instant};
use bincode::{deserialize, serialize};
use bytes::{BufMut, Bytes, BytesMut};
use fnv::{FnvHashMap, FnvHashSet};
use log::debug;
use multiaddr::Multiaddr;
use rand::seq::Slic... |
use std::str::Chars;
use std::iter::Peekable;
pub struct Lexer<'a> {
input: Peekable<Chars<'a>>,
}
impl<'a> Lexer<'a> {
pub fn new(input: &'a str) -> Lexer<'a> {
Lexer {
input: input.chars().peekable(),
}
}
fn read_char(&mut self) -> Option<char> {
self.input.next(... |
use crate::TypeExt;
use inflector::Inflector;
use proc_macro2::TokenStream;
use quote::quote;
use syn::{spanned::Spanned, Error, FnArg, Ident, Item, ItemFn, LitStr, ReturnType, Type};
pub(crate) fn indexing(item: Item) -> TokenStream {
match &item {
Item::Fn(f) => indexing_fn(f),
_ => Error::new(it... |
use std::io::Read;
use anyhow::{Context, Result};
use itertools::{iproduct, Itertools};
use lazy_static::lazy_static;
use regex::Regex;
use aoc2021::util::input_file;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
struct TargetArea {
x: (i32, i32),
y: (i32, i32),
}
fn main() -> Result<()> {
let target_are... |
extern crate reqwest;
extern crate scraper;
extern crate jstime_core;
extern crate pyo3;
use pyo3::prelude::*;
use jstime_core::JSTime;
use std::iter::FromIterator;
use scraper::{Html, Selector};
use pyo3::wrap_pyfunction;
fn eval_js(scope: &mut JSTime, str_script: &str) -> String {
scope.run_script(&str_script,... |
use std::{collections::HashMap, unreachable};
use proc_macro2::Span;
use syn::{parse::{Parse, ParseStream}, punctuated::Punctuated, spanned::Spanned};
use crate::{Asset, AssetSettings, Input};
impl Parse for Input {
fn parse(input: ParseStream) -> Result<Self, syn::Error> {
// Parse attributes
l... |
use chargrid_render::*;
#[cfg(feature = "serialize")]
use serde::{Deserialize, Serialize};
/// The characters comprising a border. By default, borders are made of unicode
/// box-drawing characters, but they can be changed to arbitrary characters via
/// this struct.
#[cfg_attr(feature = "serialize", derive(Serialize,... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{FullNode, HealthCheckError, LocalVersion, Node, NodeExt, Validator, Version};
use anyhow::{anyhow, Context, Result};
use diem_config::config::NodeConfig;
use diem_logger::{debug, warn};
use diem_sdk::{
client::BlockingCl... |
//! Test clustering behavior.
mod fixtures;
use std::time::Duration;
use actix::prelude::*;
use actix_raft::metrics::{RaftMetrics, State};
use futures::sync::oneshot;
use fixtures::{
RaftTestController, Node, setup_logger,
dev::{ExecuteInRaftRouter, RaftRouter, Register},
};
/// Basic lifecycle tests for a... |
use crate::{
db::{self, models},
prelude::*,
timer::Interval,
utils,
};
use chrono::{DateTime, Duration, Utc};
use failure::Error;
use hashbrown::HashMap;
use parking_lot::RwLock;
use std::{collections::VecDeque, sync::Arc, time};
use tokio_threadpool::ThreadPool;
use diesel::prelude::*;
struct Entry ... |
use crypto_box::{
self as cbox,
aead::{generic_array::typenum::Unsigned, Aead},
};
use ursa::blake2::{digest::Input, digest::VariableOutput, VarBlake2b};
use crate::error::{ConversionError, UnexpectedError, ValidationError};
use crate::keys::{KeyType, PrivateKey};
use crate::random::random_vec;
const CBOX_NON... |
//! Description:
//!
//! Handle sound playback. All very simply sound effects and the music for the inpending
//! invasion.
//!
//! Copyright © 2020 <NAME>. All rights reserved.
extern crate rodio;
use std::sync::Arc;
use std::io::Read;
use std::io;
use rodio::{Device, Sink, Source};
/// Static sound data stored... |
// Copyright 2013 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 ... |
use smithay_client_toolkit::{
default_environment,
environment::SimpleGlobal,
init_default_environment,
output::{with_output_info, OutputInfo},
reexports::{
calloop,
client::protocol::{wl_output, wl_shm, wl_surface},
client::{Attached, Main},
protocols::wlr::unstable:... |
use super::HttpTarget;
use futures::{future, TryFutureExt};
use linkerd_app_core::{
dns, profiles,
proxy::http,
svc::{self, layer},
tls, Error, NameAddr,
};
use linkerd_app_inbound::{GatewayDomainInvalid, GatewayIdentityRequired, GatewayLoop};
use linkerd_app_outbound as outbound;
use std::{
future:... |
#![forbid(unsafe_code)]
#![deny(clippy::all)]
use clap::Parser;
use itertools::iproduct;
use palette::{Hsla, Hsva, Hwba, IntoColor, Srgba};
use std::str::FromStr;
use yozuk_helper_preprocessor::{TokenMerger, TokenParser};
use yozuk_sdk::prelude::*;
pub const ENTRY: SkillEntry = SkillEntry {
model_id: b"fYemWbybyq... |
use crate::game_opts::GameOpts;
use anyhow::Result;
use crossterm::{
cursor,
style::{self, style, Color, Stylize},
terminal, QueueableCommand,
};
use rand::Rng;
use std::{
collections::{HashMap, HashSet},
io::{Stdin, Stdout, Write},
};
use wurds::{
row::LetterVisibility,
wurds_game::{GameSta... |
//! Functions to exercise the parser from the command line.
use std::cell::RefCell;
use std::ffi::OsStr;
use std::fs;
use std::io;
use std::io::prelude::*; // flush() at least
use std::path::Path;
use std::rc::Rc;
extern crate jsparagus_ast as ast;
extern crate jsparagus_emitter as emitter;
extern crate jsparagus_int... |
// Copyright (c) EoE & Nephren 2020-2021. All rights reserved.
use failure::{Error, bail, format_err};
use half::f16;
use vapoursynth::prelude::*;
use vapoursynth::core::CoreRef;
use vapoursynth::plugins::{Filter, FrameContext};
use vapoursynth::video_info::VideoInfo;
use crate::common::*;
use crate::{PLUGIN_NAME, pro... |
//! Performs validation and correction of GTIN-13 and EAN-13 codes.
use utils;
/// Errors that make GTIN-13 correction impossible.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum FixError {
/// The provided string contains non-ASCII characters.
NonAsciiString,
/// The provided code was too lon... |
use std::error::Error;
use std::path::PathBuf;
use iced::{executor, Application, Clipboard, Command, Element, Settings, Subscription};
use tracing_subscriber::filter::EnvFilter;
extern crate serde;
extern crate serde_json;
mod app;
mod conversion;
mod installer;
mod revault;
mod revaultd;
mod ui;
use app::{
conf... |
//
//
// This file is a part of Aleph
//
// https://github.com/nathanvoglsam/aleph
//
// MIT License
//
// Copyright (c) 2020 Aleph Engine
//
// 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 Softwar... |
use std::prelude::v1::*;
use matrix::{Matrix, BaseMatrix, BaseMatrixMut, MatrixSlice, MatrixSliceMut};
use error::{Error, ErrorKind};
use std;
use std::any::Any;
use libnum::Float;
impl<T> Matrix<T>
where T: Any + Float
{
/// Converts matrix to bidiagonal form
///
/// Returns (B, U, V), where B is bi... |
/// SMCd is the SummerCash node daemon.
extern crate clap;
#[macro_use]
extern crate log;
extern crate env_logger;
extern crate tokio;
use failure::Error;
use libp2p::{Multiaddr, PeerId};
use summercash::{
core::{sys::system::System, types::genesis::Config},
p2p::{
client::Client,
network, pe... |
// Copyright (c) 2019 <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 ... |
// Copyright (c) SimpleStaking, Viable Systems and Tezedge Contributors
// SPDX-License-Identifier: MIT
use std::collections::{BTreeMap, HashMap};
use std::ops::Range;
use serde::{Deserialize, Serialize};
use thiserror::Error;
use crypto::hash::*;
/// Possible errors for schema
#[derive(Debug, Error)]
pub enum Sche... |
use forge_engine::vulkan::{Engine, EngineCreateInfo};
use forge_engine::vulkan::renderer;
use forge_engine::vulkan::renderer::instance_manager::{InstanceManager, UBO};
use std::ffi::CString;
use winit::event_loop::{EventLoop, ControlFlow};
use winit::platform::unix::WindowExtUnix;
use winit::event::{Event, WindowEvent,... |
// 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
//! Push-buttons
use std::fmt::{self, Debug};
use std::rc:... |
use std::fmt;
use std::rc::Rc;
use som_core::bytecode::Bytecode;
use crate::class::Class;
use crate::compiler::Literal;
use crate::frame::FrameKind;
use crate::interpreter::Interpreter;
use crate::primitives;
use crate::primitives::PrimitiveFn;
use crate::universe::Universe;
use crate::value::Value;
use crate::{SOMRe... |
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
pub(crate) mod codegen;
pub(crate) mod doc;
pub(crate) mod ensures;
pub(crate) mod invariant;
pub(crate) mod parse... |
#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use]
extern crate rocket;
extern crate rocket_multipart_form_data;
extern crate serde;
use rocket::State;
use rocket::http::ContentType;
use rocket::Data;
use rocket_contrib::json::Json;
use rocket_multipart_form_data::{
MultipartFormData, MultipartFormDataField... |
#![feature(braced_empty_structs, custom_derive)]
#![feature(plugin)]
#![plugin(serde_macros)]
#![warn(missing_docs)]
#![doc(html_logo_url = "https://rusticcoder.github.io/images/photo.jpg",
html_favicon_url = "https://rusticcoder.github.io/favicon.ico",
html_root_url = "https://rusticcoder.github.io/")]
... |
//! Desugarer maintains state during desugar passes.
use super::desugarable::{Content, Desugarable};
use crate::{
common::{
environment::DefaultingEnvironment,
sourcemap::{Smid, SourceMap},
},
core::{
doc::DeclarationDocumentation, error::CoreError, expr::*, target::*, unit::Translat... |
// Copyright 2020-2021 the Deno authors. All rights reserved. MIT license.
use super::{Context, LintRule, ProgramRef, DUMMY_NODE};
use crate::swc_util::StringRepr;
use swc_common::Span;
use swc_ecmascript::ast::CallExpr;
use swc_ecmascript::ast::Expr;
use swc_ecmascript::ast::ExprOrSuper;
use swc_ecmascript::ast::Paren... |
//! `i686`'s Streaming SIMD Extensions 4a (`SSE4a`)
use crate::{
core_arch::{simd::*, x86::*},
mem::transmute,
};
#[cfg(test)]
use stdsimd_test::assert_instr;
#[allow(improper_ctypes)]
extern "C" {
#[link_name = "llvm.x86.sse4a.extrq"]
fn extrq(x: i64x2, y: i8x16) -> i64x2;
#[link_name = "llvm.x8... |
// 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::{Context as _, Error},
argh::FromArgs,
fidl::endpoints::{ClientEnd, RequestStream, ServiceMarker},
fidl_fuchsia_overnet::{
... |
// http://rosettacode.org/wiki/Knapsack_problem/0-1
use std::cmp::max;
use std::iter::repeat;
// This struct is used to store our items that we want in our knap-sack.
//
// Show is for displaying the fields.
// allow(dead_code) removes a dead code warning when the name of the struct is not
// used (as in this case h... |
use std::collections::{btree_map, BTreeMap};
use crate::component::{Component, ComponentTypeID};
use crate::component_data::ComponentValueRef;
use crate::entity::EntityID;
use crate::snapshot::{Edit, EditAction};
#[derive(Clone, Debug)]
enum ComponentAction {
Set(usize, usize),
Remove,
}
/// A command buffer... |
use super::classify::{self, HttpOrGrpcClassification};
use axum::extract::{ConnectInfo, MatchedPath};
use http::{header, uri::Scheme, Method, Request, Response, Version};
use opentelemetry::trace::TraceContextExt;
use std::{borrow::Cow, net::SocketAddr, time::Duration};
use tower_http::{
request_id::RequestId,
... |
use crate::{renderer::render_error, MiniserveConfig};
use actix_web::{
body::AnyBody,
dev::{ResponseHead, Service, ServiceRequest, ServiceResponse},
http::{header, StatusCode},
HttpRequest, HttpResponse, ResponseError,
};
use futures::prelude::*;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum C... |
use eyre::WrapErr;
use std::{
fs::File,
io::{Read, Write},
path::Path,
};
use syn::{parse_quote, ForeignItem, ForeignItemFn, ForeignItemStatic, Item};
const ADDITIONAL_FUNCTIONS_TO_STUB: [&'static str; 6] = [
"varsize_any",
"query_tree_walker",
"expression_tree_walker",
"sigsetjmp",
"si... |
#[macro_use]
extern crate lazy_static;
use std::fmt::Display;
use std::time::Instant;
use regex::Regex;
use aoc_2020::get_input;
lazy_static! {
static ref HGT_RGX: Regex = Regex::new(r"(\d+)(cm|in)").unwrap();
static ref HCL_RGX: Regex = Regex::new(r"#[0-9a-f]{6}").unwrap();
static ref VALID_ECL: Vec<&'... |
#![allow(dead_code)]
use crate::token::*;
use crate::node::*;
use crate::cache::Cache;
use isaac::{Arena, Node, NodeId};
use std::rc::Rc;
#[macro_export]
macro_rules! make {
($builder:expr => token { $text:expr, $start:expr $(,)? }) => {{
$builder.make_token($text, $start)
}};
($builder:expr => un... |
use ppu::{Color, SCREEN_BUFFER_SIZE, SCREEN_HEIGHT, SCREEN_WIDTH};
use screen::Screen;
use sdl2::{Sdl, VideoSubsystem};
use sdl2::pixels::PixelFormatEnum;
use sdl2::rect::Rect;
use sdl2::render::{Renderer, Texture};
#[allow(dead_code)]
pub struct SDLScreen<'a> {
video: VideoSubsystem,
renderer: Rende... |
mod receiver_stream;
#[cfg(test)]
mod receiver_test;
use super::*;
use crate::error::Error;
use crate::*;
use receiver_stream::ReceiverStream;
use anyhow::Result;
use std::collections::HashMap;
use std::time::{Duration, SystemTime};
use tokio::sync::{mpsc, Mutex};
use waitgroup::WaitGroup;
pub(crate) struct Receiver... |
// 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 alloc::vec::Vec;
use core::fmt::{self, Display, Formatter};
use bitflags::bitflags;
#[cfg(feature = "datasize")]
use datasize::DataSize;
use rand::{
distributions::{Distribution, Standard},
Rng,
};
use serde::{de::Error as SerdeError, Deserialize, Deserializer, Serialize, Serializer};
use crate::bytesrepr... |
use super::AnyPositionConstraint;
use crate::dynamics::{IntegrationParameters, RigidBodySet};
use crate::geometry::ContactManifold;
use crate::math::{
AngularInertia, Isometry, Point, Real, Rotation, SimdReal, Translation, Vector,
MAX_MANIFOLD_POINTS, SIMD_WIDTH,
};
use crate::utils::{WAngularInertia, WCross, W... |
use std::path::Path;
#[cfg(feature = "encryption")]
use bonsaidb_core::document::KeyId;
use bonsaidb_core::{permissions::Permissions, schema::Schema};
#[cfg(feature = "compression")]
use bonsaidb_local::config::Compression;
use bonsaidb_local::config::{Builder, KeyValuePersistence, StorageConfiguration};
#[cfg(feature... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.