text stringlengths 7.05k 33.9k |
|---|
use errors::{
in_method, invalid_type, method_return_type_invalid, report_similar, Error, Span,
SpannedObject, SpannedVector,
};
use mir::{Mir, MirCodeBlock};
use crate::{
compiler::state::typed_definition::{CheckAgainst, TypedMemory},
parser::{
expression::{BooleanOperator, Expr},
ty::... |
//! NES rom data container and utilities.
use std::fs::File;
use std::io::Read;
// use std::io::Result;
// use std::io::Error;
use std::error::Error;
use crate::nes::util;
pub const PRG_ROM_UNIT_SIZE: usize = 0x4000;
pub const CHR_ROM_UNIT_SIZE: usize = 0x2000;
/// NESのROM(バイナリ)情報を保存する構造体。
/// バイナリの構成については以下を参照。
//... |
// Most of this was inspired by and/or taken directly from https://github.com/bemasher/rtlamr
// TODO
// - add log trace/debug/info stuff
// - redo preamble bit/byte matching
// - the ProtocolParser trait
// - buffering techniques, get rid of the rotate_left's
// - add support for other data formats
// - cu8 current... |
use crate::errors::{RconNoPathFound, RconSourcePositionBlocked, RconTargetPositionBlocked};
use crate::factorio::entity_graph::QuadTreeRect;
use crate::types::{
Direction, FactorioEntity, FactorioEntityPrototype, FactorioTile, Pos, Position, Rect,
};
use dashmap::DashMap;
use factorio_blueprint::BlueprintCodec;
use... |
// 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... |
//! Queries to support the index node API
//!
// For git_testament_macros
#![allow(unused_macros)]
use diesel::dsl;
use diesel::prelude::{
ExpressionMethods, JoinOnDsl, NullableExpressionMethods, OptionalExtension, PgConnection,
QueryDsl, RunQueryDsl,
};
use diesel_derives::Associations;
use git_testament::{git... |
#![feature(rustc_private)]
#![deny(rust_2018_idioms)]
#![warn(unreachable_pub)]
#![recursion_limit = "256"]
#![allow(clippy::match_like_matches_macro)]
#[macro_use]
extern crate derive_new;
#[cfg(test)]
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate log;
// N.B. these crates are loaded from the sysr... |
pub mod history;
pub mod mailbox;
pub mod utils;
use constants::*;
use bitboard::BitBoard;
use std::boxed::Box;
use regex::Regex;
use zobrist;
use util::*;
use types::*;
use board::history::MoveContext;
use board::mailbox::{Mailbox};
use moves::types::{Move};
pub struct Board {
pub bb: BitBoard,
pub mb: Mailb... |
//! Maps *syntax* of various definitions to their semantic ids.
//!
//! This is a very interesting module, and, in some sense, can be considered the
//! heart of the IDE parts of rust-analyzer.
//!
//! This module solves the following problem:
//!
//! Given a piece of syntax, find the corresponding semantic definit... |
#![deny(missing_docs)]
//!
//! Bitcoind
//!
//! Utility to run a regtest bitcoind process, useful in integration testing environment
//!
//! ```no_run
//! use bitcoincore_rpc::RpcApi;
//! let bitcoind = bitcoind::BitcoinD::new("/usr/local/bin/bitcoind").unwrap();
//! assert_eq!(0, bitcoind.client.get_blockchain_info()... |
use std::{cell::RefCell, collections::HashMap, ops::Range, rc::Rc};
use font_kit::source::SystemSource;
use lyon::lyon_tessellation::{
BuffersBuilder, FillOptions, FillTessellator, FillVertex, StrokeOptions, StrokeTessellator,
StrokeVertex, VertexBuffers,
};
use piet::kurbo::Line;
use piet::Color;
use piet::{
... |
use lazy_static::lazy_static;
use pest::iterators::Pair;
use pest::Parser;
use pest_derive::Parser;
use regex::Regex;
use tera::{to_value, Context, Map, Value};
use crate::context::RenderContext;
use errors::{bail, Error, Result};
// This include forces recompiling this source file if the grammar file changes.
// Unc... |
use std::{
collections::{HashMap, HashSet},
fmt::Display,
};
use crate::utils::add_extra_where_clauses;
use proc_macro2::{Ident, Span, TokenStream};
use quote::{quote, quote_spanned};
use syn::{
parse::{Error, Result},
spanned::Spanned,
Attribute, Data, DeriveInput, Fields, Lit, Meta, MetaNameValue... |
use log::{debug, error, info};
use rayon::prelude::*;
use rspotify::spotify::client::Spotify;
use rspotify::spotify::model::artist::SimplifiedArtist;
use rspotify::spotify::model::context::SimplifiedPlayingContext;
use rspotify::spotify::oauth2::{SpotifyClientCredentials, SpotifyOAuth};
use rspotify::spotify::senum::Co... |
use regex::Regex;
use std::cmp::{min, max};
lazy_static! {
static ref FIELD_RANGE: Regex = Regex::new(r"^(?P<left>-?\d+)?(?P<sep>\.\.)?(?P<right>-?\d+)?$").unwrap();
}
#[derive(PartialEq, Eq, Clone, Debug)]
pub enum FieldRange {
Single(i32),
LeftInf(i32),
RightInf(i32),
Both(i32, i32),
}
impl Fie... |
// Copyright 2021. The Tari Project
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclai... |
// Copyright 2020-2021 <NAME>
// SPDX-License-Identifier: Apache-2.0
use crate::behaviour::{
message::{P2PEvent, P2PReqResEvent},
MessageEvent, P2PNetworkBehaviour,
};
use async_std::task;
use core::{
ops::Deref,
task::{Context as TaskContext, Poll},
};
use futures::{
channel::mpsc::{unbounded, Unb... |
use chrono::{Date, DateTime, Utc};
use std::fmt::Display;
use time::Time;
#[derive(Debug, Clone)]
pub enum SRU {
Info(InfoHeader, InfoContact),
Blanketter(Vec<Blankett>),
}
impl Display for SRU {
fn fmt(&self, fmt: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
match s... |
//! The JobControlShell can run command groups in the foreground and background,
//! in addition to the normal shell abilities such as managing the command
//! history.
use std::env;
use std::fmt;
use std::fs::File;
use std::path::{Path, PathBuf};
use std::process::{self, ExitStatus};
use atty::{self, Stream};
use di... |
//! Responsible for dealing with all input.
use piston::input::{Button, GenericEvent, Key, MouseButton};
use serde_json::json;
use std::error::Error;
use std::fs::File;
use std::path::Path;
use crate::common::{ButtonInteraction, Cell, Directions, DIMENSIONS_CHOICES};
use crate::nonogram_board::NonogramBoard;
/// Han... |
//! Support for the AES hardware block on OpenTitan
//!
//! <https://docs.opentitan.org/hw/ip/aes/doc/>
use core::cell::Cell;
use kernel::common::cells::{OptionalCell, TakeCell};
use kernel::common::dynamic_deferred_call::{
DeferredCallHandle, DynamicDeferredCall, DynamicDeferredCallClient,
};
use kernel::common::... |
use std::{
cmp::Ordering,
fmt::{self, Debug},
iter::{once, repeat, repeat_with},
ops::{Add, AddAssign, RangeBounds, Sub, SubAssign},
};
use Ordering::{Equal as EQ, Greater as GT, Less as LT};
use crate::{bits, fenwick::FenwickTree, num, num::Int, ops::*};
const UPPER_BLOCK: usize = 1 << 32;
const SUP... |
// Copyright 2017 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... |
/* lexer.rs
* -------- */
use crate::code::{Opcode, BinOp, BoolOp, ConstCode, get_prec, get_prec_bool};
use crate::expr::{Expr, walk_expr};
use crate::words::Word;
use unicode_segmentation::UnicodeSegmentation;
use rustyline::Editor;
/* HELPER FUNCTIONS */
fn num_chars(ch: &String) -> bool { return "012345678... |
/* Copyright 2021 <NAME> (https://github.com/al8n). Licensed under Apache-2.0.
*
* Copyright 2017 The Hashicorp's Raft repository authors(https://github.com/hashicorp/raft) authors. Licensed under MPL-2.0.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in com... |
//! The eHSI device-dependent polar color model
use crate::channel::{
AngularChannel, AngularChannelScalar, ChannelCast, ChannelFormatCast, ColorChannel,
PosNormalBoundedChannel, PosNormalChannelScalar,
};
use crate::color;
use crate::color::{Bounded, Color, FromTuple, Invert, Lerp, PolarColor};
use crate::con... |
#![allow(dead_code, unused_variables)]
use sdl2::init;
use sdl2::event::Event;
use sdl2::keyboard::Keycode;
use gl::types::*;
use std::mem;
use std::ptr;
mod shader;
mod utils;
mod sandbox;
mod vertex_shapes;
mod camera;
fn print_gl_version_and_profile(gl_attributes: &sdl2::video::gl_attr::GLAttr)
{
use sdl2::... |
use crate::game::graphics::vk::{Buffer, Graphics, Image, Pipeline, ThreadPool};
use crate::game::shared::enums::ShaderType;
use crate::game::shared::structs::{
Mesh, Model, ModelMetaData, PositionInfo, Primitive, PushConstant, Vertex,
};
use crate::game::shared::traits::{Disposable, GraphicsBase, Renderable};
use c... |
//! nom-based parser for Datalog values.
use num::bigint::*;
#[cfg(test)]
use num::Num;
use nom::*;
use differential_datalog::record::*;
use std::borrow::Cow;
#[derive(Debug,PartialEq,Eq,Clone)]
pub enum Command {
Start,
Commit,
Rollback,
Timestamp,
Profile,
Dump(Option<String>),
Exit,
... |
//! Tools for creating Descriptor and witness stack from given scriptpubkey and corresponding
//! scriptsig and witness.
//!
use bitcoin::{self, Script};
use bitcoin::blockdata::opcodes;
use bitcoin::blockdata::script::Instruction;
use descriptor::satisfied_constraints::Error as IntError;
use descriptor::satisfied_co... |
// Copyright 2020 - present <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 t... |
extern crate direction;
extern crate prototty;
extern crate prototty_common;
extern crate punchcards;
extern crate rand;
use std::fmt::Write;
use std::time::Duration;
use rand::{Rng, SeedableRng, StdRng};
use direction::CardinalDirection;
use punchcards::state::*;
use punchcards::tile::Tile;
use punchcards::tile_info:... |
//! driver for virtio device, only used for disk now
//!
//! from sec 2.6 in https://docs.oasis-open.org/virtio/virtio/v1.1/virtio-v1.1.pdf :
//! * Descriptor Table - occupies the Descriptor Area
//! * Available Ring - occupies the Driver Area
//! * Used Ring - occupies the Device Area
//!
//! NOTE: 4096 in... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - XT Oscillator Control"]
pub calxt: CALXT,
#[doc = "0x04 - RC Oscillator Control"]
pub calrc: CALRC,
#[doc = "0x08 - Autocalibration Counter"]
pub acalctr: ACALCTR,
#[doc = "0x0c - Oscillator Control"]
pub oc... |
mod iter;
use crate::inventory::STACK_SIZE;
use super::{
drop_items::DropItem,
dyn_iter::{DynIter, DynIterMut},
inventory::InventoryType,
items::ItemType,
underground_belt::UnderDirection,
water_well::FluidBox,
FactorishState, Inventory, InventoryTrait, Recipe,
};
use rotate_enum::RotateEn... |
use super::attribute;
use std::io::{BufReader, Read};
const PUBLIC: u16 = 0x0001;
const PRIVATE: u16 = 0x0002;
const PROTECTED: u16 = 0x0004;
const STATIC: u16 = 0x0008;
const FINAL: u16 = 0x0010;
const SYNCHRONIZED: u16 = 0x0020;
const BRIDGE: u16 = 0x0040;
const VARARGS: u16 = 0x0080;
const NATIVE: u16 = 0x0100;
con... |
use crate::common::TreeNode;
use std::cell::RefCell;
use std::rc::Rc;
struct Solution;
impl Solution {
// 50. Pow(x, n)
// https://leetcode-cn.com/problems/powx-n/
pub fn my_pow(x: f64, n: i32) -> f64 {
if n < 0 {
1.0 / Solution::my_pow_helper2(x, -(n as i64))
} else {
... |
use std::future::Future;
use std::io;
use std::pin::Pin;
use std::process::ExitStatus;
use std::rc::Rc;
use std::str::FromStr;
use std::time::Duration;
use anyhow::{anyhow, Context};
use clap::Parser;
use futures::TryFutureExt;
use tako::common::error::DsError;
use tako::messages::common::WorkerConfiguration;
use ta... |
#![crate_name = "day19"]
//! ## --- Day 19: Monster Messages ---
//!
//! You land in an airport surrounded by dense forest. As you walk to your high-speed train, the Elves at the Mythical Information Bureau contact you again. They think their satellite has collected an image of a sea monster! Unfortunately, the connec... |
//! Chapter 1. 数学の問題
use std;
/// 与えられた上限 `upper_limit` までの3または5で割り切れる正の整数の総和を求める。
pub fn sum_of_naturals_divisible_by_3_5(upper_limit: u32) -> u64 {
// 3の倍数の総和と5の倍数の総和から、15の倍数の総和を引く。
sum_of_mutiple(3, upper_limit/3) + sum_of_mutiple(5, upper_limit/5) - sum_of_mutiple(15, upper_limit/15)
}
#[test]
fn tes... |
/**
* Holo-REA 'economic resource' zome library API
*
* Contains helper methods that can be used to manipulate economic resource data
* structures in either the local Holochain zome, or a separate DNA-local zome.
*
* @package Holo-REA
*/
use hdk::prelude::*;
use hdk_records::{
DataIntegrityError, RecordAPIRe... |
use clap::{App, Arg, ArgMatches, SubCommand};
use thiserror::Error;
use super::{clap_arg_puzzle_part_time_two, read_file_contents, ReadFileContentsError};
pub const SUBCOMMAND_NAME: &str = "day08";
pub fn subcommand() -> App<'static, 'static> {
SubCommand::with_name(SUBCOMMAND_NAME)
.about("My solution ... |
/**
* Copyright [2020] [<NAME>]
* Licensed under the Apache License, Version 2.0 (the "License");
* y ou 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, ... |
use log::{debug, error, info};
use nom::bytes::complete::take;
use nom::combinator::cond;
use nom::multi::count;
use nom::number::complete::{le_u16, le_u32, le_u8};
use nom::IResult;
use std::fmt::{Display, Formatter, Result};
use crate::disk_format::stx::sector::{
stx_sector_data_parser, stx_sector_header_parser... |
//! Collection of utility functions to find path.
use std::{cmp::Ordering, collections::BinaryHeap};
use crate::Point;
pub type NodeId = usize;
/// Implement the Map trait to use the pathfinding functions.
pub trait PathMap {
/// Dimension of your map, in grid size.
fn dimensions(&self) -> (i32, i32);
/... |
#![allow(dead_code, unused_assignments)]
use bevy::prelude::*;
use crystal_planes::math::prelude::*;
use crystal_planes::octree;
use crystal_planes::octree_render;
fn main() {
App::build()
.add_plugins(DefaultPlugins)
// .add_startup_stage("renderer")
.add_plugin(bevy_fly_camera::FlyCameraPl... |
use super::super::{CommitDomains, HashDomains, SinsemillaInstructions};
use super::{NonIdentityEccPoint, SinsemillaChip};
use crate::{
ecc::FixedPoints,
sinsemilla::primitives::{self as sinsemilla, lebs2ip_k, INV_TWO_POW_K, SINSEMILLA_S},
};
use halo2_proofs::circuit::AssignedCell;
use halo2_proofs::{
circ... |
use crate::print_data::PrintData;
use crate::{Driver, Finger};
use std::{
convert::TryFrom,
fmt::{Display, Error, Formatter},
os::{
raw::{c_char, c_int, c_uchar},
unix::ffi::OsStrExt,
},
path::Path,
};
///
#[derive(Debug, Clone)]
pub struct Device(*mut fprint_sys::fp_dev);
impl Dev... |
use crate::group::*;
use crate::key::PublicKey;
use crate::keypackage::{self as kp, KeyPackage, MLS10_128_DHKEMP256_AES128GCM_SHA256_P256};
use crate::message::*;
use crate::utils::{decode_option, encode_option, encode_vec_u32, read_vec_u32};
use rustls::internal::msgs::codec::{self, Codec, Reader};
#[derive(Debug, Cl... |
//use num_derive::FromPrimitive;
use serde::Serialize;
#[derive(PartialEq, Clone, Debug, Serialize)]
pub enum TagSignature {
VendorTag(String),
AToB0Tag , /* 'A2B0' */
AToB1Tag , /* 'A2B1' */
AToB2Tag , /* 'A2B2' */
ATo... |
use core::ops::{
Add,
AddAssign,
Neg,
Sub,
SubAssign,
Mul,
MulAssign,
};
use subtle::{
Choice,
ConditionallySelectable,
ConstantTimeEq,
};
use super::FieldImplementation;
pub type Limbs = [i64; 16];
/// Element of the base field of the elliptic curve
#[derive(Clone,Copy,Debug... |
// Copyright (c) 2018-2021 The MobileCoin Foundation
use core::{cell::RefCell, convert::TryFrom};
use lazy_static::lazy_static;
use mc_account_keys::{AccountKey, PublicAddress};
use mc_attest_core::{MrSignerVerifier, Verifier, DEBUG_ENCLAVE};
use mc_common::{
logger::{create_app_logger, log, o, Logger},
HashMa... |
//! # Message Parser
//! The message parser is the low level API which takes care of encoding and decoding of Payloads.
//! The normal user should not need to interact with this directly to communicate with Tuya
//! devices, but rather create an instance of the TuyaDevice struct.
use crate::cipher::TuyaCipher;
use crat... |
use std::ffi::{OsStr, OsString};
use std::fs::File;
use std::io;
use std::path::{Path, PathBuf};
use std::process::Command;
use globset::{Glob, GlobSet, GlobSetBuilder};
use process::{CommandError, CommandReader, CommandReaderBuilder};
/// A builder for a matcher that determines which files get decompressed.
#[deriv... |
//
// dc4 main program state
//
// Copyright (c) 2015-2021 by <NAME>
//
use std::fmt;
use std::io::{self, BufRead, Write};
use num_bigint::BigInt;
use num_traits::{ToPrimitive, Zero};
use crate::big_real::BigReal;
use crate::dcregisters::DcRegisters;
use crate::parser::{Action, RegisterAction, Parser};
use crate::{Dc... |
//! Various utility functions used throughout rustbuild.
//!
//! Simple things like testing the various filesystem operations here and there,
//! not a lot of interesting happenings here unfortunately.
use std::env;
use std::fs;
use std::io;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
use std::... |
// Copyright 2019 The Chromium OS 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 std::mem::drop;
use std::sync::Arc;
use super::error::*;
use super::usb_endpoint::UsbEndpoint;
use super::utils::{submit_transfer, update_transfer... |
use super::archive::Archive;
use super::error::{ErrorKind, Result, ResultExt};
use super::image::Image;
use super::name::WadName;
use super::types::{Colormap, Palette, WadTextureHeader, WadTexturePatchRef};
use bincode;
use byteorder::{LittleEndian, ReadBytesExt};
use indexmap::IndexMap;
use math::prelude::*;
use math:... |
// Copyright 2017 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... |
mod constants;
pub mod dns;
mod errors;
mod globals;
pub mod odoh;
#[cfg(feature = "tls")]
mod tls;
use crate::constants::*;
pub use crate::errors::*;
pub use crate::globals::*;
use byteorder::{BigEndian, ByteOrder};
use futures::prelude::*;
use futures::task::{Context, Poll};
use hyper::http;
use hyper::server::conn... |
pub type c_char = i8;
pub type wchar_t = i32;
s! {
pub struct stat {
pub st_dev: ::dev_t,
__st_dev_padding: ::c_int,
__st_ino_truncated: ::c_long,
pub st_mode: ::mode_t,
pub st_nlink: ::nlink_t,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
pub st_rdev: :... |
use log::{debug, info, log_enabled, Level};
use futures_util::TryStreamExt;
use licoricedev::client::Lichess;
use licoricedev::models::board::Challengee::{LightUser, StockFish};
use licoricedev::models::board::{BoardState, Event};
use shakmaty::fen;
use shakmaty::fen::Fen;
use shakmaty::uci::{IllegalUciError, Uci};
u... |
use crate::{
block::{
compare_block_ids, convert_block_id_ext_api2blk, convert_block_id_ext_blk2api, BlockStuff
},
block_proof::BlockProofStuff, shard_state::ShardStateStuff,
network::neighbours::{Neighbours, Neighbour},
types::top_block_descr::TopBlockDescrStuff,
};
use adnl::{common::{ser... |
use core::convert::TryFrom;
use core::fmt::{self, Debug, Display, Error, Formatter};
use core::marker::PhantomData;
use core::slice;
use core::str;
use capstone_sys::*;
use crate::arch::ArchDetail;
use crate::constants::Arch;
use crate::ffi::str_from_cstr_ptr;
use crate::{Capstone, CsResult};
/// Representation of t... |
//! See docs in build/expr/mod.rs
use crate::build::expr::category::Category;
use crate::build::ForGuard::{OutsideGuard, RefWithinGuard};
use crate::build::{BlockAnd, BlockAndExtension, Builder};
use crate::hair::*;
use rustc::middle::region;
use rustc::mir::interpret::{PanicInfo::BoundsCheck};
use rustc::mir::*;
use ... |
use std::cmp::min;
use std::collections::HashSet;
use std::fs::{create_dir_all, File};
use std::num::NonZeroU8;
use std::path::{Path, PathBuf};
use std::time::SystemTime;
use aw_upscale::Upscaler;
use image::codecs::png::{CompressionType, FilterType, PngEncoder};
use image::imageops::overlay;
use image::{ColorType, Dy... |
// Magical Bitcoin Library
// Written in 2020 by
// <NAME> <<EMAIL>>
//
// Copyright (c) 2020 Magical Bitcoin
//
// 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, in... |
//!
//! Ported from [elm-lang's `Graphics.Collage` module]
//! (https://github.com/elm-lang/core/blob/62b22218c42fb8ccc996c86bea450a14991ab815/src/Graphics/Collage.elm).
//!
//!
//! This module is for freeform graphics. You can shift, rotate, scale etc. All sorts of forms
//! including lines, shapes, images and element... |
use std::os;
use std::collections::HashSet;
use std::env;
use std::fs;
use std::fs::File;
use std::io::{self, BufRead, BufReader, Write};
use std::path::Path;
use std::path::PathBuf;
use std::process::exit;
use std::process::{Command, Stdio};
use termcmd::TermCmd;
use config::Config;
pub struct BuildResult {
/// ... |
//! trycp_server listens for remote commands issued by tryorama and does as requested
//! with a set of Holochain conductors that it manages on the local machine.
mod holochain_interface;
mod registrar;
mod rpc_util;
use rpc_util::{internal_error, invalid_request};
use std::{
collections::HashMap,
fs::{self,... |
use crate::*;
use std::cell::RefCell;
thread_local!(
pub static ALLOC: RefCell<Allocator> = RefCell::new(Allocator::new());
);
const SIZE: usize = 64;
const GCBOX_SIZE: usize = std::mem::size_of::<GCBox<RValue>>();
const PAGE_LEN: usize = 64 * SIZE;
const DATA_LEN: usize = 64 * (SIZE - 1);
const THRESHOLD: usize ... |
// Copyright 2018-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... |
//!
//! USIプロトコル
//!
use crate::entities::cosmic::playing::Game;
use crate::entities::cosmic::recording::Phase;
use crate::entities::spaceship::equipment::Beam;
use crate::position::FILE_9;
use crate::position::RANK_1;
use crate::take1base::Move;
use crate::take1base::Piece;
use atoi::atoi;
use regex::Regex;
// 局面の最多合... |
use std::error::Error as StdError;
use std::hash::{Hash, Hasher};
use std::{fmt, i64, mem};
use num_traits::cast;
use rustc_hash::FxHashMap;
use gc_arena::{Collect, GcCell, MutationContext};
use crate::Value;
#[derive(Debug, Copy, Clone, Collect)]
#[collect(no_drop)]
pub struct Table<'gc>(pub GcCell<'gc, TableState... |
/*! Ordering of bits within register elements.
[`bitvec`] data structures are parametric over any ordering of bits within a
register type. The [`BitOrder`] trait translates a cursor position (indicated by
the [`BitIdx`] type) to an electrical position (indicated by the [`BitPos`]
type) within that register, thereby de... |
use serde::{
de::{Deserializer, Error as DeError, Visitor},
Deserialize,
};
use serde_json::Value as JsonValue;
use std::collections::HashMap;
/// The window webview URL options.
#[derive(PartialEq, Debug, Clone)]
pub enum WindowUrl {
/// The app's index URL.
App,
/// A custom URL.
Custom(String),
}
impl... |
use std::collections::HashMap;
use std::fmt;
use failure::{format_err, ResultExt};
use xcb_util::keysyms::KeySymbols;
use xcb_util::{ewmh, icccm};
use crate::groups::Group;
use crate::keys::{KeyCombo, KeyHandlers};
use crate::stack::Stack;
use crate::Result;
pub use self::ewmh::StrutPartial;
/// A handle to an X Wi... |
use crate::config::AppConfig;
use async_std::task;
use chrono::{DateTime, Local, NaiveTime, Utc};
use failure::{bail, format_err, Error};
use futures::future;
use log::{error, info, warn};
use stats_api::model::{
GameContentEditorialItemArticle, GameContentMilestoneItem, GameContentMilestoneItemHighlight,
GameC... |
use core::marker::PhantomData;
use mk20d7::sim::SCGC5;
/// Extension trait to split a GPIO peripheral in independent pins and registers
pub trait GpioExt {
/// The to split the GPIO into
type Parts;
/// Splits the GPIO block into independent pins and registers
fn split(self, scgc5: &SCGC5) -> Self::Pa... |
// Copyright 2016 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, software... |
//! Rust library for uploading events to AWS CloudWatch Logs.
#![warn(missing_docs)]
use fehler::{throw, throws};
use log::error;
use rusoto_core::RusotoError;
use rusoto_logs::{
CloudWatchLogs, CloudWatchLogsClient, DescribeLogStreamsError,
DescribeLogStreamsRequest, InputLogEvent, PutLogEventsError,
Put... |
#![no_std]
#[no_mangle]
pub extern "C" fn abort() -> ! {
motor_stop(MotorPort::A, false);
motor_stop(MotorPort::B, false);
motor_stop(MotorPort::C, false);
motor_stop(MotorPort::D, false);
sensor_config(SensorPort::S1, SensorType::NONE);
sensor_config(SensorPort::S2, SensorType::NONE);
sens... |
//! A path type exposed from the configuration crate
//!
//! This type allows the user to specify paths as strings, with some
//! support for tab expansion and user directory support.
use std::path::{Path, PathBuf};
use directories::{BaseDirs, ProjectDirs};
use once_cell::sync::Lazy;
use serde::{Deserialize, Serializ... |
// End-users should provide their own layer to translate from these general values to something
// appropriate to their platform or windowing system
// These match winit
#[derive(Copy, Clone, Debug)]
pub enum KeyboardKey {
/// The '1' key over the letters.
Key1,
/// The '2' key over the letters.
Key2,
... |
use std::time::{Duration, SystemTime};
use std::{cmp, fs, env, thread};
use sdl2::audio::{AudioSpecDesired, AudioQueue};
use sdl2::keyboard::Keycode;
use sdl2::render::Canvas;
use sdl2::pixels::Color;
use sdl2::video::Window;
use sdl2::event::Event;
use sdl2::rect::Rect;
use sdl2::EventPump;
use rand::random;
static S... |
// Copyright 2019, The Tari Project
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclai... |
/*
* 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 ... |
use ggez::graphics;
use rand::{seq::SliceRandom, Rng};
use semeion::*;
use std::{any::Any, sync::Arc};
use crate::entity::phero;
use crate::{entity, game};
use memory::*;
mod memory;
/// The Ant current activity.
#[derive(Debug, PartialEq, Eq)]
enum Activity {
/// The Ant is is search of food following
Forag... |
use crate::{
assets::{self, lookup},
esplora,
esplora::Utxo,
CHAIN, DEFAULT_SAT_PER_VBYTE,
};
use aes_gcm_siv::{
aead::{Aead, NewAead},
Aes256GcmSiv,
};
use anyhow::{bail, Context, Result};
use elements::{
bitcoin::{
self,
secp256k1::{SecretKey, SECP256K1},
util::amou... |
use std::{io, ptr, net};
use std::collections::{HashMap, VecDeque};
use std::io::{Cursor, Read, Write};
use std::sync::{atomic, mpsc, Arc};
use std::time::Instant;
use bitcoin::consensus::encode::{self, Decodable, Encodable};
use bitcoin::network::message::{NetworkMessage, RawNetworkMessage};
use crate::logic::{self... |
//! Rust implementation of the client-side application for the [CG
//! Local](https://www.codingame.com/forum/t/cg-local/10359) extension. This is a drop-in
//! replacement for the original [Java application](https://github.com/jmerle/cg-local-app) which
//! works with the original [browser extension](https://github.co... |
//! A library and command-line tool for detecting broken links in Markdown files.
//!
//! By default, this tool detects broken links like "[foo](file.md)" (target file does not exist)
//! and broken header links like "[foo](file.md#header)" (target file exists but specific header does not exist)
//!
//! ## Command-line... |
pub use crate::board::*;
pub use crate::board::{PieceColor::*, PieceKind::*};
pub use crate::engine::*;
pub use crate::move_generation::*;
pub use crate::time_control::*;
pub use crate::utils::*;
use crate::zobrist::ZobristHasher;
use log::{error, info};
use std::io::{self, BufRead};
use std::process;
use std::sync::mp... |
/// The create assessment request message.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateAssessmentRequest {
/// Required. The name of the project in which the assessment will be created,
/// in the format "projects/{project_number}".
#[prost(string, tag="1")]
pub parent: ::prost::alloc... |
use crate::{Error, Result};
use ::std::iter::once;
use ::std::{
convert::TryFrom,
fmt::{Binary, Debug, Display},
};
use ::strum::{Display, EnumCount};
#[derive(Debug, Clone, Copy, PartialEq, Display, EnumCount)]
pub enum Class {
/// N, H, H, H
#[strum(serialize = "class A network")]
A,
/// N, N... |
#![cfg_attr(not(feature = "std"), no_std)]
use crate::RandomnessCollectiveFlip;
use codec::{Decode, Encode};
use frame_support::{
dispatch::DispatchResult,
ensure,
traits::{Currency, ExistenceRequirement},
};
use frame_system::ensure_signed;
pub use pallet::*;
use sp_runtime::traits::{Hash, Zero};
use sp_s... |
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
use std::collections::HashMap;
use std::path::Path;
use std::path::PathBuf;
use anyhow::bail;
use anyhow::Result;
use futures::FutureExt;
use crate::commands::cat_command;
use crate::commands::cd_command;
use crate::commands::cp_command;
use ... |
use std::ops::Range;
use proc_macro2::TokenStream;
use quote::{format_ident, quote, ToTokens};
use syn::parse_quote;
use syn::{Expr, Fields, Ident, ItemStruct, Path, Token, Type, Visibility};
use super::{is_uint, self_repr_ty, value_repr_ty};
use crate::constness;
#[derive(Clone)]
pub struct Bitfield {
pub use_c... |
//! JSON Schema import functions.
use crate::schema::{self, RegularSchema, Schema};
use iref::{Iri, IriBuf};
use locspan::{Loc, Location};
use rdf_types::Quad;
use treeldr::{vocab, Caused, Id, Name, Vocabulary};
use treeldr_build::{Context, Descriptions};
use vocab::{LocQuad, Object, Term};
/// Import error.
#[derive(... |
use gles::es20::data_struct as es20d;
use gles::es30::data_struct as es30d;
use gles::es31::data_struct as es31d;
use gles::es32::data_struct as es32d;
use gles::es20;
use gles::es30;
use gles::es31;
use gles::es32;
use std::ptr;
use std::fmt;
use std::fmt::Formatter;
use std::mem;
use std::ops::Range;
/// the pixel... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.