text stringlengths 7.05k 33.9k |
|---|
mod macos_workaround;
use std::sync::{Arc, Mutex, Weak};
use rand::prelude::*;
use structopt::StructOpt;
use async_std::prelude::*;
use async_std::task;
use futures::channel::mpsc;
use futures::sink::{Sink, SinkExt};
use futures::stream::StreamExt;
use async_tungstenite::tungstenite;
use tungstenite::Error as WsEr... |
// ---------------------------------------------------------------------------
// Copyright: (c) 2021 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.
// -----... |
use ::{Overlay, get_string};
use ::{openvr_sys as sys, TrackedDeviceIndex};
use std::fmt;
use std::ffi::{CStr, CString};
use compositor::Texture;
use compositor::texture::Handle::{Vulkan, OpenGLTexture, OpenGLRenderBuffer};
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct OverlayError(sys::EVROverlayError);
impl Over... |
use core::convert::TryFrom;
use core::fmt::Debug;
use core::ops::{Add, AddAssign, Div, DivAssign, Index, IndexMut, Mul, MulAssign, Sub, SubAssign};
use std::iter::Sum;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use serde_big_array::big_array;
use color_data::{LAMBDA_END, LAMBDA_START};
pub use int... |
//! The initial handler is responsible for
//! handling new connections and getting
//! through the login sequence. After login
//! is completed, control is handed over to the server
//! thread, which is responsible for sending chunks/inventory/
//! players and then spawning the player.
//!
//! The initial handler is a... |
use std::cmp::{PartialOrd, Ordering, min};
use std::collections::{HashMap, BinaryHeap};
use std::io::Write;
use std::mem;
use std::net::SocketAddr;
use std::sync::{Arc, Mutex};
use std::time::{Instant, Duration};
use serde_cbor::from_slice;
use serde_cbor::ser::to_writer;
use futures::{Future, Async, Stream};
use quic... |
use crate::util::{usize_from_bytes_be_padded, NumericError};
use log::trace;
use thiserror::Error;
/// An enum for matching recursive length prefix encoded bytes
#[derive(PartialEq)]
pub(crate) enum Rlp<'a> {
Bytes(&'a [u8]),
List(&'a [u8]),
EmptyList,
Empty,
}
impl<'a> std::fmt::Debug for Rlp<'a> {
... |
//! One-shot channel.
//!
//! The channel allows you to send a single value and that it. It does allow the
//! channel's allocation to be reused via [`Receiver::try_reset`]. It is
//! designed to be used for [Remote Procedure Calls (RPC)].
//!
//! [Remote Procedure Calls (RPC)]: https://en.wikipedia.org/wiki/Remote_pro... |
use glob::Pattern;
use regex::Regex;
use rusoto_core::Region;
use std::str::FromStr;
use structopt::clap::AppSettings;
use structopt::StructOpt;
use thiserror::Error;
/// Walk an Amazon S3 path hierarchy
#[derive(StructOpt, Debug, Clone)]
#[structopt(
name = "s3find",
global_settings(&[AppSettings::ColoredHelp, A... |
use crate::expressions::{FormatSpec, PreparedExpression};
use crate::{expressions, prelude::*};
use crate::handles::{self, Handle};
use super::into_string_lossy;
use super::AsyncResponse;
use adapter_protocol::*;
use futures::future;
use lldb::*;
use std::borrow::Cow;
use std::collections::HashMap;
use std::fmt::Wr... |
use byteorder::{
BigEndian,
ByteOrder,
LittleEndian,
ReadBytesExt,
WriteBytesExt
};
use constants::VOICE_GATEWAY_VERSION;
use internal::prelude::*;
use internal::{
ws_impl::{ReceiverExt, SenderExt},
Timer
};
use model::{
event::VoiceEvent,
id::UserId
};
use opus::{
packet as ... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - USART Configuration register. Basic USART configuration settings that typically are not changed during operation."]
pub cfg: CFG,
#[doc = "0x04 - USART Control register. USART control settings that are more likely to change dur... |
/*
MIT License
Copyright (c) 2021, 2022 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, d... |
use {Error, Errno, Result};
use std::os::unix::io::RawFd;
use libc::{c_void, off_t, size_t};
use libc;
use std::fmt;
use std::fmt::Debug;
use std::marker::PhantomData;
use std::mem;
use std::rc::Rc;
use std::ptr::{null, null_mut};
use sys::signal::*;
use sys::time::TimeSpec;
/// Mode for `AioCb::fsync`. Controls whet... |
use crate::ball::{BALL_RADIUS, BALL_RADIUS_ANGLE, NO_TEAM, SPIN_MAX};
use crate::protocol::{
ClientMoveUpdate, ClientSync, JoinData, LobbyMessageFromClient, LoginMessageFromClient,
MessageToClient, MessageToInbox, OutdatedReason, RoomMessageFromClient,
};
use crate::room::{CIRCLE_RADIUS, FIELD_HEIGHT, FIELD_WID... |
//! This module performs a static _taint analysis_ of a (typed) frawk program.
//!
//! The goal is to detect any strings that are passed to the system shell whose content is
//! "tainted" by user input. At a high level, we want to allow executing string constants and
//! concatentations of multiple string constants, bu... |
//! Proofs of correct chunking
use crate::forward_secure::CHUNK_SIZE;
use crate::random_oracles::{random_oracle, random_oracle_to_scalar, HashedMap, UniqueHash};
use crate::utils::*;
use miracl_core::bls12381::big::BIG;
use miracl_core::bls12381::ecp::ECP;
use miracl_core::bls12381::rom;
use miracl_core::rand::RAND;
u... |
extern crate clap;
use clap::{App, Arg};
use regex::Regex;
use std::collections::HashMap;
use std::error::Error;
use std::process::{Command, Stdio};
use std::{
env,
fs::{self, DirBuilder},
io::Write,
path::{Path, PathBuf},
};
#[derive(Debug)]
pub struct Config {
query: Vec<String>,
trimmomatic... |
use std::convert::TryInto;
use crate::{
angle::{DirectionX, DirectionY},
grid::Grid,
position::{SignedTilePosition, TilePosition, WorldCoords},
util::floats_equal,
AngleRad,
};
fn normalize_zeros(tp: &mut SignedTilePosition) {
// Avoid (-0.0)
if floats_equal(tp.rel_x, 0.0) {
tp.rel... |
//! Generic serialization framework.
//! # For Developers who want to serialize objects
//! Implement the `Serialize` trait for the type of objects you want to serialize. Call methods of
//! the `serializer` object. For which methods to call and how to do so, look at the documentation
//! of the `Serializer` trait.
//!... |
use crate::app::*;
use fltk_sys::fl::Fl_get_rgb_color;
/// Defines label types
#[repr(i32)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub enum LabelType {
/// Normal
Normal = 0,
/// None
None,
/// Shadow
Shadow,
/// Engraved
Engraved,
/// Embossed
Embossed,
/// Multi
Mult... |
use super::partial_derivatives::partial_deepex;
use crate::{
definitions::N_NODES_ON_STACK,
expression::deep::{DeepEx, DeepNode, ExprIdxVec},
make_default_operators,
operators::UnaryOp,
BinOp, ExParseError,
};
use num::Float;
use smallvec::{smallvec, SmallVec};
use std::fmt::{self, Debug, Display, F... |
use rand;
use rand::Rng;
use font::FONT_SET;
use CHIP8_HEIGHT;
use CHIP8_WIDTH;
use CHIP8_RAM;
const OPCODE_SIZE: usize = 2;
pub struct OutputState<'a> {
pub vram: &'a [[u8; CHIP8_WIDTH]; CHIP8_HEIGHT],
pub vram_changed: bool,
pub beep: bool,
}
enum ProgramCounter {
Next,
Skip,
Jump(usize),
... |
use geo::algorithm::contains::Contains;
use geo::algorithm::euclidean_distance::EuclideanDistance;
use geo::algorithm::line_intersection::{line_intersection, LineIntersection};
use geo::relate::Relate;
use ordered_float::NotNan;
use serde_derive::{Deserialize, Serialize};
use std::collections::HashSet;
use crate::comm... |
use sanskrit_common::errors::*;
use loader::Loader;
use sanskrit_common::store::Store;
use utils::Crc;
use model::resolved::*;
use model::*;
use alloc::vec::Vec;
use sanskrit_common::model::*;
use model::linking::{Component, CallableComponent};
use alloc::rc::Rc;
use model::bitsets::{CapSet, BitSet};
//All... |
/*
MIT License
Copyright (c) 2021 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distrib... |
use crate::block::*;
use byteorder::{BigEndian, ByteOrder, LittleEndian};
use std::fmt;
use std::io;
use std::result;
use std::time::SystemTime;
pub type Result<T> = result::Result<T, Error>;
#[derive(Debug)]
pub enum Error {
DidntUnderstandMagicNumber([u8; 4]),
NotEnoughBytes { expected: usize, actual: usize... |
use super::*;
pub const LEAN_BACK_POS: [f32; 3] = [0.0, 0.25, -1.3];
pub const LEAN_BACK_ANGLE: [f32; 3] = [0.0, PI, 0.0];
pub const LEAN_FORWARD_POS: [f32; 3] = [0.0, 1.3, 0.0];
pub const LEAN_FORWARD_ANGLE: [f32; 3] = [0.0, PI / std::f32::consts::SQRT_2, PI / std::f32::consts::SQRT_2];
pub fn movement(mut q: Query<... |
//! The universal package manager library (upm-lib) provides an abstraction to perform simple
//! commands with any package manager. Currently there are no frontends implemented, but the
//! functionality is exposed for frontends to utilize. Feel free to implement a frontend!
//!
//! If you want to do something with a ... |
/*!
A step-by-step PDF writer.
The entry point into the API is the main [`PdfWriter`], which constructs the
document into one big internal buffer. The top-level writer has many methods to
create specialized writers for specific PDF objects. These all follow the same
general pattern: They borrow the main buffer mutably... |
use tensorflow_rust_sys;
use std::path::Path;
use std::ffi::CString;
use libc;
use friday_logging;
#[cfg(target_arch="x86_64")] pub type Char = i8;
#[cfg(target_arch="x86_64")] pub type UInt = u64;
#[cfg(target_arch="arm")] pub type Char = u8;
#[cfg(target_arch="arm")] pub type UInt = u32;
pub trait TensorDataType... |
// Unfinished & WIP file
// imports
use std::{
borrow::Cow,
fmt::Display,
};
use crate::matriad::{
token::{
lexer::Set as InSet,
lexthrow::{
Set as OutSet,
NumberKind,
NumberPrecision,
StringSet,
StringValue,
},
To... |
use std::process::Command;
use error::ErrorKind;
use file::{read_file, write_file};
#[derive(Copy, Clone, Debug)]
enum PdfOpt {
Emacs,
EmacsMinted,
Pandoc,
}
#[derive(Clone, Debug)]
struct SrcBlock {
pub name: String,
pub lang: String,
pub lines: Vec<String>,
pub dependencies: Vec<Stri... |
#![deny(warnings)]
#![allow(non_camel_case_types)]
#![allow(clippy::all)]
#![no_std]
mod generic;
pub use generic::*;
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - CSI Control Register 1"]
pub csicr1: CSICR1,
#[doc = "0x04 - CSI Control Register 2"]
pub csicr2: CSICR... |
use crate::migrations::adb::{DeferredSqlType, TypeIdentifier, TypeKey};
use crate::migrations::{MigrationMut, MigrationsMut};
use crate::{SqlType, SqlVal};
use proc_macro2::TokenStream as TokenStream2;
use proc_macro2::{Ident, Span, TokenTree};
use quote::{quote, ToTokens};
use regex::Regex;
use syn::parse_quote;
use s... |
use crate::cache::Priority;
use crate::generate::{EARTH_CIRCUMFERENCE, EARTH_RADIUS};
use cgmath::*;
use serde::{Deserialize, Serialize};
use std::collections::VecDeque;
const ROOT_SIDE_LENGTH: f32 = (EARTH_CIRCUMFERENCE * 0.25) as f32;
lazy_static! {
pub static ref OFFSETS: [Vector2<i32>; 4] =
[Vector2::... |
use std::{fmt, error};
nvenum! {
/// NvAPI Status Values
///
/// All NvAPI functions return one of these codes.
pub enum NvAPI_Status / Status {
/// Success. Request is completed.
NVAPI_OK / Ok = 0,
/// Generic error
NVAPI_ERROR / Error = -1,
/// NVAPI support li... |
/**
* @File : quaternion.rs
* @Author : dtysky (<EMAIL>)
* @Link : http://dtysky.moe
* @Date : 2019/2/7 下午9:53:03
*/
use wasm_bindgen::prelude::*;
use super::common::*;
use super::matrix3::*;
use super::vector3::*;
#[wasm_bindgen]
pub struct Quaternion(pub f32, pub f32, pub f32, pub f32);
#[wasm_bindgen]
... |
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
#![forbid(unsafe_code)]
use bytecode_verifier::{verify_module, DependencyChecker};
use log::LevelFilter;
use move_lang::{compiled_unit::CompiledUnit, move_compile, shared::Address};
use sha2::{Digest, Sha256};
use std::{
collectio... |
extern crate sdl2;
use crate::consts::*;
use crate::cpu;
use crate::ram;
use anyhow::Result;
use sdl2::pixels::Color;
use sdl2::rect::{Point, Rect};
//const WIDTH: u16 = 256;
//const HEIGHT: u8 = 240;
const SCALE: u32 = 2;
const RED: Color = Color {
r: 0x64,
g: 0x00,
b: 0x00,
a: 0xFF,
};
const _GREEN:... |
use serde::Serialize;
use crate::{
did::DIDResolver,
error::{err_msg, ErrorKind, Result, ResultContext},
jws::{self, Algorithm},
secrets::SecretsResolver,
utils::{
crypto::{AsKnownKeyPair, KnownKeyPair},
did::{did_or_url, is_did},
},
Message,
};
impl Message {
/// Produ... |
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
#![cfg(target_os = "macos")]
use std::os::raw::c_void;
use crate::{
dpi::LogicalSize,
event_loop::{EventLoop, EventLoopWindowTarget},
menu::CustomMenuItem,
monitor::MonitorHandle,
platform_impl::{ge... |
// Copyright 2019. The Tari Project
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclai... |
//! Details of the `request` section of the procedural macro.
use std::{collections::BTreeSet, mem};
use proc_macro2::TokenStream;
use quote::{quote, quote_spanned, ToTokens};
use syn::{
braced,
parse::{Parse, ParseStream},
spanned::Spanned,
Attribute, Field, Ident, Lifetime, Token,
};
use crate::{
... |
// The SHA2 module is where the SHA2 hash function family is implemented
//
use crate::{
core::{
message::{
Message,
MessageBlock,
MessageSchedule
},
HashEngine,
State,
functions::sha2::*,
hash_struct,
iconst_funcs,
... |
use postgres;
use uuid::Uuid;
use std::fmt;
use chrono::{NaiveDateTime, Utc};
use apple_music;
use spotify;
use error::Error;
use super::{conn, Model};
use model::provider::Provider;
use model::state::State;
use model::enclosure::Enclosure;
use model::track::Track;
use model::artist::Artist;
static PROPS: [&'static s... |
// 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... |
#![deny(missing_docs)]
use crate::apic;
use crate::boot_info::BootInfo;
use crate::error::{Error, Result};
use crate::interrupt;
use crate::lock::ro_after_init::RoAfterInit;
use crate::memory::{
self, GuestAddressSpace, GuestPhysAddr, HostPhysAddr, HostPhysFrame,
Raw4kPage,
};
use crate::percore;
use crate::ph... |
// Copyright 2017 The Grin 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 agreed t... |
#[cfg(debug_assertions)]
use std::sync::atomic::AtomicI64;
use std::{cell::UnsafeCell, ffi::c_void};
use libloading::{Library, Symbol};
macro_rules! find_library {
($path:literal) => {
Library::new($path).map(|lib| (lib, $path))
};
}
use super::{LuaError, State as LuaState, LuaDebug};
pub type LuaInt = isize;
... |
use std::{collections::HashMap, fs, io, os::unix::fs::PermissionsExt, path::Path, string::String};
use fanotify::{
high_level::{Event, Fanotify, FanotifyMode, FanotifyResponse},
low_level::FAN_OPEN_EXEC_PERM,
};
use k8s_openapi::api::core::v1;
use nix::poll::{poll, PollFd, PollFlags};
use procfs::{process::Pro... |
//!Acid testing program
#![feature(thread_local, llvm_asm)]
fn e<T, E: ToString>(error: Result<T, E>) -> Result<T, String> {
error.map_err(|e| e.to_string())
}
fn create_test() -> Result<(), String> {
use std::fs;
use std::io::{self, Read, Write};
use std::path::PathBuf;
let mut test_dir = PathBu... |
// 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... |
/*
Copyright [2019] [<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, software
dist... |
// Copyright 2020 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT
use super::{Error, TipIndex, TipsetMetadata};
use actor::{power::State as PowerState, STORAGE_POWER_ACTOR_ADDR};
use address::Address;
use beacon::BeaconEntry;
use blake2b_simd::Params;
use blocks::{Block, BlockHeader, FullTipset, Tipset, ... |
// Compiler:
//
// Run-time:
// status: 0
#![feature(bench_black_box, const_black_box, core_intrinsics, start)]
#![no_std]
#[panic_handler]
fn panic_handler(_: &core::panic::PanicInfo) -> ! {
core::intrinsics::abort();
}
/*
* Code
*/
#[start]
fn main(_argc: isize, _argv: *const *const u8) -> isize {
us... |
use std::collections::{HashSet, HashMap};
use crate::db::{Span, NameId, NameIdSet, TaskId};
use crate::layout::{Layout, ThreadId, RowId, BoxListKey, SpanRange, LabelListKey};
use crate::render::{DrawCommand, Color, Region, SimpleRegion};
use crate::util::hsl_to_rgb;
pub struct View {
cursor: (f64, f64),
cursor... |
#![no_std]
#![no_main]
#![feature(naked_functions)]
#![feature(alloc_error_handler)]
#![feature(llvm_asm)]
#![feature(asm)]
#![feature(global_asm)]
mod hal;
#[cfg(not(test))]
use core::alloc::Layout;
#[cfg(not(test))]
use core::panic::PanicInfo;
use linked_list_allocator::LockedHeap;
use rustsbi::{print, println};
... |
use std::io::Write;
use crate::format;
use crate::styles::Animation;
use crate::term;
use crate::term::Output;
/// Standard struct implemention of progress bar.
///
/// # Examples
///
/// A clean nice progress bar with a total value.
///
/// ```rust
/// use kdam::Bar;
///
/// fn main() {
/// let mut pb = Bar::new... |
use crate::{
builtins::{PyBaseExceptionRef, PyBytesRef, PyTuple, PyTupleRef, PyTypeRef},
common::{static_cell, str::wchar_t},
convert::ToPyObject,
function::{ArgBytesLike, ArgIntoBool, ArgIntoFloat},
PyObjectRef, PyResult, TryFromObject, VirtualMachine,
};
use half::f16;
use itertools::Itertools;
us... |
use crate::*;
/// LLVM Value wrapper
#[derive(Copy)]
pub struct Value<'a>(NonNull<llvm::LLVMValue>, PhantomData<&'a ()>);
llvm_inner_impl!(Value<'a>, llvm::LLVMValue);
/// An enumeration of possible Value kinds
pub type ValueKind = llvm::LLVMValueKind;
/// Attribute placement index
#[derive(Clone, Copy, Debug, Eq, ... |
use super::config::Config;
use super::error::*;
use exif;
use image::imageops::FilterType;
use image::DynamicImage;
use image::ImageFormat;
use serde::{Deserialize, Serialize};
use std::collections::HashSet;
use std::fs;
use std::path::Path;
use std::process;
use std::process::Command;
use std::process::Stdio;
use walk... |
// Copyright (c) 2021-present, Cruise LLC
//
// This source code is licensed under the Apache License, Version 2.0,
// found in the LICENSE-APACHE file in the root directory of this source tree.
// You may not use this file except in compliance with the License.
//! WebGL bindings.
//!
//! Communicates with main_worke... |
//! `cargo upgrade`
#![warn(
missing_docs,
missing_debug_implementations,
missing_copy_implementations,
trivial_casts,
trivial_numeric_casts,
unsafe_code,
unstable_features,
unused_import_braces,
unused_qualifications
)]
#[macro_use]
extern crate error_chain;
use crate::errors::*;
... |
// Digital signal processor
// Clamp val between min and max.
macro_rules! clamp {
($val:expr, $min:expr, $max:expr) => {
std::cmp::min($max, std::cmp::max($min, $val))
};
}
mod brr;
mod envelope;
mod voice;
use bitflags::bitflags;
use crossbeam_channel::Sender;
use dasp::frame::{
Frame,
Ster... |
use std::collections::HashMap;
use std::ops::Rem;
pub fn primes() -> Box<dyn Iterator<Item = u64>> {
let mut multiples = HashMap::new();
let iter = (3..).step_by(2).filter_map(move |i| {
let (prime_or_none, factor) = match multiples.remove(&i) {
Some(f) => (None, f),
None => (So... |
use itertools::*;
use std::collections::{HashMap, HashSet};
use vek::Vec2;
type TParsed = Vec<TParsedSub>;
type TParsedSub = Tile;
pub fn day(input: String) -> (usize, usize) {
let parsed_input = parse(&input);
let (result, border_to_tiles) = part_1(&parsed_input);
(result, part_2(&parsed_input, border_to... |
#![recursion_limit = "256"]
mod api;
mod cancellation;
mod collateral;
mod constants;
mod error;
mod execution;
mod faucet;
mod issue;
mod redeem;
mod refund;
mod replace;
use crate::collateral::lock_required_collateral;
use crate::{constants::*, faucet::*, refund::*};
use bitcoin::BitcoinCoreApi;
use clap::Clap;
use... |
//! Analysis in support of copy coalescing for the backtracking allocator.
//!
//! This detects and collects information about all copy coalescing
//! opportunities in the incoming function. It does not use that information
//! at all -- that is for the main allocation loop and the spill slot allocator
//! to do.
//!
... |
extern crate dirs;
extern crate rand;
extern crate subprocess;
use subprocess::Exec;
use std::{thread, time};
//use std::process::Command;
use std::io::{self};
use std::fs;
use std::fs::File;
use std::io::BufWriter;
use std::io::BufReader;
use std::io::Read;
use std::io::Write;
use serde_json::json;
use serde_jso... |
use super::cost_domain::CostDomain;
use super::cost_language::{Cost, Symbolic};
use super::events_variants_domain::Variants;
use super::pallet::Pallet;
use super::specifications::storage_actions_specs::{HasAccessCost, AccessCost};
use crate::analysis::events_variants_domain::EventVariantsDomain;
use crate::analysis::sp... |
extern crate bytes;
extern crate futures;
extern crate hyper;
extern crate native_tls;
extern crate num_cpus;
extern crate serde_json;
extern crate tokio;
extern crate tokio_signal;
extern crate tokio_threadpool;
extern crate tokio_tls;
extern crate uuid;
#[macro_use]
extern crate serde_derive;
#[cfg(target_os = "lin... |
extern crate carbide_core;
#[macro_use]
extern crate vulkano;
extern crate vulkano_shaders;
use std::error::Error as StdError;
use std::fmt;
use std::sync::Arc;
use carbide_core::mesh::{self, Mesh};
use carbide_core::text::rt;
use carbide_core::{image, render, Rect, Scalar};
use vulkano::buffer::cpu_pool::CpuBufferP... |
//! This module contains a lot of the structures and algorithms related to memory allocation.
//!
mod btree;
mod bump;
mod slab;
mod vma;
pub use slab::{SlabAllocator, SlabBox};
use btree::BTree;
pub use bump::BumpAllocator;
use core::mem::MaybeUninit;
use core::ptr;
use core::slice;
use multiboot2::{BootInformatio... |
#![allow(clippy::absurd_extreme_comparisons)]
extern crate oxygengine_procedural as procedural;
mod data_aggregator;
use data_aggregator::*;
use minifb::{Key, KeyRepeat, MouseMode, Scale, Window, WindowOptions};
use procedural::prelude::*;
use std::f64::consts::PI;
const SIZE: usize = 100;
const ALTITUDE_LIMIT: Sca... |
// MIT License
//
// Copyright (c) 2021 <NAME> All Rights Reserved.
// Distributed under the terms of the MIT License.
//
//
#[cfg(test)]
mod tests {
use crate::{E};
#[test]
fn e() {
let init = E::default();
println!("e104 is: {}", init.get("e104"));
}
}
pub struct E {
everything... |
// Symphonia
// Copyright (c) 2019 The Project Symphonia Developers.
//
// 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 https://mozilla.org/MPL/2.0/.
use std::cmp;
use std::io;
use std::io::{Rea... |
use std::{env, ptr, isize};
use std::fs::OpenOptions;
extern crate rustbox;
use rustbox::{Color, RustBox};
use rustbox::Key;
extern crate memmap;
use memmap::MmapMut;
static BANKOCOLS: usize = 9;
static BANKOROWS: usize = 3;
static BANKOPLADESIZE: usize = 82;
#[derive(Clone, Copy, PartialEq)]
enum Mode {
Normal,... |
mod behaviour;
mod gossip;
mod request;
mod swarm;
use crate::config;
use crate::message::{self, GetSet, Message, PeerInfo, Service};
use crate::unix_socket;
use async_std::prelude::*;
use async_std::task;
use futures::channel::mpsc;
use futures::future::FutureExt;
use futures::select;
use futures::sink::SinkExt;
use ... |
// E - Linux - System
// <NAME>, 2020
#[doc(hidden)]
use {
crate::*,
std::{
os::{
raw::{
c_void,
c_int,
},
unix::io::AsRawFd,
},
ffi::{
CString,
CStr,
},
mem::transmute,
p... |
use crate::{
analytics::{Key, PositionInfo},
schema::{
contains_type, get_schema_objects, object_contains_type, resolve_object_ref, resolve_ref,
ExtMeta, ExtendedSchema, EXTENSION_KEY,
},
Document,
};
use dom::{Cast, Entries};
use lsp_types::*;
use schemars::{
schema::{InstanceType, ... |
// 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... |
// Copyright © 2021 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT
//! Runtime support to link with/use libpthread
use alloc::boxed::Box;
use core::ops::Add;
use core::ptr;
use core::ptr::NonNull;
use core::sync::atomic::{AtomicI32, AtomicUsize, Ordering};
use hashbrown::HashMap;
use... |
//! Store and manipulate Kafka messages.
use std::ffi::{CStr, CString};
use std::fmt;
use std::marker::PhantomData;
use std::os::raw::c_void;
use std::ptr;
use std::str;
use std::time::SystemTime;
use log::trace;
use rdkafka_sys as rdsys;
use rdkafka_sys::types::*;
use crate::error::{IsError, KafkaError, KafkaResul... |
use std::env;
fn main() {
let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
let api_json_file = format!("{}/godot_headers/gdnative_api.json", manifest_dir);
let out_dir = env::var("OUT_DIR").unwrap();
header_binding::generate(&manifest_dir, &out_dir);
api_wrapper::generate(&api_json_fil... |
// Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// When designing the MMDS, we thought about a split in functionality, were we have some basic
// building blocks (such as the simplified TCP implementation, and the micro HTTP server) which can
// even be... |
// Copyright (c) 2019, Facebook, Inc.
// All rights reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the "hack" directory of this source tree.
use decl_provider::NoDeclProvider;
use external_decl_provider::ExternalDeclProvider;
use hhbc_by_ref_hhas_program::HhasProgram... |
//! Logic to shard writes/deletes and push them into a write buffer sequencer.
use std::{
fmt::{Debug, Display},
future,
sync::Arc,
};
use async_trait::async_trait;
use data_types::{delete_predicate::DeletePredicate, non_empty::NonEmptyString, DatabaseName};
use dml::{DmlDelete, DmlMeta, DmlOperation, Dml... |
// This file is part of the uutils coreutils package.
//
// (c) <NAME> <<EMAIL>>
// (c) <NAME> <<EMAIL>>
//
// For the full copyright and license information, please view the LICENSE file
// that was distributed with this source code.
#[macro_use]
extern crate uucore;
use uucore::error::UError;
use uucore::error::URes... |
//! This module uses the allsorts crate to parse font data.
//! At this time it is used only to extract name information,
//! but in the future I'd like to use its shaping functionality
#![allow(dead_code)]
use crate::config::{Config, FontAttributes};
use crate::font::locator::{FontDataHandle, FontLocatorSelection};
us... |
use crate::{error::{Error,
Result},
member::{MemberList,
Membership},
protocol::{newscast,
Message},
rumor::{Departure,
Election,
ElectionUpdate,
Rumor,
... |
// The MIT License (MIT)
//
// Copyright (c) 2013 <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... |
use crate::assemble_asset::LatexmlStatus;
use crate::constants::{AR5IV_CSS_URL, DOC_NOT_FOUND_TEMPLATE, SITE_CSS_URL};
use regex::{Captures, Regex};
use std::borrow::Cow;
use unicode_segmentation::UnicodeSegmentation;
lazy_static! {
static ref END_ARTICLE: Regex = Regex::new("</article>").unwrap();
static ref END_... |
use crate::{Body, MutCow};
use encoding_rs::Encoding;
use futures_lite::{io, ready, AsyncRead, AsyncReadExt, AsyncWrite, Stream};
use httparse::Status;
use std::{
convert::TryInto,
fmt::{self, Formatter},
io::ErrorKind,
iter,
pin::Pin,
task::{Context, Poll},
};
use Poll::{Pending, Ready};
use R... |
use ::Plugin;
use build::BuildError;
use build::Context;
use build::Module;
use build::Task;
use chrono;
use chrono::DateTime;
use dunce;
use failure::Error;
use path_util;
use std::collections::HashMap;
use std::collections::HashSet;
use std::fs;
use std::path::PathBuf;
use std::process::Command;
use timeago;
pub con... |
// Copyright 2019 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, ... |
// Copyright 2019 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
// Substrate 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 la... |
use crate::constants::{memory_range, InterruptVectors};
use crate::opcodes::{Mode, OpCode};
use crate::{bus::SharedBus, opcodes};
pub mod opcodes_illegal;
pub mod opcodes_jump;
pub mod opcodes_logical;
pub mod opcodes_move;
#[cfg(test)]
mod test_helpers;
// Test must be after test_helpers, rust format tries to move t... |
// Copyright 2019. The Tari Project
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclai... |
// Copyright 2020 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.
// Do not depend on this crate. Instead, use the `fuchsia_inspect_derive` crate.
#![recursion_limit = "128"]
use proc_macro2::{Span, TokenStream};
use qu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.