text stringlengths 7.05k 33.9k |
|---|
// This file is part of Deskchains.
// Copyright (C) 2020-2021 Deskchains Foundation.
// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0
// 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 So... |
#![no_std]
// This mod MUST go first, so that the others see its macros.
pub(crate) mod fmt;
use core::cell::Cell;
use core::intrinsics::copy_nonoverlapping;
use core::mem::{size_of, MaybeUninit};
use embassy_usb::control::{self, ControlHandler, InResponse, OutResponse, Request};
use embassy_usb::driver::{Endpoint, E... |
//! This module abstracts various manipulation with Cargo.toml and Cargo.lock files
//! 1. It can create a custom package that repicates the full dependency build of a given workspace
//! 2. Check a Cargo.toml is a package or a virtual manifest toml
use crate::guppy_wrapper::get_direct_dependencies;
use anyhow::{anyho... |
use crate::transform::{Transform, Transformable};
use common::fmt_float;
use num_traits::cast::NumCast;
use std::iter;
pub const IDENTITY_AFFINE: Affine = Affine([[1., 0.], [0., 1.]], [0., 0.]);
const DISPLAY_PRECISION: u32 = 3;
pub struct Affine(pub [[f64; 2]; 2], pub [f64; 2]); // (row-major transform matrix, trans... |
extern crate rand;
use rand::Rng;
use std::sync::mpsc;
use std::sync::mpsc::{Receiver, Sender};
extern crate weekit;
use weekit::*;
mod body;
mod rock;
mod ship;
mod shot;
use body::{Direction, Turn};
use rock::Rock;
use ship::Ship;
use shot::Shot;
const S: usize = 10;
const W: usize = 5 * S;
const H: usize = 3 * ... |
use ansi_term::Style;
use futures::executor::block_on;
use futures::future::{FutureExt, TryFutureExt};
use futures::stream::StreamExt;
use libp2p::core;
use libp2p::core::either::EitherOutput;
use libp2p::core::muxing::StreamMuxerBox;
use libp2p::core::transport::{Boxed, Transport};
use libp2p::core::upgrade;
use libp2... |
use borsh::{BorshDeserialize, BorshSerialize};
use evm::backend::{Apply, ApplyBackend, Backend, Basic, Log};
use evm::executor::{MemoryStackState, StackExecutor, StackSubstateMetadata};
use evm::{Config, CreateScheme, ExitError, ExitReason, ExitSucceed};
use crate::parameters::{FunctionCallArgs, NewCallArgs, ViewCallA... |
// Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause
//
// Portions Copyright 2017 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the THIRD-PARTY file.
use s... |
use emulator::DeviceMode;
use cart::Cartridge;
use graphics::{self, Gpu};
use sound::SoundController;
use joypad::Joypad;
use timer::Timer;
/// The GB/C memory mapper
pub struct Memory {
pub crashed: bool,
pub sb: u8,
pub sc: u8,
/// Interrupt enabled register (mapped to: 0xFFFF)
pub ie_reg: u8,
... |
pub const BLOCKBYTES: usize = 128;
pub const KEYBYTES: usize = 64;
pub const OUTBYTES: usize = 64;
pub const SALTBYTES: usize = 16;
pub const PERSONALBYTES: usize = 16;
#[derive(Copy, Clone)]
pub struct Blake2bState {
pub h: [u64; 8],
pub t: [u64; 2],
pub f: [u64; 2],
pub buf: [u8; BLOCKBYTES],
pub... |
//!
//! DSP310 embedded-hal I2C driver crate
//!
//! A platform agnostic driver to interface with the DSP310 barometric pressure & temp sensor.
//! This driver uses I2C via [embedded-hal]. Note that the DSP310 also supports SPI, however that
//! is not (yet) implemented in this driver.
//!
//! [embedded-hal]: https://d... |
use std::io;
use tui::backend::CrosstermBackend;
use tui::layout::Rect;
use tui::style::{Color, Style};
use tui::symbols::Marker;
use tui::widgets::canvas::{Canvas, Points};
use tui::widgets::{Block, Borders};
use tui::Terminal;
/// Display is used by the interpreter to draw things on the screen. It should
/// abstrac... |
//! Implementation of packed vectors for decoding packed block data.
use std::fmt;
/// A packed vector of unsigned integers with a fixed number of bits per entry.
///
/// The data is stored as a vector of u64 words. If N is the number of bits per
/// entry, then the first entry is stored in the least significant N bi... |
use std::fs;
#[derive(Copy, Clone, PartialEq)]
struct FftRangeSum {
pattern_value: i64,
left_index: usize,
right_index: usize,
sum: i64,
}
impl FftRangeSum {
/// Creates a new FftRangeSum initialised with the given parameters.
pub fn new(pattern_value: i64, left_index: usize, right_index: usiz... |
use super::{
drop_items::DROP_ITEM_SIZE_I,
gl::utils::{enable_buffer, Flatten},
inventory::InventoryTrait,
items::ItemType,
structure::{ItemResponse, ItemResponseResult, Structure, StructureDynIter, StructureId},
transport_belt::TransportBelt,
window, DropItem, FactorishState, FrameProcResul... |
//! This module provides routines for the orbit integration
//!
//! Here is a quick breakdown of what is going on (see
//! Bajkova & Bobylev ([2020, v1](https://arxiv.org/abs/2008.13624v1))
//! for more details).
//!
//! Let the initial positions and space velocities of a
//! test particle in the heliocentric coordinat... |
mod receiver;
mod configfs;
use std::convert::{TryFrom, TryInto};
use std::fmt::{Debug, Formatter};
use std::fs::{File, OpenOptions};
use std::io::Write;
use std::net::{SocketAddr};
use std::num::NonZeroU8;
use std::time::{Duration, Instant};
use mio::{Events, Interest, Poll, Token};
use anyhow::Result;
use clap::Pars... |
use j2534_rust::FilterType::FLOW_CONTROL_FILTER;
use j2534_rust::*;
use libloading::Library;
use std::os::raw::c_char;
use std::sync::Arc;
use std::{ffi::*, fmt};
#[cfg(windows)]
use winreg::enums::*;
#[cfg(windows)]
use winreg::{RegKey, RegValue};
/// Result which contains a PASSTHRU_ERROR in it's Err() variant
pub... |
/*
* Copyright 2021 <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 writ... |
extern crate util;
use std::collections::HashMap;
use std::collections::HashSet;
const ATTACK_POWER: isize = 3;
type Map = HashMap<(usize, usize), Entry>;
type Loc = (usize, usize);
#[derive(Debug, Clone, Copy, PartialEq)]
enum Entry {
Empty,
Wall,
Goblin{hp: isize},
Elf{hp: isize},
}
fn print_map(... |
use postgres;
use uuid::Uuid;
use std::fmt;
use std::collections::BTreeMap;
use chrono::{NaiveDateTime, Utc, DateTime};
use apple_music;
use youtube;
use youtube::HasThumbnail;
use soundcloud;
use spotify;
use lemoned;
use error::Error;
use super::{conn, Model};
use model::enclosure::Enclosure;
use model::provider::Pr... |
use super::Expression;
use crate::{
BinaryOp, ClassDefinition, CollectedErrors, CollectibleErrors, FuncDefinition, FuncType,
LogicalBinaryOp, LoxError, Nil, Position, PositionedToken, SimpleToken, Statement, Token,
UnaryOp, Value,
};
use std::collections::HashMap;
pub struct Parser<Iter: CollectedErrors<It... |
use std::{io, fs, mem};
use std::io::Read;
use std::path::PathBuf;
use std::sync::Arc;
use std::sync::mpsc::{sync_channel, Receiver, TryRecvError};
use std::thread::{spawn, JoinHandle};
use std::collections::HashMap;
use std::collections::hash_map;
use std::iter::Iterator;
use tempdir::TempDir;
use byteorder::{ReadByte... |
use std::ffi::OsString;
use std::io::Write;
use std::mem;
use std::path::{Path, PathBuf};
use std::rc::Rc;
use std::time::{Duration, Instant};
use rand::seq::SliceRandom;
use rand::thread_rng;
use gelatin::glium;
use gelatin::window::Window;
//use crate::window::Window;
use crate::image_cache::{self, AnimationFrame... |
use cgmath::Vector4;
use buffer::WritableBuffer;
use std::cmp;
use util::Rasterizable;
use util::Tri;
use vertex_shader::VertexShader;
use pixel_shader::PixelShader;
use pixel_masker::PixelMasker;
use pixel_masker::NonePixelMasker;
use std::mem;
//Templates: Vertex, Vertex Shader, Rasterize Vertex, Pixel Shader, Back ... |
// This file is part of Substrate.
// Copyright (C) 2017-2020 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... |
#![feature(convert)]
extern crate piston;
extern crate conrod;
extern crate graphics;
extern crate opengl_graphics;
extern crate glutin_window;
extern crate vecmath;
use conrod::{
Background,
Button,
Callable,
Color,
Colorable,
Drawable,
DropDownList,
EnvelopeEditor,
Frameable,
... |
// Copyright 2018 <NAME>.
// Copyright Materialize, Inc. and contributors. All rights reserved.
//
// 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 file at the
// root of this rep... |
use std::error::Error as StdError;
use std::marker::Unpin;
use std::sync::{Arc, Mutex};
#[cfg(feature = "runtime")]
use std::time::Duration;
use bytes::Bytes;
use h2::server::{Connection, Handshake, SendResponse};
use h2::{Reason, RecvStream};
use http::{Method, Request};
use pin_project_lite::pin_project;
use tokio::... |
use std::ops::Deref;
use crate::{LinearOpticalModelError, Result};
use nalgebra as na;
use serde::{Deserialize, Serialize};
/// Optical sensitivities
///
/// Linear transformation of M1 and M2 rigid body motions into wavefront and wavefront piston and tip-tilt modes
#[derive(Serialize, Deserialize, Clone)]
pub struct... |
#![allow(non_camel_case_types)]
use libc::FILE;
use std::os::raw::{c_char, c_int, c_uint, c_void};
pub enum xkb_context {}
pub enum xkb_keymap {}
pub enum xkb_state {}
pub type xkb_keycode_t = u32;
pub type xkb_keysym_t = u32;
pub type xkb_layout_index_t = u32;
pub type xkb_layout_mask_t = u32;
pub type xkb_le... |
#![cfg_attr(not(feature = "std"), no_std)]
use frame_support::{
decl_module, decl_storage, decl_event, decl_error, dispatch, ensure,
traits::{Currency, ReservableCurrency},
};
use frame_system::ensure_signed;
use sp_std::prelude::*;
use core::str;
use core::str::FromStr;
use crate::sp_api_hidden_includes_decl_stor... |
use martinez::{
binutil::MartinezDataDir,
hex_to_bytes,
kv::{
tables::{self, CHAINDATA_TABLES},
traits::*,
},
models::*,
stagedsync,
stages::*,
};
use anyhow::{bail, ensure, format_err, Context};
use bytes::Bytes;
use clap::Parser;
use itertools::Itertools;
use std::{borrow::... |
use graphql_parser::{query as q, query::Name, schema as s, schema::ObjectType};
use std::collections::{BTreeMap, HashMap};
use graph::data::graphql::{TryFromValue, ValueList, ValueMap};
use graph::data::subgraph::schema::SUBGRAPHS_ID;
use graph::prelude::*;
use graph_graphql::prelude::{
object_value, BlockConstrai... |
use ckb_metrics::metrics;
use fail::fail_point;
use lru::LruCache;
use snap::raw::{Decoder as SnappyDecoder, Encoder as SnappyEncoder};
use std::convert::TryInto;
use std::fs::{self, File};
use std::io::{Error as IoError, ErrorKind as IoErrorKind};
use std::io::{Read, Write};
use std::io::{Seek, SeekFrom};
use std::pat... |
// Copyright 2019 <NAME> <<EMAIL>>
//
// 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 t... |
//! MIR optimizations.
use std::{collections::{HashMap, VecDeque}, hash::Hash, marker::PhantomData, rc::Rc};
use smallvec::SmallVec;
use crate::Symbol;
use super::types;
use types::{Idx, mir, entity};
use entity::Entity;
#[allow(clippy::wildcard_imports)] use mir::*;
pub(crate) use dominator::DominatorTree;
pub(crate... |
/*
This tool is part of the WhiteboxTools geospatial analysis library.
Authors: Dr. <NAME>
Created: Feb. 18, 2018
Last Modified: 12/10/2018
License: MIT
Notes:
1. The num_pulses output is actually the number of pulses with at lease one return; specifically it is
the sum of the early returns (first and only) in a gr... |
#![warn(rust_2018_idioms)]
#![warn(missing_docs)]
//! The salsa crate is a crate for incremental recomputation. It
//! permits you to define a "database" of queries with both inputs and
//! values derived from those inputs; as you set the inputs, you can
//! re-execute the derived queries and it will try to re-use re... |
/*
* Copyright (C) 2020-2021 Fanout, 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 ... |
//
// Copyright 2022 The Project Oak Authors
//
// 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 o... |
use std::{convert::TryFrom, fmt};
#[cfg(feature = "std")]
use std::borrow::Cow;
#[cfg(target_arch = "wasm32")]
use serde::{Deserialize, Serialize};
#[cfg(not(feature = "std"))]
use alloc::{borrow::Cow, string::String};
/// Token which represents a valid CDDL character or sequence
#[derive(PartialEq, Debug, Clone)]
... |
use crate::signatures::SignatureRegistry;
use crate::{Config, Trap};
use anyhow::Result;
use once_cell::sync::OnceCell;
#[cfg(feature = "parallel-compilation")]
use rayon::prelude::*;
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::Arc;
#[cfg(feature = "cache")]
use wasmtime_cache::CacheConfig;
use wasmtim... |
/*
Copyright 2021 Volt 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
Unless required by applicable law or agreed t... |
use std::collections::BTreeMap;
use std::sync::mpsc::Sender;
use log::debug;
use pueue::log::{clean_log_handles, read_and_compress_log_files};
use pueue::message::*;
use pueue::state::SharedState;
use pueue::task::{Task, TaskStatus};
use crate::aliasing::insert_alias;
use crate::response_helper::*;
static SENDER_ER... |
use std::borrow::Cow;
use std::convert::TryInto;
use differential_datalog::program::Relation;
use differential_datalog::record::IntoRecord;
// Trait that must be implemented by an instance of a DDlog program.
// Type that represents a set of changes to DDlog relations.
// Returned by `DDlog::transaction_commit_dump_c... |
use core::{
fmt::{self, Debug, Formatter},
u16, u8,
};
use crate::{
bytesrepr,
contract_api::turef::AccessRightsError,
system_contracts::{mint, pos},
value::account::{AddKeyFailure, RemoveKeyFailure, SetThresholdFailure, UpdateKeyFailure},
};
/// All `Error` variants defined in this library ot... |
//! Transaction dispatcher.
use std::{
collections::{BTreeMap, BTreeSet},
convert::TryInto,
marker::PhantomData,
sync::{atomic::AtomicBool, Arc},
};
use anyhow::anyhow;
use slog::error;
use thiserror::Error;
use oasis_core_runtime::{
self,
protocol::HostInfo,
storage::mkvs,
transaction... |
#[cfg(feature = "std")]
use crate::primitive::write_varlen_slice;
use crate::{
prelude::*,
primitive::{read_varlen_slice, SmpteTime},
};
/// Represents a fully parsed track event, with delta time.
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub struct Event<'a> {
pub delta: u28,
pub kind: EventKind<'a... |
// 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.
use crate::args::Macro;
... |
#![allow(unknown_lints)]
use std::fs::File;
use std::path::Path;
use std::fmt;
use std::io::Write;
extern crate u15;
use u15::U15;
const BINARY_FILE: &[u8] = include_bytes!("../challenge.bin");
#[allow(dead_code)]
const TEST_PROGRAM: &[u16] = &[9, 32_768, 32_769, 4, 19, 32_768];
const MAX_WM_WORD: u16 = 32_775;
con... |
use super::*;
use quaint::prelude::Queryable;
use std::collections::{BTreeMap, HashMap};
use std::{borrow::Cow, sync::Arc};
use tracing::debug;
fn is_mariadb(version: &str) -> bool {
version.contains("MariaDB")
}
enum Flavour {
Mysql,
MariaDb,
}
impl Flavour {
fn from_version(version_string: &str) ->... |
use std::{borrow::Cow, net::Ipv4Addr};
use std::fmt::Debug;
#[macro_use] extern crate nom;
use nom::IResult;
use nom::number::complete::{be_u8, be_u16, be_u32};
use nom::bytes::complete::take;
use nom::multi::count;
#[derive(Debug, Default)]
pub struct DnsHeader {
pub id: u16,
pub message_type: u8,
opcod... |
use super::*;
use crossbeam_epoch::{Atomic, Owned};
use flurry::{epoch::Guard, HashMap as FlurryHashMap};
use itertools::Itertools;
use kvsengine::KvsEngine;
use parking_lot::{Mutex, MutexGuard};
use positioned_io::ReadAt;
use serde::{Deserialize, Serialize};
use smallvec::{smallvec, SmallVec};
use std::{
collectio... |
use super::utils::{Update, *};
use crate::bot::command::*;
use crate::database::Gallery;
use crate::utils::get_message_url;
use crate::*;
use anyhow::{Context, Result};
use chrono::{Duration, Utc};
use std::convert::TryInto;
use teloxide::types::*;
use tokio_stream::wrappers::UnboundedReceiverStream;
// TODO: 新本子继承父画廊... |
use std::marker::PhantomData;
use std::path::PathBuf;
use anyhow::{ensure, Context};
use filecoin_hashers::{Domain, HashFunction, Hasher, PoseidonArity};
use fr32::bytes_into_fr_repr_safe;
use generic_array::typenum;
use merkletree::store::{ReplicaConfig, StoreConfig};
use rayon::prelude::*;
use serde::{Deserialize, S... |
use super::viewmodel::*;
use super::attributes::*;
use super::gtk_control::*;
use super::property_action::*;
use super::gtk_user_interface::*;
use super::consolidate_actions::*;
use super::super::gtk_event::*;
use super::super::gtk_action::*;
use super::super::gtk_widget_event_type::*;
use flo_ui::*;
use flo_ui::sessi... |
#![allow(non_camel_case_types)]
use libc;
use libc::{ c_ulong, c_long, c_int, c_uint, size_t, c_void, ssize_t, c_char };
pub enum snd_pcm_status_t { }
pub enum snd_pcm_sw_params_t { }
pub enum snd_pcm_t { }
pub enum snd_pcm_hw_params_t { }
pub type snd_pcm_uframes_t = c_ulong;
pub type snd_pcm_sframes_t = c_long;
pu... |
extern crate log;
extern crate serde_json;
use std::net::TcpStream;
use std::io::Read;
use std::io::Write;
use std::io::Error;
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering;
use std::string::FromUtf8Error;
use std::string::String;
use std::str::FromStr;
use std::fmt;
use std::result;
use std::tim... |
use pipeline::model::Triangle;
use crate::{
algebra::{
matrix::Matrix4f,
vector::{Vector3f, Vector4f},
},
pipeline::{
fragment_shader::{make_shader, FragmentShader},
light::Light,
model::Vertex,
},
};
use crate::{
pipeline::{
camera::Camera, model::Mo... |
use super::ast::*;
use std::collections::HashMap;
macro_rules! map(
{ $($key:expr => $value:expr),+ } => {
{
let mut m = ::std::collections::HashMap::new();
$(
m.insert($key, $value);
)+
m
}
};
);
#[derive(Debug)]
#[derive(Partia... |
#![allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
use xlcall::XLREF12;
use xlcall::XLMREF12;
use std::{mem, fmt, slice};
use xlcall::{XLOPER12, LPXLOPER12, xloper12__bindgen_ty_1, xloper12__bindgen_ty_1__bindgen_ty_3,
xltypeNil, xltypeInt, xltypeStr, xltypeErr, xltypeMissing, xltypeNum... |
// Copyright 2020-2021 <NAME> under the terms of the MIT License as detailed
// in the accompanying file README.md or <https://opensource.org/licenses/MIT>.
//! Get from [`Space`] to [`Tess`].
use std::collections::HashSet;
use std::fmt;
use std::sync::{Arc, Mutex, Weak};
use cgmath::{EuclideanSpace as _, Matrix4, P... |
#[path = "tuples.rs"]
pub mod tuples;
/*
The Ray Tracer Challenge (<NAME>)
-------------------------------------
Chapter 3: Matrices
*/
pub struct Matrix2 (
[[f32;2];2]
);
#[derive(Debug)]
pub struct Matrix3 (
[[f32;3];3]
);
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct Matrix (
pub [[f32;4];4]
)... |
//! Feather, a Minecraft server implementation in Rust.
//!
//! This is the developer documenation, and anyone wishing to contribute
//! should read this first.
//!
//! The core of Feather is based on [`legion`](https://github.com/TomGillen/legion),
//! a fast ECS for Rust, and [`tonks`](https://github.com/feather-rs/t... |
use crate::frame_info::GameInput;
use crate::network::compression::{decode, encode};
use crate::network::non_blocking_socket::NonBlockingSocket;
use crate::network::udp_msg::{
ConnectionStatus, Input, InputAck, MessageBody, MessageHeader, QualityReply, QualityReport,
SyncReply, SyncRequest, UdpMessage,
};
use c... |
use std::collections::HashMap;
use std::path::PathBuf;
use std::str::FromStr;
use clap::Parser;
use anni_clap_handler::{Context as ClapContext, Handler, handler};
use anyhow::{bail, Context};
use indicatif::{MultiProgress, ProgressBar, ProgressStyle};
use rand::Rng;
use serde_json::Value;
use tokio::fs;
use ssup::{Clie... |
// 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... |
use ggez;
use ggez::graphics;
use ggez_goodies::scene;
use nalgebra as na;
use ncollide2d as nc;
use rand;
use specs::{self, Builder, Join};
use warmy;
use std::f32;
use components::*;
use error::Err;
use input;
use resources;
use scenes::*;
use systems::*;
use util::*;
use world::World;
pub struct LevelScene {
... |
#[macro_use]
extern crate futures;
extern crate libc;
#[macro_use]
extern crate log;
extern crate mio;
extern crate nix;
extern crate pty;
#[macro_use]
extern crate tokio_core;
extern crate tokio_io;
use std::io::{self, Read, Write};
use std::ffi::CStr;
use std::fs::{File, OpenOptions};
use std::net::ToSocketAddrs;
us... |
use ::serde::{Deserialize, Serialize};
use std::fmt;
use crate::{
basics::*,
serde::{from_retroshare_wire, to_retroshare_wire},
tlv::*,
*,
};
// enum class RsGossipDiscoveryItemType : uint8_t
// {
// PGP_LIST = 0x1,
// PGP_CERT = 0x2, // deprecated
// CONTACT = 0x5,
... |
use rand::distributions::{Distribution, Uniform};
use rand::Rng;
use rand::SeedableRng;
use rand_chacha::ChaCha20Rng;
type Step = i64;
/// A [reservoir sampling] data structure, with support for preemption and deferred "commits" of
/// records to a separate destination for better concurrency. This structure always ke... |
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
use std::{
cell::{Ref, RefCell},
mem,
ops::{Deref, DerefMut},
};
use emacs::{defun, Result, Value, Env, GlobalRef, Vector, IntoLisp, FromLisp};
use tree_sitter::{Tree, TreeCursor, Node};
use crate::{
types::{self, Shared, BytePos},
node::{RNode, LispUtils},
lang::Language,
};
emacs::use_symbo... |
use crate::scene::*;
use raylib::prelude::*;
use std::io;
use std::io::{Read, Write};
use std::net::TcpStream;
use std::vec::Vec;
use common::PongInputState;
pub const GAME_CONFIG: PongGameConfig = PongGameConfig {
arena_size: Vector2::new(1000.0, 800.0),
paddle_size: Vector2::new(25.0, 175.0),
paddle_f... |
// Copyright (c) Meta Platforms, Inc. and affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the "hack" directory of this source tree.
use crate::decl_defs::{self, shallow, ty, DeclTy, DeclTy_, FunParam, FunType, UserAttribute};
use crate::reason::Reason;
use pos::{Con... |
// Copyright (c) 2021 Quark Container Authors / 2018 The gVisor Authors.
//
// 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 ... |
// Built-in Lints
#![deny(warnings, missing_copy_implementations)]
// Clippy lints
#![allow(clippy::option_map_unwrap_or_else, clippy::option_map_unwrap_or)]
#![warn(
clippy::wrong_pub_self_convention,
clippy::mut_mut,
clippy::non_ascii_literal,
clippy::similar_names,
clippy::unicode_not_nfc,
cl... |
use super::app_validation_workflow;
use super::error::WorkflowResult;
use super::sys_validation_workflow::sys_validate_element;
use crate::conductor::api::CellConductorApiT;
use crate::conductor::interface::SignalBroadcaster;
use crate::core::queue_consumer::OneshotWriter;
use crate::core::queue_consumer::TriggerSender... |
//! This crate provides the `AnyMap` type, a safe and convenient store for one value of each type.
#![warn(missing_docs, unused_results)]
use std::any::TypeId;
use std::marker::PhantomData;
use raw::RawMap;
use any::{UncheckedAnyExt, IntoBox, Any};
macro_rules! impl_common_methods {
(
field: $t:ident.$f... |
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use anyhow::{format_err, Context as _, Error};
use bt_a2dp as a2dp;
use fidl_fuchsia_media::{AudioFormat, AudioUncompressedFormat, DomainFormat, PcmFormat}... |
// Copyright © 2016-2017 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
use std::convert::{From, Into};
use std::collections::HashMap;
use rabble::{self, Pid, CorrelationId, Envelope};
use time::{SteadyTime, Duration};
use msg::Msg;
use namespace_msg::NamespaceMsg;
use vr::vr_fsm::{Transition... |
// run in release mode
// `cargo run --release --example mic_playback`
use web_audio_api::buffer::AudioBuffer;
use web_audio_api::context::{AudioContext, AudioContextRegistration, BaseAudioContext};
use web_audio_api::media::Microphone;
use web_audio_api::node::BiquadFilterType;
use web_audio_api::node::{
Analyser... |
// Copyright 2015-2016 Mozilla Foundation. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at you... |
pub mod builder;
pub use builder::Win32OffsetBuilder;
#[cfg(feature = "symstore")]
pub mod pdb;
#[cfg(feature = "symstore")]
pub mod symstore;
pub mod offset_table;
#[doc(hidden)]
pub use offset_table::{Win32OffsetFile, Win32OffsetTable, Win32OffsetsArchitecture};
#[cfg(feature = "symstore")]
pub use {
self::pdb... |
use crate::jcli_app::utils::{rest_api::RestApiRequestBody, CustomErrorFiller};
use mime::Mime;
use openapiv3::{
OpenAPI, Operation, Parameter, ParameterData, ParameterSchemaOrContent, PathItem, PathStyle,
Paths, ReferenceOr, RequestBody, Schema, SchemaKind, StringFormat, StringType, Type,
VariantOrUnknownOr... |
use crate::{
core::Context,
custom_client::TwitchVideo,
database::MinimizedPp,
embeds::{osu, Author, EmbedBuilder, EmbedData, Footer},
error::PpError,
util::{
constants::{AVATAR_URL, TWITCH_BASE},
datetime::{how_long_ago_dynamic, HowLongAgoFormatterDynamic},
matcher::high... |
use std::fmt;
use std::i32;
use std::borrow::Cow;
use std::collections::BTreeMap;
use kailua_syntax::Str;
use diag::{Origin, TypeReport, TypeResult};
use super::{Display, DisplayState, T, Ty, Slot, TypeContext, Union, Lattice, RVar};
/// A key allowed in the row variable.
#[derive(Clone, PartialEq, Eq, PartialOrd, Or... |
use async_std::future::timeout;
use async_std::sync::Arc;
use async_std::task::{Builder, JoinHandle};
use futures::future::join_all;
use handlebars::TemplateRenderError;
use log::{error, info, trace, warn};
use chord_core::action::Action;
use chord_core::case::{CaseAssess, CaseState};
use chord_core::collection::TailD... |
use crate::idl::Idl;
use crate::in_out_config::InOutConfig;
use crate::lang::Lang;
use crate::lang_config::LangConfig;
use crate::protoc;
use anyhow::{anyhow, Context, Result};
use clap::{crate_version, App, Arg, ArgMatches, Values};
use std::env;
use std::ffi::OsString;
use std::path::{Path, PathBuf};
use tempfile::{t... |
use crate::clipmap::neighborhood_subdiv::{NEIGHBORHOODS, NEIGHBORHOODS_PARENTS};
use crate::clipmap::{ChunkClipMap, NodeState};
use crate::core::geometry::Sphere;
use crate::core::glam::{IVec3, Vec3A};
use crate::{
clipmap::{ChildIndex, Level, NodeLocation, StateBit, VisitCommand},
coordinates::{chunk_bounding_... |
use crate::common::{self, *};
use cocoa::appkit::{NSBackingStoreBuffered, NSView, NSWindow, NSWindowStyleMask};
use dispatch::Queue;
const BASE_CLASS: &str = "NSWindow";
lazy_static! {
static ref WINDOW_CLASS: common::RefClass = unsafe { register_window_class("PlyguiWindow", BASE_CLASS, |_| {}) };
static ref... |
use crate::octree_dbvt::{OctreeDBVT, OctreeDBVTVisitor};
use building_blocks_core::prelude::*;
use building_blocks_storage::{Octant, VisitStatus};
use core::hash::Hash;
use nalgebra::{self as na, zero, Isometry3, Translation3, UnitQuaternion};
use ncollide3d::{
bounding_volume::{BoundingVolume, HasBoundin... |
use crate::adsorption::{ExternalPotential, FluidParameters};
use crate::convolver::ConvolverFFT;
use crate::functional::{HelmholtzEnergyFunctional, MoleculeShape, DFT};
use crate::functional_contribution::FunctionalContribution;
use crate::geometry::{Axis, Geometry, Grid};
use crate::profile::{DFTProfile, CUTOFF_R... |
//! A binary that runs automatically on the `fabric` that is responsible for forwarding output back to `cargo deploy` at the user's terminal.
/*
TODO: can lose processes such that ctrl+c doesn't kill them. i think if we kill while spawning.
*/
#![warn(
missing_copy_implementations,
missing_debug_implementations,
... |
//! # UI
//!
//! The UI module contains logic for matching keyboard and system events
use sdl2::event::Event;
use sdl2::keyboard::Mod;
use sdl2::mouse::MouseButton;
use std::time::Instant;
/// Action represents the possible actions that could result from an event
#[derive(Debug, Clone)]
pub enum Action<'a> {
/// ... |
use chrono::{Duration, Utc};
use futures::executor::block_on;
use jsonwebtoken as jwt;
use mockito::{
mock,
Matcher::{self, AllOf, UrlEncoded},
Mock,
};
use serde::Serialize;
use serde_json::json;
use url::Url;
use super::*;
use crate::test_util::*;
const POST: &str = "POST";
const GET: &str = "GET";
cons... |
mod intcode;
mod map;
use intcode::{load_code, spawn_processes};
use std::cmp::{max, min};
use std::collections::{HashMap, HashSet};
use std::time::{SystemTime, UNIX_EPOCH};
type Coordinate = (isize, isize);
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy)]
pub enum Move {
R(usize),
L(usize),
}
#[derive(D... |
use chrono::DateTime;
use chrono::offset::{TimeZone, Utc};
use nom::branch::alt;
use nom::bytes::complete::{tag, take};
use nom::combinator::{all_consuming, flat_map};
use nom::Err as NomErr;
use nom::error::{Error, ErrorKind};
use nom::IResult;
use nom::number::complete::{be_i64, be_u16, be_u8};
use nom::sequence::tup... |
//! Reflow documentation comments to a desired line width.
//!
//! Note that for commonmark this might not be possible with links.
//! The reflow is done based on the comments no matter the content.
use anyhow::{anyhow, Result};
use crate::checker::Checker;
use crate::documentation::{CheckableChunk, Documentation};
u... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.