text stringlengths 7.05k 33.9k |
|---|
use fate::gx::gl;
use fate::math::Rgb;
use fate::img;
// TODO: Also move enums to GX
pub fn into_bytes_vec<T>(mut v: Vec<T>) -> Vec<u8> {
let (ptr, len, cap, sz) = (v.as_mut_ptr(), v.len(), v.capacity(), ::std::mem::size_of::<T>());
::std::mem::forget(v);
unsafe { Vec::from_raw_parts(ptr as *mut u8, len *... |
use std::{
cmp::Reverse,
collections::{BTreeMap, VecDeque},
fmt,
ops::DerefMut,
};
use crate::{MergeResult, Prioritised};
use self::may_be_taken::SkipIterator;
pub(crate) struct PriorityQueue<T: Prioritised> {
map: BTreeMap<Reverse<T::Priority>, VecDeque<T>>,
merge_fn: Option<fn(T, &mut T) ->... |
//! A Rust wrapper for [openstack/liberasurecode].
//!
//! [openstack/liberasurecode]: https://github.com/openstack/liberasurecode
//!
//!
//! # Prerequisites to Build
//!
//! This crate requires the following packages for building [openstack/liberasurecode] in the build script:
//! - C compiler (e.g., `gcc`)
//! - `gi... |
use std::collections::HashMap;
use std::io;
use std::net::Ipv4Addr;
use std::net::{IpAddr, SocketAddr, ToSocketAddrs};
use std::path::{Path, PathBuf};
use std::str::FromStr;
use ipnet::{IpNet, Ipv4Net, Ipv6Net};
use toml;
use crate::db::{deserialize_map_type, MapType};
use crate::format::{option_deserialize_format, F... |
use futures::{executor::ThreadPool, task::SpawnExt, Future};
use crate::backend::decode_rust;
use crate::config::{default_thread_pool, Backend, VerifierConfig};
use crate::input::{AdditionalData, Password, SecretKey};
use crate::output::HashRaw;
use crate::{Error, ErrorKind, Hasher};
impl Default for Hash {
fn de... |
//! Advanced builders for Transaction(View), Header(View) and Block(View).
use crate::{
constants, core, packed,
prelude::*,
utilities::{merkle_root, DIFF_TWO},
};
/*
* Definitions
*/
/// An advanced builder for [`TransactionView`].
///
/// Base on [`packed::TransactionBuilder`] but added lots of synta... |
use std::collections::HashSet;
#[derive(Debug, Clone)]
pub struct StopWords {
set: HashSet<String>,
}
pub struct Tokens<'a> {
pub unfiltered: Vec<&'a str>,
pub filtered: Vec<&'a str>,
}
impl StopWords {
// Derived from http://xpo6.com/list-of-english-stop-words/
pub fn new() -> Self {
let... |
extern crate parcel;
use crate::ByteSized;
/// Represents various conversion errors between mnemnoic types.
#[derive(Debug, Clone, PartialEq)]
pub enum MnemonicErr {
ConversionErr(String),
}
impl std::fmt::Display for MnemonicErr {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
m... |
use super::program::*;
use crate::common::{self, type_size};
use ast::{closure, knormal::ConstKind};
use util::{Id, ToSpanned};
type ConstMap = util::Map<Id, ConstKind>;
fn gen_new_var(p: &mut Program, t: Ty) -> Id {
let x = util::id::gen_tmp_var_with(t.short());
p.tyenv.insert(x.clone(), t);
x
}
fn con... |
use std::collections::BTreeSet;
use std::collections::{HashMap};
use std::io::{stdout, stderr, Write};
use std::time::{Instant, Duration};
use libmount::Tmpfs;
use argparse::{ArgumentParser, List};
use signal::trap::Trap;
use libc::{pid_t};
use unshare::Signal::{SIGINT, SIGTERM, SIGCHLD, SIGTTIN, SIGTTOU, SIGTSTP};
us... |
use conventional_commits_types::{
Commit, Footer, FooterSeparator, SEPARATOR_COLON, SEPARATOR_HASHTAG,
};
use nom::{
branch::alt,
bytes::complete::{tag, take, take_while1},
character::complete::{line_ending, not_line_ending},
combinator::{map, map_res, opt, peek},
error::{context, ContextError, ... |
// #![feature(external_doc)]
// #![doc(include = "../README.md")]
#![doc(html_logo_url = "https://avatars2.githubusercontent.com/u/71794210?s=200&v=4")]
mod app;
mod licenses;
mod models;
use crate::app::build_app;
use crate::licenses::get_license;
use crate::models::{AppTemplate, GithubRepo, Settings, Variable};
use... |
use crate::server::{check_zombie, new as new_server, ServerPtr};
use hbb_common::{
allow_err,
anyhow::bail,
config::{self, Config, REG_INTERVAL, RENDEZVOUS_PORT, RENDEZVOUS_TIMEOUT},
futures::future::join_all,
log,
protobuf::Message as _,
rendezvous_proto::*,
sleep, socket_client,
to... |
//! firebuf - Calculate fire weather indicies from soundings in your Bufkit Archive.
use bfkmd::{bail, parse_date_string, TablePrinter};
use bufkit_data::{Archive, BufkitDataErr, Model, SiteInfo};
use chrono::{Duration, NaiveDate, NaiveDateTime, Timelike};
use clap::{crate_version, App, Arg};
use dirs::home_dir;
use me... |
use std::collections::HashMap;
use std::collections::hash_map::Entry;
use std::default::Default;
use std::path::{Path, PathBuf};
use chrono::{Datelike, Timelike};
use itertools;
use jsonfeed;
use liquid;
use liquid::Value;
use pulldown_cmark as cmark;
use regex::Regex;
use rss;
use serde_yaml;
use error::*;
use cobal... |
use crate::*;
use std::char;
/// An abbreviation identifier for a Z-string. References a Z-string addressed in the abbreviation
/// table.
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct ZStringAbbrv(u8);
impl ZStringAbbrv {
/// Creates a new abbreviation. Valid numbers are in `0..96`; a higher index will... |
// Copyright 2022 TiKV Project Authors. Licensed under Apache-2.0.
use std::{borrow::Cow, ffi::CStr, marker::PhantomData, os::raw::c_char, ptr, slice};
use libc::c_void;
use tirocks_sys::{
crocksdb_mergeoperator_t, r, rocksdb_MergeOperator_MergeOperationInput,
rocksdb_MergeOperator_MergeOperationOutput, rocks... |
//
// Copyright (c) <NAME>. All rights reserved.
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
//
use datasource_type::Datasource;
use datasource::DatasourceInput;
use datasource_type::Datasources;
use core::grid::{Extent, ExtentInt, Grid};
use core::layer::Layer... |
// Copyright 2018 The xi-editor 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 ag... |
use std::convert::TryFrom;
use std::io;
use std::ops::{Deref, DerefMut};
use sigma_ser::vlq_encode::{ReadSigmaVlqExt, VlqEncodingError, WriteSigmaVlqExt};
use thiserror::Error;
use crate::encoding::vlq::{default_vlq_reader, default_vlq_writer, TryFromVlq, TryIntoVlq};
use crate::features::{Features, FeaturesError, Pe... |
use std::rc::Rc;
use std::fmt::Debug;
use js_sys::{Function};
use wasm_bindgen::prelude::{JsValue, wasm_bindgen};
use super::utils::*;
use super::lex::*;
use super::lalr::*;
#[wasm_bindgen]
pub enum ParserType {
LR1,
LALR1
}
#[derive(PartialEq, Debug)]
pub enum ParseResult {
ParseWait,
ParseSuccess
}
#[deri... |
use collections::{HashMap, HashSet};
use fmt::{Display, Formatter};
use std::*;
use crate::parser::{DeclInfoAndPos, DefInfoAndPos};
use crate::tokenizer::token;
use token::*;
pub(crate) enum Issue {
BracketNotOpened(TokenPos),
BracketNotClosed(TokenPos),
EmptyTokenStream,
ParsingError(TokenPos),
F... |
/// # LU Decomposition
///
use std::cmp::Ordering;
use std::mem;
use std::ops::{Mul, Neg, Sub};
use num::Zero;
use crate::algorithm::two_phase::tableau::inverse_maintenance::carry::lower_upper::decomposition::pivoting::{Markowitz, PivotRule};
use crate::algorithm::two_phase::tableau::inverse_maintenance::carry::lowe... |
#![allow(dead_code)]
use super::error::Error;
///! see https://en.wikipedia.org/wiki/Control-flow_graph
///! see https://www.khronos.org/registry/spir-v/specs/unified1/SPIRV.html#_a_id_structuredcontrolflow_a_structured_control_flow
use super::{
function::{BlockId, MergeInstruction, Terminator},
LookupExpressi... |
use crate::{record::Recorder, WatchRequest};
use super::{Event, WakeOp, Watch, WatchKind};
use console_api as proto;
use tokio::sync::{mpsc, Notify};
use futures::FutureExt;
use std::{
collections::hash_map::Entry,
convert::TryInto,
sync::{
atomic::{AtomicBool, Ordering::*},
Arc,
},
... |
use std::{
cell::{Cell, RefCell},
sync::Arc,
};
use super::behaviors::{MouseBehavior, SelectionBehavior};
use crate::{
api::prelude::*, prelude::*, proc_macros::*, shell::prelude::*, themes::theme_orbtk::*,
};
type SelectedItem = Option<Entity>;
// /// The `ComboBoxItemAction` represent actions that can... |
//! VFS stands for Virtual File System.
//!
//! When doing analysis, we don't want to do any IO, we want to keep all source
//! code in memory. However, the actual source code is stored on disk, so you
//! need to get it into the memory in the first place somehow. VFS is the
//! component which does this.
//!
//! It is... |
//! All the code for responding to Supervisor commands
use crate::{ctl_gateway::CtlRequest,
error::Error,
manager::{action::{ActionSender,
SupervisorAction},
service::{spec::ServiceSpec,
DesiredState,
... |
use super::*;
use app::constants::*;
use backend::messagebus::{Inbox, Message, ReceiveDrain, Whiteboard};
use backend::obj;
use backend::world;
use backend::world::particle::{EmitterAttachment, EmitterStyle};
use backend::world::AgentState;
use cgmath::InnerSpace;
use core::clock::{seconds, Seconds, SimulationTimer, Ti... |
mod utils;
use std::cmp::Ordering;
use std::convert::TryFrom;
use std::f64::consts::PI;
use wasm_bindgen::prelude::*;
// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
// allocator.
#[cfg(feature = "wee_alloc")]
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;... |
use super::segment_manager::{get_mergeable_segments, SegmentManager};
use core::Index;
use core::IndexMeta;
use core::Segment;
use core::SegmentId;
use core::SegmentMeta;
use core::SerializableSegment;
use core::META_FILEPATH;
use directory::{Directory, DirectoryClone};
use error::TantivyError;
use futures::oneshot;
us... |
// 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.
// Transport parame... |
use crate::editor::codeeditorwidget::CodeEditorWidgetState;
use crate::{draw2d::Draw2D};
use server::gamedata::GameData;
use crate::editor::dialog::{ DialogState, DialogEntry };
use crate::TileUsage;
use server::gamedata::behavior::BehaviorType;
use zeno::{Mask, Stroke};
use directories::{ UserDirs };
#[derive(Par... |
//! The `bank_forks` module implments BankForks a DAG of checkpointed Banks
use bincode::{deserialize_from, serialize_into};
use solana_metrics::inc_new_counter_info;
use solana_runtime::bank::{Bank, BankRc, StatusCacheRc};
use solana_sdk::genesis_block::GenesisBlock;
use solana_sdk::timing;
use std::collections::{Has... |
#[cfg(test)]
mod data_channel_test;
pub mod data_channel_init;
pub mod data_channel_message;
pub mod data_channel_parameters;
pub mod data_channel_state;
use data_channel_message::*;
use data_channel_parameters::*;
use bytes::Bytes;
use std::future::Future;
use std::pin::Pin;
use std::sync::atomic::{AtomicBool, Atom... |
use crate::{
spaces::{discrete::Ordinal, real::Reals},
Domain,
Observation,
Reward,
};
use rand::{rngs::ThreadRng, thread_rng, Rng};
#[derive(Debug)]
pub struct Roulette {
active: bool,
reward: f64,
wealth: f64,
bet_size: f64,
rng: ThreadRng,
}
impl Roulette {
pub fn new(budge... |
// Buttplug Rust Source Code File - See https://buttplug.io for more info.
//
// Copyright 2016-2019 Nonpolynomial Labs LLC. All rights reserved.
//
// Licensed under the BSD 3-Clause license. See LICENSE file in the project root
// for full license information.
//! Communications API for accessing Buttplug Servers
pu... |
use crate::{arch::cpu::*, mem::PhysicalAddress, sync::RwLock, system::System, *};
use alloc::{
boxed::Box,
collections::{btree_map::Values, BTreeMap},
string::String,
sync::Arc,
vec::Vec,
};
use bitflags::*;
use core::{
cell::UnsafeCell,
fmt,
num::NonZeroU8,
ops::{Add, ControlFlow},
... |
// 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 {
crate::colors::ColorScheme,
carnelian::{
color::Color,
drawing::{FontFace, GlyphMap, TextGrid, TextGridCell},
render:... |
use crate::{
buffer::{CellBuffer, Contacts, Span},
fragment,
fragment::Arc,
fragment::Circle,
Cell, Point, Settings,
};
use lazy_static::lazy_static;
use std::{collections::BTreeMap, collections::HashMap, iter::FromIterator};
#[derive(PartialEq, Debug, Clone, Copy)]
/// edge cases of the circle art... |
use anyhow::anyhow;
use crossbeam::channel::unbounded;
use crossbeam::channel::Receiver;
use crossbeam::channel::Sender;
use std::collections::HashMap;
use std::process::Command;
use std::sync::Arc;
use std::thread;
#[derive(Eq, PartialEq, Debug)]
struct Item {
uuid: String,
json: serde_json::Value,
}
fn chec... |
#![allow(unused_results)]
use std::cell::RefCell;
use std::ops::DerefMut;
use std::rc::Rc;
use std::sync::mpsc::Sender;
use event::{Action, Key, Modifiers, MouseButton, WindowEvent};
use image::{GenericImage, Pixel};
use stdweb::unstable::TryFrom;
use stdweb::web::event as webevent;
use stdweb::web::event::{ConcreteE... |
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT
//! this module defines some metadata structures for the codegen
use super::cbmc::goto_program::{
DatatypeComponent, Expr, Location, Stmt, Symbol, SymbolTable, Type,
};
use super::cbmc::utils::aggr_n... |
use std::any::Any;
use std::collections::hash_map::{Entry, };
use std::error::Error;
use std::fmt::Debug;
use std::intrinsics::likely;
use std::sync::{Arc, Weak, atomic::AtomicUsize, atomic::Ordering, };
use indexvec::{Idx, IndexVec};
use parking_lot::{Mutex, RwLock, RwLockUpgradableReadGuard, MappedRwLockReadGuard,
... |
use rug::ops::Pow;
use rug::{float::Constant, Float};
use std::{char::from_digit, cell::RefCell};
use std::collections::HashMap;
use std::process::exit;
use lazy_static::lazy_static;
#[derive(Clone)]
enum Sign {
Init,
Data,
Char
}
pub struct Calc {
sign: RefCell<Sign>,
numbers: RefCell<Vec<Float>>... |
//! Font drawing primitives.
use std::sync::RwLock;
use std::sync::RwLockReadGuard;
use crate::*;
use zaplib_vector::geometry::Trapezoid;
use zaplib_vector::geometry::{AffineTransformation, Transform, Vector};
use zaplib_vector::internal_iter::*;
use zaplib_vector::path::PathIterator;
use zaplib_vector::trapezoidator... |
use rand::Rng;
const MEM_SIZE: usize = 0x1000;
const ROM_START: usize = 0x200;
pub const ROM_SIZE: usize = MEM_SIZE - ROM_START;
pub const GFX_COLS: usize = 64;
pub const GFX_ROWS: usize = 32;
const FONT_LOC: usize = 0x50;
const FONT_NUM_ROWS: usize = 5;
pub fn coords_to_index(x: u8, y: u8) -> usize {
(y as usize... |
//! # QuickCrawler
//! QuickCrawler is a Rust crate that provides a completely async, declarative web crawler
//! with domain-specific request rate-limiting built-in.
//!
//! # Examples
//!
//! Let's say you are trying to crawl a subset of pages for a given domain:
//!
//! `https://bike-site.com/search?q=red-bike... |
use bevy::{
core::FloatOrd,
core_pipeline::Transparent2d,
ecs::system::lifetimeless::{Read, SQuery, SRes},
ecs::system::SystemParamItem,
prelude::*,
reflect::TypeUuid,
render::{
mesh::GpuBufferInfo,
render_asset::RenderAssets,
render_component::{ComponentUniforms, Dyn... |
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
// The documentation for the inspector API is sparse, but these are helpful:
// https://chromedevtools.github.io/devtools-protocol/
// https://hyperandroid.com/2020/02/12/v8-inspector-from-an-embedder-standpoint/
use deno_core::v8;
use futures... |
/// https://www.w3.org/TR/css3-color/#html4
/// https://www.w3.org/TR/css3-color/#svg-color
pub const ALICEBLUE: (u8, u8, u8) = (0xf0, 0xf8, 0xff);
pub const ANTIQUEWHITE: (u8, u8, u8) = (0xfa, 0xeb, 0xd7);
pub const AQUA: (u8, u8, u8) = (0x00, 0xff, 0xff);
pub const AQUAMARINE: (u8, u8, u8) = (0x7f, 0xff, 0xd4);
pub... |
extern crate chrono;
extern crate gilrs;
extern crate image;
use std::sync;
use std::thread;
use std::time;
use crate::common::settings;
use crate::common::types;
use crate::conn;
use crate::utils;
use druid::{
piet::{FontBuilder, ImageFormat, InterpolationMode, Text, TextLayoutBuilder},
widget::{
pr... |
use std::fmt::{Display, Error, Formatter};
use crate::{NEAR_ZERO, Vec4};
/** # Vec3 - 3 Dimensional Vector <f32>
A Vector with three elements, `x`, `y`, and `z`, stored internally as `[f32; 3]`.
#### Default
[Default](https://doc.rust-lang.org/nightly/core/default/trait.Default.html) is implemented for
ease of... |
mod c_api;
#[cfg(feature = "c_api")]
pub use c_api::*;
use std::ffi;
use std::fs;
use std::io;
use std::iter;
use std::mem;
use std::os::raw;
#[cfg(unix)]
use std::os::unix::io::{FromRawFd, IntoRawFd, RawFd};
#[cfg(windows)]
use std::os::windows::io::{FromRawHandle, IntoRawHandle, RawHandle};
use std::ptr;
use std:... |
//! The UI is what drives the interactive phetch application: it
//! spawns threads to fetch Gopher pages and download binary files, it
//! manages the opened pages (Views), it asks the focused View to
//! respond to user input, and it performs actions based on what the
//! View returns - like opening a telnet client, ... |
use crate::wasm::wasm_serialize::{serialize_string, serialize_u32, serialize_i32};
/// This is an implementation of https://github.com/WebAssembly/tool-conventions/blob/master/Linking.md
///
/// It contains copies of fragments of the code and comments in that file.
#[derive(Debug, Clone, Copy)]
enum WasmSymInfoKind{... |
// Copyright 2022 Palantir Technologies, 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 a... |
// This file is part of Sulis, a turn based RPG written in Rust.
// Copyright 2018 <NAME>
//
// Sulis 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 opt... |
use crate::{
AssetAnimation, AssetAnimation3D, AssetSprite, AssetSprite3D, GraphicsSheet, ResourceName,
};
use crate::core::indexmap::indexmap;
use crate::core::indexmap::IndexMap;
use crate::core::serde_derive::Deserialize;
use crate::core::serde_json;
use crate::core::*;
use crate::draw::*;
use crate::image::*;
... |
/// Send command and data over SPI
pub trait SpiSendCommandData {
///
fn send_command_data(&mut self, data: &[u8], command_bytes: u8) -> Result<(), Error>;
}
// NRF52840 and NRF9160 16 bits 1..0xFFFF
pub const EASY_DMA_SIZE: usize = 65535;
// Limits for Easy DMA - it can only read from data ram
pub const SRAM_... |
// Copyright (c) Facebook, Inc. and its affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the "hack" directory of this source tree.
use oxidized::aast_visitor::{visit_mut, AstParams, NodeMut, VisitorMut};
use oxidized::{aast, aast_defs, ast_defs, local_id};
use oxidiz... |
use std::error::Error;
use std::fmt;
use std::fs::File;
use std::io::{self, BufRead, BufReader, Read, Write};
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
use std::sync::mpsc;
use std::thread;
use font_loader::system_fonts;
use image::{GenericImage, RgbImage, Rgb};
use imageproc::drawing::{draw_... |
//! This module includes the structs, traits, and functions needed to receive a
//! serialized RecordBatch (in IPC format) from R, transform it to a usable
//! RecordBatch, serialize back to IPC format, and send the serialized
//! RecordBatch back to R.
use arrow::{
array::ArrayDataRef,
buffer::Buffer,
dat... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00..0xf0 - Cluster GPIO%s, containing GPIO*_STATUS, GPIO*_CTRL"]
pub gpio: [GPIO; 30],
#[doc = "0xf0 - Raw Interrupts"]
pub intr0: crate::Reg<intr0::INTR0_SPEC>,
#[doc = "0xf4 - Raw Interrupts"]
pub intr1: crate::Reg<int... |
//! # in_definite
//!
//! Get the indefinite article ('a' or 'an') to match the given word. For example: an umbrella, a user.
mod core_is_an;
mod options;
mod rules;
mod utils;
use utils::string_helper;
pub use core_is_an::Is;
pub use options::Options;
/// Get 'a' or 'an' to match the given word.
///
/// # Examples... |
// Copyright 2020 WHTCORPS INC Project Authors. Licensed Under Apache-2.0
use std::mem;
use std::sync::Arc;
use std::time::Instant;
use async_trait::async_trait;
use ekvproto::interlock::{KeyCone, Response};
use protobuf::Message;
use rand::rngs::StdRng;
use rand::Rng;
use milevadb_query_common::causet_storage::scann... |
//! RustSBI Implementation for XiangShan Platform
#![no_std]
#![no_main]
#![feature(naked_functions)]
#![feature(alloc_error_handler)]
#![feature(llvm_asm)]
#![feature(asm)]
#![feature(global_asm)]
extern crate xs_hal;
extern crate embedded_hal;
extern crate nb;
#[cfg(not(test))]
use core::alloc::Layout;
use core::pa... |
use std::path::PathBuf;
use std::io;
use fate::math::{Rgb, Rgba};
use fate::mt;
use fate::img;
use viewport::ViewportNode;
use eid::EID;
use cubemap::{CubemapSelector, CubemapArrayID, CubemapArrayInfo, CubemapFace};
use texture2d::{Texture2DArrayID, Texture2DArrayInfo};
use gpu::{GpuTextureInternalFormat, CpuS... |
// Copyright (c) 2020 DDN. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
use crate::{
api_utils::{
get, get_all, get_hosts, post, put, wait_for_cmds, wait_for_cmds_success, SendCmd, SendJob,
},
display_utils::{
d... |
use super::{Infer, Stats, Summarize, Summary, Test, Train};
use crate::{
buffer::float::FloatSlice,
device::Device,
glsl_shaders,
result::Result,
scalar::{FloatType, Uint},
tensor::{
float::{
FloatArcTensor, FloatArcTensor2, FloatData, FloatTensor, FloatTensor2, FloatTensorBa... |
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
use core::ops::RangeInclusive;
use s2n_quic_core::{
counter::{Counter, Saturating},
event,
event::IntoEvent,
frame::ack::EcnCounts,
inet::ExplicitCongestionNotification,
number::CheckedS... |
use std::borrow::Cow;
use std::collections::HashSet;
use std::default::Default;
use html5ever::tree_builder::{ElementFlags, NodeOrText, QuirksMode, TreeSink};
use html5ever::{Attribute, QualName};
use markup5ever::ExpandedName;
use tendril::StrTendril;
use rustler::{Encoder, Env, Term};
use self::NodeEnum::{Comment... |
use cairo_sys as cairo;
use gobject_sys as gobject;
use pango_cairo_sys as pango_cairo;
use pango_sys as pango;
use std::any::Any;
use std::collections::hash_map;
use std::collections::HashMap;
use std::error;
use std::fmt;
use std::ops::Add;
use std::os::raw::*;
use std::rc::Rc;
use std::sync::atomic::{AtomicUsize, Or... |
use crate::impl_::dep::Dep;
use crate::impl_::lazy::Lazy;
use crate::impl_::listener::Listener;
use crate::impl_::node::{Node, WeakNode, IsNode};
use crate::impl_::sodium_ctx::SodiumCtx;
use crate::impl_::sodium_ctx::SodiumCtxData;
use crate::impl_::stream::Stream;
use crate::impl_::stream::WeakStream;
use crate::impl_... |
#![allow(non_camel_case_types)]
extern crate libc;
extern crate eina_sys;
extern crate eo_sys;
use libc::*;
use eina_sys::*;
use eo_sys::*;
/* automatically generated by rust-bindgen */
pub type Ecore_Con = Eo;
pub enum Ecore_Con_Socks { }
pub type EcoreConDnsCb = Option<unsafe extern "C" fn(canonname: *const c_char,... |
extern crate minifb;
extern crate cpal;
extern crate rand;
use std::env;
use std::fs::File;
use std::io::Read;
use std::time::{Instant, Duration};
use std::thread;
use std::sync::mpsc;
use std::path::Path;
use minifb::{Window, WindowOptions, Key};
use cpal::traits::{HostTrait, DeviceTrait, StreamTrait};
use cpal::Sam... |
/// Barter Engine module specific errors.
pub mod error;
/// Contains the trading event loop for a Trader capable of trading a single market pair. A Trader
/// has it's own Data handler, Strategy & Execution handler, as well as shared access to a global
/// Portfolio instance.
pub mod trader;
use crate::Market;
use c... |
/*
* Copyright (c) 2020-2021 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>.
*
* This file is part of alevin-fry
* (see https://github.com/COMBINE-lab/alevin-fry).
*
* License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
*/
extern crate bio_types;
extern crate chrono;
extern crate clap;
extern crate ... |
/* ------------------------------- Shadoblade ------------------------------- */
// -- Includes -- {{{
extern crate serde;
use rltk::{GameState, Rltk, Point};
use specs::prelude::*;
use specs::saveload::{SimpleMarker, SimpleMarkerAllocator};
/* Resources */
mod components;
pub use components::*;
mod player;
pub use pl... |
use std::cell::{Cell, RefCell};
use gccjit::{Block, CType, Context, Function, FunctionPtrType, FunctionType, LValue, RValue, Struct, Type};
use rustc_codegen_ssa::base::wants_msvc_seh;
use rustc_codegen_ssa::traits::{
BackendTypes,
MiscMethods,
};
use rustc_data_structures::base_n;
use rustc_data_structures::f... |
use crate::layout::common::{FromLowlevel, Lookup, ToLowlevel, GPOSGSUB};
use crate::layout::contextual::{ChainedSequenceContext, SequenceContext};
use crate::layout::gpos1::SinglePos;
use crate::layout::gpos2::PairPos;
use crate::layout::gpos3::CursivePos;
use crate::layout::gpos4::MarkBasePos;
use crate::layout::gpos5... |
// Copyright 2019 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... |
//! Check properties that are required by built-in traits and set
//! up data structures required by type-checking/codegen.
use rustc::infer::SuppressRegionErrors;
use rustc::infer::outlives::env::OutlivesEnvironment;
use rustc::middle::region;
use rustc::middle::lang_items::UnsizeTraitLangItem;
use rustc::traits::{s... |
use std::convert::TryInto;
use super::{super::BLOCK_SIZE, AssignedBits, BlockWord, SpreadInputs, Table16Assignment, ROUNDS};
use halo2_proofs::{
circuit::Layouter,
pasta::pallas,
plonk::{Advice, Column, ConstraintSystem, Error, Selector},
poly::Rotation,
};
mod schedule_gates;
mod schedule_util;
mod s... |
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use crate::ast;
use crate::ast::Diagnostic;
use crate::ast::ImportsNotUsedAsValues;
use crate::ast::TokenOrComment;
use crate::colors;
use crate::media_type::MediaType;
use crate::program_state::ProgramState;
use deno_core::error::AnyError;
use... |
//! A one-shot, futures-aware channel
use std::sync::Arc;
use std::sync::atomic::AtomicBool;
use std::sync::atomic::Ordering::SeqCst;
use std::error::Error;
use std::fmt;
use {Future, Poll, Async};
use future::{lazy, Lazy, Executor, IntoFuture};
use lock::Lock;
use task::{self, Task};
/// A future representing the c... |
use std::ops::RangeInclusive;
use std::sync::Arc;
use super::{Fonts, Galley, Glyph, LayoutJob, LayoutSection, Row, RowVisuals};
use crate::{Color32, Mesh, Stroke, Vertex};
use emath::*;
/// Temporary storage before line-wrapping.
#[derive(Default, Clone)]
struct Paragraph {
/// Start of the next glyph to be added... |
use crate::{config_file::ConfigFile, crate_detail::CrateDetail, dir_path::DirPath};
use fs_extra::dir::get_size;
use serde_derive::Deserialize;
use std::{
env, fs,
io::prelude::*,
path::{Path, PathBuf},
};
// struct store Cargo.lock file location
pub(crate) struct CargoTomlLocation {
path: Vec<PathBuf>... |
//! A relatively advanced example of a lockup program. If you're new to Anchor,
//! it's suggested to start with the other examples.
#![feature(proc_macro_hygiene)]
use anchor_lang::prelude::*;
use anchor_lang::solana_program::instruction::Instruction;
use anchor_lang::solana_program::program;
use anchor_spl::token::... |
use crate::avm1::Avm1;
use crate::backend::{audio::AudioBackend, render::Letterbox, render::RenderBackend};
use crate::events::{ButtonEvent, PlayerEvent};
use crate::library::Library;
use crate::movie_clip::MovieClip;
use crate::prelude::*;
use crate::transform::TransformStack;
use gc_arena::{make_arena, ArenaPa... |
//! This module defines the different ffi_abi values for each platform.
//!
//! This module is set-up to define all the constants for each platform, but only export those which
//! are actually relevant to the target arch. This is done as a compile check to ensure the code
//! paths in less utilized architectures large... |
// Copyright 2020 The Exonum Team
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
use ircnvim::channel::IsChannelName;
use ircnvim::config::AuthMethod;
use ircnvim::config::Config;
use ircnvim::irc::IrcMessage;
use ircnvim::msg::Message;
use ircnvim::room::Room;
use ircnvim::text::Text;
use ircnvim::user::User;
use ircnvim::_my_nick_regex;
use regex::Regex;
use regex;
use rustc_serialize::base64::To... |
// 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 {
crate::ie::SupportedRate,
anyhow::{bail, Error},
banjo_fuchsia_hardware_wlan_associnfo as hw_wlan_associnfo,
banjo_fuchsia_hardware_w... |
use super::KvsEngine;
use crate::{KvsError, Result};
use crossbeam_skiplist::SkipMap;
use serde::{Deserialize, Serialize};
use serde_json::{self, Deserializer};
use std::{
cell::RefCell,
collections::BTreeMap,
fs::{self, File, OpenOptions},
io::{self, BufReader, BufWriter, Read, Seek, SeekFrom, Write},
... |
//! Build
#[macro_use]
extern crate error_chain;
error_chain! {
foreign_links {
Io(::std::io::Error);
EnvVar(::std::env::VarError);
StringFromUtf8(::std::string::FromUtf8Error);
}
}
use glob::glob;
use std::env;
use std::path::{Path, PathBuf};
use std::process::Command;
use std::time:... |
use std::{
collections::{HashMap, HashSet, VecDeque},
fs,
path::PathBuf,
sync::Arc,
};
use anyhow::*;
use cgmath::{InnerSpace, Vector2};
use corrode::renderer::{create_device_image_with_usage, DeviceImageView};
use image::{ImageBuffer, Rgba};
use vulkano::{
buffer::CpuAccessibleBuffer,
command_... |
use std::borrow::Cow;
use std::collections::HashSet;
use std::sync::Arc;
use actix_web::{HttpResponse, ResponseError};
use dashmap::mapref::one::Ref;
use serde::{Deserialize, Serialize};
use serde_json::value::RawValue;
use thiserror::Error as ThisError;
use tracing::{debug, warn};
use crate::filter::Filters;
use cra... |
/*
* Copyright 2020 Fluence Labs 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 applicable law or a... |
use ::crossterm::{
cursor::{DisableBlinking, EnableBlinking, Hide, Show},
execute,
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen},
};
use ::sysinfo::{ProcessorExt, SystemExt};
use ::tui::{
backend::{Backend, CrosstermBackend},
layout::{Constraint, Direction... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.