text
stringlengths
3.09k
13.9k
extern crate futures; extern crate tokio; extern crate getopts; extern crate cpal; extern crate rb; extern crate nix; extern crate terminal_size; extern crate hex_conf; extern crate hex_database; extern crate hex_music_container; mod audio; mod play; mod modify; mod sync; use std::io::{self, Write, BufRead}; use std...
use crate::data::{errors::*, item::*, states::*, *}; use chrono::prelude::*; pub struct IndexPage; impl IndexPage { fn main_content( ui: &mut egui::Ui, frame: &mut epi::Frame<'_>, search_term: &mut String, (password, confirm_pass, current_account): ( &mut String, ...
// Copyright (c) 2021 <NAME>. All rights reserved. // Licensed under the MIT License. #![allow(non_upper_case_globals)] //! Implements `Servers` which exposes C++ part through FFI. use crate::bindings::*; use laplace_eq_therm::{GlobalInfo, LocalInfoType, SimulationResult, SimulationResults}; use std::ffi::{c_void, C...
// This file is part of Substrate. // Copyright (C) 2017-2021 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...
/* Day 20: Trench Map You have 2 parts, an image enhancement algorithm, and an image map. The image map is a 2d grid. To enhance each point in the grid: look at the surrounding points (9 points total) Convert them to binary. For example: ... #.. .#. ...#...#. == 000100010 == 34 look up the ...
#[macro_use] extern crate lazy_static; use regex::Regex; use std::fs::File; use std::path::Path; use serde_json::json; use tiny_http::{Method, Request, Response, Server, StatusCode}; use std::sync::Arc; use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; use std::thread; mod craft; use crate::craft::recipe::...
extern crate libc; extern crate gl; extern crate cgmath; extern crate image; #[macro_use] extern crate enum_primitive; #[macro_use] extern crate bitflags; use libc::{ c_void, c_int, c_char }; mod ffi; use ffi::*; mod events; pub use events::{ Event, MouseButton, Key, Modifiers }; pub mod gfx; pub trait Game { ...
#![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] include!("./bindings.rs"); use std::convert::TryInto; use std::fmt::Debug; use std::marker::PhantomData; use std::mem::size_of; use std::mem::transmute; unsafe extern "C" fn iter_trampoline<T, I, const N: i32>( rect: *con...
use crate::{interval::Interval, simd::*}; use std::mem::transmute; impl Interval { pub(crate) fn classify(self) -> IntervalClass { let zero = splat(0.0); let ge_zero = bitmask(ge(self.rep, zero)) as u8; let le_zero = bitmask(le(self.rep, zero)) as u8; unsafe { transmute((le_zero << ...
//! Game of Life app use ggez::conf; use ggez::event::{self, EventHandler}; use ggez::graphics::{self, DrawMode, DrawParam, Mesh}; use ggez::input::{ self, keyboard::{KeyCode, KeyMods}, mouse::MouseButton, }; use ggez::{Context, ContextBuilder, GameResult}; use super::gui::{render_ui, ImGuiWrapper, UiStat...
use std::collections::HashMap; use std::fs::{self, File}; use std::io::Read; use std::path::{Path, PathBuf}; use std::time::Instant; use plugin::PluginChain; use vfs::VfsItem; /// Represents a virtual layer over multiple parts of the filesystem. /// /// Paths in this system are represented as slices of strings, and a...
use futures::io::ErrorKind; use futures::task::{Context, Poll}; use futures::{AsyncBufRead, Future}; use std::io::{Error, Result}; use std::pin::Pin; pub trait AsyncTokenReader: AsyncBufRead { fn read_until_token<'a>( &'a mut self, token: &'a [u8], buf: &'a mut [u8], state: &'a mut ...
use super::{ fanout::{self, Fanout}, task::Task, ConfigDiff, }; use crate::{ buffers, config::{DataType, SinkContext, TransformContext}, dns::Resolver, event::Event, shutdown::SourceShutdownCoordinator, Pipeline, }; use futures::{compat::Future01CompatExt, FutureExt}; use futures01::...
mod authfields; mod client_context; mod client_info; mod command_info; mod commit_options; mod connect_options; mod execution_result; mod fetch_options; mod hdb_value; mod lob_flags; mod multiline_option_part; mod option_part; mod option_value; mod output_parameters; mod parameter_descriptor; mod parameter_rows; mod pa...
use std::thread::sleep; use std::time::Duration; use log::*; use rppal::i2c::I2c; use serde::Deserialize; use crate::Result; // https://cdn-shop.adafruit.com/datasheets/PCA9685.pdf #[allow(dead_code)] enum Register { /// Mode register 1 Mode1 = 0, /// Mode register 2 Mode2 = 1, /// I2C-bus subadd...
#[macro_use] extern crate scan_fmt; use std::collections::HashMap; use std::collections::HashSet; const INPUT: &'static str = include_str!("input.txt"); fn main() { println!("Part One: {}", part_one()); println!("Part Two: {}", part_two()); } struct Entry { // year: u32, // month: u32, // day: u...
//! Multiply function. use std::fmt; use std::rc::Rc; use std::collections::HashMap; use crate::model::node::Node; use crate::model::node_base::NodeBase; use crate::model::node_std::{NodeStd, NodeStdProp}; use crate::model::constant::ConstantScalar; /// Multiply function. pub struct FunctionMul { args: (Node, No...
// Copyright 2017-2019 Parity Technologies (UK) Ltd. // This file is part of Substrate. // Substrate 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) a...
use serum_common::pack::Pack; use serum_safe::accounts::{Safe, TokenVault, Vesting}; use serum_safe::error::{SafeError, SafeErrorCode}; use solana_sdk::account_info::{next_account_info, AccountInfo}; use solana_sdk::info; use solana_sdk::pubkey::Pubkey; use solana_sdk::sysvar::clock::Clock; use solana_sdk::sysvar::Sysv...
// Copyright 2015 <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, ...
//! The block producer. //! //! The java-tron's block producer is not optimized. //! It sleeps and wait for next slot, so it can only use 750ms(default) to generate a block, //! Making the 3s block producing interval meaningless. use chrono::Utc; use futures::future::FutureExt; use indexmap::IndexMap; use log::{debug,...
use std::convert::TryFrom; use defi::DeFiContract; use deployer_contract::ContractContract as DeployerContract; use fungible_token::ContractContract as FtContract; use near_sdk::AccountId; use shared::TokenWithRatioValid; use token_set_fungible_token::ContractContract as TokenSetContract; use near_sdk::json_types::{V...
pub(crate) type AccountId = sp_core::crypto::AccountId32; pub(crate) type BlockNumber = u32; pub(crate) type Moment = u64; pub(crate) type Balance = u128; pub(crate) type Header = sp_runtime::generic::Header<BlockNumber, sp_runtime::traits::BlakeTwo256>; pub(crate) type Hash = sp_core::H256; pub(crate) type Index = u32...
use ate::mesh::Registry; use std::future::Future; use std::pin::Pin; use std::sync::Arc; use std::sync::Mutex; use term_lib::api::ConsoleRect; use term_lib::api::System; use term_lib::console::Console; use thrussh::server; use thrussh::server::Auth; use thrussh::server::Session; use thrussh::ChannelId; use thrussh_keys...
use crate::cache::MessageMeta; use maildir::MailEntry; use maildir::Maildir as SubMaildir; use std::collections::HashMap; use std::path::PathBuf; //use std::time::SystemTime; /// A wrapper around a maildir implementation pub struct Maildir { maildir: SubMaildir, } /// A struct representing a mail message in the M...
use crate::{ alipay::{ AlipayAppPrivKey, AlipayClient, CancelTrade, CancelTradeResp, Precreate, PrecreateResp, SignedResponse, TradeQuery, TradeQueryResp, }, guards::*, DbConn, IntoFlash, }; use askama::Template; use rocket::{ response::{Flash, Redirect}, State, }; use sails_db::...
//! Main entry point for CLI command to start server. use anyhow::{ensure, Context, Result}; use apollo_router::configuration::Configuration; use apollo_router::GLOBAL_ENV_FILTER; use apollo_router::{ConfigurationKind, FederatedServer, SchemaKind, ShutdownKind, State}; use directories::ProjectDirs; use futures::prelud...
extern crate simple_nn; use simple_nn::{Matrix, nn}; #[test] fn functions_softmax() { let input = Matrix::new_from(2, 7, vec![1.0, 2.0, 3.0, 4.0, 1.0, 2.0, 3.0, 8.0, 3.0, 1.0, 6.0, 12.0, 1.0, 2.0], true); let output = nn::functions::softmax(&input); let expected...
use crate::{ client::ScrapeClient, stage::{FlowControl, ScrapeStage}, value::JsonValue, }; use fantoccini::{ elements::Element, error::{CmdError, NewSessionError}, }; use futures::future::{BoxFuture, FutureExt}; use log::{info, warn}; use serde::{Deserialize, Serialize}; use serde_json::json; use st...
//! Day 4: Giant Squid use aoc21::{util::*, Quizzer}; use std::{convert::Infallible, str::FromStr}; /// Todays quiz implementation pub struct Quiz; impl Quizzer for Quiz { fn part1(&self, input: &str) -> String { let mut bingo: Bingo = input.parse().unwrap(); bingo.play_winning_score().to_string()...
//! This module defines a generic file format that allows to check if a given //! file generated by incremental compilation was generated by a compatible //! compiler version. This file format is used for the on-disk version of the //! dependency graph and the exported metadata hashes. //! //! In practice "compatible c...
//! ChaCha20 stream cipher implementation. //! //! Adapted from the `ctr` crate. // TODO(tarcieri): figure out how to unify this with the `ctr` crate (see #95) use crate::{ block::{Block, BUFFER_SIZE}, rounds::{Rounds, R12, R20, R8}, BLOCK_SIZE, MAX_BLOCKS, }; use core::{ cmp, convert::TryInto, ...
use crate::clipboard; use crate::display; use crate::filesystem; use crate::finder::Finder; use crate::handler; use crate::parser; use crate::structures::cheat::{Suggestion, VariableMap}; use crate::structures::config; use crate::structures::finder::{Opts as FinderOpts, SuggestionType}; use crate::structures::{config::...
// Copyright 2021 UINB Technologies Pte. 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 applicable law or ag...
extern crate zermelo; extern crate chrono; #[macro_use] extern crate serde_derive; extern crate clap; extern crate termcolor; mod config; mod printer; use config::Config; use printer::Printer; use chrono::prelude::*; use clap::{Arg, App}; use zermelo::Schedule; const SECONDS_PER_DAY: i64 = 24 * 60 * 60; fn main() {...
// Copyright 2019 <NAME>. // Licensed under the MIT license <https://opensource.org/licenses/MIT>. use std::fs::read_to_string; use std::path::Path; use clipboard::{ClipboardContext, ClipboardProvider}; use colored::*; use distance::*; use structopt::StructOpt; /// Welcome to Safe ChangeLog Detector! /// {n}This too...
use crate::{ sys::solid::abi::{self, EPOLLET, EPOLLIN, EPOLLOUT}, Interest, Token, }; use log::error; use std::os::solid::io::{AsRawFd, RawFd}; #[cfg(debug_assertions)] use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; use std::time::Duration; use std::{cmp, i32, io}; /// Unique id for use as `Selec...
// This file is part of Sulis, a turn based RPG written in Rust. // Copyright 2018 <NAME> // // Sulis 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 opt...
use std::collections::HashMap; use itertools::Itertools; fn main() { let input = include_str!("..\\input.txt"); let tiles = get_tiles(input); assert_eq!(326, count_black(&tiles)); let tiles = flip(tiles, 100); assert_eq!(3979, count_black(&tiles)); } fn flip(mut tiles: HashMap<(i32, i32, i32), bo...
use colored::*; use core::fmt::Debug; use lazy_static::lazy_static; use num::Integer; use regex::Regex; use serde::Deserialize; use std::collections::BTreeMap; use std::fmt; use std::fs; use std::path::PathBuf; use std::time::{Duration, Instant}; use super::strings::StringExt; pub mod macros; pub mod prelude; pub co...
use crate::shared::usecase::UseCase; use futures::future; use nettu_scheduler_domain::{Calendar, CalendarEvent, EventRemindersExpansionJob, Reminder}; use nettu_scheduler_infra::NettuContext; use std::iter::Iterator; use tracing::error; #[derive(Debug)] pub enum EventOperation { Created, Updated, } /// Synchr...
// Copyright (c) The Diem Core Contributors // SPDX-License-Identifier: Apache-2.0 use crate::{ account, deploy, shared::{self, MAIN_PKG_PATH}, }; use anyhow::{anyhow, Context, Result}; use diem_config::config::NodeConfig; use diem_crypto::PrivateKey; use diem_sdk::{ client::{AccountAddress, BlockingClient...
//! Literal types. use crate::huffman; use crate::io::SliceReader; use crate::Result; use byteorder::{ReadBytesExt, WriteBytesExt}; use std::borrow::Cow; use std::io::{Read, Write}; use std::u16; use trackable::error::Failed; pub(crate) fn encode_u16<W: Write>( mut writer: W, prepended_value: u8, prefix_bi...
use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)] pub struct LegStreamTerminationDate { /// LegStreamTerminationDateUnadjusted #[serde(skip_serializing_if = "Option::is_none")] #[serde(rename = "40257")] pub leg_stream_termination_date_unadjusted: Option<fix_...
use crate::{ immutable::{Band, Text}, PacketLine, StreamingPeekableIter, U16_HEX_BYTES, }; use std::{io, io::BufRead}; /// An implementor of [`BufRead`][io::BufRead] yielding packet lines on each call to [`read_line()`][io::BufRead::read_line()]. /// It's also possible to hide the underlying packet lines using...
// Copyright (c) The Starcoin Core Contributors // SPDX-License-Identifier: Apache-2.0 // Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 //! This file defines ledger store APIs that are related to the main ledger accumulator, from the //! root(LedgerInfo) to leaf(TransactionInfo). u...
extern crate bincode; extern crate fuzzer; extern crate serde; use std::io::Write; use std::os::raw::{c_int, c_uint, c_void}; use fuzzer::{ Command, CommandDataSpec, CommandSpec, Fuzzer, FuzzerBuilder, Input as CommandsInput, }; use rand::distributions::Uniform; use rand::Rng; use serde::{Deserialize, Serialize};...
//use oboe_sys as ffi; use num_traits::FromPrimitive; use std::fmt::{self, Display}; use super::{ AudioFormat, ChannelCount, ContentType, Direction, InputPreset, PerformanceMode, RawAudioStreamBase, SampleRateConversionQuality, SessionId, SharingMode, Usage, }; /** * Base trait containing parameters for aud...
// Title: 효율적인 해킹 // Link: https://www.acmicpc.net/problem/1325 use std::collections::{HashMap, HashSet}; use std::io::{stdin, stdout, BufRead, BufReader, BufWriter, Write}; use std::mem::swap; macro_rules! read_to_tuple { ($buffer:expr, $($t:ty),+) => {{ let mut line = String::new(); let buffer =...
// Copyright 2020-2021 The Datafuse Authors. // // SPDX-License-Identifier: Apache-2.0. use std::sync::atomic::AtomicBool; use std::sync::atomic::Ordering; use std::sync::Arc; use std::time::Duration; use std::time::Instant; use clickhouse_srv::connection::Connection; use clickhouse_srv::errors::ServerError; use clic...
use advent_of_code::bits::Bitstream; fn main() { for test_file in ["2021-12-16.sample_literal.txt", "2021-12-16.txt"] { println!( "------------------------- {} -------------------------", test_file ); let input_path = advent_of_code::env::get_puzzle_input_path(test_f...
extern crate num_cpus; extern crate serde; use crate::geometry::*; use crate::materials::MaterialId; use crate::math::*; use crate::parsing::Point3Data; use serde::{Deserialize, Serialize}; use tobj; use std::collections::HashMap; pub fn load_obj_file(filename: &str, material_mapping: &HashMap<String, MaterialId>) ...
#![allow(trivial_numeric_casts)] use core::marker::PhantomData; use core::num::{NonZeroU128, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize}; use core::ptr; use crate::buffer::Buffer; use crate::constants::{MAX_BUF_LEN, TABLE}; use crate::format::Format; use crate::grouping::Grouping; use crate::sealed::...
// Copyright (c) 2019 DDN. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. use futures::Future; use iml_agent::action_plugins::stratagem::{ action_warning, server::{generate_cooked_config, trigger_scan}, }; use prettytable::{cell, row...
use crate::{AkitaError, Wrapper, FromValue, ToValue, Params, GetTableName, GetFields}; use serde::{Serialize, Deserialize}; #[derive(Clone, Deserialize, Serialize)] pub struct IPage <T> where T: Sized { pub total: usize, pub size: usize, pub current: usize, pub records: Vec<T> } impl <T> IPage <...
//! Items mainly locked by Fremennik. use super::ExprMap; use crate::{ bool_expr::{BoolExpr, BoolExprBuilder}, vars::Region, }; fn expr() -> BoolExpr<Region> { BoolExpr::new(Region::Fremennik) } /// Add requirements for the following items: /// - [Dragon Slayer II](https://oldschool.runescape.wiki/w/Drag...
use aoc_runner_derive::{aoc, aoc_generator}; use regex::Regex; use std::collections::{HashMap, HashSet}; // The HashMap solution and the bitmask solution are both possible // This is the HashMap solution #[derive(Debug, Clone)] pub struct Rule { name: String, min1: usize, max1: usize, min2: usize, ...
//! This file is derived from `cortex-m-rt` crate, with `Reset` //! function modified. use core::{ptr, mem, fmt}; use super::{main, hardfault_handler}; #[link_section = ".vector_table.reset_vector"] #[no_mangle] pub static __RESET_VECTOR: unsafe extern "C" fn() -> ! = Reset; /// Registers stacked (pushed into the s...
use crate::kernel::tasks::{TaskManager, TaskManager_C1, schedule}; use crate::system::resource::{PiStackGlobal, PiStackGlobal_C1, Resource}; use crate::system::scheduler::{BooleanVector, Scheduler}; use crate::utils::arch::{critical_section, Mutex}; use crate::system::spinlock::{spinlock, spinlock_try, spinunlock, TASK...
use crate::{ engine::{ KeyboardKey, MouseButton }, ecs::{ GlobalComponent, GlobalComponentStorage }, }; use pill_core::{ PillTypeMapKey, Vector2f }; use std::{ any::Any, cell::RefCell, collections::HashMap, }; use winit::dpi::PhysicalPosition; use winit::event::{ ElementState, MouseScrollDelta };...
//! Provides structures to identify nodes at various levels of the rule tree and a [Selector] to match on these structs. //! //! Rules are nested in up to three layers in the original XML: //! ```xml //! <category ...> //! <rulegroup ...> <!-- can be omitted, there's also <rule>s at this level --> //! <rule .....
/* * Copyright (c) 2021 gematik GmbH * * 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 std::mem::{self, size_of}; use std::ptr; use winapi::ctypes::wchar_t; use winapi::shared::minwindef::{UINT, USHORT, TRUE}; use winapi::shared::hidusage::{ HID_USAGE_PAGE_GENERIC, HID_USAGE_GENERIC_MOUSE, HID_USAGE_GENERIC_KEYBOARD, }; use winapi::shared::windef::HWND; use winapi::um::winnt::HANDLE; use...
use super::{BoxFilter, BoxFuture, DummyError, EitherError}; use futures::{future::ok, Future}; use serde::{de::DeserializeOwned, Serialize}; use std::error::Error; /// Extra filter pub trait HasFilter<X = ()> { type Arg: Send + Clone + 'static; /// Get filter fn filter(&self) -> BoxFilter<(Self::Arg,)>; }...
use super::{Inner, COMPLETE, NUMBER_BITS, NUMBER_MASK, RX_WAKER_STORED}; use crate::sync::spsc::{SpscInner, SpscInnerErr}; use alloc::sync::Arc; use core::{ fmt, ptr, sync::atomic::Ordering, task::{Context, Poll}, }; const IS_TX_HALF: bool = true; /// The sending-half of [`ring::channel`](super::channel)....
//! Owned variants of [`ChanTarget`] and [`CircTarget`]. use std::fmt::{self, Display}; use std::net::SocketAddr; use tor_llcrypto::pk; use crate::{ChanTarget, CircTarget}; /// OwnedChanTarget is a summary of a [`ChanTarget`] that owns all of its /// members. #[derive(Debug, Clone)] pub struct OwnedChanTarget { ...
extern crate accumulators; extern crate rand_chacha; use num_bigint::{BigInt, BigUint, IntoBigUint}; use num_traits::{One, Zero}; #[cfg(feature = "classgroup")] extern crate classgroup; //use crate::proofs; extern crate num_bigint; extern crate num_integer; extern crate num_traits; extern crate rand; //extern cr...
use std::{ net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr}, thread::sleep, time::Duration, }; use clap::Clap; use crypto::{digest::Digest, sha2::Sha224}; #[derive(Clap)] #[clap( version = "0.7.3", author = "<NAME>", about = "A trojan implementation using rust" )] pub struct Opts { #[clap(sub...
/*! ## About `wasm-tracing-allocator` enables you to better debug and analyze memory leaks and invalid frees in an environment where we don't have access to the conventional tools like Valgrind. The tracing hooks are safely implemented in JS, outside the Wasm module and its linear memory, to ensure that the tracing c...
// Copyright 2015 The Gfx-rs 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 ag...
use std::sync::Mutex; use crate::*; lazy_static! { static ref SEQUENCE: Mutex<u8> = Mutex::new(0); } static ssequence: u8 = 0x00; static start: u8 = 0x8d; static end: u8 = 0xd8; static escape: u8 = 0xab; static escape_mask: u8 = 0x88; static escaped_bytes: (u8,u8,u8) = (start & !escape_mask, end & !es...
use core::convert::TryFrom; use crate::elog; /// An event related to the mouse #[derive(Debug)] pub enum MouseEvent { /// A click with the main button Click(u32, u32), DoubleClick(u32, u32), Move(u32, u32), Enter(u32, u32), Leave(u32, u32), Up(Button, u32, u32), Down(Button, u32, u32), ...
use crate::DarnCommand; use anyhow::Result; use clap::{AppSettings, Arg, ArgGroup, ArgMatches, Command}; use daml::util::DamlSandboxTokenBuilder; /// Darn command for generating Daml Sandbox auth tokens. pub struct CommandToken {} impl DarnCommand for CommandToken { fn name(&self) -> &str { "token" } ...
// // Copyright 2021 The Project Oak 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 o...
use std::collections::VecDeque; use crate::html_entities::get_named_entities; use xmltree::ParserConfig; // TODO: fix spacing for inline tags such as <i> <b> etc. pub fn html_to_text( full_text: &str, start_anchor: Option<&str>, stop_anchor: Option<&str>, ) -> Result<String, xmltree::ParseError> { let...
use super::*; foreign_enum! { /// MSDN: [Device Management Events](https://docs.microsoft.com/en-us/windows/win32/devio/device-management-events) pub struct DBT(pub WPARAM); impl { APPYBEGIN = 0x0000; APPYEND = 0x0001; DEVNODES_CHANGED = 0x0007; QUERYCHANGECONFIG = 0x0017; CONFIGCHANGED = 0x0...
use itertools::Itertools; use std::ffi::OsStr; use std::fs::{read_to_string, write}; use std::path::{Path, PathBuf}; use crate::releases::{cargo, package_json, pyproject}; use crate::step::StepError; use serde::{Deserialize, Serialize}; /// Represents an entry in the `[[packages]]` section of `knope.toml`. #[derive(C...
use std::collections::HashMap; use std::fmt; use std::fs::File; use std::io::Read; use std::path::Path; use super::error::{Error, ErrorKind, Result}; use super::keytype::KeyType; use super::pubkey::PublicKey; use super::reader::Reader; use base64; /// Represents the different types a certificate can be. #[derive(Deb...
// SPDX-License-Identifier: MIT use actix::prelude::*; use log::warn; use serde_json::Value; use std::collections::HashMap; use std::fmt; use std::time::SystemTime; use crate::action::set::Set; use crate::api_error::{ActionErrorResponse, BAD_REQUEST_FILTER_INVALID}; use crate::api_type::{ActionPath, ActionSuccessResp...
use std::{ error::Error, fs::File, io::{BufRead, BufReader}, path::PathBuf, }; use ahash::AHashSet; const REQUIRED_FIELDS: [&str; 7] = ["byr", "iyr", "eyr", "hgt", "hcl", "ecl", "pid"]; const EYE_COLORS: [&str; 7] = ["amb", "blu", "brn", "gry", "grn", "hzl", "oth"]; fn check_valid(prefixes: &AHashSet...
/// CPS style evaluator. /// This could be improved by using Rc's as well for the AST, since it is often cloned to satisfy /// the borrowing and ownership rules of Rust. use crate::{values::{Val, Exp}, env::{EnvRef, Env}, ast::Expr}; use std::{cell::RefCell, rc::Rc}; #[derive(Clone)] enum ERes { Value(Exp), ...
use crate::utils::NodeExt; use gdnative::api::Engine; use gdnative::prelude::*; use rapier2d::{ dynamics::{ CCDSolver, IntegrationParameters, JointSet, RigidBodyBuilder, RigidBodyHandle, RigidBodySet, }, geometry::{BroadPhase, ColliderBuilder, ColliderSet, NarrowPhase}, na, pipeline::Physics...
use std::fmt; use crate::{ compiler::{Compile, Compiler, CompilerError, Instruction}, parser::{Parse, ParseResult, ParserError, Rule}, }; use pest::iterators::Pair; #[derive(Debug, Clone, PartialEq)] pub enum Value { Integer(i64), Float(f64), True, False, } impl fmt::Display for Value { ...
//! SMT-LIB binders: `let`, `match`, `forall`, and `exists`. // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 use super::{quantifier, Logic, Term}; use crate::{ fold::{Fold, Folder, SuperFold}, quantifier::InvalidQuantifier, IMatch, ISort, ISymbol,...
#![feature(vec_remove_item)] #[macro_use] extern crate handlebars; #[macro_use] extern crate lazy_static; mod task; #[macro_use] mod utils; mod router; mod store; mod hljs; mod blog; mod sn; mod render; use cfg_if::cfg_if; use js_sys::{Promise}; use utils::*; use wasm_bindgen::prelude::*; use wasm_bindgen_futures::J...
extern crate lv2_atom as atom; extern crate lv2_core as core; extern crate lv2_sys as sys; extern crate lv2_units as units; use atom::prelude::*; use atom::AtomHeader; use core::prelude::*; use lv2_urid::*; use units::prelude::*; use urid::*; #[derive(PortCollection)] struct Ports { input: InputPort<AtomPort>, ...
/* * Copyright 2019 <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 agre...
use crate::process::ProcessInfo; use crate::Column; use std::cmp; use std::collections::HashMap; pub struct Tree { header: String, unit: String, width: usize, tree: HashMap<i32, Vec<i32>>, rev_tree: HashMap<i32, i32>, symbols: [String; 5], } impl Tree { pub fn new(symbols: &[String; 5]) ->...
//! # Example //! //! `_binded_a`, `_binded_b` and `_binded_0` in below example are //! `BinededField`. //! //! ```rust //! struct S { //! a: u8, //! b: u16, //! } //! let s = S { a: 0, b: 0 }; //! match s { //! S { //! a: _binded_a, //! b: _binded_b, //! } => {} //! } //! enum E { //! ...
use crate::render::{ terrain::{Rect, HEIGHT_FORMAT}, Shaders, }; use bytemuck::{Pod, Zeroable}; use std::{mem, num::NonZeroU32}; use wgpu::util::DeviceExt as _; #[repr(C)] #[derive(Clone, Copy)] struct Vertex { _pos: [f32; 2], } unsafe impl Pod for Vertex {} unsafe impl Zeroable for Vertex {} struct Mip {...
extern crate gl; extern crate sdl2; use sdl2::event::Event; use sdl2::video::GLProfile; use std::time::Instant; use egui::{vec2, Color32, Image, Pos2, Rect}; //Alias the backend to something less mouthful use egui_sdl2_gl as egui_backend; const SCREEN_WIDTH: u32 = 800; const SCREEN_HEIGHT: u32 = 600; const PIC_WIDT...
use super::buffer::*; use super::keymap::*; use super::mode::*; use super::modes::normal::Normal; use super::modes::quitting; use crossterm::event::{Event, KeyCode, KeyEvent, KeyModifiers}; use lazy_static::lazy_static; use maplit::hashmap; use std::borrow::Cow; use std::collections::HashMap; use std::fs; pub struct C...
// Copyright (c) Microsoft. All rights reserved. #[derive(Clone, Copy)] pub(crate) struct ExIndices { pub(crate) engine: openssl::ex_data::Index<openssl_sys::ENGINE, crate::engine::Engine>, pub(crate) ec_key: openssl::ex_data::Index<openssl_sys::EC_KEY, KeyExData>, pub(crate) rsa: openssl::ex_data::Index<o...
// Rust Bitcoin Library // Written in 2018 by // <NAME> <<EMAIL>> // To the extent possible under law, the author(s) have dedicated all // copyright and related and neighboring rights to this software to // the public domain worldwide. This software is distributed without // any warranty. // // You should have rece...
// Copyright 2020 <NAME> <<EMAIL>> and collaborators // Licensed under the MIT License. //! Boostrapping Cranko on a preexisting repository. use anyhow::bail; use log::{error, info, warn}; use serde::{Deserialize, Serialize}; use std::{collections::HashMap, fs, io::Write}; use structopt::StructOpt; use super::Comman...
use legion::{systems::CommandBuffer, *}; use crate::core::{ components::{ animations::{ AnimationModifier, AnimationModifierType, AnimationStatus, Animations, ComputedKeyframeModifier, }, color::Color, material::Material, maths::transform::Transform, ...
use c04_advanced_opengl::{process_events, process_input, Camera, Model, Shader}; use cgmath::prelude::*; use cgmath::{perspective, vec3, Deg, Matrix4, Point3}; use dx::{ assets, gles::{core30::gl, enums::*}, utils::*, Instance, }; use rand::Rng; use std::time::SystemTime; use winit::{ event::*, ...
mod api; mod cell; mod header; mod range; mod restricted; mod sheet; mod token_manager; mod value; pub use api::*; pub use cell::*; pub use header::*; use once_cell::sync::OnceCell; pub use range::*; use reqwest::Client as ReqClient; #[cfg(feature = "restricted")] use restricted::*; use serde::{Deserialize, Serialize}...
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 use crate::{perf, tls, Result}; use futures::future::try_join_all; use s2n_quic::{ provider::io, stream::{BidirectionalStream, ReceiveStream, SendStream}, Connection, Server, }; use std::path::PathB...
// Copyright (c) The Starcoin Core Contributors // SPDX-License-Identifier: Apache-2.0 use crate::node::{AccumulatorStoreType, ACCUMULATOR_PLACEHOLDER_HASH}; use crate::node_index::NodeIndex; use crate::proof::AccumulatorProof; use crate::tree::AccumulatorTree; use anyhow::{ensure, Error, Result}; pub use node::Accumu...