text stringlengths 7.05k 33.9k |
|---|
//! Load config files.
use crate::util::*;
use crate::OxWM;
use crate::Result;
use std::collections::HashMap;
use std::fs;
use std::path::Path;
use serde::Deserialize;
use serde::Deserializer;
use serde::Serialize;
use serde::Serializer;
use thiserror::Error;
use x11rb::connection::Connection;
use x11rb::protocol:... |
//! Various helpers and companion code for the parser are put here to keep the grammar definition
//! uncluttered.
use std::collections::hash_map::Entry;
use std::collections::HashMap;
use std::fmt::Debug;
use std::rc::Rc;
use codespan::FileId;
use crate::{
identifier::Ident,
label::Label,
mk_app, mk_fun,... |
//! # Piano_Keyboard
//!
//! [](https://travis-ci.org/gin66/piano_keyboard)
//!
//! This crate provides the graphical elements in order to draw a piano keyboard
//! with close to realistic, pixel accurate appearance.
//!
//! Reference for the ... |
use mio::*;
use std::time::{SystemTime, Duration};
use std::ops::Add;
use std::error::Error;
use std::rc::Rc;
use mio::net::{TcpListener, TcpStream};
use crate::server::Server;
use std::cell::RefCell;
use crate::client::*;
use std::collections::{VecDeque, HashMap};
use std::sync::atomic::Ordering;
type AeTimeProc = fn... |
use crate::{
error::{ErrorExt, Result},
graphics::{Color, Color2, GString, Grapheme, Style, Tile},
input::{translate_key, Event, KeyEvent, ResizeEvent},
math::plane::{Coord2, Nat},
};
use crossterm::{
cursor,
event::{self, Event as CrosstermEvent},
style,
terminal,
Command,
};
use nd... |
// The rusty_bft library
// Core functionalities of the SMR
mod communication;
pub mod cryptografer;
mod quorum;
use communication::*;
pub use cryptografer::*;
use quorum::*;
use std::collections::BTreeMap;
use std::fs::File;
use std::io::{self, BufRead};
use std::time;
#[derive(Debug)]
pub struct Node {
pub id:... |
use crate::clausify;
use crate::io::exit;
use crate::io::szs;
use crate::prelude::*;
use fnv::FnvHashMap;
use memmap::Mmap;
use std::env;
use std::fmt;
use std::fs::File;
use std::io;
use std::path::{Path, PathBuf};
use std::sync::Arc;
use tptp::{cnf, common, fof, top, TPTPIterator};
fn report_os_error<D: fmt::Display... |
//!
//! A library providing simple `Color` and `Gradient` types along with useful transformations and
//! presets.
//!
//!
//! Inspiration taken from [elm-lang's color module]
//! (https://github.com/elm-lang/core/blob/62b22218c42fb8ccc996c86bea450a14991ab815/src/Color.elm)
//!
//!
//! Module for working with colors. ... |
pub mod cli;
use std::{
collections::HashMap,
convert::From,
env, fmt,
fmt::Display,
num::ParseIntError,
path::{Path, PathBuf},
str::FromStr,
};
/// [`std::result::Result`] type with [`Error`] as the error type.
pub type Result<T> = std::result::Result<T, Error>;
/// Error enum for the en... |
// Copyright 2019 MaidSafe.net limited.
//
// This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT
// https://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD
// https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied,
// modified, or d... |
// WARNING still updating the code, it works, but is still in process the refactor.
pub mod eddsa;
use poseidon_rs::Poseidon;
pub type Fr = poseidon_rs::Fr;
#[macro_use]
extern crate ff;
#[macro_use]
extern crate arrayref;
extern crate generic_array;
//extern crate mimc_rs;
extern crate num;
extern crate num_bigint... |
// Copyright 2020 MaidSafe.net limited.
//
// This SAFE Network Software is licensed to you under the MIT license <LICENSE-MIT
// http://opensource.org/licenses/MIT> or the Modified BSD license <LICENSE-BSD
// https://opensource.org/licenses/BSD-3-Clause>, at your option. This file may not be copied,
// modified, or di... |
//! Input details.
//!
//! Inputs are special "functions" which can store a user-provided value and indicate to dependent
//! queries when its value was changed.
//!
//! # Design: input as a trait
//!
//! Here's a loose collection of thoughts which led to this design.
//!
//! ## `initial` fn
//!
//! Input nodes have an... |
use crate::{
compute_truncation_size, crh::FieldBasedHash, signature::FieldBasedSignatureScheme, Error,
};
use algebra::{
convert, leading_zeros, serialize::*, Field, FromBytes, FromBytesChecked, Group, PrimeField,
ProjectiveCurve, SemanticallyValid, ToBits, ToBytes, ToConstraintField, UniformRand,
};
use r... |
use crate::bititer::BitIter;
use crate::failx::*;
use crate::flag::Flag;
use crate::perm::Perm;
use crate::qualifier::Qualifier;
use crate::sys::*;
use crate::util::util_common;
use log::debug;
use nix::unistd::{Gid, Uid};
use scopeguard::defer;
use std::ffi::{c_void, CString};
use std::io;
use std::os::unix::ffi::OsS... |
#![allow(unused)]
#![allow(non_camel_case_types)]
use nix::errno::Errno;
use nix::libc::{c_long, c_uint, c_int};
use nix::sys::ptrace::*;
use nix::sys::signal::Signal;
use nix::unistd::Pid;
use nix::{Error, Result};
use std::ptr;
use std::mem;
use std::slice;
use std::mem::MaybeUninit;
use std::{fmt::Display, convert:... |
// Copyright 2021 Centrifuge Foundation (centrifuge.io).
//
// This file is part of the FUDGE project.
// FUDGE 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... |
use pulldown_cmark::{Event, Parser, Tag};
use rayon::prelude::*;
use serde_derive::Serialize;
use crate::config::Config;
use crate::document::Document;
use crate::error::Result;
use crate::front_matter::*;
use crate::io_utils::slurp;
use crate::utils::DebugTimer;
use std::path::PathBuf;
#[derive(Serialize, Debug)]
pu... |
use std::collections::hash_map::Entry;
use std::rc::Rc;
use std::time::Instant;
use crate::grid::{grid::NEIGHBORS_5, Droplet, DropletId, Grid, GridView, Location, Rectangle};
use crate::util::{minheap::MinHeap, HashMap, HashSet};
pub type Path = Vec<Location>;
pub struct RoutingRequest<'a> {
pub gridview: &'a Gr... |
use std::{cell::RefCell, sync::Arc};
use ray_tracing::{
bvh::BvhNode,
hittable::{HittableList, RotateY, Translate},
material::{Dielectric, DiffuseLight, Lambertian, Mat, Metal},
medium,
objects::{rect, Cube, MovingSphere, Sphere},
rand_range,
ray::{Point, Vec3},
render::Color,
textu... |
// 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>.
//! Rotations which exchange axes (thus not leaving the integer grid).
//! This module is private but reexported by its parent.
use std::ops::Mul;
use cgmath::{... |
use super::*;
use nix::sys::stat::SFlag;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct Linux {
// UIDMapping for supporting user namespaces
#[serde(default, rename = "uidMappings")]
pub uid_mappings: Vec<LinuxIdMapping>,
// GIDMapping for suppo... |
extern crate ndarray;
extern crate ndarray_linalg;
use ndarray::*;
use ndarray_linalg::*;
use crate::network_config::*;
use crate::network_rollout::*;
use crate::array_utils::*;
use crate::game_state::*;
use crate::normal_inverse_chi_squared::*;
use crate::game_data::*;
use std::fmt;
use rand::Rng;
use tch::{kind, ... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - SPI_CMD"]
pub cmd: CMD,
#[doc = "0x04 - SPI_ADDR"]
pub addr: ADDR,
#[doc = "0x08 - SPI_CTRL"]
pub ctrl: CTRL,
#[doc = "0x0c - SPI_CLOCK"]
pub clock: CLOCK,
#[doc = "0x10 - SPI_USER"]
pub user: USER,
... |
use anyhow::{anyhow, bail, Context, Error};
#[allow(deprecated)]
use std::{
fmt,
hash::{Hash, Hasher, SipHasher},
path::{Path, PathBuf},
};
use tracing::debug;
use url::Url;
fn to_hex(num: u64) -> String {
const CHARS: &[u8] = b"0123456789abcdef";
let bytes = &[
num as u8,
(num >> ... |
use snarkblock::ark_serialize::CanonicalSerialize;
use snarkblock::test_util::{rand_issuance, test_rng};
use snarkblock::{
agg_chunk_setup, agg_iwf_setup, chunk_setup, issuance_and_wf_setup, AggChunkProver,
AggChunkVerifier, AggIwfProver, AggIwfVerifier, BlocklistCom, Chunk, ChunkPreparer, ChunkProof,
Chunk... |
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
// This file is part of Parity Ethereum.
// Parity Ethereum 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 yo... |
// Copyright 2016 click2stream, 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... |
use {
super::{
bid::{BId, SortableBId},
bline::BLine,
},
crate::{
app::AppContext,
errors::TreeBuildError,
git::{GitIgnoreChain, GitIgnorer, LineStatusComputer},
pattern::Candidate,
path::{SpecialHandling, SpecialPathList},
task_sync::Computati... |
// Copyright 2018 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.
#![warn(missing_docs)]
mod asset;
mod builder;
mod debug;
mod family;
mod inspect;
mod typeface;
use {
self::{
asset::AssetCollection,
... |
use crate::album::Album;
use crate::artist::Artist;
use crate::episode::Episode;
use crate::playable::Playable;
use crate::playlist::Playlist;
use crate::spotify_worker::WorkerCommand;
use crate::track::Track;
use crate::ui::pagination::{ApiPage, ApiResult};
use chrono::{DateTime, Duration as ChronoDuration, Utc};
use ... |
//! Signal processing core logic.
use core::cell::Cell;
use core::iter::{Cycle, Iterator, Peekable};
use core::slice::{self, Iter as SliceIter};
use dsp;
use dsp::control::CommandReceiver;
use dsp::signal::Chain;
use crate::config;
use crate::{debug, static_buf};
use crate::dsp::buffer::{SampleContainer, BufferState... |
// Copyright 2017 pdb Developers
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to tho... |
extern crate conrod_core;
#[macro_use]
extern crate vulkano;
use std::error::Error as StdError;
use std::fmt;
use std::sync::Arc;
use conrod_core::mesh::{self, Mesh};
use conrod_core::text::rt;
use conrod_core::{image, render, Rect, Scalar};
use vulkano::buffer::cpu_pool::CpuBufferPool;
use vulkano::buffer::BufferUs... |
#![forbid(unsafe_code)]
mod certificates;
mod metadata;
use metadata::{FileOptions, PresetMeta};
use {
once_cell::sync::Lazy,
percent_encoding::{percent_decode_str, percent_encode, AsciiSet, CONTROLS},
rcgen::{Certificate, CertificateParams, DnType},
rustls::{NoClientAuth, ServerConfig},
std::{
... |
use rustc::ty::{self, TyCtxt, Ty, Instance};
use rustc::ty::layout::{self, LayoutOf};
use rustc::ty::subst::Substs;
use rustc::hir::def_id::DefId;
use rustc::mir;
use rustc::middle::const_val::ErrKind::{CheckMatchError, TypeckError};
use rustc::middle::const_val::{ConstEvalErr, ConstVal};
use rustc_const_eval::{lookup_... |
//! Interfaces for retrieving packages (and information about them) from different sources.
//!
//! Packages can originate from several sources, which complicates getting metadata about them.
//! This module is responsible for smoothing over that process, as well as coordinating the actual
//! retrieval of packages fro... |
use anyhow::Result;
/// AST used for code generation, as opposed to the parsing AST
use std::{collections::BTreeMap, collections::BTreeSet, rc::Rc};
use crate::ast;
use crate::lexer::SrcSpan;
use std::fmt::Debug;
#[derive(Debug, PartialEq, Eq, Clone)]
pub enum TopDeclaration {
Struct(Struct),
Enum(Enum),
... |
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use {
anyhow::{format_err, Context as _, Error},
fidl_fuchsia_bluetooth::{DeviceClass, MAJOR_DEVICE_CLASS_TOY},
fidl_fuchsia_bluetooth_control:... |
/// This file translates Booth_NPP.py
/// We want to reduce each unique preference sequence to some ordering
/// of each of the parties. For example, for four parties there are 65 orderings:
/// (0!) + (4 * 1!) + (6 * 2!) + (4 * 3!) + (4!)
use anyhow::{bail, Context, Result};
use factorial::Factorial;
use indexmap... |
use anyhow::{anyhow, Context, Result};
use async_trait::async_trait;
use homectl_types::device::{CorrelatedColorTemperature, DeviceColor};
use homectl_types::utils::{cct_to_rgb, xy_to_cct};
use homectl_types::{
device::{Device, DeviceId, DeviceState, Light},
event::{Message, TxEventChannel},
integration::{I... |
use linux_loader::{
cmdline::Cmdline,
loader::{
load_cmdline,
KernelLoader,
elf::Elf as Loader,
}
};
use linux_loader::cmdline::Cmdline as LoaderKernelCmdline;
use vm_memory::{Bytes, GuestAddress};
use vmm_sys_util::eventfd::EventFd;
use vm_superio::serial;
use std::{
fs::File,
... |
// Copyright Materialize, Inc. and contributors. All rights reserved.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by ... |
use super::layout_data::*;
use super::layout::*;
/// Alignment of a paragraph.
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
#[repr(u8)]
pub enum Alignment {
Start,
Middle,
End,
}
impl Default for Alignment {
fn default() -> Self {
Self::Start
}
}
/// Line breaking support for a paragraph.... |
pub mod jsx_parse_errors;
use rome_js_syntax::JsSyntaxKind::*;
use rome_rowan::TextRange;
use crate::lexer::{JsSyntaxKind, LexContext, ReLexContext, T};
use crate::parser::expected_token;
use crate::syntax::expr::{
is_nth_at_identifier_or_keyword, parse_expression, parse_name, ExpressionContext,
};
use crate::syn... |
use std::fmt;
use cosmwasm_std::{
from_binary, log, to_binary, to_vec, Api, Binary, CanonicalAddr, CosmosMsg, Empty, Env, Extern,
HandleResponse, HumanAddr, InitResponse, Querier, QueryResponse, StdError, StdResult, Storage,
WasmQuery,
};
use k256::{ecdsa::VerifyingKey, CompressedPoint};
use schemars::Json... |
//! Types to help with building simulated networks.
//! Note this is an experimental prototype.
#![warn(missing_docs)]
use std::collections::{BTreeMap, HashMap};
use std::sync::Arc;
use ::fixt::prelude::*;
use hdk::prelude::*;
use holo_hash::{DhtOpHash, DnaHash};
use holochain_conductor_api::conductor::ConductorConfi... |
//! Provides a 3d transformation gizmo that can be used to manipulate 4x4
//! transformation matrices. Such gizmos are commonly used in applications
//! such as game engines and 3d modeling software.
//!
//! # Creating a gizmo
//! For a more complete example, see the online demo at <https://urholaukkarinen.github.io/eg... |
//! A [`metrics`][metrics]-compatible exporter that outputs metrics to clients over TCP.
//!
//! This exporter creates a TCP server, that when connected to, will stream individual metrics to
//! the client using a Protocol Buffers encoding.
//!
//! # Backpressure
//! The exporter has configurable buffering, which allow... |
//! Message Module
//!
//!
//!
//!
//!
//! Check link below for more info:
//! https://github.com/ValvePython/steam/blob/09f4f51a287ee7aec1f159c7e8098add5f14bed3/steam/core/msg/headers.py
use std::fmt::Formatter;
use bytes::BytesMut;
use steam_language_gen::generated::enums::EMsg;
use steam_language_gen::generated::h... |
pub mod shaders;
pub mod ship;
pub mod transform;
use crate::canvas::CanvasData;
use crate::input::UserInput;
use crate::programs::asteroid::ship::Asteroid;
use crate::transform::Transform as UserTransform;
use crate::utils::console_log;
use crate::RenderObjectTrait;
use core::f32::consts::PI;
use js_sys::Function;
use... |
use crate::{
backend::FileReferenceMap,
environment::{
symbol::{PhpSymbolKind, Symbol, SymbolAlias, Visibility},
visitor::name_resolver::NameResolver,
},
parser::{node::NodeRange, token::TokenType},
};
use crate::{environment::get_range, environment::in_range, parser::node::Node as AstNo... |
use super::{Lab, CBRT_EPSILON, EPSILON, KAPPA};
use std::arch::x86_64::*;
use std::{f32, iter, mem};
static BLANK_LAB: Lab = Lab {
l: f32::NAN,
a: f32::NAN,
b: f32::NAN,
};
/// Converts a slice of `Lab`s to `[u8; 3]` RGB triples using 256-bit SIMD operations.
///
/// # Panics
/// This function will panic ... |
use std::fmt;
use std::error::Error as StdError;
use std::io;
use std::iter::Peekable;
use std::str::FromStr;
use core::fmt::Debug;
/// location
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
struct Loc(usize, usize);
impl Loc {
fn merge(&self, other: &Loc) -> Self {
use std::cmp::{max, min};
Loc(mi... |
use std::borrow::Borrow;
use std::cmp::{Ordering, PartialEq, PartialOrd};
use std::fmt::{self, Debug, Display};
use std::ops::Deref;
use hdf5_sys::h5t::{
H5T_cdata_t, H5T_class_t, H5T_cset_t, H5T_order_t, H5T_sign_t, H5T_str_t, H5Tarray_create2,
H5Tcompiler_conv, H5Tcopy, H5Tcreate, H5Tenum_create, H5Tenum_ins... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - MTB Position"]
pub position: POSITION,
#[doc = "0x04 - MTB Master"]
pub master: MASTER,
#[doc = "0x08 - MTB Flow"]
pub flow: FLOW,
#[doc = "0x0c - MTB Base"]
pub base: BASE,
_reserved4: [u8; 3824usize],
... |
// Copyright 2018 Parity Technologies (UK) Ltd.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, mer... |
#![no_main]
#![feature(map_first_last)]
#![feature(map_try_insert)]
use std::cmp::Ordering;
use std::fmt::Debug;
use std::iter::FromIterator;
use std::ops::Bound::Included;
use std::ops::Range;
use libfuzzer_sys::{
arbitrary::{unstructured::Int, Arbitrary, Unstructured},
fuzz_target,
};
use scapegoat::map_ty... |
use action::Action;
use gloo_timers::callback::Interval;
use js_sys::{Array, Uint8Array};
use midi::export_midi;
use views::PIANO_KEYS_WIDTH;
use wasm_bindgen::{prelude::Closure, JsCast, JsValue};
use web_sys::{Blob, HtmlAnchorElement, HtmlElement, MidiAccess, MidiOutput, SvgLineElement, Url};
use yew::{events::MouseEv... |
/*
Copyright (c) NCC Group, 2021
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following di... |
use crate::errors::ParseEnumError;
use super::{Color, clamp, EPSILON, Hsl};
use std::fmt::Display;
use crate::color::format_color;
use std::str::FromStr;
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum Intensity {
Average,
Rec601Luma,
Rec709Luma,
Brightness,
Lightness,
Saturation,
Re... |
#![doc(html_root_url = "https://docs.rs/faimm/0.2.1")]
//! This crate provides indexed fasta access by using a memory mapped file to read the sequence
//! data. It is intended for accessing sequence data on genome sized fasta files and provides
//! random access based on base coordinates. Because an indexed fasta file ... |
use olc_pge as olc;
struct Edge {
sx: f32, sy: f32, // start coordinate
ex: f32, ey: f32 // end coordinate
}
#[derive(Copy, Clone)]
struct Cell {
edge_id: [usize; Direction::COUNT],
edge_exist: [bool; Direction::COUNT],
exist: bool
}
impl Default for Cell {
fn default() -> Self {
Sel... |
/*
* Copyright 2019 sukawasatoru
*
* 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... |
use crate::aws::{create_ssm_activation, ensure_ssm_service_role, wait_for_ssm_ready};
use crate::tuf::download_target;
use bottlerocket_agents::wireguard::setup_wireguard;
use bottlerocket_agents::{
aws_resource_config, decode_write_kubeconfig, TEST_CLUSTER_KUBECONFIG_PATH,
};
use bottlerocket_types::agent_config::... |
use lazy_static::lazy_static;
use crate::options::ConfigColours;
// Default widget ID
pub const DEFAULT_WIDGET_ID: u64 = 56709;
// How long to store data.
pub const STALE_MAX_MILLISECONDS: u64 = 600 * 1000; // Keep 10 minutes of data.
// How much data is SHOWN
pub const DEFAULT_TIME_MILLISECONDS: u64 = 60 * 1000; /... |
use core::cmp;
use core::ffi::c_void;
use core::fmt;
use core::ptr::NonNull;
use core::slice;
use core::str;
use std::os::raw::c_char;
use alloc::borrow::ToOwned;
use objc2::ffi;
use objc2::msg_send;
use objc2::rc::DefaultId;
use objc2::rc::{autoreleasepool, AutoreleasePool};
use objc2::rc::{Id, Shared};
use objc2::ru... |
use crate::{
chunk::{Chunk, ChunkBundle, RemeshChunk},
morton_index,
prelude::{SquareChunkMesher, Tile, TilemapChunkMesher},
render::TilemapData,
tile::RemoveTile,
TilemapMeshType,
};
use bevy::{
prelude::*,
render::{
mesh::{Indices, VertexAttributeValues},
pipeline::Prim... |
use super::*;
use std::collections::HashMap;
use ckb_dyn_lock::locks::binary::{self, Binary};
use ckb_standalone_debugger::transaction::{
MockCellDep, MockInfo, MockInput, MockTransaction, ReprMockTransaction,
};
use ckb_system_scripts::BUNDLED_CELL;
use ckb_testtool::{builtin::ALWAYS_SUCCESS, context::Context};
... |
use crate::util::clone_atomic_usize;
use crate::write_once_lock::{WriteOnceLock, WriteOnceWriteGuard};
use lib_boardgame::{GameResult, GameState};
use std::fmt;
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use std::sync::Mutex;
/// A data struct containing the results of MCTS for a single action.
#[deri... |
use std::io::Result;
use std::ffi::CString;
use std::sync::{Arc, Mutex};
//use std::collections::VecDeque;
//use core::task::Waker;
use libc::{c_int, c_void, size_t, c_char};
use std::string::String;
use std::time::Duration;
use simple_vpn::{VpnClient, VpnConnectionError, VpnDisconnectionError, PhySendError, PhyReceive... |
extern crate sdl2;
extern crate xorshift;
use std::env;
use std::fs::File;
use std::io::Read;
use std::thread;
use std::time::Duration;
use xorshift::{Rng, SeedableRng, Xoroshiro128};
use sdl2::event::Event;
use sdl2::keyboard::Keycode;
use sdl2::pixels::Color;
use sdl2::rect::Rect;
use sdl2::{Sdl, VideoSubsystem};
... |
use super::math_util::*;
use super::ogl::{array::*, buffer::*, program::*, texture::*, OglIncomplete, *};
use glow::*;
pub use hiero_pack::*;
use crate::{*,window::*,console::*};
pub use hiero_pack;
// This module renders Hiero Atlases(signed distance fields only) in OpenGL.
// Right now only 2D orthographic drawing... |
//! World view.
use graphics::types::Color;
use graphics::{Context, Graphics};
use graphics::character::CharacterCache;
use WorldController;
use AppState;
use planning::world::*;
use planning::astar::*;
/// Stores world view settings.
pub struct WorldViewSettings {
pub position: [f64; 2],
pub size: f64,
... |
use crate::error::Error;
use bitcoin::{stream_blocks, BitcoinCoreApi, BlockHash, Network, PartialAddress, Transaction, TransactionExt as _};
use futures::{
prelude::*,
stream::{iter, StreamExt},
};
use runtime::{
BtcAddress, BtcRelayPallet, Error as RuntimeError, H256Le, InterBtcParachain, InterBtcVault, Pr... |
use crate::prelude::graphql::*;
use apollo_parser::ast;
use derivative::Derivative;
use std::collections::{HashMap, HashSet};
use tracing::level_filters::LevelFilter;
#[derive(Debug, Derivative)]
#[derivative(PartialEq, Hash, Eq)]
pub struct Query {
string: String,
#[derivative(PartialEq = "ignore", Hash = "ig... |
#![allow(dead_code)]
#![allow(non_camel_case_types)]
extern crate libc;
use libc::{c_char, c_int, c_void, c_uint};
use libc::types::os::arch::c95::size_t;
pub static MDB_FIXEDMAP : c_uint = 0x01;
pub static MDB_NOSUBDIR : c_uint = 0x4000;
pub static MDB_NOSYNC : c_uint = 0x10000;
pub static... |
use std::future::Future;
#[cfg(not(target_arch = "wasm32"))]
use std::time::{Duration, Instant};
use winit::{
event::{self, WindowEvent},
event_loop::{ControlFlow, EventLoop},
};
#[cfg(test)]
#[path = "../tests/common/mod.rs"]
pub mod test_common;
#[rustfmt::skip]
#[allow(unused)]
pub const OPENGL_TO_WGPU_MAT... |
// rust lib
use std::process::exit;
use std::collections::HashMap;
type Lines = std::io::Lines<std::io::BufReader<std::fs::File>>;
// svg_generator
use rustviz_lib::data::{
ExternalEvent, Function, MutRef, Owner, Struct,
ResourceAccessPoint, StaticRef, VisualizationData, Visualizable
};
// Requires: Valid file... |
use super::{
common::SQL_INDENTATION,
common::{render_nullability, render_on_delete, Quoted},
IteratorJoin, SqlRenderer,
};
use crate::{
flavour::{MysqlFlavour, SqlFlavour, MYSQL_IDENTIFIER_SIZE_LIMIT},
pair::Pair,
sql_migration::{AddColumn, AlterColumn, AlterEnum, AlterTable, DropColumn, Redefi... |
use std::collections::{BTreeMap, VecDeque};
use std::fmt::{self, Debug};
use std::mem;
use std::sync::Arc;
use log::{debug, warn};
use rand::{self, Rng};
use rand_derive::Rand;
use serde_derive::{Deserialize, Serialize};
use hbbft::dynamic_honey_badger::Batch;
use hbbft::{
Contribution, DaStep, DistAlgorithm, Fau... |
// Copyright (C) 2018 Aprila Bank ASA
//
// alcoholic_jwt 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 version.
//
// This program is dis... |
//! Contains logic to decide which packets are sent when.
use definitions::{
algorithms::{AlgorithmCategory, AlgorithmDirection, AlgorithmRole, KeyExchangeData},
consts::{MessageType, SSH_MSG_NEWKEYS, SSH_MSG_SERVICE_ACCEPT, SSH_MSG_SERVICE_REQUEST},
parse, write, ConnectionRole, ParsedValue,
};
use rand::... |
use cpp_common::{Class, Closure, Macro, RustInvocation};
use regex::Regex;
use std::fmt;
use std::fs::File;
use std::io::Read;
use std::mem::swap;
use std::path::{Path, PathBuf};
use syn;
use syn::visit::Visit;
#[derive(Debug)]
pub enum Error {
ParseCannotOpenFile {
src_path: String,
},
ParseSyntax... |
use crate::primitives::{
group::Group,
status::{Status, StatusMatrix},
types::*,
DKGError, DKGResult, ShareError,
};
use rand_core::RngCore;
use std::collections::HashMap;
use threshold_bls::{
ecies,
group::{Curve, Element},
poly::{Idx, PrivatePoly, PublicPoly},
};
pub type ShareInfo<C> = ... |
//! fastest text uwuifier in the west
#![cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[cfg(target_arch = "x86")]
use std::arch::x86::*;
#[cfg(target_arch = "x86_64")]
use std::arch::x86_64::*;
use std::{ptr, str};
pub mod rng;
use rng::XorShift32;
pub mod bitap;
use bitap::Bitap8x16;
#[repr(align(16))]
... |
use std::ops::Mul;
pub mod data_type {
pub fn execute() {
// let i8 = 0;
// let u8 = 0;
// let i16 = 0;
// let u16 = 0;
// let i32 = 0;
// let u32 = 0;
// let i64 = 0;
// let u64 = 0;
// let i128 = 0;
// let u128 = 0;
// let isi... |
mod ctx;
mod search_table;
use ctx::CgCtx;
use super::simplify::Trans;
use super::{State, StateIdx, DFA};
use crate::ast::{RuleKind, RuleRhs};
use crate::collections::Map;
use crate::range_map::RangeMap;
use crate::semantic_action_table::{SemanticActionIdx, SemanticActionTable};
use std::convert::TryFrom;
use proc... |
use byteorder::{BigEndian, ByteOrder};
use std::cmp::Ordering;
use std::fmt;
use std::io;
use crate::TryFrom;
/// Represents a signed integer value of any size.
///
/// An integer that fits in a `u64` or `i64` is directly stored in the object.
/// Anything bigger is stored somewhere else (with lifetime `'a`) as a 2's... |
use rand::seq::SliceRandom;
use rand::Rng;
use abstutil::Timer;
use geom::{Distance, Duration, Polygon};
use map_gui::tools::{
grey_out_map, nice_map_name, open_browser, CityPicker, PopupMsg, PromptInput,
};
use map_gui::ID;
use map_model::{BuildingID, IntersectionID, Position, NORMAL_LANE_THICKNESS};
use sim::{In... |
use super::api::*;
use super::const_reloc as loader;
use super::kernelvm::*;
use super::structs::*;
use crate::consts::*;
use crate::lkm::structs::ModuleState::{Ready, Unloading};
use crate::memory::GlobalFrameAlloc;
use crate::sync::{Condvar, SpinLock as Mutex};
use crate::syscall::SysError::*;
use crate::syscall::Sys... |
//! Contains function to generate the `impl MemSink` for a type. Main function
//! is `gen_impl`.
use proc_macro2::TokenStream;
use quote::{format_ident, quote, quote_spanned};
use syn::{
Ident,
spanned::Spanned,
};
use super::{
DEFAULT_COLOR_CAST_ALLOWED, DEFAULT_CAST_MODE,
input::{CastMode, ColorProp... |
use winit::{
event::{ElementState, Event, KeyboardInput, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::WindowBuilder,
};
use winit_blit::{PixelBufferTyped, BGRA};
fn main() {
let event_loop = EventLoop::new();
let window = WindowBuilder::new()
.with_title("Software rendering ... |
use kiss3d::conrod::{self, Borderable, Colorable, Labelable, Positionable, Sizeable, Widget};
use kiss3d::window::Window;
use crate::testbed::{RunMode, TestbedActionFlags, TestbedState, TestbedStateFlags};
use nphysics::world::DefaultMechanicalWorld;
const SIDEBAR_W: f64 = 200.0;
const ELEMENT_W: f64 = SIDEBAR_W - 20... |
use std::mem::size_of;
use std::ops::DerefMut;
use std::{ptr, u32};
use dma::Dma;
use io::{Io, Mmio};
use syscall::error::{Error, Result, EIO};
use super::fis::{FisType, FisRegH2D};
const ATA_CMD_READ_DMA_EXT: u8 = 0x25;
const ATA_CMD_WRITE_DMA_EXT: u8 = 0x35;
const ATA_CMD_IDENTIFY: u8 = 0xEC;
const ATA_DEV_BUSY: u... |
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... |
//! Single-future, `#![no_std]` executor based on event bitmasks.
//!
//! See `README.md` for a brief overview. [`Executor`] describes the most important elements
//! to get started.
#![cfg_attr(not(test), no_std)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![forbid(unsafe_code)]
#![warn(missing_docs)]
use core::{
c... |
mod utils;
use std::cmp::{max, min};
use std::ffi::CString;
use std::sync::mpsc::Receiver;
use std::time::{Duration, SystemTime};
use glfw::Context;
use glm::{ceil, cos, IVec2, Mat4, Mat4x3, radians, sin, UVec2, Vec3};
use num_traits::identities::Zero;
struct State {
width: i32,
height: i32,
bounce_count:... |
extern crate clap;
extern crate env_logger;
extern crate protobuf;
#[macro_use] extern crate log;
extern crate serialport;
extern crate libloading;
extern crate libc;
#[cfg(feature="pluginlua")]
extern crate rlua;
extern crate rand;
#[cfg(target_family="unix")]
extern crate socketcan;
#[cfg(feature="gui")]
extern crate... |
use crate::{error::{Result,
SupError},
feat,
manager::{self,
service::{HealthCheck,
HealthCheckHook}}};
use actix;
use actix_web::{http::{self,
StatusCode},
middleware::{Finished,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.