text stringlengths 3.35k 22.8k |
|---|
// Copyright 2013 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 ... |
mod constant;
mod declare;
mod entry;
mod type_;
use crate::builder::{ExtInst, InstructionTable};
use crate::builder_spirv::{BuilderCursor, BuilderSpirv, SpirvValue, SpirvValueKind};
use crate::decorations::{
CustomDecoration, SerializedSpan, UnrollLoopsDecoration, ZombieDecoration,
};
use crate::spirv_type::{Spir... |
use std::fs::remove_file;
use std::str::FromStr;
use bellperson::{util_cs::bench_cs::BenchCS, Circuit};
use blstrs::Scalar as Fr;
use fil_proofs_tooling::{
measure,
shared::{create_replicas, PROVER_ID, RANDOMNESS, TICKET_BYTES},
Metadata,
};
use filecoin_hashers::sha256::Sha256Hasher;
use filecoin_proofs::... |
// Copyright 2019-2021 PureStake Inc.
// This file is part of Moonbeam.
// Moonbeam 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.... |
use std::{
cmp, env,
ffi::OsStr,
fs,
path::{Path, PathBuf},
};
use crate::{extension::CompressionFormat, file::File, oof, OVERWRITE_CONFIRMATION};
#[macro_export]
#[cfg(debug_assertions)]
macro_rules! debug {
($x:expr) => {
dbg!($x)
};
}
#[macro_export]
#[cfg(not(debug_assertions))]
m... |
//! The `sigverify_stage` implements the signature verification stage of the TPU. It
//! receives a list of lists of packets and outputs the same list, but tags each
//! top-level list with a list of booleans, telling the next stage whether the
//! signature in that packet is valid. It assumes each packet contains one
... |
// 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... |
use iced::{
pick_list, button, scrollable, Element, Row, PickList, Button, Text, Container, Column, Align,
Scrollable, Checkbox, Length, Space,
};
use std::fmt::{Display, Formatter, Result};
use crate::gui::{CustomButton, CustomContainer, CustomSelect, CustomCheckbox};
use config::Config;
use super::auto_start::{... |
//! Teensy 4.0 specific APIs
//!
//! Use [`into_pins`](fn.into_pins.html) to constrain the processor pads into the pins available on the Teensy 4.0.
//! If you cannot safely acquire all processor pads, use the unsafe [`Pins::new`](struct.Pins.html#method.new)
//! method to generate pins.
//!
//! | Pin | Pad ID | Al... |
use std::error::Error;
use super::RawFeatureVector;
use super::NodeAlias;
use super::Color;
use super::super::types::{RawSignature, RawPublicKey};
use common_types::secp256k1_m::{Signed, Data};
use binformat::SerdeVec;
use binformat::PackSized;
use std::net::SocketAddr;
use std::net::IpAddr;
use std::net::Ipv4Addr;... |
// Buttplug Rust Source Code File - See https://buttplug.io for more info.
//
// Copyright 2016-2019 Nonpolynomial Labs LLC. All rights reserved.
//
// Licensed under the BSD 3-Clause license. See LICENSE file in the project root
// for full license information.
//! Handles client sessions, as well as discovery and co... |
//!Provides access to metadata associated with a channel.
use super::utils::{align, is_aligned, REC_HEADER_LEN};
use super::version::Version;
use super::TickUnit;
use crate::api::ChannelError;
use crate::api::ChannelError::{IncompatibleVersion, InvalidCapacity, InvalidMaxMessageLength, InvalidSignature};
use std::cmp::... |
use crate::syscall;
// use alloc::boxed::Box;
use alloc::collections::btree_map::BTreeMap;
use alloc::sync::Arc;
use alloc::vec::Vec;
use core::borrow::BorrowMut;
use core::cell::RefCell;
use core::convert::TryInto;
use core::ops::FnMut;
use core::pin::Pin;
use core::slice::{from_raw_parts, from_raw_parts_mut};
use spi... |
// Copyright 2015 <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, ... |
use std::cmp;
use super::*;
// Friendly neighborhood axis-aligned rectangle
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct AaRect {
x: i64,
y: i64,
width: i64,
height: i64,
}
impl AaRect {
pub fn new((x, y): (i32, i32), (width, height): (u32, u32)) -> Self {
let (x, y) = (x as i64, y a... |
use abstutil::{prettyprint_usize, Counter};
use collisions::{CollisionDataset, Severity};
use geom::{Circle, Distance, Duration, FindClosest, Polygon, Time};
use map_gui::tools::ColorNetwork;
use map_gui::ID;
use widgetry::{
Choice, Color, Drawable, EventCtx, GeomBatch, GfxCtx, HorizontalAlignment, Line, Outcome,
... |
use super::Reply;
use crate::head_ext::HeaderMapExt;
use crate::server::handler::Handler;
use crate::server::limit::ContentLengthRead;
use crate::server::peek::Peekable;
use crate::server::{ResponseBuilderExt, ServerRequestExt};
use crate::AsyncReadSeek;
use crate::AsyncRuntime;
use crate::Body;
use crate::Error;
use f... |
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
use seccomp::{
Error, SeccompAction, SeccompCmpArgLen as ArgLen, SeccompCmpOp::Eq, SeccompCondition as Cond,
SeccompRule,
};
#[macro_use]
mod macros;
mod filters;
pub use self::filters::default_f... |
//! AES128 driver, nRF5X-family
//!
//! Provides a simple driverto encrypt and decrypt
//! messages using aes128-ctr mode on top of aes128-ecb.
//!
//! Roughly, the module three buffers with the following content:
//!
//! * Key
//! * Initial counter
//! * Payload, to be encrypted or decrypted
//!
//! ### Key
//! The ke... |
//! `ReadWriteRiscvCsr` type for RISC-V CSRs.
use core::marker::PhantomData;
use tock_registers::registers::{
Field, FieldValue, IntLike, LocalRegisterCopy, RegisterLongName, TryFromValue,
};
pub const MINSTRETH: usize = 0xB82;
pub const MINSTRET: usize = 0xB02;
pub const MCYCLEH: usize = 0xB80;
pub const MCYCLE... |
#![deny(unused_extern_crates)]
use api::config::Config;
use api::database::Database;
use api::utils::spotify;
use api::utils::ServiceLocator;
use clap::*;
use db::prelude::*;
use db::schema::transfers;
use diesel::prelude::*;
use dotenv::dotenv;
use log::{error, info, Level::*};
use logging::jlog;
use serde_json::json;... |
use std::{
convert::{AsRef, From, Into, TryFrom},
fmt,
result::Result as StdResult,
str,
};
use super::frame::{CloseFrame, Frame};
use crate::error::{CapacityError, Error, Result};
mod string_collect {
use utf8::DecodeError;
use crate::error::{Error, Result};
#[derive(Debug)]
pub str... |
use std::env;
use std::path::{Path, PathBuf};
#[cfg(feature = "bundled")]
fn build_libevent(libevent_path: impl AsRef<std::path::Path>) -> PathBuf {
let mut config = cmake::Config::new(libevent_path);
if !cfg!(feature = "threading") {
config.define("EVENT__DISABLE_THREAD_SUPPORT", "ON");
} else {
... |
//! Handling of a player's "view."
//!
//! This module includes systems and components
//! which handle sending new data as
//! a player moves through the world.
//!
//! When a player crosses a chunk boundary, its
//! view has changed: some chunks are no longer visible,
//! while others now are. To account for this, we... |
use super::Apply;
use crate::virtual_dom::vtag::{InputFields, Value};
use crate::virtual_dom::Attributes;
use indexmap::IndexMap;
use std::collections::HashMap;
use std::iter;
use std::ops::Deref;
use web_sys::{Element, HtmlInputElement as InputElement, HtmlTextAreaElement as TextAreaElement};
impl<T: AccessValue> App... |
// Copyright 2014 The Gfx-rs Developers.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
//! A [Latin square](https://en.wikipedia.org/wiki/Latin_square) is a
//! n × n array filled with n different symbols, each occurring exactly once in
//! each row and exactly once in each column.
use crate::ExactCover;
use core::iter;
use std::collections::HashSet;
/// Instance of a Latin square puzzle.
#[derive(Deb... |
use std::io;
use std::time::{Instant,Duration};
use std::sync::atomic::Ordering;
use url::percent_encoding::{
utf8_percent_encode,
DEFAULT_ENCODE_SET,
QUERY_ENCODE_SET
};
use hyper;
use hyper::client::HttpConnector;
use hyper::{header,Method};
use hyper_tls::HttpsConnector;
use tokio::prelude::*;
use toki... |
#[cfg(test)]
pub mod test;
mod applicable_transform;
mod file_source_builder;
mod message_parser;
use self::applicable_transform::ApplicableTransform;
use crate::{
event::{self, Event, Value},
shutdown::ShutdownSignal,
sources::Source,
topology::config::{DataType, GlobalOptions, SourceConfig},
tra... |
// M_2_1_01
//
// Generative Gestaltung – Creative Coding im Web
// ISBN: 978-3-87439-902-9, First Edition, Hermann Schmidt, Mainz, 2018
// <NAME>, <NAME>, <NAME>, <NAME>
// with contributions by <NAME> and <NAME>
// Copyright 2018
//
// http://www.generative-gestaltung.de
//
// Licensed under the Apache License, Versi... |
use crate::backend::util::GpuImage;
use crate::backend::util::UniformsBuffer;
use crate::error::InvalidWindowId;
use crate::error::SetImageError;
use crate::event::EventHandlerControlFlow;
use crate::event::WindowEvent;
use crate::AsImageView;
use crate::Color;
use crate::ContextHandle;
use crate::ImageInfo;
use crate:... |
// Copyright 2020-2021, The Tremor 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 agr... |
//! Module with common error types.
mod ganache;
mod parity;
pub(crate) mod revert;
use crate::transaction::TransactionResult;
use ethcontract_common::abi::{Error as AbiError, Event, Function};
use ethcontract_common::abiext::EventExt;
pub use ethcontract_common::errors::*;
use secp256k1::Error as Secp256k1Error;
use... |
/*!
Working with timers on the Web: `setTimeout` and `setInterval`.
These APIs come in two flavors:
1. a callback style (that more directly mimics the JavaScript APIs), and
2. a `Future`s and `Stream`s API.
## Timeouts
Timeouts fire once after a period of time (measured in milliseconds).
### Timeouts with a Callb... |
use std::collections::HashMap;
use std::net::SocketAddr;
use std::path::PathBuf;
use serde::Deserialize;
use tentacle_multiaddr::MultiAddr;
use protocol::types::{Hex, H160, H256};
pub const DEFAULT_BROADCAST_TXS_SIZE: usize = 200;
pub const DEFAULT_BROADCAST_TXS_INTERVAL: u64 = 200; // milliseconds
pub const DEFAULT... |
/*
Copyright (c) 2019 <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, publish, distribute... |
use crate::dispatching::{
dialogue::{
DialogueDispatcherHandler, DialogueStage, DialogueWithCx, GetChatId, InMemStorage, Storage,
},
DispatcherHandler, UpdateWithCx,
};
use std::{fmt::Debug, marker::PhantomData};
use futures::{future::BoxFuture, FutureExt, StreamExt};
use tokio::sync::mpsc;
use cr... |
//! Module for handling signals.
use std::io;
use std::iter::FusedIterator;
use std::ops::BitOr;
use crate::event;
use crate::os::OsQueue;
use crate::sys;
/// Notifications of process signals.
///
///
/// # Notes
///
/// This will block all signals in the signal set given when creating `Signals`,
/// using `sigprocm... |
#![allow(dead_code, unused_variables, unused_imports)]
use anchor_client::anchor_lang;
use anchor_client::anchor_lang::InstructionData;
use anchor_client::anchor_lang::ToAccountMetas;
use anchor_client::solana_client::rpc_client::RpcClient;
use anchor_client::solana_client::rpc_config::RpcSendTransactionConfig;
use an... |
// 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... |
// This program isn't necessarily meant to serve as an example of how to use
// walkdir, but rather, is a good example of how a basic `find` utility can be
// written using walkdir in a way that is both correct and as fast as possible.
// This includes doing things like block buffering when not printing to a tty,
// an... |
#[cfg(feature = "realtime")]
pub mod realtime;
// mod translated_pairs { MAP: FxHashMap<&str, FxHashMap<&str, &str>> }
include!("../target/generated/translated-pairs.rs");
// mod company { MAP: FxHashMap<&str, FxHashMap<CompanyMessageId, &str>>, ... }
include!("../target/generated/company.rs");
// mod primer { MAP: ... |
use super::prelude::*;
use oceanpkg::{
api,
drop::{
name::{Name, Query},
Manifest,
},
};
use std::{
fs::{self, File},
io::{BufWriter, Write},
mem,
path::{Path, PathBuf},
process::{Command, Stdio},
};
pub const NAME: &str = "install";
pub fn cmd() -> App {
SubCommand... |
//! Window, Graphics Device and Input Handling Functions
use std::ffi::{CStr, CString};
use std::os::raw::{c_int, c_uchar};
use std::slice;
use crate::{raw, BitFlags, Color, ConfigFlag, Image, LogType};
//------------------------------------------------------------------------------
// Window-related functions
//---... |
/* Copyright (c) Fortanix, Inc.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use core::arch::x86_64::*;
use crate::avx2::*;
/// # Safety
/// The caller sh... |
//! The age file format.
use age_core::format::Stanza;
use std::io::{self, Read, Write};
use crate::{
error::DecryptError,
primitives::{HmacKey, HmacWriter},
};
#[cfg(feature = "async")]
use futures::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt};
const AGE_MAGIC: &[u8] = b"age-encryption.org/";
c... |
use core::fmt;
use iota_streams_core::{
async_trait,
prelude::Box,
Result,
};
use iota_streams_core::{
sponge::prp::PRP,
try_or,
Errors::*,
};
use iota_streams_core_edsig::signature::ed25519;
use iota_streams_ddml::{
command::*,
io,
types::{
typenum::{
U2,
... |
use gir_core::primitives::*;
use gir_core::graph::*;
use gir_core::backend::*;
use gir_core::errors::*;
use std::collections::HashMap;
use std::rc::Rc;
use std::cell::RefCell;
use std::ops::Neg;
use arrayfire as af;
#[derive(Clone)]
pub struct AfFunction {
pub initialized: bool,
pub precisions: BackendPrecis... |
extern crate libc;
extern crate serde;
#[macro_use]
extern crate lazy_static;
use libc::c_char;
use serde::{Deserialize, Serialize};
use std::collections::hash_map::RandomState;
use std::collections::{HashMap, HashSet};
use std::ffi::{CStr, CString};
use std::fs::OpenOptions;
use std::io::{BufRead, BufReader};
use std... |
// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
use std::collections::BTreeMap;
use std::convert::TryInto;
use libc;
use seccomp::{
allow_syscall, allow_syscall_if, BpfProgram, SeccompAction, SeccompCmpArgLen, SeccompCmpOp::*,
SeccompCondition... |
use arch::CapstoneBuilder;
use capstone_sys::cs_opt_value::*;
use capstone_sys::*;
use constants::{Arch, Endian, ExtraMode, Mode, OptValue, Syntax};
use error::*;
use instruction::{Insn, InsnDetail, InsnGroupId, InsnId, Instructions, RegId};
use std::convert::From;
use std::ffi::CStr;
use std::marker::PhantomData;
use ... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
//! Tasks that are executed by coordinators (short-lived compared to coordinators)
use crate::{
core_mempool::{CoreMempool, TimelineState, TxnPointer},
counters,
logging::{LogEntry, LogEvent, LogSchema},
network::Mempool... |
/*!
* API layer implementing [Draw][crate::draw::Draw] and [DrawContext][crate::draw::DrawContext]
* using XCB, pango and cairo.
*
* This is a reference implementation and requires that you have the relevant C dependencies
* installed on your system for it to work.
*/
use crate::{
core::{
data_types::... |
use std::collections::BTreeSet;
use std::fmt::Display;
use std::io::BufRead;
const WIDTH: usize = 10;
const HEIGHT: usize = 10;
const MAX_WIDTH: usize = WIDTH - 1;
const MAX_HEIGHT: usize = HEIGHT - 1;
struct EnergyMap {
map: [u8; WIDTH * HEIGHT],
}
impl EnergyMap {
fn tick(&mut self) -> usize {
// F... |
use crate::io::{DataSource, ReadState};
use std::path::PathBuf;
use std::fs::File;
use std::io::{Read, Seek, SeekFrom};
pub const BUFFER_SIZE: usize = 65535;
pub struct FileReader {
path: PathBuf,
file: File,
separator: u32,
buffer: [u8; BUFFER_SIZE],
buf_pos: u16,
buf_size: u16,
reference... |
use anyhow::anyhow;
use beancount_price_fetcher::openexchangerate::{OpenExchangeRate, Usage};
use chrono::{Duration, NaiveDate};
use clap::{App, Arg};
use commodity::{exchange_rate::ExchangeRate, CommodityTypeID};
use futures::{stream, StreamExt};
use reqwest::Client;
use serde::de::DeserializeOwned;
use std::{
col... |
//! Linux-specific implementation of the `SharedLibrary` trait.
use libc;
use crate::Segment as SegmentTrait;
use crate::SharedLibrary as SharedLibraryTrait;
use crate::{Bias, IterationControl, SharedLibraryId, Svma};
use std::any::Any;
use std::borrow::Cow;
use std::env::current_exe;
use std::ffi::{CStr, CString, O... |
use ethers_core::{
types::{
Address, BlockId, Bytes, NameOrAddress, Signature, Transaction, TransactionRequest, U256,
},
utils::keccak256,
};
use ethers_providers::{FromErr, Middleware, PendingTransaction};
use ethers_signers::Signer;
use async_trait::async_trait;
use futures_util::{future::ok, joi... |
#![allow(dead_code)]
use std::ffi::CStr;
use std::mem;
use std::os::raw::c_void;
use std::ptr;
use cgmath::{perspective, vec3, Deg, EuclideanSpace, InnerSpace, Matrix4, Point3, SquareMatrix, Vector3};
use gl::types::*;
use glfw::Context;
use crate::c_str;
use crate::shared::{load_texture, process_events, process_inp... |
use core::{ops, slice};
use macroquad::prelude::{rand, screen_height, screen_width, vec2, Vec2};
use rstar::{PointDistance, RTree, RTreeObject, AABB};
/// Genome propeties of biots.
#[derive(Debug, Copy, Clone)]
#[repr(u8)]
pub enum Gene {
/// Influences the attack value of the biot.
Attack = 0,
/// Influe... |
use super::build_filter::BuildFilter;
use super::collector::{AndCollector, FilterCollector};
use super::filter_value::FilterValue;
use super::inner_filter::InnerFilter;
use crate::diesel_ext::BoxableFilter;
use crate::juniper_ext::{NameBuilder, Nameable, FromLookAheadValue};
use crate::scalar::WundergraphScalarValue;
u... |
use structopt::StructOpt;
use std::str::FromStr;
use crate::hash256::Hash256;
use secp256k1::{ecdh, Secp256k1, key::{PublicKey, SecretKey}};
#[derive(StructOpt,Debug)]
/// Sender information.
pub struct Wallet {
#[structopt(long)]
/// Public address of sender to be used as input.
///
pub in_address: St... |
use super::{healthcheck_response, GcpAuthConfig, GcpCredentials, Scope};
use crate::{
event::{Event, LogEvent},
sinks::{
util::{
encoding::{
skip_serializing_if_default, EncodingConfigWithDefault, EncodingConfiguration,
},
http::{https_client, HttpRetr... |
//! An example hello world contract also used in unit tests.
extern crate alloc;
use std::convert::TryInto;
use oas20::types::{ReceiverRequest, Request as Oas20Request, TokenInstantiation};
use oasis_contract_sdk::{
self as sdk,
env::{Crypto, Env},
storage::Store,
types::{
crypto::SignatureKi... |
// x11-rs: Rust bindings for X11 libraries
// The X11 libraries are available under the MIT license.
// These bindings are public domain.
use libc::FILE;
use crate::os_primitives::{c_char, c_int, c_long, c_uchar, c_uint, c_ulong, c_void};
use ::xlib::{Cursor, Display, XColor, XImage};
//
// functions
//
x11_link! {... |
// Copyright 2020 ETH Zurich and University of Bologna.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
// This seems to be bug in the compiler.
#[macro_use]
extern crate clap;
#[macro_use]
extern crate log;
extern crate llvm_sys as llvm;
use anyhow::... |
// 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 {
anyhow::{Context as _, Error},
core::convert::TryInto,
fidl::endpoints::{ClientEnd, RequestStream, ServerEnd},
fidl_fuchsia_ui_input ... |
use anyhow::{anyhow, Result};
use clap::Parser;
use elasticsearch::auth::Credentials;
use elasticsearch::http::transport::SingleNodeConnectionPool;
use elasticsearch::http::Url;
use elasticsearch::Elasticsearch;
use futures_retry::{FutureRetry, RetryPolicy};
use futures_util::TryFutureExt;
use jsonrpc_core_client::tran... |
use makepad_render::*;
use makepad_widget::*;
use crate::mprstokenizer::*;
use crate::makepadstorage::*;
use crate::colorpicker::*;
use crate::floatslider::*;
use std::fmt;
use std::collections::HashMap;
#[derive(Clone, Default)]
pub struct LiveItemsList {
pub live_on_self: bool,
pub visible_editors: bool,
... |
use bio::io::fasta;
use peroxide::fuga::*;
use peroxide::pnorm;
use rayon::prelude::*;
use std::cmp;
use std::convert::TryFrom;
use std::error::Error;
use std::fs::File;
use std::io::{self, Write};
/// Structure for a read with only start position and the sense of the reads.
#[derive(Debug)]
pub struct Read {
posi... |
use anyhow::{Context, Result};
use futures::{Stream, StreamExt};
use ipfs_api::IpfsApi;
use std::{io::Write, path::Path};
use tokio::io::{AsyncBufRead, AsyncBufReadExt};
use git_lfs_spec::transfer::custom::{self, Complete, Error, Event, Operation, Progress};
pub fn read_events(
input: impl AsyncBufRead + AsyncBuf... |
#[cfg(feature = "rt")]
extern "C" {
fn WWDG();
fn PVD_PVM();
fn RTC_TAMP_CSS_LSE();
fn RTC_WKUP();
fn FLASH();
fn RCC();
fn EXTI0();
fn EXTI1();
fn EXTI2();
fn EXTI3();
fn EXTI4();
fn DMA1_CH1();
fn DMA1_CH2();
fn DMA1_CH3();
fn DMA1_CH4();
fn DMA1_CH5();
... |
//! Contains the definition for the "Rust IR" -- this is basically a "lowered"
//! version of the AST, roughly corresponding to [the HIR] in the Rust
//! compiler.
use chalk_derive::Fold;
use chalk_ir::cast::Cast;
use chalk_ir::family::ChalkIr;
use chalk_ir::fold::{shift::Shift, Fold, Folder};
use chalk_ir::{
Appl... |
use crate::layer::Layer;
pub struct Network {
layers: Vec<Box<dyn Layer>>,
errors: Vec<f64>,
inputs: Vec<Vec<f64>>,
input_count: usize,
output_count: usize,
}
impl Network {
pub fn new(layers: Vec<Box<dyn Layer>>) -> Network {
assert!(!layers.is_empty(), "Network must have at least one... |
use crate::{
backend::{Backend, BackendInformation, Token},
components::placeholder::Placeholder,
data::{SharedDataBridge, SharedDataOps},
error::error,
page::AppPage,
preferences::Preferences,
};
use anyhow::Error;
use chrono::{DateTime, Utc};
use drogue_cloud_console_common::UserInfo;
use patt... |
//! a fuzzy pattern matcher for filename filtering / sorting.
//! It's not meant for file contents but for small strings (less than 1000 chars)
//! such as file names.
use {
super::NameMatch,
secular,
smallvec::{smallvec, SmallVec},
std::fmt::{self, Write},
};
type CandChars = SmallVec<[char; 32]>;
... |
use core::fmt;
use core::cmp;
use core::hash::{Hash, Hasher};
use crate::runtime::gc::{Gc, GcTrace};
use crate::runtime::errors::ExecResult;
pub mod intern;
pub mod buffer;
pub use intern::{StringSymbol, StringInterner, static_symbol, STRING_TABLE};
pub use buffer::StrBuffer;
use intern::StringTable;
// need to bu... |
use std::fs::File;
use std::io::BufWriter;
use std::path::Path;
use clap::{App, Arg};
use piet_gpu_hal::{BufferUsage, Error, Instance, Session};
use piet_gpu::{render_scene, render_svg, PietGpuRenderContext, Renderer, HEIGHT, WIDTH};
#[allow(unused)]
fn dump_scene(buf: &[u8]) {
for i in 0..(buf.len() / 4) {
... |
/// Contains the foreground actor of the repository.
///
/// The foreground actor is in charge accepting all commands and delegating them to the
/// `background actor`. If the background actor signals, that the repository contents have changed,
/// the `loader actor`is notified.
use crate::commands::{queue, Call, Comma... |
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct StandardMessageHeader<const T: char> {
/// FIX.4.2 (Always unencrypted, must be first field in message)
#[serde(rename = "8")]
#[serde(default)]
pub begin_string: fix_common::FixVersion<2>,
/// (Al... |
use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize};
use near_sdk::{env, near_bindgen,AccountId,Gas};
use near_sdk::collections::LookupMap;
use near_sdk::serde_json::{json};
const SINGLE_CALL_GAS: Gas = Gas(200000000000000);
/// The Voting details of a person
/// has_voted:Whether to vote
/// support:I... |
use ::core::result::Result;
use ::failure::Error;
use ::log::*;
use ::std::collections::HashMap;
use ::std::collections::HashSet;
use ::std::sync::Arc;
use crate::connection::*;
use crate::connection_config::*;
use crate::with_stopper::with_stopper;
/// Configuration object for NSQLookup nodes
#[derive(Clone)]
pub st... |
// Copyright (c) 2014 by SiegeLord
//
// All rights reserved. Distributed under ZLib. For full terms see the file LICENSE.
use libc::*;
pub const ALLEGRO_KEY_A: c_uint = 1;
pub const ALLEGRO_KEY_B: c_uint = 2;
pub const ALLEGRO_KEY_C: c_uint = 3;
pub const ALLEGRO_KEY_D: c_uint = 4;
pub const ALLEGRO_KEY_E: c_uint = ... |
#![cfg(test)]
pub use super::*;
use frame_support::{
construct_runtime, parameter_types, PalletId,
traits::{Everything, GenesisBuild, Nothing},
};
use frame_system::EnsureRoot;
use sp_core::H256;
use sp_runtime::{traits::IdentityLookup, Permill};
use orml_traits::parameter_type_with_key;
impl Campaign<Hash, Accoun... |
//
// main.rs
// Copyright (C) 2019 <NAME> <<EMAIL>>
// Distributed under terms of the MIT license.
//
//
use std::convert::TryInto;
use std::fs::File;
use std::io::prelude::*;
use std::path;
use std::path::PathBuf;
use anyhow::{anyhow, bail, Error};
use clap::arg_enum;
use log::{debug, info, LevelFilter};
use rand::... |
#[cfg(feature = "std")]
use std::{collections::BTreeMap, marker::PhantomData};
#[cfg(not(feature = "std"))]
use alloc::collections::BTreeMap;
#[cfg(not(feature = "std"))]
use core::marker::PhantomData;
use cryptraits::{
aead::Aead,
convert::{Len, ToVec},
hmac::Hmac,
kdf::Kdf,
key::{Generate, KeyP... |
use csv;
use csv::ReaderBuilder;
use owo_colors::OwoColorize;
use std::io::{self};
use structopt::StructOpt;
mod datatype;
#[derive(Debug, StructOpt)]
#[structopt(
name = "tv",
about = "Tidy Viewer (tv) is a csv pretty printer that uses column styling to maximize viewer enjoyment.✨✨📺✨✨\n
Example Usage:
... |
use xorslp_ec::for_benchmark;
use xorslp_ec::reorder::Pebble;
use xorslp_ec::rsv_bitmatrix;
use xorslp_ec::run;
use xorslp_ec::slp;
use xorslp_ec::vandermonde;
use xorslp_ec::Parameter;
use std::time::Instant;
extern crate itertools;
use itertools::Itertools;
extern crate structopt;
use structopt::StructOpt;
extern... |
use crate::nwg;
use crate::gl;
use crate::glutin::{
ContextBuilder, GlRequest, GlProfile, PossiblyCurrent, RawContext, Api,
dpi::PhysicalSize,
os::windows::RawContextExt
};
use std::cell::RefCell;
use std::ffi::c_void;
use std::{ptr, mem};
/**
A macro that loads the required opengl functions pointers... |
use std::fs::File;
use std::io::{BufReader, BufWriter, Read, Seek, Write};
use std::path::Path;
use anyhow::{anyhow, Context, Error};
use clap::{arg, crate_version, Command};
use dasp_interpolate::{sinc::Sinc, Interpolator};
use dasp_ring_buffer::Fixed;
use hound::{SampleFormat, WavReader, WavSpec, WavWriter};
use nn... |
use std::error::Error;
use std::sync::{
atomic::{AtomicBool, Ordering},
Arc,
};
use std::thread;
use std::time::Duration;
use crossbeam::queue;
use crate::parser::{FileStorage, PlaylistEntry};
enum Fade {
In,
Out,
None,
}
struct Block {
channels: Box<[Box<[f32]>]>,
}
impl Block {
fn new... |
use chrono::{Datelike, Local};
use itertools::Itertools;
use language::Language;
use leptos2::*;
use serde::Deserialize;
use {
calendar::{Date, Feast, LiturgicalDay, LiturgicalDayId, Rank, Weekday, BCP1979_CALENDAR},
library::summary,
};
use crate::views::Header;
use crate::utils::{
scroll_to_element_by_id... |
// Copyright 2022, The Tremor 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 t... |
// Copyright 2018 Entropy-Soldier
//
// Licensed under the MIT license: http://opensource.org/licenses/MIT
// This file may not be copied, modified, or distributed except according to those terms.
// ----------------------------------------------------------------------------
// shared: Contains utility functions and ... |
extern crate base64;
extern crate chrono;
extern crate config;
#[macro_use]
extern crate error_chain;
extern crate env_logger;
extern crate flate2;
extern crate futures;
extern crate glob;
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate log;
extern crate r2d2;
extern crate rayon;
extern crate regex;
ex... |
//
// Sysinfo
//
// Copyright (c) 2015 <NAME>
//
use crate::{NetworkData, Networks, NetworksExt, UserExt};
/// Trait to have a common fallback for the [`Pid`][crate::Pid] type.
pub trait AsU32 {
/// Allows to convert [`Pid`][crate::Pid] into [`u32`].
fn as_u32(&self) -> u32;
}
cfg_if::cfg_if! {
if #[cfg(... |
// Copyright 2019-2021 Parity Technologies (UK) Ltd.
// This file is part of substrate-subxt.
//
// subxt 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 optio... |
use super::error_message::get_error_message;
use crate::styles::{get_palette, get_size, Palette, Size};
use wasm_bindgen_test::*;
use yew::prelude::*;
use yew::{utils, App};
/// # Form Textearea
///
/// ## Features required
///
/// forms
///
/// ## Example
///
/// ```rust
/// use yew::prelude::*;
/// use yew_styles::f... |
use super::cu_ast::{
BinOp, BufferKind, Expr, Item, ParamDecl, ScalarTy, Stmt, TemplParam, TemplateArg, Ty, UnOp,
};
use crate::codegen::cu_ast::{GpuAddrSpace, Lit};
use std::fmt::Formatter;
// function cuda_fmt takes Formatter and recursively formats
// trait CudaFormat has function cuda_fmt so that cuda_fmt_vec ... |
//! ### logger
//!
//! `logger` is the module which implements Log and is used to handle log for Octopipes
//
// Octopipes-Server
// Developed by <NAME>
//
// MIT License
// Copyright (c) 2020 <NAME>
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.