text stringlengths 7.05k 33.9k |
|---|
// Copyright (c) 2022, Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
use std::collections::{BTreeMap, BTreeSet, HashSet};
use crate::crypto::Signable;
use crate::messages::CertifiedTransaction;
use crate::waypoint::{Waypoint, WaypointDiff};
use crate::{
base_types::{AuthorityName, TransactionDigest},
... |
use num_derive::FromPrimitive;
use crate::attribute::{Attribute, AttributeName};
use crate::character::character_common_data::CharacterCommonData;
use crate::character::character_sub_stat::CharacterSubStatFamily;
use crate::character::{CharacterConfig, CharacterName, CharacterStaticData};
use crate::character::skill_co... |
// Copyright (c) 2020 Huawei Technologies Co.,Ltd. All rights reserved.
//
// StratoVirt is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan
// PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWA... |
#![forbid(unsafe_code)]
#![allow(unused_imports)]
use std::{collections::VecDeque,
env,
fmt::Debug,
os::unix::net::UnixListener,
sync::{Arc, Mutex ,MutexGuard},
thread,
time::{Duration, Instant}};
// Crates.io
use chrono::prelude::*;
use mysql::Result as mys... |
use c04_advanced_opengl::{process_events, process_input, Camera, Shader};
use cgmath::prelude::*;
use cgmath::{perspective, vec3, Deg, Matrix4, Point3};
use dx::{
assets,
gles::{core30::gl, enums::*},
utils::*,
Instance,
};
use image::{DynamicImage::*, GenericImageView};
use std::path::PathBuf;
use std:... |
use std::fmt::{Debug, Display};
use std::marker::PhantomData;
use crate::alloc::{Allocator, AllocError};
use crate::ast::Span;
use crate::lexer::{Lexer, Token, SpannedToken, LexerError};
use crate::errors::{ParseError, ParseErrorKind, tracker::LineTracker, SpannedError};
#[derive(Copy, Clone, Debug)]
pub enum Separat... |
mod int;
mod scroll;
use std::cell::{Cell, RefCell};
use std::collections::HashMap;
use std::convert::TryInto;
use std::rc::Rc;
use std::str::FromStr;
use std::time::{Duration, Instant};
use flume::Sender;
use gtk::gdk::ModifierType;
use gtk::glib::SourceId;
use gtk::prelude::*;
use gtk::{cairo, gdk, gio, glib, Align... |
/* This is dvipdfmx, an eXtended version of dvipdfm by <NAME>.
Copyright (C) 2002-2016 by <NAME> and <NAME>,
the dvipdfmx project team.
Copyright (C) 1998, 1999 by <NAME> <<EMAIL>>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public Li... |
//! # bevy-hikari
//!
//! An implementation of Voxel Cone Tracing Global Illumination for [bevy].
//!
use self::{deferred::*, overlay::*, tracing::*, voxel::*};
use bevy::{
core_pipeline::{self, AlphaMask3d, Opaque3d, Transparent3d},
prelude::*,
reflect::TypeUuid,
render::{
render_graph::Render... |
use crate::debug::DebugConfig;
use crate::joyride::{FIELD_HEIGHT, FIELD_WIDTH};
use crate::road_object::{RoadObjectType, RoadSide, RoadSignType};
use crate::{boxed_array, joyride};
use bevy::{
core::AsBytes,
prelude::*,
render::texture::{Extent3d, TextureDimension, TextureFormat},
};
use core::mem::size_of;... |
//! YubiKey PC/SC transactions
use crate::{
apdu::Response,
apdu::{Apdu, Ins, StatusWords},
consts::{CB_BUF_MAX, CB_OBJ_MAX},
error::{Error, Result},
piv::{AlgorithmId, SlotId},
serialization::*,
yubikey::*,
Buffer, ObjectId,
};
use log::{error, trace};
use zeroize::Zeroizing;
#[cfg(fe... |
use std::ops::Mul;
use u256::U256;
// P = 2^256 - 2^32 - 2^9 - 2^8 - 2^7 - 2^6 - 2^4 - 1
const P_D1: u128 = 0xFFFFFFFF_FFFFFFFF_FFFFFFFE_FFFFFC2F;
const P_MINUS_2_D1: u128 = 0xFFFFFFFF_FFFFFFFF_FFFFFFFE_FFFFFC2D;
const P: U256 = U256 {
d0: 0xFFFFFFFF_FFFFFFFF_FFFFFFFF_FFFFFFFF,
d1: P_D1,
};
// const G_X: U25... |
use rustc_hash::FxHashSet as HashSet;
use serde::Deserialize;
use serde_json::Value;
use std::sync::Arc;
use algebra::module::homomorphism::FreeModuleHomomorphism;
use algebra::module::{FreeModule, Module};
use algebra::Algebra;
use ext::chain_complex::ChainComplex;
use ext::resolution::Resolution as ResolutionInner;
... |
// Copyright 2022 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//! Duplicate Address Detection.
use core::{num::NonZeroU8, time::Duration};
use net_types::{
ip::{Ipv6, Ipv6Addr},
MulticastAddr, UnicastAddr, W... |
use super::*;
use crate::{search::request::*, steps::FieldPath};
pub use self::result::*;
use std::{self, f32};
use fnv::FnvHashMap;
use itertools::Itertools;
#[inline]
pub(crate) fn boost_text_locality_all(persistence: &Persistence, term_id_hits_in_field: &mut FnvHashMap<String, FnvHashMap<String, Vec<TermId>>>) ->... |
// 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
// distributed ... |
//! This module contains all the important structs and implementations to create, configure
//! and run an application containing only a webview.
use std::{any::Any, env, net::SocketAddr, path::PathBuf, sync::{Arc, Mutex}};
#[cfg(target_os = "linux")]
use gtk::{Application, ApplicationWindow, Builder};
#[cfg(target_os... |
//! Data structure to store a list of userspace applications.
use core::marker::PhantomData;
use core::mem::{align_of, size_of};
use core::ops::{Deref, DerefMut};
use core::ptr::{slice_from_raw_parts_mut, write, NonNull};
use crate::callback::AppId;
use crate::process::{Error, ProcessType};
use crate::sched::Kernel;
... |
use ::valis::data::{
context::{ContextManager, CtxError},
ledger::{DataError, DataStore, EventFilter, ExportFormat},
model::{Actor, Entity, Event, TimeWindow},
utils,
};
mod prompts;
use prompts::{PolarAnswer::*, UserConfig};
use clap::{App, Arg};
use directories_next::ProjectDirs;
use pad::{Alignment,... |
use super::id;
use rspirv::dr::{Function, Instruction, Module, ModuleHeader, Operand};
use rspirv::spirv::{Op, Word};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_middle::bug;
pub fn collect_types(module: &Module) -> FxHashMap<Word, Instruction> {
module
.types_global_values
.it... |
#![allow(unused_variables, dead_code)]
use std::ops::Range;
use std::rc::Rc;
use logos::Logos;
use ariadne::{Color, Label, Report, ReportKind, Source};
macro_rules! valid_token {
($token:expr, $e:expr, $($m:tt)*) => {
if matches!($token.0, $($m)*) {
Ok(())
} else {
Err(CError::UnexpectedToken($token.0.clo... |
use crate::{
constants2::*,
encryption::{decrypt, encrypt},
errors::{SaveError, Smm2Error},
fix_crc32,
key_tables::*,
Course2, Error, Result,
};
use arr_macro::arr;
use async_std::{
fs::{remove_file, rename, File},
prelude::*,
};
use std::{cell::Cell, path::PathBuf};
type Courses = [Op... |
use crate::{
ast::{Expr, NaryOp},
context::{Context, InputWithContext},
real::Real,
};
use inari::dec_interval;
use nom::{
branch::alt,
bytes::complete::tag,
character::complete::{char, digit0, digit1, one_of, satisfy, space0},
combinator::{all_consuming, cut, map, map_opt, not, opt, peek, r... |
#![deny(missing_docs)]
//! # gearman-worker
//!
//! The `gearman-worker` crate provides a high level library to easily
//! implement gearman [`Worker`](struct.Worker.html)s.
//!
//! It handles registration of functions as jobs in the gearman queue
//! server, fetching of jobs and their workload.
//!
//! ## Usage
//!
//... |
/*
This tool is part of the WhiteboxTools geospatial analysis library.
Authors: Dr. <NAME>
Created: 14/09/2017
Last Modified: 13/10/2018
License: MIT
*/
use crate::raster::*;
use crate::tools::*;
use num_cpus;
use std::env;
use std::f64;
use std::fs::File;
use std::io::BufRead;
use std::io::BufReader;
use std::io::{Er... |
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
//! This module provides an API for the PureEdDSA signature scheme over the ed25519 twisted
//! Edwards curve as defined in [RFC8032](https://tools.ietf.org/html/rfc8032).
//!
//! Signature verification also checks and rejects non-cano... |
//! EGL-based surface and swapchain.
use crate::{conv, native, GlContainer, PhysicalDevice, Starc};
use glow::HasContext;
use hal::{image, window as w};
use parking_lot::Mutex;
use std::{os::raw, ptr};
#[derive(Debug)]
pub struct Swapchain {
framebuffer: glow::Framebuffer,
renderbuffer: glow::Renderbuffer,
... |
//! Eigendecomposition for symmetric square matrices
use ndarray::{s, Array1, Array2, ArrayBase, Data, DataMut, Ix2, NdFloat};
use crate::{
check_square, givens::GivensRotation, index::*, tridiagonal::SymmetricTridiagonal, Order,
Result,
};
fn symmetric_eig<A: NdFloat, S: DataMut<Elem = A>>(
mut matrix: ... |
// Copyright (c) Facebook, Inc. and its affiliates.
// Copyright (c) 2021-2022 Toposware, Inc.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
//! This crate contains Winterfell STARK prover.
//!
//! This prover can be used to generate pr... |
use async_trait::async_trait;
use codec::{Decode, Encode};
use log::{debug, error};
use parking_lot::Mutex;
use futures::{
channel::{
mpsc::{unbounded, UnboundedReceiver, UnboundedSender},
oneshot,
},
Future, StreamExt,
};
use std::{
cell::RefCell,
collections::{hash_map::DefaultHa... |
#![forbid(unsafe_code)]
//! This is a tiny project to be a quick alternative to symchk for generating
//! manifests. This mimics symchk of the form `symchk /om manifest /r <path>`
//! but only looks for MZ/PE files.
//!
//! Due to symchk doing some weird things it can often crash or get stuck in
//! infinite loops. Th... |
use crate::*;
use datamodel::dml;
use itertools::Itertools;
use std::convert::TryInto;
pub struct DatamodelConverter<'a> {
datamodel: &'a dml::Datamodel,
relations: Vec<TempRelationHolder>,
}
impl<'a> DatamodelConverter<'a> {
pub fn convert_string(datamodel: String) -> InternalDataModelTemplate {
... |
#![no_std]
#![no_main]
use defmt_rtt as _;
use panic_probe as _;
extern crate stm32l1xx_hal as hal;
mod layout;
#[macro_use]
mod dma_scan;
defmt::timestamp! {"{=u64}", {
use core::sync::atomic::{AtomicUsize, Ordering};
static COUNT: AtomicUsize = AtomicUsize::new(0);
let n = COUNT.load(Orderi... |
use crate::qr::{LinearLeastSquaresDiagonalProblem, PivotedQR};
use crate::trust_region::{determine_lambda_and_parameter_update, LMParameter};
use crate::utils::{enorm, epsmch};
use crate::LeastSquaresProblem;
use nalgebra::{
allocator::{Allocator, Reallocator},
convert, DefaultAllocator, Dim, DimMax, DimMaximum... |
// SPDX-License-Identifier: BSD-3-Clause
// rkallocbuddy/lib.rs
// Authors: 张子辰 <<EMAIL>>
// Copyright (C) 2022 吴骏东, 张子辰, 蓝俊玮, 郭耸霄 and 陈建绿.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
// 1. Redistributions of ... |
use std::fmt::Write;
use yaxpeax_arch::{AddressBase, Decoder, LengthedInstruction};
use yaxpeax_x86::long_mode::{DisplayStyle, InstDecoder};
fn test_display(data: &[u8], expected: &'static str) {
test_display_under(&InstDecoder::default(), data, expected);
}
fn test_display_under(decoder: &InstDecoder, data: &[u... |
use super::Vertex;
use crate::{
pipeline::{
AsVertexBufferDescriptor, IndexFormat, PrimitiveTopology, RenderPipelines,
VertexBufferDescriptor, VertexBufferDescriptors, VertexFormat,
},
renderer::{BufferInfo, BufferUsage, RenderResourceContext, RenderResourceId},
};
use bevy_app::prelude::{Ev... |
#[derive(Clone)]
#[allow(non_camel_case_types)]
pub struct Python3_fifo {
support_level: SupportLevel,
data: DataHolder,
code: String,
imports: String,
main_file_path: String,
plugin_root: String,
cache_dir: String,
interpreter: String,
venv: Option<String>,
current_output_id: u... |
// 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.
use {
crate::error::*,
cm_rust::{self, NativeIntoFidl},
fidl::endpoints::create_proxy,
fidl_fuchsia_data as fdata, fidl_fuchsia_io as fio, ... |
//! # API for the Analog to Digital converter
//!
//! Currently implements oneshot conversion with variable sampling times.
//! Also references for the internal temperature sense, voltage
//! reference and battery sense are provided.
//!
//! ## Example
//! ``` no_run
//! use stm32f0xx_hal as hal;
//!
//! use crate::hal... |
extern crate gdk;
extern crate gio;
extern crate glib;
extern crate gstreamer as gst;
extern crate gtk;
use gdk::prelude::*;
#[allow(unused_imports)]
use gio::prelude::*;
#[allow(unused_imports)]
use glib::SendWeakRef;
use gtk::prelude::*;
use std::cmp;
#[allow(unused_imports)]
use std::os::raw::c_void;
use std::strin... |
use crate::storage::{schema::PostMigrationAction, state::StarknetEventsTable};
use anyhow::Context;
use rusqlite::{named_params, Transaction};
// This is a copy of data structures and their serialization specification as of
// revision 6. We have to keep these intact so that future changes to these types
// do not bre... |
// Copyright © 2015, <NAME>
// Licensed under the MIT License <LICENSE.md>
//! Cryptographic API Prototypes and Definitions
//108
pub const ALG_CLASS_ANY: ALG_ID = 0;
pub const ALG_CLASS_SIGNATURE: ALG_ID = 1 << 13;
pub const ALG_CLASS_MSG_ENCRYPT: ALG_ID = 2 << 13;
pub const ALG_CLASS_DATA_ENCRYPT: ALG_ID = 3 << 13;
p... |
use log::{debug, info, warn};
use twilight_cache_inmemory::{model::CachedMember, InMemoryCache, ResourceType};
use twilight_command_parser::{Command, CommandParserConfig, Parser};
use twilight_gateway::{cluster::Events, Cluster, Event};
use twilight_http::{
request::prelude::create_message::CreateMessageErrorType,... |
extern crate glib;
extern crate gstreamer as gst;
extern crate gstreamer_player as gst_player;
extern crate gstreamer_video as gst_video;
extern crate gtk;
extern crate serde_json;
extern crate sha2;
use self::sha2::{Digest, Sha256};
use gst::prelude::*;
use gtk::prelude::*;
use std::cell::RefCell;
use std::collection... |
// 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 {
bt_rfcomm::{profile::server_channel_from_protocol, ServerChannel},
fidl_fuchsia_bluetooth_bredr as bredr,
fuchsia_async::{DurationExt, Ti... |
//! A crate for solving Vehicle Routing Problem using default metaheuristic.
//!
//!
//! This crate provides ready-to-use functionality to solve rich ***Vehicle Routing Problem***.
//!
//! For more details check the following resources:
//!
//! - [`user guide`](https://reinterpretcat.github.io/vrp) describes how to use... |
//! A platform agnostic driver to interface with the FT5336 touch controller
//!
//! This driver was build using ['embedded-hal'] traits.
//!
//! [`embedded-hal`]: https://docs.rs/embedded-hal
#![deny(missing_docs)]
#![deny(warnings)]
#![no_std]
#[allow(unused_imports)]
use panic_semihosting;
const FT5336_DEV_MODE_R... |
use crate::utils;
/// struct for containing the information about the atoms.
pub struct Atoms {
/// The lattice of the structure.
pub lattice: Lattice,
/// The positions of the atoms in cartesian coordinates.
pub positions: Vec<[f64; 3]>,
/// Text representation from the input file.
pub text: S... |
use crate::error::NettuError;
use crate::shared::usecase::{execute, UseCase};
use actix_web::{web, HttpRequest, HttpResponse};
use futures::future::join_all;
use nettu_scheduler_api_structs::get_service_bookingslots::*;
use nettu_scheduler_domain::{
booking_slots::{
get_service_bookingslots, validate_bookin... |
use super::IntervalSet;
use crate::mpfr::Mpfr;
type B = Mpfr;
type IVS = IntervalSet<B>;
const PREC: usize = 2;
macro_rules! assert_str_eq {
($x:expr, $y:expr) => { assert_eq!($x, format!("{}", $y)) };
($x:expr, $y:expr, $($arg:tt)+) => { assert_eq!($x, format!("{}", $y), $($arg)+) };
}
macro_rules! b {
... |
/* ************************************************************************ **
** This file is part of rsp2, and is licensed under EITHER the MIT license **
** or the Apache 2.0 license, at your option. **
** **
** ... |
use crate::*;
use std::borrow::Cow;
use std::convert::{TryFrom, TryInto};
use std::net::Ipv4Addr;
#[derive(Clone, Debug)]
pub struct Ipv4Packet {
pub data: PacketData,
pub layer2_offset: Option<usize>,
pub layer3_offset: usize,
pub payload_offset: usize,
}
impl Ipv4Packet {
pub fn from_buffer(
... |
//! A freestanding version of the Veracruz execution engine, for offline development.
//!
//! ## About
//!
//! Reads a TOML configuration file at `./config/execution-engine.toml` to ascertain
//! static configuration options for computation.
//!
//! The WASM binary to execute, and any data sources being passed to the b... |
use serde::{Deserialize, Serialize};
use rand::prelude::*;
use crate::player::Player;
use crate::card::{Card, Deck, CardType};
use crate::card_pile::CardPile;
use crate::commands::CannotExecute;
#[derive(Debug, Serialize, Deserialize)]
pub struct GameState {
pub phase: Phase,
pub generation: u32,
pub star... |
extern crate argparse;
use argparse::{ArgumentParser,Store,StoreTrue};
extern crate capnp;
extern crate fuzzydb;
use fuzzydb::message_capnp;
use fuzzydb::message_capnp::message::msg_type::{CloseWriteStreamMsg,InsertEntitiesMsg,EntityMsg,EntityKeysMsg,OpenWriteStreamMsg,QueryMsg,QueryEntityMsg,QueryFilterMsg,WriteEnti... |
/// Degrees of Freedom (Groups of one or more Basis Function that can take a scalar value in the FEM solution)
pub mod dof;
/// Structures used to render a solution over a Domain
pub mod fields;
/// The internal geometric structure of a Domain. This is modified by hp-refinements.
pub mod mesh;
use dof::{
basis_spe... |
use cpu::{operation::Operation, Core};
use memory::{ReadAddr, WriteAddr};
use std::convert::From;
#[cfg(test)]
#[macro_export]
macro_rules! nes_asm {
($e:expr) => {{
let mut buf = vec![];
// We push a newline into the bytes array because of a known issue in asm6502
$crate::asm6502::assemble(format!("{}\n... |
use crate::error_unknown;
use crate::lib::error::{DfxError, DfxResult};
use crate::lib::locations::canister_did_location;
use crate::lib::models::canister_id_store::CanisterIdStore;
use crate::lib::network::network_descriptor::NetworkDescriptor;
use crate::util::check_candid_file;
mod http_transport;
use actix::Syste... |
/*! Reader and writer for the refFlat format.
The refFlat format is a transcript-oriented format in which each transcript is denoted in a single
line. It is used most prominently by the
[picard suite tools](https://broadinstitute.github.io/picard/)
A minimum specification of the columns can be found on
[this page](ht... |
use std::{
collections::HashMap,
convert::{TryFrom, TryInto},
};
use log::{info, warn};
use screeps::{
find,
game::{get_object_typed, rooms},
memory::MemoryReference,
Creep, HasId, HasPosition, ObjectId, Position, RoomName, RoomObjectProperties,
SharedCreepProperties, SpawnOptions,
};
use s... |
//! `tor-circmgr`: circuits through the Tor network on demand.
//!
//! # Overview
//!
//! This crate is part of
//! [Arti](https://gitlab.torproject.org/tpo/core/arti/), a project to
//! implement [Tor](https://www.torproject.org/) in Rust.
//!
//! In Tor, a circuit is an encrypted multi-hop tunnel over multiple
//! re... |
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
use super::{
gen_pattern_test_data, stream_data, MockWriteContext, OutgoingFrameBuffer, WrittenFrame,
};
use crate::{
stream::{
incoming_connection_flow_controller::IncomingConnectionFlowControl... |
// 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 ... |
use std::sync::{Arc, Mutex};
use std::collections::{HashSet, HashMap};
use std::pin::Pin;
use futures::task::{Spawn, SpawnError, Waker, ArcWake};
use futures::future::FutureObj;
use futures::{Poll, Future};
use crate::caller_info::{get_caller_info, CallerInfo};
/// Collect tracking information about calls to poll()... |
use super::aacoordinatetransformation;
pub fn k(year: f64) -> f64
{
12.3685 * (year - 2000.0)
}
pub fn mean_phase(k: f64) -> f64
{
//convert from K to T
let t = k / 1236.85;
let t2 = t * t;
let t3 = t2 * t;
let t4 = t3 * t;
2451550.09766 + 29.530588861 * k + 0.00015437 * t2 -... |
//! A color scheme groups colors used for different map, dynamic, and UI elements in one place, to
//! encourage deduplication. The player can also switch between different color schemes.
use std::io::Write;
use anyhow::Result;
use fs_err::File;
use serde::{Deserialize, Serialize};
use map_model::osm::RoadRank;
use ... |
use crate::dataflow::move_paths::{HasMoveData, LookupResult, MoveData, MovePathIndex};
use crate::dataflow::DataflowResults;
use crate::dataflow::MoveDataParamEnv;
use crate::dataflow::{self, do_dataflow, DebugFormatted};
use crate::dataflow::{drop_flag_effects_for_location, on_lookup_result_bits};
use crate::dataflow:... |
//! How to read arbitrary channels and rgb channels.
use crate::meta::attribute::{LevelMode, ChannelDescription, SampleType, ChannelList};
use smallvec::SmallVec;
use crate::meta::header::Header;
use crate::block::{BlockIndex, UncompressedBlock};
use crate::image::{AnyChannels, SpecificChannels};
use crate::math::{Vec... |
// Copyright 2021 Famedly GmbH
//
// 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... |
use crate::{census::CensusRing,
manager::{periodic::Periodic,
service::{Service,
Topology,
UpdateStrategy}},
util};
use habitat_butterfly;
use habitat_common::{liveliness_checker,
outputln,... |
#[path = "../framework.rs"]
mod framework;
use bytemuck::{Pod, Zeroable};
use cgmath::SquareMatrix;
use std::borrow::Cow;
use wgpu::{util::DeviceExt, AstcBlock, AstcChannel};
const IMAGE_SIZE: u32 = 128;
#[derive(Clone, Copy, Pod, Zeroable)]
#[repr(C)]
struct Vertex {
pos: [f32; 3],
normal: [f32; 3],
}
stru... |
use crate::dos_error_codes::DosErrorCode;
use std::io::{Read, Write, Seek};
use std::collections::{HashMap, VecDeque};
pub trait DosFileSystem : std::fmt::Debug {
/// Returns a file handle if successful. Error code if not.
fn create(&mut self, filename: &[u8], attributes: u16) -> Result<u16, DosErrorCode>;
/// Ret... |
#![allow(unknown_lints)]
#![allow(bare_trait_objects)]
//! Debug rinter for abstract syntax tree
//!
//! ```no_run
//! # use lang_c::print::Printer;
//! use lang_c::visit::Visit;
//! # let unit = panic!();
//! let s = &mut String::new();
//! Printer::new(s).visit_translation_unit(unit);
//! ```
use std::fmt;
use ast:... |
// Copyright 2015 The Ramp 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 applicab... |
// Copyright 2017 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
//! Basic allocator types, both generic and Unix-specific.
//!
//! ## Basic Types
//!
//! ### [`RawAlloc`](struct.RawAlloc.html)
//!
//! A `RawAlloc` is a single-threaded, non-thread-safe heap and freed memory
//! manager, implementing
//! [`core::alloc::GlobalAlloc`](https://doc.rust-lang.org/nightly/core/alloc/trait.... |
// 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 ... |
//! A channel for sending a single message between asynchronous tasks.
use crate::loom::{sync::atomic::AtomicUsize, sync::CausalCell};
use std::fmt;
use std::future::Future;
use std::mem::{self, ManuallyDrop};
use std::pin::Pin;
use std::sync::atomic::Ordering::{self, AcqRel, Acquire};
use std::sync::Arc;
use std::ta... |
use byteorder::{BigEndian, ByteOrder};
use bytes::{BufMut};
use custom_error::custom_error;
use std::io::{Error as IoError, ErrorKind, Result as IoResult, Write, Seek, SeekFrom};
pub const EBML_HEAD_ID: u64 = 0x0A45DFA3;
pub const DOC_TYPE_ID: u64 = 0x0282;
pub const VOID_ID: u64 = 0x6C;
custom_error!{pub EbmlError
... |
use frame_support::{
construct_runtime,
dispatch::Weight,
parameter_types, sp_io,
traits::{Everything, GenesisBuild, Nothing, SortedMembers},
weights::constants::WEIGHT_PER_SECOND,
PalletId,
};
use frame_system::{pallet_prelude::BlockNumberFor, EnsureOneOf, EnsureRoot, EnsureSignedBy};
use orml_... |
#![allow(dead_code)] // allow not-used code
// import dependency
use std::io:: { stdin, stdout, BufWriter, ErrorKind };
use std::fs::File;
use std::collections::HashMap;
use std::process::Command;
use ferris_says:: say; // :: means path
use rand::Rng;
use regex::Regex;
use std::thread;
use std::sync::mpsc;
use std:... |
// 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 ... |
//! A test suite to parse everything in `dump` and assert that it matches
//! the `*.dump` file it generates.
//!
//! Use `BLESS=1` in the environment to auto-update `*.err` files. Be sure to
//! look at the diff!
use anyhow::{bail, Result};
use rayon::prelude::*;
use std::env;
use std::fmt::Write;
use std::path::{Pat... |
// Copyright (c) 2018-2020 MobileCoin Inc.
//! Manages ledger block scanning for mobilecoind monitors.
//!
//! The sync code creates a pool of worker threads, and a main thread to hand off tasks to the
//! worker threads over a crossbeam channel. Each task is a request to sync block data for a given
//! monitor id. Ea... |
use crate::detail;
use crate::node::NodeId;
use crate::settings::DhtSettings;
use bencode::Value;
use common::bloom_filter::{BloomFilter128, BloomFilter256};
use common::random;
use common::sha1::Sha1Hash;
use common::types::{PublicKey, SequenceNumber, Signature};
use defaults::Defaults;
use std::cmp::Ordering;
use s... |
// Copyright (c) SimpleStaking, Viable Systems and Tezedge Contributors
// SPDX-License-Identifier: MIT
use crypto::hash::OperationHash;
use redux_rs::Store;
use std::{
collections::{BTreeMap, HashMap},
sync::Arc,
};
use tezos_messages::p2p::{
binary_message::MessageHash,
encoding::{
current_h... |
// Copyright 2018 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 ... |
//! (deprecated) Transcript management for interactive distributed key
//! generation.
use crate::api::dkg_errors::{
DkgCreateReshareTranscriptError, DkgCreateTranscriptError, DkgLoadPrivateKeyError,
InvalidArgumentError, MalformedDataError, SizeError,
};
use crate::crypto::x_for_index;
use crate::dkg::secp256... |
//!
//! Manticore PCI subsystem.
//!
#![no_std]
#![feature(const_fn_fn_ptr_basics)]
extern crate alloc;
#[macro_use]
extern crate kernel;
#[macro_use]
extern crate intrusive_collections;
use alloc::rc::Rc;
use core::intrinsics::transmute;
use intrusive_collections::{LinkedList, LinkedListLink, UnsafeRef};
use kernel... |
use byteorder::{LittleEndian, ByteOrder};
use super::func::ConfigReader;
use super::class::PciClass;
use super::bar::PciBar;
use bitflags::bitflags;
#[derive(Debug, PartialEq)]
pub enum PciHeaderError {
NoDevice,
UnknownHeaderType(u8)
}
bitflags! {
/// Flags found in the status register of a PCI device
... |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
//! Utilities for providing the completion language feature
use crate::lsp::Position;
use common::{FileKey, Span};
use graphql_synt... |
//! A slotmap, a vector-like container with unique keys instead of indices.
//!
//! See the documentation of [`SlotMap`] for details.
//!
//! [`SlotMap`]: struct.SlotMap.html
use super::{ManagedSlice as Slice};
/// Provides links between slots and elements.
///
/// The benefit of separating this struct from the elemen... |
// #[cfg(not(feature = "3d"))]
// mod dim2;
// #[cfg(feature = "3d")]
mod dim3;
use bevy::{
asset::{Assets, HandleUntyped},
prelude::*,
reflect::TypeUuid,
render::render_resource::Shader,
render::{
mesh::{Indices, Mesh, VertexAttributeValues},
render_phase::AddRenderCommand,
... |
use libc;
extern "C" {
#[no_mangle]
fn calloc(_: libc::c_ulong, _: libc::c_ulong) -> *mut libc::c_void;
#[no_mangle]
fn free(_: *mut libc::c_void);
#[no_mangle]
fn memcpy(_: *mut libc::c_void, _: *const libc::c_void, _: libc::c_ulong)
-> *mut libc::c_void;
#[no_mangle]
fn memset(_: ... |
#![recursion_limit = "128"]
//! # Log Derive
//!
//! `log-derive` provides a simple attribute macro that facilitates logs as part of the [`log`] facade <br>
//! Right now it contains two macros [`logfn`], [`logfn_inputs`] these macros are only for functions but still have a lot of power.
//!
//!
//! # Use
//! The bas... |
use crate::config::Whitelist;
use crate::geolocation::api::MaxMindAPIKey;
use crate::geolocation::api::MAXMIND_CITY_URI;
use crate::geolocation::caching::GeolocationCache;
use crate::geolocation::get_rpc_contact_ip;
use crate::geolocation::identifier::DatacenterIdentifier;
use crate::rpc_extra::with_first_block;
use an... |
//! `Tensor`, tract main data object of interest.
use crate::internal::*;
use ndarray::prelude::*;
use std::alloc;
use std::fmt;
use std::mem::{align_of, size_of};
use tract_linalg::f16::f16;
#[cfg(feature = "serialize")]
use serde::ser::{Serialize, Serializer};
use std::sync::Arc;
pub mod litteral;
/// Tensor is a... |
use std::ops::{Deref, DerefMut};
use std::borrow::{Borrow, BorrowMut};
use std::os::unix::io::RawFd;
use std::io::{self, ErrorKind, IoSlice, IoSliceMut};
use std::alloc::{self, Layout};
use std::convert::TryInto;
use std::{mem, ptr, slice};
use std::marker::PhantomData;
use libc::{c_int, c_uint, c_void};
use libc::{so... |
// Copyright 2020. 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.