text stringlengths 3.09k 13.9k |
|---|
use crate::extensions::NodeExt as _;
use crate::hud;
use crate::mob;
use crate::player;
use gdnative::api::*;
use gdnative::*;
use rand::*;
use std::f64::consts::PI;
#[derive(Debug, Clone, PartialEq)]
pub enum ManageErrs {
CouldNotMakeInstance,
RootClassNotRigidBody2D(String),
}
#[derive(NativeClass)]
#[inher... |
//! A function that runs when a trap happens
pub use kernel_cpu::{clear_interrupt_context, in_interrupt_context, set_interrupt_context};
pub use kernel_trap_frame::TrapFrame;
pub use crate::trap_frame::TrapFrameExt;
use crate::{
context_switch,
cpu::{self, load_hartid, read_sscratch, read_sstatus},
extern... |
// Copyright 2011 Google Inc. All Rights Reserved.
// Copyright 2017 The Ninja-rs Project Developers. All Rights Reserved.
//
// 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:/... |
use binrw::{binread, BinRead};
use uom::si::acceleration::meter_per_second_squared;
use uom::si::angle::radian;
use uom::si::angular_acceleration::degree_per_second_squared;
use uom::si::angular_velocity::{degree_per_second, revolution_per_minute};
use uom::si::f32::Acceleration as AccelerationF32;
use uom::si::f32::An... |
// Copyright 2018-2020, Wayfair GmbH
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::Arc;
use async_trait::async_trait;
use bytes::Bytes;
use itertools::Itertools;
use runkv_common::coding::CompressionAlgorithm;
use runkv_proto::exhauster::exhauster_service_server::ExhausterService;
use runkv_proto::exhauster::{CompactionRequest, CompactionR... |
use super::info::{ClassInfo, IssuerInfo};
use super::parser::{
parse_claim, parse_claim_update, parse_define, parse_mint, parse_mint_v1, parse_transfer,
parse_transfer_update, parse_transfer_update_v1, parse_transfer_v1, parse_update,
parse_withdrawal, parse_withdrawal_v1,
};
use crate::response::helper::In... |
// 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::{Error, Fail, ResultExt};
use fidl_fuchsia_bluetooth_le::{AdvertisingData, PeripheralMarker, PeripheralProxy};
use fuchsia_app as app;
use fuc... |
use nom::{
alt, char, complete, fold_many1, many_till, map, multi, named, none_of, one_of, opt, preceded,
switch, tag, take, tuple, value, IResult,
};
use crate::grammar::{IntSuffix, Literal};
named!(bin_digit<&str, u32>, map!(
one_of!("01"),
|c: char| c.to_digit(2).unwrap()
));
named!(oct_digit<&str, u32>, ... |
use std::ptr;
use std::cell::RefCell;
use std::rc::{Rc, Weak};
use std::ops::Deref;
use std::collections::HashSet;
use std::hash::{Hash, Hasher};
use super::node_function::CgFunctionWrapper;
use ndarray::*;
pub fn slice2pair(slice: &[usize]) -> (usize, usize) {
(slice[0], slice[1])
}
#[derive(Debug, Hash, Pa... |
use framework;
use framework::nesting::{self, Nesting, Node};
use framework::media;
use framework::path;
use backend;
use errors;
use server::mime;
use server::header;
use json::{JsonValue};
#[allow(dead_code)]
#[allow(missing_copy_implementations)]
#[derive(Clone)]
pub enum Versioning {
Path,
AcceptHeader(&'s... |
#[doc = "Reader of register SR"]
pub type R = crate::R<u32, super::SR>;
#[doc = "Reader of field `IDTI`"]
pub type IDTI_R = crate::R<bool, bool>;
#[doc = "Reader of field `VBUSTI`"]
pub type VBUSTI_R = crate::R<bool, bool>;
#[doc = "Reader of field `SRPI`"]
pub type SRPI_R = crate::R<bool, bool>;
#[doc = "Reader of fie... |
extern crate walkdir;
use walkdir::WalkDir;
use std::path::Path;
use std::process::Command;
use std::env;
use std::io::Error;
//use std::collections::HashMap;
//const PROG_NOT_SET: &str = "cabal-rs: Program was not set using `with_prog`";
const STATIC_EXTENSION: &str = ".a";
pub struct Cabal<T>
where T: AsRef<Path... |
extern crate magma;
#[allow(non_upper_case_globals)]
const key: &magma::GostKey = &magma::GostKey ([
0xffeeddcc, 0xbbaa9988, 0x77665544, 0x33221100,
0xf0f1f2f3, 0xf4f5f6f7, 0xf8f9fafb, 0xfcfdfeff,
]);
#[allow(non_upper_case_globals)]
const text: [u8; 32] = [
0x59, 0x0a, 0x13, 0x3c, 0x6b, 0xf0, 0xde, 0x92,... |
//! # Day 09: Encoding Error
//!
//! [GitHub source](https://github.com/nbigaouette/advent_of_code_2019/tree/master/day09)
//!
//! [Benchmarking report](../../../day09/target/criterion/report/index.html)
//!
//! ## Part One
//!
//! With your neighbor happily enjoying their video game, you turn your attention to an open... |
use crate::{
object::JsObject,
property::{PropertyDescriptor, PropertyKey},
Context, JsResult, JsValue,
};
use super::{InternalObjectMethods, ORDINARY_INTERNAL_METHODS};
/// Definitions of the internal object methods for string exotic objects.
///
/// More information:
/// - [ECMAScript reference][spec]
... |
//! # Freedesktop Desktop Entry Specification
//!
//! This crate provides a library for efficiently generating valid desktop entries.
//!
//! - [Specification](https://specifications.freedesktop.org/desktop-entry-spec/latest/index.html)
//!
//! ```
//! use freedesktop_desktop_entry::{Application, DesktopEntry, DesktopT... |
//! 线程 [`Thread`]
use super::*;
use crate::fs::{INodeExt, ROOT_INODE};
use crate::interrupt::context::Context;
use crate::kernel::SyscallResult;
use crate::kernel::SyscallResult::{Park, Proceed};
use crate::memory::addr::VirtualAddress;
use crate::memory::mapping::Flags;
use crate::memory::range::Range;
use crate::pro... |
use crate::error::ContractError;
use crate::msg::MigrateMsg;
use crate::version_info::get_version_info;
use cosmwasm_std::{Addr, Coin, DepsMut, Order, Pair, StdResult, Storage, Uint128};
use cosmwasm_storage::{bucket, bucket_read, Bucket, ReadonlyBucket};
use schemars::JsonSchema;
use semver::{Version, VersionReq};
use... |
use super::*;
use rayon::prelude::*;
use std::collections::{HashMap, HashSet};
pub type DirEntryList = Vec<DirEntry>;
#[derive(Debug)]
pub struct DirDescriptor {
pub dir: PathBuf,
pub children: DirEntryList,
marker_file_child_index: Option<usize>,
subdir_child_indexes: HashSet<usize>,
}
impl DirDesc... |
extern crate ncurses;
extern crate rand;
use ncurses::*;
use rand::Rng;
struct Pong {
running: bool,
player1_score: i32,
player2_score: i32,
player1_y: i32,
player2_y: i32,
ball_x: f64,
ball_y: f64,
ball_velo_x: f64,
ball_velo_y: f64
}
const WIN_WIDTH: i32 = 80;
const WIN_HE... |
#![warn(clippy::pedantic)]
#![allow(clippy::unnecessary_wraps)]
use clap::{App, Arg, ArgMatches};
use mdbook::book::{Book, Chapter};
use mdbook::errors::Error;
use mdbook::preprocess::{CmdPreprocessor, Preprocessor, PreprocessorContext};
use mdbook_classy::{attr_list_def, AttrListDef};
use pulldown_cmark::{CowStr, Eve... |
mod utils;
use bit_vec::BitVec;
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;
struct Flag {
z: bool, //(0x80) if zero
n: boo... |
use alloc::collections::BTreeMap;
use alloc::prelude::v1::*;
use core::mem::size_of;
use crate::types::*;
use crate::utils::align_up;
use crate::{bail, ensure, warn_malformed, Result};
struct Cursor<'a> {
buf: &'a [u8],
i: usize,
}
impl<'a> Cursor<'a> {
fn new(buf: &'a [u8]) -> Self {
Self { buf,... |
use std::collections::HashSet;
use crate::folder::{fold_operation, fold_partial, fold_term, Folder};
use crate::kb::Bindings;
use crate::terms::{Operation, Operator, Term, TermList, Value};
use super::Partial;
/// Simplify the values of the bindings to be returned to the host language.
///
/// - For partials, simpli... |
//! Session contexts
//!
//! Contexts contain meta-data, such as certificates and principals and their
//! roles, necessary to establish and manage a session.
//!
//! ## Authors
//!
//! The Veracruz Development Team.
//!
//! ## Licensing and copyright notice
//!
//! See the `LICENSE_MIT.markdown` file in the Veracruz r... |
//! Rust implementation of bgzip
//!
//! # Example
//!
//! ## Reader example
//! ```
//! use bgzip::read::BGzReader;
//! use std::fs;
//! use std::io;
//! use std::io::prelude::*;
//!
//! # fn main() { let _ = run(); }
//! # fn run() -> io::Result<()> {
//! let mut reader = BGzReader::new(fs::File::open("./testfiles/co... |
use crate::game::{State, Transition, WizardState};
use crate::ui::PerMapUI;
use crate::ui::UI;
use abstutil::prettyprint_usize;
use ezgui::{
hotkey, Color, EventCtx, GfxCtx, HorizontalAlignment, Key, ModalMenu, Text, VerticalAlignment,
Wizard,
};
use geom::Duration;
use itertools::Itertools;
use sim::{FinishedT... |
// Copyright 2022 Xayn 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 agreed to in writ... |
use crate::*;
use crevice::std430::{AsStd430, Std430};
use std::{
marker::PhantomData,
sync::atomic::{AtomicU64, Ordering::SeqCst},
};
use wgpu::util::DeviceExt;
/// Specifies state for a single mesh draw.
///
/// This should be created on the fly and **not** stored.
#[derive(Debug, Clone)]
pub struct MeshDraw... |
//! MPPA evaluation context.
use crossbeam::sync::MsQueue;
use device::mppa::telajax;
use device::Context as ContextTrait;
use device::{self, mppa};
use explorer;
use ir;
use libc;
use search_space::SearchSpace;
use std;
use std::sync::Arc;
use utils::*;
const EXECUTION_QUEUE_SIZE: isize = 512;
/// MPPA evaluation co... |
use evdev::{Device, ABSOLUTE};
use framebuffer::{Framebuffer, KdMode};
use std::fs::File;
use std::os::unix::io::FromRawFd;
use std::path::Path;
use std::time::Instant;
pub mod gesture;
pub mod point;
pub mod streamed_data;
pub mod swipe;
use crate::point::*;
use crate::streamed_data::*;
use crate::swipe::*;
const ... |
use std::sync::Arc;
use tracing::debug;
use futures::SinkExt;
use futures::future::BoxFuture;
use futures::future::FutureExt;
use fluvio_types::SpuId;
use error::ServerError;
use fluvio_controlplane_metadata::partition::ReplicaKey;
use utils::actions::Actions;
use utils::SimpleConcurrentHashMap;
use fluvio_types::log... |
use superslice::Ext;
use crate::partition::GetHistogram;
use rand::prelude::*;
#[path = "../src/bin/wordfreq/partition.rs"]
mod partition;
struct GetHistogramFromKey {
}
impl GetHistogram for GetHistogramFromKey {
// REQUIRE: keys and pivots are sorted
fn get_histogram(&self, keys: &Vec<i64>, pivots: &Vec<i6... |
use std::any::Any;
use std::cell::UnsafeCell;
use std::mem::{self, ManuallyDrop, MaybeUninit};
use std::ops::{Deref, DerefMut};
use std::panic::{catch_unwind, AssertUnwindSafe};
use std::sync::atomic::{AtomicU8, Ordering};
use crate::{Metric, Value};
const UNINIT: u8 = 0;
const INIT_IN_PROGRESS: u8 = 1;
const INIT: u... |
// Copyright (c) 2021 The Lutino Projects
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.
use std::convert::TryInto;
use nh_common::result::AssetResult;
use nh_common::stack_containers::SVec;
use crate::format::p... |
use anyhow::anyhow;
use anyhow::Result;
use clap::arg;
use clap::command;
use clap::Command;
use owo_colors::OwoColorize;
use owo_colors::Stream;
use rusqlite::Connection;
use rusqlite::OpenFlags;
use std::collections::BTreeSet;
use std::fs::File;
use std::io::BufRead;
use std::io::BufReader;
struct WordWithCount {
... |
use std::ops::Range;
use plonky2_field::extension_field::Extendable;
use crate::gates::gate::Gate;
use crate::hash::hash_types::RichField;
use crate::iop::ext_target::ExtensionTarget;
use crate::iop::target::Target;
use crate::plonk::circuit_builder::CircuitBuilder;
/// Trait for gates which interpolate a polynomial... |
// Copyright <NAME> <<EMAIL>>
// SPDX-License-Identifier: MIT OR Apache-2.0
//
// 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, mo... |
use std::collections::HashMap;
use itertools::Itertools;
use once_cell::sync::Lazy;
use regex::Regex;
type Input<'a> = (HashMap<u64, Rule>, Vec<&'a str>);
fn parse_rule_numbers(s: &str) -> Vec<u64> {
s.split_whitespace()
.map(str::parse)
.map(Result::unwrap)
.collect()
}
fn parse_rule(ru... |
/*
* Copyright 2021 <NAME>
* https://github.com/mikechambers/dcli
*
* 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... |
use crate::{
opcode::BlockDir,
tables::{lookup8_r12, HALF_CARRY_SUB_TABLE, PARITY_TABLE, SZF3F5_TABLE},
RegName16, RegName8, Z80Bus, FLAG_CARRY, FLAG_F3, FLAG_F5, FLAG_HALF_CARRY, FLAG_PV, FLAG_SIGN,
FLAG_SUB, FLAG_ZERO, Z80,
};
/// ldi/ldd instruction group
pub fn execute_ldi_ldd(cpu: &mut Z80, bus: &... |
use std::collections::HashMap;
use std::env;
use std::fs;
const ITERATIONS: usize = 100;
type Point = (i32, i32);
type Grid = HashMap<Point, Tile>;
#[derive(Debug)]
enum Dir {
East,
SouthEast,
SouthWest,
West,
NorthWest,
NorthEast,
}
impl Dir {
fn gen_dir(first: &char, second: &char) -> ... |
use crate::{
core::{Algorithm, Parameter},
fa::{Approximator, Embedding, Features, Parameterised, VFunction},
geometry::{Space, Matrix, MatrixView, MatrixViewMut, Vector, continuous::Interval},
policies::{DifferentiablePolicy, ParameterisedPolicy, Policy},
};
use ndarray::Axis;
use rand::{thread_rng, rn... |
use std::collections::HashMap;
use std::fmt;
#[repr(u8)]
#[derive(Clone, PartialOrd, PartialEq)]
#[cfg_attr(feature="debug", derive(Debug))]
#[allow(non_camel_case_types)]
/// The numerical representation of Tag types.
///
/// Used within the internal encode/decode process and hence is returned within errors.
pub enum... |
use std::rc::Rc;
use std::cell::RefCell;
use runtime::SingleThreadRuntime;
use continuation::ContinuationSt;
use signal::Signal;
use signal::signal_runtime::{SignalRuntimeRefBase, SignalRuntimeRefSt};
use signal::valued_signal::{ValuedSignal, MpSignal, CanEmit, GetValue};
/// A shared pointer to a signal runtime.
pub... |
// File: day_11.rs
// Author: <NAME>
// Date: December 2020
/*
Copyright 2020 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights t... |
use strum::*;
use serde_derive::{Deserialize, Serialize};
#[derive(Copy, Clone, Debug, Eq, PartialEq, EnumIter, EnumMessage, EnumProperty, Serialize, Deserialize)]
pub enum Track
{
#[strum(message="Cheesey Jumps", props(TrackSelect="1", PhysicsSelect="0x1"))]
Cheesey,
#[strum(message="Cereal Killer", props... |
use super::conversion::{datetime_to_timestamp_ms, datetime_to_timestamp_ns};
use super::*;
use crate::prelude::DataType::Datetime;
use crate::prelude::*;
use arrow::temporal_conversions::{
timestamp_ms_to_datetime, timestamp_ns_to_datetime, timestamp_us_to_datetime,
};
use std::fmt::Write;
impl DatetimeChunked {
... |
// 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::io::Directory,
fidl_fuchsia_device::ControllerMarker,
fidl_fuchsia_hardware_block_partition::Guid,
fidl_fuchsia_hardware_block... |
use half::f16;
use std::io;
use crate::byteorder_io::ByteOrder;
use crate::multifilereader::HasError;
use crate::peekreader::PeekRead;
/// Processes an input and provides access to the data read in various formats
///
/// Currently only useful if the input implements `PeekRead`.
pub struct InputDecoder<'a, I>
where
... |
use secstr::SecUtf8;
use chain_core::tx::TransactionId;
use client_common::{BlockHeader, ErrorKind, Result, ResultExt, Storage};
use crate::service::{GlobalStateService, KeyService, WalletService};
use crate::{BlockHandler, TransactionHandler, TransactionObfuscation};
/// Default implementation of `BlockHandler`
#[d... |
use serde::{Deserialize, Serialize};
use std::{fmt::Display, future::Future};
pub fn set_panic_hook() {
std::panic::set_hook(Box::new(|panic_info| {
let message = panic_info
.payload()
.downcast_ref::<&str>()
.unwrap_or(&"Unavailable");
let err_str = format!(
... |
//! Heap trace file.
use std::{
fs::File,
io,
io::{BufReader, Read},
ops::{Generator, GeneratorState},
pin::Pin,
};
use thiserror::Error;
/// The key used to shuffle packet bits.
pub const KEY: u32 = 0xC5AC_CE55;
const MAX_FRAME: usize = 8;
/// Heap trace file parser error.
#[derive(Error, Debug... |
// 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 {
anyhow::Error,
fidl::endpoints,
fidl_fuchsia_bluetooth_host::{HostMarker, HostRequest},
fidl_fuchsia_bluetooth_sys::AccessMarker,
... |
use std::{
fs::{self, OpenOptions},
future::Future,
marker::PhantomData,
net::SocketAddr,
path::{Path, PathBuf},
str::FromStr,
};
use crate::{Error, Result};
use axum::Router;
use config::{builder::DefaultState, Config, ConfigBuilder, ConfigError, File};
use serde::{Deserialize, Serialize};
use... |
use fenris::element::{Hex8Element, Quad4d2Element};
use fenris::embedding::{
compute_element_embedded_quadrature, construct_embedded_quadrature_for_element_2d, embed_cell_2d,
optimize_quadrature, QuadratureOptions,
};
use fenris::geometry::procedural::{approximate_triangle_mesh_for_sdf_2d, create_simple_stupid_... |
// This file is part of the uutils coreutils package.
//
// (c) <NAME> <<EMAIL>>
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
//! Set of functions to parse modes
// spell-checker:ignore (vars) fperm srwx
use libc::{mode_t, umask, S_... |
//! A `Mapper` is responsible for acquiring address space and backing
//! memory from the operating system. Each `Mill` is parameterised on
//! such a `Mapper`.
#[cfg(any(
all(test, feature = "check_contracts_in_tests"),
feature = "check_contracts"
))]
use contracts::*;
#[cfg(not(any(
all(test, feature = "... |
//! Response codes
use super::{Error, ErrorKind};
use crate::command;
use anomaly::{fail, format_err};
use serde::{de, ser, Deserialize, Serialize};
/// Codes associated with HSM responses
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
pub enum Code {
/// Successful response for the given command type
Success(c... |
#![cfg(test)]
use super::*;
use frame_support::{assert_ok, ord_parameter_types, parameter_types, PalletId};
use frame_system::{self as system};
use sp_core::H256;
use sp_runtime::{
testing::Header,
traits::{AccountIdConversion, BlakeTwo256, IdentityLookup},
};
use crate::{self as pallet_bridge, Config};
pub use pa... |
mod args;
mod utils;
use darling::*;
use proc_macro2::TokenStream as TokenStream2;
use quote::*;
use syn::*;
// impl `#[derive(Visit)]` for `struct` or `enum`
pub fn impl_visit(ast: DeriveInput) -> TokenStream2 {
let ty_args = args::TypeArgs::from_derive_input(&ast).unwrap();
match &ty_args.data {
ast... |
use std::cmp::Ordering;
use phf;
use regex::Regex;
use {SplitCaptures};
lazy_static! {
static ref RE_HAN: Regex = Regex::new(r"([\u{4E00}-\u{9FD5}]+)").unwrap();
static ref RE_SKIP: Regex = Regex::new(r"([a-zA-Z0-9]+(?:.\d+)?%?)").unwrap();
}
pub type StatusSet = [f64; 4];
#[derive(Debug, PartialEq, Eq, Ha... |
mod blogs;
mod posts;
use crate::blogs::Blog;
use crate::posts::Post;
use handlebars::{handlebars_helper, Handlebars};
use sass_rs::{compile_file, Options};
use serde_derive::Serialize;
use serde_json::json;
use std::convert::AsRef;
use std::error::Error;
use std::fs::{self, File};
use std::io::Write;
use std::path::{... |
use crate::{RenderApp, RenderStage};
use bevy_app::{App, Plugin};
use bevy_asset::{Asset, AssetEvent, Assets, Handle};
use bevy_ecs::{
prelude::*,
system::{lifetimeless::*, RunSystem, SystemParam, SystemParamItem},
};
use bevy_utils::{HashMap, HashSet};
use std::marker::PhantomData;
pub enum PrepareAssetError<... |
//! Module providing the building blocks to create macros and expand them.
use std::any::Any;
use std::error::Error as StdError;
use std::mem;
use std::sync::{Arc, RwLock};
use futures::{stream, Future, Stream};
use base::ast::{self, Expr, MutVisitor, SpannedExpr};
use base::error::Errors as BaseErrors;
use base::fnv... |
use crate::internal::*;
use crate::ops::cnn::{PaddingSpec, Patch, PatchSpec};
use crate::ops::nn::{DataFormat, DataShape};
#[derive(Debug, Clone, new, Default)]
pub struct PoolSpec {
data_format: DataFormat,
kernel_shape: TVec<usize>,
padding: PaddingSpec,
strides: Option<TVec<usize>>,
}
impl PoolSpe... |
use std::{
cell::RefCell, collections::HashMap, os::unix::prelude::IntoRawFd, rc::Rc, sync::atomic::Ordering,
time::Duration,
};
use smithay::{
backend::{
renderer::{Frame, Renderer, Transform},
SwapBuffersError,
},
reexports::{
calloop::{
channel::{Channel, Even... |
//! This module contains the top level netlink header code. Every
//! netlink message will be encapsulated in a top level `Nlmsghdr`.
//!
//! [`Nlmsghdr`][crate::nl::Nlmsghdr] is the structure representing a
//! header that all netlink protocols require to be passed to the
//! correct destination.
//!
//! # Design deci... |
extern crate bincode;
extern crate bincode_tester;
extern crate clap;
extern crate serde_json;
use std::io::{
BufRead, BufReader, BufWriter, Read, Write, stdin, stdout
};
// use std::iter::Zip;
use std::fs::File;
use bincode::{deserialize_from, serialize_into};
use bincode_tester::{Harness, RandomStuff};
use clap... |
extern crate regex_syntax;
extern crate libcsearch;
use regex_syntax::Expr;
use libcsearch::regexp::RegexInfo;
macro_rules! regex_eq {
( $r:expr, $expected:expr ) => {
{
let e = match Expr::parse($r.as_ref()) {
Ok(e) => e,
Err(e) => panic!("FAILED to parse exp... |
mod build_support;
use build_support::{binaries, cargo, git, skia, utils};
use std::io::Cursor;
use std::path::Path;
use std::{fs, io};
/// Environment variables used by this build script.
mod env {
use crate::build_support::cargo;
use std::path::PathBuf;
/// Returns `true` if the download of prebuilt bin... |
// Copyright 2020 <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writi... |
use crate::elasticsearch::Elasticsearch;
use crate::executor_manager::get_executor_manager;
use crate::gucs::ZDB_DEFAULT_ROW_ESTIMATE;
use crate::utils::find_zdb_index;
use crate::zdbquery::ZDBQuery;
use pgx::*;
use std::collections::HashSet;
#[pg_extern(immutable, parallel_safe)]
fn anyelement_cmpfunc(
element: A... |
// Copyright 2020 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of
// this software and associated documentation files (the "Software"), to deal in
// the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute... |
extern crate libc;
#[macro_use]
extern crate lazy_static;
pub mod dynamic_library;
/// Error that can happen while loading the shared library.
#[derive(Debug, Clone)]
pub enum LoadingError {
///
LibraryNotFound {
descr: String,
},
/// One of the symbols could not be found in the library.
... |
/* Copyright 2015 <NAME>
*
* Licensed under the MIT license <LICENSE or
* http://opensource.org/licenses/MIT>. This file may not be copied,
* modified, or distributed except according to those terms.
*/
use super::control_prelude::*;
use std::borrow::Cow;
use std::ffi::CStr;
use std::path::{PathBuf, Path};
use su... |
// this file is part of the pointproofs.
// it benches the cost for cross commitments aggregation and batch verification
#[macro_use]
extern crate criterion;
extern crate ff_zeroize as ff;
extern crate pairing_plus as pairing;
extern crate pointproofs;
use criterion::Benchmark;
use criterion::Criterion;
use pairing::... |
use sokol_bindings::{
cstr,
sg::{
self,
range,
Bindings,
Pipeline,
PipelineDesc,
},
Int,
};
use math::mat4::Mat4;
use sokol_extras::shaders::textured;
#[derive(Default)]
pub struct State {
pub bind: Bindings,
pub pipe: Pipeline,
}
/*
Cube vertex buff... |
use ggez::{Context, GameResult};
use ggez::graphics::{
clear, draw, present, BlendMode, Color, Drawable, DrawMode, DrawParam, FillOptions, Mesh, Rect, Text, TextFragment};
use ggez::input::keyboard;
use ggez::nalgebra as na;
type Point2 = na::Point2<f32>;
type Vector2 = na::Vector2<f32>;
use crate::entities::{Cha... |
pub mod alu_parsing_utils;
pub mod alu_generation_utils;
pub mod rust_code_generator;
// Important: nightly must be enabled to work
#[macro_use] extern crate lazy_static;
#[macro_use] extern crate lalrpop_util;
extern crate clap;
use clap::{App, Arg};
lalrpop_mod!(pub alugrammar); // synthesized by LALRPOP
fn main()... |
use crate::aggregator::Aggregator;
use crate::env;
use crate::partitioner::Partitioner;
use crate::rdd::RddBase;
use crate::serializable_traits::Data;
use log::info;
use serde_derive::{Deserialize, Serialize};
use serde_traitobject::{Deserialize, Serialize};
use std::cmp::Ordering;
use std::collections::HashMap;
use st... |
use std::collections::BTreeMap;
use std::fmt::{Display, Formatter};
use parser::{LR1Parser, Parse, ParseError, Rule, Syntax};
use parser::enum_index;
use parser::enum_index_derive::*;
use parser::Symbol::*;
use tokenizer::{DFATokenizer, Tokenize};
#[derive(Debug, EnumIndex)]
enum Token {
Lambda(String),
Ident... |
use hyphae::configuration::Configuration;
use hyphae::events::CubensisEvent;
use psilocyn::device::GraphicsDevice;
use psilocyn::resources::CubensisResource;
use std::time::Duration;
use substrate::stream_info::AudioStreamInfo;
use substrate::wave_stream::WaveStream;
use substrate::AudioStreamSource;
pub struct AudioR... |
//!
use chart_builder::charts::*;
/// Structure used for storing chart related data and the drawing of an Bar Chart.
///
/// Compare values across multiple categories.
#[derive(Clone)]
pub struct VerticalBarChart {
data_labels: Vec<String>,
data: Vec<Vec<f64>>,
pub chart_prop: ChartProp,
pub axis_pro... |
use crate::{
app::StatusOr,
file,
render::{
attribute,
Attribute,
AttributeProgram,
BitmapTexture,
CameraGeometry,
ShaderProgram,
ShaderUniformKey,
Texel,
TextureUnit,
},
text::{
Base10CharIterator,
GlyphId,
... |
use crate::apple_photos::Fromable;
use rusqlite::Result;
use rusqlite::Row;
#[derive(Debug)]
pub struct Face {
pub model_id: i32,
pub uuid: String,
pub is_in_trash: i32,
pub person_id: i32,
pub has_been_synced: i32,
pub adjustment_uuid: String,
pub image_model_id: i32,
pub source_width:... |
use nix::{
sys::ptrace,
sys::wait::waitpid,
unistd::{execv, fork, getpid, ForkResult, Pid},
};
use std::{
ffi::CString,
fs::File,
io::{BufRead, BufReader},
mem,
};
/// This structure holds the state of a debuggee.
/// You can use it to read & write debuggee's memory, pause it, set breakpoin... |
//! Types and declarations for the Object Attribute Memory (`OAM`).
use super::*;
newtype! {
/// 0th part of an object's attributes.
///
/// * Bits 0-7: row-coordinate
/// * Bits 8-9: Rendering style: Normal, Affine, Disabled, Double Area Affine
/// * Bits 10-11: Object mode: Normal, SemiTransparent, Object... |
//! xmlファイル関係のモジュール
use std::boxed::Box;
use std::error::Error;
use std::fmt;
use std::io::Write;
use std::result::Result;
use chrono::Duration;
use ulid::Ulid;
use xml::writer::{EmitterConfig, XmlEvent};
use crate::unitsubrip::UnitSubRip;
impl Error for XmlError {}
#[derive(Debug)]
struct XmlError(String);
impl f... |
//! Abstractions over the Falcon opcode format.
use std::fmt;
/// Represents the operand size of an instruction.
///
/// The size is determined by the highest two bits of the first
/// instruction byte.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum OperandSize {
/// The instruction operates on operands of... |
/*!
Link of tree node IDs
*/
use std::fmt;
pub trait Tree {
/// usize or small size
type Slot: Default + Clone + PartialEq + fmt::Debug;
/// Slot with generation
type Id: Id<Self::Slot> + Clone + fmt::Debug;
fn root_mut(&mut self) -> &mut Link<Self::Slot>;
fn link_mut_by_slot(&mut self, slo... |
use std::convert::Into;
use std::sync::{Arc, Mutex};
use std::time::Instant;
use zvariant::Type;
use zvariant::{Dict, Signature, Str, Value};
fn boxed_value<'a, V: Into<Value<'a>>>(v: V) -> Value<'a> {
Value::new(v.into())
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum PlaybackStatus {
Playing,
P... |
use super::{Config, Configure, FvWrite};
use crate::buffer::Buffer;
use crate::definitions::fix44;
use crate::dict;
use crate::dict::IsFieldDefinition;
use crate::tagvalue::datatypes::CheckSum;
use crate::FixValue;
use crate::TagU16;
use std::ops::Range;
/// A buffered, content-agnostic FIX encoder.
///
/// [`Encoder`... |
#![cfg(windows)]
use futures_core::ready;
use hyper::client::connect::Connected;
use mio_named_pipes::NamedPipe;
use pin_project::pin_project;
use tokio::io::{AsyncRead, AsyncWrite};
use tokio::io::PollEvented;
use winapi::um::winbase::*;
use std::fmt;
use std::fs::OpenOptions;
use std::future::Future;
use std::io::{... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00..0x40 - Master Configuration Register"]
pub mcfg: [crate::Reg<mcfg::MCFG_SPEC>; 16],
#[doc = "0x40..0x80 - Slave Configuration Register"]
pub scfg: [crate::Reg<scfg::SCFG_SPEC>; 16],
#[doc = "0x80 - Priority Register A fo... |
//! Query batching utility
extern crate batch_recv;
extern crate crossbeam_channel as chan;
extern crate futures;
extern crate itertools;
extern crate worker_sentinel;
use std::fmt::Debug;
use futures::sync::oneshot;
use itertools::Itertools;
use worker_sentinel::{Work, WorkFactory};
use batch_recv::BatchRecv;
/// T... |
/*
MIT License
Copyright (c) 2021 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distrib... |
use std::collections::HashMap;
use neat::network::network_graph::NetworkGraph;
use neat::{node_data::NodeData, node_kind::NodeKind};
use ggez::graphics::{self};
use ggez::nalgebra as na;
use super::{opencolor, text::Text};
fn calculate_y(total_count: usize, nth: usize, rect: &graphics::Rect) -> f32 {
let delta ... |
//! # Parameters module
//! Resources for modifying the various simulation parameters of the
//! nphysics World.
use std::ops::{Deref, DerefMut};
use crate::{
nalgebra::{self as na, RealField, Scalar, Vector2},
nphysics::solver::IntegrationParameters,
};
/// The `TimeStep` is used to set the timestep of the ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.