text stringlengths 8 4.13M |
|---|
use crate::zgroup::GroupEvent::{LeaseExpired, NewGroupView};
use async_std::sync::{Arc, Condvar, Mutex};
use async_std::task::JoinHandle;
use flume::{Receiver, Sender};
use futures::prelude::*;
use futures::select;
use serde::{Deserialize, Serialize};
use std::cmp::Ordering;
use std::collections::HashMap;
use std::ops:... |
#[doc = r" Value read from the register"]
pub struct R {
bits: u32,
}
#[doc = r" Value to write to the register"]
pub struct W {
bits: u32,
}
impl super::CTRUP {
#[doc = r" Modifies the contents of the register"]
#[inline]
pub fn modify<F>(&self, f: F)
where
for<'w> F: FnOnce(&R, &'w mut... |
use regex::Regex;
lazy_static! {
/// Bitcoin Regex Pattern
static ref BTC: Regex = Regex::new(r"(?i)^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$").unwrap();
/// Bitcoin Cash Regex Pattern
static ref BCH: Regex = Regex::new(r"(?i)^((bitcoincash|bchreg|bchtest):)?(q|p)[a-z0-9]{41}$").unwrap();
/// Ethereum Rege... |
use sdl2::rect::Rect as SdlRect;
pub struct Rectangle {
pub x: f64,
pub y: f64,
pub width: f64,
pub height: f64,
}
impl Rectangle {
pub fn to_sdl(&self) -> SdlRect {
assert!(self.width >= 0f64 && self.height >= 0f64);
SdlRect::new(self.x as i32, self.y as i32, self.width as u32, self.height as u32)
}
} |
// cargo run --release -- ~/p/covid_county.json ./out
use anyhow::{Context, Result};
use chrono::{TimeZone, Utc};
use rayon::prelude::*;
use serde::{Deserialize, Serialize};
use std::collections::{BTreeMap, BTreeSet, HashMap};
use std::fs;
use std::path::PathBuf;
use structopt::StructOpt;
type Rfc3339 = String;
#[d... |
use analyser::interface::*;
use ops::prelude::*;
pub mod conv2d;
pub mod local_patch;
pub mod pools;
pub mod space_to_batch;
pub fn register_all_ops(reg: &mut OpRegister) {
reg.insert("AvgPool", pools::pool::<pools::AvgPooler>);
reg.insert("Conv2D", conv2d::conv2d);
reg.insert("MaxPool", pools::pool::<poo... |
//! Measure each Sightglass phase using VTune. When using this [Measure] and running a benchmark
//! inside VTune, VTune will mark the phases in the timeline and allow for filtering based on the
//! Sightglass phase. For example:
//!
//! ```text
//! vtune -collect hotspots sightglass-cli benchmark <path to>/benchmark.w... |
use dashmap::mapref::{entry::Entry, one::RefMut};
use eyre::Report;
use twilight_model::id::{
marker::{GuildMarker, UserMarker},
Id,
};
use crate::{
commands::osu::ProfileSize,
database::{Authorities, EmbedsSize, GuildConfig, MinimizedPp, Prefix, Prefixes, UserConfig},
BotResult, Context,
};
impl ... |
pub const ERROR_VALUE: u8 = 0u8;
pub type Res = (usize, usize);
|
use error_chain::error_chain;
error_chain! {
foreign_links {
Io(std::io::Error);
HttpRequest(reqwest::Error);
UrlParse(url::ParseError);
}
}
pub async fn try_request() -> Result<()> {
// 同步
let res = reqwest::blocking::get("http://httpbin.org/get")?;
let body = res.text()?;... |
use std::f64::consts::PI;
pub const TWO_PI: f64 = PI * 2.0;
pub const PI_2: f64 = PI / 2.0;
pub const EPS: f64 = 1E-8;
pub trait AlmostEq<RHS = Self> {
fn is_eq(&self, rhs: &RHS, eps: f64) -> bool;
}
impl AlmostEq for f64 {
fn is_eq(&self, rhs: &f64, eps: f64) -> bool
{
let res = self - rhs;
... |
use super::utils;
use crate::{
endpoints::params::DeleteParams,
service::{error::PostgresManagementServiceError, PostgresManagementService},
};
use actix_web::ResponseError;
use async_trait::async_trait;
use chrono::Utc;
use core::pin::Pin;
use drogue_client::registry;
use drogue_cloud_database_common::{
au... |
use crate::{
audio_encoder::AudioEncoder, order::frame::FrameAddress, order::*, packet::Packet,
subtitle_encoder::SubtitleEncoder, tools, video_encoder::VideoEncoder,
};
use ffmpeg_sys_next::*;
use std::{
collections::{BTreeMap, HashMap},
ffi::{c_void, CString},
ptr::null_mut,
};
#[derive(Debug)]
pub struct ... |
use std::{sync::Arc, time::Duration};
use lavalink_rs::gateway::LavalinkEventHandler;
use poise::{
serenity::async_trait,
serenity_prelude::{Channel, GuildId, Http, Mentionable, UserId},
};
use songbird::Songbird;
use tracing::{debug, info};
use crate::{
constants::MAX_SINGLE_ENTRY_LENGTH,
types::{Idl... |
use crate::{
auth::UserDetail,
server::{
chancomms::ControlChanMsg,
controlchan::{
error::ControlChanError,
handler::{CommandContext, CommandHandler},
Reply, ReplyCode,
},
ftpserver::options::SiteMd5,
},
storage::{StorageBackend, FEATUR... |
use crate::ContinuumSpotTally;
use codec::{Decode, Encode, EncodeLike, Input, Output};
use frame_support::sp_runtime::traits::AccountIdConversion;
use primitives::SpotId;
use sp_runtime::{
traits::{Saturating, Zero},
RuntimeDebug,
};
use sp_std::{convert::TryFrom, prelude::*, result::Result};
// use crate::mock... |
#[doc = "Reader of register ALM2_TIME"]
pub type R = crate::R<u32, super::ALM2_TIME>;
#[doc = "Writer for register ALM2_TIME"]
pub type W = crate::W<u32, super::ALM2_TIME>;
#[doc = "Register ALM2_TIME `reset()`'s with value 0x0100_0000"]
impl crate::ResetValue for super::ALM2_TIME {
type Type = u32;
#[inline(al... |
use std::fs::{self, File};
use std::path::PathBuf;
use std::process::Stdio;
use std::sync::atomic::{AtomicUsize, Ordering};
use tokio::{io::BufReader, prelude::*, process};
use uuid::prelude::*;
use crate::integration::common::TEST_REALM;
/// A handle to a started router; drop to close the router and delete its conf... |
pub mod bomb;
pub mod explosion;
pub mod player;
|
/// Assert a condition is true.
///
/// * When true, return `()`.
///
/// * Otherwise, call [`panic!`] with a message and the values of the
/// expressions with their debug representations.
///
/// # Example
///
/// ```rust
/// # #[macro_use] extern crate assertable; fn main() {
/// assert!(true);
/// //-> ()
/// # }... |
//! Generator macro.
ligen::define_binding_generator!(name = "ligen_csharp", generator = "ligen_csharp_core::Generator");
// Or if you want to create a project generator:
// ligen::define_project_generator!(name = "ligen_csharp", generator = "ligen_csharp_core::Generator"); |
pub enum BinaryTree<T> {
Empty,
NonEmpty(Box<TreeNode<T>>),
}
pub struct TreeNode<T> {
element: T,
left: BinaryTree<T>,
right: BinaryTree<T>,
}
impl<T: Ord> BinaryTree<T> {
pub fn add(&mut self, value: T) {
match *self {
BinaryTree::Empty =>
*self = BinaryTr... |
use std::path::PathBuf;
// 一个标准的unix socket path如下
// /tmp/breeze/socks/config+v1+breeze+feed.content.icy:user@mc@cs.sock
pub struct UnixSocketPath;
impl UnixSocketPath {
// 第一个部分是biz
// 第二个部分是资源类型
// 第三个部分是discovery类型
pub fn parse(path: &String) -> Option<(String, String, String)> {
let base =... |
pub(crate) mod modification_plan_tree;
use self::modification_plan_tree::ModificationPlanTree;
/// Modification plan from which an executor can do its work deterministically.
#[derive(Clone, PartialEq, Debug, new)]
pub(crate) struct ModificationPlan {
pub(crate) plan_tree: ModificationPlanTree,
}
|
#[derive(Debug)]
pub enum Ident {
Uuid(String),
Md5(String),
Name(String)
}
|
use crate::color::Color;
use serde::{Deserialize, Serialize};
const OPACITY_PRECISION: usize = 3;
fn format_opacity(name: &str, opacity: f32) -> String {
if (opacity - 1.).abs() > 10f32.powi(-(OPACITY_PRECISION as i32)) {
format!(r#" {}-opacity="{:.precision$}""#, name, opacity, precision = OPACITY_PRECISION)
} el... |
#[doc = "Register `SR` reader"]
pub type R = crate::R<SR_SPEC>;
#[doc = "Field `PVU` reader - Watchdog prescaler value update This bit is set by hardware to indicate that an update of the prescaler value is ongoing. It is reset by hardware when the prescaler update operation is completed in the VDD voltage domain (take... |
#[doc = "Register `FDCAN_TEST` reader"]
pub type R = crate::R<FDCAN_TEST_SPEC>;
#[doc = "Register `FDCAN_TEST` writer"]
pub type W = crate::W<FDCAN_TEST_SPEC>;
#[doc = "Field `LBCK` reader - Loop back mode"]
pub type LBCK_R = crate::BitReader;
#[doc = "Field `LBCK` writer - Loop back mode"]
pub type LBCK_W<'a, REG, con... |
use actix_web::web::Data;
use actix_web::Responder;
use tracing::info;
use tracing::instrument;
use htsget_http::get_service_info_json as get_base_service_info_json;
use htsget_http::Endpoint;
use htsget_search::htsget::HtsGet;
use crate::handlers::pretty_json::PrettyJson;
use crate::AppState;
/// Gets the JSON to r... |
extern crate nalgebra as na;
extern crate nalgebra_glm as glm;
use nalgebra::Matrix4;
use nalgebra::Point3;
use nalgebra::Vector3;
#[derive(Default, Debug, Clone, Copy)]
pub struct CameraMatrices {
pub projection_matrix: [f32; 16],
pub view_matrix: [f32; 16],
pub camera_position: [f32; 3],
}
impl CameraM... |
// Copyright 2019 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 applicable law or agreed to in ... |
use render::RenderBuilder;
use rise_stylesheet::styles::style::{Style, StyleExt};
use rise_stylesheet::yoga::context::{get_context, get_context_mut, ContextExt, NodeContextExt};
use rise_stylesheet::yoga::yoga_sys;
use rise_stylesheet::yoga::Node;
use std::any::Any;
use std::boxed::Box;
use std::cell::RefCell;
use std:... |
use super::{Block, BlockId, Field};
use crate::{random_id::U128Id, resource::ResourceId, JsObject, Promise};
use ordered_float::OrderedFloat;
use std::collections::BTreeMap;
use std::collections::HashSet;
use wasm_bindgen::{prelude::*, JsCast};
#[derive(Clone)]
pub struct Tab {
name: String,
items: BTreeMap<Or... |
use crate::appkit::NSMenu;
use crate::base::id;
use crate::base::Sel;
use crate::foundation::NSString;
// https://developer.apple.com/documentation/appkit/nsmenuitem
#[derive(Clone, Copy, Debug)]
#[repr(C)]
pub struct NSMenuItem(pub(crate) id);
impl Default for NSMenuItem {
fn default() -> Self {
Self::new()
... |
use libc::{c_int, c_void, getpid, pid_t};
use {Error, Protection, Region, Result};
pub fn get_region(address: *const u8) -> Result<Region> {
unsafe {
let mut vm_cnt = 0;
let vm = kinfo_getvmmap(getpid(), &mut vm_cnt);
if vm.is_null() {
return Err(Error::NullAddress);
}
for i in 0..vm_cnt {... |
// Copyright 2020 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0
use wasmlib::*;
//@formatter:off
pub struct Donation {
pub amount: i64, // amount donated
pub donator: ScAgentId, // who donated
pub error: String, // error to be reported to donator if anything goes wrong
pub fee... |
extern crate typemap;
use self::typemap::Key;
use serenity::prelude::Mutex;
use std::collections::HashMap;
use std::sync::Arc;
use std::time::SystemTime;
pub struct PlayerManager;
impl Key for PlayerManager {
type Value = Arc<Mutex<HashMap<String, Player>>>;
}
pub struct Player {
position: Vector3,
velo... |
use std::borrow::Cow;
use std::collections::{BTreeMap, HashMap};
use std::mem;
use std::sync::Arc;
use std::u32;
use gimli::Reader as GimliReader;
use object::{self, ObjectSection, ObjectSymbol};
use crate::cfi::{Cfi, CfiDirective};
use crate::file::{Architecture, Arena, DebugInfo, FileHash};
use crate::function::{
... |
use bit_vec::BitVec;
use rand::distributions::{Bernoulli, Distribution};
use std::convert::TryInto;
#[derive(Debug)]
pub struct BitMap {
bit_vector: Box<[BitVec; 2]>,
current_index: bool,
len: usize,
}
// Arbitrary size bitmap where most significant bit is leftmost
impl BitMap {
pub fn new(length: u64... |
fn main() {
let image = raytracer::render();
raytracer::show_image(image);
}
|
pub mod login_controller;
pub mod posts_controller;
pub use login_controller::*;
pub use posts_controller::*;
|
use Result;
use cameras::Config;
use glacio::camera::Image;
/// A summary of information about an image.
#[derive(Debug, Serialize)]
pub struct Summary {
/// The image's date and time, as a string.
pub datetime: String,
/// The image's url on a remote server.
pub url: String,
}
impl Summary {
/// ... |
use alloc::boxed::Box;
use core::fmt::Debug;
use crate::ClientContext;
/// An asset resolver context allows clients to provide additional data
/// to the resolver for use during resolution. Clients may provide this
/// data via a context object of their own (subject to restrictions below).
/// An ArResolverContext is... |
use std::fs::File;
use std::io::Write;
pub fn mov(des: &str, src: &str, f: &mut File) {
write!(f, " ").expect("asm mov: Unable to write to the file.");
write!(f, "mov {}, {}\n", des, src).expect("asm: Unable to write to the file.");
}
pub fn ret(f: &mut File) {
write!(f, " ").expect("asm ret: stat_return... |
#![deny(missing_docs)]
#![allow(clippy::all)] // generated code is not clippy friendly
//! Flat OpenStreetMap (OSM) data format providing an efficient *random* data
//! access through [memory mapped files].
//!
//! The data format is described and implemented in [flatdata]. The [schema]
//! describes the fundamental O... |
use std::time::Duration;
use std::time::Instant;
use std::time::SystemTime;
pub fn timed<T>(tag: &str, body: impl FnOnce() -> T) -> T {
let start = Instant::now();
let result = body();
let end = Instant::now();
log::trace!("run of {} {:?}", tag, (end - start));
result
}
pub struct Tracer {
last... |
mod details;
mod index;
pub use details::*;
pub use index::*;
use crate::page::AppRoute;
use patternfly_yew::*;
use std::fmt::Formatter;
use std::str::FromStr;
use yew_router::prelude::*;
#[derive(Switch, Debug, Clone, PartialEq, Eq)]
pub enum Pages {
#[to = "/{name}/{*:details}"]
Details {
name: Str... |
use std::fmt;
use actix::prelude::*;
use once_cell::sync::Lazy;
use regex::Regex;
use scraper::{ElementRef, Html};
use serde::{Deserialize, Serialize};
use crate::caltrain_status::Error::{HtmlError, InvalidIntError};
static NUMERIC: Lazy<Regex> = Lazy::new(|| Regex::new("[0-9]+").unwrap());
#[derive(Serialize, Dese... |
// Copyright 2018-2019 Mozilla
//
// 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, sof... |
#![doc = "generated by AutoRust 0.1.0"]
#![allow(non_camel_case_types)]
#![allow(unused_imports)]
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct DeploymentExtendedFilter {
#[serde(rename = "provisioningState", default, skip_serializing_if = "Option::is_non... |
use anyhow::{Context, Result};
use regex::Regex;
use std::collections::HashSet;
use structopt::{
clap::crate_authors, clap::crate_description, clap::crate_version, clap::AppSettings, StructOpt,
};
use uvm_cli::{options::ColorOption, set_colors_enabled, set_loglevel};
use uvm_core::unity::VersionType;
use uvm_versio... |
pub mod state;
pub mod utils; |
// Create the Error, ErrorKind, ResultExt, and Result types
error_chain!{
foreign_links {
Io(::io::Error);
Hyper(::hyper::Error);
SerdeJSON(::serde_json::Error);
}
}
|
#![feature(str_split_once)]
#[macro_use]
extern crate lazy_static;
mod day01;
mod day02;
mod day03;
mod day04;
mod day05;
mod day06;
mod day07;
mod day08;
mod day09;
mod day10;
mod day11;
mod day12;
mod day13;
fn main() {
day01::part1();
day01::part2();
day02::part1();
day02::part2();
day03::part... |
#[doc = "Register `FCR3` reader"]
pub type R = crate::R<FCR3_SPEC>;
#[doc = "Register `FCR3` writer"]
pub type W = crate::W<FCR3_SPEC>;
#[doc = "Field `TZSCFC` reader - TZSCFC"]
pub type TZSCFC_R = crate::BitReader;
#[doc = "Field `TZSCFC` writer - TZSCFC"]
pub type TZSCFC_W<'a, REG, const O: u8> = crate::BitWriter<'a,... |
#![allow(unused_variables)]
fn main() {
let number = 3;
// if / else
// ---------
if number < 5 {
println!("lower than five");
} else if number == 5 {
println!("equal to five");
} else {
println!("greater than five");
}
// condition must always evaluate to bool... |
use std::collections::BTreeSet;
use std::fs::read_dir;
use std::process::Command;
use insta::assert_snapshot;
/// Bit of a jank test, runs `cargo run -p hydroflow --example <EXAMPLE>` for all the
/// `example_*.rs` examples and uses `insta` to snapshot tests the stdout.
#[test]
fn test_all() {
let examples_files ... |
pub struct Interpolator {
pub pts : Vec<[f32;2]>,
}
impl Interpolator {
pub fn at(&self, input : f32) -> f32 {
for i in 0..(self.pts.len() - 1) {
if self.pts[i][0] <= input && input <= self.pts[i + 1][0] {
let frac = (input - self.pts[i][0]) /
(sel... |
#[doc = "Register `DEACHINTMSK` reader"]
pub type R = crate::R<DEACHINTMSK_SPEC>;
#[doc = "Register `DEACHINTMSK` writer"]
pub type W = crate::W<DEACHINTMSK_SPEC>;
#[doc = "Field `IEP1INTM` reader - IN Endpoint 1 interrupt mask bit"]
pub type IEP1INTM_R = crate::BitReader;
#[doc = "Field `IEP1INTM` writer - IN Endpoint... |
extern crate regex;
use std::io::{stdin,stdout,Write};
use std::process::Command;
pub mod mods;
pub use mods::parser::Node;
fn main() {
/*main = { [];const x = "Hello World!";println!("{}",x);mut y = "Hello World!";println!("{}",y);y = "Bye!";println!("{}",y);}*/
let big = "
fibonacci = { [(n:u32)->u128];
... |
impl Solution {
pub fn check_possibility(nums: Vec<i32>) -> bool {
let n = nums.len();
let mut cnt = 0;
//让数组可变
let mut nums = nums;
for i in 0..n-1{
let x = nums[i];
let y = nums[i+1];
if x > y{
cnt += 1 ;
i... |
use proconio::{fastout, input};
const MOD: i64 = 1_000_000_000 + 7;
#[fastout]
fn main() {
input! {
n: usize,
k: usize,
mut a_vec: [i64; n],
};
let (mut s, mut t): (Vec<i64>, Vec<i64>) = (Vec::new(), Vec::new());
a_vec.iter().for_each(|a| {
if *a >= 0 {
s.pu... |
use itertools::Itertools;
use std::collections::HashSet;
use std::env;
use std::iter::FromIterator;
use std::str::FromStr;
fn parse_path(path_str: &str) -> Vec<(i32, i32)> {
let mut point = (0, 0);
path_str
.split(',')
.flat_map(|dir| {
println!("started line {} at {:?}", dir, poin... |
use lazy_static::lazy_static;
use pulldown_cmark::{Event, Tag};
use regex::Regex;
use std::iter::Peekable;
pub struct EmbedYoutube<'a, I: Iterator<Item = Event<'a>>> {
parent: Peekable<I>,
}
impl<'a, I: Iterator<Item = Event<'a>>> EmbedYoutube<'a, I> {
pub fn new(parent: I) -> Self {
Self {
... |
use crate::vec::{vec3, Vec3};
use rand::prelude::*;
use rand::rngs::SmallRng;
#[allow(dead_code)]
pub fn degrees_to_radians(degrees: f64) -> f64 {
return degrees * std::f64::consts::PI / 180.0;
}
pub fn clamp(x: f64, min: f64, max: f64) -> f64 {
if x < min {
return min;
}
if x > max {
... |
use std::env;
use bson::doc;
use crate::Client;
type Result<T> = anyhow::Result<T>;
struct TempVars {
restore: Vec<(&'static str, Option<std::ffi::OsString>)>,
}
impl TempVars {
#[must_use]
fn set(vars: &[(&'static str, &str)]) -> TempVars {
let mut restore = vec![];
for (name, value) i... |
use schema::TextOptions;
use schema::U32Options;
use rustc_serialize::json::Json;
use schema::Value;
/// Possible error that may occur while parsing a field value
/// At this point the JSON is known to be valid.
#[derive(Debug)]
pub enum ValueParsingError {
/// Encounterred a numerical value that overflows or un... |
use super::*;
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq)]
#[repr(transparent)]
pub struct Color(pub u16);
impl Color {
const_new!();
bitfield_int!(u16; 0..=4: u8, red, with_red, set_red);
bitfield_int!(u16; 5..=9: u8, green, with_green, set_green);
bitfield_int!(u16; 10..=14: u8, blue, with_blue, set... |
// This file is part of Substrate.
// Copyright (C) 2017-2020 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// 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
//
// ht... |
use rocket::fairing::{Fairing, Info, Kind};
use rocket::http::Header;
use rocket::{http::Method, http::Status, Request, Response};
use std::io::Cursor;
use crate::config::CONFIG;
pub struct CorsFairing;
impl Fairing for CorsFairing {
fn info(&self) -> Info {
Info {
name: "Add CORS headers",
... |
#[derive(Debug, PartialEq)]
pub enum Direction {
North,
South,
East,
West,
Left,
Right,
Forward,
}
#[derive(Debug, PartialEq)]
pub struct Instruction {
direction: Direction,
units: i32,
}
#[derive(Debug, PartialEq)]
pub struct Ship {
instructions: Vec<Instruction>,
curr_direc... |
pub fn a(input: String) -> String {
let mut grid = input.lines().map(|l| l.chars().cycle());
let mut trees = 0;
grid.next();
let mut y_axis = 3;
for mut line in grid {
let c = line.nth(y_axis).unwrap();
if c == '#' {
trees += 1;
}
y_axis += 3;
}
f... |
#[doc = "Reader of register DDRPHYC_BISTBER0"]
pub type R = crate::R<u32, super::DDRPHYC_BISTBER0>;
#[doc = "Reader of field `ABER`"]
pub type ABER_R = crate::R<u32, u32>;
impl R {
#[doc = "Bits 0:31 - ABER"]
#[inline(always)]
pub fn aber(&self) -> ABER_R {
ABER_R::new((self.bits & 0xffff_ffff) as u... |
#[doc = "Register `DDRCTRL_DFIUPD2` reader"]
pub type R = crate::R<DDRCTRL_DFIUPD2_SPEC>;
#[doc = "Register `DDRCTRL_DFIUPD2` writer"]
pub type W = crate::W<DDRCTRL_DFIUPD2_SPEC>;
#[doc = "Field `DFI_PHYUPD_EN` reader - DFI_PHYUPD_EN"]
pub type DFI_PHYUPD_EN_R = crate::BitReader;
#[doc = "Field `DFI_PHYUPD_EN` writer -... |
use std::rc::Rc;
use dprint_core::formatting::*;
use dprint_core::formatting::{parser_helpers::*,condition_resolvers, conditions::*};
use swc_ecmascript::ast::*;
use swc_common::{comments::{Comment, CommentKind}, BytePos, Span, Spanned};
use swc_ecmascript::parser::{token::{TokenAndSpan}};
use super::*;
use super::swc... |
#![cfg_attr(feature="alloc_system",feature(alloc_system))]
#[cfg(feature="alloc_system")]
extern crate alloc_system;
extern crate crypto;
#[macro_use]
extern crate serde_json;
extern crate crossbeam;
extern crate walkdir;
extern crate semver;
extern crate zip;
extern crate tempdir;
extern crate libc;
extern crate uuid;... |
use anchor_lang::{AccountsExit, Key, prelude::*};
use anchor_spl::token::{self, Burn, Mint, MintTo, TokenAccount, Transfer};
use spl_token::state::Account as SPLTokenAccount;
use solana_program::{program::invoke, program_error::ProgramError, program_pack::Pack, system_instruction, system_program};
declare_id!("5JqFVkV... |
pub mod models;
pub mod operations;
#[allow(dead_code)]
pub const API_VERSION: &str = "2018-02-01-preview";
|
use crate::NumberStyle;
use std::cmp::Ordering::*;
use std::cmp::Ordering;
pub trait Section {
fn print_info(&self, style: NumberStyle);
fn start(&self) -> u64;
fn size(&self) -> usize;
fn end(&self) -> u64 {
self.start() + self.size() as u64 - 1
}
fn compare_offset(&self, offset: u... |
#[doc = "Register `DDRPHYC_DX0DQTR` reader"]
pub type R = crate::R<DDRPHYC_DX0DQTR_SPEC>;
#[doc = "Register `DDRPHYC_DX0DQTR` writer"]
pub type W = crate::W<DDRPHYC_DX0DQTR_SPEC>;
#[doc = "Field `DQDLY0` reader - DQDLY0"]
pub type DQDLY0_R = crate::FieldReader;
#[doc = "Field `DQDLY0` writer - DQDLY0"]
pub type DQDLY0_... |
macro_rules! toml_template {
($name:expr, $edition:expr) => {
format_args!(
r##"[package]
name = "{name}-fuzz"
version = "0.0.0"
publish = false
{edition}
[package.metadata]
cargo-fuzz = true
[dependencies]
libfuzzer-sys = "0.4"
[dependencies.{name}]
path = ".."
# Prevent this from interferin... |
use crate::NodeClient;
use async_trait::async_trait;
use lru::LruCache;
use parking_lot::Mutex;
use subspace_archiving::archiver::is_piece_valid;
use subspace_core_primitives::crypto::kzg::Kzg;
use subspace_core_primitives::{Piece, PieceIndex, SegmentCommitment, SegmentIndex};
use subspace_networking::libp2p::PeerId;
u... |
use super::{Load, traits::{Allocate, New}};
use image::{GenericImage};
use super::utils;
use super::shader;
use super::vao;
#[derive(Debug, Default)]
pub struct Texture {
id: gl::types::GLuint,
width: i32,
height: i32,
quad_shader: shader::Shader,
quad: vao::Vao,
internal_format: gl:... |
use crate::{Vec3, Ray, Intersect, DistanceField, SurfaceInteraction};
/// A sphere primitive.
pub struct Sphere {
origin: Vec3,
radius: f32,
}
impl Sphere {
/// Create a new Sphere.
///
/// # Examples
/// ```
/// use obscura::{Sphere, Vec3};
///
/// let origin = Vec3::zero();
... |
use crate::rendering::meshrenderable::scale_color;
use crate::rendering::render_context::RenderContext;
use cgmath::{InnerSpace, Vector2};
use ggez::graphics::{Color, WHITE};
use scale::map_model::{Map, TrafficBehavior};
pub struct RoadRenderer;
const MID_GRAY: Color = Color {
r: 0.5,
g: 0.5,
b: 0.5,
a... |
extern crate trousers_sys;
use std::error;
use std::ffi;
use std::fmt;
use std::slice;
use trousers_sys::trousers::*;
use trousers_sys::tspi::*;
pub type TssFlag = u32;
pub type TssHObject = u32;
pub type TssHContext = TssHObject;
pub type TssHTPM = TssHObject;
pub type TssHPCRS = TssHObject;
pub type TssResult = u32... |
// Copyright (c) Facebook, Inc. and its affiliates.
use anyhow::{anyhow, bail, Result};
use crossbeam::channel::Sender;
use env_logger;
use glob::glob;
use lazy_static::lazy_static;
use log::{info, warn};
use num;
use simplelog as sl;
use std::cell::RefCell;
use std::env;
use std::ffi::{CString, OsStr, OsString};
use s... |
use std::fs;
fn main() {
let mut program = fs::read_to_string("input.txt")
.unwrap()
.trim()
.split(",")
.map(|x| x.parse::<u32>().unwrap())
.collect::<Vec<u32>>();
program[1] = 12;
program[2] = 2;
// for x in &program {
// println!("{}", x);
// }
... |
use serde::{Deserialize, Serialize};
use super::audio_status_code;
#[derive(Serialize, Deserialize, Debug, PartialEq)]
pub struct Audit {
status: Option<audio_status_code::AudioStatusCode>,
feed_back: Vec<String>,
init: Option<i32>,
lastmod: Option<i32>,
corr: Option<Correction>,
ext: Option<A... |
pub mod grand_product;
pub mod permutation;
pub mod well_formed;
pub mod s_perm;
|
use crate::{
custom_client::MedalCount,
database::OsuData,
embeds::{EmbedData, MedalCountEmbed},
pagination::{MedalCountPagination, Pagination},
util::{constants::OSEKAI_ISSUE, numbers, InteractionExt, MessageExt},
BotResult, Context,
};
use eyre::Report;
use std::sync::Arc;
use twilight_model:... |
use core::future::Future;
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
#[non_exhaustive]
pub enum Error {
Other,
}
pub trait Read {
type ReadFuture<'a>: Future<Output = Result<(), Error>>
where
Self: 'a;
fn read<'a>(&'a mut self, buf: &'a ... |
//! Module defining the initial page of the application.
//!
//! It contains elements to select network adapter and traffic filters.
use iced::widget::scrollable::Direction;
use iced::widget::tooltip::Position;
use iced::widget::{
button, horizontal_space, vertical_space, Button, Column, Container, PickList, Row, ... |
extern crate rand;
pub mod math;
|
use nextcloud_config_parser::parse;
fn main() {
let config = match parse("tests/configs/basic.php") {
Ok(config) => config,
Err(err) => {
eprintln!("{}", err);
return;
}
};
dbg!(config);
}
|
use std::{env, fs::File, io::{Read, Write}, path::Path};
use positioned_io::WriteAt;
static BOOTLOADER: &str = "BootLoader.bin";
static KERNEL32: &str = "Kernelx86.bin";
static KERNEL64: &str = "Kernelx64.bin";
static DISK: &str = "Disk.img";
#[inline]
fn u16_to_u8(v: u16) -> [u8; 2] {
[
v as u8,
... |
#![allow(clippy::forget_non_drop)]
// This example exists to allow for profiling
// applications to provide details about
// the criterion benchmarks
use ress::Tokenizer;
static COMMENTS: &[&str] = &[
"//this is a comment",
"/*this is a
multi-line comment*/",
"<!-- This is an HTML comment -->",
"<!-- T... |
use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;
#[allow(dead_code)]
struct Scanner<'a> {
cin: StdinLock<'a>,
}
#[allow(dead_code)]
impl<'a> Scanner<'a> {
fn new(cin: StdinLock<'a>) -> Scanner<'a> {
Scanner { cin: cin }
}
fn read<T: FromStr>(&mut self) -> Option<T> {
let t... |
pub const CONFIG_FILENAME: &str = "config.toml";
pub const CONTENT_TYPE_JSON: &str = "application/json";
pub const ERR_MSG_PAYLOAD_PARSE_ORDERBY_FAIL: &str = "parse orderby list fail";
pub const ERR_MSG_PAYLOAD_PARSE_TIME_COND_FAIL: &str = "parse time condition fail";
|
use amethyst::{
assets::ProgressCounter,
core::{nalgebra::Vector2, transform::components::Transform},
ecs::prelude::*,
renderer::{Transparent,Flipped},
shrev::EventChannel,
};
use crate::{
components::{
for_characters::{player::Position, Engine, FuelTank, TagGenerator},
physics:... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.