text stringlengths 7.05k 33.9k |
|---|
// 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... |
use alloc::heap::{AllocErr, Layout};
use std;
use std::mem;
use allocator::util::*;
use allocator::linked_list::LinkedList;
use allocator::page::{
PGSIZE, Page, PPN, KERNEL_PAGES, NPAGE,
MAXPA, pa2page, ATTRIB_AP_RW_ALL,
PTE_ADDR, PTE_V, PADDR};
use allocator::alloc_pages;
use allocator;
use mm::pmm::page... |
mod bilibili;
mod bilivideo;
mod douyu;
mod fudujikiller;
mod huya;
mod mkv_header;
mod twitch;
mod youtube;
mod cc;
use crate::{
config::ConfigManager,
dmlive::DMLMessage,
ipcmanager::DMLStream,
};
use anyhow::anyhow;
use anyhow::Result;
use async_channel::Sender;
use chrono::{
Duration,
NaiveTime... |
#[cfg(feature = "serde")]
use serde::{Serialize, Deserialize};
use crate::sys;
/// Covers errors that can be returned by the steamworks API
///
/// Documentation is based on official documentation which doesn't
/// always explain when an error could be returned or its meaning.
#[derive(Copy, Clone, Debug, Fail, Parti... |
// vim: tw=80
// This module contains methods that haven't yet been integrated into vdev_raid
#![allow(unused)]
use crate::types::SGList;
use fixedbitset::FixedBitSet;
use std::borrow::BorrowMut;
use super::sgcursor::*;
/// An encoder/decoder for Reed-Solomon Erasure coding in GF(2^8), oriented
/// towards RAID appl... |
use std::collections::HashSet;
use std::{cmp, fmt, hash};
use core::compiler::CompileMode;
use core::interning::InternedString;
use core::{Features, PackageId, PackageIdSpec, PackageSet, Shell};
use util::errors::CargoResultExt;
use util::lev_distance::lev_distance;
use util::toml::{ProfilePackageSpec, StringOrBool, T... |
//! Definition of how to encode a `Resolve` into a TOML `Cargo.lock` file
//!
//! This module contains all machinery necessary to parse a `Resolve` from a
//! `Cargo.lock` as well as serialize a `Resolve` to a `Cargo.lock`.
//!
//! ## Changing `Cargo.lock`
//!
//! In general Cargo is quite conservative about changing t... |
use crate::ast;
use crate::{Parse, ParseError, Parser, Peek};
use runestick::Span;
use std::ops;
/// Indicator that an expression should be parsed with an eager brace.
#[derive(Debug, Clone, Copy)]
pub(super) struct EagerBrace(pub(super) bool);
impl ops::Deref for EagerBrace {
type Target = bool;
fn deref(&s... |
//! This module handles Session (singular) management. The session is
//! responsible for Frame generation and encryption.
//!
//! ### Client session vs Server session
//! Only different between ClientSession and ServerSession is that Client
//! doesn't know about server's session key at the beginning, while Server key... |
use heapless::{consts::*, spsc::Queue, String};
use nrf52840_hal as hal;
use core::ptr::read_volatile;
use core::sync::atomic::{compiler_fence, Ordering::SeqCst};
use embedded_hal::digital::v2::OutputPin;
use rtt_target::rprintln;
/// A serial controller for the UARTE1 peripheral on the NRF52840
/// Furthermore, for ... |
use std::iter;
use rustc::hir;
use rustc_target::spec::abi::Abi;
use crate::prelude::*;
#[derive(Debug)]
enum PassMode {
NoPass,
ByVal(Type),
ByRef,
}
impl PassMode {
fn get_param_ty(self, fx: &FunctionCx<impl Backend>) -> Type {
match self {
PassMode::NoPass => unimplemented!("p... |
// Copyright 2018 Parity Technologies (UK) Ltd.
//
// 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, copy, modify, mer... |
extern crate phf_codegen;
use std::env;
use std::fs::File;
use std::io::{Write, BufWriter};
use std::path::Path;
use std::convert::AsRef;
// From http://www.postgresql.org/docs/9.2/static/errcodes-appendix.html
static SQLSTATES: &'static [(&'static str, &'static str)] = &[
// Class 00 — Successful Completion
... |
use bitcoin::AddressType;
use candid::{CandidType, Deserialize};
use ic_base_types::ic_types::Principal;
use ic_ckbtc_minter::runtime::Runtime;
use ic_ledger_types::{Subaccount, DEFAULT_SUBACCOUNT};
use serde::Serialize;
const SCHEMA_V1: u8 = 1;
#[derive(CandidType, Clone, Debug, Deserialize, Serialize, PartialEq)]
p... |
//! Contains helpers for Gotham applications to use during testing.
//!
//! See the `TestServer` type for example usage.
use std::fmt;
use std::net::{self, IpAddr, SocketAddr};
use std::ops::{Deref, DerefMut};
use std::sync::{Arc, RwLock};
use std::time::{Duration, Instant};
use failure;
use futures::{future, Future... |
// Copyright 2020 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 writ... |
use std::str::from_utf8;
use std::fmt;
use nom;
use nom::{IResult, ErrorKind, digit, space, alphanumeric, is_space};
use nom::IResult::{Error, Done, Incomplete};
#[derive(PartialEq)]
#[derive(Debug)]
#[derive(Clone)]
pub enum CrontabSyntaxError {
InvalidEnumField,
ValueOutOfBounds { value: i32, min: i32, max... |
extern crate glfw;
extern crate log;
extern crate stb_image;
extern crate bmfa;
extern crate structopt;
mod gl {
include!(concat!(env!("OUT_DIR"), "/gl_bindings.rs"));
}
mod gl_help;
use crate::gl::types::{
GLfloat, GLint, GLsizeiptr, GLuint, GLvoid
};
use crate::gl_help as glh;
use glfw::{Action, Context... |
// Copyright (c) SimpleStaking, Viable Systems and Tezedge Contributors
// SPDX-License-Identifier: MIT
use std::{
borrow::Cow,
fmt::Debug,
ops::{Index, IndexMut, Range},
};
use crate::gc::SortedMap;
use super::{Chunk, DEFAULT_LIST_LENGTH};
/// Structure allocating multiple `Chunk`
///
/// Example:
/// ... |
use std::collections::HashMap;
use std::collections::BTreeMap;
pub use crate::shadergen::*;
pub use crate::cx_fonts::*;
pub use crate::cx_turtle::*;
pub use crate::cx_cursor::*;
pub use crate::cx_drawlist::*;
pub use crate::math::*;
pub use crate::events::*;
pub use crate::shader::*;
pub use crate::colors::*;
pub use ... |
// Copyright 2017 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::cmp;
use std::fmt::{self, Display};
use std::mem;
use std::net::Ipv4Addr;
use std::os::unix::io::{AsRawFd, RawFd};
use std::sync::atomic::{Ato... |
// Widget Base Definition
//
// 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,... |
use crate::callbacks::PersonaStateChangeFlags;
use crate::Client;
use enum_primitive_derive::Primitive;
use futures::{Future, StreamExt};
use num_traits::FromPrimitive;
use std::cmp::Ordering;
use std::ffi::CStr;
use std::fmt::{self, Debug, Display, Formatter};
use std::hash::{Hash, Hasher};
use steamworks_sys as sys;
... |
/* Copyright (c) 2019-2021 <NAME> <<EMAIL>>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This pro... |
#[cfg(feature = "tracy")]
#[global_allocator]
static GLOBAL: tracy_client::ProfiledAllocator<std::alloc::System> =
tracy_client::ProfiledAllocator::new(std::alloc::System, 100);
use rand::{distributions as distr, distributions::Distribution};
use egui_winit_platform as egui_wp;
use starframe::{
game::{self, ... |
use crate::network::server::Handle as ServerHandle;
use crate::blockchain::Blockchain;
use crate::block::*;
use crate::ledger_manager::LedgerManager;
use crate::transaction::{self,*};
use crate::crypto::hash::{H256, Hashable};
use crate::crypto::address::{*};
use crate::network::message::Message;
use log::{debug,info};... |
// Copyright 2017 Parity Technologies (UK) Ltd.
//
// 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, copy, modify, mer... |
// 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.
// All files in the project carrying such notice may not be copied, modified, or distributed
// except according ... |
//! Writes the AST into a string representing WIT with its textual format.
//!
//! # Example
//!
//! ```rust
//! use wasmer_interface_types::{
//! ast::{Adapter, Export, Implementation, Import, Interfaces, Type},
//! encoders::wat::*,
//! interpreter::Instruction,
//! types::InterfaceType,
//! };
//!
//... |
use std::str::FromStr;
use cosmwasm_std::{Api, BlockInfo, CanonicalAddr, Decimal, StdError, StdResult, Storage, Uint128};
use cw20::Expiration;
use cw_storage_plus::{Item, Map};
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use crate::math::{decimal_mul_in_256, decimal_sub_in_256, decimal_sum_in_256}... |
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License in the LICENSE-APACHE file or at:
// https://www.apache.org/licenses/LICENSE-2.0
//! Rounded flat pipeline
use std::mem::size_of;
use wgpu:... |
//! A simple P2P network simulator. Acts as the _reactor_, but without doing any I/O.
#![allow(clippy::collapsible_if)]
use super::*;
use nakamoto_common::collections::{HashMap, HashSet};
use std::collections::BTreeMap;
use std::collections::VecDeque;
use std::fmt;
use std::io;
/// Minimum latency between peers.
pub... |
use crate::A3;
pub(crate) const AD: A3 = &[b'A', b'N', b'D'];
pub(crate) const AE: A3 = &[b'A', b'R', b'E'];
pub(crate) const AF: A3 = &[b'A', b'F', b'G'];
pub(crate) const AG: A3 = &[b'A', b'T', b'G'];
pub(crate) const AI: A3 = &[b'A', b'I', b'A'];
pub(crate) const AL: A3 = &[b'A', b'L', b'B'];
pub(crate) const AM: A... |
use crate::error::*;
use crate::misc::*;
use crate::random_access_file::*;
use byte_struct::*;
use log::*;
use std::cell::Cell;
use std::rc::Rc;
bitfields!(
#[derive(PartialEq, Clone)]
EntryHalf: u32 {
index: 31,
flag: 1,
}
);
#[derive(ByteStruct, PartialEq, Clone)]
#[byte_struct_le]
struc... |
//! Contains the `Language` enum and its associated traits. It is used to
//! specify a desired language for a response. _This is not a comprehensive list
//! of languages, it is a list of languages that Google Maps supports._
use crate::error::Error;
use serde::{Deserialize, Serialize};
/// Specifies the language in... |
//
//! Copyright 2020 Alibaba Group Holding Limited.
//!
//! 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 ... |
//! Parser for the Common Layer Interface (.cli) file format
//!
//! The parser is written according to the spec provided [`here.`]
//!
//! This library works by examining the data in place and collecting pointers to the geometry sections. The CLI object consists of a [`Vec`] of layers. Each layer in turn contains
//! ... |
use super::Edge;
use crate::node::{self, Node};
use petgraph::visit::{
Data, Dfs, EdgeRef, GraphRef, IntoEdgesDirected, IntoNodeReferences, NodeIndexable, NodeRef,
Topo, Visitable, Walker,
};
use std::collections::{HashMap, HashSet};
use std::hash::Hash;
use syn::punctuated::Punctuated;
/// An evaluation step ... |
use super::perm::*;
use rand::Rng;
use std::collections::HashSet;
pub struct GroupRNG {
gens: Vec<Perm>,
n: usize,
id: Perm,
rng: rand::rngs::ThreadRng
}
impl GroupRNG {
pub fn new(g: &Group) -> GroupRNG {
GroupRNG {
gens: g.gens.clone(),
n: g.n,
id: g.... |
use std::collections::HashMap;
use proc_macro2::{Group, Ident, Literal, TokenStream};
use syn::punctuated::Punctuated;
use syn::spanned::Spanned;
use syn::{
parse2, Attribute, Data, Field, GenericParam, Generics, Index, Lifetime, LifetimeDef, Path,
PathArguments, Type, TypePath, TypeReference, Variant,
};
use... |
pub(crate) mod utils;
mod workers;
use std::collections::{hash_map::Entry, HashMap, HashSet};
use clap::Parser;
use futures::TryStreamExt;
use mongodb::{
bson::{doc, Bson, Document},
error::ErrorKind,
options::{
ClientOptions, CreateIndexOptions, FindOneAndUpdateOptions, IndexOptions, InsertManyOp... |
use rustc_serialize::json::encode;
use std::iter::repeat;
use board::point::Point;
struct MoveFor {
pub v: [(i32, i32); 4],
pub n: usize
}
impl MoveFor {
pub fn new() -> MoveFor {
MoveFor {
v: [(0, 0); 4],
n: 0,
}
}
}
#[derive(Debug, Clone, Copy, RustcEncodabl... |
use std::fmt::Write as FmtWrite;
use std::io::{stdin, stdout, Write};
use super::psx::System;
use super::psx::cpu::{R3000A, REGISTERS};
use super::psx::cpu::ops::Operation;
#[derive(Clone)]
pub struct Breakpoint {
address: u32,
}
impl Breakpoint {
pub fn new(address: u32) -> Breakpoint {
Breakpoint {... |
#![crate_name = "platform"]
#![crate_type = "rlib"]
#![no_std]
#![feature(const_fn,lang_items)]
extern crate common;
extern crate drivers;
extern crate hil;
extern crate sam4l;
extern crate support;
extern crate process;
use hil::Controller;
use hil::spi_master::SpiMaster;
use hil::gpio::GPIOPin;
use drivers::timer::... |
use anyhow::{ensure, Result};
use capstone as cs;
use cs::arch::arm64::{Arm64Insn, Arm64Operand, Arm64OperandType};
use itertools::zip;
use lazy_init::Lazy;
use rustc_hash::FxHashMap;
use std::collections::{HashMap, HashSet};
use std::convert::TryInto;
use std::path::{Path, PathBuf};
use crate::{capstone_utils::*, elf... |
// Copyright 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-MIT or ... |
use std::f32;
use std::sync::Arc;
use light_arena::Allocator;
use num::zero;
use crate::bsdf::{fr_dielectric, reflect, Fresnel};
use crate::bsdf::{
BxDF, BxDFHolder, BxDFType, LambertianTransmission, MicrofacetDistribution,
MicrofacetReflection, MicrofacetTransmission, SpecularTransmission,
TrowbridgeReit... |
//! The "bir" (pronounced "beer") is the "base ir" that we use
//! for interpretation.
use crate::{
class::Class,
code::validated::op::Op,
filename::Filename,
function::Function,
in_ir_db::InIrDb,
intrinsic::Intrinsic,
origin_table::HasOriginIn,
prelude::InIrDbExt,
span::FileSpan,
... |
/// An enumeration of different triplet feels.
#[derive(Debug,Clone,PartialEq)]
pub enum TripletFeel { None, Eighth, Sixteenth }
pub(crate) fn get_triplet_feel(value: i8) -> TripletFeel {
match value {
0 => TripletFeel::None,
1 => TripletFeel::Eighth,
2 => TripletFeel::Sixteenth,
_ ... |
/*!
# OpenGL backend internals.
The main target is OpenGL ES3 on Linux and Android.
## Binding model
Binding model is the biggest and most painful difference with gfx-hal API.
First, the bindings get linearized into the pipeline layout (see `PipelineLayoutSet`).
Then a pipeline gets created, and we track all the te... |
/// # Example Implementations
///
/// ## Example Problem Implementation: 0-1 Knapsack
///
/// This struct extends the subset sum struct to implement the "real" or "full valued"
/// zero-one knapsack problem.
/// Each item that can go in the knapsack has a value.
/// The function to optimize (maximize) is now the sum of... |
use std::mem;
use rustc_ast::ast::{self, NodeId};
use rustc_ast::attr;
use rustc_ast::expand::is_proc_macro_attr;
use rustc_ast::ptr::P;
use rustc_ast::visit::{self, Visitor};
use rustc_ast_pretty::pprust;
use rustc_expand::base::{ExtCtxt, Resolver};
use rustc_expand::expand::{AstFragment, ExpansionConfig};
use rustc_... |
// Copyright (c) 2021, <NAME>
// All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
use crate::parser::{
pointer_to, ASTnode, ASTop, DataType, SymPosition, SymType, SymbolTable, SymbolTableEntry,
};
use crate::st... |
// Copyright 2020 <NAME>
//
// SPDX-License-Identifier: (Apache-2.0 OR MIT)
//! Git API
use crate::error::{Error, Result};
use crate::util::trim_newline;
use derivative::Derivative;
use log::trace;
use std::cell::RefCell;
use std::cmp::Ordering;
use std::collections::{HashMap, HashSet};
use std::fmt::{self, Display, ... |
use std::collections::BTreeMap;
use std::sync::Arc;
use std::{fmt, result};
use byteorder::{BigEndian, ByteOrder};
use hex_fmt::{HexFmt, HexList};
use log::{debug, warn};
use rand::Rng;
use reed_solomon_erasure as rse;
use reed_solomon_erasure::ReedSolomon;
use super::merkle::{Digest, MerkleTree, Proof};
use super::m... |
// Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
// Allow KiB, MiB consts
#![allow(non_upper_case_globals, non_snake_case)]
// Allow fns to take &usize, since criterion only passes parameters by ref
#![allow(clippy::trivially_copy_pass_by_ref)]
// Allow writing 1 * KiB or 1 * MiB
#![... |
use crate::client::client_types::{terra_decimal_format, terra_u64_format};
use regex::Regex;
use rust_decimal_macros::dec;
// use rust_decimal::prelude::*;
use rust_decimal::Decimal;
use crate::errors::TerraRustAPIError;
use crate::messages::Message;
use rustc_serialize::base64::{ToBase64, STANDARD};
use serde::{Des... |
use std::cmp::Ordering;
use std::collections::HashMap;
use std::collections::{BTreeMap, BTreeSet};
use std::fmt::{self, Debug, Display};
use std::hash::Hash;
use std::mem;
use serde::{Deserialize, Serialize};
use super::ctx::{AddCtx, ReadCtx, RmCtx};
//use crate::{CmRDT, CvRDT, Dot, ResetRemove, VClock};
use super::t... |
// Copyright (c) 2021 taidaesal
// Licensed under the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>
//
// This file contains code copied and/or adapted
// from code provided by the Vulkano project under
// the MIT license
mod model;
mod obj_loader;
use vulkano::buffer::{BufferUsage, CpuAccessible... |
#![warn(
// Harden built-in lints
missing_copy_implementations,
missing_debug_implementations,
// Harden clippy lints
clippy::cargo_common_metadata,
clippy::clone_on_ref_ptr,
clippy::dbg_macro,
clippy::decimal_literal_representation,
clippy::float_cmp_const,
clippy::get_unwrap,
... |
use std::sync::Mutex;
#[derive(Debug)]
pub enum InitError {
/// Initialisation failed, the plugin will be unloaded again
Failure,
/// Like `Failure`, but the client will not show a "failed to load" warning.
/// This is a very special case and should only be used if a plugin displays
/// a dialog (e.g. overlay) as... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Control Register"]
pub ctrl: crate::Reg<ctrl::CTRL_SPEC>,
#[doc = "0x04 - Clock Scale divide value"]
pub clkscale: crate::Reg<clkscale::CLKSCALE_SPEC>,
#[doc = "0x08 - Word Count value"]
pub words: crate::Reg<words:... |
//! LiteX timer core
//!
//! Hardware source and documentation available at
//! [`litex/soc/cores/timer.py`](https://github.com/enjoy-digital/litex/blob/master/litex/soc/cores/timer.py).
use core::cell::Cell;
use core::marker::PhantomData;
use kernel::common::cells::OptionalCell;
use kernel::common::StaticRef;
use ker... |
use crate::breakpoint::*;
use crate::cargo::rust_flags;
use crate::config::Config;
use crate::errors::RunError;
use crate::generate_tracemap;
use crate::ptrace_control::*;
use crate::source_analysis::LineAnalysis;
use crate::statemachine::*;
use crate::TestHandle;
use nix::errno::Errno;
use nix::sys::signal::Signal;
us... |
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
extern crate proc_macro;
mod parse;
use {
parse::*,
proc_macro2::{Literal, Span, TokenStream, TokenTree},
syn::{
parse_macro_input, s... |
use crate::{
github, process_builder,
shell::Shell,
workspace::{self, PackageExt as _, TargetExt as _},
};
use anyhow::{anyhow, Context as _};
use camino::Utf8Path;
use cargo_metadata as cm;
use git2::Repository;
use ignore::Walk;
use indoc::indoc;
use itertools::Itertools as _;
use maplit::{btreemap, btree... |
#[cfg(feature = "voice")]
use std::collections::HashMap;
use std::sync::mpsc;
use websocket::client::{Client, Receiver, Sender};
use websocket::stream::WebSocketStream;
use serde_json;
use internal::Status;
use model::*;
#[cfg(feature = "voice")]
use voice::VoiceConnection;
use {Error, ReceiverExt, Result, SenderExt... |
use arrayvec::ArrayVec;
use mmcc::Idx;
use super::{Dedup, ProofDedup, ProofId, predefs::SplitBits};
pub(super) struct HexCache<Id = ProofId> {
pub(super) hex: [Id; 16],
}
impl<Id> std::ops::Index<u8> for HexCache<Id> {
type Output = Id;
fn index(&self, i: u8) -> &Self::Output { &self.hex[usize::from(i)] }
}
... |
use clipboard::{ClipboardContext, ClipboardProvider};
use ruffle_core::backend::input::{InputBackend, MouseCursor};
use ruffle_core::events::{KeyCode, PlayerEvent};
use std::collections::HashSet;
use std::rc::Rc;
use winit::event::{ElementState, ModifiersState, VirtualKeyCode, WindowEvent};
use winit::window::Window;
... |
//! The traits defined here are implementation details of cell_gc.
//!
//! Application code does not need to use these traits. They are public only so
//! that `#[derive(IntoHeap)]` can use them. Use the friendly macro!
//!
//! Summary of the types that are allowed in the GC heap:
//!
//! ```text
//! machine types
//! ... |
//! Run the experiment for CS 600: Independent Study: Developmental Robotics
//!
//! This application runs in either random mode or GA mode.
//! If random mode (as specified in the config file), the robot arm
//! just moves to random locations within its allowed joint angles for the
//! length of one episode (some numb... |
// Copyright 2017 the authors. See the 'Copyright and license' section of the
// README.md file at the top-level directory of this repository.
//
// Licensed under the Apache License, Version 2.0 (the LICENSE-APACHE file) or
// the MIT license (the LICENSE-MIT file) at your option. This file may not be
// copied, modif... |
//! Interface to profile data.
//!
//! # Overview
//!
//! Usage of this API starts with applying [`str::parse`] to JSON profiling data, returning a
//! [`Measurement`] which is the root of the hierarchy of profiler outputs.
//!
//! Parsing is robust to changes in the definitions of metadata types; if deserialization of... |
use crate::block::ID;
use crate::block_store::BlockStore;
use crate::updates::decoder::{Decode, Decoder};
use crate::updates::encoder::{Encode, Encoder};
use crate::utils::client_hasher::ClientHasher;
use std::collections::hash_map::Entry;
use std::collections::HashMap;
use std::hash::BuildHasherDefault;
use std::ops::... |
#[derive(PartialEq, Eq)]
pub enum AddrMode {
Imp,
Imm,
Zp0,
Zpx,
Zpy,
Rel,
Abs,
Abx,
Aby,
Ind,
Izx,
Izy,
}
pub enum Op {
Adc,
And,
Asl,
Bcc,
Bcs,
Beq,
Bit,
Bmi,
Bne,
Bpl,
Brk,
Bvc,
Bvs,
Clc,
Cld,
Cli,
Cl... |
// Copyright 2015 <NAME>
// Copyright 2015 Contributors of github.com/huonw/crates.io-graph
//
// 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.... |
use std::io;
use chrono::{DateTime, Datelike, Duration, NaiveDate, NaiveDateTime, SecondsFormat, TimeZone, Timelike, Utc};
use console::{style, Key, Term};
use std::cmp::{max, min};
use theme::{get_default_theme, TermThemeRenderer, Theme};
trait DateAdjust {
fn increment_year(&self) -> Self;
fn decrement_year... |
use crate::*;
use squote::{format_ident, quote, Ident, Literal, TokenStream};
use std::iter::FromIterator;
use winmd::Decode;
/// A type's name including module namespace and generics
#[derive(Debug, Clone)]
pub struct TypeName {
/// The type's module namespace as a period separated string
///
/// e.g. "Ou... |
//! Convert parser model to rust-protobuf model
mod option_resolver;
mod type_resolver;
use protobuf;
use protobuf::descriptor::descriptor_proto::ReservedRange;
use protobuf::descriptor::field_descriptor_proto;
use protobuf::descriptor::field_descriptor_proto::Type;
use protobuf::descriptor::FieldDescriptorProto;
use... |
//! Advent of Code 2021 Day 11
//! https://adventofcode.com/2021/day/11
//!
//! Challenge part 2
//!
//! Simulates a group of octopuses as they gain energy and flash each cycle. Runs the simulation
//! until all octopuses flashes simultaneously, and returns the number of times the simulation
//! steps until this occurs... |
#![allow(clippy::len_without_is_empty)]
use std::convert::TryFrom;
use std::fmt;
use std::num::NonZeroU32;
use fxhash::FxHashSet;
use lazy_static::lazy_static;
use serde::{Deserialize, Serialize};
use crate::{
dodeca::{Side, Vertex, SIDE_COUNT, VERTEX_COUNT},
math,
proto::Position,
};
/// Graph of the r... |
#[macro_use]
extern crate fields;
extern crate proc_macro;
#[macro_use]
extern crate quote;
use proc_macro::TokenStream;
use proc_macro2::TokenStream as TokenStream2;
use std::collections::HashMap;
use syn::parse::{Parse, ParseStream};
use syn::parse_macro_input;
use syn::punctuated::Punctuated;
use syn::{braced, pare... |
use anyhow::{bail, ensure, Result};
use bitvec_helpers::{bitvec_reader::BitVecReader, bitvec_writer::BitVecWriter};
#[cfg(feature = "serde_feature")]
use serde::Serialize;
use super::dovi_rpu::DoviRpu;
use super::rpu_data_header::RpuDataHeader;
use super::rpu_data_nlq::NlqData;
#[derive(Debug, Default)]
#[cfg_attr(f... |
use core::ops::Shl;
use crypto_bigint::prelude::ArrayEncoding;
use crypto_bigint::subtle::Choice;
use crypto_bigint::Integer;
use crypto_bigint::Limb;
use crypto_bigint::LimbUInt;
use crypto_bigint::U4096;
use num_bigint::BigUint;
use sha2_const::Sha256;
const EM_LEN: usize = (4095 + 7) / 8;
const EM_BITS: usize = 409... |
use ::serde::{Deserialize, Serialize};
use std::{
collections::HashSet,
fmt,
hash::{Hash, Hasher},
net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr},
};
use crate::{
basics::*,
read_u16, read_u32, read_u64,
serde::{from_retroshare_wire, to_retroshare_wire},
write_u16, write_u32, write_u64,
... |
//! Mocking utilities for tests.
// Built-in deps
use std::collections::VecDeque;
use std::convert::TryFrom;
// External uses
use tokio::sync::RwLock;
use web3::contract::Options;
use zksync_basic_types::{BlockNumber, H256, U256};
// Workspace uses
use zksync_config::configs::eth_sender::{ETHSenderConfig, GasLimit, Se... |
use log::*;
use pancurses::{cbreak, endwin, init_pair, initscr, noecho, start_color, Input, Window, ACS_HLINE};
use std::convert::TryInto;
use std::process::{exit, ExitCode, Termination};
use crate::log_display;
use crate::webdata;
pub struct Screen {
window: Window,
wd: webdata::WebData,
x: i32,
y: i... |
// Copyright 2015-2021 Swim Inc.
//
// 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 ... |
mod client;
use event::{tags, Event, Metric};
use futures_util::StreamExt;
use serde::{Deserialize, Serialize};
use std::collections::HashSet;
use std::time::Instant;
use tokio_stream::wrappers::IntervalStream;
use crate::config::{
default_interval, default_true, deserialize_duration, serialize_duration, DataType... |
//! Functions and types relating to rendering.
//!
//! This module implements a (hopefully!) efficent quad renderer, which will queue up
//! drawing operations until it is absolutely necessary to send them to the graphics
//! hardware. This allows us to minimize the number of draw calls made, speeding up
//! rendering.... |
// Copyright 2021 The BMW 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 agreed... |
// SPDX-License-Identifier: BSD-2-Clause
/*
* resource.rs - Types relating to CoAP resource management.
* Copyright (c) 2022 The NAMIB Project Developers, all rights reserved.
* See the README as well as the LICENSE file for more information.
*/
//! Resource and resource handler descriptions
use std::{
any::An... |
// Copyright (c) 2016 The vulkano developers
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or
// https://www.apache.org/licenses/LICENSE-2.0> or the MIT
// license <LICENSE-MIT or https://opensource.org/licenses/MIT>,
// at your option. All files in the project carrying such
// notice may not be ... |
use rand::distributions::OpenClosed01;
use rand::{thread_rng, Rng};
use rayon::prelude::*;
use std::fmt::Display;
use std::ops::{Add, AddAssign, Mul, Sub};
use thread_local::CachedThreadLocal;
const EPSILON: f64 = 1e-4;
#[derive(Copy, Clone, Debug, PartialEq, Default)]
pub struct Vector3d {
pub x: f64,
pub y:... |
//
// Copyright (c) <NAME>. All rights reserved.
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
//
use core::config::ApplicationCfg;
use datasource_type::Datasources;
use datasource::DatasourceInput;
use core::grid::Grid;
use core::layer::Layer;
use service::tiles... |
#[macro_use]
extern crate glium;
#[macro_use]
pub extern crate glyph_brush;
mod builder;
pub use builder::GlyphBrushBuilder;
use glyph_brush::ab_glyph::{point, FontArc, Rect};
use std::ops::Deref;
use glium::backend::{Context, Facade};
use glium::index::PrimitiveType;
use glium::texture::texture2d::Texture2d;
us... |
use gloo_render::{request_animation_frame, AnimationFrame};
use rust_internal::PluginExecutionBehaviour;
use std::any::Any;
use std::cell::RefCell;
use std::collections::{BTreeMap, HashMap};
use std::rc::Rc;
use thiserror::Error;
use wasm_bindgen::JsCast;
use yew::html::Scope;
use crate::input::keyboard::Key;
use crat... |
use proc_macro2::{Ident, Span};
use hotg_rune_core::reflect::Type;
use quote::quote;
use syn::{
Attribute, DeriveInput, Error, ExprLit, Lit, LitStr, Path, Token,
TypeArray, TypePath, TypeReference,
parse::{Parse, ParseStream},
punctuated::Punctuated,
spanned::Spanned,
};
use crate::{
descriptor... |
mod windows;
use std::path::PathBuf;
use std::sync::{Arc, RwLock};
use std::sync::mpsc::Sender;
use imgui::*;
use imgui_glium_renderer::{Renderer, Texture};
use imgui_winit_support::{HiDpiMode, WinitPlatform};
use glium::{Display, Surface};
use glium::glutin::ContextBuilder;
use glium::glutin::dpi::LogicalSize;
use... |
use std::io;
use super::error::{Error, ErrorCode, Result};
use super::metadata::StreamInfo;
use super::decode::Decode;
pub struct Frame<'a> {
pub header: FrameHeader,
pub blocks: &'a mut Vec<Vec<i32>>
}
impl<'a> Frame<'a> {
pub fn from_reader(reader: &mut Decode, stream_info: &StreamInfo, blocks: &'a mut... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.