text stringlengths 9.08k 47.9k |
|---|
//
// Copyright (c) 2017 10x Genomics, Inc. All rights reserved.
//
use fxhash::FxHashMap;
use debruijn::{filter, kmer};
use debruijn::dna_string::DnaString;
use debruijn::{Exts, Dir, Kmer, Mer};
use debruijn::graph::{DebruijnGraph, Node};
use debruijn::compression::{SimpleCompress, compress_kmers};
use debruijn::Vme... |
use std::{
ffi::CStr,
io::{Error, ErrorKind},
thread::park_timeout,
time::Duration,
};
use base::{bytes_cat, mem::MemAddr, mmap::mm_file_ro};
use libc::close;
use crate::{
errs::{MetaError, MetaResult},
types::{AsBytes, BqlType, Id, IntoRef},
};
///
///## Basic designs and concepts about Part... |
use std::fmt::Debug;
use std::path::PathBuf;
use termion::event::Key;
use unicode_width::UnicodeWidthStr;
use rayon::prelude::*;
use async_value::Stale;
use crate::files::{File, Files};
use crate::fail::{HResult, HError, ErrorLog};
use crate::term;
use crate::widget::{Widget, WidgetCore};
use crate::dirty::Dirtyable... |
use bevy::prelude::*;
use bevy_egui::{egui, EguiContext, EguiPlugin, EguiSettings};
//use rand::Rng;
use rand::prelude::*;
//++++++++
//use bevy_egui::{egui::Widget};
//use bevy_prototype_lyon::prelude::*;
const BEVY_TEXTURE_ID: u64 = 0;
const BEVY_TEXTURE_ID_ONE: u64 = 1;
const BEVY_TEXTURE_ID_SECOND: u64 = 2;
/... |
#[macro_use] extern crate lazy_static;
extern crate regex;
use std::convert::TryInto;
use std::fs;
use mod_exp::mod_exp;
use modinverse::modinverse;
use regex::Regex;
fn main() {
part1();
part2();
}
fn part1() {
let input_str = fs::read_to_string("input.txt").expect("Something went wrong reading the file... |
use std::{borrow::Cow, collections::HashSet, path::Path};
use crate::{
addressresolver::AddressResolver,
mutation::{Mutation, MutationLocation},
};
use parity_wasm::elements::{
External, FunctionType, GlobalEntry, GlobalSection, GlobalType, ImportEntry, InitExpr,
Instruction, Internal, Module, Section,... |
// Copyright 2017 10x Genomics
//! Methods for minimum substring partitioning of a DNA string
//!
//! simple_scan method is based on:
//! <NAME>. "MSPKmerCounter: a fast and memory efficient approach for k-mer counting." arXiv preprint arXiv:1505.06550 (2015).
use crate::DnaSlice;
use crate::Exts;
use crate::Kmer;
us... |
use num_bigint::BigUint;
use rand::{rngs::OsRng, Rng};
use std::iter::repeat;
use crate::constants::{ELGAMAL_G, ELGAMAL_P};
use crate::crypto::math::rectify;
use crate::crypto::SessionKey;
pub struct DHSessionKeyBuilder {
dh_priv: BigUint,
dh_pub: BigUint,
}
impl DHSessionKeyBuilder {
pub fn new() -> Sel... |
// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use fuchsia_zircon as zx;
use parking_lot::{Mutex, RwLock};
use std::cmp;
use std::collections::HashSet;
use std::convert::TryFrom;
use std::ffi::CString;
... |
// Workaround for `failure` see https://github.com/rust-lang-nursery/failure/issues/223 and
// ECR-1771 for the details.
#![allow(bare_trait_objects)]
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use super::{
key::{BitsRange, ChildKind, ProofMapKey, ProofPath, KEY_SIZE},
node::{BranchNode, N... |
use std::collections::HashMap;
use osm::{NodeID, OsmID, RelationID, WayID};
use abstio::MapName;
use abstutil::{Tags, Timer};
use geom::{Distance, FindClosest, HashablePt2D, Polygon, Pt2D, Ring};
use kml::{ExtraShape, ExtraShapes};
use map_model::raw::{RawArea, RawBuilding, RawMap, RawParkingLot, RawRoad, Restriction... |
// Copyright (c) 2020 Huawei Technologies Co.,Ltd. All rights reserved.
//
// StratoVirt is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan
// PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWA... |
//! Routines for creating and manipulating 4-level x86_64 page tables
#![no_std]
extern crate alloc;
use core::mem::size_of;
use core::alloc::Layout;
/// Page table flag indicating the entry is valid
pub const PAGE_PRESENT: u64 = 1 << 0;
/// Page table flag indiciating this page or table is writable
pub const PAG... |
// TODO: make sure all this unsafe is actually okay
use std::{fs, iter, mem, slice};
use hal::memory::Properties;
use hal::prelude::*;
use hal::pso::{PipelineStage, Rect};
use hal::{buffer, command, device, format, image, memory, pass, pso, MemoryTypeId};
use imgui::{DrawCmd, DrawCmdParams, DrawData, DrawIdx, DrawVert... |
use embedded_hal::blocking::delay::DelayMs;
use usb_device::{Result, UsbDirection, UsbError};
use usb_device::bus::{UsbBusAllocator, PollResult};
use usb_device::endpoint::{EndpointType, EndpointAddress};
use crate::ral::{read_reg, write_reg, modify_reg, otg_global, otg_device, otg_pwrclk, otg_global_dieptxfx};
use cr... |
// Copyright Materialize, Inc. All rights reserved.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License... |
pub use debugid;
use debugid::{CodeId, DebugId};
use serde_json::{json, Value};
use std::collections::{BTreeMap, HashMap};
use std::path::{Path, PathBuf};
use std::cmp::Ordering;
use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH};
mod markers;
pub use markers::*;
#[derive(Debug)]
pub struct ProfileBuilder ... |
use crate::state::{account_store, poll_voter_store, read_account, read_config, read_poll, read_state, read_vault, read_vaults, state_store, vault_store, Account, Config, State, StatePool, SEC_IN_DAY};
use cosmwasm_std::{
attr, to_binary, CanonicalAddr, CosmosMsg, Decimal, Deps, DepsMut, Env, MessageInfo, Response,
... |
use std::{ffi::CString};
mod texture;
mod shader_impl;
mod types_impl;
mod query_impl;
mod buffer_impl;
use crate::sapp::*;
pub use texture::{FilterMode, Texture, TextureAccess, TextureFormat, TextureParams, TextureWrap, TextureKind};
pub(crate) use shader_impl::{ShaderInternal};
pub use shader_impl::{Shader, Shader... |
//! A dictionary-based tagger.
use crate::{types::*, utils::parallelism::MaybeParallelRefIterator};
use bimap::BiMap;
use fst::{IntoStreamer, Map, Streamer};
use log::error;
use serde::{Deserialize, Serialize};
use std::{
borrow::Cow,
cell::UnsafeCell,
fmt,
iter::{once, FusedIterator},
};
#[derive(Deb... |
#![doc = "generated by AutoRust"]
#![allow(non_camel_case_types)]
#![allow(unused_imports)]
use serde::de::{value, Deserializer, IntoDeserializer};
use serde::{Deserialize, Serialize, Serializer};
use std::str::FromStr;
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct HiveJobProperties {
#[serd... |
use bulletproofs::r1cs;
use bulletproofs::r1cs::R1CSProof;
use bulletproofs::{BulletproofGens, PedersenGens};
use curve25519_dalek::ristretto::{CompressedRistretto, RistrettoPoint};
use curve25519_dalek::scalar::Scalar;
use merlin::Transcript;
use spacesuit;
use std::iter::FromIterator;
use crate::encoding;
use crate:... |
use alt::Alt;
use preorder::Preorder;
use alt_set::{AltSet,AltSetView};
use std::result::Result;
use linear_preorders;
use precomputed::Precomputed;
use precomputed::Error as PreorderError;
use std::fmt;
use std::cmp;
use std::io::{Read,Write};
use std::iter::FromIterator;
use codec::{self,Encode,Decode};
use rpc_commo... |
/*
* Copyright (c) 2021. Aberic - 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://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law ... |
/*
This tool is part of the WhiteboxTools geospatial analysis library.
Authors: Dr. <NAME>
Created: 15/03/2018
Last Modified: 18/10/2019
License: MIT
*/
use crate::na::DMatrix;
use whitebox_raster::*;
use whitebox_common::rendering::html::*;
use whitebox_common::rendering::LineGraph;
use crate::tools::*;
use std::env;... |
use crate::{
devices,
ids::{LinkId, NodeId, PortId},
node::Perform,
nodes,
theme::{self, Theme},
Params,
};
use eframe::CreationContext;
use egui::{pos2, Visuals};
use egui_nodes::{AttributeFlags, ColorStyle, LinkArgs, NodeArgs, NodeConstructor, PinArgs};
use itertools::Itertools;
use rivulet::{... |
use std::collections::BTreeMap;
use anyhow::Result;
use bitvec::prelude::*;
use nom::{
branch::alt,
bytes::complete::{tag, take_while_m_n},
combinator::{map, map_res},
multi::many1,
IResult,
};
use smallvec::SmallVec;
// u16 because we need 257 possible values, all unsigned.
#[derive(Copy, Clone, ... |
use crate::error::Error;
use crate::qrcode::decoder::error_correction_level::ErrorCorrectionLevel;
use crate::qrcode::decoder::format_information::FormatInformation;
static VERSION_DECODE_INFO: [isize; 34] = [
0x07C94, 0x085BC, 0x09A99, 0x0A4D3, 0x0BBF6,
0x0C762, 0x0D847, 0x0E60D, 0x0F928, 0x10B78,
... |
use std::{
io,
marker::PhantomData,
ptr::NonNull,
ops::{Deref, DerefMut},
convert::{AsRef, AsMut, TryFrom},
ffi::CStr,
collections::HashMap,
};
pub mod lib;
pub use lib::*;
use super::{
from_cstr, get_cstr, htsFile, hts_err, kstring_t, Hts, HtsFile, HtsPos, HtsHdr,
HtsRead, HtsWrit... |
use crate::proof::step::Step;
use lazy_static::lazy_static;
use lsp_types::{
Diagnostic as LspDiagnostic, DiagnosticSeverity, Position, Range as LspRange,
TextDocumentContentChangeEvent,
};
use metamath_knife::diag::StmtParseError;
use metamath_knife::statement::{StatementAddress, TokenPtr};
use metamath_knife:... |
use num_enum::TryFromPrimitive;
use std::fmt;
use std::fmt::Display;
/// Length of ELF file header platform-independent identification fields
pub const EI_NIDENT: usize = 16;
/// ELF magic number byte 1
pub const ELFMAG0: u8 = 0x7f;
/// ELF magic number byte 2
pub const ELFMAG1: u8 = 0x45;
/// ELF magic number byte 3
... |
/// A RISC-V simulator baed on
/// ([the RISC-V Instruction Set Manual](https://riscv.org/specifications/),
/// Volume 1, Version, 2.1, Section 2.4).
type Register = usize;
struct Processor {
// XXX make registers just 4 bytes that are interpreted as necessary,
// e.g. SLTIU wants things treated as unsig... |
// Copyright 2016-2018 <NAME> and other GilRs Developers
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed... |
/**
* @File : quaternion2.rs
* @Author : dtysky (<EMAIL>)
* @Link : http://dtysky.moe
* @Date : 2019/2/7 下午9:53:03
*/
use wasm_bindgen::prelude::*;
use super::common::*;
use super::matrix4::*;
use super::quaternion::*;
use super::vector3::*;
#[wasm_bindgen]
pub struct Quaternion2(
pub f32,
pub f32,... |
/*
* Copyright © 2020 <NAME> <EMAIL>
*
* 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... |
mod conversions;
use crate::{
primitives::Aabb,
render_asset::{PrepareAssetError, RenderAsset},
render_resource::Buffer,
renderer::RenderDevice,
};
use bevy_core::cast_slice;
use bevy_ecs::system::{lifetimeless::SRes, SystemParamItem};
use bevy_math::*;
use bevy_reflect::TypeUuid;
use bevy_utils::EnumV... |
use crate::browser::dom::virtual_dom_bridge;
use crate::browser::{
service::routing,
util::{self, window, ClosureNew},
Url, DUMMY_BASE_URL,
};
use crate::virtual_dom::{patch, El, EventHandlerManager, IntoNodes, Mailbox, Node, Tag};
use builder::{
init::{Init, InitFn as BuilderInitFn},
IntoAfterMount... |
//! # libgit2 bindings for Rust
//!
//! This library contains bindings to the [libgit2][1] C library which is used
//! to manage git repositories. The library itself is a work in progress and is
//! likely lacking some bindings here and there, so be warned.
//!
//! [1]: https://libgit2.github.com/
//!
//! The git2-rs l... |
// Copyright 2019 Parity Technologies (UK) Ltd.
//
// 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, mer... |
#![warn(rust_2018_idioms)]
pub mod default_layout;
mod theme;
pub use self::theme::{SlotStyle, Theme};
use std::any::Any;
use std::collections::HashMap;
use std::marker::PhantomData;
#[cfg(not(feature = "scalar_i32"))]
mod scalar {
pub type Scalar = f64;
pub const ZERO: Scalar = 0.0;
pub const TWO: Sca... |
use std::collections::HashMap;
use std::num::NonZeroU32;
use std::path::Path;
use std::time::Duration;
use std::{convert::TryInto, str, u32};
use std::{sync::Arc, time::SystemTime};
use arrow::{
array::{ArrayRef, Float64Array, StringArray, TimestampNanosecondArray},
record_batch::RecordBatch,
};
use data_types... |
use rand::random;
pub const CHIP8_SCREEN_WIDTH: usize = 64;
pub const CHIP8_SCREEN_HEIGHT: usize = 32;
// Only included for documentation purposes
//pub const CHIP8_NUM_PIXELS: usize = CHIP8_SCREEN_WIDTH * CHIP8_SCREEN_HEIGHT;
pub const SCHIP8_SCREEN_WIDTH: usize = 128;
pub const SCHIP8_SCREEN_HEIGHT: usize = 64;
pub... |
use std::{convert::TryFrom, net::SocketAddr, string::FromUtf8Error, time::Duration};
#[cfg(not(feature = "tokio_async"))]
use std::net::UdpSocket;
#[cfg(not(feature = "tokio_async"))]
use std::time::Instant;
#[cfg(feature = "tokio_async")]
use tokio::net::UdpSocket;
#[cfg(feature = "tokio_async")]
use tokio::time::{s... |
//! USART(s) and LPUART
//!
//! This is an implementation of RS232 USART(s) and LPUART. The interface for the LPUART and USARTs
//! is largely the same, though their interaction with various power modes is different (see the
//! Reference Manual).
//!
//! ```rust
//! extern crate stm32l0x1_hal;
//!
//! use stm32l0x1_ha... |
use num_traits::FromPrimitive;
use crate::gameboy::interrupt::{Interrupt, InterruptHandler};
pub const SCREEN_WIDTH: u8 = 160;
pub const SCREEN_HEIGHT: u8 = 144;
#[derive(Clone, Copy, Debug, FromPrimitive)]
pub enum TileDataAddressRange {
TileDataAddr8800_97FF = 0,
TileDataAddr8000_8FFF = 1,
}
impl From<u8> ... |
use proc_macro2::{Ident, TokenStream};
use quote::quote;
use std::collections::{HashMap, HashSet};
use syn::parse::ParseBuffer;
use syn::spanned::Spanned;
#[derive(Debug)]
pub struct Class {
pub name: Ident,
pub has_class_factory: bool,
pub docs: Vec<syn::Attribute>,
pub visibility: syn::Visibility,
... |
// 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::error::*,
anyhow::{format_err, Context as _},
cm_rust::{self, NativeIntoFidl},
fidl::endpoints::{self, DiscoverableService, Se... |
// A boxed future proc-macro based off async-trait
use {
proc_macro2::{Group, Spacing, Span, TokenStream, TokenTree},
quote::ToTokens,
std::{iter::FromIterator, mem},
syn::{
parse::{Parse, ParseStream},
punctuated::Punctuated,
visit_mut::{self, VisitMut},
Attribute, Bloc... |
use std::fmt;
use num_derive::*;
// Constants from Section 3. "Symbols and abbreviated terms"
pub const MAX_CDEF_STRENGTHS: usize = 8;
pub const MAX_OPERATING_POINTS: usize = 32;
pub const MAX_TILE_COLS: usize = 64;
pub const MAX_TILE_ROWS: usize = 64;
pub const MAX_SEGMENTS: usize = 8;
pub const NUM_REF_FR... |
// Copyright © 2021
// Author: <NAME> <<EMAIL>>
// SPDX-License-Identifier: MIT
use ash::*;
use std::{borrow::Borrow, cell::RefCell, collections::HashMap, rc::Rc};
use super::*;
use imgui as im;
/// This is the one that is going to be recreated
/// when the swapchain goes out of date
pub struct Framebuffer {
// ... |
// Copyright (c) 2022 GreenYun Organization
// SPDX-License-Identifier: MIT
use std::str::FromStr;
macro_rules! response_from_str {
($s:expr $(,)?) => {{
Response::from_str($s).unwrap()
}};
}
#[tokio::test]
async fn test_hhot() {
use super::hhot::Response;
// CSV with header
let Response... |
pub mod error;
pub mod indexing;
pub mod multiverse;
pub mod persistent_sequence;
mod tally;
use self::{
error::{BlockNotFound, ExplorerError as Error},
indexing::{
Addresses, Blocks, ChainLengths, EpochData, Epochs, ExplorerAddress, ExplorerBlock,
ExplorerVote, ExplorerVotePlan, ExplorerVotePr... |
//! Methods for creating nvmf targets
//!
//! We create a default nvmf target when mayastor starts up. Then for each
//! replica which is to be exported, we create a subsystem in that default
//! target. Each subsystem has one namespace backed by the lvol.
use std::{
cell::RefCell,
ffi::{c_void, CStr, CString}... |
use std::marker::PhantomData;
use anyhow::ensure;
use bellperson::bls::{Bls12, Fr};
use bellperson::gadgets::num;
use bellperson::{Circuit, ConstraintSystem, SynthesisError};
use storage_proofs_core::{
compound_proof::{CircuitComponent, CompoundProof},
drgraph::Graph,
error::Result,
fr32::u64_into_fr,
... |
#![deny(warnings)]
#![allow(non_camel_case_types)]
#![allow(clippy::all)]
#![no_std]
mod generic;
pub use generic::*;
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - USB PHY Power-Down Register"]
pub pwd: PWD,
#[doc = "0x04 - USB PHY Power-Down Register"]
pub pwd_set: ... |
mod constant;
mod declare;
mod entry;
mod type_;
use crate::builder::{ExtInst, InstructionTable};
use crate::builder_spirv::{BuilderCursor, BuilderSpirv, SpirvConst, SpirvValue, SpirvValueKind};
use crate::decorations::{
CustomDecoration, SerializedSpan, UnrollLoopsDecoration, ZombieDecoration,
};
use crate::spirv... |
use std::fmt;
use PieceType::*;
use Color::*;
use super::movement::{Score, Position};
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum Color{
White,
Black
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum PieceType{
King,
Queen,
Bishop,
Knight,
Rook,
Pawn
}
#[de... |
///! # Code Motion / Code Placement and Global Common Subexpression Elimination
///!
///! NOTE: the built in libfirm backend for amd64 calls `place_code` (libfirm's
///! own implementation of this optimization) even when optimizations are
///! disabled. You have to either use our backend or comment out
///! line 3337 i... |
// Copyright 2020, <NAME>
// Licensed under the terms of the MIT license. See LICENSE file in project root for terms.
use core;
use core::fmt::Write;
use core::intrinsics;
use cortex_m_semihosting::hio;
use stm32f405;
#[macro_use]
use cli::*;
use ::{CALL_PAYLOAD_STASHED_CTX, LEVEL9_CLEAR_FLAG, LEVEL10_CLEAR_FLAG};
... |
use std::{fmt, iter};
use crate::ext::*;
use crate::goal_builder::GoalBuilder;
use crate::rust_ir::*;
use crate::solve::SolverChoice;
use crate::split::Split;
use crate::RustIrDatabase;
use chalk_ir::cast::*;
use chalk_ir::fold::shift::Shift;
use chalk_ir::interner::Interner;
use chalk_ir::visit::{Visit, Visitor};
use... |
use std::{
fmt, io,
path::PathBuf,
sync::atomic::{AtomicBool, AtomicU16, AtomicU64, AtomicUsize, Ordering},
time::Instant,
};
use bytecheck::CheckBytes;
use bytes::BytesMut;
use crossbeam_utils::atomic::AtomicCell;
use fslock::LockFile;
use memmap2::{MmapMut, MmapOptions};
use rkyv::{with::Atomic, Arch... |
use std::{env, fs};
use std::io::{Write};
use std::fs::File;
use std::io::Read;
use std::str;
use std::path::Path;
use std::char;
/*
SDES:
ciphertext = IP^{-1} (fk_2(SW(fk_1(IP(plaintext)))))
plaintext = IP^{-1} (fk_1(SW(fk_2(IP(plaintext)))))
where:
K_1 = P8(Shift(P10(key)))
K_2 = P8(Shift(Shift(P10(key))))
vector:... |
use std::str::FromStr;
use std::io::Write;
use strum::IntoEnumIterator;
#[allow(dead_code)]
#[derive(Copy, Clone, PartialEq, Eq, EnumString, EnumIter, Display)]
pub enum Keycode {
None = 0x00,
Escape = 0x01,
Key1 = 0x02,
Key2 = 0x03,
Key3 = 0x04,
Key4 = 0x05,
Key5 = 0x06,
Key6 = 0x07,
... |
//! The `entry` module is a fundamental building block of Proof of History. It contains a
//! unique ID that is the hash of the Entry before it, plus the hash of the
//! transactions within it. Entries cannot be reordered, and its field `num_hashes`
//! represents an approximate amount of time since the last Entry was ... |
mod tui;
use anyhow::{anyhow, bail, Result};
use dirs::home_dir;
use ipfs_api::{
response::{BlockStatResponse, FileLsResponse, IpfsHeader},
IpfsApi, IpfsClient, TryFromUri,
};
use multibase::Base;
use serde::{ser::SerializeStruct, Serialize};
use std::{
collections::HashMap,
fs::{self},
path::{Path... |
mod blend;
pub mod encoder;
mod gradient;
#[cfg(feature = "roxmltree")] mod pico_svg;
mod render_ctx;
pub mod stages;
#[cfg(feature = "roxmltree")] pub mod test_scenes;
#[cfg(feature = "swash")] mod text;
use bytemuck::Pod;
use std::convert::TryInto;
pub use blend::{Blend, BlendMode, CompositionMode};
pub use encoder... |
//! A [`Frontend`](gooey_core::Frontend) for `Gooey` that targets web browsers
//! by creating DOM elements using `web-sys` and `wasm-bindgen`.
//!
//! ## [`Window`] implementation
//!
//! The [`Window`] implementation in this frontend is limited by the browser's APIs. Of
//! note:
//!
//! - [`maximized()`](Window::max... |
use crate::{
crypto,
file_chunk_pos::{FileChunkPosition, FileChunkPositions},
queries, utils,
v1::{
bool_from_int, bool_to_int, response_payload, Expire, FileChunkLocation, FileProperties, LocationNameMetadata,
PlainResponsePayload,
},
FilenSettings, SettingsBundle,
};
use secstr... |
/// Key schedule maintenance for TLS1.3
use ring::{aead, hkdf::{self, KeyType as _}, hmac, digest};
use crate::error::TLSError;
use crate::cipher::{Iv, IvLen};
use crate::msgs::base::PayloadU8;
use crate::KeyLog;
/// The kinds of secret we can extract from `KeySchedule`.
#[derive(Debug, Clone, Copy, PartialEq)]
pub e... |
//! A general parser for command-line options.
//!
//! exa uses its own hand-rolled parser for command-line options. It supports
//! the following syntax:
//!
//! - Long options: `--inode`, `--grid`
//! - Long options with values: `--sort size`, `--level=4`
//! - Short options: `-i`, `-G`
//! - Short options with value... |
//! Unification and canonicalization logic.
use std::{fmt, iter, mem, sync::Arc};
use chalk_ir::{
cast::Cast, fold::Fold, interner::HasInterner, zip::Zip, FloatTy, IntTy, NoSolution,
TyVariableKind, UniverseIndex,
};
use chalk_solve::infer::ParameterEnaVariableExt;
use ena::unify::UnifyKey;
use hir_expand::na... |
// Copyright 2018 <NAME> <<EMAIL>>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... |
use crate::util::print_color;
use crate::{commands, dep_types::Version, util};
use flate2::read::GzDecoder;
use regex::Regex;
use ring::digest;
use std::{fs, io, io::BufRead, path::Path, process::Command};
use tar::Archive;
use termcolor::Color;
#[derive(Copy, Clone, Debug)]
pub enum PackageType {
Wheel,
Sourc... |
use self::metadata::{Metadata, ParamMetadata};
use super::{contains_decorator, DecoratorFinder};
use smallvec::SmallVec;
use std::mem::{replace, take};
use swc_common::{collections::AHashMap, util::move_map::MoveMap, DUMMY_SP};
use swc_ecma_ast::*;
use swc_ecma_transforms_base::helper;
use swc_ecma_utils::{
alias_i... |
//! JA3 Hash
//!
//! A small TLS fingerprinting library written in Rust.
//!
//! This crate enables a consumer to fingerprint the ClientHello portion of a TLS handshake.
//! It can hash TLS handshakes over IPv4 and IPv6. It heavily depends on the [tls-parser
//! project](https://github.com/rusticata/tls-parser) from Ru... |
extern crate ajson;
extern crate json;
extern crate serde_json;
use ajson::{get as ajson_get, parse, Getter, Value};
use std::env;
// #[test]
// fn test_json_rs_unicode() {
// use serde_json::Value;
// let data = r#"{"IdentityData":{"GameInstanceId":634866135153775564}}"#;
// // let a = &json::parse(dat... |
use crate::{
buffer::{
fragment_buffer::fragment::{polygon::Polygon, PolygonTag},
Cell, CellGrid, Fragment,
},
fragment::{marker_line, Bounds, Circle, Marker, MarkerLine},
util, Direction, Point,
};
use ncollide2d::{
math::Isometry,
query::point_internal::point_query::PointQuery,... |
//! Implementation of C++11-consistent weak memory emulation using store buffers
//! based on Dynamic Race Detection for C++ ("the paper"):
//! <https://www.doc.ic.ac.uk/~afd/homepages/papers/pdfs/2017/POPL.pdf>
//!
//! This implementation will never generate weak memory behaviours forbidden by the C++11 model,
//! but... |
//! Runtime call dispatcher.
use std::{
convert::TryInto,
process,
sync::{
atomic::{AtomicBool, Ordering},
Arc, Condvar, Mutex,
},
thread,
};
use anyhow::{anyhow, Result as AnyResult};
use crossbeam::channel;
use io_context::Context;
use slog::Logger;
use crate::{
common::{
... |
mod common;
mod shape;
#[cfg(test)]
mod syriac_tests {
use crate::common;
use crate::shape;
use allsorts::binary::read::ReadScope;
use allsorts::gsub::RawGlyph;
use allsorts::scripts::syriac::gsub_apply_syriac;
use allsorts::tables::cmap::CmapSubtable;
use allsorts::tables::OpenTypeFont;
... |
//! Procedural macros for the `serenity-utils` crate.
#![deny(rust_2018_idioms, unused, unused_crate_dependencies, unused_import_braces, unused_qualifications, warnings)]
use {
std::ops::RangeInclusive,
convert_case::{
Case,
Casing as _,
},
if_chain::if_chain,
itertools::Itertools ... |
use std::cell::RefCell;
use std::rc::{Rc, Weak};
use crate::constants;
use rand::prelude::*;
use sha2::{Sha256, Digest};
use chrono::DateTime;
use chrono::offset::Utc;
use std::collections::HashMap;
use crate::security::{ProtectedString, ProtectedBinary};
use crate::vdict::VariantDict;
use crate::context::Context;
use ... |
// The architecture of this runner was thought in a way that allows all
/// protocols that implement the `Protocol` trait to achieve their maximum
/// throughput. Below we detail all key decisions.
///
/// We assume:
/// - C clients
/// - E executors
/// - P protocol processes
///
/// 1. When a client connects for the ... |
// Copyright (C) 2020 - 2022, J2 Innovations
//! Haystack Def namespace
use dashmap::{mapref::one::Ref as MapReadRef, DashMap};
use std::collections::{BTreeMap, HashSet};
use super::misc::parse_multi_line_string_to_dicts;
use super::reflection::Reflection;
use crate::val::{Dict, Grid, HaystackDict, Ref, Symbol, Valu... |
// Copyright (c) 2018-2020 <NAME> <<EMAIL>>
// Distributed under the MIT License
// (See acoompanying LICENSE file or a copy at http://opensource.org/licenses/MIT)
use std::convert::TryFrom;
use hulc2envolventecte::{
collect_hulc_data,
cte::{climatedata, ClimateZone, Model},
parsers::{bdl, ctehexml, kyg, ... |
//! qrpc_build parses proto files and generates Rust code of client methods called from q.
//++++++++++++++++++++++++++++++++++++++++++++++++++//
//>> Load Libraries
//++++++++++++++++++++++++++++++++++++++++++++++++++//
use std::collections::HashSet;
use std::fmt;
use std::fs::{File, OpenOptions};
use std::io::{self... |
//! Low level access to the eMMC
use core::{
num::NonZeroU16,
sync::atomic::{self, Ordering},
};
use pac::{uSDHC2, SRC};
mod card;
mod cmd;
use core::{fmt, time::Duration};
use crate::{
memlog, memlog_flush_and_reset,
storage::{Block, ManagedBlockDevice, BLOCK_SIZE},
time::{self, Instant},
... |
//
//
// This file is a part of Aleph
//
// https://github.com/nathanvoglsam/aleph
//
// MIT License
//
// Copyright (c) 2020 Aleph Engine
//
// 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 Softwar... |
use std::{
convert, fmt, mem,
net::{IpAddr, Ipv4Addr, Ipv6Addr},
str,
sync::Arc,
};
use chrono::prelude::*;
use chrono_tz::Tz;
use crate::types::{
column::{datetime64::to_datetime, Either},
decimal::{Decimal, NoBits},
DateConverter, DateTimeType, Enum16, Enum8, SqlType, HasSqlType,
};
use... |
//! RTC peripheral abstraction
use void::Void;
use crate::{
datetime::*,
hal::timer::{self, Cancel as _},
pwr,
rcc::{APB1R1, BDCR},
stm32::{EXTI, RTC},
};
/// Interrupt event
pub enum Event {
WakeupTimer,
AlarmA,
AlarmB,
Timestamp,
}
pub enum Alarm {
AlarmA,
AlarmB,
}
im... |
// Copyright (c) 2018-2020 MobileCoin Inc.
//! Attestation Verification Report handling
use alloc::vec;
use super::json::JsonValue;
use crate::{
error::{
IasQuoteError, IasQuoteResult, JsonError, NonceError, PseManifestError,
PseManifestHashError, PseManifestResult, RevocationCause, SignatureErro... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Random Number Lower Word Readout Value"]
pub out0: OUT0,
#[doc = "0x04 - Random Number Upper Word Readout Value"]
pub out1: OUT1,
#[doc = "0x08 - Interrupt Status"]
pub irqflagstat: IRQFLAGSTAT,
#[doc = "0x0c - ... |
use crate::{
derived_state::DerivedState,
spec::{self, Frag, PartHeads, Spec},
view::View,
};
use bellframe::{place_not::PnBlockParseError, PnBlock, RowBuf};
use serde::Serialize;
use std::convert::TryFrom;
use wasm_bindgen::prelude::*;
// Imports used solely for doc comments
#[allow(unused_imports)]
use b... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{
data_notification,
data_notification::{
AccountsWithProofRequest, DataClientRequest, DataNotification, DataPayload,
EpochEndingLedgerInfosRequest, NotificationId, NumberOfAccountsRequest,
Tra... |
//! System call
use alloc::{string::String, sync::Arc, vec::Vec};
use core::{fmt, slice, str};
use bitflags::bitflags;
use rcore_fs::vfs::{FileType, FsError, INode, Metadata};
use rcore_memory::VMError;
use crate::arch::cpu;
use crate::arch::interrupt::TrapFrame;
use crate::arch::syscall::*;
use crate::process::*;
u... |
//! This crate provides a framework to set up clients and groups using the
//! OpenMLS managed_group API. To use the framework, start by creating a new
//! `TestSetup` with a number of clients. After that, `create_clients` has to be
//! called before the the `TestSetup` can be used.
//!
//! Note that due to lifetime is... |
// Copyright 2015 The GFX 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... |
use super::Felt;
use core::fmt;
mod advice;
pub use advice::AdviceInjector;
mod debug;
pub use debug::DebugOptions;
#[cfg(test)]
mod tests;
// OPERATIONS
// ================================================================================================
/// TODO: add docs
#[derive(Copy, Clone, Debug, PartialEq)]
pub... |
//! Module to generate lightmaps for surfaces.
//!
//! # Performance
//!
//! This is CPU lightmapper, its performance is linear with core count of your CPU.
//!
//! WARNING: There is still work-in-progress, so it is not advised to use lightmapper
//! now!
use crate::engine::resource_manager::{ResourceManager, TextureR... |
#[derive(Debug, PartialEq, Eq, Hash, Clone, Copy, Serialize, Deserialize)]
#[allow(non_camel_case_types, dead_code)]
pub enum Keys {
Unknown,
KEY_ESC,
KEY_1,
KEY_2,
KEY_3,
KEY_4,
KEY_5,
KEY_6,
KEY_7,
KEY_8,
KEY_9,
KEY_0,
KEY_MINUS,
KEY_EQUAL,
KEY_BACKSPACE,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.