text stringlengths 7.05k 33.9k |
|---|
// Crisp: a distortion plugin but not quite
// 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) any later v... |
#![cfg_attr(rustfmt, rustfmt_skip)]
type Bits = usize;
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum ArgType {
Void,
U(Bits),
}
#[derive(Debug, PartialEq, Eq)]
pub struct Instruction {
pub op: u8,
pub name: &'static str,
pub arg: ArgType,
}
pub const OP_STOP: Instruction = Instruction { ... |
use nalgebra::geometry::{Isometry3, Point3, Rotation3, Translation, UnitQuaternion};
use nalgebra::{
allocator::Allocator,
storage::{Owned, Storage},
DefaultAllocator, RealField,
};
use nalgebra::{convert, Dim, OMatrix, SMatrix, Unit, Vector3, U3};
#[cfg(feature = "serde-serialize")]
use serde::{Deserializ... |
use core::qm;
use std::sync::Arc;
use instruments::RcInstrument;
use instruments::PricingContext;
use instruments::DependencyContext;
use risk::cache::PricingContextPrefetch;
use risk::Pricer;
use risk::PricerClone;
use risk::dependencies::DependencyCollector;
use risk::Bumpable;
use risk::TimeBumpable;
use risk::Savea... |
// Copyright (c) 2020 DDN. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
pub mod enclosures;
use crate::{
components::{attrs, tooltip, Placement},
extensions::MergeAttrs,
font_awesome::{font_awesome, font_awesome_outline},
... |
use std::borrow::Cow;
use std::collections::HashMap;
use std::fmt::{Display, Error, Formatter};
use std::hash::{BuildHasher, Hash, Hasher};
use std::ops::Deref;
use std::ptr;
use std::sync::{Arc, RwLock};
use murmur3::murmur3_32::MurmurHasher;
use crate::atn::ATN;
use crate::parser_atn_simulator::MergeCache;
use crat... |
use crate::{chars_to_code_point_ranges, pack_adjacent_chars, parse_line};
use std::fs::File;
use std::io::{self, BufRead};
use codegen::{Block, Enum, Function, Scope};
pub(crate) fn generate(scope: &mut Scope) {
let mut property_enum = Enum::new("UnicodePropertyValueScript");
property_enum
.vis("pub")... |
use lexgen::lexer;
use thiserror::Error;
pub type Loc = lexgen_util::Loc;
pub type LexerError = lexgen_util::LexerError<LexicalError>;
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
pub enum Keyword {
Or,
And,
Module,
Import,
Include,
Def,
As,
Label,
Break,
... |
//! This crate provides you with a [metrics](metrics) recorder
//! that can print all metrics to a target of your choice in regular intervals.
//!
//! It uses a thread to print, so it doesn't interfere with other threads' work directly.
//!
//! Custom printing targets (e.g., logging frameworks) can be provided via the ... |
/*
* Copyright 2018-2019 TON DEV SOLUTIONS LTD.
*
* Licensed under the SOFTWARE EVALUATION License (the "License"); you may not use
* this file except in compliance with the License. You may obtain a copy of the
* License at: https://ton.dev/licenses
*
* Unless required by applicable law or agreed to in writing... |
use super::*;
impl BlockFormattingContext {
pub fn construct<'a>(
context: &'a Context<'a>,
style: &'a Arc<ComputedValues>,
contents: NonReplacedContents,
) -> Self {
let (contents, contains_floats) = BlockContainer::construct(context, style, contents);
Self {
... |
use std::iter::repeat;
use std::num::{Int,NumCast,cast};
use std::slice::bytes::copy_memory;
use std::mem::size_of;
const NORX_B : usize = 16; // total words
const NORX_C : usize = 6; // capacity words
const NORX_K : usize = 4; // key words
const NORX_N : usize = 2; // nonce words
const NORX_R : usize = NORX_B - NO... |
use std::fmt::{Debug, Formatter};
use amf::amf0;
use amf::amf0::Value;
use byteorder::{BigEndian, ByteOrder, WriteBytesExt};
use chrono::Local;
use num::FromPrimitive;
use smol::io::{AsyncReadExt, AsyncWriteExt};
use smol::net::TcpStream;
use crate::rtmp_server::eventbus_map;
use crate::util::bytes_hex_format;
use st... |
//! Event persistence and querying
use crate::config::SETTINGS;
use crate::error::Error;
use crate::error::Result;
use crate::event::Event;
use crate::hexrange::hex_range;
use crate::hexrange::HexSearch;
use crate::nip05;
use crate::schema::{upgrade_db, STARTUP_SQL};
use crate::subscription::Subscription;
use crate::ut... |
//! A SIMD-ized implementation of MD4 designed to hash many blocks in parallel.
//! The base implementation is derived from https://github.com/RustCrypto/hashes/tree/master/md4.
#![allow(clippy::ptr_offset_with_cast)]
use arrayref::{array_mut_ref, array_ref, array_refs, mut_array_refs};
#[cfg(any(target_arch = "x86",... |
use nftregistry::*;
use frame_support::{
impl_outer_origin, impl_outer_event, impl_outer_dispatch, assert_ok,
parameter_types, weights::Weight, traits::Currency,
};
use std::cell::RefCell;
use sp_core::{Blake2Hasher, sr25519};
use sp_runtime::{
BuildStorage, traits::{BlakeTwo256, IdentityLookup, Hash},
... |
use super::utils;
use crate::cl::{CommandQueueProperties, DeviceType};
use crate::numbers::{Number, NumberTyped, NumberTypedT};
use crate::vec_or_slice::{MutVecOrSlice, VecOrSlice};
use crate::{
BufferBuilder, BufferReadEvent, BuiltContext, CommandQueue, CommandQueueOptions, Context,
ContextBuilder, Device, Err... |
//! ARM64 ISA definitions: instruction arguments.
#![allow(dead_code)]
#![allow(non_snake_case)]
use crate::binemit::{CodeOffset, CodeSink};
use crate::ir::constant::{ConstantData, ConstantOffset};
use crate::ir::{ExternalName, JumpTable, Type};
use crate::isa::arm64::inst::*;
use crate::machinst::*;
use regalloc::{... |
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use cid::Cid;
use integer_encoding::{VarInt, VarIntWriter};
use std::convert::From;
use std::io::{Cursor, Result as IoResult, Write};
use std::net::{Ipv4Addr, Ipv6Addr};
use std::fmt;
use std::str::FromStr;
use {Error, Result};
///! # Protocol
///!
///! A type ... |
use std::collections::VecDeque;
use std::fmt::{Display, Formatter};
use std::ops::Not;
use once_cell::unsync::Lazy;
use regex::Regex;
use crate::day18::ExplosionResult::NoExplosion;
// fn explode(number: &Number, depth: i64) -> ExplosionResult {
// if depth == 4 {
// // time to explode
// return Ex... |
use std::collections::HashMap;
use prometheus::{Counter, Gauge, GaugeVec, Opts, Registry};
use crate::error::Error;
use starlink::proto::space_x::api::device::{
device_client::DeviceClient,
request,
response,
GetStatusRequest,
Request,
};
#[derive(Debug)]
pub struct Metrics {
pub device_info:... |
use crate::protocol::Protocol;
use crate::protocol::ProtocolSet;
use std::net::IpAddr;
use std::net::Ipv4Addr;
use std::net::Ipv6Addr;
pub const DEFAULT_UDP_PORT: u16 = 53;
pub const DEFAULT_TCP_PORT: u16 = 53;
pub const DEFAULT_DOT_PORT: u16 = 853;
pub const DEFAULT_DOH_PORT: u16 = 443;
pub const DEFAULT_MDNS_P... |
use crate::dev_prelude::*;
use building_blocks_core::{prelude::*, Sphere};
impl<Ni, Nf, T, Usr, Bldr, Store> ChunkTree<Ni, T, Bldr, Store>
where
PointN<Ni>: std::hash::Hash + IntegerPoint<Ni, FloatPoint = PointN<Nf>>,
PointN<Nf>: FloatPoint<IntPoint = PointN<Ni>>,
Bldr: ChunkTreeBuilder<Ni, T, Chunk = Usr... |
#![warn(missing_docs)]
//! __A micro batching library.__
//!
//! Micro-batching is a technique used in processing pipelines where
//! individual tasks are grouped together into small batches. This can
//! improve throughput by reducing the number of requests made to a
//! downstream system. Nano is a micro-batching lib... |
extern crate fs_lib;
use std::io::{BufRead, BufReader, Read, Seek, SeekFrom, Write};
use std::str::from_utf8;
use std::sync::Mutex;
use std::ptr;
use std::mem::size_of;
use std::fs::{ File, OpenOptions };
use std::cmp::min;
use std::sync::atomic::AtomicBool;
use fs_lib::{BSIZE, FSMAGIC, FSSIZE, IPB, LOGSIZE, MAXFILE,... |
extern crate rand;
pub mod instruction;
use std::path::Path;
use std::fs::File;
use std::io::Read;
use instruction::Instruction;
/// Describes the Chip-8 Display
#[derive(Copy, Clone)]
pub struct Display {
arr: [[bool; 64]; 32],
}
impl Display {
pub const WIDTH: usize = 64;
pub const HEIGHT: usize = 32;
/// Cre... |
pub mod framebuffer;
mod mem;
mod registers;
use self::mem::MemoryView;
use self::registers::{ControlRegister1, ControlRegister2, InterruptEnabled, InterruptRegister};
use crate::color_ram::ColorRAM;
use crate::ram::RAM;
use crate::rom::ROM;
use crate::utils::R2C;
use crate::vic20::registers::Registers;
use std::colle... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Version ID Register"]
pub verid: VERID,
_reserved1: [u8; 4usize],
#[doc = "0x08 - Regulator Status Register"]
pub rsr: RSR,
_reserved2: [u8; 4usize],
#[doc = "0x10 - Run Control Register"]
pub rctrl: RCTRL,
#[doc = "0x14 ... |
/*
Copyright 2020 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,... |
// Copyright 2019 The Gotts 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 agre... |
use num_derive::FromPrimitive;
use crate::attribute::{Attribute, AttributeName, AttributeCommon};
use crate::character::character_common_data::CharacterCommonData;
use crate::character::{CharacterConfig, CharacterName, CharacterStaticData};
use crate::character::character_sub_stat::CharacterSubStatFamily;
use crate::ch... |
use std::marker::PhantomData;
use crate::Sha256Instructions;
use halo2::{
arithmetic::FieldExt,
circuit::{Cell, Chip, Layouter, Region},
plonk::{Advice, Column, ConstraintSystem, Error},
};
mod compression;
mod gates;
mod message_schedule;
mod spread_table;
mod util;
use compression::*;
use gates::*;
use... |
// This file is part of Substrate.
// Copyright (C) 2019-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// 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
//
// ht... |
//! A simple representation of color
use std::fmt::{Debug, Formatter};
/// A datatype representing color.
///
/// Currently this is only a 32 bit RGBA value, but it will likely
/// extend to some form of wide-gamut colorspace, and in the meantime
/// is useful for giving programs proper type.
#[derive(Clone, PartialE... |
use std::collections::BTreeMap;
use std::future::Future;
use std::io;
use std::mem;
#[cfg(unix)]
use std::os::unix::io::RawFd;
#[cfg(windows)]
use std::os::windows::io::RawSocket;
use std::panic;
use std::pin::Pin;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::{Arc, Mutex, MutexGuard};
use std::task::{... |
use std::collections::{HashMap, HashSet};
fn input_data() -> Vec<&'static str> {
vec![
"--- scanner 0 ---",
"404,-588,-901",
"528,-643,409",
"-838,591,734",
"390,-675,-793",
"-537,-823,-458",
"-485,-357,347",
"-345,-311,381",
"-661,-816,-575",... |
#[cfg(test)]
mod stream_test;
use crate::association::AssociationState;
use crate::chunk::chunk_payload_data::{ChunkPayloadData, PayloadProtocolIdentifier};
use crate::error::{Error, Result};
use crate::queue::reassembly_queue::ReassemblyQueue;
use crate::queue::pending_queue::PendingQueue;
use bytes::Bytes;
use std... |
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{
chained_bft::{
block_storage::{
block_tree::BlockTree, BlockReader, BlockTreeError, InsertError, VoteReceptionResult,
},
common::{Payload, Round},
consensus_types::{block::Bl... |
// Minimal Page Manager
// use crate::*;
use crate::*;
use bitflags::*;
use bootprot::*;
use core::intrinsics::*;
use core::ops::*;
use core::ptr;
use core::slice;
use uefi::table::boot::*;
pub struct PageConfig {}
impl PageConfig {
/// UEFI virtual page size (not the actual page size)
pub const UEFI_PAGE_SI... |
use std::error::Error;
use std::fs::File;
use std::io::prelude::*;
use std::path::Path;
struct Icache {
}
impl Icache {
fn read(&self, address: u32, bios: &Bios) -> u32 {
return bios.read32(address);
}
}
enum ALU {
ADD,
ADDU,
SUB,
SUBU,
AND,
OR,
XOR,
NOR,
SLL,
... |
use std::fmt;
use std::error::Error;
use rustc::hir;
use rustc::mir::interpret::{ConstEvalErr, ScalarMaybeUndef};
use rustc::mir;
use rustc::ty::{self, TyCtxt, Ty, Instance};
use rustc::ty::layout::{self, LayoutOf, Primitive, TyLayout};
use rustc::ty::subst::Subst;
use rustc_data_structures::indexed_vec::IndexVec;
us... |
use std::ops::Deref;
use ast::*;
use span::Span;
use compileerror::{CompileResult, type_error};
use super::typecheckercontext::TypeCheckerContext;
fn matches_function_signature(expected: &Type, actual: &Type, concrete_type: &Type, interface: &Type, method_name: &str) -> Result<(), String>
{
fn type_matches(expecte... |
use std::collections::BTreeMap;
use rand::seq::SliceRandom;
use rand::{Rng, SeedableRng};
use rand_xorshift::XorShiftRng;
use geom::{Angle, Duration, Time};
use map_model::Map;
use sim::{
AgentID, CarID, ParkingSpot, PedestrianID, Person, PersonID, PersonState, TripEndpoint, TripID,
TripMode, TripResult, Vehi... |
use crate::comp_ui::CompUI;
use crate::visual_grid::TileCoordinate;
use crate::windows::{
foundation::numerics::Vector2, graphics::SizeInt32, ui::composition::ContainerVisual,
};
use rand::distributions::{Distribution, Uniform};
use std::collections::VecDeque;
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
pub enum M... |
use vulkano::{
instance::{ Instance, PhysicalDevice },
device::{ Device, Features },
swapchain::{ Swapchain, SurfaceTransform, PresentMode, ColorSpace, FullscreenExclusive },
swapchain,
image::{ SwapchainImage, view::ImageView, attachment::AttachmentImage },
command_buffer::{ PrimaryAutoCommandB... |
// Rust Monero Library
// Written in 2019 by
// h4sh3d <<EMAIL>>
//
// 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... |
use std::collections::{BTreeMap, HashMap};
use std::convert::TryInto;
use std::mem;
use abci::*;
use log::{info, warn};
use parity_scale_codec::{Decode, Encode};
use protobuf::Message;
use serde::{Deserialize, Serialize};
use crate::enclave_bridge::EnclaveProxy;
use crate::staking::StakingTable;
use chain_core::commo... |
use core::fmt::Debug;
use core::ops::{Index, IndexMut};
use zeroize::Zeroize;
use constants;
#[derive(Copy, Clone)]
pub struct Scalar52(pub [u64; 5]);
impl Debug for Scalar52 {
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
write!(f, "Scalar52: {:?}", &self.0[..])
}
}
impl Z... |
use crate::cuda::CUresult;
use crate::{
cuda::{CUcontext, CUdevice, CUmodule, CUuuid},
cuda_impl,
};
use super::{context, context::ContextData, device, module, Decuda, Encuda, GlobalState};
use std::os::raw::{c_uint, c_ulong, c_ushort};
use std::{
ffi::{c_void, CStr},
ptr,
};
use std::{mem,... |
use crate::util::ckb_tx_generator::Generator;
use crate::util::ckb_util::{
parse_cell, parse_main_chain_headers, parse_merkle_cell_data, parse_privkey_path,
};
use crate::util::config::ForceConfig;
use crate::util::eth_util::Web3Client;
use crate::util::rocksdb;
use anyhow::{anyhow, Result};
use ckb_sdk::{Address, ... |
//! The structure copying is needed because we cannot impl things for foreign
//! types. Naturally this is a good reason, but it means we have to copy things
//! around. If the structures change, we will know about it because we use the
//! from trait, and we are not allowed to skip or use different types.
use std::ptr... |
// For a list of 256 terminal colors: https://jonasjacek.github.io/colors/
use std::cmp;
use std::borrow::Cow;
use std::path::Path;
use std::path::PathBuf;
use std::io::Write;
use std::fs::{File, rename};
use std::sync::{Mutex, Arc};
use std::time::SystemTime;
// use rustbox::{Color, RustBox, Style as RustBoxStyle};
... |
// Copyright © 2018 <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,
// distribu... |
use eframe::egui::{Button, RichText, Slider, TextEdit, TextStyle};
use eframe::{egui, epi};
use harptabber::Style;
use std::collections::BTreeMap;
#[cfg(not(target_arch = "wasm32"))]
use rodio::{OutputStream, Sink};
pub struct GUIApp {
input_text: String,
output_text: String,
semitone_shift: i32,
from... |
// Copyright 2020 Sigma Prime Pty 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, merge, publi... |
use crate::witness_rep::{
implementation::{
generate_sigs,
user_and_organization::{
UserIdentity, OrganizationIdentity, IdInfo, get_public_keys
}
},
};
use wb_reputation_system::data_types::{
event_protocol_messages::{
application_constructs::{
appli... |
// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause
use std::mem::size_of;
use vmm_sys_util::epoll::EpollEvent;
#[cfg(feature = "remote_endpoint")]
use vmm_sys_util::epoll::{ControlOperation, EventSet};
#[cfg(feature = "remote_endpoint")]
... |
#![allow(clippy::if_same_then_else)]
use crate::{
color::*,
math::*,
paint::{Stroke, TextStyle},
types::*,
};
/// Specifies the look and feel of a `Ui`.
#[derive(Clone, Debug)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub struct Style {
/// Default `TextStyle` f... |
use commands::command::Command;
use gd_udp::gd_udp::GDUdp;
use log::info;
use messages::{
message::AsMessage,
message_types::MessageType,
packet::{Packet, Packetize},
};
use secp256k1::{
key::{PublicKey, SecretKey},
Error, Message, Secp256k1, Signature,
};
use std::collections::{HashMap, HashSet};
u... |
// #![feature(specialization)]
mod columnar;
mod linkedlist;
mod list_attempt_2;
mod cell;
mod tree;
mod tree_attempt_2;
mod kmeans;
mod complex;
mod circular_palindrome;
extern crate rand;
// rust - weird things.
// - mut Box<T> offers both internal and external mutability.
struct SplitIterator<'a> {
s: &'a st... |
// Copyright (c) Microsoft. All rights reserved.
#![deny(rust_2018_idioms, warnings)]
#![deny(clippy::all, clippy::pedantic)]
#![allow(
clippy::default_trait_access,
clippy::let_unit_value,
clippy::too_many_lines,
clippy::use_self,
)]
mod tokio_openssl2;
#[tokio::main]
async fn main() -> Result<(), Error> {
ope... |
//! A container layer that runs operations sequentially on the contained layers.
use std::cell::RefCell;
use std::collections::{HashMap, HashSet};
use std::rc::Rc;
use std::sync::{Arc, RwLock};
use co::{IBackend, SharedTensor};
use layer::*;
use util::{ArcLock, LayerOps};
use leaf_capnp::sequential_config as capnp_conf... |
use crate::{error::ParseError, Tag, TagIterator};
use byteorder::{ByteOrder, NetworkEndian as NE};
use core::convert::TryFrom;
use core::{str, u16};
const BROADBAND_FORUM_VENDOR_ID: u32 = 0x0DE9;
// TAG TLS - defined in TR101
const AGENT_CIRCUIT_ID: u8 = 0x01;
const AGENT_REMOTE_ID: u8 = 0x02;
const ACTUAL_DATA_RATE_... |
/// Name: Basketball trajectory in Rust
///
/// Author: <NAME>
/// Date: 2022.01.06
/// Description: This tries to answer the question if the ball that a basket
/// player throws with a V_0 velocity vector and a Teta angle
/// will enter the basket in a parabolic trajectory?
/// ... |
// 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.
//! Socket features exposed by netstack3.
pub(crate) mod udp;
use std::convert::TryFrom;
use std::num::NonZeroU16;
use byteorder::{NativeEndian, Network... |
// Copyright 2020 WHTCORPS 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 writing, sof... |
//! This file contains the entry point to the Hypervisor. The Uhyve utilizes KVM to
//! create a Virtual Machine and load the kernel.
use crate::arch::x86_64::BootInfo;
use crate::consts::*;
use crate::linux::vcpu::*;
use crate::linux::virtio::*;
use crate::linux::KVM;
use crate::params::Params;
use crate::shared_queu... |
// Lumol, an extensible molecular simulation engine
// Copyright (C) Lumol's contributors — BSD license
use std::f64::consts::{PI, FRAC_2_SQRT_PI};
use rayon::prelude::*;
use crate::math::{exp, erfc};
use crate::consts::FOUR_PI_EPSILON_0;
use crate::PairRestriction;
use crate::utils::ThreadLocalVec;
use crate::Config... |
use std::collections::BTreeSet;
use std::fs::File;
use std::io;
use std::io::{Read, Seek, SeekFrom};
use std::path::Path;
use std::str;
use crate::{debug, error, info, warn};
use thiserror::Error;
use vec_map::VecMap;
use crate::index::{MsfIndex, MsfIndexError};
use crate::{Event, Image, ImageError, TrackType};
/... |
use crate::request::{Chunk, Encoding};
use crate::router::{Ctx, Router};
use crate::{Request, Result};
use crate::{Sender, BUF_LEN, KEEP_ALIVE_TIMEOUT};
use async_std::{
net::{TcpListener, TcpStream},
prelude::*,
task,
};
use futures::{channel::mpsc, join, select, sink::SinkExt, FutureExt};
use futures_time... |
use std::cmp;
use std::io::Write;
use futures_util::StreamExt;
use headers::HeaderMapExt;
use htmlescape;
use http::{status::StatusCode, Request, Response};
use bytes::Bytes;
use crate::async_stream::AsyncStream;
use crate::body::Body;
use crate::conditional;
use crate::davheaders;
use crate::davpath::DavPath;
use c... |
//! A tiny library providing a GPU-powered pixel buffer.
//!
//! [`Pixels`] represents a 2D pixel buffer with an explicit image resolution, making it ideal for
//! prototyping simple pixel-based games, animations, and emulators. The pixel buffer is rendered
//! entirely on the GPU, allowing developers to easily incorpo... |
//! Tseitin Transformation
//!
//! See [wikipedia](https://en.wikipedia.org/wiki/Tseytin_transformation)
//! for a primer.
#[macro_use] extern crate log;
use {
batsmt_core::{
ast_u32::{self, AST, }, gc, AstView,
ast::{self, AstMap, iter_dag::State as AstIter},
},
fxhash::FxHashSet,
ba... |
use {
makepad_shader_compiler::makepad_live_compiler::*,
makepad_derive_live::*,
makepad_shader_compiler::{
ShaderTy,
},
crate::{
cx::Cx,
live_traits::*,
turtle::{Walk, Width, Height, Margin},
font::{CxFontsAtlasTodo, Font,},
view::ManyInstances,
... |
use super::{
directory_manager::DirectoryManager, errors::*, folders::*, pipelines::PipelineManager, utils,
YyResource, YyResourceData, YyResourceHandler, YypSerialization,
};
use crate::{FileSerializationError, ProjectMetadata, Resource};
use anyhow::{Context, Result as AnyResult};
use object_yy::Object;
use s... |
use itertools::Itertools;
use param;
use regex::{self, Regex, RegexSet};
use std::borrow::Cow;
use std::cmp::{Ord, Ordering};
use std::collections::BTreeMap;
use std::fmt::{self, Display, Formatter};
use std::iter::FromIterator;
use std::str::FromStr;
use vec_map::VecMap;
macro_rules! check_path {
($path:expr) => ... |
// Copyright 2022 <NAME>
//
// SPDX-License-Identifier: Apache-2.0
//
// 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 requir... |
use {
crate::{
models::{Enum, EnumVariant, Field, Function, Struct, Type},
parser::{
self, LineOutput, LineOutputType, LineOutputValue, MetadataLineOutputValue,
MetadataLineOutputValueToken, NormalLineOutputValue,
},
utils,
},
lazy_static::lazy_static,... |
use chrono::TimeZone;
use ordered_float::NotNan;
use crate::{
event::{self, BTreeMap, WithMetadata},
metrics::AgentDDSketch,
};
include!(concat!(env!("OUT_DIR"), "/event.rs"));
pub use event_wrapper::Event;
pub use metric::Value as MetricValue;
use super::{array, metric::MetricSketch};
impl event_array::Eve... |
use super::{
parse_decimal_param, parse_element_param, parse_hex_param, push_value, validate_operation,
AssemblyError, Felt, Operation, Token,
};
// CONSTANTS
// ================================================================================================
/// The maximum number of constant inputs allowed b... |
//! Truth tables.
use crate::ir;
use fxhash::FxHashMap;
use itertools::Itertools;
use log::debug;
use std;
use std::collections::hash_map;
use utils::*;
/// Lists the rules to apply for each combinaison of input.
#[derive(Debug)]
struct TruthTable {
values: Vec<(usize, Vec<ir::ValueSet>)>,
rules: NDArray<Cell>... |
use std::time::Duration;
use crate::editor::collider::EditableCollider;
use crate::game::animations::{Animation, AnimationBundle, EnemyAnimations};
use crate::game::damage::{DamageEvent, DamageSource, Health};
use crate::game::phys_layers::PhysLayer;
use crate::game::player::Player;
use crate::util::WorldCursor;
use b... |
//! This module contains multiple types defined by the standard.
//! At the moment, not all of them are used internally (`NiftiType`
//! makes the exception, which also provides a safe means of
//! reading voxel values). However, primitive integer values can be
//! converted to these types and vice-versa.
use crate::e... |
extern crate diesel;
extern crate quick_xml;
extern crate serde;
use crate::schematic::VariantDef;
use crate::*;
use prettytable::Table;
use quick_xml::de::from_reader;
use self::diesel::prelude::*;
use chrono::Utc;
use serde::Serialize;
use std::io::{BufReader, BufWriter};
use std::{
fs::File,
io::{StdinLoc... |
use super::*;
use read::Sexp;
use std::rc::Rc;
use std::borrow::Borrow;
use std::fmt::{self, Debug, Formatter};
use macros::*;
#[derive(Copy)]
pub struct ExternFnPtr(pub fn(&[Value]) -> Value);
impl PartialEq for ExternFnPtr {
fn eq(&self, other: &Self) -> bool {
self.0 as *const () == other.0 as *con... |
use super::discrete_window::DiscreteWindowInstance;
use super::window_aggregations::*;
use super::Value;
use crate::basics::Time;
use ordered_float::NotNan;
use rtlola_frontend::mir::{Type, WindowOperation as WinOp};
use std::cmp::Ordering;
use std::collections::VecDeque;
use std::fmt::Debug;
use std::ops::Add;
use std... |
use std::{collections::HashMap, env, num::ParseIntError, sync::Arc, time::Duration};
use config::PoolSize;
use git_testament::{git_testament, render_testament};
use graph::{data::graphql::effort::LoadManager, prelude::chrono, prometheus::Registry};
use graph_core::MetricsRegistry;
use graph_graphql::prelude::GraphQlRu... |
use std::collections::HashMap;
use std::cell::RefCell;
use super::{
Object,
Program,
VertexShader,
TessEvaluationShader,
TessControlShader,
GeometryShader,
FragmentShader,
ComputeShader,
};
use gl::{self, types::*};
use math::{Mat4, Vec3, Vec4, Rgba, Rgb};
impl Program {
pub fn lin... |
use std::collections::HashMap;
use std::fs::{self, File};
use std::io::prelude::*;
use std::path::{Path, PathBuf};
use cargo::util::Sha256;
use flate2::write::GzEncoder;
use flate2::Compression;
use git2;
use hex;
use tar::{Builder, Header};
use url::Url;
use crate::support::git::repo;
use crate::support::paths;
pub... |
use std::sync::Arc;
use {
ahash::AHashMap,
rusttype::{point, Scale},
};
use crate::{
mutex::{Mutex, RwLock},
text::{
galley::{Galley, Row},
TextStyle,
},
TextureAtlas,
};
use emath::{vec2, Vec2};
// ----------------------------------------------------------------------------
... |
use std::collections::HashMap;
use std::path::Path;
use log::{error, info};
use crate::env;
use crate::Env;
use env::{EnvTypes, ExtApp, ExtSpawnApp, ExtTemplate};
use crate::error::ValidateError;
use crate::storage::StorageBuilderFn;
use crate::vmcalls;
use crate::{Config, Context, ExternImport, Runtime};
use svm_... |
use core::time::Duration;
#[test]
fn creation() {
assert_ne!(Duration::from_secs(1), Duration::from_secs(0));
assert_eq!(Duration::from_secs(1) + Duration::from_secs(2), Duration::from_secs(3));
assert_eq!(
Duration::from_millis(10) + Duration::from_secs(4),
Duration::new(4, 10 * 1_000_000)... |
//! Range check gate
use std::collections::HashMap;
use ark_ff::{FftField, SquareRootField, Zero};
use ark_poly::{univariate::DensePolynomial, Evaluations, Radix2EvaluationDomain as D};
use array_init::array_init;
use rand::{prelude::StdRng, SeedableRng};
use serde::{Deserialize, Serialize};
use serde_with::serde_as;... |
//! A program which generates a linux-headers installation and runs bindgen
//! over each public header, for each supported architecture, for a selection
//! of Linux kernel versions.
use bindgen::{builder, EnumVariation};
use std::collections::HashSet;
use std::env;
use std::fs;
use std::fs::File;
use std::io::{Read,... |
use super::entry::BannerEntry;
use crate::{
config::Configuration,
event_handlers::Handles,
utils::{logged_request, status_colorizer},
VERSION,
};
use anyhow::{bail, Result};
use console::{style, Emoji};
use reqwest::Url;
use serde_json::Value;
use std::{io::Write, sync::Arc};
/// Url used to query git... |
use std::collections::HashMap;
extern crate proc_macro;
use inflector::Inflector;
use proc_macro2::TokenStream;
use quote::{format_ident, quote};
use serde::Deserialize;
use serde_tokenstream::from_tokenstream;
use syn::{Field, ItemStruct, Type};
/// The parameters passed to our macro.
#[derive(Deserialize, Debug)]
... |
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: MIT
//! Types and functions related to HTTP request.
use http::Method;
pub use http::StatusCode;
use serde::{Deserialize, Deserializer, Serialize};
use serde_json::Value;
use serde_... |
//
// Copyright (C) 2018 Kubos Corporation
//
// 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 agree... |
//! A `PDFDocument` represents the whole content of the file
use std::rc::Rc;
use std::cell::RefCell;
use std::io::Write;
use std::io::BufWriter;
use utils::random_character_string_32;
use crate::OffsetDateTime;
use lopdf;
use indices::*;
use {
ExternalFont, Font, PdfPage, FontList, IccProfileList, PdfMetadata, ... |
//! Source-based integration tests.
//!
//! See the [source test README](source/README.md) for more information.
extern crate rustdoc;
#[macro_use]
extern crate failure;
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate serde_json;
extern crate itertools;
extern crate jmespath;
extern crate rand;
exte... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.