text stringlengths 3.09k 13.9k |
|---|
use crate::thr::IntToken;
use core::{
marker::PhantomData,
ptr::{read_volatile, write_volatile},
};
const NVIC_ISER: usize = 0xE000_E100;
const NVIC_ICER: usize = 0xE000_E180;
const NVIC_ISPR: usize = 0xE000_E200;
const NVIC_ICPR: usize = 0xE000_E280;
const NVIC_IABR: usize = 0xE000_E300;
const NVIC_IPR: usize... |
use crate::app::App;
use crate::edit::EditMode;
use crate::game::{State, Transition, WizardState};
use crate::helpers::nice_map_name;
use crate::managed::{WrappedComposite, WrappedOutcome};
use crate::sandbox::gameplay::{GameplayMode, GameplayState};
use crate::sandbox::SandboxControls;
use crate::sandbox::SandboxMode;... |
//! Consensus-based block verification.
//!
//! In contrast to checkpoint verification, which only checks hardcoded
//! hashes, block verification checks all Zcash consensus rules.
//!
//! The block verifier performs all of the semantic validation checks.
//! If accepted, the block is sent to the state service for cont... |
// 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.
// All files in the project carrying such notice may not be copied, modified, or distributed
// except according ... |
use super::{Backend, Result};
use crate::object::{Object, ObjectId, ReadBuffer, ReadObject, WriteObject};
use lru::LruCache;
use std::{
fs,
path::{Path, PathBuf},
sync::{Arc, Mutex},
};
#[cfg(feature = "mmap")]
mod mmap {
use super::Result;
use std::{
fs,
path::{Path, PathBuf},
... |
//! Checker
//!
//! Trait to handle additional trackers.
//! Contains also helpers to avoid re-implementing generic
//! algorithms again and again, i.e. tokenization.
use crate::{Config, Detector, Documentation, Suggestion, SuggestionSet};
use anyhow::Result;
use crate::Range;
use log::debug;
#[cfg(feature = "hunsp... |
use macroquad::prelude::*;
use resphys::{Collider, ColliderState, AABB, FP};
// Body creation with builder assistance, event iteration and deletion of bodies
extern crate log;
use log::debug;
const FPS_INV: f32 = 1. / 60.;
type Vec2 = resphys::Vec2;
#[macroquad::main("Basic usage")]
async fn main() {
let mut p... |
mod cli;
mod collections;
mod io;
mod random;
mod time;
pub use crate::cli::CmdArgs;
pub use crate::collections::{
contains_duplicates, retain_btreemap, retain_btreeset, wraparound_get, Counter, MultiMap, Tags,
VecMap,
};
pub use crate::io::{
basename, deserialize_btreemap, deserialize_multimap, deserializ... |
use crate::sys;
use libc::c_void;
use std::marker::PhantomData;
use std::mem;
use crate::TimerSubsystem;
impl TimerSubsystem {
/// Constructs a new timer using the boxed closure `callback`.
///
/// The timer is started immediately, it will be cancelled either:
///
/// * when the timer is dropped
... |
#[macro_use]
extern crate nih_plug;
use nih_plug::{
formatters, util, Buffer, BufferConfig, BusConfig, Plugin, ProcessContext, ProcessStatus,
Vst3Plugin,
};
use nih_plug::{BoolParam, FloatParam, Params, Range, Smoother, SmoothingStyle};
use std::f32::consts;
use std::pin::Pin;
/// A test tone generator that c... |
use std::{
collections::HashMap, env, io, net::TcpListener, process::exit, str::from_utf8, sync::Arc,
};
use polling::{Event, Poller};
use tungstenite;
mod conn;
use conn::Connection;
mod bite;
use bite::Bite;
fn main() -> io::Result<()> {
println!("\nBIT:E WebSocket Proxy\n");
let server = match env::... |
use utils::{files, parse_field_unwrap};
fn main() {
let filename = "input";
let input = files::read_in_matrix_as::<usize>(filename);
let mut map: Vec<Vec<(usize, Distance)>> = input.iter().map(
|r| r.iter().map(|v| (*v, Distance::Infinite)).collect()
).collect();
println!("----- PART 1 --... |
//! Defines the `ContentTypeHeaderRouteMatcher`.
use hyper::header::{HeaderMap, CONTENT_TYPE};
use hyper::StatusCode;
use log::trace;
use mime::Mime;
use super::{LookupTable, LookupTableFromTypes};
use crate::router::route::RouteMatcher;
use crate::router::RouteNonMatch;
use crate::state::{request_id, FromState, Stat... |
///
/// Common System API benchmark functions, types, constants.
///
use criterion::{BatchSize, Criterion};
use ic_config::execution_environment::Config;
use ic_execution_environment::Hypervisor;
use ic_interfaces::{
execution_environment::{
AvailableMemory, ExecutionMode, ExecutionParameters, SubnetAvailab... |
use std::collections::BTreeMap;
use std::fs;
use std::net::AddrParseError;
use std::net::SocketAddr;
use std::ops::{Deref, DerefMut};
use std::path::Path;
use crate::conf::ConfError;
use crate::qpaxos::ReplicaId;
use serde::{Deserialize, Serialize};
/// NodeId is the global identity of a service.
/// A physical serv... |
//! This module defines the data structures and settings
//! for a 'project-generate.toml' file,
//! usually located in the root folder of a project,
//! and a 'values.toml' file, used for automated project creation.
//!
// This file is based on config.rs from cargo-generate
// source: https://github.com/cargo-genera... |
use core::ptr;
use core::slice;
use core::mem;
use syscall;
use syscall::flag::*;
use syscall::data::TimeSpec as redox_timespec;
use c_str;
use errno;
use types::*;
pub fn e(sys: Result<usize, syscall::Error>) -> usize {
match sys {
Ok(ok) => ok,
Err(err) => {
unsafe {
... |
use core::ops::Range;
use r3::kernel::{InterruptNum, InterruptPriority};
pub const INTERRUPT_PRIORITY_RANGE: Range<InterruptPriority> = 0..256;
/// `InterruptNum` for SysTick.
pub const INTERRUPT_SYSTICK: InterruptNum = 15;
/// `InterruptNum` for the first external interrupt.
pub const INTERRUPT_EXTERNAL0: Interrupt... |
use std::cell::{RefCell, RefMut};
use std::rc::Rc;
use std::time::{Instant, Duration};
use super::*;
const MAX_FPS: u32 = 60;
pub struct FPS {
max: u32,
instant: Instant,
counter: u32,
second_timer: Instant,
}
impl FPS {
pub fn new(max: u32) -> FPS {
FPS {
max: max,
... |
pub mod events;
pub mod signals;
pub mod state;
pub mod views;
pub mod widgets;
use self::events::*;
use self::state::*;
use self::views::*;
use self::widgets::*;
use crate::fl;
use gtk::{self, prelude::*};
use std::{fs::File, process, rc::Rc, sync::Arc};
const CSS: &str = include_str!("ui.css");
pub struct App {
... |
use core::fmt;
use crate::parser::lvalue::DeclType;
use crate::runtime::Variant;
use crate::runtime::strings::{StringValue, StringSymbol, StrBuffer, STRING_TABLE};
use crate::runtime::errors::{ExecResult, RuntimeError};
#[derive(Clone, Debug)]
pub struct Signature {
display: String,
name: Option<StringSymbol>... |
// Copyright 2022. The Tari Project
//
// 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 following
// di... |
use itertools::Itertools;
use rgb::RGB8;
use crate::{V2Ext, V2};
use super::{
ir::{ConcreteTextStyle, TextStyle},
ConcreteFillStyle, ConcreteStrokeStyle, Elem, FillStyle, Image, LoweredElem, LoweredImage,
LoweredStyle, StrokeStyle, Style, TextAnchor,
};
/// 'Lower' an [`Image`] to a [`LoweredImage`] - i.... |
//! Small tracked parts of the application state. Includes **window**, **keys**, **mouse**, and
//! **time** - each of which are stored in the **App**.
pub use self::keys::Keys;
pub use self::mouse::Mouse;
pub use self::time::Time;
pub use self::window::Window;
/// Tracked state related to the focused window.
pub mod... |
use packets::icmp::v6::{Icmpv6, Icmpv6Packet, Icmpv6Payload, Icmpv6Type, Icmpv6Types, NdpPayload};
use packets::ip::v6::Ipv6Packet;
use std::fmt;
use std::net::Ipv6Addr;
/* From https://tools.ietf.org/html/rfc4861#section-4.4
Neighbor Advertisement Message Format
0 1 2 ... |
// Copyright 2019 The vault713 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 a... |
use std::fs::File;
use std::io::prelude::*;
use std::str::FromStr;
use std::fmt;
use std::collections::HashMap;
use rocket::fairing::AdHoc;
use toml;
use serde::de::{self, Deserialize, Deserializer, Visitor};
use nav::Link;
/// This struct is used to hold meta data for contexts to be passed to [`Template::render`]
/... |
use log::{error, trace};
use std::fmt;
use std::io::Read;
use std::num::Wrapping;
use crate::{Class, Error, Id};
pub enum Frame {
Txt(String),
Ublox(Ublox),
}
#[derive(Debug, Copy, Clone, PartialEq)]
pub enum State {
Sync1,
Sync2,
Class,
Id,
LengthLow,
LengthHigh,
Payload,
Che... |
// Twelve days of Christmas song generator
/* ORIGINAL LYRICS
On the first day of Christmas my true love gave to me
A partridge in a pear tree
On the second day of Christmas my true love gave to me
Two turtle doves and a partridge in a pear tree
On the third day of Christmas my true love gave to me
Three French hen... |
//! [F16C intrinsics].
//!
//! [F16C intrinsics]: https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=fp16&expand=1769
use crate::{
core_arch::{simd::*, x86::*},
hint::unreachable_unchecked,
mem::transmute,
};
#[cfg(test)]
use stdsimd_test::assert_instr;
#[allow(improper_ctypes)]
extern "u... |
#![allow(missing_docs)]
use crate::{
error::AudiusProgramError,
state::{VerifiedMessage, TOTAL_VERIFIED_MESSAGES},
vote_message,
};
use solana_program::{
account_info::AccountInfo,
entrypoint::ProgramResult,
program::{invoke, invoke_signed},
program_error::ProgramError,
program_pack::IsI... |
extern crate diesel;
extern crate dotenv;
extern crate select;
extern crate newsinboundr_db;
use newsinboundr_db::db::models::SourceHttp;
use newsinboundr_db::db::schema::NewsSourceType;
use newsinboundr_db::create_news;
use dotenv::dotenv;
use std::env;
use std::vec::Vec;
use std::fmt::Error;
use futures::future::joi... |
use anyhow::Result;
use clap::{
app_from_crate, crate_authors, crate_description, crate_name, crate_version,
AppSettings, Arg,
};
use std::{f64, path::Path, str::FromStr, time::Duration};
use osm_tile_downloader::*;
const BBOX_NORTH_ARG: &str = "BBOX_NORTH";
const BBOX_SOUTH_ARG: &str = "BBOX_SOUTH";
const BB... |
// Copyright (c) 2020-2021 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0
//
// The VSOCK Exporter sends trace spans "out" to the forwarder running on the
// host (which then forwards them on to a trace collector). The data is sent
// via a VSOCK socket that the forwarder process is listening on. To allow... |
use libc::*;
use *;
pub const OCSP_REVOKED_STATUS_NOSTATUS: c_int = -1;
pub const OCSP_REVOKED_STATUS_UNSPECIFIED: c_int = 0;
pub const OCSP_REVOKED_STATUS_KEYCOMPROMISE: c_int = 1;
pub const OCSP_REVOKED_STATUS_CACOMPROMISE: c_int = 2;
pub const OCSP_REVOKED_STATUS_AFFILIATIONCHANGED: c_int = 3;
pub const OCSP_REVOK... |
//! ADS-B Simulator - see README.md
//
// © NewForester, 2018. Available under MIT licence terms.
//
//! The mavlink module declares a trait to ensure MAVLink messages are handled
//! consistently and provide DRY code as appropriate.
//!
//! The two most important traits are:
//!
//! * serialise - message ready for t... |
use structopt::StructOpt;
use crate::command::{self, Command};
use volta_core::layout;
use volta_core::session::Session;
use volta_fail::{ExitCode, Fallible};
#[derive(StructOpt)]
#[structopt(
name = "Volta",
about = "The JavaScript Launcher ⚡",
author = "",
long_about = "The JavaScript Launcher ⚡
... |
#[macro_use]
extern crate clap;
#[macro_use]
extern crate log;
use std::{
error::Error,
io::{BufWriter, Write},
net::{SocketAddr, TcpStream, UdpSocket},
sync::{
mpsc::{self, Receiver, SyncSender},
Arc,
},
thread,
time::Duration,
};
use clap::{App, AppSettings, Arg, SubComma... |
use crate::puzzle::{Info, Puzzle};
use regex::Regex;
use std::collections::HashMap;
use std::fs::File;
use std::io::{BufRead, BufReader};
pub struct Day14 {}
#[derive(Debug)]
pub enum Instr {
Mask(HashMap<i32, i32>),
Mem(i64, i64),
}
impl Puzzle for Day14 {
type InputType = Vec<Instr>;
type T1 = i64;... |
use std::error::Error as StdError;
use std::fmt;
use nom::error::VerboseErrorKind;
use thiserror::Error;
use crate::parse::{ErrType, Position, Span};
pub type BoxError = Box<dyn StdError + 'static>;
/// Error type for expression evaluation
///
/// If in doubt use either [`EvalError::CallError`] or, if passing throu... |
// c:dLbls
use super::ShowLegendKey;
use super::ShowValue;
use super::ShowCategoryName;
use super::ShowSeriesName;
use super::ShowPercent;
use super::ShowBubbleSize;
use super::ShowLeaderLines;
use writer::driver::*;
use quick_xml::Reader;
use quick_xml::events::{Event, BytesStart};
use quick_xml::Writer;
use std::io::... |
use std::collections::HashMap;
use gimli::{
write::{EndianVec, Writer},
DebugStrOffsetsBase, DebugStrOffsetsIndex, DwarfFileType, Encoding, EndianSlice, Format,
};
use indexmap::IndexSet;
use tracing::debug;
use crate::{
error::{Error, Result},
ext::PackageFormatExt,
};
/// New-type'd index from `Ind... |
use std::iter;
use num::Float;
use na;
use ncollide::utils::data::hash_map::HashMap;
use ncollide::utils::data::hash::UintTWHash;
use world::RigidBodyCollisionWorld;
use detection::constraint::Constraint;
use detection::joint::{JointManager, Joint};
use object::{RigidBody, RigidBodyHandle, ActivationState};
use utils::... |
/**
* Generic Plotter
*
* A generic heatmap generator for use in big data environments when
* files get large enough that you cannot hold the whole thing in memory
*
* GNU GPL v2+
*
* 2020, <NAME> <<EMAIL>>
* Institute for Clinical Molecular Biology
* University Hospital Schleswig-Holstein Kiel, Germany
*/
... |
use graph::{Graph,GraphNode};
use std::collections::{HashMap,HashSet};
pub trait SearchStrategy {
fn solve(&self, graph: &Graph, start: (isize,isize), end: (isize,isize)) -> Option<Vec<(isize,isize)>>;
}
pub struct AStarSearch {
heuristic: fn(&GraphNode,&GraphNode) -> f32
}
// functionality unique to AStar
impl AS... |
// Copyright 2017 Mozilla Foundation. 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 http://op... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Channel Configuration register"]
pub chcfg0: crate::Reg<chcfg0::CHCFG0_SPEC>,
#[doc = "0x01 - Channel Configuration register"]
pub chcfg1: crate::Reg<chcfg1::CHCFG1_SPEC>,
#[doc = "0x02 - Channel Configuration register"... |
//! The pronunciation dictionary from Carnegie Mellon University's CMUSphinx project
#![deny(missing_docs)]
use std::{io::Cursor, fs::File};
use std::io::{BufRead, BufReader};
use std::path::Path;
use std::str::FromStr;
use std::{collections::HashMap};
#[cfg(feature = "serde")]
use serde::{Serialize, Deserialize};
mo... |
use arrayvec::Array;
use arrayvec::ArrayVec;
use buffer;
use common::digest::Sha256;
use common::num::Cast;
use common::num::LeI32;
use huffman::instances::TEEWORLDS as HUFFMAN;
use packer::with_packer;
use std::mem;
use uuid::Uuid;
use bitmagic::WriteCallbackExt;
use format::Chunk;
use format::ChunkHeader;
use format... |
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2018, the Perspective Authors.
//
// This file is part of the Perspective library, distributed under the terms
// of the Apache License 2.0. The full license can be found in the LICENSE
// file.
use crate::components:... |
mod error;
use clap;
use env_logger::Builder;
use log::LevelFilter;
use nmstate::NetworkState;
use serde::Serialize;
use serde_yaml::{self, Value};
use crate::error::CliError;
const SUB_CMD_GEN_CONF: &str = "gc";
const SUB_CMD_SHOW: &str = "show";
const SUB_CMD_APPLY: &str = "apply";
fn main() {
let matches = c... |
use librad::canonical::Canonical as _;
use librad::git::tracking::git::odb;
use librad::git::tracking::git::odb::Read as _;
use librad::git::tracking::git::refdb;
use librad::git::tracking::reference::RefName;
use librad::git::tracking::Config;
use librad::git_ext::RefspecPattern;
use librad::git_ext::{is_not_found_err... |
// Unless explicitly stated otherwise all files in this repository are licensed
// under the MIT/Apache-2.0 License, at your convenience
//
// This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2020 Datadog, Inc.
//
use crate::io::{
dma_file::{DmaFile, Result},
BufferedF... |
#![cfg_attr(not(test), no_std)]
#![doc = include_str!("../README.md")]
use serde::{Deserialize, Serialize};
/// Indicates where data is sourced from i.e. its direction.
#[derive(Debug, Deserialize, PartialEq, Serialize)]
pub enum DataSource {
Client,
Server,
}
/// There was an error parsing the data frame. P... |
//! STLink commands module
pub mod swd {
pub const AP_WAIT : u8 = 0x10;
pub const AP_FAULT : u8 = 0x11;
pub const AP_ERROR : u8 = 0x12;
pub const AP_PARITY_ERROR : u8 = 0x13;
pub const DP_WAIT : u8 = 0x14;
pub const DP_FAULT : u8 = 0x15;
pub const DP_... |
use sdl2::{
event::Event,
image::{InitFlag, LoadSurface, Sdl2ImageContext},
pixels::Color,
rect::{Point, Rect},
render::{Canvas, RenderTarget, Texture, TextureCreator},
surface::Surface,
ttf::{Font, Sdl2TtfContext},
video::Window,
Sdl,
};
use std::path::Path;
const WIDTH: u32 = 640;... |
use crate::ast::{ Ast
, FunParam
, ConsDef
};
use super::input::{Input, ParseError};
use super::util::{ parse_symbol
, parse_params
, keyword
, maybe
, punct
, fatal
, f... |
#![warn(clippy::all)]
#![allow(clippy::many_single_char_names)]
use image::ColorType::RGBA;
use image::{ImageBuffer, Rgba, RgbaImage};
use std::{
cmp::Ordering,
env::args,
fs::{create_dir, File},
io::{stdin, Write},
path::Path,
};
use walkdir::WalkDir;
mod tilesheets;
type FloatImage = ImageBuffe... |
use asset::scene;
use cgmath::{
perspective, vec2, vec3, Deg, Matrix3, Matrix4, SquareMatrix, Transform, Vector2, Vector3,
Vector4, Zero,
};
use crate::{graphics::structures::CameraMatrices, math::Ray};
pub struct Camera {
position: Vector3<f32>,
rotation: Vector2<f32>,
projection: Matrix4<f32>,
... |
use crate::core_compat::entity::rmd_type::RmdType;
use crate::core_compat::entity::sprite_type::SpriteType;
use crate::game::Game;
use crate::geometry::point::Point;
use crate::geometry::rectangle::Rectangle;
use crate::resource_manager::list_manager::ListType;
use crate::sdl2::rect::Rect;
use crate::sdl::Sdl;
use crat... |
//! A series of constant strings used to communicate with DBus and Bluez.
use rustbus::params;
use rustbus::params::{Base, Container, Param};
use std::collections::HashMap;
pub const PROP_IF_STR: &str = "org.freedesktop.DBus.Properties";
pub const OBJ_MANAGER_IF_STR: &str = "org.freedesktop.DBus.ObjectManager";
pub co... |
use std::{path::Path};
use rusqlite::{Connection, NO_PARAMS};
use url::Url;
use utils::{is_git_repo, pathbuf_filename_to_string, pathbuf_to_string};
use interface::{
RepositoriesEmitter, RepositoriesList, RepositoriesTrait
};
#[derive(Default, Clone)]
pub struct RepositoriesItem {
id: i64,
current: bool,
... |
mod btree;
mod buffer;
mod epoch;
#[allow(non_snake_case, unused_imports)]
mod operation_queue;
mod serialization;
pub mod time;
mod work_tree;
pub use crate::buffer::{Buffer, Change, Point};
pub use crate::epoch::{Cursor, DirEntry, Epoch, FileStatus, FileType, ROOT_FILE_ID};
pub use crate::work_tree::{
BufferId, ... |
use std::{cmp, mem};
use std::cmp::Ordering;
/// Calculate an approximate median of `array`.
///
/// The return value is the index/reference to some value of `array`
/// that is guaranteed to lie between the 30th and 70th percentiles of
/// the values in `array`. That is, it both is not smaller and not
/// larger than... |
use std::{backtrace::Backtrace, path::PathBuf};
use crate::{buf::ReadError, decoder::DecodeError};
/// Result wrapper for [`CacheError`].
pub type CacheResult<T> = Result<T, CacheError>;
/// An error type for things that can go wrong when reading from the cache.
pub enum CacheError {
/// Wraps [`sqlite::Error`].
... |
use chrono::{Datelike, NaiveDate};
use druid::{
BoxConstraints, Data, Env, Event, EventCtx, KeyOrValue, LayoutCtx, LifeCycle, LifeCycleCtx,
PaintCtx, Point, Size, UpdateCtx, Widget, WidgetPod,
};
const DAY_COUNT: usize = 5 * 7;
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy)]
pub struct YearAndMonth {
... |
use std::collections::BTreeMap;
use serde::Serialize;
use serde::de::DeserializeOwned;
use serde_json::{self, Value};
use serde_json::error::Error as JsonError;
/// Helper macro to simplify the creation of complex statements
///
/// Pass in the statement text as the first argument followed by the (optional) parameters... |
//! Nonce related functionality.
//!
//! This includes serialization and deserialization.
use std::convert::Into;
use std::io::Write;
use byteorder::{BigEndian, ByteOrder};
use rust_sodium::crypto::{box_, secretbox};
use crate::errors::{SignalingError, SignalingResult};
use super::cookie::Cookie;
use super::csn::Co... |
#[cfg(feature = "std")]
extern crate std;
use std::{
cell::RefCell,
convert::TryInto,
fmt,
io,
num::{NonZeroU64, NonZeroU8},
vec::Vec,
string::String
};
use crate::qmap;
use crate::qmap::Result;
const TEXT_CAPACITY: usize = 32;
#[derive(Debug, Clone)]
pub struct Token {
pub text: Vec... |
use std::{
collections::HashSet,
net::{Ipv4Addr, SocketAddr, SocketAddrV4},
time::{Duration, Instant},
};
use log::debug;
use crate::{
multiaddr::Multiaddr,
utils::{is_reachable, multiaddr_to_socketaddr},
};
#[cfg(not(windows))]
use self::unix::get_local_net_state;
#[cfg(windows)]
use self::windo... |
use std::io::Error as IoError;
use std::string::FromUtf8Error;
use std::process::{Command, Stdio};
use tracing::{instrument, warn};
use thiserror::Error;
use serde::Deserialize;
use flv_util::cmd::CommandExt;
#[derive(Error, Debug)]
pub enum HelmError {
#[error(
r#"Unable to find 'helm' executable
Pleas... |
use regex::Regex;
use std::collections::HashMap;
use std::collections::HashSet;
use std::iter::FromIterator;
pub type Passport = HashMap<String, String>;
/// a trait that exposes methods to validate the passport for part1 and part2
pub trait ValidatePassport {
/// method that validates a passport based on p1 crit... |
use super::OauthError;
use crate::core::{error::AppError, AppState};
use actix_session::Session;
use actix_web::http::header::LOCATION;
use actix_web::http::StatusCode;
use actix_web::web::{Data, Form, Query};
use actix_web::Error;
use actix_web::{HttpResponse, Responder, Result};
use std::collections::HashSet;
/// GE... |
//! Token types outputted by lexing.
use crate::Span;
use smol_str::SmolStr;
use std::{convert::TryFrom, fmt};
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum TokenType {
LeftParen, // (
RightParen, // )
LeftBracket, // [
RightBracket, // ]
LeftBrace, // {
RightBrace, // }
... |
//! Configuration related to the various character-separated formats, like CSV.
use super::{EncodingRef, ErrorThreshold};
use schemars::{
gen::SchemaGenerator,
schema::{InstanceType, Schema, SchemaObject},
JsonSchema,
};
use serde::{de, ser, Deserialize, Serialize};
use std::convert::TryFrom;
/// A single ... |
//! Tool to vet mqtt brokers. The goal here is to test and benchmark
//! mqtt brokers for features, robustness, performance and scalability
//!
//! Goals of the test suite
//!
//! - Spawn n clients with publish and subscribe on the same topic (and report thoughput and latencies)
//! - Spawn n clinets with publishes and... |
use ndarray::prelude::*;
use polars::prelude::*;
use rand::prelude::*;
fn random_shuffle(matrix: &mut Array2<f64>) {
let mut rng = thread_rng();
for i in 1..matrix.nrows() {
let mut it = matrix.outer_iter_mut();
let j = rng.gen_range(0..i);
ndarray::Zip::from(it.nth(j).unwrap())
... |
// Copyright (c) 2021 ESRLabs
//
// 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... |
use super::image::*;
use super::factory::*;
use super::super::gtk_event::*;
use super::super::gtk_thread::*;
use super::super::gtk_action::*;
use super::super::widgets::custom_style::*;
use super::super::widgets::proxy_widget::*;
use flo_ui::*;
use gtk;
use gtk::prelude::*;
use std::rc::*;
lazy_static! {
/// Ha... |
use mjtools::shanten::*;
use mjtools::types::*;
use std::collections::{HashMap, HashSet};
use std::fs::File;
use std::io::{BufRead, BufReader};
#[test]
fn test_shanten_problems() {
let problem_files = [
"./data/p_hon_10000.txt",
"./data/p_koku_10000.txt",
"./data/p_normal_10000.txt",
... |
// 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 writing,... |
//! Note: This crate is considered internal API of the `json_typegen` tools. If you want to use this
//! crate directly, be prepared for breaking changes to happen, and consider
//! [opening an issue](https://github.com/evestera/json_typegen/issues/new)
//! to let me know what you are using.
//! (Breaking changes will ... |
use crate::exporter::Exporter;
use pyo3::{pyclass, pymethods, PyResult, Python};
use sabi_resources::Singleton;
use sabi_binarizer::Binarizer;
use sabi_core::App;
use sabi_nodes::{LogicNodeRegistry, NodeType};
use sabi_resources::{DATA_FOLDER, DATA_RAW_FOLDER};
use std::{
env,
io::Write,
net::{Shutdown, T... |
use actix_web::{server, App, middleware, Path, fs, http::Method};
use super::config;
use std::io;
use std::io::{BufRead, BufReader};
use std::fs::{OpenOptions, create_dir_all, remove_file, File};
use std::path;
use reqwest;
use futures_cpupool::CpuPool;
use std::sync::mpsc;
use std::thread;
use glob::glob;
use serde_js... |
use crate::vector::{Vector3, pick_in_circle};
use crate::world::World;
use crate::image::Image;
use crate::color::RGB;
use crate::ray::Ray;
use crate::background::Background;
use rand_core::SeedableRng;
use rand::Rng;
pub struct Camera {
location: Vector3,
lower_left: Vector3,
horizontal: Vector3,
... |
use ckb_chain_spec::consensus::ConsensusBuilder;
use ckb_mock_tx_types::{MockResourceLoader, MockTransaction, ReprMockTransaction, Resource};
use ckb_script::{ScriptGroupType, TransactionScriptsVerifier, TxVerifyEnv};
use ckb_types::{
bytes::Bytes,
core::{
cell::resolve_transaction, hardfork::HardForkSw... |
use nom::branch::alt;
use nom::bytes::complete::{take_till, take_while, take_while1};
use nom::character::complete::{char, multispace0};
use nom::combinator::cut;
use nom::sequence::{delimited, terminated};
use crate::error::NomErrorExt;
use crate::{parse_geo_point, parse_geo_radius, Error, ErrorKind, IResult, Span, T... |
#![allow(warnings)]
use core::convert::TryInto;
use rustBoot::dt::{
correct_endianess, patch::*, Error, PropertyValue, RawNodeConstructor, RawPropertyConstructor,
Reader, Result, StringsBlock, StructItem, TOKEN_SIZE,
};
use std::fs;
use std::io::Read;
fn main() {
let mut buf = Vec::new();
let mut fil... |
pub mod protocol;
use cardano::util::hex;
use std::io::{Read, Write};
use std::{error, fmt, io, iter, result};
pub use self::protocol::{LightweightConnectionId, LIGHT_ID_MIN};
#[derive(Debug)]
pub enum Error {
IOError(io::Error),
UnsupportedVersion,
InvalidLightid,
InvalidRequest,
CrossedRequest,... |
use json::object;
use maud::{html, PreEscaped, DOCTYPE};
use std::fs;
use crate::{entry::Entry, error::Result, handlers::SolomonAmpHandler};
pub fn write(entries: &[Entry]) -> Result<()> {
match entries.len() {
0 => {}
1 => {
write_amp(&entries[0], None, None)?;
}
len @... |
#![feature(iterator_step_by)]
use std::process::Command;
use std::io;
use std::io::prelude::*;
use std::mem;
use std::u8;
use std::fmt;
use std::collections::HashSet;
const HASHER_PATH: &str = "../day10/target/release/day10";
struct Grid {
grid: [[bool; 128]; 128],
}
impl fmt::Display for Grid {
fn fmt(&... |
use std::io::Error;
use std::ptr::null_mut;
use super::volume::Volume;
use super::winioctl::{USN_JOURNAL_DATA, CREATE_USN_JOURNAL_DATA, MFT_ENUM_DATA, USN_RECORD};
use winapi::shared::minwindef::{DWORD, LPDWORD, LPVOID};
use winapi::shared::ntdef::USN;
use winapi::um::ioapiset::DeviceIoControl;
use winapi::um::winioc... |
use std::slice;
use elf::{program_header, dyn, reloc};
use utils;
#[cfg(target_arch = "x86_64")]
pub const DTPMOD64: u32 = reloc::R_X86_64_DTPMOD64;
#[cfg(target_arch = "x86_64")]
pub const RELATIVE: u32 = reloc::R_X86_64_RELATIVE;
#[cfg(target_arch = "x86_64")]
pub const IRELATIVE: u32 = reloc::R_X86_64_IRELATIVE;
#... |
//! DML data types
#![deny(rustdoc::broken_intra_doc_links, rustdoc::bare_urls, rust_2018_idioms)]
#![warn(
missing_copy_implementations,
missing_debug_implementations,
missing_docs,
clippy::explicit_iter_loop,
clippy::future_not_send,
clippy::use_self,
clippy::clone_on_ref_ptr
)]
use hash... |
#[macro_use]
extern crate clap;
use std::path::Path;
use crate::conv::{binary_parser, xyz_parser, text_parser, dump_parser};
mod ans;
mod diff;
mod xyz;
mod conv;
fn main() {
use clap::App;
let yml = load_yaml!("cli.yaml");
let matches = App::from(yml)
.setting(clap::AppSettings::ArgRequiredEls... |
use linfa::Float;
use ndarray_rand::rand::{Rng, SeedableRng};
use rand_isaac::Isaac64Rng;
#[cfg(feature = "serde")]
use serde_crate::{Deserialize, Serialize};
#[cfg_attr(
feature = "serde",
derive(Serialize, Deserialize),
serde(crate = "serde_crate")
)]
#[derive(Clone, Debug, PartialEq)]
/// The set of hyp... |
use crate::frustum_culling::{collect_visible_objects, PackedBoundingSphereChunk};
use crate::geometry::{BoundingSphere, Transform};
use crate::internal::VisibilityWorld;
use crate::{Projection, ViewFrustum};
use crossbeam_channel::{unbounded, Receiver, Sender};
use glam::Vec3;
use parking_lot::{Mutex, MutexGuard, RwLoc... |
pub use super::*;
use std::convert::TryFrom;
#[derive(Default)]
pub struct UpgradeGUI;
impl<'a> System<'a> for UpgradeGUI {
type SystemData = (
(
Entities<'a>,
ReadStorage<'a, CharacterMarker>,
WriteStorage<'a, ShipStats>,
WriteStorage<'a, MultyLazer>,
... |
use druid::kurbo::{Point, RoundedRect, Size};
use druid::theme;
use druid::widget::Label;
use druid::{
Affine, BoxConstraints, Color, Data, Env, Event, EventCtx, Insets, LayoutCtx, LifeCycle, LifeCycleCtx, LinearGradient,
MouseEvent, PaintCtx, Rect, RenderContext, UnitPoint, UpdateCtx, Widget,
};
use std::fmt::Displa... |
// Copyright 2022 <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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.