text stringlengths 7.05k 33.9k |
|---|
use crate::bin::*;
use crate::periphery::{Periphery, SCREEN_HEIGHT, SCREEN_SIZE, SCREEN_WIDTH};
use std::convert::TryInto;
use std::ops::Add;
use std::thread::sleep;
use std::time::{Duration, Instant};
use rand::Rng;
use std::ops::Sub;
const MEMORY_SIZE: usize = 4_096;
const TARGET_FPS: u32 = 60;
const CPU_CLOCK_IN_... |
use super::rdf_object::*;
use crate::config::{JsonLdSpecVersion::*, *};
use crate::error::*;
use crate::util_traits::*;
use json::object::Object;
use json::JsonValue;
use sophia::ns::{rdf, xsd};
use sophia::quad::{stream::*, Quad};
use sophia::triple::stream::{SinkError, StreamResult};
use sophia_api::term::{TTerm, Ter... |
#![allow(non_upper_case_globals)]
// Copyright (c) 2019, Facebook, Inc.
// All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the "hack" directory of this source tree.
//
use crate::token_kind::TokenKind;
use std::borrow::Cow;
// many errors are static string... |
use actix;
use gst::prelude::{
Cast, ElementExt, ElementExtManual, GstBinExt, GstBinExtManual, GstObjectExt, ObjectExt,
PadExt, PadExtManual,
};
use gst::MessageView;
use thread_control;
use proto;
use std::net::Ipv4Addr;
use std::thread;
use std::time;
#[derive(Copy, Clone)]
enum AudioService {
Auto,
... |
mod broadcast;
mod commands;
mod item;
mod util;
use std::backtrace::Backtrace;
use std::borrow::Cow;
use std::collections::HashMap;
use std::error::{Error as StdError, Error};
use std::io::Write;
use std::sync::mpsc::Sender;
use std::sync::{Arc, Mutex};
use rand::Rng;
use crate::error::EnnuiError;
use crate::error... |
//! Provides userspace access to a Crc unit.
//!
//! ## Instantiation
//!
//! Instantiate the capsule for use as a system call driver with a hardware
//! implementation and a `Grant` for the `App` type, and set the result as a
//! client of the hardware implementation. For example, using the SAM4L's `CrcU`
//! driver:
... |
use crate::{
correlation_id::CorrelationId,
event::{Event, EventQueue},
eventdispatcher::EventDispatcher,
identity::Identity,
request::Request,
service::Service,
session_options::SessionOptions,
Error,
};
use blpapi_sys::*;
use std::{ffi::CString, ptr};
use std::os::raw::{c_void, c_int, ... |
#![feature(test)]
#[cfg(test)]
extern crate png;
#[cfg(test)]
extern crate test;
trait Pixel {
fn red_f32(&self) -> f32;
fn green_f32(&self) -> f32;
fn blue_f32(&self) -> f32;
fn red_u8(&self) -> u8;
fn green_u8(&self) -> u8;
fn blue_u8(&self) -> u8;
}
fn color_f32_to_u32(r: f32, g: f32, b: f... |
#![allow(clippy::trivial_regex)]
use crate::structures::Word;
use rand::prelude::*;
use regex::Regex;
lazy_static! {
static ref O_TO_OWO: Regex = Regex::new(r"o").expect("Failed to build regular expression.");
static ref EW_TO_UWU: Regex = Regex::new(r"ew").expect("Failed to build regular expression.");
st... |
use num_derive::FromPrimitive;
use crate::attribute::{Attribute, AttributeName};
use crate::character::character_common_data::CharacterCommonData;
use crate::character::character_sub_stat::CharacterSubStatFamily;
use crate::character::{CharacterConfig, CharacterName, CharacterStaticData};
use crate::character::skill_co... |
//! A simple, easy-to-use library for interfacing with the Mojang API.
//!
//! All functions involving IO in this crate are asynchronous and utilize
//! async/await. As a result, you will have to use nightly Rust until async/await
//! is stabilized.
//!
//! This crate provides a number of functions:
//!
//! * Server-si... |
use core::isize;
use core::mem::transmute;
use core::ptr;
use memcpy;
use spin::Mutex;
use c_types::*;
use errno::{set_errno, ENOMEM};
use malloc::expand_heap::__expand_heap;
use mmap::{__madvise, __mmap, __munmap, mremap_helper};
use platform::atomic::{a_crash, a_store, a_swap, a_and_64, a_ctz_64, a_or_64};
use pla... |
use std::collections::{BTreeMap, HashMap};
use std::fmt::Write;
use crate::bindinfo::BindInfoInner;
use crate::bindtype::BindType;
use crate::block::Block;
use crate::block::BlockType;
use crate::memtype::Memtype;
use crate::Error;
use crate::Handle;
#[derive(Debug, Clone)]
struct Node {
prev: Option<BlockType>,
... |
extern crate line_splat;
#[macro_use(arg_enum,value_t,_clap_count_exprs)]
extern crate clap;
extern crate image;
extern crate rand;
use std::path::Path;
use std::str::FromStr;
use clap::{App,Arg};
use image::ImageBuffer;
use rand::{Closed01,Open01,Rand,Rng,ThreadRng};
use rand::distributions::{IndependentSample,Norma... |
//! Parsing implementation. `pub` contents are low-level error details.
use enso_profiler as profiler;
use std::collections;
use std::error;
use std::fmt;
use std::mem;
use std::str;
// ===========================
// === parse and interpret ===
// ===========================
impl<M: serde::de::DeserializeOwned> s... |
use std::collections::HashMap;
use std::collections::HashSet;
use std::fmt;
use std::mem;
use std::rc::Rc;
use std::str::FromStr;
use chrono::{Local, NaiveDate};
use gloo_storage::{errors::StorageError, LocalStorage, Storage};
use serde::{Deserialize, Serialize};
use wasm_bindgen::JsValue;
use web_sys::{window, Window... |
// This file is part of Substrate.
// Copyright (C) 2017-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... |
use std::io::{Read, Write};
use crate::{
codec::{JdwpReadable, JdwpWritable},
enums::{ClassStatus, TypeTag},
CommandId,
};
use super::jdwp_command;
/// Returns the JDWP version implemented by the target VM.
/// The version string format is implementation dependent.
#[jdwp_command(1, 1)]
#[derive(Debug, J... |
use crate::accounts_index::AccountMapEntry;
use crate::accounts_index::{IsCached, RefCount, SlotList, ACCOUNTS_INDEX_CONFIG_FOR_TESTING};
use crate::bucket_map_holder::{BucketMapWriteHolder};
use crate::pubkey_bins::PubkeyBinCalculator16;
use solana_bucket_map::bucket_map::BucketMap;
use solana_sdk::clock::Slot;
use s... |
//! Implementation of the Flinn-Engdahl seismic and geographical regionalization scheme.
//!
//! Converts a location (latitude, longitude) into a named region of the world
//!
//!
//! ```rust
//! use flinn_engdahl as fe;
//! let name = fe::region(-42.448299, 171.214005).unwrap();
//! assert_eq!(name, "SOUTH ISLAND, NE... |
use anyhow::{anyhow, Result};
use futures::future;
use indexmap::{indexmap, IndexMap};
use indicatif::ProgressBar;
use lazy_static::lazy_static;
use log::warn;
use os_release::OsRelease;
use owo_colors::OwoColorize;
use reqwest::Client;
use serde::{Deserialize, Serialize};
use sha1::Sha1;
use std::{
collections::Ha... |
use std::cmp::Ordering;
use std::ops::Deref;
use bio_types::strand::Strand;
use std::error::Error;
use std::str;
use std::str::FromStr;
use rust_htslib::bcf;
use std::borrow::ToOwned;
#[derive(Debug)]
pub struct Annotation {
pub prot_change: String,
}
impl Annotation {
pub fn new(rec: &mut bcf::Record) ->... |
// Copyright 2019 The Exonum Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
// Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
#![deny(warnings)]
// Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to... |
// 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.
use crate::{
app::{FrameBufferPtr, MessageInternal, ViewMode},
canvas::{Canvas, MappingPixelSink},
geometry::{IntSize, Point, Size},
messag... |
//! A module that allows to read and write bgzip files directly, as well as modify bgzip blocks.
use std::io::{self, Read, Write, ErrorKind};
use std::cmp::min;
use std::fmt::{self, Display, Debug, Formatter};
use std::time::Duration;
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt};
use flate2::write::{Def... |
use julian::*;
use math::*;
#[cfg(not(feature = "std"))]
use num_traits::Float;
#[derive(PartialEq)]
enum Event {
Midnight,
Sunrise,
Midday,
Sunset
}
fn get_time_of(event: Event, timestamp: i64, longitude: f64, latitude: f64, altitude: f64) -> Option<i64> {
// Julian day
let jd = (unix_to_jul... |
#![doc(html_root_url = "https://docs.rs/wasm-bindgen-cli-support/0.2")]
use failure::{bail, Error, ResultExt};
use std::collections::{BTreeMap, BTreeSet};
use std::env;
use std::fs;
use std::mem;
use std::path::{Path, PathBuf};
use std::str;
use walrus::Module;
mod decode;
mod descriptor;
mod js;
pub mod wasm2es6js;
... |
// 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.
use failure::{bail, format_err, Error, ResultExt};
use fdio::watch_directory;
use fidl::endpoints;
use fidl_fuchsia_hardware_display::{
ControllerEvent... |
// 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.
#![feature(async_await)]
use {
failure::{bail, Error, ResultExt},
fidl_fuchsia_bluetooth_control::{
ControlEvent, ControlEventStream, Cont... |
// 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 ... |
use std::sync::Arc;
use riker::actors::*;
use riker::actors::Context;
use crate::timewarping::Protocol;
use crate::timewarping::zmqlistener::RegisterZMQListener;
use crate::indexstorage::*;
use crate::SETTINGS;
use crate::indexstorage::{Persistence};
//use iota_client::options::;
use iota_lib_rs::prelude::*;
use i... |
// Copyright (C) 2018 <NAME> <<EMAIL>>
//
// journaldriver 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... |
use r1cs_core::{ConstraintSystem, SynthesisError};
use super::PairingGadget as PG;
use crate::{
fields::{fp::FpGadget, fp2::Fp2Gadget, fp4::Fp4Gadget, FieldGadget},
groups::mnt4::{
AteAdditionCoefficientsGadget, AteDoubleCoefficientsGadget, G1Gadget, G1PreparedGadget,
G2Gadget, G2PreparedGadge... |
#![allow(non_snake_case)]
extern crate bulletproofs;
extern crate curve25519_dalek;
extern crate merlin;
extern crate rand;
use bulletproofs::r1cs::*;
use bulletproofs::{BulletproofGens, PedersenGens};
use curve25519_dalek::ristretto::CompressedRistretto;
use curve25519_dalek::scalar::Scalar;
use merlin::Transcript;
... |
/*
* Copyright (c) 2018 <NAME> <<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, copy, modify, merge, pu... |
use std::fs;
use std::fs::{read_to_string, File};
use std::io::{BufReader, Write};
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
use std::str::FromStr;
use std::time::Instant;
use archiver_rs::{Archive, Compressed};
use async_std::fs::create_dir;
use indicatif::HumanDuration;
use indicatif::{Prog... |
//! Details of the `request` section of the procedural macro.
use std::{convert::TryFrom, mem};
use proc_macro2::TokenStream;
use quote::{quote, quote_spanned, ToTokens};
use syn::{spanned::Spanned, Field, Ident};
use crate::{
api::{
attribute::{Meta, MetaNameValue},
strip_serde_attrs, RawRequest... |
mod codegen;
mod debugging;
mod option_group;
mod option_info;
mod parse;
pub use self::codegen::CodegenOptions;
pub use self::debugging::DebuggingOptions;
pub use self::option_group::{
OptionGroup, OptionGroupParseResult, OptionGroupParser, ShowOptionGroupHelp,
};
pub use self::option_info::OptionInfo;
pub use se... |
// 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 {
super::{cache::Cache, Asset, AssetId, AssetLoader},
anyhow::Error,
fidl_fuchsia_fonts::CacheMissPolicy,
fidl_fuchsia_io as io, fidl_f... |
/*
* Copyright 2021 <NAME>
* https://github.com/mikechambers/dcli
*
* 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... |
use crate::querier::load_token_balance;
use crate::state::{
bank_read, bank_store, config_read, config_store, poll_read, poll_store, poll_voter_read,
poll_voter_store, read_bank_stakers, read_polls, state_read, state_store, Config, Poll, State,
TokenManager,
};
use cosmwasm_std::{
attr, to_binary, Cano... |
// 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 LICENSE-BSD-3-Clause file.
//
// Copyright (C) 2020-2021 Alibaba Cloud. All rights reserved.
//
// SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause
use ... |
///! Various utility functions for NPC-related objects
use num_traits::abs;
use crate::caret::CaretType;
use crate::common::{Condition, Direction, Flag, Rect};
use crate::components::number_popup::NumberPopup;
use crate::map::NPCData;
use crate::npc::list::NPCList;
use crate::npc::{NPCFlag, NPCLayer, NPCTable, NPC};
u... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use std::sync::Arc;
use futures::{
channel::{
mpsc::{UnboundedReceiver, UnboundedSender},
oneshot,
},
executor::block_on,
SinkExt,
};
use consensus_types::{common::Author, executed_block::ExecutedBlock}... |
use crate::view::View;
use winit::{
event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::WindowBuilder,
dpi::PhysicalSize,
};
use wgpu::*;
// Ignore Results (remove `unused Result` warning)
trait Ignore {
fn ignore(self);
}
impl<T, U> Ignore for Result<T, U> {
fn ignore(... |
#![allow(dead_code,
mutable_transmutes,
non_camel_case_types,
non_snake_case,
non_upper_case_globals,
unused_assignments,
unused_mut)]
extern crate libc;
use crate::dpx_pdfobj::pdf_obj;
extern "C" {
#[no_mangle]
fn __ctype_b_loc() -> *mut *const u16;
#[... |
use super::*;
use std::fmt;
pub trait VMRangeTrait {
fn get_start(&self) -> usize;
fn get_end(&self) -> usize;
fn get_size(&self) -> usize;
fn get_growth(&self) -> VMGrowthType;
fn contains_obj(&self, ptr: usize, size: usize) -> bool;
}
macro_rules! impl_vmrange_trait_for {
($struct_name: iden... |
use futures::future::{BoxFuture, Future, FutureExt};
use std::convert::{TryFrom, TryInto};
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::{Arc, Mutex, RwLock};
use std::time::Duration;
use async_std::task::sleep;
use http::Method as HttpMethod;
use http::Response as HttpResponse;
use js_int::UInt;
use r... |
// 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>.
//! [`Face`] type and related items.
//! This module is private but reexported by its parent.
use cgmath::{BaseNum, Vector3};
pub use ordered_float::{FloatIsNan,... |
use crate::format::TotemFormat;
use euclid;
use std::hash::{Hash, Hasher};
use std::io::{self, Read, Write};
use std::mem;
pub const ITEM_TYPE_SURFACE: u16 = 1;
pub const ITEM_TYPE_SPLINE: u16 = 2;
pub const ITEM_TYPE_SKIN: u16 = 3;
pub const ITEM_TYPE_ROTSHAPE: u16 = 4;
pub const ITEM_TYPE_LOD: u16 = 5;
pub const ITE... |
//! The backend of the "proc:" scheme. Most internal breakpoint
//! handling should go here, unless they closely depend on the design
//! of the scheme.
use crate::{
arch::{
macros::InterruptStack,
paging::{
entry::EntryFlags,
mapper::MapperFlushAll,
temporary_pa... |
// 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 crate::{
services::discovery::{filter::*, player_event::PlayerEvent},
Result,
};
use anyhow::Error as FError;
use fidl::endpoints::ClientEnd;
u... |
//! Pre-rasterized bitmap font from "Noto Sans Mono", an open font from Google. \
//! * Original font files taken from: <https://fonts.google.com/noto/specimen/Noto+Sans+Mono>
//! * License: SIL Open Font License (OFL) <https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL>
//!
//! Strictly speaking, this cr... |
use crate::lapin_helper::{assert_exchange, assert_queue};
use amq_protocol_types::LongString;
use amq_protocol_types::ShortString;
use amq_protocol_types::{AMQPValue, LongLongUInt, ShortUInt};
use anyhow::{Context, Result};
use async_std::future::timeout;
use cerk::kernel::{
BrokerEvent, CloudEventMessageRoutingId,... |
//! # MountainCar
//!
//! Currently there are two versions of MountainCar.
//! One with a discrete action space and one with a continuous one.
//!
//! ## Discrete version
//!
//! The description on the OpenAI page reads:
//!
//! > *“A car is on a one-dimensional track, positioned between two "mountains". The goal... |
/* Copyright © 2020, <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, distrib... |
use super::super::{EccBaseFieldElemFixed, EccPoint, FixedPoints, NUM_WINDOWS, T_P};
use super::H_BASE;
use crate::{
primitives::sinsemilla,
utilities::{bitrange_subset, lookup_range_check::LookupRangeCheckConfig, range_check},
};
use group::ff::PrimeField;
use halo2_proofs::{
circuit::{AssignedCell, Layou... |
pub mod preprocess;
pub mod track;
use im_ternary_tree::TernaryTreeList;
use std::sync::{Arc, RwLock};
use crate::builtins;
use crate::builtins::is_proc_name;
use crate::call_stack::{extend_call_stack, CallStackList, StackKind};
use crate::primes::{Calcit, CalcitErr, CalcitItems, CalcitScope, CalcitSyntax, CrListWrap... |
#![cfg_attr(not(feature = "std"), no_std)]
use sp_std::{fmt::Debug, prelude::*};
use sp_runtime::{
RuntimeDebug, Percent,
traits::{
Hash, AtLeast32BitUnsigned, Zero,
// Saturating, CheckedSub, CheckedAdd,
},
};
use frame_support::{
traits::{
Currency, ReservableCurrency,
ExistenceRequirement::{KeepAlive},
... |
// Copyright 2021 Anchor Protocol. Modified by Lido
//
// 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 applicabl... |
use core::fmt;
use core::hash::{Hash, Hasher};
use crate::internal_prelude::*;
#[inline]
fn init_bufsize() -> usize {
crate::sysconf(crate::SysconfName::GETPW_R_SIZE_MAX).unwrap_or(1024)
}
const MAX_BUFSIZE: usize = 32768;
macro_rules! osstr_getters {
($($(#[$attr:meta])* $name:ident, $field_name:ident;)*) ... |
//! # Raw Sockets for nrfxlib
//!
//! Generic socket related code.
//!
//! Copyright (c) 42 Technology Ltd 2019
//!
//! Dual-licensed under MIT and Apache 2.0. See the [README](../README.md) for
//! more details.
//******************************************************************************
// Sub-Modules
//********... |
use gtk::{
prelude::{GtkListStoreExtManual, TreeSortableExtManual},
Button, ButtonExt, ComboBoxExt, ContainerExt, Grid, GridExt, Label, LabelExt, MenuButton,
MenuButtonExt, OrientableExt, Orientation, Popover, RangeExt, Scale, ScaleExt, SortColumn,
SortType, Switch, SwitchExt, WidgetExt,
};
use gtk::{
... |
#![allow(non_snake_case)]
use crate::deferred_call_tasks::Task;
use kernel::debug;
use kernel::hil;
use kernel::hil::entropy::Continue;
use kernel::utilities::cells::OptionalCell;
use kernel::utilities::registers::interfaces::{ReadWriteable, Readable};
use kernel::utilities::registers::register_bitfields;
use kernel::... |
use std::fs;
use std::collections::{HashSet,HashMap};
use std::cell::RefCell;
type Id = u64;
type EdgeLoc = u64;
type Transform = u64;
#[derive(Default,Clone,PartialEq,Eq,Debug)]
struct Tile {
id: Id,
data: [[bool;10];10],
matches: HashMap<EdgeLoc,Id>
}
impl Tile {
// Orientation is a number between ... |
//! Contains the necessary machinery to run [pot::Pot]s in forked processes.
//!
//! Once a pot is launched, it is converted into a `RunningPot`. The running
//! pots are periodically monitored for changes in the main event loop (in
//! the [execute] function). When a `RunningPot`'s underlying process finishes
//! we c... |
pub mod agent;
pub mod alert;
pub mod gen;
pub mod particle;
pub mod persist;
pub mod phen;
pub mod segment;
pub mod swarm;
use backend::obj;
use backend::obj::*;
use chrono::DateTime;
use chrono::Utc;
use rand;
use std::collections::HashMap;
use std::collections::HashSet;
use std::f32::consts;
use std::fs;
use std::i... |
// Copyright 2021 TiKV Project Authors. Licensed under Apache-2.0.
use crate::{
pd::{RetryClient, RetryClientTrait},
region::{RegionId, RegionVerId, RegionWithLeader, StoreId},
Key, Result,
};
use std::{
collections::{BTreeMap, HashMap, HashSet},
sync::Arc,
};
use tikv_client_common::Error;
use tik... |
extern crate event;
extern crate orbclient;
extern crate orbimage;
extern crate orbfont;
extern crate syscall;
use std::{env, io, mem};
use std::cell::RefCell;
use std::fs::File;
use std::io::{Read, Write};
use std::os::unix::io::AsRawFd;
use std::os::unix::process::ExitStatusExt;
use std::path::Path;
use std::process... |
use super::super::environment::jvmti::*;
use method::{MethodId, MethodSignature};
use std::collections::*;
use native::{JavaMethod, JavaLong};
use class::ClassSignature;
use thread::{ThreadId, Thread};
use environment::Environment;
use serde::{Deserialize, Serialize};
use profile::tree::{TreeArena, NodeId};
use std::c... |
/*!
Module to generate problems (TD Mk Landscapes) using passed codomain, read these problems and write them (using (de)serialization ).
*/
use itertools::Itertools;
use rand::rngs::StdRng;
use serde::{Deserialize, Serialize};
use structopt::StructOpt;
use std::{
error::Error,
fmt::Write as fmt_write,
fs:... |
/* Copyright 2018 Mozilla Foundation
*
* 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... |
//! Provides features for flattening Huffman tree and generating translation
//! matrix.
//!
//! [HPACK] documentation provides an already prepared and for the web optimized
//! Huffman code for all [ASCII] characters. To implement the Huffman algorithm
//! for [HPACK] we have to first flatten this table to a two-dime... |
// TODO: To facilitate timeout and disruption tests we need to count incoming messages.
// This brings a bunch of functions and counters that are needed only for malicious build
// For now, we use `#[allow(allow)]` instead of `#[cfg(feature = "malicious")]` because it
// produces less friction in the ... |
use crate::ffi::apple as ffi;
// use std::collections::HashMap;
use crate::browse::{Service, ServiceEventType};
use crate::ffi::apple::kDNSServiceErr_NoError;
use crate::ServiceBrowserBuilder;
use std::collections::HashMap;
use std::ffi::{c_void, CStr, CString};
use std::io::{Error as IoError, ErrorKind};
use std::net:... |
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT
//! Utilities to extract examples from Rust books, run them through RMC, and
//! display their results.
extern crate rustc_span;
use crate::{
dashboard,
litani::{Litani, LitaniPipeline, LitaniRu... |
/*
Copyright 2020 <盏一 <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 to in writing, software
distribut... |
#![allow(clippy::option_option)]
use std::collections::BTreeMap;
use std::io::prelude::*;
use std::path::PathBuf;
use anyhow::{ anyhow, Context as ErrorContext, Result };
use atty::Stream;
use log::{info, warn};
use owo_colors::OwoColorize;
use serde_json::{ Value, self };
use serde::{ Serialize, Deserialize };
use s... |
//! # Example: interactive-editor
//!
//! This example demonstrates how to use the plugins feature to implement an editable text box.
//!
//! Running this example requires enabling the "plugin" feature
use az::SaturatingAs;
use embedded_graphics::{
geometry::AnchorPoint,
mono_font::{iso_8859_2::FONT_6X10, Mono... |
extern crate gl;
extern crate glfw;
extern crate chrono;
extern crate stb_image;
extern crate png;
#[macro_use]
extern crate scan_fmt;
mod gl_utils;
mod graphics_math;
mod obj_parser;
mod logger;
use glfw::{Action, Context, Key};
use gl::types::{GLfloat, GLsizeiptr, GLvoid, GLuint};
use stb_image::image;
use stb_... |
//! Note Commitment Trees.
//!
//! A note commitment tree is an incremental Merkle tree of fixed depth
//! used to store note commitments that JoinSplit transfers or Spend
//! transfers produce. Just as the unspent transaction output set (UTXO
//! set) used in Bitcoin, it is used to express the existence of value and
/... |
use actix_web::http::header::ContentType;
use actix_web::{App, HttpRequest, HttpResponse, HttpServer, guard, web, middleware::Logger};
use futures::StreamExt;
use tokio::time::{sleep, Duration};
use openssl::ssl::{SslAcceptor, SslFiletype, SslMethod};
use serde_json::{Value, json};
use serde::Deserialize;
use thiserr... |
use alloc::{
collections::{BTreeMap, LinkedList},
vec::Vec,
};
use core::convert::TryFrom;
use std::fmt::{Display, Error, Formatter};
use crate::{MessageClass, MessageType, error::{InvalidContentFormat, InvalidObserve, MessageError}};
macro_rules! u8_to_unsigned_be {
($src:ident, $start:expr, $end:expr, $... |
#![warn(clippy::all)]
#![allow(clippy::pedantic)]
#![forbid(unsafe_code)]
#[macro_use]
extern crate log;
#[macro_use]
extern crate lazy_static;
use althea_kernel_interface::KernelInterface;
use althea_kernel_interface::LinuxCommandRunner;
use althea_types::Identity;
use althea_types::WgKey;
use antenna_forwarding_pro... |
use graphql_client::{GraphQLQuery, Response};
use seed::{prelude::*, *};
use serde::{Deserialize, Serialize};
use std::mem;
use uuid::Uuid;
use web_sys::HtmlInputElement;
mod cookies;
mod session;
const ENTER_KEY: u32 = 13;
const ESC_KEY: u32 = 27;
const DEFAULT_API_URL: &str = "http://localhost:3030";
const ACTIVE: ... |
// Copyright 2013 The Servo Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at ... |
extern crate timely;
extern crate differential_dataflow;
extern crate declarative_server;
extern crate serde_json;
extern crate mio;
extern crate slab;
extern crate ws;
extern crate getopts;
#[macro_use]
extern crate log;
extern crate env_logger;
#[macro_use]
extern crate abomonation_derive;
extern crate abomonation;... |
use opencv::{
dnn,
core::{self, Mat, Scalar, Vector},
highgui,
prelude::*,
videoio,
};
use tracker::deep_sort::{
deep::ImageEncoder,
sort,
};
use ndarray::prelude::*;
const CHANNELS: usize = 24;
const CONFIDENCE_THRESHOLD: f32 = 0.6;
const NMS_THRESHOLD: f32 = 0.4;
pub const NAMES: [&'stat... |
mod mem_map;
use audio_frame_sink::*;
use self::mem_map::*;
// Docs claim the sample rate is 41.7khz, but my calculations indicate it should be 41666.66hz repeating
// (see SAMPLE_CLOCK_PERIOD calculation below), so we take the nearest whole-number sample rate to that.
// Note that the documentation rounds values i... |
//use xcb_util::keysyms::KeySymbols;
use xcb::{
ClientMessageData as XCBClientMsgData,
ClientMessageEvent as XCBClientMsgEvent,
randr,
};
use crate::x::{
core::{
XWindow, XWindowID,
XConn, XError, XAtom,
PointerQueryReply, Result,
WindowClass,
},
event::{
... |
//! Runge–Kutta solvers.
use lazy_static::lazy_static;
use ndarray::prelude::*;
use ndarray::{FoldWhile, Zip};
use std::error::Error;
use std::marker::PhantomData;
use thiserror::Error;
use crate::OdeIntegrate;
/// Multiply steps computed from asymptotic behaviour of errors by this.
const SAFETY: f64 = 0.9;
/// Mini... |
/*!
[](https://github.com/LPGhatguy/nonmax/actions)
[](https://crates.io/crates/nonmax)
[](https://docs.rs/... |
use std::collections::{VecDeque, vec_deque};
use std::fmt::{Debug, Formatter};
use std::process::exit;
use arrayvec::ArrayVec;
use crate::game_rules::GameRules;
use crate::hand::Hand;
use crate::strategy::{Strategy, GameContext, Decision};
use crate::card::Card;
use crate::shoe::CardShoe;
use crate::game_rules::GameTy... |
//! Handles receiving events from the Discord gateway.
use crate::context::DiscordContext;
use derive_setters::*;
use enumset::EnumSet;
use fxhash::FxHashMap;
use minnie_errors::*;
use minnie_model::event::*;
use minnie_model::gateway::*;
use minnie_model::types::*;
use parking_lot::{Mutex, RwLock};
use rand::Rng;
use... |
use {
std::{
collections::HashMap,
io,
time::Duration,
},
futures::stream::TryStreamExt as _,
rand::prelude::*,
rocket::{
Request,
Rocket,
State,
config::SecretKey,
fairing::Fairing,
fs::FileServer,
http::{
H... |
use log::{debug};
use crate::{ast::{Ast, CmpStmt, DataType, Expr, FuncParam, FunctionDecl, Id, Literal, Stmt, VarDecl, VarPrefix}, lexer::Lexer, token::Tok, token::TokType};
use std::iter::Peekable;
use crate::ast::{DataTypeLoc, UnaryOp, BinOp};
use crate::core::Location;
use crate::ast::Expr::Unary;
pub struct Parser... |
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... |
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{
counters,
logging::{LogEntry, LogEvent, LogSchema},
network::MempoolSyncMsg,
shared_mempool::{
tasks,
types::{notify_subscribers, SharedMempool, SharedMempoolNotification},
},
};
use ite... |
use std::path::PathBuf;
use std::net::{IpAddr, Ipv4Addr};
use figment::{Figment, Profile, Provider, Metadata, error::Result};
use figment::providers::{Serialized, Env, Toml, Format};
use figment::value::{Map, Dict};
use serde::{Deserialize, Serialize};
use yansi::Paint;
use crate::config::{TlsConfig, LogLevel, Shutdo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.