text stringlengths 7.05k 33.9k |
|---|
use core::ptr::read_volatile;
use packing::{
Packed,
PackedSize,
};
use usbd_scsi::{
BlockDevice,
BlockDeviceError,
};
use uf2_block::Block as Uf2Block;
use itm_logger::*;
use stm32f1xx_hal::{
backup_domain::BackupDomain,
pac::{
SCB,
NVIC,
},
};
use cortex_m::asm;
use cr... |
use std::io::Write;
use memory::MI;
use coresight::ap_access::APAccess;
use coresight::access_ports::generic_ap::GenericAP;
use coresight::ap_access::access_port_is_valid;
use coresight::access_ports::AccessPortError;
use std::time::Instant;
use coresight::dap_access::DAPAccess;
use probe::debug_probe::{DebugProbe, De... |
// Copyright (c) SimpleStaking, Viable Systems and Tezedge Contributors
// SPDX-License-Identifier: MIT
//! Implementation of an in-memory repository.
use std::{
borrow::Cow,
collections::{hash_map::DefaultHasher, BTreeMap, VecDeque},
hash::Hasher,
mem::size_of,
sync::{atomic::Ordering, Arc},
... |
// Copyright 2021 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 agree... |
//! Java Ant plugin.
use crate::{
error::JavaError, java_plugin::JavaPlugin, AntStudentFilePolicy, CompileResult, TestRun,
SEPARATOR,
};
use j4rs::Jvm;
use std::env;
use std::ffi::OsStr;
use std::path::{Path, PathBuf};
use std::time::Duration;
use tmc_langs_framework::{
nom::{error::VerboseError, IResult},... |
use log::*;
use winapi::shared::dxgi::*;
use winapi::shared::dxgiformat::*;
use winapi::shared::dxgitype::*;
use winapi::shared::minwindef::*;
use winapi::shared::windef::{HBRUSH, HICON, HMENU, HWND, POINT, RECT};
use winapi::um::d3d11::*;
use winapi::um::d3dcommon::*;
use winapi::um::libloaderapi::GetProcAddress;
use... |
//! `restore` functions
use std::{env, io::Write, process::Stdio};
use abscissa_core::{status_ok};
use libra_global_constants::{GENESIS_WAYPOINT, WAYPOINT};
use once_cell::sync::Lazy;
use reqwest;
use anyhow::Error;
use glob::glob;
use serde::{Serialize, Deserialize};
use std::{fs::{self, File}, io::{self}, path::{Pat... |
use super::{Token, TokenStream, Tokenizer};
/// Tokenize the text by splitting words into n-grams of the given size(s)
///
/// With this tokenizer, the `position` is always 0.
/// Beware however, in presence of multiple value for the same field,
/// the position will be `POSITION_GAP * index of value`.
///
/// Example... |
use core::cmp::Ordering;
use trussed::{
client, syscall, try_syscall,
Client as TrussedClient,
types::{
self,
ObjectHandle as Key,
UniqueId,
Location,
Mechanism,
},
};
use ctap_types::{
Bytes32,
authenticator::Error,
cose::EcdhEsHkdf256PublicKey as Co... |
use std::mem;
use std::str;
use std::collections::{HashMap, HashSet};
use std::rc::Rc;
#[allow(dead_code)]
#[derive(Debug, Clone, Copy)]
struct Point {
x: f64,
y: f64,
}
#[allow(dead_code)]
struct Rectangle {
p1: Point,
p2: Point,
}
fn origin() -> Point {
Point { x: 0., y: 0.}
}
fn boxed_origin(... |
use crate::*;
use std::str::FromStr;
use std::time::Instant;
use std::convert::Infallible;
use std::net::SocketAddr;
use std::sync::Arc;
use std::collections::HashMap;
use tokio::sync::RwLock;
use hyper::{Body, Request, Response, Server, StatusCode};
use routerify::prelude::*;
use routerify::{Middleware, Router, Router... |
//! TreeKEM test vectors
//!
//! See https://github.com/mlswg/mls-implementations/blob/master/test-vectors.md
//! for more description on the test vectors.
//!
//! The test vector describes a tree of `n` leaves adds a new leaf with
//! `my_key_package`, `my_leaf_secret` and `my_path_secret` (common ancestor of
//! `add... |
/*
* Copyright (C) 2021 <NAME> <<EMAIL>>
*
* Use of this source code is governed by the Apache 2.0 and/or the MIT
* License.
*/
//! Module describing file processor that changes filenames to setup cache-busting
//!
//! Run the following during build using `build.rs`:
//!
//! ```rust
//! use cache_buster::BusterBuilde... |
pub use plygui_api::sdk::*;
pub use plygui_api::{callbacks, controls, defaults, ids, layout, types::{self, adapter}, utils};
pub use plygui_api::external::image;
pub use std::borrow::Cow;
pub use std::collections::HashMap;
pub use std::os::raw::c_void;
pub use std::sync::Arc;
pub use std::{any, cmp, ffi, marker, mem, ... |
//! Functions related to spawning levels.
use crate::{
app::{
LdtkEntity, LdtkEntityMap, LdtkIntCellMap, PhantomLdtkEntity, PhantomLdtkEntityTrait,
PhantomLdtkIntCell, PhantomLdtkIntCellTrait,
},
assets::{LdtkLevel, TilesetMap},
components::*,
ldtk::{
EntityDefinition, EnumT... |
#![cfg_attr(not(target_os = "none"), allow(dead_code))]
#![cfg_attr(not(target_os = "none"), allow(unused_imports))]
#![cfg_attr(target_os = "none", no_std)]
#![cfg_attr(target_os = "none", no_main)]
mod api;
use api::*;
use num_traits::{ToPrimitive, FromPrimitive};
use xous_ipc::Buffer;
use xous::msg_blocking_scal... |
#![allow(proc_macro_derive_resolution_fallback)]
#![allow(unused_imports)]
#![allow(unused_variables)]
use log::{debug, error, info, trace, warn};
use diesel;
use diesel::prelude::*;
use diesel_migrations;
use crate::models::*;
use crate::schema::entries::dsl as e;
use crate::schema::entry2labels::dsl as e2l;
use ... |
//! C interface for behaviors support (a.k.a windowless controls).
#![allow(non_camel_case_types, non_snake_case)]
#![allow(dead_code)]
use super::{
scdom::*,
scgraphics::HGFX,
scom::{som_asset_t, som_passport_t},
sctypes::*,
scvalue::VALUE,
};
#[repr(C)]
pub struct BEHAVIOR_EVENT_PARAMS {
//... |
use core::cell::Cell;
use core::mem;
use kernel::grant::Grant;
use kernel::hil::led::Led;
use kernel::hil::time::{Alarm, AlarmClient, ConvertTicks};
use kernel::process::{Error, ProcessId};
use kernel::processbuffer::{ReadOnlyProcessBuffer, ReadableProcessBuffer};
use kernel::syscall::{CommandReturn, SyscallDriver};
us... |
use std::cmp;
use std::collections::HashSet;
use std::convert::{TryFrom, TryInto};
use std::error::Error;
use std::fmt;
use std::iter;
use crate::kind;
mod f4jumble;
/// The HRP for a Bech32m-encoded mainnet Unified Address.
///
/// Defined in [ZIP 316][zip-0316].
///
/// [zip-0316]: https://zips.z.cash/zip-0316
pub... |
//! Implements the Scrypt key derivation function as [Specification][1].
//!
//! # Examples
//!
//! ```
//! use cryptoxide::scrypt::{scrypt, ScryptParams};
//!
//! let password = b"password";
//! let salt = b"<PASSWORD>";
//! let params = ScryptParams::new(4, 1, 1);
//! let mut out = [0u8; 64];
//! scrypt(password, sal... |
use crate::process_error::ProcessError;
use crate::read2;
use anyhow::{bail, Context, Result};
use jobserver::Client;
use shell_escape::escape;
use tempfile::NamedTempFile;
use std::collections::BTreeMap;
use std::env;
use std::ffi::{OsStr, OsString};
use std::fmt;
use std::io::{self, Write};
use std::iter::once;
use... |
use crate::{
material::{Material, MaterialKind},
math::align_to,
simd::*,
};
use glam::{vec3, Vec3};
use std::f32;
#[inline]
fn cttz_8bits_nonzero(x: u32) -> u32 {
// cttz on first 8 bits - 0 not expected
#[cfg(feature = "core_intrinsics")]
{
use std::intrinsics::cttz_nonzero;
u... |
use std::fmt;
use base::ast::{self, DisplayEnv, Do, Expr, MutVisitor, Pattern, SpannedExpr, Typed, TypedIdent};
use base::error::Errors;
use base::fnv::FnvMap;
use base::kind::{ArcKind, Kind, KindEnv};
use base::pos::{self, BytePos, Span, Spanned};
use base::scoped_map::ScopedMap;
use base::symbol::{Symbol, SymbolModu... |
use std::cmp::max;
use serde::{ Serialize, Deserialize };
use nalgebra::{ Vector2, Vector3 };
use ash::{ vk, Device };
use crate::constants;
use crate::resource::resource::{ EngineResources, DEFAULT_FONT_NAME };
use crate::renderer::renderer_context::RendererContext;
use crate::renderer::utility;
use crate::utilities... |
use mat::mat4::*;
#[test]
fn creation() {
let mut mat: Mat4 = Mat4::new(1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.);
assert_eq!(mat._11, 1.);
assert_eq!(mat._12, 1.);
assert_eq!(mat._13, 1.);
assert_eq!(mat._14, 1.);
assert_eq!(mat._21, 1.);
assert_eq!(mat._22, 1.);
assert_eq!(mat._23, 1... |
//! A Dynamic Bounding Volume Tree.
use std::cell::RefCell;
use std::rc::Rc;
use std::ptr;
use std::mem;
use utils::data::owned_allocation_cache::OwnedAllocationCache;
use na::{FloatVec, Translation};
use na;
use bounding_volume::BoundingVolume;
use partitioning::bvt_visitor::BVTVisitor;
use math::{Scalar, Point};
#... |
use std::collections;
use std::io;
use std::fs;
use std::ops::Deref;
use std::error::Error;
use std::path::Path;
use hyper::header;
use iron;
use iron::prelude::*;
use iron::modifiers::{Header,Redirect};
use iron::status;
use iron::method::Method;
use iron::typemap::Key;
use persistent;
use handlebars_iron::{Handl... |
//! Implements the ntor handshake, as used in modern Tor.
//!
//! # Limitations
//!
//! These functions should be extensible to work with the ntor variant
//! used in v3 hidden services; but right now they aren't.
use super::KeyGenerator;
use crate::util::ct;
use crate::{Error, Result, SecretBytes};
use tor_bytes::{Re... |
//! RTFM application analysis
use core::cmp;
use std::collections::{btree_map::Entry, BTreeMap, BTreeSet, HashMap};
use indexmap::IndexMap;
use syn::{Ident, Type};
use crate::{ast::App, Core, Set};
pub(crate) fn app(app: &App) -> Analysis {
// a. Which core initializes which resources
let mut late_resources... |
//! Flash Controller
use core::cell::Cell;
use core::ops::{Index, IndexMut};
use kernel::common::cells::OptionalCell;
use kernel::common::cells::TakeCell;
use kernel::common::registers::{
register_bitfields, register_structs, ReadOnly, ReadWrite, WriteOnly,
};
use kernel::common::StaticRef;
use kernel::hil;
use ke... |
/*
* Copyright (C) 2022 Open Source Robotics Foundation
*
* 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... |
use crate::{Instruction, Opcode, Word};
use core::{convert, fmt, mem};
const WORD_SIZE: usize = mem::size_of::<Word>();
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[repr(u8)]
#[non_exhaustive]
/// Panic reason representation for the... |
use super::parser::{AstNode, BlendMode, TargetBuffer, FormulaExpr, Atom, Operator, NormalizeMetric, UnaryOperator, Function};
use std::path::PathBuf;
use rand_pcg::Pcg64;
use rand::prelude::*;
use rustfft::{FFTplanner, num_complex::Complex, num_traits::Zero};
const E: f32 = 2.71828182845904523536;
const PI: f32 = 3.1... |
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed unde... |
//! Index/slot allocator policies for the pooling allocator.
use super::PoolingAllocationStrategy;
use crate::CompiledModuleId;
use rand::Rng;
use std::collections::HashMap;
/// A slot index. The job of this allocator is to hand out these
/// indices.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct SlotId(pub... |
/*!
A symbolic natural language parsing library for Rust, inspired by
[HDPSG](https://en.wikipedia.org/wiki/Head-driven_phrase_structure_grammar).
# What is this?
This is a library for parsing natural or constructed languages into syntax trees
and feature structures. There's no machine learning or probabilistic models... |
use std::hash::Hash;
use crate::ast::abstract_syntax_node::AbstractSyntaxNode;
use crate::ast::abstract_syntax_tree::AbstractSyntaxTree;
use crate::grammar::context_free_grammar::ContextFreeGrammar;
use crate::grammar::first_follow_symbols::FirstFollowSymbols;
use crate::parser::failed_production::FailedProduction;
us... |
use std::collections::HashMap;
use std::convert::TryFrom;
use std::ops::Range;
use crate::byte_vec::{DataVecReader, DataVecWriter};
use crate::data_type::DataType;
use crate::{
has_end, has_start, has_step, skip_byte_sizes, skip_size, skip_sizes, skip_type,
skip_type_and_byte_size, skip_type_and_size, Expressi... |
use std::sync::atomic::{ AtomicUsize, Ordering::Relaxed };
use std::fs::File;
use std::io::{ BufRead, BufReader };
use std::str::SplitWhitespace;
use crossbeam_utils::thread;
use crate::name::{ NamePtr, Name };
use crate::level::{ LevelPtr, LevelsPtr, Level };
use crate::expr::{ ExprPtr, Expr };
use crate::env::{ Dec... |
use crate::application::Application;
use crate::config::{APP_ID, PROFILE};
use anyhow::Result;
use adw::subclass::prelude::*;
use glib::clone;
use glib::signal::Inhibit;
use gtk::subclass::prelude::*;
use gtk::{self, prelude::*};
use gtk::{gio, glib, CompositeTemplate};
use image::io::Reader;
use image::GenericImageVie... |
//! # field
//!
//! Ssh config fields
/**
* MIT License
*
* ssh2-config - 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 wi... |
/// CHIP 8 CPU
use crate::utils;
use crate::bus::Bus;
// Mem from 0 to 0x199 is reserved
pub const PROG_START: u16 = 0x200u16;
pub struct Cpu {
st: u8, // Sound timer
dt: u8, // delay timer
pc: u16, // Program counter
idx: u16, // Memory index
v: [u8; 16], ... |
#![warn(missing_docs)]
#![warn(rust_2018_idioms)]
//! # Better Any
//!
//! Rust RFC for `non_static_type_id` feature has been reverted.
//! Which means in foreseeable future there will be no built-in way in rust to get type id for non-static type
//! let alone safely use it to downcast to a particular type.
//!
//! Thi... |
use std::collections::HashMap;
use std::collections::{HashSet, VecDeque};
use std::env;
use std::fs::File;
use std::io::{self, Write};
use std::io::{BufRead, BufReader};
use std::process;
use std::time::{SystemTime, UNIX_EPOCH};
extern crate adventofcode;
use adventofcode::*;
use std::time::{Duration, Instant};
fn g... |
//! CHIP-8 interpreter backend.
//! You can develop your own frontends for it.
//!
//! The reference frontend is
//! [crusty-chip-sfml](https://github.com/crumblingstatue/crusty-chip/tree/master/sfml).
//!
#![warn(missing_docs, trivial_casts, trivial_numeric_casts)]
use std::num::Wrapping;
use std::{error, fmt};
mod... |
// Copyright 2015-2016 <NAME>.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL... |
use crate::{
archetype::{ArchetypeComponentId, ArchetypeGeneration},
query::Access,
schedule::{ParallelSystemContainer, ParallelSystemExecutor},
world::World,
};
use async_channel::{Receiver, Sender};
use bevy_tasks::{ComputeTaskPool, Scope, TaskPool};
#[cfg(feature = "trace")]
use bevy_utils::tracing::... |
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... |
use std::{
cell::RefCell,
collections::HashMap,
io::Error as IoError,
os::unix::io::{AsRawFd, RawFd},
path::PathBuf,
rc::Rc,
sync::{
atomic::{AtomicBool, Ordering},
Arc, Mutex,
},
};
use glium::Surface as GliumSurface;
use slog::Logger;
#[cfg(feature = "egl")]
use smith... |
// Copyright (C) 2020, Cloudflare, Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list... |
//! Use a color picker as an input element for picking colors.
//!
//! *This API requires the following crate features to be activated: `color_picker`*
use iced_native::Layout;
use std::collections::HashMap;
use iced_graphics::{
backend,
canvas::{self, LineCap, Path, Stroke},
Backend, Color, Defaults, Poin... |
use keypad::Keypad;
use display::{Display, FONT_SET};
use rand::ComplementaryMultiplyWithCarryGen;
pub struct Cpu {
// index register
pub i: u16,
// program counter
pub pc: u16,
// memory
pub memory: [u8; 4096],
// registers
pub v: [u8; 16],
// th
pub keypad: Keypad,
// disp... |
extern crate aesm_client;
extern crate byteorder;
extern crate enclave_runner;
extern crate libc;
extern crate sgxs_loaders;
use self::aesm_client::AesmClient;
use self::enclave_runner::usercalls::{SyncListener, SyncStream, UsercallExtension};
use self::enclave_runner::EnclaveBuilder;
use self::sgxs_loaders::isgx::Dev... |
// 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 writ... |
use clap::Parser;
use crate::ll;
use std::path::{Path, PathBuf};
use std::collections::{HashSet, HashMap};
use anni_common::validator::*;
use serde::{Deserialize, Deserializer};
use std::rc::Rc;
use std::str::FromStr;
use serde::de::Error;
use crate::config::read_config;
use anni_flac::{FlacHeader, MetadataBlockData};
... |
// Copyright (c) 2016-2020 <NAME>
//! A hardware description language compiler.
#[macro_use]
extern crate log;
use clap::{App, Arg, ArgMatches};
use llhd;
use llhd::opt::{Pass, PassContext};
use moore::common::score::NodeRef;
use moore::errors::*;
use moore::name::Name;
use moore::score::{ScoreBoard, Sc... |
use std::io::{ErrorKind, prelude::*};
use std::io::SeekFrom;
use std::io::Error;
use super::{mem_map::{HostOS, CENTRAL_DIR_SIGNATURE, MINIMUM_SIZE_TO_COMPRESS, ZipVersion, CompressionMethod, EncryptionMethod}};
use byteorder::{LittleEndian, ByteOrder};
use super::date_time::*;
use super::zip_item::ZipItem;
#[d... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{
counters,
logging::{LogEntry, LogEvent, LogSchema},
network::MempoolSyncMsg,
shared_mempool::{
tasks,
types::{notify_subscribers, SharedMempool, SharedMempoolNotification},
},
};
use diem... |
use serde::{ Serialize, Deserialize };
use nalgebra::{ Vector3, Vector4, Matrix4 };
use rust_engine_3d::renderer::material_instance::MaterialInstanceData;
use rust_engine_3d::renderer::mesh::MeshData;
use rust_engine_3d::renderer::transform_object::TransformObjectData;
use rust_engine_3d::utilities::bounding_box::Boun... |
use std::collections::{HashMap, HashSet};
use std::fmt;
/* A function that immediately panics */
pub fn get_out () -> ! {
panic!("Uh oh!")
}
/* The logical and operation as a function on bool */
pub fn bool_and (x:bool, y:bool) -> bool {
x & y
}
/* The logical and operation as a function on bools in a pair *... |
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
use std::sync::Arc;
use crate::comments::MultiThreadedComments;
use crate::swc::ast::EsVersion;
use crate::swc::ast::Module;
use crate::swc::ast::Program;
use crate::swc::ast::Script;
use crate::swc::common::comments::SingleThreadedComments;
u... |
use byteorder::{LittleEndian, ReadBytesExt};
use modbus::tcp;
use modbus::{Client, Transport};
use std::cmp::PartialEq;
use std::env;
use std::io;
use std::io::{ErrorKind, Read};
use std::net::TcpStream;
fn main() {
// hardcode the IP address if one has not been passed in
let mut host: String = "192.168.1.87:1... |
//! File creation properties.
use std::fmt::{self, Debug};
use std::ops::Deref;
use bitflags::bitflags;
#[cfg(hdf5_1_10_1)]
use hdf5_sys::h5f::H5F_fspace_strategy_t;
use hdf5_sys::h5o::{
H5O_SHMESG_ALL_FLAG, H5O_SHMESG_ATTR_FLAG, H5O_SHMESG_DTYPE_FLAG, H5O_SHMESG_FILL_FLAG,
H5O_SHMESG_NONE_FLAG, H5O_SHMESG_P... |
use super::*;
use std::collections::HashMap;
#[derive(Debug)]
pub struct Environment<'a, 'b> {
pub current_module: &'a [String],
pub uid: &'b mut usize,
pub level: usize,
pub importable_modules: &'a HashMap<String, (Origin, Module)>,
pub imported_modules: HashMap<String, (Origin, Module)>,
// ... |
// Copyright 2019-2021 Parity Technologies (UK) Ltd.
// This file is part of substrate-subxt.
//
// subxt 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 optio... |
use std::thread;
use once_cell::sync::OnceCell;
use crate::sys::{
self, mbool, mcomplex, mint, mreal, st_WolframCompileLibrary_Functions,
st_WolframIOLibrary_Functions, st_WolframImageLibrary_Functions,
st_WolframNumericArrayLibrary_Functions, st_WolframRawArrayLibrary_Functions,
st_WolframRuntimeData... |
/*
Copyright 2016 <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, sublicense,
... |
//! Code related to parsing literals.
use crate::ast::{self, Lit, LitKind};
use crate::parse::parser::Parser;
use crate::parse::PResult;
use crate::parse::token::{self, Token, TokenKind};
use crate::print::pprust;
use crate::symbol::{kw, sym, Symbol};
use crate::tokenstream::{TokenStream, TokenTree};
use errors::{App... |
//! Functionality for evaluating *Breakpad
//! [RPN](https://en.wikipedia.org/wiki/Reverse_Polish_notation) expressions*.
//!
//! These expressions are defined by the following
//! [BNF](https://en.wikipedia.org/wiki/Backus%E2%80%93Naur_form) specification:
//! ```text
//! <rule> ::= <identifier>: <expr>
//! <as... |
#![type_length_limit = "2257138"]
#[macro_use]
extern crate actix_web;
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate tracing;
mod cache;
pub mod config;
mod count;
mod error;
mod service;
mod statics;
pub mod telemetry;
mod template;
use crate::{
cache::... |
/*
* << Haru Free PDF Library 2.0.0 >> -- text_demo.c
*
* Copyright (c) 1999-2006 <NAME> <<EMAIL>>
*
* Permission to use, copy, modify, distribute and sell this software
* and its documentation for any purpose is hereby granted without fee,
* provided that the above copyright notice appear in all copies and
* t... |
use dependencies::secp256k1;
use dependencies::hex;
use dependencies::rand;
use super::{OnionPacketVersion, OnionPacket, ValidOnionPacket, OnionRoute, Hop, HopData, BitcoinHopData, Processed};
use secp256k1::SecretKey;
use wire::{Wrapper, Satoshi};
use binformat::BinarySD;
// BOLT4_PUB_KEYS are the public keys of the... |
use std::collections::BTreeSet;
use std::convert::TryFrom;
pub fn get_paths() -> (Vec<Movement>, Vec<Movement>) {
let p1 = "R999, D666, L86, U464, R755, U652, R883, D287, L244, U308, L965, U629, R813, U985, \
R620, D153, L655, D110, R163, D81, L909, D108, L673, D165, L620, U901, R601, D561, \
... |
#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use] extern crate rocket;
extern crate serde;
#[macro_use] extern crate serde_derive;
extern crate toml;
use std::collections::HashMap;
use std::fs;
use std::path::{Path, PathBuf};
use std::ffi::OsStr;
use std::os::unix::ffi::OsStrExt;
use percent_encoding::{percen... |
//#![license = "MIT"]
extern crate rand;
extern crate piston;
extern crate graphics;
extern crate glfw_window;
extern crate opengl_graphics;
extern crate cgmath;
extern crate openal;
extern crate vorbisfile;
use std::cmp::min;
use std::f64::consts::FRAC_2_PI;
use std::i16;
use std::iter::FromIterator;
use std::iter::... |
//! # Examples
//!
//! Print a file
//!
//! ```rust,no_run
//! use ashpd::desktop::print::PrintProxy;
//! use ashpd::WindowIdentifier;
//! use std::fs::File;
//!
//! async fn run() -> ashpd::Result<()> {
//! let connection = zbus::Connection::session().await?;
//! let proxy = PrintProxy::new(&connection).await?... |
/*
* Copyright 2018 Intel Corporation
*
* 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 agre... |
// Copyright (c) 2013-2015 Sandstorm Development Group, Inc. and contributors
// Licensed under the MIT License:
//
// 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, inc... |
use std::convert::TryFrom;
use bible::OfflineBible;
use calendar::{Calendar, LiturgicalDay, LiturgicalDayId, Rank, Weekday};
use canticle_table::{CanticleId, CanticleTable};
use itertools::Itertools;
use language::Language;
use lectionary::{rcl_readings, Lectionary, RCLTrack, Reading, ReadingType};
use liturgy::*;
use... |
use alloc::{string::String, vec::Vec};
use core::{cmp, num::NonZeroUsize};
use awint_core::Bits;
use awint_internals::{SerdeError::*, *};
use crate::ExtAwi;
/// # non-`const` string representation conversion
impl ExtAwi {
// note: we use the name `..._to_vec` instead of `..._to_bytes` to avoid name
// collis... |
#![allow(clippy::type_complexity)]
#![allow(clippy::too_many_arguments)]
pub mod error;
#[cfg(feature = "hooks")]
pub mod hooks;
use std::collections::{HashMap, HashSet};
use std::convert::Infallible;
use std::fs::File;
use std::io::prelude::*;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
use s... |
// Copyright 2018 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 yaxpeax_arch::{Arch, Decoder, StandardDecodeError, U8Reader};
use yaxpeax_avr::*;
type InstDecoder = <AVR as Arch>::Decoder;
const ALL_TARGETS: [Target; 2] = [
Target { has_16_bit_lds_sts: false },
Target { has_16_bit_lds_sts: true },
];
fn test_display(data: &[u8], expected: &'static str) {
for targ... |
// Copyright (c) 2018 10x Genomics, Inc. All rights reserved.
// Copyright (c) 2021 <NAME>
use lazy_static::lazy_static;
use std::collections::{HashMap, HashSet};
use std::sync::Arc;
use crate::config::{KmerType, MEM_SIZE, REPORT_ALL_KMER, STRANDED};
use boomphf::hashmap::{BoomHashMap2, NoKeyBoomHashMap};
use debrui... |
// Copyright (C) 2018, Cloudflare, Inc.
// Copyright (C) 2018, <NAME>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyri... |
//! Helper methods to work with image data sets.
use arrayfire::*;
use image;
use image::DynamicImage;
use walkdir::{DirEntry, WalkDir};
use rand::{thread_rng, Rng};
use std::fmt;
use std::fs;
use std::io;
use std::path::Path;
use std::io::Write;
use super::{Scaling, DataSet, DataSetError};
use crate::errors::*;
use c... |
//! The `SyncManager` facilities the block syncing logic of lighthouse. The current networking
//! specification provides two methods from which to obtain blocks from peers. The `BlocksByRange`
//! request and the `BlocksByRoot` request. The former is used to obtain a large number of
//! blocks and the latter allows fo... |
use std::collections::HashMap;
use rustc_serialize::json::{self, ToJson};
// masks for pulling nibbles out of bytes
const BYTE_WIDTH: usize = 8;
const U4_LOW: u8 = 0b00001111;
const U4_HIGH: u8 = 0b11110000;
/// If the CPU enters the `Halt` state then any additional ticks will result in
/// the program ex... |
/// Defined in appendix B: THE GRAND PRODUCT ARGUMENT
use pairing::{Engine, Field, CurveAffine, CurveProjective};
use bellman::SynthesisError;
use merlin::Transcript;
use crate::{traits, transcript::ProvingTranscript};
use crate::srs::SRS;
use crate::utils::*;
use crate::polynomials::operations::mul_polynomials;
use cr... |
use crate::priv_prelude::*;
use super::*;
use futures::sync::mpsc::SendError;
/// An Ipv4 packet.
#[derive(Clone, PartialEq)]
pub struct Ipv4Packet {
buffer: Bytes,
}
impl fmt::Debug for Ipv4Packet {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let payload = self.payload();
if self.... |
/* ************************************************************************ **
** This file is part of rsp2, and is licensed under EITHER the MIT license **
** or the Apache 2.0 license, at your option. **
** **
** ... |
use std::{
borrow::Cow,
mem,
path::PathBuf,
sync::{Arc, RwLock},
time::{Duration, Instant},
};
use cgmath::{Matrix4, Ortho, Vector3, Vector4};
use glium::{
backend::glutin::Display,
draw_parameters::DrawParameters,
implement_vertex,
index::PrimitiveType,
program::Program,
te... |
/*
Advent of Code 2020
<NAME>
Day 19 Solution
2020-12-19 to 2020-12-20
Time (--release): 5m16.695s
*/
use aoc2020::util::file_to_vec;
use regex::Regex;
use std::collections::{HashMap, HashSet};
/*
SmartRegexMatcher
Specialized matcher designed for matching small strings against a set of
... |
use super::*;
use llvm_sys::core::*;
use llvm_sys::prelude::*;
use std::borrow::Cow;
use std::ffi::{CStr, CString};
use std::fmt;
use std::marker::PhantomData;
pub use llvm_sys::LLVMTypeKind as TypeKind;
pub trait AnyType<'ctx>: Copy {
fn as_ptr(self) -> LLVMTypeRef;
#[allow(clippy::missing_safety_doc)]
... |
//! Color representations.
use crate::util::{lcms_mat3_eval, lcms_mat3_per};
use cgmath::prelude::*;
use cgmath::{Matrix3, Vector3};
/// A CIE XYZ color.
#[repr(C)]
#[derive(Debug, Clone, Copy, PartialEq, Default)]
pub struct Cxyz {
pub x: f64,
pub y: f64,
pub z: f64,
}
/// A CIE xyY color.
#[repr(C)]
#[... |
/*
Copyright 2021 Picovoice Inc.
You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE"
file accompanying this source.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an ... |
use super::screen::{Screen, ScreenFetcher};
use crate::{
mem::memory::{MapsMemory, Memory},
processor::interrupt_controller::InterruptController,
};
use std::cmp::Ordering;
use std::{cell::RefCell, rc::Rc};
// LCD Control Register
const LCDC_REGISTER: u16 = 0xFF40;
// LCD Position and Scrolling
const SCY_REGI... |
//! This module simulates the CPU behaviours which relate to I/O
//! devices (connect/disconnect, the ways the IOS and TSD instructions
//! with devices).
//!
//! ## Report Word
//!
//! The Report word of I/O units looks like this:
//!
//! | Special - Mag tape | Sequence Number | Flag | Avail | Maint | Connected | E... |
// Copyright 2020-2022 <NAME>. All rights reserved.
//
// SPDX-License-Identifier: Apache-2.0
//! FUSE session management.
//!
//! A FUSE channel is a FUSE request handling context that takes care of handling FUSE requests
//! sequentially. A FUSE session is a connection from a FUSE mountpoint to a FUSE server daemon.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.