text stringlengths 3.35k 22.8k |
|---|
//! Redis job queue and worker crate.
//!
//! # Enqueue jobs
//!
//! ```rust
//! use std::time::Duration;
//! use std::thread::sleep;
//!
//! let queue = rjq::Queue::new("redis://localhost/", "rjq");
//! let mut uuids = Vec::new();
//!
//! for _ in 0..10 {
//! sleep(Duration::from_millis(100));
//! uuids.push(q... |
// Copyright 2014 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... |
use std::collections::HashMap;
use std::fmt::{Debug, Formatter, Error};
use std::path::PathBuf;
use std::convert::From;
use sdl2::ttf::{Sdl2TtfContext, Font, GlyphMetrics};
use sdl2::render::{Renderer, Texture};
use sdl2::rect::Rect;
use sdl2::pixels::{PixelFormatEnum, Color};
use sdl2::surface::Surface;
const GLYPH_... |
// plotter.rs Vector path plotter.
//
// Copyright (c) 2017-2021 <NAME>
//
use crate::fig::Fig;
use crate::geom::{float_lerp, WidePt};
use crate::path::{FillRule, PathOp};
use crate::stroker::{JoinStyle, Stroke};
use pix::chan::{Ch8, Linear, Premultiplied};
use pix::el::Pixel;
use pix::Raster;
use pointy::{Pt, Tr... |
use std::fmt;
use std::str::Chars;
use self::LiteralKind::{Char, Int, Str};
use self::Symbol::*;
use self::TokenKind::*;
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum Symbol {
SemiColon,
Comma,
Dot,
Plus,
Minus,
Star,
Slash,
Percentage,
Caret,
Exclamation,
Question,
... |
mod utils;
use wasm_bindgen::prelude::*;
use js_sys::Array;
use rand::Rng;
// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
// allocator.
#[cfg(feature = "wee_alloc")]
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
#[wasm_bindgen]
extern {
fn alert(s: ... |
#![no_main]
#![no_std]
use core::sync::atomic::{AtomicUsize, Ordering};
use defmt_rtt as _;
use panic_probe as _;
mod gfx;
mod io;
#[rtic::app(
device = stm32f1xx_hal::pac,
dispatchers = [SPI1, SPI2]
)]
mod app {
use crate::{gfx, io};
use cortex_m::asm;
use defmt::{assert, debug, error, info, war... |
pub mod address_space;
pub mod handle_table;
pub(super) mod process;
pub mod list;
pub mod modules;
use crate::{Error, RekallProfile, Result};
use crate::{
EPROCESS, IA32_CSTAR, IA32_LSTAR, KPROCESS, KUSER_SHARED_DATA, LLP64_ULONG_SZ, PAGE_SHIFT,
PTR_SZ,
};
use address_space::{IA32eAddrT, IA32eVirtual, KVMIP... |
//! Asynchronous HTTP integration for _body-image_.
//!
//! The _body-image-futio_ crate integrates _body-image_ with
//! _futures_, _http_, _hyper_, and _tokio_ for both client and server
//! use.
//!
//! * Trait [`RequestRecorder`] extends `http::request::Builder` for recording
//! a [`RequestRecord`] of various bo... |
#![feature(
arbitrary_self_types, // Unfortunately this is required for methods on Gc refs
)]
//! Implementation of the binary trees benchmark, using a low level binding to the MPS.
//!
//! See [BinaryTrees] for more information.
use slog::{Logger, Drain, o};
use std::cell::Cell;
use mps::format::{RawFormatMethods, Sca... |
use std::cmp::{min};
use rand::Rng;
use rand::rngs::ThreadRng;
use crate::grid::{Grid, Particle, ParticleGrid, ParticleType};
macro_rules! random_eval {
($rng:expr, $x:expr, $y:expr) => {
if $rng.gen() {
$x
$y
} else {
$y
$x
}
};
}
macro... |
// Copyright 2017 <NAME>
//
// 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 to those terms.
... |
// See https://www.iana.org/assignments/kerberos-parameters/kerberos-parameters.xhtml
use std::fmt;
/// Address type
#[derive(Clone, Copy, PartialEq, Eq)]
pub struct AddressType(pub i32);
#[rustfmt::skip]
impl AddressType {
pub const IPV4 : AddressType = AddressType(2);
pub const DIRECTIONAL : Add... |
//!
use chart_builder::*;
use chart_builder::window::*;
use chart_builder::chart_prop::AxisType;
use chart_builder::axis_prop::calc_axis_props;
use chart_builder::axis_prop::calc_data_range;
use chart_builder::axis_prop::percentile;
use chart_builder::axis_drawer::*;
pub(in chart_builder) mod histogram;
pub(in cha... |
use crate::unit::Derived;
use crate::units;
pub const MINUTE: u32 = 1021968384;
pub const HOUR: u32 = 1021968385;
pub const DAY: u32 = 1021968387;
pub const WEEK: u32 = 1021968388;
pub const MONTH: u32 = 1021968389;
pub const YEAR: u32 = 1021972480;
pub const DECADE: u32 = 1021976576;
pub const CENTURY: u32 = 10219806... |
//! Functions used to generate the documentation for Rust Crates.
#![warn(missing_debug_implementations)]
#![warn(missing_docs)]
#[macro_use]
extern crate failure;
#[cfg_attr(test, macro_use)]
#[cfg(test)]
extern crate indoc;
#[macro_use]
extern crate log;
#[cfg_attr(test, macro_use)]
extern crate quote;
#[macro_use]... |
use crate::entity::*;
use crate::entity::*;
use crate::hitbox::*;
use crate::level::*;
use crate::render::*;
use crate::resource::*;
use crate::texture_id::*;
use crate::utility::*;
use serde::{Deserialize, Serialize};
use rand::Rng;
use num_traits::FromPrimitive;
use sdl2::pixels::Color;
pub cons... |
// Implementation of the read-write task;
mod rw;
// Implementation of `ShardsPending`.
mod pending;
// Definition of `Batch`.
mod batch;
// Implementation of a batcher.
mod batcher;
// Implementation of an unbatcher.
mod unbatcher;
use crate::client::{Client, ClientData, Workload};
use crate::command::{Command, C... |
use gst::prelude::*;
use gstreamer as gst;
use gstreamer_app as gst_app;
use iced::{image as img, Command, Image, Subscription};
use num_traits::ToPrimitive;
use std::sync::{mpsc, Arc, Mutex};
use std::time::Duration;
use thiserror::Error;
/// Position in the media.
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialO... |
/* artifact: the requirements tracking tool made for developers
* Copyright (C) 2018 <NAME> <@vitiral, <EMAIL>>
*
* The source code is Licensed under either of
*
* * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or
* http://www.apache.org/licenses/LICENSE-2.0)
* * MIT license ([LICENSE-MIT](L... |
use serde::{Deserialize, Serialize};
use diff;
use split::split_romaji;
pub fn to_romaji(input: &str) -> String {
split_romaji(input).concat()
}
/// Result of matching a kana and romaji string.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Match {
/// True if `kana` and `romaji` match.
pub i... |
use super::events::*;
use super::*;
use crate::hal::*;
use crate::prelude::{BTerm, GameState, BACKEND_INTERNAL, INPUT, BEvent};
use crate::{clear_input_state, BResult, gl_error_wrap};
use glow::HasContext;
use std::cell::RefCell;
use std::rc::Rc;
use bracket_geometry::prelude::Point;
use instant::Instant;
use wasm_bind... |
#![crate_name = "day16"]
//! ## --- Day 16: Ticket Translation ---
//!
//! As you're walking to yet another connecting flight, you realize that one of the legs of your re-routed trip coming up is on a high-speed train. However, the train ticket you were given is in a language you don't understand. You should probably ... |
// Copyright (c) 2017, <NAME>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this
// list of conditions... |
//! Solvers for the linear schematic railway drawing problem.
//!
//! For now, this module contains only one algorithm, LevelsSat,
//! but could offer alternatives in the future.
//!
use crate::model::*;
use std::collections::HashMap;
use ordered_float::OrderedFloat;
use crate::levelssat;
use crate::edgeorder;
use log... |
use crate::Animatable;
use gee::en::Num as _;
// const UNIFORM_ALPHA: f64 = 0.0;
const CENTRIPETAL_ALPHA: f64 = 0.5;
// const CHORDAL_ALPHA: f64 = 1.0;
const TANGENT_EPSILON: f64 = 1e-5;
pub fn catmull_rom_value<V: Animatable>(
p0: &V,
p1: &V,
p2: &V,
p3: &V,
t0: f64,
t1: f64,
t2: f64,
... |
/*!
The `Page` class deals with operations done on pages, like editing.
*/
#![deny(
missing_docs,
missing_debug_implementations,
missing_copy_implementations,
trivial_casts,
trivial_numeric_casts,
unsafe_code,
unstable_features,
unused_import_braces,
unused_qualifications
)]
use cr... |
use std::convert::TryFrom;
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use git_config::{parser::Parser, File};
fn git_config(c: &mut Criterion) {
c.bench_function("GitConfig large config file", |b| {
b.iter(|| File::try_from(black_box(CONFIG_FILE)).unwrap())
});
}
fn parse... |
use fog_pack::{document::*, schema::NoSchema};
use rand::Rng;
use std::error::Error;
use std::mem;
use std::ops;
pub trait Generate {
fn generate<R: Rng>(rng: &mut R) -> Self;
}
impl Generate for () {
fn generate<R: Rng>(_: &mut R) -> Self {}
}
impl Generate for bool {
fn generate<R: Rng>(rng: &mut R) ->... |
#![doc = "generated by AutoRust 0.1.0"]
#[cfg(feature = "package-2021-07-01")]
pub mod package_2021_07_01;
#[cfg(all(feature = "package-2021-07-01", not(feature = "no-default-version")))]
pub use package_2021_07_01::{models, operations};
#[cfg(feature = "package-2021-04-01")]
pub mod package_2021_04_01;
#[cfg(all(featu... |
// Copyright 2022 <NAME>
//
// 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 to those terms... |
#![allow(clippy::cast_lossless)]
pub (crate) fn pack_u64(num : u64) -> u64
{
num
}
pub (crate) fn pack_f64(num : f64) -> u64
{
num.to_bits()
}
pub (crate) const NOP : u64 = 0x00;
pub (crate) const PUSHFLT : u64 = 0x10;
pub (crate) const PUSHSTR : u64 = 0x11;
pub (crate) const PUSHNULL : u64 = 0x12;
pub (cra... |
use futures::prelude::Stream;
use p2p::{
builder::ServiceBuilder,
context::{ServiceContext, SessionContext},
error::Error,
multiaddr::Multiaddr,
service::{Service, ServiceError, ServiceEvent},
traits::{ProtocolMeta, ServiceHandle, ServiceProtocol},
ProtocolId, SecioKeyPair, SessionId, Sessio... |
// simple rust interface to some of the PYNQ peripherals
extern crate libc;
use std;
use std::ffi::CString;
use std::ops::{Index, IndexMut, Drop};
use std::io::{Read, Write};
use std::fs::File;
#[derive(Copy, Clone, Debug)]
pub struct Clock { pub div0 : u32, pub div1 : u32 }
pub fn load_bitstream(filename: &str, clo... |
// Copyright 2018 The Exonum Team
//
// 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 i... |
// Copyright (c) SimpleStaking, Viable Systems and Tezedge Contributors
// SPDX-License-Identifier: MIT
use std::{
borrow::Cow,
collections::hash_map::DefaultHasher,
convert::{TryFrom, TryInto},
hash::Hasher,
io::Read,
};
use crate::{
chunks::ChunkedVec,
gc::{Entry, SortedMap},
kv_stor... |
use std::cmp;
use crate::utils::{read_u16};
use crate::defines::{FRAME_BUFFER_WIDTH, FRAME_BUFFER_HEIGHT};
const MAX_NUM_VERTICES: usize = 50;
pub fn draw_poly_to_buffer(poly: &mut Poly, poly_buffer: &[u8], offset: u16, x: i16, y: i16, zoom: i16, color_idx: u8, output_pages: &mut [Vec<u8>; 4], backbuffer_page_idx: us... |
use crate::Context;
use crate::core::consts::colors;
use std::collections::HashMap;
use std::{fmt, fmt::{Debug, Formatter}};
use std::error::Error as StdError;
use std::sync::Arc;
use super::args::Args;
use tracing::{event, Level};
use twilight_model::channel::Message;
use twilight_model::guild::Permissions;
use twilig... |
#![allow(dead_code)]
mod aggregates;
mod aliases;
pub(crate) mod analyze;
mod bulk;
mod cat;
mod count;
mod create_index;
mod delete_index;
mod expunge_deletes;
mod get_document;
mod get_mapping;
mod get_settings;
mod profile_query;
mod put_mapping;
mod refresh_index;
mod update_settings;
pub mod aggregate_search;
pu... |
use crate::Message;
use anyhow::{anyhow, Context, Result};
use cached::{proc_macro::cached, Return, TimedCache};
use ssh2::{KeyboardInteractivePrompt, Prompt, Session, Stream};
use std::{
fmt::Debug,
io::{BufRead, BufReader, Read, Write},
net::{Ipv4Addr, TcpStream},
};
const DEFAULT_PORT: u16 = 5022;
const... |
use proc_macro2::{Ident, TokenStream as TokenStream2};
use quote::{quote, ToTokens};
use syn::{
bracketed, parenthesized,
parse::Parse,
punctuated::Punctuated,
token::{Bracket, Comma},
Error, LitInt, LitStr, Token,
};
use crate::{parse_utils, AnyValue, Type};
use super::{property::Property, Conten... |
/// --- Day 8: Handheld Halting ---
/// Your flight to the major airline hub reaches cruising altitude without incident. While you
/// consider checking the in-flight menu for one of those drinks that come with a little umbrella,
/// you are interrupted by the kid sitting next to you.
///
/// Their handheld game consol... |
#[cfg(target_arch = "x86")]
use std::arch::x86::*;
#[cfg(target_arch = "x86_64")]
use std::arch::x86_64::*;
use std::alloc;
pub fn encode(nuc: &[u8]) -> Vec<u64> {
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
{
if is_x86_feature_detected!("avx2") {
return unsafe { encode_movem... |
use crate::internals::*;
use proc_macro2::Span;
use proc_macro2::TokenStream;
use quote::quote_spanned;
use quote::{quote, ToTokens};
use syn::spanned::Spanned as _;
use syn::Meta::*;
use syn::MetaNameValue;
use syn::NestedMeta::*;
/// Parsed `#[rune(..)]` field attributes.
#[derive(Default)]
pub(crate) struct FieldAt... |
# and ... |
extern crate libc;
use libc::*;
use std::ptr;
use std::default::Default;
use std::ffi::CStr;
use std::ffi::CString;
use std::collections::hash_map::HashMap;
use std::fmt;
// #define MFSTYPENAMELEN 16 length of fs type name including null
// #define MAXPATHLEN 1024
// #define MNAMELEN MAXPATHLEN
// s... |
// Currently the `VMComponentContext` allocation by field looks like this:
//
// struct VMComponentContext {
// magic: u32,
// may_enter: u8,
// may_leave: u8,
// store: *mut dyn Store,
// lowering_anyfuncs: [VMCallerCheckedAnyfunc; component.num_lowerings],
// lowerings: [VMLowering; comp... |
use anyhow::Result;
use log::debug;
use thiserror::Error;
pub mod imports;
pub mod rsrc;
use crate::{
arch::Arch,
aspace::RelativeAddressSpace,
module::{Module, Permissions, Section},
util, RVA, VA,
};
#[derive(Error, Debug)]
pub enum PEError {
#[error("format not supported: {0}")]
FormatNotS... |
//! OTLP exporter builder and configurations.
//!
//! OTLP supports sending data via different protocols and formats.
#[cfg(feature = "grpc-sys")]
use crate::exporter::grpcio::GrpcioExporterBuilder;
#[cfg(feature = "http-proto")]
use crate::exporter::http::HttpExporterBuilder;
#[cfg(feature = "tonic")]
use crate::expo... |
#![warn(missing_docs)]
//! Entangled provides thread pool based on the `async-executor` crate to spawn async futures on.
//!
//! It's main selling point is the "scoped spawn" functionality, which is essentially spawning
//! futures from the calling thread, which have access to the stack of the calling thread and joins
... |
use getset::{CopyGetters, Getters};
use super::header::PacketHeader;
#[derive(Debug, Copy, Clone, CopyGetters)]
#[getset(get_copy = "pub")]
pub struct FastestLap {
vehicle_idx: u8,
lap_time: u32,
}
impl FastestLap {
pub(crate) fn new(vehicle_idx: u8, lap_time: u32) -> Self {
Self {
ve... |
use super::{Page, PageAllocatorInner, PageInner, ALLOCATED_PAGES};
use cvt::cvt_r;
use ic_sys::{page_bytes_from_ptr, PageBytes, PageIndex, PAGE_SIZE};
use libc::{c_void, close, ftruncate64, off_t};
use nix::sys::memfd::{memfd_create, MemFdCreateFlag};
use nix::sys::mman::{mmap, munmap, MapFlags, ProtFlags};
use std::ff... |
use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize};
use near_sdk::collections::{LookupMap, UnorderedMap, UnorderedSet};
use near_sdk::json_types::U128;
use near_sdk::serde::{Deserialize, Serialize};
use near_sdk::{env, log, near_bindgen, AccountId, PanicOnDefault, Promise};
use hex::encode;
use std::convert:... |
//! A CRDT that stores mutable text
mod text_edit;
use self::text_edit::TextEdit;
use dot::{Dot, Summary, SiteId};
use Error;
use tree::{self, Tree};
use sequence::uid::Uid;
use std::borrow::Cow;
use std::cmp::Ordering;
pub type LocalOp = TextEdit;
lazy_static! {
pub static ref START_ELEMENT: Element = Element{... |
use ndarray::{Array, ArrayBase};
use std::collections::HashMap;
use std::path::Path;
use wonnx::onnx::{ModelProto, TensorShapeProto, ValueInfoProto};
use wonnx::utils::{DataTypeError, ScalarType, Shape};
use wonnx::WonnxError;
use wonnx_preprocessing::image::{load_bw_image, load_rgb_image};
use wonnx_preprocessing::tex... |
// Copyright 2020 Adobe. All rights reserved.
// This file is licensed to you under the Apache License,
// Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
// or the MIT license (http://opensource.org/licenses/MIT),
// at your option.
// Unless required by applicable law or agreed to in writing,
// this softwa... |
mod function;
mod query;
#[cfg(not(feature = "std"))]
use alloc::{boxed::Box, format, vec, vec::Vec};
use crate::{
ast::{expression::*, types::*},
dialect::Dialect,
error::{parse_error, ParserError},
keywords::Keyword,
parser::Parser,
tokens::{Token, Word},
};
impl<'a, D: Dialect> Parser<'a, ... |
//! A simple, easy-to-use library for interfacing with the Mojang API.
//!
//! All functions involving IO in this crate are asynchronous and utilize
//! async/await. As a result, you will have to use nightly Rust until async/await
//! is stabilized.
//!
//! This crate provides a number of functions:
//!
//! * Server-si... |
//! Pipeline CRD.
//!
//! The code here is used to generate the actual CRD used in K8s. See examples/crd.rs.
use std::collections::BTreeSet;
use kube::CustomResource;
use regex::Regex;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use crate::crd::RequiredMetadata;
pub type Pipeline = PipelineCRD; /... |
//! DOM access methods, C interface.
#![allow(non_camel_case_types, non_snake_case)]
use capi::sctypes::*;
MAKE_HANDLE!(#[doc = "Element native handle."] HELEMENT, _HELEMENT);
MAKE_HANDLE!(#[doc = "Node native handle."] HNODE, _HNODE);
#[repr(C)]
#[derive(Debug, PartialOrd, PartialEq)]
/// Type of the result value ... |
use rand::Rng;
use std::collections::HashMap;
use std::fmt;
use strum_macros::EnumString;
#[derive(Debug, PartialEq, Eq)]
pub enum Week {
Week1,
Week2,
Week3,
Week4,
}
#[derive(Debug, Clone, Copy, Hash, PartialEq, Eq, EnumString)]
pub enum Lift {
/* Primary */
#[strum(serialize = "squat", ser... |
//! Sound context.
use crate::scene::graph::NodePool;
use crate::{
core::{
inspect::{Inspect, PropertyInfo},
pool::{Handle, Pool},
visitor::prelude::*,
},
resource::model::Model,
scene::{
node::Node,
sound::{self, effect::Effect, Sound},
},
utils::log::{L... |
//! Optimizations over R1CS
use super::*;
use crate::util::once::OnceQueue;
use fxhash::{FxHashMap as HashMap, FxHashSet as HashSet};
use log::debug;
struct LinReducer<S: Eq + Hash> {
r1cs: R1cs<S>,
uses: HashMap<usize, HashSet<usize>>,
queue: OnceQueue<usize>,
/// The maximum size LC (number of non-co... |
//! Solvent is a dependency resolver library written in rust.
//!
//! Solvent helps you to resolve dependency orderings by building up a dependency graph and then
//! resolving the dependences of some target node in an order such that each output depends only
//! upon the previous outputs.
//!
//! It is currently quite... |
// (C) COPYRIGHT 2018 TECHNOLUTION BV, GOUDA NL
// 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
// exce... |
use std::fs::{File, Metadata};
use std::ops::{Deref, DerefMut};
use std::path::{Path, PathBuf};
use std::time::{SystemTime, UNIX_EPOCH};
use std::{cmp, io};
#[cfg(unix)]
use std::os::unix::fs::MetadataExt;
use async_trait::async_trait;
use bitflags::bitflags;
use headers::{ETag, HeaderMapExt, IfMatch, IfModifiedSince... |
use hdk::{
error::ZomeApiResult,
error::ZomeApiError,
holochain_core_types::{
cas::content::Address,
entry::Entry,
json::JsonString,
link::LinkMatch
},
api::{
AGENT_ADDRESS, AGENT_ID_STR, CAPABILITY_REQ, DNA_ADDRESS, DNA_NAME
}
};
use std::convert::TryFr... |
mod colors;
mod utils;
use chrono::{DateTime, FixedOffset};
use getopts;
use std::io::{self, BufRead, Write};
use yaml_rust::{YamlEmitter, YamlLoader};
fn print_version(program: &str, as_json: bool) {
let fallback_version = format!("{}-dev", env!("CARGO_PKG_VERSION"));
let version = option_env!("VERSION").unw... |
mod pattern_designer;
mod toggle;
mod utils;
use crate::midi::MidiReader;
use crate::periodic_updater::PeriodicUpdater;
use crate::synth::{ChannelFeedback, Synth, PATTERN_LENGTH};
use crate::{audio::AudioManager, synth};
use cpal::traits::DeviceTrait;
use crossbeam::channel;
use eframe::egui::{emath, pos2, ComboBox, Re... |
use std::collections::HashMap;
use std::io::Cursor;
use std::mem;
use ash::vk;
use crate::extra::gltf_loader::{CollisionInformation, GltfModel, MaterialUbo, MeshVertex};
use crate::extra::{gltf_loader, Math};
use crate::offset_of;
use crate::shader_handlers::{Camera, TextureHandler};
use crate::vkwrapper::{
Buffer,... |
#![recursion_limit = "256"]
#[macro_use]
extern crate failure;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate stdweb;
#[macro_use]
extern crate yew;
mod pond;
use crate::pond::PondService;
use failure::Error;
use std::time::Duration;
use stdweb::unstable::TryInto;
use stdweb::Value;
use yew::prelud... |
use std::{
cmp::Ordering,
collections::HashMap,
fmt::{self, Display, Formatter},
hint::unreachable_unchecked,
io,
ops::Mul,
};
use nom::{
bytes::complete as bytes, character::complete as character, combinator as comb, multi,
sequence, IResult,
};
use crate::parse::NomParse;
#[derive(C... |
mod query_test;
mod transfer_completion;
use crate::config::{parse, MercuryConfig};
use crate::extensions::tests::{build_extension, MemoryDB};
use crate::extensions::{special_cells, udt_balance, Extension, ExtensionType};
use crate::rpc::rpc_impl::{BYTE_SHANNONS, STANDARD_SUDT_CAPACITY};
use crate::rpc::types::{
A... |
use {
batsmt_core::{ast, AstView},
batsmt_hast::{HManager, StrSymbolManager},
batsmt_theory::{self as theory, LitMapBuiltins},
batsmt_cc::{self as cc, CCView, HasConstructor, ConstructorView as CView, },
batsmt_solver as solver,
batsmt_pretty as pp,
batsmt_tseitin::{self as tseitin, View as... |
extern crate clap;
extern crate crypto;
extern crate cursive;
extern crate cursive_tree_view;
extern crate flate2;
extern crate rpassword;
extern crate sxd_document;
use clap::{App, Arg};
use cursive::traits::*;
use cursive::view::Margins;
use cursive::views::{
Button, Dialog, EditView, LinearLayout, ListView, OnE... |
use crate::option;
use crate::error;
use transcoding_rs as tc;
use encoding_rs as enc;
use std::io;
use std::io::Write;
use std::path;
pub fn transcode(reader: &mut dyn io::Read, writer: &mut dyn io::Write, encoding: &'static enc::Encoding, opt: &option::Opt, relative_path: &path::PathBuf)
-> Result<(), error::Er... |
/*
* Copyright 2021 Actyx AG
*
* 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 ... |
// Copyright(C) Facebook, Inc. and its affiliates.
use crate::error::{DagError, DagResult};
use crate::messages::Header;
use crate::primary::{PrimaryMessage, PrimaryWorkerMessage, Round};
use bytes::Bytes;
use config::{Committee, WorkerId};
use crypto::{Digest, PublicKey};
use futures::future::try_join_all;
use futures... |
use crate::{
api::{
Attributes, ContainerStatus, Isolation, Labels, MountPoint, NetworkEntry, Port, VolumeInfo,
},
errors::{Error, Result},
};
use hyper::header::HeaderMap;
use serde::{Deserialize, Serialize};
use std::{collections::HashMap, convert::TryFrom};
#[cfg(feature = "chrono")]
use {
... |
// Copyright 2019-2020 Twitter, Inc.
// Licensed under the Apache License, Version 2.0
// http://www.apache.org/licenses/LICENSE-2.0
use core::convert::TryFrom;
use core::str::FromStr;
#[cfg(feature = "bpf")]
use bcc::perf_event::*;
use rustcommon_metrics::*;
use serde_derive::{Deserialize, Serialize};
use strum::Pa... |
use cloudtruth_restapi::models::{ServiceAccount, ServiceAccountCreateResponse, User};
use once_cell::sync::OnceCell;
static DEFAULT_USER_VALUE: OnceCell<User> = OnceCell::new();
/// This is to provide a unified view of users that includes `ServiceAccount` and `User` properties.
#[derive(Clone, Debug)]
pub struct User... |
//! Tools for grabbing venue data, both the basic data available from the API, as well as the svg files that will tell us where homeplate is.
//! The svg data is critical, since it will help us map the hit_data to actual coordinates on the field. It will also allow us to properly measure feet, since we'll hbe able to m... |
use itertools::join;
use std::fmt;
use crate::array::ArrayU16;
use crate::bytecode::ByteCode;
use crate::containers::{Container, ContainerFromSlice, SliceableContainer, StackContainer};
use crate::error::RuntimeError;
use crate::list::List;
use crate::memory::MutatorView;
use crate::printer::Print;
use crate::safeptr:... |
use std::fs::{File, OpenOptions};
use std::io;
use std::io::SeekFrom;
use std::io::prelude::*;
use std::io::{BufReader, BufWriter, Cursor};
use std::path::Path;
use std::str::FromStr;
use std::time::Instant;
use std::{thread, time};
extern crate blake2;
extern crate byteorder;
extern crate md5;
extern crate memchr;
ex... |
#![allow(clippy::wrong_self_convention)]
use anyhow::{format_err, Error};
use chrono::{DateTime, Utc};
use json::{parse, JsonValue};
use log::debug;
use postgres_query::FromSqlRow;
use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
use stack_string::StackString;
use std::{collections::HashMap, fs, hash::Bui... |
use crate::database::blob::Blob;
use crate::database::commit::Commit;
use crate::database::object::Object;
use crate::database::tree::TreeEntry;
use crate::database::Database;
use crate::database::ParsedObject;
use crate::index;
use crate::index::Index;
use crate::refs::Refs;
use crate::workspace::Workspace;
use std::c... |
use rusticata_macros::newtype_enum;
use std::convert::From;
/// Transform (cryptographic algorithm) type
///
/// Defined in [RFC7296](https://tools.ietf.org/html/rfc7296) section 3.3.2
#[derive(Clone, Copy, PartialEq, Eq)]
pub struct IkeTransformType(pub u8);
newtype_enum! {
impl debug IkeTransformType {
Encrypti... |
// Copyright 2019 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
// Substrate is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any la... |
#![no_std]
#![no_main]
// Halt when the program panics.
extern crate panic_halt;
// Generic ARM Cortex-M includes.
use cortex_m::peripheral::syst::SystClkSource;
use cortex_m_rt::entry;
// Chip-specific PAC include.
use stm32_pac::stm32g0x1 as stm32;
const SINE_SAMPLES : usize = 32;
const SINE_WAVE : [ u16; SINE_SAM... |
mod utils;
use std::collections::HashSet;
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
use std::error::Error;
use std::io::prelude::*;
use image::GenericImage;
use image::imageops::FilterType;
use std::fmt;
#[cfg(feature = "wee_alloc")]
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc:... |
#[macro_use]
extern crate clap;
#[macro_use]
extern crate failure;
extern crate finch;
extern crate serde_json;
use std::collections::{HashMap, HashSet};
use std::fs::File;
use std::io::{stderr, stdout, Write};
use std::process::exit;
use clap::{App, AppSettings, Arg, ArgMatches, SubCommand};
use finch::distance::di... |
extern crate urlencoding;
use seed::prelude::*;
use std::collections::HashMap;
use std::time::Duration;
use crate::utils::*;
use crate::chart;
use common::moisture::Measurement;
use common::time::{TimeSeries, UnixTime};
#[derive(Clone, Debug, Deserialize)]
pub struct IrrigationRow {
start: UnixTime,
duration:... |
use anyhow::{ensure, Result};
use byteorder::{ReadBytesExt, WriteBytesExt, LE};
use std::io::{Read, Seek, SeekFrom, Write};
#[derive(Clone, Debug, Default, Eq, PartialEq)]
pub struct HierarchicalSchema {
unique_name: String,
name: String,
scopes: Vec<ResourceMapEntry>,
items: Vec<ResourceMapEntry>,
}
... |
//# struct extrapolation_table
//# {
//# size_t n;
//# double rlist2[52];
//# size_t nres;
//# double res3la[3];
//# };
#[cfg(not(feature = "std"))]
use crate::float::Float;
pub struct ExtrapolationTable {
/// rlist2\[n\] contains the new element in the first
/// column of the epsilon tabl... |
use std::collections::HashMap;
use std::fmt::{Display, Formatter};
use std::sync::Arc;
use std::thread::spawn;
use std::time::Duration;
use crate::epi::Frame;
use bleasy::{BDAddr, Device, DeviceEvent, Error, ScanConfig, Scanner};
use eframe::epi;
use egui::{CtxRef, Layout, Ui, Vec2, Widget};
use futures::StreamExt;
us... |
// Copyright 2021 WeDPR Lab Project Authors. Licensed under Apache-2.0.
#[macro_use]
extern crate criterion;
use criterion::Criterion;
use curve25519_dalek::{
ristretto::RistrettoPoint, scalar::Scalar, traits::MultiscalarMul,
};
use wedpr_l_crypto_zkp_discrete_logarithm_proof::{
self, prove_sum_relationship, ... |
use super::Color;
use enum_map::{enum_map, Enum, EnumMap};
#[cfg(feature = "toml")]
use log::warn;
use std::ops::{Index, IndexMut};
// Use AHash instead of the slower SipHash
type HashMap<K, V> = std::collections::HashMap<K, V, ahash::ABuildHasher>;
/// Color configuration for the application.
///
/// Assign each co... |
/// A CPU architecture.
#[allow(missing_docs)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Architecture {
Unknown,
Aarch64,
Arm,
I386,
Mips,
S390x,
Wasm32,
X86_64,
}
impl Architecture {
/// The size of an address value for this architecture.
///
/// Returns `... |
use crate::plant::parsers::parse_name;
use crate::species::SpeciesName;
use serde_derive::Deserialize;
use strum_macros::Display;
/// struct that the CSV rows will be deserialized into
/// a CSV row is: "Symbol","Synonym Symbol","Scientific Name with Author","State Common Name","Family"
#[derive(Debug, Deserialize)]
p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.