text stringlengths 7.05k 33.9k |
|---|
use super::{enums, structs};
use chrono::{DateTime, Duration, FixedOffset, NaiveTime, Offset, Timelike};
use super::structs::Coordinate;
use super::traits::{DateTimeExt, NaiveTimeExt};
#[derive(Debug, Clone)]
struct SolarCalculationsRow {
// represents one row as keyed by time of day in the NOAA calculations spr... |
// Copyright 2018 Cryptape Technology LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ... |
use std::{
fmt,
sync::Arc,
};
use rayon::prelude::*;
use salsa::{Database, ParallelDatabase};
use hir::{
self, FnSignatureInfo, Problem, source_binder,
};
use ra_db::{FilesDatabase, SourceRoot, SourceRootId, SyntaxDatabase};
use ra_editor::{self, FileSymbol, find_node_at_offset, LineIndex, LocalEdit, Seve... |
use futures::future;
use futures::prelude::*;
use graph::ethabi::Token;
use std::collections::HashSet;
use std::sync::Arc;
use graph::components::ethereum::{EthereumAdapter as EthereumAdapterTrait, *};
use graph::prelude::*;
use graph::web3;
use graph::web3::api::Web3;
use graph::web3::types::{Filter, *};
pub struct ... |
use nom::{
bytes::streaming::take,
combinator::{opt, peek},
do_parse,
error::ErrorKind,
named,
number::streaming::{be_u16, be_u32, be_u64},
peek,
sequence::{tuple, Tuple},
switch, tag, take, IResult, Slice,
};
struct TempAccessUnit {
length: u16,
input_timing: u16,
is_ma... |
#![deny(unsafe_code)]
use mime::Mime;
use serde_json::{self as json, value::Value as JsonValue};
use strsim;
use yup_oauth2::{ApplicationSecret, ConsoleApplicationSecret};
pub mod dep {
pub use mime;
pub use serde_json;
pub use strsim;
pub use yup_oauth2;
}
use std::{
default::Default,
env, fm... |
pub mod identity;
pub mod packets;
mod rest;
use std::collections::HashMap;
use std::io::Read;
use std::io::Write;
use std::net::TcpStream;
use std::time;
use std::{error, fmt, io};
use flat_bytes::Flat;
use log::debug;
use log::warn;
use sodiumoxide::crypto::box_;
use sodiumoxide::crypto::box_::PublicKey;
use sodium... |
// Copyright 2018 Parity Technologies (UK) Ltd.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, mer... |
#![doc(html_root_url = "https://docs.rs/aleph-alpha-tokenizer/0.3.0")]
//! aleph-alpha-tokenizer is a fast word-piece-like tokenizer based on fst
//!
//! This can be used as a `Model` in huggingface's tokenizers, or standalone.
//!
//! By default, this library builds only the code to be used standalone. Add it
//! to ... |
use crate::{
enums::{
EvilType,
TBool,
},
models::{
Position,
TString,
VariableTBitVec,
WorldCtx,
},
};
use scroll::{
ctx::{
SizeWith,
TryFromCtx,
TryIntoCtx,
},
Endian,
Pread,
Pwrite,
LE,
};
use std::fmt::Debug;
pub use uuid::Uuid;
/// Represents the size of a T... |
#![warn(
clippy::all,
clippy::doc_markdown,
clippy::dbg_macro,
clippy::todo,
clippy::empty_enum,
clippy::enum_glob_use,
clippy::pub_enum_variant_names,
clippy::mem_forget,
clippy::use_self,
clippy::filter_map_next,
clippy::needless_continue,
clippy::needless_borrow,
r... |
use super::*;
use crate::error::Result;
use arrow_deps::arrow::{
self,
array::{
as_boolean_array, as_primitive_array, as_struct_array, make_array, Array, ArrayData,
StructArray,
},
buffer::MutableBuffer,
datatypes::DataType,
};
use arrow_deps::datafusion::parquet::{
self,
bas... |
use consts::{KERNEL_P2_INDEX, RECURSIVE_INDEX};
// Depends on kernel
use memory::{active_table, alloc_frame, dealloc_frame};
use super::riscv::addr::*;
use super::riscv::asm::{sfence_vma, sfence_vma_all};
use super::riscv::paging::{Mapper, PageTable as RvPageTable, PageTableEntry, PageTableFlags as EF, RecursivePageTab... |
//! Types used in the rest of the compiler.
use std::sync::Arc;
use std::{rc::Rc, collections::HashMap};
use num::BigInt;
use crate::util::FileSpan;
use crate::elab::{environment::{AtomID, Environment},
lisp::{LispVal, Uncons}};
// /// An argument to a function.
// #[derive(Debug, DeepSizeOf)]
// pub struct Arg {
//... |
use std::ops::Range;
use std::convert::TryInto;
use rand::prelude::*;
use rand::distributions::{ Distribution, Uniform };
use crate::utils::{ uninit_vector };
use std::prelude::v1::*;
// CONSTANTS
// ================================================================================================
// Field modulus = 2^... |
use std::{fmt, ops};
use std::cmp::Ordering;
use std::num::ParseIntError;
use std::str::FromStr;
use crate::types::int::{Int, ToInt};
use crate::division::{gcd, div};
#[derive(Debug, Clone)]
struct Rational {
numer: Int,
denom: Int,
}
//----------------------------------------------------------
// standard t... |
//! Python wrapper for Brave's adblocking library, which is written in Rust.
#![deny(
future_incompatible,
nonstandard_style,
rust_2018_idioms,
missing_copy_implementations,
trivial_casts,
trivial_numeric_casts,
unsafe_code,
unused_qualifications
)]
use adblock::blocker::BlockerError as... |
//! Contains only core game logic for the Pomp game.
//!
use std::{collections::HashMap, mem, time::Duration};
use rand::{distributions::Standard, prelude::Distribution, Rng};
use serde::{Deserialize, Serialize};
use crate::{
game::{LiveEffect, RemoteEvent, SharedLiveState, UserUuid, UserView},
setup,
};
// ... |
use thoth_api::model::affiliation::AffiliationWithInstitution;
use thoth_api::model::institution::Institution;
use uuid::Uuid;
use yew::html;
use yew::prelude::*;
use yew::ComponentLink;
use yewtil::fetch::Fetch;
use yewtil::fetch::FetchAction;
use yewtil::fetch::FetchState;
use yewtil::future::LinkFuture;
use yewtil::... |
///! Calculator to maintain the invariant on adding/removing liquidity and on swapping.
///! Large part of the code was taken from https://github.com/saber-hq/stable-swap/blob/master/stable-swap-math/src/curve.rs
use near_sdk::{Balance, Timestamp};
use crate::admin_fee::AdminFees;
use crate::utils::{FEE_DIVISOR, U256}... |
use std::time::{Duration, Instant};
use std::{
collections::HashMap,
future::ready,
sync::{Arc, Mutex},
};
use buffers::builder::TopologyBuilder;
use buffers::channel::{BufferReceiver, BufferSender};
use buffers::{BufferType, WhenFull};
use event::Event;
use futures::{FutureExt, SinkExt, StreamExt, TryFutu... |
use crate::common::api_client::sirius_proxima::{ApiResponse, PingResponse};
use crate::common::errors::api_errors::{ApiClientError, ApiResponseError};
use crate::common::errors::wifi_errors::WifiError;
use crate::constants::default_values::DefaultValues;
use crate::constants::segment_display_text::SegmentDisplayText;
u... |
use std::{
fs::{self, File},
io,
path::Path,
sync::mpsc::Receiver,
};
use rusqlite::Connection;
use crate::{
client::{Client, ParentIdParameter},
context::Context,
database::DatabaseOperation,
error::{ClientError, Error},
types::{ContentId, ContentType, RelativeFilePath},
util,... |
// Copyright (c) 2021, Qualcomm Innovation Center, Inc. All rights reserved.
//
// SPDX-License-Identifier: BSD-3-Clause
//! GNU Debugger (GDB) triage functionality
//!
//! AFLTriage heavily leans on GDB 7.10 and above to collect crash context. This includes memory,
//! registers, stack traces, along with symbol and de... |
// ΔE₉₄ computation implementation.
// Copyright (c) 2021 <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
/... |
//! Datetime-to-string routines.
use std::fmt::Display;
use std::io;
use std::io::Write;
use std::str::CharIndices;
use cal::{DatePiece, TimePiece};
use locale;
use num_traits::PrimInt;
use pad::{PadStr, Alignment};
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
pub enum Field<'a> {
Literal(&'a str),
Year(N... |
pub fn run_15_1() {
// raii.rs
fn create_box() {
// Allocate an integer on the heap
let _box1 = Box::new(3i32);
// `_box1` is destroyed here, and memory gets freed
}
// Allocate an integer on the heap
let _box2 = Box::new(5i32);
// A nested scope:
{
// Allo... |
use std::{
sync::atomic::{AtomicBool, AtomicUsize, Ordering},
time::Instant,
};
use crate::{
buffer::Image,
device::{Dev, ReducedContext, RenderDevice},
query::{PerfQuery, PerfQueryResult},
Context, ContextError, DerefDev, FramePerfReport, ImageBuilder, ImageFormat, ImageUsage,
ImmediateFra... |
use crate::core::geometry::point::{Point2i, Point2f};
use crate::core::spectrum::{Spectrum, xyz_to_rgb};
use crate::core::pbrt::{Float, Options, clamp, INFINITY};
use crate::core::filter::{Filters, Filter};
use crate::core::geometry::bounds::{Bounds2i, Bounds2f};
use crate::core::parallel::AtomicFloat;
use std::sync::R... |
use {
crate::{ErrorCode, FairLaunch, FairLaunchData, MAX_GRANULARITY},
anchor_lang::{
prelude::{
msg, AccountInfo, ProgramAccount, ProgramError, ProgramResult, Pubkey, Rent,
SolanaSysvar,
},
solana_program::{
program::{invoke, invoke_signed},
... |
/// Text handling logic related to individual lines of text.
///
/// This module is the core of multi-line text handling.
use rusttype;
use super::Font;
use rusttype::Scale;
use types::{Range, Align, Rect, RectExt};
use std;
use rusttype::GlyphId;
use std::str::CharIndices;
use std::iter::Peekable;
use super::Wrap;
us... |
// Copyright 2021 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 {
carnelian::{
color::Color,
drawing::{FontFace, GlyphMap, TextGrid, TextGridCell},
render::{BlendMode, Context as RenderCo... |
#![allow(unused_assignments)]
use crate::utils;
use std::{
os::raw::c_void,
mem::size_of,
ptr,
process::Command,
borrow::Borrow,
i64::MAX
};
use winapi::{
um::{
winbase::{
LocalFree,
LookupAccountSidW
},
tlhelp32::{
CreateToolhelp3... |
use core::fmt;
use fixedbitset::FixedBitSet;
use crate::core::{Card, Hand};
use super::errors::GameStateError;
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum Round {
Starting,
Preflop,
Flop,
Turn,
River,
Showdown,
Complete,
}
impl Round {
pub fn advance(&self) -> Result<Self,... |
use crate::chunks::{
Chunk, ChunkIterator, Configuration, Entry, KeyAndValue, MapEntry, Spec, Value, ValueType,
};
use crate::endianness::{LittleEndianU16, LittleEndianU32};
use crate::error::Error;
use crate::resources::{ResourceConfiguration, ResourceId, ResourceValue};
use crate::stringpool::LoadedStringPool;
us... |
//! LLVM style control flow graph with information of AFL-style index of the each
//! edges, use together with ``AFLCoverage`` pass having --dump-afl-cfg flag enabled.
use core::borrow::Borrow;
use serde::{Deserialize, Serialize};
use std::collections::{BinaryHeap, HashMap, HashSet};
use std::marker::PhantomData;
/// ... |
#[cfg(not(feature = "library"))]
use cosmwasm_std::entry_point;
use cosmwasm_std::{
from_binary, to_binary, Addr, Binary, CanonicalAddr, CosmosMsg, Decimal, Deps, DepsMut, Env,
MessageInfo, Response, StdError, StdResult, Uint128, WasmMsg,
};
use cosmwasm_storage::singleton_read;
use cw20::{Cw20ExecuteMsg, Cw2... |
use std::{cell::Cell, sync::Arc};
use rand::{self, Rng, SeedableRng};
use rand_xorshift::XorShiftRng;
use cgmath::{EuclideanSpace, InnerSpace, Point2, Point3, Vector3};
use super::{
algorithm::{contribute, make_tiles},
Progress, Renderer, TaskRunner,
};
use crate::cameras::Camera;
use crate::film::{DetachedP... |
pub mod error;
pub mod sys;
use logger::*;
pub use error::Error;
use std::mem::MaybeUninit;
use std::os::raw::c_char;
use std::os::raw::c_void;
pub use sys::ma_device;
macro_rules! impl_from_c {
($RustType:ty, $CType:ty) => {
impl $RustType {
pub fn from_c(c_enum: $CType) -> $RustType {
... |
// Copyright 2019-2021 Parity Technologies (UK) Ltd.
// This file is part of Parity Bridges Common.
// Parity Bridges Common 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, ... |
use crate::html;
use crate::links;
use crate::parse_string::{parse, Expression};
use crate::roam_edn::*;
use crate::string_builder::StringBuilder;
use crate::syntax_highlight;
use anyhow::{anyhow, Result};
use fxhash::{FxHashMap, FxHashSet};
use katex;
use serde::Serialize;
pub struct TitleSlugUid {
pub title: Str... |
use num_derive::FromPrimitive;
use crate::attribute::Attribute;
use crate::character::character_common_data::CharacterCommonData;
use crate::character::character_sub_stat::CharacterSubStatFamily;
use crate::character::{CharacterConfig, CharacterName, CharacterStaticData};
use crate::character::skill_config::CharacterSk... |
use std::io::Read;
use bindings::Windows::{
Graphics::Imaging::{BitmapPixelFormat, SoftwareBitmap},
Storage::Streams::Buffer,
UI::Color,
};
use byteorder::{BigEndian, ReadBytesExt};
use crate::{interop::as_mut_slice, mkv::KnownEncoding};
pub fn parse_idx(data: &[u8]) -> KnownEncoding {
let idx_string... |
//! Datatypes and properties.
//!
//! Julia has an optional typing system. The type information of a [`Value`] is available at
//! runtime. Additionally, a value can hold type information as its contents. For example,
//!
//! ```julia
//! truth = true
//! truthtype = typeof(truth)
//! @assert(truthtype == Bool)
//! @as... |
// Copyright 2020 <NAME>
// SPDX-License-Identifier: Apache-2.0
//! Types of several IOTA APIs related objects
use crate::Result;
use bee_message::{
payload::milestone::{MilestoneEssence, MILESTONE_MERKLE_PROOF_LENGTH},
prelude::*,
};
use bee_pow::providers::{Constant, ConstantBuilder, ProviderBuilder as PowP... |
mod messages;
#[cfg(test)]
mod test;
use std::io;
use bitflags::bitflags;
use byteorder::{LittleEndian, WriteBytesExt};
use lazy_static::lazy_static;
use serde_derive::{Deserialize, Serialize};
use crate::{
crypto::{compute_hmac_md5, Rc4, HASH_SIZE},
sspi::{
self, internal::SspiImpl, CertTrustStatus,... |
// Copyright 2018-2019 Parity Technologies (UK) Ltd
//
// 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... |
//! A type for indicating ranges on the dht arc
use derive_more::From;
use derive_more::Into;
use num_traits::AsPrimitive;
use std::num::Wrapping;
use std::ops::Bound;
use std::ops::RangeBounds;
#[cfg(test)]
use std::ops::RangeInclusive;
#[cfg(test)]
mod tests;
mod dht_arc_set;
pub use dht_arc_set::{ArcInterval, Dh... |
// Copyright © 2021 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT
#![allow(warnings)]
use alloc::sync::Arc;
use alloc::vec;
use alloc::vec::Vec;
use core::convert::TryInto;
use fallible_collections::{FallibleVec, FallibleVecGlobal};
use klogger::{sprint, sprintln};
use log::{debug, ... |
//
// metal_view.rs
//
// Created by TR Solutions on 2020-07-13.
// Copyright © 2020 TR Solutions Pte. Ltd.
// Licensed under Apache 2.0 and MIT
// See appropriate LICENCE files for details.
//
//! Implements our application's MetalView in Rust
use objc::{class, Encode, Encoding};
use objc::msg_send;
use objc::se... |
extern crate crossbeam;
extern crate zipf;
extern crate zookeeper;
extern crate rand;
extern crate structopt;
#[macro_use]
extern crate structopt_derive;
use std::net::SocketAddr;
use std::str::FromStr;
use std::sync::atomic::{AtomicUsize, AtomicBool, ATOMIC_USIZE_INIT, ATOMIC_BOOL_INIT};
use std::sync::atomic::Orde... |
// Copyright Materialize, Inc. All rights reserved.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License... |
use crate::{error::Error,
util};
use clap::ArgMatches;
use native_tls::Certificate;
use std::{collections::HashMap,
fmt,
fs,
io,
net::{IpAddr,
Ipv4Addr,
SocketAddr,
SocketAddrV4,
ToSocketAddrs},
... |
extern crate serde_json;
extern crate uuid;
use self::uuid::Uuid;
use errors::common::CommonError;
use errors::sovrin::SovrinError;
use errors::anoncreds::AnoncredsError;
use services::anoncreds::AnoncredsService;
use utils::crypto::bn::BigNumber;
use services::pool::PoolService;
use utils::json::{JsonDecodable, JsonE... |
use std::convert::TryFrom;
use std::fmt::Debug;
use std::fs::File;
use std::io::{BufReader, Read, Write};
use clap::{App, Arg, ArgMatches};
use colored::*;
use crate::command::Command;
use crate::commands::{ALPHABETICAL, LAST_MODIFIED};
use crate::commands::aws_meta_appender::MetadataAppender;
use crate::commands::fi... |
// 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 your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![cfg_attr(feature... |
/// EFI PXE Base Code Protocol definitions, which is used to access PXE-compatible
/// devices for network access and network booting.
/// This Protocol is introduced in EFI Specification 1.10.
use core::fmt;
use ffi::base::{
EFI_GUID,
EFI_IP_ADDRESS,
EFI_MAC_ADDRESS,
EFI_STATUS,
... |
//! Node manages its own state and the state of its peers, and orchestrates messages between them.
use core::time::Duration;
use std::collections::HashMap;
use std::fmt;
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
use futures::future::FutureExt;
use futures::select;
use futures::stream::StreamExt;
use tokio::io;
us... |
use cosmwasm_std::{BankMsg, Binary, Coin, Deps, DepsMut, Env, MessageInfo, Order, Response, StdResult, SubMsg, to_binary, Uint128, WasmMsg, WasmQuery};
#[cfg(not(feature = "library"))]
use cosmwasm_std::entry_point;
use cw0::{maybe_addr, must_pay};
use cw20::{BalanceResponse, Cw20ExecuteMsg, Cw20QueryMsg};
use cw2::{ge... |
use lucet_module_data::{Error, FunctionSpec, ModuleData, TrapManifest, TrapSite};
use byteorder::{LittleEndian, ReadBytesExt};
use colored::Colorize;
use goblin::{elf, Object};
use std::env;
use std::fs::File;
use std::io::Cursor;
use std::io::Read;
#[derive(Debug)]
struct ArtifactSummary<'a> {
buffer: &'a Vec<u8... |
use crate::models::unigram::{lattice::Lattice, model::Unigram};
use crate::tokenizer::{AddedToken, Result, Trainer};
use indicatif::{ProgressBar, ProgressStyle};
use log::debug;
use std::cmp::Reverse;
use std::collections::{HashMap, HashSet};
use std::convert::TryInto;
// A token and a score
type SentencePiece = (Stri... |
//! Pure Rust implementation of the [Argon2] password hashing function.
//!
//! # About
//!
//! Argon2 is a memory-hard [key derivation function] chosen as the winner of
//! the [Password Hashing Competition] in July 2015.
//!
//! It provides three algorithmic variants (chosen via the [`Algorithm`] enum):
//!
//! - **A... |
use crate::vm::{FileId, VM};
use dora_parser::lexer::position::Position;
#[derive(Clone, PartialEq, Eq, Debug)]
pub enum SemError {
Unimplemented,
UnknownClass(String),
UnknownType(String),
UnknownIdentifier(String),
UnknownStruct(String),
UnknownFunction(String),
UnknownField(String, Strin... |
use std::collections::BTreeMap;
use std::sync::Arc;
use byteorder::{BigEndian, ByteOrder};
use hex_fmt::{HexFmt, HexList};
use reed_solomon_erasure as rse;
use reed_solomon_erasure::ReedSolomon;
use super::merkle::{Digest, MerkleTree, Proof};
use super::message::HexProof;
use super::{Error, Message, Result};
use faul... |
use vulkano::{
buffer::{device_local::DeviceLocalBuffer, BufferUsage, CpuAccessibleBuffer},
command_buffer::{
AutoCommandBufferBuilder, CommandBufferUsage, PrimaryAutoCommandBuffer,
PrimaryCommandBuffer, SubpassContents,
},
device::physical::{PhysicalDevice, PhysicalDeviceType},
devi... |
//! This module implements a specialized linked list.
//!
//! The implemented list (from now on called a tail list) is neither a singly
//! nor doubly linked: aside from the optional link to the next node, each node
//! also has reference to the link which owns the node.
//!
//! For each tail list there is one item whi... |
//! This is loosely based on [`tiny-aes-c`].
//!
//! I was going to replace this with `RustCrypto/aes`, but the final binary size
//! increased significantly as a result.
//!
//! Comparing `.text` sizes in a `thumbv7em-none-eabi` end application:
//!
//! | implementation | `-O3` | `-O... |
use leveldb::database::Database;
use leveldb::iterator::Iterable;
use leveldb::kv::KV;
use leveldb::options::*;
use serde_json;
use std::collections::*;
use std::collections::hash_map::Entry::*;
use std::error::Error;
use std::fmt;
use std::fs::File;
use std::path::Path;
use std::time::{SystemTime, UNIX_EPOC... |
// Copyright 2020 <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 writi... |
use crate::arg_parse::{opts::*, plugins::*};
use ansi_term::Colour;
use dqcsim::{
common::types::*,
host::configuration::PluginConfiguration,
host::{configuration::*, reproduction::*},
};
use failure::{Error, Fail};
use git_testament::{git_testament, render_testament};
use std::{ffi::OsString, path::PathBuf... |
// Copyright 2020 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.
// Polkadot 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 late... |
use timeseries::*;
#[test]
#[allow(unused_assignments)]
fn readme_duration() {
use time::{Date, Month};
// Durations can be created directly ...
let mut dur = Duration::new(1, 2, 3); // 3 years, 2 months and 1 day
// ... from a pair of dates ...
let d1 = Date::from_calendar_date(2022, Month::Janu... |
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
// Think of Resources as File Descriptors. They are integers that are allocated
// by the privileged side of Deno to refer to various resources. The simplest
// example are standard file system files and stdio - but there will be other
// reso... |
use bustle::*;
use chrono::prelude::*;
use clap::{App, Arg};
use humansize::{file_size_opts as options, FileSize};
use ipc_channel::ipc::{IpcOneShotServer, IpcSender};
use libc::{c_int, sysconf};
use perfcnt::linux::{HardwareEventType as Hardware, SoftwareEventType as Software};
use perfcnt_bench::PerfCounters;
use pro... |
extern crate bcrypt;
extern crate chrono;
extern crate common;
extern crate futures;
extern crate openssl;
extern crate rusqlite;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
extern crate tokio_core;
extern crate tokio_io;
extern crate tokio_openssl;
macro_rules! attempt_or {
($result:expr, $fa... |
use std::mem::replace;
use std::rc::{Rc, Weak};
use std::cell::RefCell;
use std::boxed::FnBox;
use std::iter::IntoIterator;
use glium::backend::Facade;
use glium::texture::Texture2d;
use lazy::Lazy;
use itertools::*;
use texture_flags::*;
use texture::*;
use helpers::*;
use raw_bsp::*;
use super::{
Bsp,
BspTree... |
use ndarray::*;
use crate::internal::*;
use crate::model::*;
use super::depth_wise::DepthWise;
use super::im2col::Im2Col;
use super::mat_mat::MatMat;
use super::vec_mat::VecMat;
use super::Conv;
use crate::ops::cnn::conv::KernelFormat;
use crate::ops::cnn::{PaddingSpec, Patch, PatchSpec};
use crate::ops::nn::DataForm... |
use ash::extensions::{
ext::DebugUtils,
khr::{Surface, Swapchain},
};
#[cfg(target_os="linux")]
use ash::extensions::khr::XlibSurface;
#[cfg(target_os="windows")]
use ash::extensions::khr::Win32Surface;
use ash::{vk, Device, Entry, Instance};
use ash_window;
use winit::window::Window;
use std::{
ffi::{... |
//! Library to parse ld.so.cache according to the numerous format define in glibc
//!
//! This library doesn't use any c bindings or doesn't try to create a structure to match
//! it over the data, it uses plain parsing and thus allow the definition of endianness.
//! As parsing ld.so.cache is useful to get access to t... |
//! Lacking of a good/maintained crate alternative.
//! - Quick_crawler:0.1.2: the best candidate found, still very young ( during evaluation), no recursion support, aborts on error
//! - url-crawler:0.3.0: uses threads. While usable for a few users, it requires too many OS threads to be used within a web api. ... |
extern crate kernel32;
extern crate winapi;
use std::thread;
use std::sync::mpsc::{channel, Sender, SyncSender};
use self::winapi::{HANDLE, WCHAR};
use self::winapi::{FALSE, DWORD, SHORT, BOOL};
use self::winapi::{COORD, SMALL_RECT, CHAR_INFO, CONSOLE_SCREEN_BUFFER_INFO};
use self::winapi::{FOREGROUND_RED, FOREGROUN... |
use crate::{
core::{color::Color, math::Rect, visitor::prelude::*},
renderer::framework::framebuffer::{CullFace, DrawParameters},
utils::log::{Log, MessageKind},
};
use glow::{Framebuffer, HasContext};
use serde::Deserialize;
use std::fmt::{Display, Formatter};
#[derive(Default, Copy, Clone)]
pub struct Pi... |
#![allow(dead_code)]
use crate::abyss;
use crate::logic::Unifiable;
use crate::utils::error::Backtrace;
use abyss::object::*;
//use abyss::object::Env;
use std::rc::Rc;
//use std::cell::RefCell;
use abyss::config::HashMap;
use abyss::eval::core::*;
pub use abyss::object::EvalError;
use std::borrow::Borrow;
fn eval... |
//! Utilities around git
//! [plumbing](https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain)
//! commands.
use super::{config::PathConfig, path};
use git2::{
BranchType, Commit, Cred, DiffOptions, Direction, FetchOptions, Index, IndexAddOption,
ObjectType, PushOptions, Remote, RemoteCallbacks, ... |
use fraction::ToPrimitive;
use crate::{io::*, gp::*, enums::*, rse::*, measure::*};
/// Settings of the track.
#[derive(Debug,Clone)]
pub struct TrackSettings {
pub tablature: bool,
pub notation: bool,
pub diagram_are_below: bool,
pub show_rythm: bool,
pub force_horizontal: bool,
pub force_cha... |
extern crate unicorn_hat_hd; extern crate rgb; extern crate rand;
use unicorn_hat_hd::UnicornHatHd;
use std::{thread, time};
pub enum Rotate {
RotCW90,
}
pub fn main() {
let mut hat_hd = UnicornHatHd::default();
loop {
const OFF: rgb::RGB8 = rgb::RGB8 {r: 0, g: 0, b: 0};
const YEL... |
// Copyright Materialize, Inc. and contributors. All rights reserved.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by ... |
// 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.
//! A trie data structure used for matching inspect properties.
use {
core::marker::PhantomData,
std::collections::HashMap,
std::{cmp::Eq, fmt... |
// Copyright 2019 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 file.
use std::error;
use std::fmt;
use std::os::unix::io::RawFd;
use std::sync::Arc;
use std::time::{Duration, Instant};
use sync::{Condvar, Mutex};
use sys... |
// Copyright 2021 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::{anyhow, Context, Error},
async_trait::async_trait,
fidl::endpoints::ServerEnd,
fidl_fuchsia_hardware_block::BlockMarker,
... |
// 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 ... |
/*
This tool is part of the WhiteboxTools geospatial analysis library.
Authors: Dr. <NAME>
Created: 22/04/2018
Last Modified: 22/10/2019
License: MIT
*/
use crate::raster::*;
use crate::structures::{Array2D, BoundingBox};
use crate::tools::*;
use crate::vector::{ShapeType, Shapefile};
use std::env;
use std::f64;
use s... |
//! Replaces the game's broken cheats system with our own system that integrates with the menu.
use std::sync::atomic::{AtomicBool, Ordering};
use crate::{
call_original, gui, hook,
menu::{self, RowData, TabData},
settings::Settings,
};
use lazy_static::lazy_static;
use log::error;
use once_cell::sync::La... |
use std::collections::hash_map::HashMap;
use std::convert::TryFrom;
use std::fmt;
use std::fmt::{Display, Formatter};
use anyhow::anyhow;
use futures::future::*;
use http::{HeaderMap, HeaderValue, Method};
use http::header::{HeaderName, InvalidHeaderName, InvalidHeaderValue};
use http::header::CONTENT_TYPE;
use http::... |
//! AMQP broker.
use amq_protocol::{
types::{AMQPValue, FieldArray},
uri::AMQPUri,
};
use async_trait::async_trait;
use chrono::{DateTime, SecondsFormat, Utc};
use lapin::message::Delivery;
use lapin::options::{
BasicAckOptions, BasicConsumeOptions, BasicPublishOptions, BasicQosOptions, QueueDeclareOptions... |
// Copyright 2018 Parity Technologies (UK) Ltd.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, mer... |
mod crates;
mod godbolt;
mod misc;
mod moderation;
mod playground;
mod prefixes;
mod showcase;
use poise::serenity_prelude as serenity;
pub type Error = Box<dyn std::error::Error + Send + Sync>;
pub type Context<'a> = poise::Context<'a, Data, Error>;
pub type PrefixContext<'a> = poise::PrefixContext<'a, Data, Error>;... |
use std::{borrow::Cow, fmt::Display};
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct OpCode(pub u8);
impl OpCode {
pub const fn to_u8(self) -> u8 {
self.0
}
pub const fn to_usize(self) -> usize {
self.to_u8() as usize
}
}
impl OpCode {
pub const STOP: OpCode = OpCode(0x0... |
use super::crypto_ccm::*;
use super::*;
use crate::content::ContentType;
use crate::record_layer::record_layer_header::{ProtocolVersion, RECORD_LAYER_HEADER_SIZE};
use std::io::Cursor;
use util::Error;
use x509_parser::pem::Pem;
const RAW_PRIVATE_KEY: &'static str = "
-----<KEY>
";
#[test]
fn test_generate_key_si... |
use async_trait::async_trait;
use chrono::prelude::*;
use percent_encoding::{utf8_percent_encode, CONTROLS};
use serde_json::json;
use std::collections::HashMap;
use std::fs::Metadata;
use std::path::{Path, PathBuf};
use std::time::SystemTime;
use salvo_core::fs::NamedFile;
use salvo_core::http::{errors::*, StatusCode... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.