text
stringlengths
7.05k
33.9k
// Copyright 2018 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...
use core::fmt; use crate::{Error, Result}; enum_with_unknown! { /// IPv6 Extension Header Option Type pub enum Type(u8) { /// 1 byte of padding Pad1 = 0, /// Multiple bytes of padding PadN = 1 } } impl fmt::Display for Type { fn fmt(&self, f: &mut fmt::Formatter) -> f...
use std::ffi::OsStr; use std::fs::{FileType, Metadata}; use std::io; use std::mem; use std::path::{Path, PathBuf}; use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::mpsc::{channel, Receiver, RecvTimeoutError, Sender}; use std::sync::{Arc, Mutex}; use std::thread; use std::time::{Duration, Instant}; use std:...
//! Assorted testing utilities. //! //! Most notable things are: //! //! * Rich text comparison, which outputs a diff. //! * Extracting markup (mainly, `$0` markers) out of fixture strings. //! * marks (see the eponymous module). pub mod bench_fixture; mod fixture; mod assert_linear; use std::{ collections::BTree...
use std::fmt; use owo_colors::{OwoColorize, Style}; use crate::chain::Chain; use crate::printer::theme::*; use crate::protocol::{Diagnostic, DiagnosticReportPrinter, DiagnosticSnippet, Severity}; use crate::{SourceSpan, SpanContents}; /** A [DiagnosticReportPrinter] that displays a given [crate::DiagnosticReport] in...
use std::io::Seek; use crate::{types, Error}; use crossbeam_channel as cc; const RPC_VERSION: u32 = 1; #[derive(Clone, Copy, Debug, Eq, PartialEq)] #[repr(u32)] pub(crate) enum OpCode { Handshake = 0, Frame = 1, Close = 2, Ping = 3, Pong = 4, } /// Message immediately sent to Discord upon establ...
/// # `specs-hierarchy` /// /// Scene graph type hierarchy for use with Specs. /// /// ## `Parent` /// /// This crate uses a generic parameter `P` for the parent component. Its bound by the `Parent` /// trait that only requires a getter for the `Entity` that's the parent. /// /// ## Usage /// /// ```rust /// # extern c...
//! Relay cell cryptography //! //! The Tor protocol centers around "RELAY cells", which are //! transmitted through the network along circuits. The client that //! creates a circuit shares two different set of keys and state with //! each of the relays on the circuit: one for "outbound" traffic, and //! one for "inbo...
use nu_engine::eval_call; use nu_parser::{flatten_expression, parse, trim_quotes, FlatShape}; use nu_protocol::{ ast::{Call, Expr}, engine::{EngineState, Stack, StateWorkingSet}, PipelineData, Span, Value, CONFIG_VARIABLE_ID, }; use reedline::Completer; const SEP: char = std::path::MAIN_SEPARATOR; pub str...
use clippy_utils::diagnostics::span_lint; use clippy_utils::trait_ref_of_method; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_hir::intravisit::nested_filter::{self as hir_nested_filter, NestedFilter}; use rustc_hir::intravisit::{ walk_fn_decl, walk_generic_param, walk_generics, walk_impl_item_re...
use std::{collections::HashMap, convert::TryInto, fmt, future::Future, pin::Pin, rc::Rc}; use actix_utils::future::{ready, Ready}; use actix_web::{ body::MessageBody, cookie::{Cookie, CookieJar, Key, SameSite}, dev::{forward_ready, ResponseHead, Service, ServiceRequest, ServiceResponse, Transform}, htt...
// Copyright 2020 - <NAME> <<EMAIL>> // SPDX-License-Identifier: Apache-2.0 use fs::OpenOptions; use io::BufReader; use ipnetwork::IpNetwork; use publicsuffix::{errors, List}; use std::collections::HashSet; use std::fs; use std::fs::File; use std::io; use std::io::BufRead; use std::net::{IpAddr, SocketAddr}; use std::...
//! Bluetooth session. use dbus::{ arg::Variant, message::MatchRule, nonblock::{ stdintf::org_freedesktop_dbus::{ ObjectManagerInterfacesAdded, ObjectManagerInterfacesRemoved, PropertiesPropertiesChanged, }, SyncConnection, }, strings::BusName, Message, }; us...
use std::f32::consts::PI; use std::fs::File; use std::io::{BufReader, Read}; use std::path::Path; use anyhow::*; use byteorder::{NativeEndian, ReadBytesExt}; use log::info; use num::zero; use crate::bsdf::{BxDF, BxDFType}; use crate::geometry::{cos_theta, sin2_theta}; use crate::interpolation::{catmull_rom_weights, f...
//! Rapid early-ramdisk system initialization, accompanying initramfs generator. **CURRENTLY IN DEVELOPMENT** //! //! # What? //! ignited is a simple program meant to run before your Linux system partition has even been //! mounted! It is intended to run inside your initramfs and bring your system to a usable //! state...
// Copyright Materialize, Inc. and contributors. All rights reserved. // // Use of this software is governed by the Business Source License // included in the LICENSE file. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by ...
// Copyright 2014 The Servo Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution. // // 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 ...
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may...
#[cfg(feature = "clap")] use clap::ArgEnum; #[cfg(feature = "enumset")] use enumset::EnumSetType; #[cfg(feature = "serde")] use serde::{Deserialize, Serialize}; use std::fmt::Formatter; use strum::{Display, EnumCount, EnumIter}; use enum_map::Enum; use derivative::Derivative; #[derive(Copy, Clone, Debug, Display, Enum...
use algebra::{ BigInteger768, fields::mnt4753::Fr as MNT4Fr, curves::mnt6753::G1Projective as MNT6G1Projective, ProjectiveCurve, Field, PrimeField, ToBits }; use primitives::{ signature::{ schnorr::field_based_schnorr::{FieldBasedSchnorrSignature, FieldBasedSchnorrSignatureScheme}, ...
#![recursion_limit = "1024"] #[macro_use] extern crate error_chain; #[macro_use] extern crate log; extern crate env_logger; #[macro_use] extern crate clap; extern crate chrono; extern crate rouille; #[cfg(feature="update")] extern crate self_update; extern crate walkdir; use std::env; use std::time; use std::fs; use ...
// Copyright (c) The Starcoin Core Contributors // SPDX-License-Identifier: Apache-2.0 use anyhow::Result; use futures::channel::mpsc; use futures::future::AbortHandle; use futures::StreamExt; use jsonrpc_pubsub::typed::Subscriber; use jsonrpc_pubsub::SubscriptionId; use parking_lot::RwLock; use starcoin_chain_notify:...
use super::{get_send, post_send}; use crate::{wechat::WxApiRequestBuilder, SdkResult}; use serde::{Deserialize, Serialize}; #[derive(Debug, Serialize, Deserialize)] pub struct Action { /// 查询配置域名的类型, 可选值如下: /// - `getbizdomain` 返回业务域名 <br/> /// - `getserverdomain` 返回服务器域名 <br/> /// - 不指明返回全部 <br/> ...
use crate::prelude::*; use core::cell::{Cell, UnsafeCell}; use core::convert::TryFrom; use core::mem::MaybeUninit; use crate::arch::cpuid; use crate::objects::*; use crate::utils::percore::PerCore; use crate::NCPU; use sysapi::init::InitCSpaceSlot::*; use sysapi::process::{ ProcessCSpace, PROCESS_MAIN_THREAD_STACK...
//! A nested containment list (NClist) is a datastructure that can be queried for elements //! overlapping intervals. It was invented and published by <NAME> and <NAME> in Bioinformatics in //! 2007 (doi: [10.1093/bioinformatics/btl647](https://doi.org/10.1093/bioinformatics/btl647)). //! //! # How it works //! The `NC...
use std::cmp::Ordering; use std::fmt::Display; use abstutil::{abbreviated_format, prettyprint_usize, CloneableAny}; use geom::{Angle, Distance, Duration, Line, Polygon, Pt2D, Time}; use map_gui::tools::ColorScale; use sim::{Problem, TripID}; use synthpop::TripMode; use widgetry::{ ClickOutcome, Color, DrawWithTool...
use log::{warn, error}; use crate::core::paramset::ParamSet; use crate::core::geometry::normal::Normal3f; use crate::core::pbrt::{Float, Options}; use crate::core::geometry::vector::{Vector3f, Vector2f}; use crate::core::geometry::point::{Point3f, Point2f}; use std::fmt::{Display, Formatter}; use std::fmt; use crate::c...
use std::convert::TryInto; use std::io::{BufRead, Write}; use std::ops::Mul; use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; use ndarray::{s, Array2, ErrorKind as ShapeErrorKind, ShapeError}; use serde::Serialize; use toml::Value; use crate::chunks::metadata::Metadata; use crate::chunks::norms::NdNorms; u...
use std::collections::{BTreeMap, BTreeSet}; use std::fs::File; use std::io::BufWriter; use memmap::MmapOptions; use powerpc::gpr_constants::*; use powerpc::EncodedInstruction; use powerpc_symbolic::Variable; use symbolic::{Expr, ExprRef, NumberedVariable}; use work_set::WorkSet; use crate::fact::basic_block::{BasicBl...
///! Sparse matrix addition, subtraction use indexing::SpIndex; use sparse::csmat::CompressedStorage; use sparse::prelude::*; use num_traits::Num; use sparse::vec::NnzEither::{Left, Right, Both}; use sparse::vec::SparseIterTools; use sparse::compressed::SpMatView; use ndarray::{ self, Array, ArrayBase, ...
/*! ## mini_http ## Basic Example ```rust # fn run() -> Result<(), Box<::std::error::Error>> { mini_http::Server::new("127.0.0.1:3002")? .start(|request| { mini_http::Response::builder() .status(200) .body(b"Hello!\n".to_vec()) .unwrap() })?; # Ok(()) # } ``` Note...
use core::{cell::Cell, cmp}; use std::convert::TryInto as _; use anyhow::bail; use arrayref::array_ref; use log::{debug, info}; use crate::{ adiv5::{self, ApBank}, dap::{self, Command}, sealed::{self, Data as _}, util, }; // XXX do other Cortex-M variants have a different "must preserve" value // see...
// 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 crate::cipd; use crate::types::{ get_fuchsia_sdk_dir, get_fuchsia_sdk_tools_dir, get_sdk_data_dir, read_env_path, FuchsiaPaths, }; use { ansi_te...
// Copyright 2021 <NAME> // SPDX-License-Identifier: Apache-2.0 use super::*; use chronicle_common::get_history_mut; use futures::SinkExt; #[async_trait] impl<H: ChronicleBrokerScope> EventLoop<H> for ChronicleBroker<H> { async fn event_loop(&mut self, mut status: Result<(), Need>, supervisor: &mut Option<H>) -> ...
// Copyright 2020-2021, The Tremor Team // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agr...
use group::{ ff::{BatchInvert, Field}, Curve, }; use rand_core::RngCore; use std::iter::{self, ExactSizeIterator}; use super::super::{circuit::Any, ChallengeBeta, ChallengeGamma, ChallengeX}; use super::{Argument, ProvingKey}; use crate::{ arithmetic::{eval_polynomial, parallelize, CurveAffine, FieldExt}, ...
// Copyright 2021 <NAME> // Copyright 2021 Google LLC // // 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 applic...
use crate::{ ewin_com::{_cfg::key::keycmd::*, colors::*, def::*, global::*, log::Log, model::*, util::*}, model::*, }; use crossterm::{cursor::MoveTo, terminal::ClearType::*, terminal::*}; use directories::BaseDirs; use ewin_com::file::*; use std::{ cmp::min, env, path::{self, Path, *}, ...
use crate::{ ByteArray, Function, Hashed, InnerInteger, Integer, IntegerError, Op, Opcode, Ops, Script, Sha256d, TaggedOp, TxInput, TxOutpoint, TxOutput, UnhashedTx, SigHashFlags, }; use bimap::BiMap; use serde::{Deserialize, Serialize}; use std::borrow::Cow; use std::collections::HashMap; use std::sync::Arc; ...
mod helpers; mod manager; use std::time::Duration; use crate::client::{ BatchMessage, ClientT, RegisterNotificationMessage, RequestMessage, Subscription, SubscriptionClientT, SubscriptionKind, SubscriptionMessage, TransportReceiverT, TransportSenderT, }; use helpers::{ build_unsubscribe_message, call_with_timeout,...
use std::collections::BTreeSet; use num_traits::ToPrimitive; use num_bigint::BigInt; use crate::resolver::{Contract, FunctionDecl, Type, cfg::{ControlFlowGraph, Instr, Variable, BasicBlock}, expression::Expression }; const MSG_SENDER: &str = "msg_sender"; const GET_CALLER: &str = "runtime::get_caller()"; pub ...
use crate::raw_symbol_token::RawSymbolToken; use nom::branch::alt; use nom::bytes::streaming::tag; use nom::character::streaming::one_of; use nom::combinator::{map, peek, recognize, value}; use nom::sequence::{delimited, pair, preceded, terminated}; use nom::{IResult, Parser}; use crate::text::parsers::annotations::pa...
use std::rc::Rc; use std::borrow::BorrowMut; use std::collections::{BTreeSet, HashMap}; use polodb_bson::{Value, Document}; use crate::DbResult; use crate::page::{RawPage, PageHandler}; use super::{BTreeNode, BTreeNodeDataItem, SearchKeyResult}; use super::wrapper_base::BTreePageWrapperBase; use crate::data_ticket::Dat...
pub use crate::parse_expr::{ IntFunc, IntFuncType, BoolFunc, BoolFuncType, CustomState, NoCustom, CustomParser, Expr, }; pub use crate::parse_expr::{BoolExpr as BoolExprTree, IntExpr as IntExprTree}; use std::fmt; use bitflags::bitflags; use crate::game::Game; use crate::parse_expr::{self, DefaultParser}; use cr...
/** * Copyright 2021 Rigetti Computing * * 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 ...
// 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 in the LICENSE-APACHE file or at: // https://www.apache.org/licenses/LICENSE-2.0 //! Event manager // Without winit, several things go unus...
use futures::stream::Stream; use rand::random; use rdkafka::client::EmptyContext; use rdkafka::config::{ClientConfig, TopicConfig}; use rdkafka::consumer::stream_consumer::StreamConsumer; use rdkafka::consumer::{Consumer, EmptyConsumerContext}; use rdkafka::error::KafkaError; use rdkafka::message::{BorrowedMessage, Mes...
use std::borrow::Cow; use crate::pica_window::Window; use crate::utils; use crate::{math, wgpu_renderer::camera::Camera}; use bytemuck::{Pod, Zeroable}; use glam::{Mat4, Quat, Vec3, Vec4}; use wgpu::ShaderModule; use wgpu::{util::DeviceExt, IndexFormat, PrimitiveTopology, ShaderSource}; pub mod camera; pub mod scene; ...
use crate::page::Renderer; use crate::utils::StyleSet; use onenote_parser::contents::{NoteTag, OutlineElement}; use onenote_parser::property::common::ColorRef; use onenote_parser::property::note_tag::{ActionItemStatus, NoteTagShape}; use std::borrow::Cow; const COLOR_BLUE: &str = "#4673b7"; const COLOR_GREEN: &str = "...
use std::path::Path; use sdl2::event::Event; use sdl2::keyboard::Scancode; use sdl2::rect::Rect; use std::time::Instant; use std::collections::VecDeque; use rand::Rng; #[derive(Clone, Copy, Debug, Eq, PartialEq)] enum Direction { Up, Right, Down, Left, } impl From<u32> for Direction { fn from(x: ...
use crate::packet::{ErrorCode, Packet, TftpOption}; use sna::SerialNumber; use std::fs::{self, File}; use std::io::{self, Read, Write}; use std::path::{Component, Path, PathBuf}; use std::time::Duration; #[derive(Debug, PartialEq)] pub enum TftpError { /// The is already running and cannot be restarted Transfe...
//! Extra data held in multiple diffferent items. use crate::identities::Identity; use crate::items::FunctionItem; use crate::paths::Ident; use crate::paths::UnresolvedPath; use crate::scopes::Scope; use crate::tokens::Tokens; use serde::{Deserialize, Serialize}; use std::fmt; use std::path::PathBuf; use std::sync::Ar...
//! # [Day 8: Seven Segment Search](https://adventofcode.com/2021/day/8) //! //! You barely reach the safety of the cave when the whale smashes into the cave mouth, //! collapsing it. Sensors indicate another exit to this cave at a much greater depth, //! so you have no choice but to press on. //! //! As your submarine...
use crate::cluster::compute_clusters; use crate::command::{Answer, AnswerConfidencePair, Command, CommandResponse, CommandType}; use crate::equalifier::{ Equalifier, ExactEqualifier, NumericEqualifier, NumericVecEqualifier, VecDistAlgo, }; use log::info; use std::collections::HashMap; use std::collections::HashSet;...
use regex::Regex; /// Regex pattern for maching ANSI codes. pub const ANSI_REGEX: &'static str = r"[\x1b\x9b][\[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]"; /// List of supported ANSI codes. pub const ANSI_PAIR: [[&'static str; 2]; 24] = [ ["\x1B[0m", "\x1B[0m"], // reset 0 ["\x1B[1m", "\x1B[2...
extern crate nalgebra as na; use std::{error::Error, fmt, iter::repeat}; type Vector = na::DVector<f64>; type Matrix = na::DMatrix<f64>; type LuDecomp = na::LU<f64, na::Dynamic, na::Dynamic>; /// Gives possible reasons why the simplex algorithm failed to solve a linear /// program. #[derive(Debug)] pub enum SimplexE...
// High level formatting functions. use std::collections::HashMap; use std::io::{self, Write}; use std::time::{Duration, Instant}; use rustc_ast::ast; use rustc_span::Span; use self::newline_style::apply_newline_style; use crate::comment::{CharClasses, FullCodeCharKind}; use crate::config::{Config, FileName, Verbosi...
// Copyright 2018-2020 Parity Technologies (UK) Ltd. // // 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 applicab...
//! # Day 9: <NAME> //! //! You talk to the Elves while you wait for your navigation system to //! initialize. To pass the time, they introduce you to their favorite marble //! game. //! //! The Elves play this game by taking turns arranging the marbles in a circle //! according to very particular rules. The marbles ar...
use byteorder::{LittleEndian, ReadBytesExt, WriteBytesExt}; use elf; use elf::types::{EM_AARCH64, ProgramHeader, PT_LOAD, SHT_NOTE}; use crate::format::{utils, romfs::RomFs, nacp::NacpFile}; use std; use std::fs::File; use std::io::{self, Cursor, Seek, SeekFrom, Write}; use std::path::{Path, PathBuf}; use std::process;...
//! An implementation of lighting, primarily based on 3D flood fill //! algorithms. //! //! # Structure //! Lighting is done on a separate _lighting worker thread_ which //! stores its own copy of the chunk map. The server notifies //! it when chunks are loaded and unloaded, and it can //! request that it handle a ligh...
//! The Direct2D backend for the Piet 2D graphics abstraction. mod conv; pub mod error; use crate::conv::{ affine_to_matrix3x2f, color_to_colorf, convert_stroke_style, gradient_stop_to_d2d, rect_to_rectf, to_point2f, Point2, }; use crate::error::WrapError; use std::borrow::Cow; use winapi::shared::basetsd::...
//! This module handles the manipulation / execution of storage //! plans. This is currently implemented using DataFusion, and this //! interface abstracts away many of the details mod counters; pub mod fieldlist; mod planning; mod schema_pivot; pub mod seriesset; pub mod stringset; // Export function to make window b...
//By Mami use rand_pcg::*; use crate::config::*; use crate::config::layer::*; use crate::util::*; use crate::com; use rand::{Rng}; use std::collections::hash_map::DefaultHasher; use std::hash::{Hash, Hasher}; pub fn mismatch_spec(db: &mut LayerData, file: &'static str, line: u32) { let error = format!("fatal error:...
//! The physical parser structure. //! This may not hold your expectations of a traditional parser, //! the parser yields events like `Start node`, `Error`, etc. //! These events are then applied to a `TreeSink`. pub(crate) mod parse_error; mod parse_lists; mod parse_recovery; mod parsed_syntax; pub(crate) mod rewrite...
use byteorder::{ByteOrder, LittleEndian}; use libflate::zlib::{Decoder, Encoder}; use serde::{Deserialize, Serialize}; use hashbrown::HashSet; use std::{ fs::File, io::{Read, Write}, path::Path, }; use crate::gen::blocks::{BlockRotation, Blocks}; use super::super::{ engine::world::WorldConfig, ...
// toggle-comment <NAME> <<EMAIL>> 2020 CE // // toggle-comment is a utility designed around setting or toggling the line-comment status // of lines in plain text files in a do-what-i-mean fashion. It should, where possible, // run without configuration, guess the current language/line-comment character, match // ...
use emulation_thread::EmulationMessage; use futures::executor::block_on; use wgpu::util::DeviceExt; use std::sync::Arc; use std::{sync::mpsc::Sender, thread::JoinHandle}; use winit::{ event::*, event_loop::{ControlFlow, EventLoop}, window::WindowBuilder, }; use std::path::PathBuf; use structopt::StructOp...
use crate::renderers::{ScalingMatrix, ScalingRenderer}; use crate::SurfaceSize; use crate::{Error, Pixels, PixelsContext, SurfaceTexture}; use raw_window_handle::HasRawWindowHandle; use std::env; /// A builder to help create customized pixel buffers. pub struct PixelsBuilder<'req, 'dev, 'win, W: HasRawWindowHandle> { ...
#![allow(clippy::upper_case_acronyms)] use crate::{AnimMode, CCTMode, HSIMode}; use bytemuck::{Pod, Zeroable}; use std::convert::TryFrom; use std::marker::PhantomData; mod _errors_ { use crate::{AnimMode, CCTMode, HSIMode}; use std::{error, fmt}; #[derive(Debug)] pub enum ConversionToPacketError { ...
// Copyright (c) 2018, The Tor Project, Inc. // Copyright (c) 2018, <NAME> // See LICENSE for licensing information //! Bindings to external digest and XOF functions which live within //! src/common/crypto_digest.[ch]. //! //! We wrap our C implementations in src/common/crypto_digest.[ch] with more //! Rusty types and...
//! Reload pass //! //! The reload pass runs between the spilling and coloring passes. Its primary responsibility is to //! insert `spill` and `fill` instructions such that instruction operands expecting a register will //! get a value with register affinity, and operands expecting a stack slot will get a value with //...
// Copyright 2015 blake2-rfc 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 except according...
//! Reset and Clock Control peripheral //! //! This module contains a partial abstraction over the RCC peripheral, as well as types and traits //! related to the various clocks on the chip. The usual pattern here is to mutate clock settings //! as you wish them to be, freeze the clocks, and then pass references to the ...
use crate::cia::keyboard::MatrixIndex; use crate::utils::R2C; use super::backends::*; pub trait Register { fn read(&self) -> u8; fn write(&self, val: u8); } pub(super) struct DataA<T>(pub R2C<DataPortBackend<T>>); pub(super) struct DataDirectionA<T>(pub R2C<DataPortBackend<T>>); pub(super) struct DataB<T>(p...
use crate::arraymap::{ImmutableListMap, ImmutableListMapBuilder}; use crate::iterators::OctetIter; use crate::matrix::BinaryMatrix; use crate::octet::Octet; use crate::sparse_vec::SparseBinaryVec; use crate::util::get_both_indices; use serde::{Deserialize, Serialize}; use std::mem::size_of; // Stores a matrix in spars...
use std::borrow::Cow; use std::fmt; // 1. sort the statements // 2. do a binary search on the first section of a path // 3. return a range of path's that match the subpath // 4. if any path's match the subset exactly and the superset either // doesn't exist or has no matches to any of the statements return // 5. re...
use crate::{ elementwise::{div::div, mul::mul}, manip::expand_dims::expand_dims, math::broadcast::{broadcast_fn, Broadcast}, reduce::reduce_prod::reduce_prod, shape::shape_of::shape_of, }; use alumina_core::{ base_ops::{OpInstance, OpSpecification}, errors::{ExecutionError, GradientError, OpBuildError, ShapeProp...
#![feature(proc_macro_hygiene, decl_macro)] mod websocket; #[macro_use] extern crate rocket; #[macro_use] extern crate rocket_contrib; extern crate pbkdf2; use pacosako::{DenseBoard, PacoError, SakoSearchResult}; use rand::{thread_rng, Rng}; use rocket::http::{Cookie, Cookies}; use rocket::outcome::IntoOutcome; use r...
//! Defines traits used to embed the chalk-engine in another crate. //! //! chalk and rustc both define types which implement the traits in this //! module. This allows each user of chalk-engine to define their own //! `DomainGoal` type, add arena lifetime parameters, and more. See //! [`Context`] trait for a list of t...
//! The newfeeds{ .. } section contains a list of all NNTP peers. //! //! It is used for a couple of things: //! //! - When a peer connects. The peer is looked up in the newsfeed list //! by IP address. If it's not listed, access is denied. //! //! - When the peer sends an article. If it is allowed to send articles, ...
use crate::conn::AmConnCore; use crate::protocol::parts::{ parse_resultset_metadata, AuthFields, ClientContext, ClientInfo, CommandInfo, ConnectOptions, DbConnectInfo, ExecutionResult, LobFlags, OutputParameters, ParameterDescriptors, ParameterRows, PartitionInformation, Parts, ReadLobReply, ReadLobRequest,...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { _reserved_0_cr: [u8; 0x04], _reserved_1_mr: [u8; 0x04], _reserved_2_ier: [u8; 0x04], _reserved_3_idr: [u8; 0x04], _reserved_4_imr: [u8; 0x04], _reserved_5_csr: [u8; 0x04], #[doc = "0x18 - Receive Holding Register"] pub rhr:...
#![forbid(missing_docs)] //! Safe rust binding to the [HiGHS](https://highs.dev) linear programming solver. //! //! ## Usage example //! //! ### Building a problem constraint by constraint with [RowProblem] //! //! Useful for traditional problem modelling where you first declare your variables, then add //!constraints ...
#![cfg(test)] use std::{env, fs, io::Read, path, str}; pub mod coappearances; fn read_and_validate_coappearances( storage: flatdata::StorageHandle, ) -> Result<(), std::str::Utf8Error> { let g = coappearances::Graph::open(storage).expect("invalid archive"); println!("{:?}", g); let vertices = g.vert...
// Copyright 2020 The Druid Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed...
use std::ffi::{OsStr, OsString}; use std::iter::once; use std::os::windows::ffi::{OsStrExt, OsStringExt}; use std::ptr::null_mut; use std::process::Command; use serde::{Serialize, Deserialize}; use winapi::shared::windef::{HWND, RECT, PPOINT, POINT}; use winapi::shared::minwindef::LPARAM; use winapi::um::errhandlinga...
//! Information updated every step stored here. use crate::{ action::{Action, ActionError}, bot::{Bot, Locked, Rs, Rw}, geometry::Point2, ids::*, pixel_map::{PixelMap, VisibilityMap}, score::Score, unit::Unit, units::Units, Event, FromProto, Player, SC2Result, }; use num_traits::FromPrimitive; use rustc_hash:...
#[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { _reserved_0_dll: [u8; 0x04], _reserved_1_dlh: [u8; 0x04], _reserved_2_fcr: [u8; 0x04], #[doc = "0x0c - UART Line Control Register"] pub lcr: crate::Reg<lcr::LCR_SPEC>, #[doc = "0x10 - UART Modem Control Register"] pub mcr: crat...
// // Copyright 2021 <NAME> // This file is part of the Ida compiler. // Ida is licensed under the BSD-3 license. See the COPYING file for more information. // use std::io; use std::io::prelude::*; use std::io::BufWriter; use std::fs::File; use std::process::Command; use parser::ltac::{LtacFile, LtacData, LtacDataTyp...
//! Module with the [peer server actor]. //! //! Peers connect to this actor to retrieve stored blobs and keys. //! //! [peer server actor]: actor() // TODO: make request and response types more consistent. // Let the peer provide the RequestId (in the passport). use std::convert::TryInto; use std::io::{self, IoSlice...
//#![feature(align_offset)] extern crate ndarray; extern crate rayon; extern crate num_cpus; mod utilities; mod matrix_math; mod danger_math; pub use utilities::{get_idx, random_array, float_eq, test_equality}; pub use utilities::{matrix_madd_n_sq, matrix_madd_nxm, matrix_madd_nmp}; pub use utilities::{matrix_madd_n_...
use super::auxility::ByteSliceExt; use super::auxility::UncheckedSliceExt; use super::bits::Bits; use super::huffman::HuffmanDecoder; use super::huffman::HuffmanEncoder; use super::matchfinder::Bucket; use super::matchfinder::BucketMatcher; use super::matchfinder::MatchResult; use super::mtf::MTFCoder; const LZ_ROID_E...
// Copyright 2017-2020 Parity Technologies (UK) Ltd. // This file is part of Polkadot. // Polkadot 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 option) any...
use bitflags::bitflags; use std::cmp::Ordering; const VRAM_SIZE: usize = 8 * 1024; pub const OAM_SIZE: usize = 160; const SCREEN_WIDTH: usize = 160; const SCREEN_HEIGHT: usize = 144; const SCREEN_PIXELS: usize = SCREEN_WIDTH * SCREEN_HEIGHT; #[derive(Debug)] pub struct PPU { vram: [u8; VRAM_SIZE], pub oam: [...
use std::{fs, io, env}; use std::collections::HashSet; use std::error::Error; use std::fs::DirEntry; use std::path::Path; use image::{ImageBuffer, RgbaImage, RgbImage}; use image::error::DecodingError; use image::imageops::FilterType; use image::io::Reader as ImageReader; use palette::{GammaSrgb, GetHue, Hsl, Hsv, Int...
use crate::parsing::{ dns_record::dns_record_tag, quoted_printable::into_dqp, signature_header::tag_list_with_reassembled, tag_value_list::tag_list, ParsingError, }; use std::convert::TryFrom; /// A struct reprensenting a DKIM-Signature header. /// It can be build using the builder syntax. #[derive(Debug)] p...
use std::ffi::{CStr, CString}; use std::sync::atomic::{AtomicBool, AtomicI64, AtomicI8, AtomicUsize, Ordering}; use bindings::{ Microsoft::Web::WebView2::Win32::{ ICoreWebView2, ICoreWebView2WebMessageReceivedEventArgs, ICoreWebView2WebResourceRequestedEventHandler, COREWEBVIEW2_WEB_RESOURCE_CONTEXT...
//! Handling of DNS layer use core::convert::TryInto; use core::fmt; use serde::{Serialize, Serializer}; use crate::errors::Error; use crate::layer::Layer; use crate::layers::udp; use crate::types::{IPv4Address, IPv6Address}; #[derive(Default, Debug, Serialize)] pub struct DNSSOA { mname: DNSName, rname: DN...
//! Implementations for various factorization algorithms. //! //! Note general prime number field sieve is not planned to be implemented, since it's too complex //! //! See <https://web.archive.org/web/20110331180514/https://diamond.boisestate.edu/~liljanab/BOISECRYPTFall09/Jacobsen.pdf> //! for a detailed comparison b...