text stringlengths 7.05k 33.9k |
|---|
use std::sync::{Arc, Mutex, RwLock};
use std::collections::{HashSet, HashMap};
use tokio::sync::mpsc;
use std::time::Instant;
use tokio::time::{self, Duration};
use tokio::task::JoinHandle;
use tokio::runtime::Handle;
use karl_common::*;
use crate::controller::HostScheduler;
use crate::protos::ComputeRequest;
use crate... |
// Copyright 2021 <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 writ... |
// 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... |
//! The command executor executes a sub program for each run
use core::{
fmt::{self, Debug, Formatter},
marker::PhantomData,
};
#[cfg(unix)]
use std::os::unix::ffi::OsStrExt;
#[cfg(feature = "std")]
use std::process::Child;
use std::{
ffi::{OsStr, OsString},
io::{Read, Write},
path::{Path, PathBuf}... |
use crate::domain::led::matrix::*;
use crate::traits::led::ToFrame;
use embassy::time::{block_for, Duration};
use embedded_hal::digital::v2::OutputPin;
// Led matrix driver supporting up to 32x32 led matrices.
pub struct LedMatrix<P, const ROWS: usize, const COLS: usize>
where
P: OutputPin + 'static,
{
pin_row... |
extern crate threadpool;
/// Implements the actual raytracer which produces the final image
use std::ops::{Drop, Deref};
use std::time::{Duration, Instant};
use std::sync::Arc;
use std::{io, fs};
use std::default::Default;
use std::sync::mpsc::sync_channel;
use super::vec::{Vector, RFloat};
use super::group::Spherical... |
// This file is part of the uutils coreutils package.
//
// (c) <NAME>
// Collaborator: <NAME>
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
// spell-checker:ignore (paths) GPGHome findxs
use clap::{crate_version, Arg, ArgMatches, Com... |
use crate::config::{Config, ServerConfig, ServerServiceConfig, ServiceType, TransportType};
use crate::config_watcher::ServiceChange;
use crate::constants::{listen_backoff, UDP_BUFFER_SIZE};
use crate::multi_map::MultiMap;
use crate::protocol::Hello::{ControlChannelHello, DataChannelHello};
use crate::protocol::{
s... |
// Copyright (c) 2017-present PyO3 Project and Contributors
//! Exception types defined by python.
use crate::err::{PyErr, PyResult};
use crate::ffi;
use crate::type_object::PyTypeObject;
use crate::types::{PyAny, PyTuple};
use crate::Python;
use crate::{AsPyPointer, ToPyObject};
use std::ffi::CStr;
use std::os::raw:... |
// 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.
//! This is an implementation of "simple" pseudo directories.
//! Use [`mod@crate::directory::immutable::simple`]
//! to construct actual instances. See [... |
//! # web_ical
//!
//! `web_ical` is an esay iCalendar Rust library. It’s goals are to read and write ics web files (Google Calendar, Airbnb Calendar and more) data in a developer-friendly way.
//!
//! # Examples 1
//! ```
//! extern crate web_ical;
//!
//!use web_ical::Calendar;
//!
//!fn main() {
//! let icals = C... |
use crate::*;
use futures::executor::block_on;
use std::{
collections::{HashMap, VecDeque},
sync::Mutex,
};
#[cfg(feature = "tao")]
use tao::{
accelerator::Accelerator,
dpi::PhysicalSize,
event::{ElementState, Event as WEvent, MouseButton as WMouseButton, WindowEvent},
event_loop::{ControlFlow... |
use anyhow::bail;
use anyhow::Context;
use anyhow::Result;
use nix::errno::Errno;
use oci_spec::runtime::Arch;
use oci_spec::runtime::LinuxSeccomp;
use oci_spec::runtime::LinuxSeccompAction;
use oci_spec::runtime::LinuxSeccompOperator;
use seccomp::scmp_compare::*;
use seccomp::*;
use std::ffi::CString;
use std::os::un... |
// Copyright (c) 2017 The vulkano developers
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or
// https://www.apache.org/licenses/LICENSE-2.0> or the MIT
// license <LICENSE-MIT or https://opensource.org/licenses/MIT>,
// at your option. All files in the project carrying such
// notice may not be ... |
// Copyright (c) The Dijets Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{borrow_graph::BorrowGraph, error::VMError};
use move_binary_format::{
access::ModuleAccess,
file_format::{
empty_module, Ability, AbilitySet, CompiledModule, FieldInstantiation,
FieldInstantiationIn... |
//! Everything related to sound in the engine.
use fxhash::FxHashMap;
use fyrox_sound::source::SoundSource;
use std::{
cell::Cell,
ops::{Deref, DerefMut},
time::Duration,
};
// Re-export some the fyrox_sound entities.
use crate::{
core::{
inspect::{Inspect, PropertyInfo},
pool::Handle,... |
#![feature(plugin_registrar, quote, rustc_private, custom_attribute, try_from)]
extern crate rustc_plugin;
extern crate syntax;
use rustc_plugin::registry::Registry;
use std::collections::HashMap;
use std::convert::TryFrom;
use std::fs::{create_dir_all, File};
use std::io::{BufWriter, Write};
use syntax::ast::*;
use ... |
use std::iter::once;
use crate::format_element::{ConditionalGroupContent, Group, GroupPrintMode, LineMode};
use crate::{FormatElement, FormatOptions, Formatted, IndentStyle};
/// Options that affect how the [Printer] prints the format tokens
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct PrinterOptions {
/// W... |
// Copyright 2019 Zhizhesihai (Beijing) Technology Limited.
//
// 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 a... |
//! Structures and types for interfacing with the VST 2.4 API.
use std::mem;
use std::os::raw::c_void;
use plugin::Plugin;
use self::consts::*;
/// Constant values
#[allow(missing_docs)] // For obvious constants
pub mod consts {
pub const MAX_PRESET_NAME_LEN: usize = 24;
pub const MAX_PARAM_STR_LEN: usize =... |
// 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::*,
anyhow::{format_err, Context as _},
cm_rust::{self, FidlIntoNative, NativeIntoFidl},
fidl::endpoints::{self, ClientE... |
// MakAir Telemetry
//
// Copyright: 2020, <NAME>
// License: Public Domain License
use nom::IResult;
use std::ops::RangeInclusive;
use crate::locale::Locale;
use crate::structures::{TelemetryError, TelemetryErrorKind};
/// Special value that can be used in a heartbeat control message to disable RPi watchdog
pub con... |
//! Generic Abstract Syntax Support Module
//!
//! Rustlr allows any type that implements the Default trait to be used as
//! the abstract syntax type (grammar directive absyntype). However, this
//! module defines custom smart pointers [LBox] and [LRc] that simplify the
//! construction of abstract syntax trees. LBox... |
use {
std::{
ptr,
time::Instant,
os::raw::{c_void}
},
makepad_shader_compiler::makepad_math::{
Vec2,
},
crate::{
platform::{
apple::frameworks::*,
cocoa_app::CocoaApp,
},
event::{
WindowGeom,
NUM_... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - TVD MODULE CONTROL Register"]
pub tvd_en: crate::Reg<tvd_en::TVD_EN_SPEC>,
#[doc = "0x04 - TVD MODE CONTROL Register"]
pub tvd_mode: crate::Reg<tvd_mode::TVD_MODE_SPEC>,
#[doc = "0x08 - TVD CLAMP And AGC CONTROL Registe... |
// Copyright 2015-2021 Swim 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 ... |
//! This module contains the nc node message, trait and helper methods.
//! To use the node you have to implement the NCNode trait that has two methods:
//! set_initial_data() and process_data_from_server()
use std::net::{IpAddr, SocketAddr};
use std::{time::Duration};
use std::thread::{self, spawn, JoinHandle};
use s... |
use crate::err::InternalError;
use crate::parser::{
get_array_length, get_type, unit_to_di, DebugInfoParser, Reader, UnitOffset, UnitParser,
};
use crate::typ;
use gimli::constants;
use indexmap::IndexMap;
use std::collections::{BTreeMap, HashMap, HashSet};
use std::convert::TryFrom;
use std::io::Write;
use std::o... |
#![allow(unused)]
extern crate proc_macro;
use proc_macro2::{Span, TokenStream};
use quote::quote;
use syn::{
parse::{Parse, ParseStream},
punctuated::Punctuated,
visit_mut::VisitMut,
Attribute, AttributeArgs, ConstParam, Expr, ExprCall, ExprPath, FnArg, GenericArgument, GenericMethodArgument,
Ge... |
use std::fmt;
use chrono::*;
use console::Style;
use uuid::Uuid;
use redis::{
Client as RedisClient,
Commands,
FromRedisValue, from_redis_value,
Value, RedisResult,
ToRedisArgs, RedisWrite,
};
// Improve it.(Use something else instead of using 'extern crate serde' directly here)
extern crate serde... |
#![allow(unused_variables, dead_code)]
#![allow(clippy::too_many_arguments)]
use std::{
collections::{BTreeMap, HashSet},
iter, mem,
};
use proc_macro2::TokenStream;
use quote::{format_ident, quote, ToTokens};
use syn::{
parse2, parse_str, punctuated::Punctuated, Field, FieldValue, Ident, Member, Meta, Me... |
use core::ffi::c_void;
use core::fmt::Error;
use crate::dyn_utf16_ptr;
use crate::guid::*;
use crate::println;
use crate::protocols::EfiGraphicsOutputProtocol;
use crate::uefi_utils::MemoryDescriptorArray;
use crate::uefi_utils::MemoryMap;
type CHAR16 = u16;
pub type EfiStatus = usize;
// *void
pub type EfiHandle = *... |
// Copyright 2021 <NAME>.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0> or the
// MIT license <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option. This file may not be copied,
// modified, or distributed except according to those te... |
//! Module for verifying a [`crate::payload::SignedPayload`] is valid.
use bitcoinsuite_core::{
ecc::{Ecc, VerifySignatureError, PUBKEY_LENGTH},
Bytes, BytesMut, Hashed, Op, Script, Sha256,
};
use bitcoinsuite_error::{ErrorMeta, Result, WrapErr};
use thiserror::Error;
use crate::payload::{SignatureScheme, Sig... |
use std::convert::TryFrom;
use num::{NumCast, One, Zero};
#[cfg(feature = "use-mpfr")]
use rug::Float;
use crate::error::Fallible;
use crate::traits::FloatBits;
// general overview of casters:
// https://docs.google.com/spreadsheets/d/1DJohiOI3EVHjwj8g4IEdFZVf7MMyFk_4oaSyjTfkO_0/edit?usp=sharing
/// Fallible castin... |
use std::usize;
use crate::models::meta::metas_to_display;
use crate::models::utils::indent_literal;
use crate::models::{Entity, EntityAccept, VisitEntity};
use serde::Deserialize;
use std::fmt::Display;
use super::meta::{metas_to_literal, Meta};
#[derive(Clone, Debug, Deserialize)]
pub enum DataType {
Boolean,
... |
use std::sync::Arc;
use std::{
sync::{
atomic::{AtomicUsize, Ordering},
mpsc::{self, Receiver, RecvTimeoutError, SyncSender},
},
thread,
time::{Duration, Instant},
};
use anyhow::Context;
use api::grpc::{
qdrant::{raft_client::RaftClient, PeerId, RaftMessage as GrpcRaftMessage},
... |
#![cfg_attr(not(feature = "std"), no_std)]
pub use pallet::*;
#[cfg(feature = "runtime-benchmarks")]
mod benchmarking;
#[cfg(test)]
mod mock;
#[cfg(test)]
mod tests;
pub mod weights;
pub mod datastructures;
#[frame_support::pallet]
pub mod pallet {
use crate::datastructures::*;
pub use crate::weights::Weigh... |
use std::collections::{HashMap, HashSet, VecDeque};
use uuid::Uuid;
use crate::mutations::MutationKind;
use crate::node::NodeKind;
pub use connection::ConnectionGene;
pub use crossover::*;
pub use node::NodeGene;
pub mod connection;
pub mod crossover;
pub mod node;
pub type GenomeId = Uuid;
#[derive(Debug, Clone, P... |
use crate::bail;
use crate::clients::mime::content_type_equal;
use crate::clients::AsyncExchanger;
use crate::clients::ToUrls;
use crate::errors::ParseError;
use crate::Class;
use crate::Error;
use crate::Message;
use crate::Question;
use crate::Record;
use crate::Resource;
use crate::clients::stats::StatsBuilder;
use ... |
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MI... |
extern crate nalgebra as na;
use super::*;
#[derive(Copy, Clone, PartialEq, Debug, Serialize, Deserialize)]
pub struct Aabb {
// origin is in the middle
pub origin: P2,
pub width: Float,
pub height: Float,
}
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
enum Configuration {
Lesser,
Greater,
... |
use crate::context::InfluxClient;
use crate::interval_handler::IntervalReq;
use async_trait::async_trait;
use chrono::{DateTime, Duration, Utc};
use influxdb::{
integrations::serde_integration::DatabaseQueryResult, InfluxDbWriteable, Query, ReadQuery,
};
use mac_address::MacAddress;
use serde::de::DeserializeOwned;... |
#![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 - Module Configuration Register"]
pub mcr: MCR,
#[doc = "0x04 - Control 1 Register"]
pub ctrl1: CTRL1,
... |
use std::ptr::NonNull;
use crate::{
data::{DataStore, GetIndex, NodeStore},
tour::{
node::{reverse_int_seg, reverse_segs},
NodeStatus,
},
Scalar,
};
use super::{
between,
node::{to_nonnull, Segment},
NodeRel, Tour, TourIter, TourNode, TourOrder, UpdateTourError,
};
#[deriv... |
//! Test runner is a testing script for the Peggy Cosmos module. It is built in Rust rather than python or bash
//! to maximize code and tooling shared with the validator-daemon and relayer binaries.
// there are several binaries for this crate if we allow dead code on all of them
// we will see functions not used in ... |
use async_raft::{RaftStorage, NodeId, RaftMetrics, AppData};
use crate::codec::{ClientRequest, ServerResponse};
use async_raft::raft::{Entry, MembershipConfig, EntryPayload};
use async_raft::storage::{HardState, InitialState, CurrentSnapshotData};
use anyhow::Result;
use tokio::io::{AsyncRead, AsyncSeek, AsyncWrite};
u... |
use super::VkEntry;
use super::VkInstance;
use ash::prelude::VkResult;
use ash::vk;
use super::Window;
use ash::version::DeviceV1_0;
use ash::version::InstanceV1_0;
use std::ffi::CStr;
use crate::PhysicalDeviceType;
use ash::extensions::khr;
use std::mem::ManuallyDrop;
use std::sync::{Arc, Mutex};
#[cfg(debug_asse... |
//! [A0 EXTI0^v input with internall pullup] Switch d (pull down once in each main period if closed)
//! [A1 EXTI1^v input with internall pullup] Switch c (pull down once in each main period if closed)
//! [A2 EXTI2^v input with internall pullup] Switch a (pull down once in each main period if closed)
//! [A3 EXTI3^v i... |
use num_enum::TryFromPrimitive;
use std::convert::TryFrom;
use std::ops::Sub;
use strum_macros::Display;
use super::super::scanner;
use super::super::token::{Token, TokenType};
use super::chunk::Chunk;
use super::opcode::OpCode;
use super::value::Value;
pub enum InterpretResult {
Ok,
CompileError,
Runtime... |
//! The abstract surface syntax for the `Session!` macro, produced by the parser.
use {
proc_macro2::TokenStream,
quote::{quote_spanned, ToTokens},
syn::{Error, Lifetime, Type},
thunderdome::Index,
};
use crate::{
cfg::{Cfg, Ir},
target::Target,
CompileError, Spanned,
};
/// A shim for pa... |
use crate::alloc::{alloc, dealloc, free, realloc, ref_counted};
use crate::redis::listpack;
use crate::redis::listpack::Listpack;
use crate::redis::rax::{RaxMap, RaxRcMap};
use crate::redis::sds::SDS;
use self::id::{next_id, StreamID};
use spin::Mutex;
use std::error::Error;
use std::fmt;
use std::path::Path;
use std::... |
// Generated from definition io.k8s.api.core.v1.PodSpec
/// PodSpec is a description of a pod.
#[derive(Clone, Debug, Default, PartialEq)]
pub struct PodSpec {
/// Optional duration in seconds the pod may be active on the node relative to StartTime before the system will actively try to mark it failed and kill ass... |
use crate::*;
use std::{
borrow::BorrowMut,
cmp::Ordering,
fmt::{self, Debug},
};
use log::*;
/** A data structure to keep track of equalities between expressions.
Check out the [background tutorial](crate::tutorials::_01_background)
for more information on e-graphs in general.
# E-graphs in `egg`
In `... |
use crate::util::hightlight_image;
use image::{GenericImage, RgbaImage};
use PackImagePaths::*;
use std::fs;
pub trait Slicer {
fn slice(
&self,
from_path: &str,
to_path: &str,
leftover_path: Option<&str>,
pip: &PackImagePaths,
);
fn slice_all(&self, from_path: &str,... |
#![deny(clippy::all, clippy::cargo)]
#![allow(clippy::multiple_crate_versions)]
#![warn(missing_docs, nonstandard_style, rust_2018_idioms)]
//! The mechanism available for defining a Lambda function is as follows:
//!
//! Create a type that conforms to the [`tower::Service`] trait. This type can
//! then be passed to ... |
use std::collections::HashSet;
use std::fs;
use std::path::Path;
use std::str::FromStr;
use anyhow::{bail, Result};
use rusqlite::{named_params, params};
use serde::Deserialize;
use crate::twitter::Tweet;
static SCHEMA_SQL: &str = include_str!("../data/schema.sql");
pub struct Connection {
conn: rusqlite::Conne... |
use std::collections::BTreeSet;
use geom::{Duration, Polygon, Time};
use map_gui::ID;
use map_model::{IntersectionID, Map, RoadID};
use sim::{AgentType, TripMode, TripPhaseType};
use widgetry::{
lctrl, Color, EventCtx, GeomBatch, GfxCtx, HorizontalAlignment, Key, Line, Panel, ScreenDims,
ScreenPt, ScreenRectan... |
//! Sciter.Lite interface.
#![allow(non_camel_case_types, non_snake_case)]
#![allow(dead_code)]
use capi::sctypes::*;
use capi::scdef::{GFX_LAYER, ELEMENT_BITMAP_RECEIVER};
use capi::scdom::HELEMENT;
use capi::scbehavior::{MOUSE_BUTTONS, MOUSE_EVENTS, KEY_EVENTS, KEYBOARD_STATES};
#[repr(C)]
#[derive(Copy, Clone)]
... |
//! Rust PKCS11 new abstraction
//!
//! The items in the new module only expose idiomatic and safe Rust types and functions to
//! interface with the PKCS11 API. All the PKCS11 items might not be implemented but everything
//! that is implemented is safe.
//!
//! The modules under `new` follow the structure of the PKCS... |
use super::{Command, Event, Shared, Watch};
use crate::{
stats::{self, Unsent},
ToProto, WatchRequest,
};
use console_api as proto;
use proto::resources::resource;
use tokio::sync::{mpsc, Notify};
use futures::FutureExt;
use std::{
sync::{
atomic::{AtomicBool, Ordering::*},
Arc,
},
... |
use std::fmt::{self, Debug};
use std::ops::Deref;
use std::panic;
use hdf5_sys::{
h5::{hsize_t, H5_index_t, H5_iter_order_t},
h5d::H5Dopen2,
h5g::{H5G_info_t, H5Gcreate2, H5Gget_info, H5Gopen2},
h5l::{
H5L_info_t, H5L_iterate_t, H5Lcreate_hard, H5Lcreate_soft, H5Ldelete, H5Lexists,
H5Li... |
// 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.
#![deny(clippy::ped... |
use crate::simulation_controller::{SimulationController, SimulationControllerStatus};
use crate::{
render_output::screen::Screen,
simulation::{HybridFluid, SolverConfig, SolverStatisticSample},
ApplicationEvent,
};
use crate::{
renderer::{FluidRenderingMode, SceneRenderer, VolumeVisualizationMode},
... |
use std::cell::{RefCell, UnsafeCell};
use std::ffi::c_void;
use std::mem;
use std::rc::Rc;
use std::sync::Arc;
use glutin::{Api, ContextBuilder, GlProfile, GlRequest, PossiblyCurrent, WindowedContext};
use glutin::event::{ElementState, Event, TouchPhase, VirtualKeyCode, WindowEvent};
use glutin::event_loop::{ControlFl... |
use crate::common::intervention::*;
use crate::common::*;
use crate::utils::*;
use crate::{Period, Seasons, IID /*, RID*/};
// TODO(vincent): Remove derive default
#[derive(Default)]
#[allow(dead_code)]
pub struct SearchState<'maintenance> {
/// Number of interventions
pub interventions: Box<[Option<Period>]>,
... |
// Copyright 2022 pyke.io
// 2019-2021 Tauri Programme within The Commons Conservancy
// [https://tauri.studio/]
//
// 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... |
// Copyright 2021-2022 the Tectonic Project
// Licensed under the MIT License.
//! Reverse-map glyph IDs to the Unicode inputs that should create them.
//!
//! Whenever possible we try to get "ActualText" info out of the engine so that
//! we don't have to do this, but for math and potentially other situations this
//... |
// Copyright 2020 The Chubao Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to... |
use winapi::shared::windef::HWND;
use winapi::shared::minwindef::{WPARAM, LPARAM};
use winapi::um::winuser::{LBS_MULTIPLESEL, LBS_NOSEL, WS_VISIBLE, WS_DISABLED, WS_TABSTOP};
use crate::win32::window_helper as wh;
use crate::win32::base_helper::{to_utf16, from_utf16, check_hwnd};
use crate::{Font, NwgError};
use super:... |
use alloc::string::String;
use core::cell::UnsafeCell;
use core::cmp::min;
use core::intrinsics::size_of;
use core::ptr;
use core::ptr::null_mut;
use cstr_core::{c_char, CStr, CString};
use file_system_lib::{DIRECT_COUNT, INDIRECT_COUNT, DIRECTORY_SIZE, Dirent, FileStatus, iblock, INodeDisk, IPB, MAX_FILE_COUNT, TYPE... |
// Copyright 2020 Two Sigma Investments, LP.
//
// 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... |
use std::borrow::Cow;
use std::convert::TryFrom;
use std::slice;
use anyhow::{anyhow, Context, Error};
use jni::objects::{JClass, JMethodID, JObject, JString, JValue, ReleaseMode};
use jni::signature::JavaType;
use jni::sys::{jlong, jobject, jobjectArray};
use jni::JNIEnv;
use log::debug;
use log::warn;
use wasmtime::... |
//! Service and ServiceFactory implementation. Specialized wrapper over substrate service.
use automata_runtime::{self, opaque::Block, RuntimeApi};
use fc_consensus::FrontierBlockImport;
use fc_mapping_sync::MappingSyncWorker;
use fc_rpc_core::types::PendingTransactions;
use futures::StreamExt;
use sc_cli::SubstrateCl... |
use gfx_hal::pso::ShaderStageFlags;
use rendy_util::types::{vertex::VertexFormat, Layout, SetLayout};
use spirv_reflect::ShaderModule;
use std::collections::HashMap;
use std::ops::{Bound, Range, RangeBounds};
pub(crate) mod types;
pub use types::ReflectTypeError;
use types::*;
/// The item kind that couldn't be retri... |
use std::{collections::HashMap, io::Write, path::Path};
use anyhow::{anyhow, Context, Result};
use byteorder::WriteBytesExt;
use crate::{image_conversion, skeleton::Skeleton};
use super::{writer::WriteTo, Material, WriterWithCounter};
/// Stores all relevant information for a rigged object.
/// This includes a skel... |
//! Bindings for [`SCNetworkReachability`]
//!
//! [`SCNetworkReachability`]: https://developer.apple.com/documentation/systemconfiguration/scnetworkreachability-g7d
use core_foundation::{
base::{TCFType, ToVoid},
runloop::CFRunLoop,
string::{CFString, CFStringRef},
};
use system_configuration_sys::{
l... |
use ark_ff::{One, PrimeField, Zero};
use ark_std::log2;
use core::cmp;
use rand::Rng;
use zkp_curve::Curve;
use zkp_r1cs::SynthesisError;
use crate::{
commitments::packing_poly_commit,
data_structure::{
AddrTimestamps, EncodeCommit, EncodeMemory, HashForMemoryChecking, MemoryLayer,
ProdForMemor... |
mod message_queue;
mod proto;
mod provisioner;
mod proxies;
mod types;
use crate::{
mesh::{
message_queue::{DevFilter, MessageQueue},
proto::sig::ConfigModelAppStatus,
},
sensor::{SensorState, SensorValues},
util::Hex,
};
use eyre::Context;
use proto::{MeshAddr, ToPacket};
use std::{
... |
use super::database::{self, DbConn};
use super::error::Error;
use super::schema::reviews;
use rusoto_s3::{DeleteObjectTaggingRequest, S3Client, S3};
use isbn::Isbn;
use serde::{Deserialize, Serialize};
use url::Url;
use diesel_geography::types::GeogPoint;
use once_cell::sync::Lazy;
use std::borrow::Cow;
use std::collec... |
use super::Display;
use rppal::{gpio, spi};
pub use epaper3_7in::EPaper3_7in;
mod epaper3_7in {
use super::{Display, GpioInputPin, GpioOutputPin, SpiHardwareInterface};
use rppal::{gpio, spi};
use std::thread;
use std::time::Duration;
pub struct EPaper3_7in {
hardware_interface: Box<dyn... |
use super::instance::{LaunchParam, LaunchParamArray};
use super::types::KernelConfig;
use super::{KernelArrayDimension, KernelDef, KernelParam, CPP_NAMESPACE};
use crate::types::ModuleDef;
use lightning_core::prelude::*;
use lightning_core::{DataType, DataValue, PrimitiveType, MAX_DIMS};
use rand::distributions::Alphan... |
use std::collections::HashMap;
use std::error::Error;
use std::fs::File;
use std::io::prelude::*;
use std::io::BufReader;
use std::io::SeekFrom;
use std::path;
/*
OS eastings & northings (eastings always precede northings) can be expressed either
as pairs of digits, or pairs of digits preceded by a two-character... |
use bellman::{Circuit, ConstraintSystem, SynthesisError};
use pairing::bls12_381::{Bls12, Fr};
use pairing::{Engine, Field};
use sapling_crypto::circuit::num;
use sapling_crypto::jubjub::JubjubEngine;
use crate::circuit::constraint;
use crate::circuit::porc;
use crate::circuit::sloth;
use crate::compound_proof::{Circu... |
// We want the DLL to be called OidosReverb
#![allow(non_snake_case)]
#[macro_use]
extern crate vst;
use std::cmp::Ordering;
use std::sync::Arc;
use vst::buffer::AudioBuffer;
use vst::plugin::{Category, Info, Plugin, PluginParameters};
use vst::util::ParameterTransfer;
const BASE_SAMPLE_RATE: f32 = 44100.0;
const D... |
mod locked_token;
mod cross_calls;
use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize};
use near_sdk::collections::{LookupMap, UnorderedMap, UnorderedSet};
use near_sdk::json_types::ValidAccountId;
use near_sdk::{
env, near_bindgen, AccountId, CryptoHash, PanicOnDefault, Promise,
};
use near_contract_st... |
use crate::*;
use sexp::{Sexp,Atom};
use std::fmt::Debug;
use ahash::{AHashMap};
use std::hash::Hash;
/// Uncurries an s expression. For example: (app (app foo x) y) -> (foo x y)
/// panics if sexp is already uncurried.
pub fn uncurry_sexp(e: &Sexp) -> Sexp {
match e {
Sexp::List(orig_list) => {
... |
pub fn get_csr_name(index: usize) -> String {
match index {
0x000 => "ustatus".to_string(),
0x001 => "fflags".to_string(),
0x002 => "frm".to_string(),
0x003 => "fcsr".to_string(),
0x004 => "uie".to_string(),
0x005 => "utvec".to_string(),
0x040 => "uscratch".to... |
use alloc::vec::Vec;
use alloc::string::{ToString, String};
use alloc::{format, vec};
use core::iter::{IntoIterator, Iterator};
use core::convert::TryFrom;
use core::str::FromStr;
use codec::{Encode, Decode};
use keys::secret::SecretKey;
#[cfg(feature = "std")]
use serde::{
Deserialize, Serialize,
de::Error as ... |
//! # Day 12: Passage Pathing
//!
//! With your submarine's subterranean subsystems subsisting suboptimally, the only way you're getting out of this cave anytime soon is by finding a path yourself. Not just a path - the only way to know if you've found the best path is to find all of them.
//!
//! Fortunately, the sens... |
use std::{
collections::{HashSet, VecDeque},
path::{Path, PathBuf},
sync::Arc,
};
use ckb_app_config::{BlockAssemblerConfig, NetworkConfig, TxPoolConfig};
use ckb_async_runtime::{new_global_runtime, Handle};
use ckb_chain_spec::{
build_genesis_type_id_script, calculate_block_reward,
consensus::{bui... |
use crate::info::{
types_interner::{EntityType, InstanceType, Type, TypeId},
Module, ModuleContext,
};
use crate::stack_ext::StackExt;
use anyhow::{Context, Result};
use std::convert::TryFrom;
use wasm_encoder::SectionId;
use wasmparser::{SectionReader, SectionWithLimitedItems};
struct StackEntry {
parser:... |
#![feature(proc_macro_hygiene)]
extern crate atom_syndication;
extern crate bincode;
extern crate chrono;
extern crate console_error_panic_hook;
extern crate futures;
extern crate js_sys;
extern crate rss;
extern crate serde;
extern crate serde_json;
extern crate squark;
extern crate squark_macros;
extern crate squark... |
extern crate sdl2;
extern crate cgmath as cg;
extern crate tobj;
extern crate time;
extern crate scoped_pool;
use sdl2::pixels::Color;
use sdl2::event::Event;
use sdl2::keyboard::Keycode;
//use sdl2::*;
use sdl2::rect::Rect;
use sdl2::render::{Canvas, Texture};
use sdl2::video::Window;
//use std::time::Duration;
use c... |
use {VRDisplay, VRDisplayData, VRDisplayCapabilities, VREyeParameters, VRFrameData};
use {VRFramebuffer, VRPose, VRStageParameters, VRFieldOfView, VRLayer};
use super::binding as openvr;
use super::binding::ETrackedPropertyError::*;
use super::binding::ETrackedDeviceProperty::*;
use super::binding::EVREye::*;
use super... |
#![allow(clippy::needless_range_loop)]
use std::cmp;
use std::io::{BufWriter, Read, Write};
use std::io::{Error, ErrorKind, Result};
pub mod ringbuffer;
const COLON: usize = 1;
const HDR_LEN: usize = COLON;
const HDR_LEN_SZ: usize = 2;
const HDR_ADDR: usize = HDR_LEN + HDR_LEN_SZ;
const HDR_ADDR_SZ: usize = 4;
cons... |
// Copyright (c) SimpleStaking, Viable Systems and Tezedge Contributors
// SPDX-License-Identifier: MIT
//! Monitors delegate related activities (baking/endorsing) on a particular node
use std::{
collections::{BTreeMap, HashMap},
net::SocketAddr,
time::Duration,
};
use anyhow::{Context, Result};
use cryp... |
use crate::*;
use ast::*;
use compiler::*;
extern crate log;
use log::warn;
use std::collections::hash_map::HashMap;
pub struct Transpiler<'a> {
depth: usize,
builder: String,
alpha_types: bool,
fresh_type_lookup: HashMap<usize, String>,
type_definition_table: &'a TypeDefinitionTable,
}
bitflags... |
use futures::channel::{mpsc, oneshot};
use futures::stream::{Stream, StreamExt};
use js_sys::Uint8Array;
use log::{debug, error, trace};
use std::collections::BTreeMap;
use std::rc::Rc;
use todorpc::{Call, Error as RPCError, Result as RPCResult, Subscribe, Upload};
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast... |
use rstar::{RTree, RTreeObject, AABB};
use std::time::Duration;
use crate::{
layer,
lines::corner_angle,
lines::{distance_on_path, travel, traveled_segments},
sim::SIMULATION_TIMESTEP,
GameState, PixieCount, RoadSegment, SimulationState, GRID_SIZE,
};
use bevy::{
prelude::*,
utils::{HashMa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.