text stringlengths 7.05k 33.9k |
|---|
use std::fs;
use std::env;
use std::process::{self, Command};
use std::os::unix::process::CommandExt;
use std::path::{Path, PathBuf};
use anyhow::Result;
use std::time::Duration;
use structopt::StructOpt;
/// The version of `cargo-hongg` cli tooling.
const VERSION: &str = env!("CARGO_PKG_VERSION");
const HONGGFUZZ_TAR... |
use self::{simulation_network::SimulationNetwork, simulation_network_dispatcher::{SimulationNetworkConfig, SimulationNetworkDispatcher}};
use super::*;
use arc_swap::ArcSwap;
use executors::*;
use hierarchical_hash_wheel_timer::{Timer, simulation::SimulationStep};
use messaging::{DispatchEnvelope, RegistrationResult};... |
//! # Octocrab: A modern, extensible GitHub API client.
//! Octocrab is an third party GitHub API client, allowing you to easily build
//! your own GitHub integrations or bots. `octocrab` comes with two primary
//! set of APIs for communicating with GitHub, a high level strongly typed
//! semantic API, and a lower leve... |
//! FAT Filesystem.
use arrayvec::ArrayString;
use byteorder::{ByteOrder, LittleEndian};
use super::attribute::Attributes;
use super::directory::{dir_entry::DirectoryEntry, Directory, File};
use super::offset_iter::ClusterOffsetIter;
use super::FatVolumeBootRecord;
use super::cluster::Cluster;
use super::table;
use ... |
pub mod scale;
use std::os::unix::thread;
use std::time::Duration;
use rand::distributions::WeightedIndex;
use rodio::{OutputStream, Sink};
use rodio::source::{SineWave, Source};
use scale::*;
use rand::prelude::*;
struct Context {
note: Option<Note>,
notes: Vec<Note>,
}
#[derive(Debug, Copy, Clone)]
enum Fo... |
//! Test utilities
use std::{cell::RefCell, collections::HashSet};
use frame_support::{
assert_ok, impl_outer_origin, parameter_types,
traits::{Currency, FindAuthor, Get},
weights::Weight,
StorageLinkedMap, StorageValue,
};
use sp_core::{crypto::key_types, H256};
use sp_runtime::{
testing::{Header, UintAuthority... |
//! Linking an external crate and sharing data.
//!
//! When running a REPL you might want to link an external crate.
//! The specific use case is a developer wants to link the crate they are working on
//! into the REPL for the user to be able to use.
//! A developer might also want to make data available to the REPL.... |
use super::{
artist::Artist,
commands::Commands,
config::ConfigurationProvider,
connection::*,
layout::{Bounds, Position},
workspace::Workspace,
};
use std::collections::HashMap;
pub struct WindowManager {
configuration: Box<dyn ConfigurationProvider>,
workspaces: Vec<Workspace>,
cu... |
use block::{Block, BlockState, Register, Transformation, format_register};
use errors::{Error, ErrorType};
use ::{humanize, hash_string};
use database::{Database};
use table::{TableIndex, TableId};
use std::cell::RefCell;
use std::sync::Arc;
use hashbrown::{HashSet, HashMap};
use rust_core::fmt;
use operations::{MechFu... |
// btleplug Source Code File
//
// Copyright 2020 Nonpolynomial Labs LLC. All rights reserved.
//
// Licensed under the BSD 3-Clause license. See LICENSE file in the project root
// for full license information.
//
// Some portions of this file are taken and/or modified from Rumble
// (https://github.com/mwylde/rumble)... |
use crate::enums::Status;
use atty::Stream;
use clap::{load_yaml, App};
use curl::easy::Easy;
use itertools::Itertools;
use log::{debug, info};
use serde_json::Value;
use std::cmp::Ordering;
use std::collections::btree_map::Entry::{Occupied, Vacant};
use std::collections::{BTreeMap, HashMap, HashSet};
use std::default:... |
use crate::{
biginteger::BigInteger,
bits::{FromBits, ToBits},
bytes::{FromBytes, ToBytes},
serialize::{
CanonicalDeserialize, CanonicalDeserializeWithFlags, CanonicalSerialize,
CanonicalSerializeWithFlags, EmptyFlags, Flags,
},
BitSerializationError, Error, FromBytesChecked, Sem... |
// Copyright 2018 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 failure::Fail;
use fidl_fuchsia_wlan_mlme::{self as fidl_mlme, BssDescription, ScanResultCodes, ScanRequest};
use log::error;
use std::mem;
use std::sy... |
use indicatif::{ProgressBar, ProgressStyle};
use ndarray::Array;
use ndarray_rand::RandomExt;
use rand::distributions::{Distribution, Normal};
use rand::seq::SliceRandom;
use rand::thread_rng;
use serde::{Deserialize, Serialize};
use std::fmt;
pub type Input = ndarray::Array2<f64>;
pub type Output = ndarray::Array2<f6... |
extern crate extra;
use std::fs;
use std::io::{self, Write};
use std::path::Path;
use std::process::exit;
use std::os::unix::fs::{FileTypeExt, MetadataExt, PermissionsExt};
use extra::option::OptionalExt;
const MAN_PAGE: &'static str = /* @MANSTART{test} */ r#"
NAME
test - perform tests on files and text
SYNOPSI... |
use crate::full_inference::analysis::AnalysisIr;
use crate::full_inference::analysis::Node;
use crate::full_inference::analysis::Path;
use crate::full_inference::analysis::PathData;
use crate::full_inference::constraint::Constraint;
use crate::full_inference::constraint::ConstraintAt;
use crate::full_inference::FullInf... |
use super::euler::{Euler, RotationOrders};
use super::vector3::Vector3;
use super::matrix4::Matrix4;
#[derive(Debug, Clone, Copy)]
pub struct Quaternion {
pub x: f32,
pub y: f32,
pub z: f32,
pub w: f32,
}
impl Quaternion {
pub fn new() -> Quaternion {
Quaternion{
x: 0.0f32,
y: 0.0f32,
z: 0.0f32,
w:... |
use super::*;
use crate::actors::ActorHost;
use crate::auth::Authorizer;
use crate::capability::extras::ExtrasCapabilityProvider;
use crate::capability::native_host::NativeCapabilityHost;
use crate::dispatch::Invocation;
use crate::hlreg::HostLocalSystemService;
use crate::messagebus::{CanInvoke, GetClaims, MessageBus,... |
/// Very basic hand baked bmp parser/writer, works for our needs
const BMP_HEADER_SIZE: usize = 54;
/// buffer is assumed to be BGRX
pub fn save_bgrx_bmp(buffer: &[u8], ww: u32, hh: u32, name: &str) {
let hh = hh as usize;
let ww = ww as usize;
let pad_per_line = ((4 - (ww * 3) % 4) % 4) as usize;
let... |
use crate::change_context::ChangeContext;
use crate::error::InvalidChangeRequest;
use crate::object::Object;
use crate::value::{random_op_id, value_to_op_requests, Value};
use automerge_protocol as amp;
use maplit::hashmap;
use std::{collections::HashMap, fmt, rc::Rc};
pub trait MutableDocument {
fn value_at_path(... |
/*
* Copyright 2019 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 std::iter::Peekable;
use std::convert::TryInto;
/// Enum type contains one of the support TokenTypes that is lexed from the input stream
/// - OpenBrace
/// - ```[\(]```
/// - Marks the beginning of the list when parsed
/// - Close Brace
/// - ```[\)]```
/// - Marks the end of a list when parsed
... |
// Copyright 2016 Google Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, ... |
//! Reed-Solomon error correction codes.
//!
//! The error correction in a Data Matrix is done using Reed-Solomon codes.
//!
//! Assuming you have never heard of coding theory: By putting some redundancy
//! into the Data Matrix one can recover from, say, detection or printing errors
//! when trying to read a Data Matr... |
use std::ops::{Deref, DerefMut};
use std::pin::Pin;
use std::sync::Arc;
use std::task::{Context, Poll};
use futures::Future;
use serde::{Deserialize, Serialize};
use tokio::sync::{Mutex, OwnedMutexGuard};
use tokio::sync::mpsc::{Receiver, Sender};
use crate::reliable_conn::ReliableOrderedStreamToTargetExt;
use crate:... |
use crate::{
ai_player_controller::AiPlayer,
animation::{inverse_lerp, TransformRotation, TweenDoneAction},
ball::{spawn_ball, Ball, BallBouncedEvt, BallStatus},
extra::TransformBundle,
impl_player_action_timer,
level::{CourtRegion, CourtSettings, InitialRegion, Net, NetOffset, ServingRegion},
... |
use base64::decode;
use chrono;
use console;
use hyper::header::{ContentType, Headers};
use mesos;
use network;
use rand::{Rng, thread_rng};
use regex;
use reqwest;
use serde_json;
use serde_json::Value;
use std::io::Read;
use std::io::stdout;
use std::io::Write;
use std::process::exit;
use std::str::fro... |
//! # FFI-compatible futures
//!
//! In case of an async program with some async plugins, `Future`s need to cross the FFI boundary.
//! But Rust currently doesn't provide stable ABI nor stable layout of related structs like
//! `dyn Future` and `Waker`.
//! With this crate, we can easily wrap async blocks or async func... |
use proc_macro::*;
use std::iter::FromIterator;
/// # Named constants
///
/// Makes enums behave like named constants in languages like C/C++ or C#.
///
/// Put this attribute on an enum and it will be rewritten as a newtype struct.
/// The enum variants are turned into associated constants.
///
/// # Examples
///
///... |
use std::convert::TryFrom;
use std::fmt;
use log::warn;
use serde::de::{MapAccess, Visitor};
use serde::{
ser::{SerializeMap, SerializeStruct},
Deserialize, Deserializer, Serialize, Serializer,
};
use crate::eval::{self, Detail, Reason};
use crate::flag_value::FlagValue;
use crate::rule::FlagRule;
use crate::... |
use cssparser::*;
use crate::traits::{Parse, ToCss, PropertyHandler};
use crate::values::{time::Time, easing::EasingFunction};
use super::{Property, PropertyId};
use crate::vendor_prefix::VendorPrefix;
use crate::declaration::DeclarationList;
use crate::printer::Printer;
use itertools::izip;
use smallvec::SmallVec;
use... |
//! Utilities for loading and using textures
use std::io;
use std::ptr;
use std::fmt;
use std::error;
use std::path::Path;
use std::borrow::Cow;
use std::fs::File;
use png;
use gl;
use gl::types::*;
/// A wraper around a OpenGL texture object which can be modified
#[derive(Debug)]
pub struct Texture {
texture: G... |
use {
crate::{
engine::{actor::Actor, math, phys::*},
r#type::{
TimeFormat,
Coord, IntoStorageDuration, LayerId, ObjectId, ObjectName,
RelativeTime, AsRelativeTime, AsAbsoluteTime, SessionId, LocationId, Vector,
},
object::GenCoord,
storage... |
use std::{
path::{Path, PathBuf},
time::Instant,
};
use crate::brentq::brentq;
use crate::platt_integral::*;
use crate::traits::*;
use log::{debug, info};
use num::integer::*;
#[doc(hidden)]
pub struct PlattBuilder {
hint_λ: f64,
poly_order: usize,
segment: u64,
ζ_zeros: PathBuf,
}
/**
The al... |
use chrono::Duration;
use nyafetch::pci;
use serde_derive::{Deserialize, Serialize};
use std::collections::HashMap;
use std::env::var;
use std::env::{args, vars};
use std::ffi::CString;
use std::fs;
use std::fs::File;
use std::io::prelude::*;
use std::path::Path;
use std::process::exit;
const VERSION: &str = "1.6.2";
... |
//! API client for calling Algorithmia algorithms
//!
//! # Examples
//!
//! ```no_run
//! use algorithmia::Algorithmia;
//!
//! // Initialize with an API key
//! let client = Algorithmia::client("111112222233333444445555566")?;
//! let moving_avg = client.algo("timeseries/SimpleMovingAverage/0.1");
//!
//! // Run the ... |
use super::{Err, Record};
use regex::Regex;
use std::convert::{TryFrom, TryInto};
use std::str::FromStr;
use std::{cmp, iter};
// (1 + 1) > 1 ✔
// Age > 1
// ((Email ~ "<EMAIL>") || (Age <= 18)) && !#Fixed
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
enum Op {
Mul,
Div,
Mod,
Not,
Add,
Sub,
... |
use std::f32::consts::FRAC_PI_4;
use bevy::prelude::*;
use bevy::tasks::prelude::*;
use rand::prelude::*;
use super::{field_systems, DepositEvent, GatherEvent, ScalarField, VectorField};
use crate::{
world::{self, Flag, WorldMap},
game,
story,
};
use rand::rngs::SmallRng;
const TEST_HIVE_LOCATION: (f32,... |
use anyhow::anyhow;
use notify::{self, DebouncedEvent, RecommendedWatcher, RecursiveMode, Watcher};
use sha2::{Digest, Sha256};
use spirq::ty::{DescriptorType, ImageArrangement, ScalarType, Type, VectorType};
use spirq::{ExecutionModel, SpirvBinary};
use std::collections::HashMap;
use std::collections::{btree_map::Entr... |
use std::{fmt::Display, sync::Arc};
use rustc_hash::{FxHashMap, FxHashSet};
use tinyvec::TinyVec;
use crate::{
frontend::ir::{self, ControlFlowInstruction, Instruction, IR},
id::{IrCtx, LiftedCtx},
isa::{AtomDealer, BlockJump, ISAInstruction, Jump, JumpIf, Return},
retag::{
BlkToFn, CnstPassRe... |
//! # Apollo Extensions for async_graphql
//! <div align="center">
//! <!-- CI -->
//! <img src="https://github.com/Miaxos/async_graphql_apollo_studio_extension/actions/workflows/ci.yml/badge.svg" />
//! <!-- Crates version -->
//! <a href="https://crates.io/crates/async-graphql-extension-apollo-tracing">
//! <... |
use crate::clean::auto_trait::AutoTraitFinder;
use crate::clean::blanket_impl::BlanketImplFinder;
use crate::clean::{
inline, Clean, Crate, ExternalCrate, FnDecl, FnRetTy, Generic, GenericArg, GenericArgs,
GenericBound, Generics, GetDefId, ImportSource, Item, ItemKind, Lifetime, MacroKind, Path,
PathSegment... |
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... |
/*
Copyright (c) 2016-2017, <NAME> <<EMAIL>>
All rights reserved.
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 ... |
use crate::consts::*;
use crate::debug_manager::DebugManager;
use crate::error::Error::*;
use crate::error::*;
use crate::linux::virtio::*;
use crate::linux::KVM;
use crate::paging::*;
use crate::vm::VirtualCPU;
use kvm_bindings::*;
use kvm_ioctls::{VcpuExit, VcpuFd};
use libc::ioctl;
use log::{debug, error, info};
use... |
// Copyright 2019-2021 Tauri Programme within The Commons Conservancy
// SPDX-License-Identifier: Apache-2.0
use raw_window_handle::RawWindowHandle;
use std::{collections::HashMap, fmt, sync::Mutex};
use windows::Win32::{
Foundation::{HWND, LPARAM, LRESULT, PSTR, PWSTR, WPARAM},
UI::{
Input::KeyboardAndMouse:... |
// 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 ... |
#![deny(rust_2018_idioms, unused, unused_crate_dependencies, unused_import_braces, unused_qualifications, warnings)]
#![forbid(unsafe_code)]
use {
std::{
collections::{
BTreeMap,
BTreeSet,
},
convert::TryInto as _,
fmt,
io::{
self,
... |
//! Tools for building and working with the filesystem of a mock Rust
//! distribution server, with v1 and v2 manifests.
use crate::mock::MockInstallerBuilder;
use lazy_static::lazy_static;
use sha2::{Digest, Sha256};
use std::collections::HashMap;
use std::fs::{self, File};
use std::io::{Read, Write};
use std::path::... |
use crate::common::{
ObjectColorer, ObjectColorerBuilder, Plot, RoadColorer, RoadColorerBuilder, Series,
};
use crate::game::{Transition, WizardState};
use crate::helpers::{rotating_color, ID};
use crate::render::DrawOptions;
use crate::sandbox::bus_explorer::ShowBusRoute;
use crate::sandbox::SandboxMode;
use crate... |
//! Implementation of the `import!` macro.
use std::{
any::{Any, TypeId},
borrow::Cow,
fs::File,
io::Read,
mem,
ops::{Deref, DerefMut},
path::PathBuf,
sync::{Arc, Mutex, MutexGuard, RwLock},
};
use {
async_trait::async_trait,
futures::{
future::{self},
prelude::... |
pub type int8_t = i8;
pub type int16_t = i16;
pub type int32_t = i32;
pub type int64_t = i64;
pub type uint8_t = u8;
pub type uint16_t = u16;
pub type uint32_t = u32;
pub type uint64_t = u64;
pub type c_schar = i8;
pub type c_uchar = u8;
pub type c_short = i16;
pub type c_ushort = u16;
pub type c_int = i32;
pub type c... |
/*
This tool is part of the WhiteboxTools geospatial analysis library.
Authors: Dr. <NAME>
Created: 18/04/2018
Last Modified: 22/10/2019
License: MIT
*/
use whitebox_raster::*;
use whitebox_common::structures::BoundingBox;
use crate::tools::*;
use whitebox_vector::{FieldData, ShapeType, Shapefile};
use std::env;
use s... |
// 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 env::emitter::Emitter;
use hhas_method::HhasMethod;
use hhas_property::HhasProperty;
use hhas_xhp_attribute::HhasXhpAttribute;
use h... |
// Copyright 2018 <NAME>
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,... |
use super::component::*;
use super::plane::Plane;
use super::triangle::Triangle;
use super::Camera;
use super::Entity;
use crate::rendering;
use crate::vertex::*;
use pantheon::context::Context;
use pantheon::graphics::prelude::*;
use pantheon::graphics::Drawable;
use pantheon::input::mouse;
use pantheon::math::*;
use ... |
/*
Copyright 2021 Integritee AG and Supercomputing Systems AG
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or... |
use core::hash::{Hash, Hasher};
use std::collections::HashMap;
fn assert_sufficiently_different(a: u64, b: u64, tolerance: i32) {
let (same_byte_count, same_nibble_count) = count_same_bytes_and_nibbles(a, b);
assert!(same_byte_count <= tolerance, "{:x} vs {:x}: {:}", a, b, same_byte_count);
assert!(
... |
//! Contain the API for splitting the source code into tokens.
use std::collections::HashMap;
use std::collections::VecDeque;
use std::fmt;
use std::str::CharIndices;
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use lazy_static::lazy_static;
use regex::Regex;
/// Represent a position inside the so... |
//! Outlier chrono-photo algorithm for processing time-sliced data produced by [`TimeSlicer`](./time_slice/struct.TimeSlicer.html).
use crate::color;
use crate::options::{BackgroundMode, Fade, OutlierSelectionMode, Threshold};
use crate::slicer::SliceLength;
use crate::streams::{Compression, PixelInputStream};
use imag... |
// Built-in deps
use std::{
collections::VecDeque,
convert::{TryFrom, TryInto},
str::FromStr,
time::Instant,
};
// External imports
use itertools::Itertools;
// Workspace imports
use zksync_api_types::v02::transaction::{
ApiTxBatch, BatchStatus, TxHashSerializeWrapper, TxInBlockStatus,
};
use zksync... |
use crypto::digest::Digest;
use crypto::sha1::Sha1;
use std::cmp;
use std::collections::{BTreeMap, HashMap, HashSet};
use std::convert::TryInto;
use std::fs::{self, File, OpenOptions};
use std::io::{self, ErrorKind, Read, Write};
use std::os::unix::fs::MetadataExt;
use std::path::{Path, PathBuf};
use std::str;
use cra... |
//! This crate is a simple implementation of minesweeper. It is carefully documented to encourage
//! newbies to add new games to the repository.
extern crate termion;
extern crate extra;
use termion::{clear, cursor, style};
use termion::raw::IntoRawMode;
use termion::input::TermRead;
use termion::event::Key;
use st... |
//! Dataflow analysis with arbitrary transfer functions.
//!
//! This module is a work in progress. You should instead use `BitDenotation` in
//! `librustc_mir/dataflow/mod.rs` and encode your transfer function as a [gen/kill set][gk]. In
//! doing so, your analysis will run faster and you will be able to generate grap... |
// Copyright 2014 <NAME>.
// Licensed under the MIT license (http://opensource.org/licenses/MIT)
// This file may not be copied, modified, or distributed
// except according to those terms.
//! Suffix arrays and related algorithms.
//! The implementation is based on the lecture notes
//! "Algorithmen auf Sequenzen", K... |
#[macro_use]
extern crate error_chain;
#[macro_use]
extern crate lazy_static;
extern crate libc;
extern crate rustc_version;
extern crate semver;
extern crate toml;
mod cargo;
mod cli;
mod docker;
mod errors;
mod extensions;
mod file;
mod id;
mod interpreter;
mod rustc;
mod rustup;
use std::io::Write;
use std::proces... |
//! Traits and functions used to implement parallel iteration. These are
//! low-level details -- users of parallel iterators should not need to
//! interact with them directly. See [the `plumbing` README][r] for a general overview.
//!
//! [r]: https://github.com/rayon-rs/rayon/blob/master/src/iter/plumbing/README.m... |
use super::*;
use crate::helpers::models::domain::get_customer_ids_from_routes;
use crate::helpers::models::problem::get_vehicle_id;
use crate::helpers::solver::*;
use crate::helpers::utils::create_test_environment_with_random;
use crate::helpers::utils::random::FakeRandom;
use crate::models::common::{Schedule, TimeWin... |
use crate::getdent::DirentBuf;
use core::mem;
use std::io;
use std::ffi::{CStr, CString, OsStr, OsString};
use std::path::{Component, Path, PathBuf};
use std::sync::Arc;
use std::os::unix::fs::FileTypeExt;
use std::os::unix::ffi::OsStrExt;
use once_cell::sync::OnceCell;
use super::UnixFileType as FileTypeInner;
use s... |
// Copyright 2020-2021, The Tremor 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 agr... |
use crate::ndarray_ext::{NdArray, NdArrayView};
use crate::op::{self, ComputeContext, InputArray, OpInput};
use crate::smallvec::SmallVec;
use crate::tensor::{Tensor, TensorInternal};
use crate::FxHashMap;
use crate::{Float, Graph};
use std::cell::UnsafeCell;
use std::sync::{RwLockReadGuard, RwLockWriteGuard};
const N... |
use super::{
build_composites, field_builders::RelationFieldBuilder, relation_builder::RelationBuilder, CompositeTypeBuilder,
FieldBuilder, IndexBuilder, ModelBuilder, PrimaryKeyBuilder,
};
use crate::{
builders::{CompositeFieldBuilder, ScalarFieldBuilder},
extensions::*,
IndexType, InlineRelation, ... |
use super::gl;
use super::gl::types::*;
use std::ffi::CString;
use std::ptr;
use std::str;
use std::mem;
use std::fmt;
pub struct AttributeInfo {
pub name: String,
pub index: GLuint,
// The strict type enum, e.g. gl::FLOAT_VEC2
pub type_enum: GLenum,
// The type of the attribute, e.g. gl::FLOAT
... |
#![feature(allocator_api, alloc_layout_extra, ptr_offset_from)]
use std::alloc::*;
use std::cell::RefCell;
use std::iter::*;
use std::mem::{align_of, size_of};
use std::ops::{Deref, DerefMut};
use std::{ptr, slice};
/// A chunk of memory that the StackPool will allocate from, as well as the pointer
/// that indicates... |
use crate::{
app::App,
chess::{
board::SquareColor,
utils::{get_square_color, uci_to_idx},
Side, Square,
},
message::Message,
ui::event::*,
user::User,
utils::{fmt_clock, parse_config_hex},
};
use std::io::{Stdout, Write};
use std::sync::mpsc::Sender;
use std::sync::... |
use crate::b2_draw::*;
use crate::b2_math::*;
use crate::b2_settings::*;
use crate::b2_time_step::*;
use crate::joints::b2_revolute_joint::*;
// Point-to-point constraint
// c = p2 - p1
// cdot = v2 - v1
// = v2 + cross(w2, r2) - v1 - cross(w1, r1)
// J = [-i -r1_skew i r2_skew ]
// Identity used:
// w k % (rx i ... |
//! Main entry point to the library.
//! See examples for documentation on how to use this struct.
use libc;
use std::{env, panic, ptr, any::Any, cell::{Cell, UnsafeCell}, ffi::CStr, rc::{Rc, Weak}};
use {DataDeviceManager, SurfaceHandle, XWaylandManagerHandler, XWaylandServer};
use errors::{HandleErr, HandleResult};... |
mod utils;
use std::{
cell::RefCell,
rc::Rc,
f32::consts::PI,
};
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
use web_sys::{
WebGlProgram, WebGlRenderingContext, WebGlShader,
WebGlUniformLocation, WebGlBuffer,
EventTarget, MouseEvent,
};
use js_sys::WebAssembly;
const AMORTIZATION:... |
// Copyright 2017-2018 The SCAII Developers.
//
// Licensed under the 3-Clause BSD license
// <BSD-3-Clause or https://opensource.org/licenses/BSD-3-Clause>
// This file may not be copied, modified, or distributed
// except according to those terms.
//! Contains the top-level RTS definition.
//!
//! This provides high-... |
#[cfg(any(target_os = "android"))]
use backtrace::Backtrace;
use common::*;
use components::*;
use gfx_h::{
load_atlas_image, Canvas, GeometryData, GlyphVertex, ParticlesData,
TextData, TextVertexBuffer, WorldTextData,
};
use glyph_brush::*;
#[cfg(any(target_os = "android"))]
use log::trace;
use nphysics2d::wor... |
//!
//! Reliquary helps keeping asset importing code away from app and
//! address assets with uuids instead of error-prone file paths and URLs.
//!
//! Importers can be loaded from dylib crates. See [`dummy`] crate for example
//!
//! TODO: Ability to archive selected assets
//!
//!
//! [`relictl`] - CLI tool can be u... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - This register contains the offset value towards the start of the operational register space and the version number of the IP block"]
pub caplength_chipid: CAPLENGTH_CHIPID,
#[doc = "0x04 - Host Controller Structural Parameters"... |
const HORIZONTAL : u8 =1;
const VERTICAL : u8 =2;
//================================
// RASTER SKELETONIZATION
//================================
// Binary image thinning (skeletonization) in-place.
// Implements Zhang-Suen algorithm.
// http://agcggs680.pbworks.com/f/Zhan-Suen_algorithm.pdf
fn thinning_zs_iterati... |
extern crate consalifold;
extern crate num_cpus;
extern crate crossbeam;
use consalifold::*;
use std::env;
use std::path::Path;
use std::io::{BufRead, BufWriter};
use std::fs::File;
use std::fs::create_dir;
use crossbeam::scope;
use std::process::{Command, Output};
use std::fs::remove_file;
type MeaCssStr = MeaSsStr;... |
//
//! Copyright 2020 Alibaba Group Holding 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 appl... |
//! SoC clock configuration
// The clocking in this chip is split into several peripheral sections oriented around low power modes
//
// Here is a quick overview of the peripheral sections as relates to those modes
//
// The GLB (global register) portion of the chip controls most clock enable/division circuits
// as... |
extern crate avr_mcu;
use clap::{App, Arg};
use std::path::{Path, PathBuf};
const DEFAULT_MCU_FOR_NON_AVR: &'static str = "atmega328";
#[derive(Clone, Debug)]
struct Config {
output_directory: PathBuf,
mcus: Vec<avr_mcu::Mcu>,
}
fn get_cli_config() -> Config {
let matches = App::new(env!("CARGO_PKG_NAM... |
//! Access code correlation and squelch
//!
//! The [`CodeCorrelator`]
//! searches the given input symbols for a known sync
//! pattern. The number of bit errors is output. When
//! the number of bit errors is zero, the system is
//! perfectly synchronized. This struct can be used to
//! detect the start of transmissi... |
#![allow(dead_code)]
use std::cell::Cell;
use std::rc::Rc;
use std::fmt::Write;
#[derive(Clone,Copy,PartialEq)]
pub enum Symbol {
Terminal, Item, Add, Sub, Mul, Div, Neg, Circumflex, Amp, Vert,
Assignment, Eq, Ne, Not, Qm, PathSep,
Dot, Comma, Colon, Semicolon,
LeftParen, RightParen,
LeftBracket,... |
use core::sync::atomic::Ordering;
use x86_64::structures::idt::{InterruptStackFrame, InterruptStackFrameValue, PageFaultErrorCode};
use x86_64::{PhysAddr, VirtAddr};
use crate::driver::pic;
use crate::multitasking::{
process, Process, ProcessId, ProcessSwitch, SCHEDULER, SCHEDULER_ENABLED,
};
use crate::smp;
use c... |
use super::util::{CacheKeyPath,
ConfigOptCacheKeyPath,
ConfigOptPkgIdent,
ConfigOptRemoteSup,
PkgIdent,
RemoteSup};
use crate::error::{Error,
Result};
use clap::AppSettings;
use configopt::{configopt_fields,
... |
/*
This tool is part of the WhiteboxTools geospatial analysis library.
Authors: Dr. <NAME>
Created: February 21, 2018
Last Modified: February 21, 2018
License: MIT
*/
use raster::*;
use rendering::html::*;
use rendering::LineGraph;
use std::env;
use std::f64;
use std::fs::File;
use std::io::prelude::*;
use std::io::B... |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
use anyhow::{self, Context};
use juno::ast::{self, node_cast, NodeRc};
use juno::hparser::{self, ParserDialect};
use juno::sema::... |
use std::collections::HashMap;
use serde::{Deserialize, Serialize};
use crate::ArenaFieldsGetter;
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
/// Fields of `VehicleSelf` that always occur in the battle results
pub struct VehicleSelf {
health: i32,
max_health: i32,
... |
//! `modelator` is a framework for model-based testing.
#![warn(
unreachable_pub,
missing_docs,
missing_copy_implementations,
trivial_numeric_casts,
unused_extern_crates,
rust_2018_idioms
)]
// It makes sense to allow those when the development is active
#![allow(unused_imports, dead_code)]
///... |
#![allow(clippy::unnecessary_mut_passed)]
#![warn(clippy::unimplemented, clippy::todo)]
// This example is another version of `passthrough.rs` that uses the
// path strings instead of the file descriptors with `O_PATH` flag
// for referencing the underlying file entries.
// It has the advantage of being able to use st... |
//! Common test fixtures for `XNetPayloadBuilder` tests.
use super::*;
use ic_base_types::PrincipalId;
use ic_interfaces::state_manager::CertificationScope;
use ic_protobuf::registry::{
node::v1::{connection_endpoint::Protocol, ConnectionEndpoint, NodeRecord},
subnet::v1::SubnetListRecord,
};
use ic_registry_c... |
//! `JSON` impl
use crate::avm2::activation::Activation;
use crate::avm2::array::ArrayStorage;
use crate::avm2::class::Class;
use crate::avm2::globals::array::ArrayIter;
use crate::avm2::method::{Method, NativeMethodImpl};
use crate::avm2::names::{Namespace, QName};
use crate::avm2::object::{ArrayObject, FunctionObjec... |
use std::fmt;
use std::io::Error as IoError;
use std::ops::Deref;
use tracing::{debug, trace, instrument};
use dataplane::batch::Batch;
use dataplane::{Offset, Size};
use fluvio_future::file_slice::AsyncFileSlice;
use crate::batch_header::{BatchHeaderStream, BatchHeaderPos};
use crate::mut_index::MutLogIndex;
use cr... |
//! Timer peripherals
//!
//! ESP32 supports two timer groups, with each timer group supports 3 timers
//! (Timer 0, 1 and Timer Lact) and a watchdog.
//! The timers are 64 bits and run from the APB clock divided by a programmable factor.
//!
//! # TODO
//! - Implement processor counter (CCOMPARE)
//! - Implement FRC1 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.