text stringlengths 9.08k 47.9k |
|---|
// Copyright © 2020 <NAME>.
//
// 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 your
// option. This file may not be copied, modified, or distributed
// except according to th... |
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
// Copyright 2020 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT
mod errors;
pub mod utils;
pub use self::errors::*;
use actor::{
init, market, miner, power, ActorState, BalanceTable, INIT_ACTOR_ADDR,
STORAGE_MARKET_ACTOR_ADDR, STORAGE_POWER_ACTOR_ADDR,
};
use address::{Address, BLSPublicKey, Pa... |
/// A module that extends neovim api with methods required in page
use neovim_lib::{
neovim_api::{Buffer, Window},
NeovimApi, Value,
};
use std::{
path::PathBuf,
sync::mpsc,
};
const VER_SPLIT_RATIO: &str = "(winwidth(0) / 2) * 3";
const HOR_SPLIT_RATIO: &str = "(winheight(0) / 2) * 3";
const TERM_... |
#[cfg(all(unix, not(feature = "minimal")))]
use std::borrow::Borrow;
use std::cell::RefCell;
use std::collections::HashSet;
use std::convert::AsRef;
use std::hash::Hash;
use std::io;
use std::mem;
use std::net::{IpAddr, SocketAddr};
use std::rc::Rc;
use std::time::Duration;
use futures::future;
use futures::{Async, Fu... |
/*
MIT License
Copyright (c) 2020 <NAME> <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, cop... |
use std::os::raw::{c_char, c_int, c_void};
mod bindgen_test;
mod rime_struct;
pub use self::rime_struct::RimeSizedStruct;
pub type RimeSessionId = usize;
pub type CBool = c_int;
/// Rime doesn't provide documentation most of the time
/// Good luck guessing the usage
#[repr(C)]
pub struct RimeApi {
pub data_size... |
// Copyright 2017 <NAME>. Subject to the MIT License.
//! _What's On WCPE?_
//!
//! This crate provides a single function [`lookup`] to find out what is playing
//! on the [classical radio station WCPE](https://theclassicalstation.org). It
//! returns a [`Response`], which contains the title, composer, and other
//! i... |
use anchor_lang::prelude::Pubkey;
use fixed::types::I80F48;
use std::{cell::Ref, cmp};
use zo_abi::{
Cache, CollateralInfo, Control, FractionType, Margin, MarkCache,
OpenOrdersInfo, PerpMarketInfo, State, WrappedI80F48, MAX_COLLATERALS,
MAX_MARKETS, SPOT_INITIAL_MARGIN_REQ, SPOT_MAINT_MARGIN_REQ,
};
use... |
//! ### Inferring borrow kinds for upvars
//!
//! Whenever there is a closure expression, we need to determine how each
//! upvar is used. We do this by initially assigning each upvar an
//! immutable "borrow kind" (see `ty::BorrowKind` for details) and then
//! "escalating" the kind as needed. The borrow kind proceeds... |
use std::num::NonZeroU64;
use std::time::Duration;
use std::{
collections::HashMap,
hash::{Hash, Hasher},
num::{NonZeroU32, NonZeroUsize},
sync::Arc,
};
use chrono::{TimeZone, Utc};
use regex::Regex;
use snafu::{OptionExt, Snafu};
use influxdb_line_protocol::ParsedLine;
use crate::{consistent_hasher:... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Data Direction"]
pub dir0: DIR,
#[doc = "0x04 - Data Direction Clear"]
pub dirclr0: DIRCLR,
#[doc = "0x08 - Data Direction Set"]
pub dirset0: DIRSET,
#[doc = "0x0c - Data Direction Toggle"]
pub dirtgl0: DIRT... |
use std::sync::Arc;
use std::time::Duration;
use anyhow::{Context, Result};
use nekoton_abi::UnpackAbiPlain;
use parking_lot::Mutex;
use tokio::sync::futures::Notified;
use tokio::sync::mpsc;
use tokio::sync::Notify;
use ton_types::UInt256;
use crate::engine::keystore::*;
use crate::engine::ton_contracts::*;
use crat... |
use crate::rsdm::rsdm::{TOLERANCE, approx_equal};
#[allow(non_upper_case_globals)]
const g :f64 = 9.80616; // Gravitational constant
const URBAN: u8 = 0;
const RURAL: u8 = 1;
fn sigma_y(c: f64, d: f64, x: f64) -> f64 {
let theta: f64 = 0.017453293 * (c - d*x.ln());
465.11628 * x * theta.tan()
}
pub fn get_si... |
#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use]
extern crate failure;
#[macro_use]
extern crate log;
#[macro_use]
extern crate rocket;
#[macro_use]
extern crate rocket_contrib;
use failure::Error;
use hogan;
use hogan::config::ConfigDir;
use hogan::config::ConfigUrl;
use hogan::datadogstatsd::{CustomMetrics,... |
use std;
use std::error::Error;
use std::fmt;
use std::fs::File;
use std::io::prelude::*;
use std::io::Cursor;
use std::num::Wrapping;
use byteorder::{LittleEndian, ReadBytesExt};
use num_traits::FromPrimitive;
#[allow(non_camel_case_types)]
#[derive(Clone, Copy, Debug, FromPrimitive)]
pub enum CartridgeType {
RO... |
// Copyright (C) 2017-2019 Baidu, Inc. All Rights Reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of condit... |
// Copyright 2022, 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 agreed t... |
// 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... |
#![allow(clippy::unwrap_used)]
use ic_crypto::utils::TempCryptoComponent;
use ic_interfaces::crypto::{
NiDkgAlgorithm, Signable, SignableMock, ThresholdSigVerifier, ThresholdSigner,
};
use ic_registry_client::fake::FakeRegistryClient;
use ic_registry_common::proto_registry_data_provider::ProtoRegistryDataProvider;
... |
use num_enum::IntoPrimitive;
use num_enum::TryFromPrimitive;
use std::convert::TryFrom;
use byteorder::{ByteOrder, LittleEndian};
// -- ModelNumber -------------------------------------------------------------------------------------------
#[derive(Clone, Copy, Debug, Eq, PartialEq, IntoPrimitive, TryFromPrimi... |
//! A mock distribution server used by tests/cli-v1.rs and
//! tests/cli-v2.rs
use std::path::{PathBuf, Path};
use std::env;
use std::process::Command;
use std::env::consts::EXE_SUFFIX;
use std::fs::{self, File};
use std::io::{Read, Write};
use std::sync::Mutex;
use tempdir::TempDir;
use {MockInstallerBuilder, MockCom... |
// Copyright 2013 The color-rs developers. For a full listing of the authors,
// refer to the AUTHORS file at the top-level directory of this distribution.
//
// 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 o... |
use core::cmp::Ordering::{self, *};
use core::fmt::{self, Debug};
use core::ops::{Add, AddAssign, Div, Index, IndexMut, Mul, RangeBounds, Rem};
use core::ptr::NonNull;
use std::sync::{Arc, Weak};
use std::vec::Drain;
use hashbrown::HashMap;
use liblumen_core::locks::Mutex;
use liblumen_alloc::borrow::CloneToProcess... |
#[macro_use]
extern crate clap;
extern crate hashbrown;
extern crate rand;
extern crate statrs;
extern crate itertools;
extern crate rayon;
use rayon::prelude::*;
use rand::Rng;
use rand::rngs::StdRng;
use rand::SeedableRng;
use clap::App;
use std::f32;
use std::io::BufReader;
use std::io::BufRead;
use std::io::Rea... |
//! Lines in a file.
use lru_cache::LruCache;
use regex::bytes::{NoExpand, Regex};
use smallvec::SmallVec;
use std::borrow::Cow;
use std::cmp::Ordering;
use std::str;
use std::sync::{Arc, Mutex};
use termwiz::cell::{CellAttributes, Intensity};
use termwiz::color::{AnsiColor, ColorAttribute};
use termwiz::escape::csi::{... |
// Atomic unit in the grammar is called "token".
// For example, `123`, `"abc"` and `while` are tokens.
// The tokenizer splits an input string into tokens.
// Spaces and comments are removed by the tokenizer.
#![allow(non_camel_case_types)]
use crate::preprocess::*;
use crate::*;
use std::cell::RefCell;
use std::col... |
use crate::syn_utils::{
impl_trait_result, parse_parenthesized_args, to_valid_ident, Arg, Args, FieldKey,
GenericParamSet, SharpVals,
};
use crate::{bound::*, syn_utils::parse_from_attrs};
use proc_macro2::{Span, TokenStream};
use quote::{quote, quote_spanned, ToTokens};
use std::{collections::HashMap, fmt::Wri... |
use std::{
borrow::Cow,
collections::HashMap,
convert::Into,
future::Future,
net::SocketAddr,
pin::Pin,
sync::Arc,
task::{Context, Poll},
};
use a2::client::{Client as ApnsClient, Endpoint};
use a2::CollapseId;
use futures::future::{BoxFuture, FutureExt};
use http::status::StatusCode;
u... |
/// This is Makepad, a work-in-progress livecoding IDE for 2D Design.
// This application is nearly 100% Wasm running on webGL. NO HTML AT ALL.
// The vision is to build a livecoding / design hybrid program,
// here procedural design and code are fused in one environment.
// If you have missed 'learnable programming' p... |
use crate::controller::domain_handle::DomainHandle;
use crate::controller::inner::{graphviz, DomainReplies};
use crate::controller::keys;
use crate::controller::{Worker, WorkerIdentifier};
use dataflow::payload::{ReplayPathSegment, SourceSelection, TriggerEndpoint};
use dataflow::prelude::*;
use std::collections::{BTre... |
use pixels::{Error, Pixels, SurfaceTexture};
use rand::{rngs::ThreadRng, thread_rng, Rng};
use std::env;
use std::fs;
use std::time::{Duration, Instant};
use winit::{
dpi::LogicalSize,
event::{Event, VirtualKeyCode},
event_loop::{ControlFlow, EventLoop},
window::WindowBuilder,
};
use winit_input_helper:... |
/*!
Extensible generational arena for various uses. [`Example`](_example)
Goals: Tiny code and real use. Non-goals: Super fast performance.
# Similar crates
* [generational_arena](https://docs.rs/generational_arena/latest)
* [thunderdome](https://docs.rs/thunderdome/latest)
NOTE: Still early, bugs can exist!
*/
// ... |
extern crate data_encoding;
#[macro_use]
extern crate lazy_static;
extern crate wasm_bindgen;
mod range;
mod state;
mod utf8;
use data_encoding::{Encoding, Specification, BASE64URL_NOPAD};
use std::collections::HashMap;
use wasm_bindgen::prelude::{wasm_bindgen, JsValue};
#[wasm_bindgen]
extern "C" {
fn createEle... |
//! Implementation of the GPIO controller.
use core::cell::Cell;
use core::ops::{Index, IndexMut};
use core::sync::atomic::{AtomicUsize, Ordering};
use kernel::common::cells::{OptionalCell, VolatileCell};
use kernel::common::StaticRef;
use kernel::hil;
use sysctl;
const CLOCKS: [sysctl::RCGCGPIO; 15] = [
sysctl::... |
mod setup;
use clap::{App, Arg};
use crossbeam_channel::{self, Receiver, Sender};
use std::{
cmp,
fmt::Debug,
net::Ipv4Addr,
num::NonZeroU32,
str::FromStr,
sync::atomic::{AtomicBool, Ordering},
thread,
time::Instant,
};
use tokio::{
runtime::Runtime,
sync::oneshot::{self, error:... |
pub mod assets;
pub mod bonds;
pub mod options;
pub mod basket;
use instruments::assets::Currency;
use instruments::assets::CreditEntity;
use instruments::assets::Equity;
use instruments::bonds::ZeroCoupon;
use instruments::basket::Basket;
use instruments::options::SpotStartingEuropean;
use instruments::options::Forwa... |
use clap::{Arg, Command};
use graphest::{
Box2D, Explicit, FftImage, Graph, GraphingStatistics, Image, Implicit, Padding, Parametric,
PixelIndex, Relation, RelationType, Ternary,
};
use image::{imageops, ImageBuffer, LumaA, Rgb, RgbImage};
use inari::{const_interval, interval, Interval};
use itertools::Itertool... |
use std::vec::Vec;
// TODO: Color Emphasis
// TODO: Sprite overflow
// TODO: Sprite #0 Hit
// TODO: Sprites (at all)
// Generate memory Controller trait for PPU
make_controller!();
pub struct Frame<'a> {
// Pixel data
pub data: &'a [u8],
// Pixel pitch
pub pitch: usize,
// Width (in pixels)
... |
// Copyright 2021 <NAME>
// SPDX-License-Identifier: Apache-2.0
//! This module implements the frame decoder.
use super::{
error, header, opcode, result,
rows::{ColumnsCount, Flags, Metadata, PagingState},
};
use crate::cql::compression::{Compression, MyCompression};
use anyhow::{anyhow, ensure};
use std::{
... |
// Copyright 2012-2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MI... |
#[cfg(target_arch = "x86")]
use core::arch::x86::*;
#[cfg(target_arch = "x86_64")]
use core::arch::x86_64::*;
use crate::{
counter_high, counter_low, CVWords, IncrementCounter, BLOCK_LEN, IV, MSG_SCHEDULE, OUT_LEN,
};
use arrayref::{array_mut_ref, mut_array_refs};
pub const DEGREE: usize = 8;
#[inline(always)]
u... |
//! Transport layer security and signing based on OpenSSL.
//!
//! This module wraps some of the lower-level TLS constructs to provide a reasonably safe-to-use API
//! surface for the rest of the application. It also fixes the security parameters of the TLS level
//! in a central place.
//!
//! Features include
//!
//!... |
use crate::args;
use crate::engine::description::DescriptionEngine;
use crate::engine::exit::ExitEngine;
use crate::engine::login::LoginEngine;
use crate::engine::upgrade::UpgradeEngine;
use crate::engine::world::WorldEngine;
use crate::engine::zone::ZoneEngine;
use crate::engine::Engine;
use crate::entity::build::Buil... |
use alloc::string::String;
use crate::common::{
DebugAddrBase, DebugAddrIndex, DebugInfoOffset, DebugLineStrOffset, DebugLocListsBase,
DebugLocListsIndex, DebugRngListsBase, DebugRngListsIndex, DebugStrOffset, DebugStrOffsetsBase,
DebugStrOffsetsIndex, DebugTypesOffset, Encoding, LocationListsOffset, Range... |
use event::{parse_action, Event, EventSender};
/// Input will listens to user input, modify the query string, send special
/// keystrokes(such as Enter, Ctrl-p, Ctrl-n, etc) to the controller.
use nix::fcntl::{fcntl, FcntlArg, OFlag};
use std::collections::HashMap;
use std::collections::VecDeque;
use std::fs::File;
use... |
use once_cell::sync::OnceCell;
use std::sync::Arc;
mod denoise;
mod model;
mod rnn;
pub use denoise::DenoiseState;
fn inner_prod(xs: &[f32], ys: &[f32], n: usize) -> f32 {
let mut sum0 = 0.0;
let mut sum1 = 0.0;
let mut sum2 = 0.0;
let mut sum3 = 0.0;
let n_4 = n - n % 4;
for (x, y) in xs[..... |
use sailar::format::{instruction_set::IntegerConstant, type_system};
use sailar_get::loader;
use std::fmt::{Display, Formatter};
use std::ops::{BitAnd, BitOr, BitXor, Not};
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum Type {
Primitive(type_system::Primitive),
Pointer(usize),
}
impl<'l> TryFrom<&'l loader... |
// Copyright 2017-2021 the Tectonic Project
// Licensed under the MIT License.
//! Local caching of bundle data.
//!
//! This module implements Tectonic’s local filesystem caching mechanism for TeX
//! support files. To enable efficient caching with proper invalidation
//! semantics, the caching layer does *not* merel... |
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(dead_code)]
use crate::coding::GetVarint64Ptr;
use crate::key::internalKey;
use crate::key::keyType;
use crate::key::makeInternalKey;
use crate::memdb;
use crate::BytesComparer;
use crate::GenericResult;
use crate::{coding::MAX_VARINT_LEN64, key::keyTyp... |
use std::cell::Cell;
use std::cell::RefCell;
use std::collections::HashMap;
use std::collections::HashSet;
use std::convert::Infallible;
use std::convert::TryFrom;
use std::future::Future;
use std::ops::RangeInclusive;
use std::rc::Rc;
use std::sync::Arc;
use futures::future::FutureExt;
use futures::lock::... |
const SAMPLE_INPUT_PART_1: &str = "\
#############
#...........#
###B#C#B#D###
#A#D#C#A#
#########";
const SAMPLE_INPUT_PART_2: &str = "\
#############
#...........#
###B#C#B#D###
#D#C#B#A#
#D#B#A#C#
#A#D#C#A#
#########";
const PUZZLE_INPUT_PART_1: &str = "\
#############
#...........#
###B#D#C#A###
#C#... |
use crate::model::User;
use crate::GAuth;
use google_people1::{api, PeopleService};
use indexmap::IndexMap;
use tap::prelude::*;
use tracing::{debug, info, trace};
use std::collections::{HashMap, HashSet};
const SCOPE: api::Scope = api::Scope::Contact;
const CONTACT_GROUPS_GET_MAX_MEMBERS: i32 = 999;
const PEOPLE_B... |
// This file is part of Substrate.
// Copyright (C) 2019-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... |
//! This example shows basic usage of wgpu-hal by rendering
//! a ton of moving sprites, each with a separate texture and draw call.
extern crate wgpu_hal as hal;
use hal::{
Adapter as _, CommandEncoder as _, Device as _, Instance as _, Queue as _, Surface as _,
};
use std::{borrow::Borrow, iter, mem, num::NonZer... |
//! Support for symbolication using the `gimli` crate on crates.io
//!
//! This implementation is largely a work in progress and is off by default for
//! all platforms, but it's hoped to be developed over time! Long-term this is
//! intended to wholesale replace the `libbacktrace.rs` implementation.
use self::gimli::... |
//! This module defines the `Container` struct and related functionality.
// FIXME There is a serious performance problem in this implementation. It assumes that the
// FIXME visualization is a child of the container. However, this is very inefficient. Consider a
// FIXME visualization containing 1M of points. When mo... |
extern crate proc_macro;
use std::str::FromStr;
use quote::{ ToTokens, spanned::Spanned };
use syn::parse::Parser;
#[macro_use]
macro_rules! __delta_hashmap_literal {
// https://stackoverflow.com/questions/28392008/more-concise-hashmap-initialization
($( $key: expr => $val: expr ),*) => {{
let mut map... |
// Copyright 2021 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.
// virtio-sound spec: https://github.com/oasis-tcs/virtio-spec/blob/master/virtio-sound.tex
use std::cell::RefCell;
use std::fmt;
use std::io;
use std... |
extern crate actix;
extern crate actix_web;
extern crate askama;
#[macro_use]
extern crate mysql;
extern crate dotenv;
extern crate futures;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
extern crate sha2;
extern crate base64;
extern crate urlencoding;
extern crate env_logger;
extern crate chro... |
// 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
// distributed ... |
use parking_lot::{
MappedRwLockReadGuard, MappedRwLockWriteGuard, Mutex, RwLock, RwLockReadGuard, RwLockWriteGuard,
};
use std::collections::HashMap;
use std::fmt;
use std::fs::OpenOptions;
use std::io::{copy, Cursor as IOCursor, Read, Seek, SeekFrom, Write};
use std::sync::atomic::{AtomicBool, Ordering};
use std::... |
use std::{
collections::{hash_map, BTreeMap},
fs, io,
io::Write,
path::PathBuf,
sync::Arc,
};
use futures::{
channel::mpsc::{UnboundedReceiver, UnboundedSender},
future,
stream::BoxStream,
StreamExt,
};
use parking_lot::Mutex;
use rkyv::{
archived_root,
de::{deserializers::S... |
/* Copyright (c) Fortanix, Inc.
*
* Licensed under the GNU General Public License, version 2 <LICENSE-GPL or
* https://www.gnu.org/licenses/gpl-2.0.html> or the Apache License, Version
* 2.0 <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0>, at your
* option. This file may not be copied, modified, or ... |
//! A GameObject that can be built from an obj file.
//!
//! TODO: explain OOP here
//!
use {
super::{
GameObject,
camera::Camera,
light::Light,
},
crate::{
registration::{
relation::{ParentWrapper, Child, Parent},
named::Named,
... |
//! Safe wrappers for `libpcap` functions.
//!
//! The functions in this module call the libpcap functions of the same name,
//! but provide safe (as opposite of unsafe) and Rust'y interface to them.
//! Functions handle libpcap errors and use `Result` to return either `Ok` on
//! success or `Err` on failure.
//!
//! D... |
/* This is dvipdfmx, an eXtended version of dvipdfm by <NAME>.
Copyright (C) 2002-2018 by <NAME> and <NAME>,
the dvipdfmx project team.
Copyright (C) 1998, 1999 by <NAME> <<EMAIL>>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public Li... |
use std::collections::hash_map::DefaultHasher;
use std::collections::{HashMap, HashSet};
use std::hash::{Hash, Hasher};
use std::io::{self, BufRead, Write};
use std::fmt::Write as OtherWrite;
use std::fs::{File, OpenOptions};
use std::path::{Path, PathBuf};
use std::thread;
use std::time::{Instant, Duration, SystemTime... |
#![windows_subsystem = "windows"]
mod dir;
use druid::{
kurbo::{Circle, CircleSegment, Shape},
piet::{Text, TextLayout, TextLayoutBuilder},
widget::{Flex, Label},
};
use druid::{
AppDelegate, AppLauncher, Color, Command, Data, DelegateCtx, Env, Event, ExtEventSink, Handled,
LifeCycle, PaintCtx, Po... |
// 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... |
//! The MMC parser, which takes lisp literals and maps them to MMC AST.
use std::mem;
use std::collections::HashMap;
use num::BigInt;
use crate::util::{Span, FileSpan};
use crate::elab::{Result, ElabError,
environment::AtomID,
lisp::{LispKind, LispVal, Uncons, print::FormatEnv},
local_context::try_get_span};
use ... |
use crate::field::{SizedPrimeField};
use crate::representation::ElementRepr;
use crate::traits::{FieldElement, BitIterator, FieldExtension, ZeroAndOne};
use super::fp6_as_3_over_2::{Fp6, Extension3Over2};
use super::fp2::Fp2;
use super::Fp6Fp12FrobeniusBaseElements;
// this implementation assumes extension using polyn... |
use rand::prelude::*;
use crate::actor::create_actor;
use crate::controller::*;
use crate::hand::*;
use crate::listener::*;
use crate::model::*;
use crate::util::common::*;
use ActionType::*;
// [App]
pub struct EngineApp {
seed: u64,
mode: usize,
n_game: u32,
n_thread: u32,
write_to_file: bool,
... |
#![macro_use]
use crate::{
ast::Ast,
beta::{Beta, ExportBeta},
form::Form,
name::*,
runtime::{eval::Value, reify},
util::assoc::Assoc,
};
use std::{boxed::Box, clone::Clone, rc::Rc};
custom_derive! {
/// `FormPat` defines a pattern in a grammar. Think EBNF, but more extended.
/// Most... |
use num::{ToPrimitive, FromPrimitive};
use sys::keycode as ll;
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]
pub enum KeyCode {
Unknown = ll::SDLK_UNKNOWN as isize,
Backspace = ll::SDLK_BACKSPACE as isize,
Tab = ll::SDLK_TAB as isize,
Return = ll::SD... |
//! Definitions related to tracing the execution of a circuit.
//!
//! Circuit API users can register handlers for two types of events:
//! [`CircuitEvent`]s emitted during circuit construction and carrying
//! information about circuit topology (operators, subcircuits, and
//! streams connecting them),
//! and
//! [`S... |
use bindings::{
windows::win32::direct3d11::*, windows::win32::direct3d12::*, windows::win32::direct3d_hlsl::*,
windows::win32::direct_composition::*, windows::win32::display_devices::*,
windows::win32::dxgi::*, windows::win32::gdi::*, windows::win32::menus_and_resources::*,
windows::win32::system_servi... |
/*
* Copyright 2021 Aon Cyber Solutions
*
* 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::borrow::Cow;
use std::cmp;
use std::collections::HashMap;
use std::io::prelude::*;
use std::path::Path;
use std::{fs, io};
use structopt::StructOpt;
// https://github.com/clap-rs/clap/pull/1397
#[macro_use]
extern crate clap;
use anyhow::{bail, Context, Result};
use directories;
use lazy_static::lazy_static;
u... |
use crate::parse_config::*;
fn cabecera(formulario: &Formulario) -> String {
let generar_js = r#####"
var _datos = {
formulario: "",
botonEnviar: null,
canvasFoto: null,
inputFoto: null,
inputFileFoto: null,
campos: [],
ultimoCampo: "",
tagConInputId: null,
datosIES: "",
piePagina: "",
mensaje_form... |
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
//! The collection of APIs to be able to take `deno_graph` module graphs and
//! populate a cache, emit files, and transform a graph into the structures for
//! loading into an isolate.
use crate::ast;
use crate::cache::CacheType;
use crate::c... |
use std::borrow::Cow;
use std::cell::RefCell;
use std::cmp;
use std::fmt;
use std::mem;
use std::sync::Arc;
use symbolic_common::types::{Endianness, Language};
use symbolic_debuginfo::{DwarfData, DwarfSection, Object, Symbols};
use dmsort;
use failure::Fail;
use fallible_iterator::FallibleIterator;
use fnv::FnvBuildH... |
use std::fmt;
use gzd::{Gzd, GridSquareId100k};
use get_100k_set_for_zone;
use latlon::LatLon;
use Mgrs;
use Accuracy;
use band::LatBand;
use datum::Datum;
use hemisphere::Hemisphere;
use col::ColLetter;
use row::RowLetter;
#[derive(Default, Copy, Clone, Debug)]
pub struct Utm {
/// UTM 6° longitudinal zone (1..6... |
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// 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 ... |
// Copyright (C) 2021 <NAME> <<EMAIL>>
// SPDX-License-Identifier: MIT OR Apache-2.0
use std::{cell::RefCell, collections::BTreeMap};
use proc_macro2::TokenStream;
use quote::{quote, quote_spanned, ToTokens};
use static_xml::{de::WhiteSpace, ExpandedNameRef};
use syn::{spanned::Spanned, DeriveInput, Fields, Lit, LitS... |
// Copyright © 2015, <NAME>
// Licensed under the MIT License <LICENSE.md>
//! This module defines the 32-Bit Windows Base APIs
//99
pub const FILE_BEGIN: ::DWORD = 0;
pub const FILE_CURRENT: ::DWORD = 1;
pub const FILE_END: ::DWORD = 2;
pub const WAIT_FAILED: ::DWORD = 0xFFFFFFFF;
pub const WAIT_OBJECT_0: ::DWORD = :... |
// 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 (C) 2017-2018 Open Information Security Foundation
*
* You can copy, redistribute or modify this Program under the terms of
* the GNU General Public License version 2 as published by the Free
* Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY... |
#![allow(unused_imports)]
#![allow(dead_code)]
#![allow(non_camel_case_types)]
#![allow(unused_import_braces)]
#![allow(unused_variables)]
#![allow(non_camel_case_types)]
#![allow(unused_qualifications)]
#![allow(unsafe_code)]
#![allow(trivial_casts)]
#![allow(non_snake_case)]
#![allow(unused_assignments)]
#![allow(unu... |
use crate::cfg::{Auth, Host};
use crate::file_listing::FileListing;
use crate::openssh::OpenSshConfig;
use anyhow::{bail, Context, Result};
use expanduser::expanduser;
use indicatif::{ProgressBar, ProgressIterator};
use itertools::Itertools;
use log::{debug, error, info};
use rpassword::prompt_password_stderr;
use ssh... |
// Copyright (c) 2020 Huawei Technologies Co.,Ltd. All rights reserved.
//
// StratoVirt is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan
// PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWA... |
//! Module containing the [`Policy`] trait and types that implement it.
use std::fmt;
use std::borrow::Cow;
use indexmap::IndexMap;
use rocket_http::{ext::IntoCollection, private::SmallVec};
use time::Duration;
use crate::http::{Header, uri::Absolute, uncased::{UncasedStr, Uncased}};
/// Trait implemented by securi... |
use num_traits::FromPrimitive;
use scroll::{
ctx::{
SizeWith,
TryFromCtx,
TryIntoCtx,
},
Endian,
Error as ScrollError,
Pread,
Pwrite,
LE,
};
#[derive(Copy, Clone, Debug, PartialEq, Eq, FromPrimitive)]
#[repr(C)]
pub enum EntityType {
BigHornetStingy = -65,
LittleHornetStingy = -64,
BigH... |
use bimap::BiMap;
use fs_err::File;
use indexmap::IndexMap;
use log::warn;
use serde::{Deserialize, Serialize};
use std::{
collections::{HashMap, HashSet},
hash::{Hash, Hasher},
io::{self, BufRead, BufReader},
path::Path,
};
use crate::{
rule::{
disambiguation::POSFilter,
engine::{
... |
#![allow(unused_variables)] macro_rules! warning { ($($tt:tt)*) => {} } // XXX: temporarilly supress warnings
use mmrbi::*;
use std::path::Path;
use std::str::FromStr;
pub fn src() -> Result<(), ()> {
dir(Path::new("thindx/src"))
}
fn dir(path: &Path) -> Result<(), ()> {
let mut errors = false;
for e ... |
/*!
A platform agnostic Rust friver for the [sx1509], based on the
[`embedded-hal`] traits.
## The Device
The [sx1509] is a GPIO expander that also providers LED driver
and keypad scanning functionality. The device has two banks
of 8 GPIO pins.
## Supported features
At the time of writing, the support is very bare... |
//! The resolution algorithm for the navigation system.
//!
//! # Overview
//!
//! This module defines two systems:
//! 1. [`listen_nav_requests`]: the system gathering [`NavRequest`] and running
//! the [`resolve`] algorithm on them, updating the [`Focusable`] states and
//! sending [`NavEvent`] as result.
//! 2... |
#[macro_use]
extern crate failure;
extern crate chrono;
extern crate clap;
#[macro_use]
extern crate log;
extern crate fern;
#[macro_use]
extern crate serde_derive;
extern crate toml;
extern crate ctrlc;
extern crate regex;
extern crate bincode;
use std::fs::{OpenOptions, DirBuilder};
use std::io::{BufReader,... |
#![forbid(unsafe_code)]
#![cfg_attr(not(debug_assertions), deny(warnings))]
#![warn(clippy::all, rust_2018_idioms)]
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
use std::fmt::Formatter;
/// pixel art handler
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct PixelArt {
palette: Vec<... |
use super::{read_to_string, Error};
use crate::config::{deserialize_regex, serialize_regex};
use event::{tags, Metric};
use serde::{Deserialize, Serialize};
use std::path::{Path, PathBuf};
/// PowerSupply contains info from files in /sys/class/power_supply for
/// a single power supply
#[derive(Debug, Default, Partial... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.