text stringlengths 3.09k 13.9k |
|---|
use volatile::Volatile;
use crate::asm;
const EFLAGS_AC_BIT: u32 = 0x00040000;
const CR0_CACHE_DISABLE: u32 = 0x60000000;
pub fn memtest(start: u32, end: u32) -> u32 {
let mut flg486 = false;
asm::store_eflags((asm::load_eflags() as u32 | EFLAGS_AC_BIT) as i32);
let mut eflags = asm::load_eflags() as u32... |
//! Terra message types
// TODO(tarcieri): autogenerate this from the schema? (possibly after proto migration)
use super::{Denom, SCHEMA};
use crate::{
error::{Error, ErrorKind},
map,
prelude::*,
Map,
};
use rand::{distributions::Alphanumeric, thread_rng, Rng};
use sha2::{Digest, Sha256};
use std::{
... |
use futures::task::{self, Task};
use futures::{Async, Poll, Stream};
use parking_lot::{RwLock, RwLockUpgradableReadGuard};
use std::sync::{Arc, Weak};
type Version = usize;
#[derive(Debug, Eq, PartialEq)]
pub enum TrySetError {
ObserverDisconnected,
}
#[derive(Clone, Debug)]
pub struct NotifyCell<T: Clone> {
... |
// Copyright (c) 2018-2021 <NAME> <<EMAIL>>
// Distributed under the MIT License
// (See acoompanying LICENSE file or a copy at http://opensource.org/licenses/MIT)
//! Implementación del cálculo de la tasa de renovación de aire a 50 Pa del edificio, según CTE DB-HE 2019
use log::info;
use serde::{Deserialize, Seriali... |
use yew::{Component, ComponentLink, Properties, html, Html, ShouldRender};
use yewtil::NeqAssign;
use yewtil::fetch::{FetchState, fetch_to_state_msg};
use wire::bucket::Bucket;
use crate::requests::bucket::{GetBucketBySlug};
use crate::pages::settings_modal::SettingsModal;
use yew_router::unit_state::{RouteAgentDispatc... |
use int::{DInt, HInt, Int};
trait Mul: DInt
where
Self::H: DInt,
{
fn mul(self, rhs: Self) -> Self {
// In order to prevent infinite recursion, we cannot use the `widen_mul` in this:
//self.lo().widen_mul(rhs.lo())
// .wrapping_add(self.lo().wrapping_mul(rhs.hi()).widen_hi())
... |
use aoc_2020::input_file;
use std::{cmp, fs};
use std::{collections::HashMap, mem};
#[derive(Debug, PartialEq, Clone)]
enum Rule {
Literal(String),
Alternative(Vec<Vec<usize>>),
}
fn parse_rule(line: &str) -> Rule {
let tokens = line.split_whitespace().collect::<Vec<_>>();
let mut alternatives = Vec::... |
use std::collections::{HashMap, VecDeque};
use std::time::Duration;
use tetra::math::Vec2;
use tetra::Context;
use crate::sprite::Sprite;
pub struct NodePoint {
pub name: String,
pub position: Vec2<f32>,
pub waiting_time: u128,
pub next_node: Option<String>,
pub spawn_patterns: VecDeque<PatternNo... |
#![cfg_attr(target_os = "wasi", allow(dead_code))]
use crate::data::manifest::PACKAGES_DIR_NAME;
use std::fs;
use std::io::Write;
use std::path::Path;
use thiserror::Error;
pub const BIN_DIR_NAME: &str = ".bin";
#[derive(Clone, Debug, Error)]
pub enum Error {
#[error("Could not save script file for command \"{0}\... |
//! # Rapier
//!
//! Rapier is a set of two Rust crates `rapier2d` and `rapier3d` for efficient cross-platform
//! physics simulation. It target application include video games, animation, robotics, etc.
//!
//! Rapier has some unique features for collaborative applications:
//! - The ability to snapshot the state of t... |
use std::borrow::Cow;
use std::fmt::{Display, Formatter, Result as FormatResult};
use std::ops::Deref;
use regex::Regex;
use serde::{Deserialize, Serialize};
lazy_static! {
static ref RE_ALIAS_NAME: Regex = Regex::new(r"^[a-zA-Z0-9:/_-]+$").expect("cannot compile regex");
static ref RE_ALIAS_ARN: Regex = Rege... |
use bytes::{BufMut, Bytes, BytesMut};
use std::convert::TryInto;
use thiserror::Error;
use uuid::Uuid;
use super::StatementConfig;
use crate::frame::response::result::PreparedMetadata;
use crate::frame::types::{Consistency, SerialConsistency};
use crate::frame::value::SerializedValues;
use crate::transport::retry_poli... |
// Copyright 2012-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-MI... |
use std::ffi::OsStr;
use std::path::Path;
/* We need to send execution time to the prompt for the cmd_duration module. For fish,
this is fairly straightforward. For bash and zsh, we'll need to use several
shell utilities to get the time, as well as render the prompt */
pub fn init(shell_name: &str) {
log::debug!(... |
//! Validate input data against schemas.
//!
//! This module contains logic related to *validation*, the process of taking a
//! piece of input data (called an "instance") and checking if it's valid
//! according to a schema.
//!
//! See the docs for [`Validator`](struct.Validator.html) for more.
use crate::schema::Sc... |
// Copyright 2015 <NAME>. See the COPYRIGHT
// file at the top-level directory of this distribution.
use failure::Error;
use std::path::Path;
use crate::sym_file::parser::{parse_symbol_bytes, parse_symbol_file};
use crate::{FrameSymbolizer, FrameWalker, Module};
pub use crate::sym_file::types::*;
mod parser;
mod t... |
pub mod builder;
pub mod injector;
pub mod resolver;
mod cycle;
use std::any::{Any, TypeId};
use std::cell::RefCell;
use std::collections::HashMap;
use crate::Result;
use cycle::CycleStopper;
/// Dependency container. Can be used with Resolver or Injector.
///
/// See [Injector](trait.Injector.html) and [Resolver](... |
use crate::signal::Signal;
use salsa::Database;
use salsa::ParallelDatabase;
use salsa::Snapshot;
use std::sync::Arc;
use std::{
cell::Cell,
panic::{catch_unwind, resume_unwind, AssertUnwindSafe},
};
#[salsa::query_group(Par)]
pub(crate) trait ParDatabase: Knobs {
#[salsa::input]
fn input(&self, key: c... |
//! Mapping program.
use arctk::{
args,
file::{Build, Load, Redirect, Save},
geom::{Grid, GridBuilder, Mesh, MeshBuilder, Tree, TreeBuilder},
ord::Set,
util::{banner, dir},
};
use arctk_attr::input;
use cartograph::{
input::Settings,
output::Data,
parts::{Interface, Landscape},
run:... |
use crate::renderer::rectangle::Rectangle;
use crate::renderer::Dimensions;
use std::collections::HashSet;
use std::ffi::OsString;
use std::path::{Path, PathBuf};
use std::str::FromStr;
use wgpu::util::StagingBelt;
use wgpu::{CommandEncoder, Device, TextureView};
use wgpu_glyph::{GlyphBrush, Section, Text};
use winit::... |
use std::io::Cursor;
use std::sync::Arc;
use arrow2::array::*;
use arrow2::datatypes::{DataType, Field};
use arrow2::error::Result;
use arrow2::io::ndjson::read as ndjson_read;
use arrow2::io::ndjson::read::FallibleStreamingIterator;
use super::*;
fn test_case(case_: &str) -> Result<()> {
let (ndjson, expected) ... |
/*A natural number, N, that can be written as the sum and product of a given set of at least two natural numbers, {a1, a2, ... , ak} is called a product-sum number: N = a1 + a2 + ... + ak = a1 × a2 × ... × ak.
For example, 6 = 1 + 2 + 3 = 1 × 2 × 3.
For a given set of size, k, we shall call the smallest N with this p... |
// Copyright 2022 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::Error;
use fidl::endpoints::{create_endpoints, ClientEnd};
use fidl_fuchsia_io as fio;
use fidl_fuchsia_test_manager as ftest_manager;
use futu... |
//! All database queries directly related to stocks and their transactions are contained within this module.
use crate::{
schema::{self, stock_transactions, stocks},
user::User,
util,
};
use apply::Apply;
use chrono::NaiveDateTime;
use diesel::{
pg::PgConnection,
query_dsl::{QueryDsl, RunQueryDsl},
... |
use failure::Fail;
use std::io;
use std::marker::PhantomData;
// FIXME: for some reason, the compiler says BufMut and Emitable are unused, but they _are_ used.
// These traits need to be in scope for some methods to be called.
use bytes::{BufMut, BytesMut};
use netlink_packet::{Emitable, NetlinkBuffer, NetlinkMessage... |
//! Some js examples will be here.
use std::collections::HashMap;
use std::convert::{TryFrom, TryInto,Into};
use std::str;
use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize};
use near_sdk::collections::{LookupSet, UnorderedSet};
use near_sdk::serde::{Deserialize, Serialize};
use near_sdk::serde_json::{self... |
use slog::Logger;
use std::path::Path;
use structopt::clap::ArgMatches;
use crate::kvs::KVS;
use crate::macro_hub::MacroHub;
use crate::error::EasyErrorHandling;
use std::collections::HashMap;
use std::fs;
use std::io::Write;
use std::process;
use colored::*;
fn macro_create(logger: &Logger, args: &ArgMatches, kvs... |
//
// Copyright (C) 2018 Kubos Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License")
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
// Tagua VM
//
//
// New BSD License
//
// Copyright © 2016-2016, <NAME>.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyrigh... |
use super::*;
pub enum Tag {
A,
Abbr,
Acronym,
Address,
Applet,
Area,
Article,
Aside,
Audio,
B,
Base,
Basefont,
Bdi,
Bdo,
Big,
Blockquote,
Body,
Br,
Button,
Canvas,
Caption,
Center,
Cite,
Code,
Col,
Colgroup,
Data,
Datalist,
Dd,
D... |
use std::collections::HashMap;
use arret_syntax::datum::DataStr;
use arret_syntax::span::Span;
use crate::hir;
use crate::mir::builder::{Builder, BuiltReg};
use crate::mir::eval_hir::EvalHirCtx;
use crate::mir::ops::{RecordStruct, RecordStructId};
use crate::mir::specific_abi_type::specific_abi_type_for_value;
use cr... |
use crate::app::config::App;
use crate::app::config::AppCommon;
use anyhow::{Context, Result};
use hogan::config::ConfigDir;
use hogan::error::HoganError;
use hogan::template::TemplateDir;
use regex::Regex;
use std::fs::File;
use std::fs::OpenOptions;
use std::io::ErrorKind::AlreadyExists;
use std::io::Write;
use std::... |
// Chariot: An open source reimplementation of Age of Empires (1997)
// Copyright (c) 2016 <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 ... |
#[macro_use]
extern crate clap;
extern crate env_logger;
#[macro_use]
extern crate log;
extern crate rustpython_parser;
extern crate rustpython_vm;
extern crate rustyline;
use clap::{App, Arg};
use rustpython_parser::error::ParseError;
use rustpython_vm::{
compile,
error::CompileError,
import,
obj::obj... |
use std::path::Path;
use std::sync::{Condvar, Mutex};
use wasmtime::{
Config, Engine, InstanceAllocationStrategy, InstanceLimits, ModuleLimits,
PoolingAllocationStrategy, Store, Strategy,
};
use wasmtime_wast::WastContext;
include!(concat!(env!("OUT_DIR"), "/wast_testsuite_tests.rs"));
// Each of the tests in... |
extern crate gstreamer as gst;
use gst::prelude::*;
extern crate gstreamer_video as gst_video;
use gst_video::prelude::*;
extern crate glib;
use glib::translate::ToGlibPtr;
extern crate gio;
use gio::prelude::*;
extern crate gtk;
use gtk::prelude::*;
extern crate gdk;
use gdk::prelude::*;
use std::env;
use std::... |
use super::{
basic_block::BasicBlocks, builder::IRBuilderWithModuleAndFuncId, constant_pool::*, function::*,
global_val::*, types::*, value,
};
use crate::codegen::is_internal_function;
use id_arena::*;
use std::fmt;
/// A representation of Module.
/// Module has its name, functions and type definisions.
#[der... |
//! When serializing or deserializing CBOR goes wrong.
use std::prelude::v1::*;
use serde::de;
use serde::ser;
use std::error;
use std::fmt;
use std::io;
use std::result;
/// This type represents all possible errors that can occur when serializing or deserializing CBOR
/// data.
pub struct Error(Box<ErrorImpl>);
/// ... |
#[macro_use]
extern crate log;
use clap::{AppSettings, Clap};
use std::path::PathBuf;
use std::env;
use std::sync::atomic::Ordering;
use tonic::transport::Server;
use bazelfe_protos::*;
use std::ffi::OsString;
use bazelfe_core::bazel_runner;
use bazelfe_core::build_events::build_event_server::bazel_event;
use bazel... |
use super::models::Submission;
use super::schema::max_streaks;
use crate::sql::MAX_INSERT_ROWS;
use crate::utils::SplitToSegments;
use chrono::Duration;
use chrono::{DateTime, Datelike, FixedOffset, TimeZone, Utc};
use diesel::pg::upsert::excluded;
use diesel::prelude::*;
use diesel::{insert_into, PgConnection, QueryRe... |
/// This file implements a lighter alternative version of the Jakob
/// 2019 spectral upsampling method. Instead of using the entire 3D
/// looking table, we use two 2d slices of the table and interpolate
/// between the evaluated spectral values calculated from those tables.
///
/// The provides similar color matchin... |
use crate::err::{SnakeCtrlErr, SnakeCtrlResult};
use crate::matrix::Matrix;
use crate::options::InnerCfg;
// use crate::utils::simple_rand;
use crate::{Direction, Point};
use rand::Rng;
use std::rc::Rc;
pub struct Food {}
impl Food {
fn generate(cfg: &InnerCfg, snake: &[Point], food: &[Point]) -> Point {
let ma... |
use std::fmt::{Debug, Formatter};
use std::fmt;
use crate::bits;
use crate::bits::{LEFT_MASKS, RIGHT_MASKS};
use crate::errors::{QCompressError, QCompressResult};
use crate::types::UnsignedLike;
#[derive(Clone)]
pub struct BitReader {
bytes: Vec<u8>,
i: usize,
j: usize,
}
impl Debug for BitReader {
fn fmt(&s... |
extern crate csv;
use std::process;
use encoding_rs::WINDOWS_1252;
use encoding_rs_io::DecodeReaderBytesBuilder;
use std::collections::HashMap;
use std::error::Error;
// use std::ffi::OsString;
//use std::fs::File;
// use std::process;
// use std::io::{self, BufRead, BufWriter};
use regex::Regex;
use std::path::{se... |
use std::error::Error as StdError;
use std::fmt;
mod utils;
use fixedbitset::FixedBitSet;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct EliasFano {
/// The maximum val... |
use xcb::Connection;
use crate::error::Error;
use crate::leechbar::component::text::Text;
use crate::{cmdline, leechbar};
pub(crate) struct Window {
id: u32,
frame: u32,
black: u32,
window_pict: u32,
border_size: u16,
border_pad: u16,
text_width: u16,
text_height: u16,
text: Text,
... |
use core::intrinsics::size_of;
use core::ptr;
use crate::file_system::{BLOCK_CACHE, BLOCK_SIZE, SuperBlock};
use crate::file_system::buffer_cache::BufferGuard;
use crate::process::{CPU_MANAGER, PROCESS_MANAGER};
use crate::spin_lock::SpinLock;
use param_lib::{LOG_SIZE, MAX_OP_BLOCKS};
struct LogHeader {
n: usize,... |
use crossbeam;
use ordered_float::NotNaN;
use super::{At, Hnsw, Search};
use crate::types::ComparableTo;
pub struct ShardedHnsw<'a, Elements, Element>
where
Elements: 'a + At<Output = Element> + Sync + ?Sized,
Element: 'a + ComparableTo<Element> + Sync,
{
indexes: Vec<(Hnsw<'a, Elements, Element>, usize)... |
use ast::AstNode;
use interner::Interner;
use rustc_hash::FxHashMap;
use std::alloc::GlobalAlloc;
use std::env;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::time::{Duration, Instant};
#[global_allocator]
static GLOBAL: TrackingAlloc =
TrackingAlloc { total_size: AtomicUsize::new(0), mimalloc: mimalloc:... |
//
// metal_render_command_encoder.rs
//
// Created by TR Solutions on 2020-07-12.
// Copyright © 2020 TR Solutions Pte. Ltd.
// Licensed under Apache 2.0 and MIT
// See appropriate LICENCE files for details.
//
//! Thin wrappers for methods we use from MTLRenderCommandEncoder
use objc::msg_send;
use objc::sel;
u... |
use chrono::Local;
use crossbeam::channel::{self, Sender, Receiver};
use log::{error, info, warn};
use serde::{Serialize, Deserialize};
use tokio::{net::TcpStream, sync::Mutex, task, task::JoinHandle};
use tokio_tungstenite::MaybeTlsStream;
use std::{fmt, option::Option, sync::Arc};
use crate::{
model::{Database,... |
use parity_wasm;
use parity_wasm::builder;
use parity_wasm::elements::{
ExportEntry, GlobalEntry, GlobalType, InitExpr, Internal, Module, ValueType,
};
use Target;
use parity_wasm::elements;
use parity_wasm::elements::{Deserialize, ImportEntry, VarUint32, VarUint7};
#[allow(dead_code)]
pub const FLAG_UNDEFINED: u... |
use crate::dijkstra::potentials::corridor_lowerbound_potential::customization::CustomizedCorridorLowerbound;
use crate::dijkstra::potentials::corridor_lowerbound_potential::CorridorLowerboundPotential;
use crate::dijkstra::potentials::multi_metric_potential::customization::CustomizedMultiMetrics;
use crate::dijkstra::p... |
use super::*;
use crate::Documentation;
use std::fs;
use log::{trace, warn};
use std::path::{Path, PathBuf};
use anyhow::Result;
/// An iterator traversing module hierarchies yielding paths
#[derive(Debug, Clone)]
pub struct TraverseModulesIter {
/// state for enqueuing child files and the depth at which they ... |
//! Funnels planned attacks
//!
//! All attacks on villages should go through this funnel.
//! This module should then guarantee some consistencies about attacks in a village.
//! For now, the consistency rules are:
//! - No two attacks reach a town at the same time
//! - No hobo is involved in more than one at... |
use crate::certification::recertify_registry;
use crate::pb::v1::RegistryCanisterStableStorage;
use crate::registry::Registry;
use prost::Message;
pub fn canister_post_upgrade(registry: &mut Registry, stable_storage: &[u8]) {
// Purposefully fail the upgrade if we can't find authz information.
// Best to have ... |
// ---------------------------------------------------------------------------
// Copyright: (c) 2022 ff. <NAME> (<EMAIL>)
// License: This program is part of a larger application. For license
// details please read the file LICENSE.TXT provided together
// with the application.
// -----... |
// MakAir
//
// Copyright: 2020, <NAME>
// License: Public Domain License
use std::sync::mpsc::Sender;
use telemetry::structures::TelemetryMessage;
pub struct LoraController {}
impl LoraController {
#[allow(clippy::new_ret_no_self)]
#[cfg(feature = "lora")]
pub fn new() -> Sender<TelemetryMessage> {
... |
use crate::code::{
check_if_no_value_from_body_iter, check_result, check_signature_from_header,
create_return_msg_from_header, get_value_from_body_iter,
};
use crate::helper::{
get_ident_from_option_nested_meta, get_ident_from_path, get_lit_str_from_option_nested_meta,
get_signatures_from_nested_meta,
}... |
use std::fs::File;
use std::io;
use crate::{x25519, Callbacks, DecryptError, EncryptError};
#[cfg(feature = "plugin")]
use crate::plugin;
/// The supported kinds of identities within an [`IdentityFile`].
#[derive(Clone)]
pub enum IdentityFileEntry {
/// The standard age identity type.
Native(x25519::Identity... |
extern crate powersoftau;
extern crate bellman;
extern crate memmap;
extern crate rand;
extern crate blake2;
extern crate byteorder;
// use powersoftau::bls12_381::{Bls12CeremonyParameters};
use powersoftau::small_bls12_381::{Bls12CeremonyParameters};
use powersoftau::batched_accumulator::{BachedAccumulator};... |
//! [`Connection`]s hold a connection to a peer in an
//! [`Endpoint`](crate::Endpoint).
//!
//!
//! A single [`Connection`] can have multiple streams, streams consist of a
//! [`Sender`] and [`Receiver`], which can send and receive messages on that
//! stream.
//!
//! You can use [`open_stream`](Connection::open_strea... |
extern crate bincode;
extern crate prost;
extern crate scaii_core;
extern crate scaii_defs;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate url;
use protos::{MultiMessage, ScaiiPacket};
use scaii_core::{Environment, ReplayAction};
use scaii_defs::protos;
use scaii_defs::{Agent, Module, Replay}... |
use std::{
env,
error::Error,
fs::File,
io::{BufWriter, Write},
path::Path,
};
/// Bit sequences that uniquely identify each instruction type. These sequences
/// are combinations of bits `[27:20]` and `[7:4]` of each instruction type's
/// encoded sequence; when combined and processed in the orde... |
//! Code to manage and set-up the GDT and TSS.
use core::mem::size_of;
use x86::bits64::segmentation::{load_cs, Descriptor64};
use x86::bits64::task::*;
use x86::dtables::*;
use x86::segmentation::*;
use x86::task::load_tr;
use x86::Ring;
use crate::stack::{Stack, StaticStack};
/// A temporary, statically allocated... |
use std::cmp::max;
use time::SteadyTime;
use mio::{self, EventLoop, Token, EventSet, Evented, PollOpt, Sender};
use mio::util::Slab;
use {Async};
use scope::{Scope, scope};
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
pub enum Abort {
NoSlabSpace,
RegisterFailed,
MachineAddError,
}
pub enum Timeo {
... |
use anyhow::Result;
use std::cmp::{max, min};
use std::fs::File;
use std::io::{BufRead, BufReader};
use std::path::PathBuf;
use termwiz::{
caps::Capabilities,
color::*,
input::*,
surface::*,
terminal::{buffered::BufferedTerminal, SystemTerminal, Terminal},
};
pub struct Editor {
bt: BufferedTer... |
use crate::ast::VarRef;
use crate::name::AbsName;
use crate::name::MemberName;
use crate::name::Name;
use crate::name::SimpleName;
use crate::GlobalEnv;
use std::collections::HashMap;
use std::collections::HashSet;
#[derive(Clone, Debug)]
pub struct StaticEnv<'a> {
global: &'a GlobalEnv,
locals: HashMap<Simpl... |
use std::mem::{ManuallyDrop, MaybeUninit};
use super::Command;
use crate::world::World;
struct CommandMeta {
offset: usize,
func: unsafe fn(value: *mut MaybeUninit<u8>, world: &mut World),
}
/// A queue of [`Command`]s
//
// NOTE: [`CommandQueue`] is implemented via a `Vec<MaybeUninit<u8>>` over a `Vec<Box<d... |
use std::fmt::Display;
use std::fmt::Formatter;
use std::fmt::Result as FmtResult;
use std::ops::Deref;
use std::ops::DerefMut;
use fastobo_derive_internal::FromStr;
use pest::iterators::Pair;
use crate::ast::*;
use crate::error::SyntaxError;
use crate::parser::Cache;
use crate::parser::FromPair;
use crate::semantics... |
use std::{
convert::TryFrom, fs::read, io::Error as IoError, net::SocketAddr, num::NonZeroUsize,
path::PathBuf, time::Duration,
};
use argh::FromArgs;
use serde::{Deserialize, Serialize};
use thiserror::Error;
use toml::{de::Error as TomlError, from_slice};
#[cfg(feature = "gcs")]
use crate::gcs::GoogleCloudS... |
//Usings, Mods, Crates, Macros
use_expansion_serenity!();
use crate::src_bot::bot;
use crate::src_bot::bot::bot_utils::bot_helpers;
use crate::src_bot::bot::bot_core::bot_framework;
use std::process;
#[group("owners")]
#[owners_only]
#[only_in(guilds)] // Limit all commands to be guild-restricted.
#[checks(Admin)] // ... |
// Copyright 2019 <NAME>.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE.txt or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT.txt or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according... |
use crate::{NumWasmPages, PageMap};
use ic_protobuf::proxy::ProxyDecodeError;
use ic_protobuf::state::system_metadata::v1 as pb;
use ic_sys::PAGE_SIZE;
use serde::{Deserialize, Serialize};
use std::{convert::TryFrom, sync::Arc};
const WASM_PAGE_SIZE_IN_BYTES: u32 = 64 * 1024;
const MAX_STABLE_MEMORY_IN_PAGES: u32 = 64... |
use libtxc::{LibTxc, LogLevel};
use std::{
env,
io::{self, BufRead, BufReader, Read, Write},
mem,
net::{Ipv4Addr, SocketAddrV4, TcpListener, TcpStream},
os::windows::io::{FromRawSocket, IntoRawSocket, RawSocket},
process::{Command, Stdio},
};
use winapi::um::winsock2::{
closesocket, WSADupli... |
#![allow(clippy::unused_unit)]
use kompact::{prelude::*, serde_serialisers::*};
use kompact_examples::trusting::*;
use std::{collections::HashSet, sync::Arc, time::Duration};
// ANCHOR: update_message
#[derive(Debug)]
struct UpdateProcesses(Arc<[ActorPath]>);
// ANCHOR_END: update_message
// ANCHOR: state
#[derive(Co... |
/* This is dvipdfmx, an eXtended version of dvipdfm by <NAME>.
Copyright (C) 2002-2018 by <NAME> and <NAME>,
the dvipdfmx project team.
Copyright (C) 1998, 1999 by <NAME> <<EMAIL>>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public Li... |
//! API Gateway request types. Typically these are exposed via the `request_context` method provided by [lando::RequestExt](trait.RequestExt.html)
// Std
use std::borrow::Cow;
use std::collections::HashMap;
use std::fmt;
use std::mem;
// Third Party
use http::header::{HeaderValue, HOST};
use http::Request as HttpRequ... |
use std::fs::File;
use std::io::prelude::*;
use std::collections::{HashMap, HashSet};
use std::hash::Hash;
mod graph;
use graph::Graph;
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
enum Tile {
Bug,
Empty
}
type Position = (usize, usize);
type RecursivePosition = (i64, Position);
struct TileMap<P>(HashMap<P, Til... |
// Copyright 2020 The Kythe Authors. 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 at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by appli... |
/*!
This crate implements the four major components of the _UPnP Device Architecture_ (UDA), namely
1. Discovery, the search and notification functions via the _Simple Service Discovery Protocol_
(SSDP).
2. Description, the device and service templates.
3. Control, TBD
4. Eventing, via the _General Event Notificat... |
#![cfg(test)]
use super::*;
use crate as pallet_elections;
use crate::traits::{EraInfoProvider, SessionInfoProvider, ValidatorRewardsHandler};
use frame_election_provider_support::{data_provider, ElectionDataProvider, VoteWeight};
use frame_support::{
construct_runtime, parameter_types, sp_io, traits::GenesisBuil... |
use crate::Buffer;
use crate::PixelFormat;
use glib::translate::ToGlibPtr;
use std::ffi::c_void;
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum ImageError {
InvalidStatus(crate::BufferStatus),
InvalidPayloadType(crate::BufferPayloadType),
UnsupportedPixelFormat(PixelFormat),
}
impl Buffer {
/// Create an Aravi... |
use crate::controller::ConsumerHandle;
use crate::metrics::StaticMetricsWriter;
use crate::storage::{Message, Storage};
use bytes::Bytes;
use log::{error, info};
use sled::Subscriber;
use std::future::Future;
use std::pin::Pin;
use std::sync::Arc;
use std::task::{Context, Poll};
use tokio::sync::mpsc::{Receiver, Sender... |
#[doc = "Reader of register SYSSNIV"]
pub type R = crate::R<u16, super::SYSSNIV>;
#[doc = "System NMI vector\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u16)]
pub enum SYSSNIV_A {
#[doc = "0: No interrupt pending"]
NONE = 0,
#[doc = "2: SVS low-power reset entry"]
SVSLIFG = 2,... |
//! A generic 2D triangle mesh.
use cgmath::{Matrix3, Rad, Vector2};
use super::{
context::{BackendError, Buffer, Program, Texture, VertexArray},
primitives::BasicPipeline2D,
primitives::BasicVertex2D,
primitives::Pipeline,
primitives::VertexData,
BlendMode, Color, Rect, RenderState, Texture2D... |
use dx::{
gles::{core30::gl, enums::*},
Instance,
};
use std::{mem, str};
use winit::{
event::{ElementState, Event, KeyboardInput, VirtualKeyCode, WindowEvent},
event_loop::{ControlFlow, EventLoop},
window::WindowBuilder,
};
// settings
// const SCR_WIDTH: u32 = 800;
// const SCR_HEIGHT: u32 = 600;... |
extern crate amy;
extern crate rabble;
#[macro_use]
extern crate assert_matches;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate slog;
extern crate slog_stdlog;
extern crate slog_envlogger;
extern crate slog_term;
extern crate log;
extern crate time;
mod utils;
use std::{str, thread};
use ... |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
use arrayvec::ArrayVec;
use catnip::{
collections::bytes::{Bytes, BytesMut},
interop::dmtr_sgarray_t,
interop::dmtr_sgaseg_t,
protocols::ethernet2::MacAddress,
protocols::{arp, tcp, udp},
runtime::Runtime,
runtime::... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - THS Control Register"]
pub ths_ctrl: crate::Reg<ths_ctrl::THS_CTRL_SPEC>,
#[doc = "0x04 - THS Enable Register"]
pub ths_en: crate::Reg<ths_en::THS_EN_SPEC>,
#[doc = "0x08 - THS Period Control Register"]
pub ths_per:... |
// 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 ... |
//! Handles query pipelines with mixed read-write queries
//!
//! The general information flow is as follows:
//!
//! - Run pre-fetch queries for every delete
//! - Run mutations
//! - Run other queries
//!
//! When running pre-fetch queries, the results need to be cached
//! and also those queries need to first be der... |
// Copyright (c) 2017-2020 <NAME>
//! A tool to convert between LLHD and other formats
#![deny(missing_docs)]
#[macro_use]
extern crate log;
use anyhow::{anyhow, bail, Context, Result};
use clap::{App, Arg};
use llhd::ir::Module;
use std::{
fs::File,
io::{BufReader, BufWriter, Read, Write},
path::Path,
... |
use std::path::Path;
use structopt::StructOpt;
use fluvio::config::ConfigFile;
use duct::cmd;
use which::which;
use crate::cli::ClusterCliError;
use crate::cli::start::get_log_directory;
type Result<T, E = ClusterCliError> = core::result::Result<T, E>;
#[derive(StructOpt, Debug)]
pub struct DiagnosticsOpt {}
impl Di... |
use crate::{cratename, user};
use regex::Regex;
use semver::VersionReq;
use std::env;
use std::ffi::{OsStr, OsString};
use std::fmt::Display;
use std::path::PathBuf;
use std::str::FromStr;
#[derive(Debug)]
pub(crate) struct Opt {
pub db: PathBuf,
pub exclude: Vec<Regex>,
pub jobs: usize,
pub relative: ... |
use super::super::Config;
use crate::{utils, Result};
use std::{future::Future, pin::Pin, sync::Arc};
use super::{DatabaseEngine, Tree};
use std::{collections::HashMap, sync::RwLock};
pub struct Engine {
rocks: rocksdb::DBWithThreadMode<rocksdb::MultiThreaded>,
old_cfs: Vec<String>,
}
pub struct RocksDbEng... |
use super::Float;
use super::SyncValue;
use super::filter::OnePole;
use serde::{Serialize, Deserialize};
const BUFF_LEN: usize = 44100;
#[derive(Serialize, Deserialize, Copy, Clone, Default, Debug)]
pub struct DelayData {
pub level: Float,
pub feedback: Float,
pub time: Float,
pub sync: SyncValue,
... |
use crate::flow::etl_flow::ETLFlow;
use crate::flow::flow_builder::{FlowBuilderBase, FlowBuilderMaterialize};
use crate::flow::flow_builder_input::FlowBuilderInput;
use crate::python::{format_code, PythonFlowBuilderInput, PythonImport, PythonPreamble};
use abi_stable::std_types::ROption;
use aorist_ast::AST;
use aorist... |
use std::time::Instant;
use plotters::prelude::*;
use wt_datamine_extractor_lib::missile::missile::Missile;
use wt_ballistics_calc_lib::launch_parameters::LaunchParameter;
use wt_ballistics_calc_lib::runner::generate;
const WIDTH: u32 = 3840;
const HEIGHT: u32 = 2160;
const TIMESTEP: f64 = 0.1;
const FONT_AXIS: u3... |
use super::*;
use consts::class;
use consts::attribute as attr;
use indexing::*;
#[derive(Debug)]
pub struct Attribute {
pub name: ConstantIndex,
pub info: AttributeInfo,
}
#[derive(Debug)]
pub enum AttributeInfo {
ConstantValue(ConstantIndex),
Code {
max_stack: CodeIndex,
max_locals... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.