hexsha stringlengths 40 40 | size int64 5 1.05M | ext stringclasses 98
values | lang stringclasses 21
values | max_stars_repo_path stringlengths 3 945 | max_stars_repo_name stringlengths 4 118 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 945 | max_issues_repo_name stringlengths 4 118 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 134k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 945 | max_forks_repo_name stringlengths 4 135 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 5 1.05M | avg_line_length float64 1 1.03M | max_line_length int64 2 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fb122339d98117ef6163eb14bca0d43b4015f3f8 | 1,193 | c | C | v4-cokapi/backends/c_cpp/valgrind-3.11.0/memcheck/tests/x86/pushpopmem.c | ambadhan/OnlinePythonTutor | 857bab941fbde20f1f020b05b7723094ddead62a | [
"MIT"
] | 17 | 2021-12-09T11:31:44.000Z | 2021-12-29T03:07:14.000Z | v4-cokapi/backends/c_cpp/valgrind-3.11.0/memcheck/tests/x86/pushpopmem.c | heysachin/OnlinePythonTutor | 0dcdacc7ff5be504dd6a47236ebc69dc0069f991 | [
"MIT"
] | 8 | 2020-02-04T20:23:26.000Z | 2020-02-17T00:23:37.000Z | v4-cokapi/backends/c_cpp/valgrind-3.11.0/memcheck/tests/x86/pushpopmem.c | heysachin/OnlinePythonTutor | 0dcdacc7ff5be504dd6a47236ebc69dc0069f991 | [
"MIT"
] | 12 | 2021-12-09T11:31:46.000Z | 2022-01-07T03:14:46.000Z |
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
unsigned int do32 ( unsigned int x )
{
unsigned int* y = malloc(sizeof(unsigned int));
unsigned int* z = malloc(sizeof(unsigned int));
unsigned int t;
assert(y);
assert(z);
y[0] = x;
__asm__ __volatile__(
"pushl %0\n\t"
"pushl %1\n\t"
"popl %%ebx\n\t"
"popl %%eax\n\t"
"pushl 0(%%eax)\n\t"
"popl 0(%%ebx)"
: /*OUT*/
: /*IN*/ "r"(y), "r"(z)
: /*TRASH*/ "memory", "eax", "ebx"
);
t = z[0];
free(y);
free(z);
return t;
}
unsigned short do16 ( unsigned short x )
{
unsigned short* y = malloc(sizeof(unsigned short));
unsigned short* z = malloc(sizeof(unsigned short));
unsigned short t;
assert(y);
assert(z);
y[0] = x;
__asm__ __volatile__(
"pushl %0\n\t"
"pushl %1\n\t"
"popl %%ebx\n\t"
"popl %%eax\n\t"
"pushw 0(%%eax)\n\t"
"popw 0(%%ebx)"
: /*OUT*/
: /*IN*/ "r"(y), "r"(z)
: /*TRASH*/ "memory", "eax", "ebx"
);
t = z[0];
free(y);
free(z);
return t;
}
int main ( void )
{
printf("do32: 0x%08X\n", do32(0xCafeBabe) );
printf("do16: 0x%08X\n", (unsigned int)do16(0xfeBa) );
return 0;
}
| 18.936508 | 57 | 0.526404 |
7f256b41d027bb90b0a71cc66f4e8aca475704ac | 8,470 | rs | Rust | pulse-binding/src/context/scache.rs | timvisee/pulse-binding-rust | 4d7d437c5aed40388e5d7fcf7c37be9968bf69cd | [
"Apache-2.0",
"MIT"
] | null | null | null | pulse-binding/src/context/scache.rs | timvisee/pulse-binding-rust | 4d7d437c5aed40388e5d7fcf7c37be9968bf69cd | [
"Apache-2.0",
"MIT"
] | null | null | null | pulse-binding/src/context/scache.rs | timvisee/pulse-binding-rust | 4d7d437c5aed40388e5d7fcf7c37be9968bf69cd | [
"Apache-2.0",
"MIT"
] | null | null | null | // Copyright 2017 Lyndon Brown
//
// This file is part of the PulseAudio Rust language binding.
//
// Licensed under the MIT license or the Apache license (version 2.0), at your option. You may not
// copy, modify, or distribute this file except in compliance with said license. You can find copies
// of these licenses either in the LICENSE-MIT and LICENSE-APACHE files, or alternatively at
// <http://opensource.org/licenses/MIT> and <http://www.apache.org/licenses/LICENSE-2.0>
// respectively.
//
// Portions of documentation are copied from the LGPL 2.1+ licensed PulseAudio C headers on a
// fair-use basis, as discussed in the overall project readme (available in the git repository).
//! Sample cache mechanism.
//!
//! # Overview
//!
//! The sample cache provides a simple way of overcoming high network latencies and reducing
//! bandwidth. Instead of streaming a sound precisely when it should be played, it is stored on the
//! server and only the command to start playing it needs to be sent.
//!
//! # Creation
//!
//! To create a sample, the normal stream API is used (see [`stream`]). The function
//! [`stream::Stream::connect_upload`] will make sure the stream is stored as a sample on the
//! server.
//!
//! To complete the upload, [`stream::Stream::finish_upload`] is called and the sample will receive
//! the same name as the stream. If the upload should be aborted, simply call
//! [`stream::Stream::disconnect`].
//!
//! # Playing samples
//!
//! To play back a sample, simply call [`context::Context::play_sample`]:
//!
//! ```rust,ignore
//! extern crate libpulse_binding as pulse;
//!
//! use pulse::volume;
//!
//! //...
//!
//! let o = my_context.play_sample(
//! "sample2", // Name of my sample
//! None, // Use default sink
//! volume::VOLUME_NORM, // Full volume
//! None // Don’t need a callback
//! );
//! ```
//!
//! # Removing samples
//!
//! When a sample is no longer needed, it should be removed on the server to save resources. The
//! sample is deleted using [`context::Context::remove_sample`].
//!
//! [`stream`]: ../../stream/index.html
//! [`stream::Stream::connect_upload`]: ../../stream/struct.Stream.html#method.connect_upload
//! [`stream::Stream::finish_upload`]: ../../stream/struct.Stream.html#method.finish_upload
//! [`stream::Stream::disconnect`]: ../../stream/struct.Stream.html#method.disconnect
//! [`context::Context::play_sample`]: ../struct.Context.html#method.play_sample
//! [`context::Context::remove_sample`]: ../struct.Context.html#method.remove_sample
use std::os::raw::{c_char, c_void};
use std::ffi::CString;
use std::ptr::null;
use super::{ContextInternal, Context};
use crate::def;
use crate::callbacks::{box_closure_get_capi_ptr, get_su_capi_params, get_su_callback};
use crate::{operation::Operation, volume::Volume, proplist::Proplist};
impl Context {
/// Removes a sample from the sample cache.
///
/// Returns an operation object which may be used to cancel the operation while it is running.
///
/// The callback must accept a `bool`, which indicates success.
///
/// Panics if the underlying C function returns a null pointer.
pub fn remove_sample<F>(&mut self, name: &str, callback: F) -> Operation<dyn FnMut(bool)>
where F: FnMut(bool) + 'static
{
// Warning: New CStrings will be immediately freed if not bound to a variable, leading to
// as_ptr() giving dangling pointers!
let c_name = CString::new(name.clone()).unwrap();
let cb_data = box_closure_get_capi_ptr::<dyn FnMut(bool)>(Box::new(callback));
let ptr = unsafe { capi::pa_context_remove_sample(self.ptr, c_name.as_ptr(),
Some(super::success_cb_proxy), cb_data) };
assert!(!ptr.is_null());
Operation::from_raw(ptr, cb_data as *mut Box<dyn FnMut(bool)>)
}
/// Plays a sample from the sample cache to the specified device.
///
/// If the specified device is `None` use the default sink.
///
/// # Params
///
/// * `name`: Name of the sample to play.
/// * `dev`: Sink to play this sample on, or `None` for default.
/// * `volume`: Volume to play this sample with. Starting with 0.9.15 you may pass here
/// [`volume::VOLUME_INVALID`] which will leave the decision about the volume to the server
/// side which is a good idea.
/// * `callback`: Optional success callback. It must accept a `bool`, which indicates success.
///
/// Panics if the underlying C function returns a null pointer.
///
/// [`volume::VOLUME_INVALID`]: ../volume/constant.VOLUME_INVALID.html
pub fn play_sample(&mut self, name: &str, dev: Option<&str>, volume: Volume,
callback: Option<Box<dyn FnMut(bool) + 'static>>) -> Operation<dyn FnMut(bool)>
{
// Warning: New CStrings will be immediately freed if not bound to a variable, leading to
// as_ptr() giving dangling pointers!
let c_name = CString::new(name.clone()).unwrap();
let c_dev = match dev {
Some(dev) => CString::new(dev.clone()).unwrap(),
None => CString::new("").unwrap(),
};
let p_dev = dev.map_or(null::<c_char>(), |_| c_dev.as_ptr() as *const c_char);
let (cb_fn, cb_data): (Option<extern "C" fn(_, _, _)>, _) =
get_su_capi_params::<_, _>(callback, super::success_cb_proxy);
let ptr = unsafe { capi::pa_context_play_sample(self.ptr, c_name.as_ptr(), p_dev, volume.0,
cb_fn, cb_data) };
assert!(!ptr.is_null());
Operation::from_raw(ptr, cb_data as *mut Box<dyn FnMut(bool)>)
}
/// Plays a sample from the sample cache to the specified device, allowing specification of a
/// property list for the playback stream.
///
/// If the device is `None` use the default sink.
///
/// # Params
///
/// * `name`: Name of the sample to play.
/// * `dev`: Sink to play this sample on, or `None` for default.
/// * `volume`: Volume to play this sample with. Starting with 0.9.15 you may pass here
/// [`volume::VOLUME_INVALID`] which will leave the decision about the volume to the server
/// side which is a good idea.
/// * `proplist`: Property list for this sound. The property list of the cached entry will have
/// this merged into it.
/// * `callback`: Optional success callback. It must accept an `u32` index value wrapper in a
/// `Result`. The index is the index of the sink input object. `Err` is given instead on
/// failure.
///
/// Panics if the underlying C function returns a null pointer.
///
/// [`volume::VOLUME_INVALID`]: ../volume/constant.VOLUME_INVALID.html
pub fn play_sample_with_proplist(&mut self, name: &str, dev: Option<&str>, volume: Volume,
proplist: &Proplist, callback: Option<Box<dyn FnMut(Result<u32, ()>) + 'static>>)
-> Operation<dyn FnMut(Result<u32, ()>)>
{
// Warning: New CStrings will be immediately freed if not bound to a
// variable, leading to as_ptr() giving dangling pointers!
let c_name = CString::new(name.clone()).unwrap();
let c_dev = match dev {
Some(dev) => CString::new(dev.clone()).unwrap(),
None => CString::new("").unwrap(),
};
let p_dev = dev.map_or(null::<c_char>(), |_| c_dev.as_ptr() as *const c_char);
let (cb_fn, cb_data): (Option<extern "C" fn(_, _, _)>, _) =
get_su_capi_params::<_, _>(callback, play_sample_success_cb_proxy);
let ptr = unsafe {
capi::pa_context_play_sample_with_proplist(self.ptr, c_name.as_ptr(), p_dev, volume.0,
proplist.0.ptr, cb_fn, cb_data)
};
assert!(!ptr.is_null());
Operation::from_raw(ptr, cb_data as *mut Box<dyn FnMut(Result<u32, ()>)>)
}
}
/// Proxy for completion success callbacks.
///
/// Warning: This is for single-use cases only! It destroys the actual closure callback.
extern "C"
fn play_sample_success_cb_proxy(_: *mut ContextInternal, index: u32, userdata: *mut c_void) {
let index_actual = match index { def::INVALID_INDEX => Err(()), i => Ok(i) };
let _ = std::panic::catch_unwind(|| {
// Note, destroys closure callback after use - restoring outer box means it gets dropped
let mut callback = get_su_callback::<dyn FnMut(Result<u32, ()>)>(userdata);
(callback)(index_actual);
});
}
| 45.053191 | 100 | 0.644038 |
2c69bce11884b5ff3348b8438b9b5c5e7323572a | 5,366 | kt | Kotlin | src/main/kotlin/org/dustinl/argparse4k/argument_parser.kt | dustinliu/argparse4k | 6b0f1e4afbe1783986fa5117aef56227da66d374 | [
"BSD-3-Clause"
] | null | null | null | src/main/kotlin/org/dustinl/argparse4k/argument_parser.kt | dustinliu/argparse4k | 6b0f1e4afbe1783986fa5117aef56227da66d374 | [
"BSD-3-Clause"
] | null | null | null | src/main/kotlin/org/dustinl/argparse4k/argument_parser.kt | dustinliu/argparse4k | 6b0f1e4afbe1783986fa5117aef56227da66d374 | [
"BSD-3-Clause"
] | null | null | null | package org.dustinl.argparse4k
import net.sourceforge.argparse4j.ArgumentParsers
import net.sourceforge.argparse4j.helper.HelpScreenException
import net.sourceforge.argparse4j.impl.Arguments
import net.sourceforge.argparse4j.inf.ArgumentParserException
import net.sourceforge.argparse4j.inf.Subparser
import org.dustinl.argparse4k.exception.ArgumentException
import org.dustinl.argparse4k.exception.HelpException
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import java.io.PrintWriter
import net.sourceforge.argparse4j.inf.ArgumentParser as JavaParser
interface ArgumentParser {
val options: Options
fun flag(vararg names: String, help: String? = null): Delegator<Boolean>
fun value(vararg names: String, help: String? = null, required: Boolean = false, metavar: String? = null)
: Delegator<String>
fun values(vararg names: String, help: String? = null, required: Boolean = false, metavar: String? = null)
: Delegator<List<String>>
fun positional(name: String, help: String? = null, required: Boolean = false): Delegator<String>
fun positionals(name: String, help: String? = null, required: Boolean = false): Delegator<List<String>>
fun description(desc: String)
fun epilog(epilog: String)
fun usage(): String
fun registerCommand(name: String): CommandArgumentParser
fun getCommandParser(name: String): CommandArgumentParser?
fun getCommand(): String
fun printError(e: ArgumentException, writer: PrintWriter = PrintWriter(System.err))
}
interface Options {
fun <T> get(name: String): T
}
object ArgumentParserFactory {
fun createParser(progName: String, args: Array<String>): ArgumentParser = ArgumentParserImpl(progName, args)
}
abstract class ArgumentParserBase(val parser: JavaParser): ArgumentParser {
private val commandParsers = mutableMapOf<String, CommandArgumentParser>()
override fun flag(vararg names: String, help: String?): Delegator<Boolean> {
val argument = parser.addArgument(*names).action(Arguments.storeTrue()).setDefault(false)
help?.run { argument.help(help) }
return Delegator(this, argument)
}
override fun value(vararg names: String, help: String?, required: Boolean, metavar: String?)
: Delegator<String> {
val argument = parser.addArgument(*names).required(required)
argument.metavar(metavar?:argument.textualName())
help?.run { argument.help(help) }
return Delegator(this, argument)
}
override fun values(vararg names: String, help: String?, required: Boolean, metavar: String?)
: Delegator<List<String>> {
val argument = parser.addArgument(*names).required(required).nargs("*")
argument.metavar(metavar?:argument.textualName())
help?.run { argument.help(help) }
return Delegator(this, argument)
}
override fun positional(name: String, help: String?, required: Boolean): Delegator<String> {
val argument = parser.addArgument(name)
if (!required) argument.nargs("?")
help?.run { argument.help(help) }
return Delegator(this, argument)
}
override fun positionals(name: String, help: String?, required: Boolean): Delegator<List<String>> {
val argument = parser.addArgument(name)
if (required) argument.nargs("+") else argument.nargs("*")
help?.run { argument.help(help) }
return Delegator(this, argument)
}
override fun description(desc: String) {
parser.description(desc)
}
override fun epilog(epilog: String) {
parser.epilog(epilog)
}
override fun usage(): String = parser.formatHelp()
override fun registerCommand(name: String) =
commandParsers.computeIfAbsent(name) {
val subParser = parser.addSubparsers().title("subcommands")
.description("valid subcommands").metavar("COMMAND")
.addParser(name).setDefault("command", name)
CommandArgumentParser(subParser, this)
}
override fun getCommandParser(name: String): CommandArgumentParser? = commandParsers[name]
override fun getCommand(): String = options.get("command")
override fun printError(e: ArgumentException, writer: PrintWriter) {
e.e.parser.handleError(e.e, writer)
}
}
internal class ArgumentParserImpl constructor(progName: String, private val args: Array<String>)
: ArgumentParserBase(ArgumentParsers.newFor(progName).build()) {
companion object {
val logger: Logger = LoggerFactory.getLogger(this::class.java)
}
override val options: Options by lazy {
logger.trace("init options")
try {
val namespace = parser.parseArgs(args)
object : Options {
override fun <T> get(name: String): T = namespace.get<T>(name)
}
} catch (e: HelpScreenException) {
throw HelpException(e)
} catch (e: ArgumentParserException) {
throw ArgumentException(e)
}
}
}
class CommandArgumentParser internal constructor( internal val subParser: Subparser, rootParser: ArgumentParserBase)
: ArgumentParserBase(subParser) {
override val options by lazy { rootParser.options }
fun help(helpMessage: String) {
subParser.help(helpMessage)
}
}
| 39.167883 | 116 | 0.686731 |
24f6dcd4bdcf6f4446ffe50f5e6f13183734bb94 | 178 | go | Go | module/userconfig/model/update_user_config.go | PhamThanhTin0702/togo | 168d28ad648e74d04fa4e35196af328378b6a394 | [
"MIT"
] | null | null | null | module/userconfig/model/update_user_config.go | PhamThanhTin0702/togo | 168d28ad648e74d04fa4e35196af328378b6a394 | [
"MIT"
] | null | null | null | module/userconfig/model/update_user_config.go | PhamThanhTin0702/togo | 168d28ad648e74d04fa4e35196af328378b6a394 | [
"MIT"
] | null | null | null | package model
type UpdateUserConfig struct {
MaxTask *uint `json:"max_task" gorm:"max_task"`
}
func (UpdateUserConfig) TableName() string {
return UserConfig{}.TableName()
}
| 17.8 | 48 | 0.747191 |
98ff691cc427d697d4c0699d54a33834e4b33d61 | 1,218 | swift | Swift | C64/Utils/CircularBuffer.swift | Sephiroth87/C-swifty4 | 81efc0bbfb99da2e3bbb683f155fe5572333d1f9 | [
"MIT"
] | 57 | 2015-02-15T19:11:33.000Z | 2021-08-31T15:45:07.000Z | C64/Utils/CircularBuffer.swift | Sephiroth87/C-swifty4 | 81efc0bbfb99da2e3bbb683f155fe5572333d1f9 | [
"MIT"
] | null | null | null | C64/Utils/CircularBuffer.swift | Sephiroth87/C-swifty4 | 81efc0bbfb99da2e3bbb683f155fe5572333d1f9 | [
"MIT"
] | 6 | 2015-07-16T15:22:49.000Z | 2019-01-17T12:14:43.000Z | //
// CircularBuffer.swift
// C64
//
// Created by Fabio Ritrovato on 30/11/2015.
// Copyright © 2015 orange in a day. All rights reserved.
//
import Foundation
public final class CircularBuffer<T: CustomStringConvertible> {
fileprivate var buffer: Array<T?>
fileprivate var index = 0
public init(capacity: Int) {
self.buffer = Array<T?>(repeating: nil, count: capacity)
}
public func add(_ item: T) {
index = (index + 1) % buffer.count
buffer[index] = item
}
}
extension CircularBuffer: Sequence {
public func makeIterator() -> AnyIterator<T> {
var index = self.index
return AnyIterator {
if index - 1 == self.index {
return nil
} else {
let value = self.buffer[index]
index -= 1
if index == -1 {
index = self.buffer.count - 1
}
return value
}
}
}
}
extension CircularBuffer: CustomStringConvertible {
public var description: String {
get {
return self.reduce("") { $0 + $1.description + "\n" }
}
}
}
| 21.75 | 65 | 0.520525 |
2f1235cde893a4cb54779570484f7998d96e779f | 329 | php | PHP | app/Http/Controllers/Api/ProvinciaController.php | echuquillanquiy/mainin | b2e4605a513d7ef867122e5bc2ac2fc4dbe6a527 | [
"MIT"
] | null | null | null | app/Http/Controllers/Api/ProvinciaController.php | echuquillanquiy/mainin | b2e4605a513d7ef867122e5bc2ac2fc4dbe6a527 | [
"MIT"
] | null | null | null | app/Http/Controllers/Api/ProvinciaController.php | echuquillanquiy/mainin | b2e4605a513d7ef867122e5bc2ac2fc4dbe6a527 | [
"MIT"
] | null | null | null | <?php
namespace App\Http\Controllers\Api;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Provincia;
class ProvinciaController extends Controller
{
public function getProvinciaxDep($id)
{
return Provincia::where('departamento_id', $id)->get(['id', 'name','departamento_id']);
}
}
| 20.5625 | 95 | 0.720365 |
ddca2330a71ea07a271d88c6a4ab8bee61deb645 | 6,290 | php | PHP | e/space/spacefun.php | 2088309711/mycms | 076a411a0c1b477d96507d481ba8ca7c03e1aab2 | [
"MIT"
] | null | null | null | e/space/spacefun.php | 2088309711/mycms | 076a411a0c1b477d96507d481ba8ca7c03e1aab2 | [
"MIT"
] | null | null | null | e/space/spacefun.php | 2088309711/mycms | 076a411a0c1b477d96507d481ba8ca7c03e1aab2 | [
"MIT"
] | null | null | null | <?php
//返回sql语句
function espace_ReturnBqQuery($classid,$line,$enews=0,$do=0,$ewhere='',$eorder=''){
global $empire,$dbtbpre,$public_r,$class_r,$class_zr,$fun_r,$class_tr,$emod_r,$etable_r,$userid,$eyh_r;
$userid=(int)$userid;
if($enews==24)//按sql查询
{
$query_first=substr($classid,0,7);
if(!($query_first=='select '||$query_first=='SELECT '))
{
return "";
}
$classid=RepSqlTbpre($classid);
$sql=$empire->query1($classid);
if(!$sql)
{
echo"SQL Error: ".ReRepSqlTbpre($classid);
}
return $sql;
}
if($enews==0||$enews==1||$enews==2||$enews==9||$enews==12||$enews==15)//栏目
{
if(strstr($classid,','))//多栏目
{
$son_r=sys_ReturnMoreClass($classid,1);
$classid=$son_r[0];
$where=$son_r[1];
}
else
{
if($class_r[$classid][islast])
{
$where="classid='$classid'";
}
else
{
$where=ReturnClass($class_r[$classid][sonclass]);
}
}
$tbname=$class_r[$classid][tbname];
$mid=$class_r[$classid][modid];
$yhid=$class_r[$classid][yhid];
}
elseif($enews==6||$enews==7||$enews==8||$enews==11||$enews==14||$enews==17)//专题
{
echo"Error:Change to use e:indexloop";
return false;
}
elseif($enews==25||$enews==26||$enews==27||$enews==28||$enews==29||$enews==30)//标题分类
{
if(strstr($classid,','))//多标题分类
{
$son_r=sys_ReturnMoreTT($classid);
$classid=$son_r[0];
$where=$son_r[1];
}
else
{
$where="ttid='$classid'";
}
$mid=$class_tr[$classid][mid];
$tbname=$emod_r[$mid][tbname];
$yhid=$class_tr[$classid][yhid];
}
$query=" where userid='$userid' and ismember=1";
if($enews==0)//栏目最新
{
$query.=' and ('.$where.')';
$order='newstime';
$yhvar='bqnew';
}
elseif($enews==1)//栏目热门
{
$query.=' and ('.$where.')';
$order='onclick';
$yhvar='bqhot';
}
elseif($enews==2)//栏目推荐
{
$query.=' and ('.$where.') and isgood>0';
$order='newstime';
$yhvar='bqgood';
}
elseif($enews==9)//栏目评论排行
{
$query.=' and ('.$where.')';
$order='plnum';
$yhvar='bqpl';
}
elseif($enews==12)//栏目头条
{
$query.=' and ('.$where.') and firsttitle>0';
$order='newstime';
$yhvar='bqfirst';
}
elseif($enews==15)//栏目下载排行
{
$query.=' and ('.$where.')';
$order='totaldown';
$yhvar='bqdown';
}
elseif($enews==3)//所有最新
{
$order='newstime';
$tbname=$public_r[tbname];
$mid=$etable_r[$tbname][mid];
$yhvar='bqnew';
$yhid=$etable_r[$tbname][yhid];
}
elseif($enews==4)//所有点击排行
{
$order='onclick';
$tbname=$public_r[tbname];
$mid=$etable_r[$tbname][mid];
$yhvar='bqhot';
$yhid=$etable_r[$tbname][yhid];
}
elseif($enews==5)//所有推荐
{
$query.=' and isgood>0';
$order='newstime';
$tbname=$public_r[tbname];
$mid=$etable_r[$tbname][mid];
$yhvar='bqgood';
$yhid=$etable_r[$tbname][yhid];
}
elseif($enews==10)//所有评论排行
{
$order='plnum';
$tbname=$public_r[tbname];
$mid=$etable_r[$tbname][mid];
$yhvar='bqpl';
$yhid=$etable_r[$tbname][yhid];
}
elseif($enews==13)//所有头条
{
$query.=' and firsttitle>0';
$order='newstime';
$tbname=$public_r[tbname];
$mid=$etable_r[$tbname][mid];
$yhvar='bqfirst';
$yhid=$etable_r[$tbname][yhid];
}
elseif($enews==16)//所有下载排行
{
$order='totaldown';
$tbname=$public_r[tbname];
$mid=$etable_r[$tbname][mid];
$yhvar='bqdown';
$yhid=$etable_r[$tbname][yhid];
}
elseif($enews==18)//各表最新
{
$order='newstime';
$tbname=$classid;
$mid=$etable_r[$tbname][mid];
$yhvar='bqnew';
$yhid=$etable_r[$tbname][yhid];
}
elseif($enews==19)//各表热门
{
$order='onclick';
$tbname=$classid;
$mid=$etable_r[$tbname][mid];
$yhvar='bqhot';
$yhid=$etable_r[$tbname][yhid];
}
elseif($enews==20)//各表推荐
{
$query.=' and isgood>0';
$order='newstime';
$tbname=$classid;
$mid=$etable_r[$tbname][mid];
$yhvar='bqgood';
$yhid=$etable_r[$tbname][yhid];
}
elseif($enews==21)//各表评论排行
{
$order='plnum';
$tbname=$classid;
$mid=$etable_r[$tbname][mid];
$yhvar='bqpl';
$yhid=$etable_r[$tbname][yhid];
}
elseif($enews==22)//各表头条信息
{
$query.=' and firsttitle>0';
$order="newstime";
$tbname=$classid;
$mid=$etable_r[$tbname][mid];
$yhvar='bqfirst';
$yhid=$etable_r[$tbname][yhid];
}
elseif($enews==23)//各表下载排行
{
$order='totaldown';
$tbname=$classid;
$mid=$etable_r[$tbname][mid];
$yhvar='bqdown';
$yhid=$etable_r[$tbname][yhid];
}
elseif($enews==25)//标题分类最新
{
$query.=' and ('.$where.')';
$order='newstime';
$yhvar='bqnew';
}
elseif($enews==26)//标题分类点击排行
{
$query.=' and ('.$where.')';
$order='onclick';
$yhvar='bqhot';
}
elseif($enews==27)//标题分类推荐
{
$query.=' and ('.$where.') and isgood>0';
$order='newstime';
$yhvar='bqgood';
}
elseif($enews==28)//标题分类评论排行
{
$query.=' and ('.$where.')';
$order='plnum';
$yhvar='bqpl';
}
elseif($enews==29)//标题分类头条
{
$query.=' and ('.$where.') and firsttitle>0';
$order='newstime';
$yhvar='bqfirst';
}
elseif($enews==30)//标题分类下载排行
{
$query.=' and ('.$where.')';
$order='totaldown';
$yhvar='bqdown';
}
//优化
$yhadd='';
if(!empty($eyh_r[$yhid]['dosbq']))
{
$yhadd=ReturnYhSql($yhid,$yhvar);
if(!empty($yhadd))
{
$query.=' and '.$yhadd;
}
}
//不调用
if(!strstr($public_r['nottobq'],','.$classid.','))
{
$notbqwhere=ReturnNottoBqWhere();
if(!empty($notbqwhere))
{
$query.=' and '.$notbqwhere;
}
}
//图片信息
if(!empty($do))
{
$query.=" and ispic=1";
}
//附加条件
if(!empty($ewhere))
{
$query.=' and ('.$ewhere.')';
}
//中止
if(empty($tbname))
{
echo "ClassID=<b>".$classid."</b> Table not exists.(DoType=".$enews.")";
return false;
}
//排序
$addorder=empty($eorder)?$order.' desc':$eorder;
$query='select '.ReturnSqlListF($mid).' from '.$dbtbpre.'ecms_'.$tbname.$query.' order by '.$addorder.' limit '.$line;
$sql=$empire->query1($query);
if(!$sql)
{
echo"SQL Error: ".ReRepSqlTbpre($query);
}
return $sql;
}
//灵动标签:返回SQL内容函数
function espace_eloop($classid=0,$line=10,$enews=3,$doing=0,$ewhere='',$eorder=''){
return espace_ReturnBqQuery($classid,$line,$enews,$doing,$ewhere,$eorder);
}
//灵动标签:返回特殊内容函数
function espace_eloop_sp($r){
global $class_r;
$sr['titleurl']=sys_ReturnBqTitleLink($r);
$sr['classname']=$class_r[$r[classid]][bname]?$class_r[$r[classid]][bname]:$class_r[$r[classid]][classname];
$sr['classurl']=sys_ReturnBqClassname($r,9);
return $sr;
}
?> | 21.178451 | 119 | 0.589984 |
654703d3442414e22c011435d888fb9d635fb514 | 1,138 | rs | Rust | src/command_control/completion_handler/generator/mod_template.rs | TheMindCompany/signedurl | c710b984ce9f7bb4074bcdff3821d279513e4fe4 | [
"MIT"
] | 1 | 2020-06-23T03:29:18.000Z | 2020-06-23T03:29:18.000Z | src/command_control/completion_handler/generator/mod_template.rs | TheMindCompany/signedurl | c710b984ce9f7bb4074bcdff3821d279513e4fe4 | [
"MIT"
] | null | null | null | src/command_control/completion_handler/generator/mod_template.rs | TheMindCompany/signedurl | c710b984ce9f7bb4074bcdff3821d279513e4fe4 | [
"MIT"
] | null | null | null | pub struct ModTemplate {
}
impl ModTemplate {
pub fn get_top_template() -> String {
String::from(
r#"pub struct CompletionScript { }
impl CompletionScript {
pub fn bash() {
println!("{}",r#"
"#,
)
}
pub fn get_fish_template() -> String {
String::from(
"
\"#);
}
pub fn fish() {
println!(\"{}\",r#\"
",
)
}
pub fn get_zsh_template() -> String {
String::from(
"
\"#);
}
pub fn zsh() {
println!(\"{}\",r#\"
",
)
}
pub fn get_ps1_template() -> String {
String::from(
"
\"#);
}
pub fn powershell() {
println!(\"{}\",r#\"
",
)
}
pub fn get_elvish_template() -> String {
String::from(
"
\"#);
}
pub fn elvish() {
println!(\"{}\",r#\"
",
)
}
pub fn get_bottom_template() -> String {
String::from(
"
\"#);
}
}
",
)
}
}
| 15.173333 | 46 | 0.353251 |
f5061509ed45f3ad65e3177383ca9cb080807981 | 8,676 | rs | Rust | examples/basic-server/examples/users.rs | ModProg/bonsaidb | 542cdccecc6876a43f47f858efd4a47c72301557 | [
"Apache-2.0",
"MIT"
] | null | null | null | examples/basic-server/examples/users.rs | ModProg/bonsaidb | 542cdccecc6876a43f47f858efd4a47c72301557 | [
"Apache-2.0",
"MIT"
] | null | null | null | examples/basic-server/examples/users.rs | ModProg/bonsaidb | 542cdccecc6876a43f47f858efd4a47c72301557 | [
"Apache-2.0",
"MIT"
] | null | null | null | //! Shows basic usage of users and permissions.
use std::time::Duration;
use bonsaidb::{
client::{url::Url, Client},
core::{
admin::{PermissionGroup, Role},
connection::{
AsyncStorageConnection, Authentication, AuthenticationMethod, SensitiveString,
},
permissions::{
bonsai::{BonsaiAction, DatabaseAction, DocumentAction, ServerAction},
Permissions, Statement,
},
schema::{InsertError, SerializedCollection},
},
local::config::Builder,
server::{Server, ServerConfiguration},
};
mod support;
use support::schema::Shape;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
drop(env_logger::try_init());
let server = setup_server().await?;
// This example shows off basic user authentication as well as the ability
// to assume roles. The server will be configured to only allow connected
// users the ability to authenticate. All other usage will result in
// PermissionDenied errors.
//
// We will create a user that belongs to a PermissionGroup that gives it the
// ability to insert and read documents, but not delete them. This example
// will demonstrate how to authenticate as the user, and shows how
// permission is denied before authentication but is allowed on the
// authenticated client.
//
// The other bit of setup we are going to do is create an administrators
// group that the user belongs to. This permission group will allow the user
// to assume any identity (user or role) in BonsaiDb. We are going to show
// how to use this to escalate privileges by creating a "superuser" Role,
// which belongs to a "superusers" group that grants all privileges.
//
// This example will finish by using the authenticated client to assume the
// Superuser role and delete the record we inserted. While this is a complex
// setup, it is a powerful pattern in Role Based Access Control which can
// help protect users from accidentally performing a dangerous operation.
// Create a database user, or get its ID if it already existed.
let user_id = match server.create_user("ecton").await {
Ok(id) => {
// Set the user's password.
server
.set_user_password("ecton", SensitiveString::from("hunter2"))
.await?;
id
}
Err(bonsaidb::core::Error::UniqueKeyViolation {
existing_document, ..
}) => existing_document.id.deserialize()?,
Err(other) => anyhow::bail!(other),
};
// Create an basic-users permission group, or get its ID if it already existed.
let admin = server.admin().await;
let users_group_id = match (PermissionGroup {
name: String::from("basic-users"),
statements: vec![Statement::for_any()
.allowing(&BonsaiAction::Database(DatabaseAction::Document(
DocumentAction::Insert,
)))
.allowing(&BonsaiAction::Database(DatabaseAction::Document(
DocumentAction::Get,
)))],
}
.push_into_async(&admin)
.await)
{
Ok(doc) => doc.header.id,
Err(InsertError {
error:
bonsaidb::core::Error::UniqueKeyViolation {
existing_document, ..
},
..
}) => existing_document.id.deserialize()?,
Err(other) => anyhow::bail!(other),
};
// Make our user a member of the basic-users group.
server
.add_permission_group_to_user(user_id, users_group_id)
.await?;
// Create an superusers group, which has all permissions
let superusers_group_id = match (PermissionGroup {
name: String::from("superusers"),
statements: vec![Statement::allow_all_for_any_resource()],
}
.push_into_async(&admin)
.await)
{
Ok(doc) => doc.header.id,
Err(InsertError {
error:
bonsaidb::core::Error::UniqueKeyViolation {
existing_document, ..
},
..
}) => existing_document.id.deserialize()?,
Err(other) => anyhow::bail!(other),
};
let superuser_role_id = match (Role {
name: String::from("superuser"),
groups: vec![superusers_group_id],
}
.push_into_async(&admin)
.await)
{
Ok(doc) => doc.header.id,
Err(InsertError {
error:
bonsaidb::core::Error::UniqueKeyViolation {
existing_document, ..
},
..
}) => existing_document.id.deserialize()?,
Err(other) => anyhow::bail!(other),
};
let administrators_group_id = match (PermissionGroup {
name: String::from("administrators"),
statements: vec![
Statement::for_any().allowing(&BonsaiAction::Server(ServerAction::AssumeIdentity))
],
}
.push_into_async(&admin)
.await)
{
Ok(doc) => doc.header.id,
Err(InsertError {
error:
bonsaidb::core::Error::UniqueKeyViolation {
existing_document, ..
},
..
}) => existing_document.id.deserialize()?,
Err(other) => anyhow::bail!(other),
};
// Make our user a member of the administrators group.
server
.add_permission_group_to_user(user_id, administrators_group_id)
.await?;
// Give a moment for the listeners to start.
tokio::time::sleep(Duration::from_millis(10)).await;
{
let client = Client::build(Url::parse("bonsaidb://localhost")?)
.with_certificate(
server
.certificate_chain()
.await?
.into_end_entity_certificate(),
)
.finish()?;
let db = client.database::<Shape>("my-database").await?;
// Before authenticating, inserting a shape shouldn't work.
match Shape::new(3).push_into_async(&db).await {
Err(InsertError {
error: bonsaidb::core::Error::PermissionDenied(denied),
..
}) => {
log::info!(
"Permission was correctly denied before logging in: {:?}",
denied
);
}
_ => unreachable!("permission shouldn't be allowed"),
}
// Now, log in and try again.
let authenticated_client = client
.authenticate(Authentication::password(
"ecton",
SensitiveString(String::from("hunter2")),
)?)
.await?;
let db = authenticated_client
.database::<Shape>("my-database")
.await?;
let shape_doc = Shape::new(3).push_into_async(&db).await?;
println!("Successully inserted document {:?}", shape_doc);
// The "basic-users" group and "administrators" groups do not give
// permission to delete documents:
assert!(matches!(
shape_doc.delete_async(&db).await.unwrap_err(),
bonsaidb::core::Error::PermissionDenied { .. }
));
// But we can assume the Superuser role to delete the document:
let as_superuser =
Role::assume_identity_async(superuser_role_id, &authenticated_client).await?;
shape_doc
.delete_async(&as_superuser.database::<Shape>("my-database").await?)
.await?;
}
// Shut the server down gracefully (or forcefully after 5 seconds).
server.shutdown(Some(Duration::from_secs(5))).await?;
Ok(())
}
async fn setup_server() -> anyhow::Result<Server> {
let server = Server::open(
ServerConfiguration::new("users-server-data.bonsaidb")
.default_permissions(Permissions::from(
Statement::for_any()
.allowing(&BonsaiAction::Server(ServerAction::Connect))
.allowing(&BonsaiAction::Server(ServerAction::Authenticate(
AuthenticationMethod::PasswordHash,
))),
))
.with_schema::<Shape>()?,
)
.await?;
if server.certificate_chain().await.is_err() {
server.install_self_signed_certificate(true).await?;
}
server.create_database::<Shape>("my-database", true).await?;
// Spawn our QUIC-based protocol listener.
let task_server = server.clone();
tokio::spawn(async move { task_server.listen_on(5645).await });
Ok(server)
}
#[test]
fn runs() {
main().unwrap();
main().unwrap();
}
| 34.15748 | 94 | 0.58172 |
1628e8e08312d99873ac687a37102e966b232060 | 162 | h | C | AbracodeFramework/OMCiTermExecutor.h | FlashSheridan/OMC | 206e38255df5d863c7a2e056ea4bf42dcfb9a155 | [
"MIT"
] | 20 | 2020-01-15T14:55:17.000Z | 2022-03-28T06:23:21.000Z | AbracodeFramework/OMCiTermExecutor.h | FlashSheridan/OMC | 206e38255df5d863c7a2e056ea4bf42dcfb9a155 | [
"MIT"
] | 15 | 2019-08-19T07:28:21.000Z | 2022-01-21T01:06:02.000Z | AbracodeFramework/OMCiTermExecutor.h | FlashSheridan/OMC | 206e38255df5d863c7a2e056ea4bf42dcfb9a155 | [
"MIT"
] | 5 | 2020-02-25T22:19:39.000Z | 2021-04-13T08:32:51.000Z | /*
* OMCTerminalExecutor.h
* OnMyCommandCM
*/
void ExecuteInITerm(CFStringRef inCommand, CFStringRef inShellPath, bool openInNewWindow, bool bringToFront);
| 23.142857 | 109 | 0.790123 |
952b7949637e34c02a4873480079dd25d13b7b76 | 26,380 | css | CSS | data/usercss/175576.user.css | 33kk/uso-archive | 2c4962d1d507ff0eaec6dcca555efc531b37a9b4 | [
"MIT"
] | 118 | 2020-08-28T19:59:28.000Z | 2022-03-26T16:28:40.000Z | data/usercss/175576.user.css | 33kk/uso-archive | 2c4962d1d507ff0eaec6dcca555efc531b37a9b4 | [
"MIT"
] | 38 | 2020-09-02T01:08:45.000Z | 2022-01-23T02:47:24.000Z | data/usercss/175576.user.css | 33kk/uso-archive | 2c4962d1d507ff0eaec6dcca555efc531b37a9b4 | [
"MIT"
] | 21 | 2020-08-19T01:12:43.000Z | 2022-03-15T21:55:17.000Z | /* ==UserStyle==
@name Custom - One Ring - Dark
@namespace USO Archive
@author MyIrish
@description `An edit, not all my work. Thanks to the guys who made the One Ring. However, this adds/fixes some colors to make a dark theme.`
@version 20190923.2.28
@license NO-REDISTRIBUTION
@preprocessor uso
==/UserStyle== */
@-moz-document domain("app.roll20.net"), domain("roll20.net") {
html,
body {
height: 100% !important;
}
.container {
background-color: #ffffff33;
}
p {
color: #d8dada;
}
.alert-info {
background-color: rgba(168, 140, 213, 0.2);
color: #ddc7ff;
}
a.calltoaction {
color: #c3fcff;
}
body.loggedin .container {
background-color: #ffffff2e;
}
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-weight: 700;
line-height: 1.1;
color: #b980b7;
}
body {
background: url('http://static.squarespace.com/static/52ed62c3e4b0957cc4094975/t/52fae638e4b073964669991d/1392174648988/ring.png') center center no-repeat, url('http://static.squarespace.com/static/52ed62c3e4b0957cc4094975/t/52fae643e4b0739646699930/1392174662191/wood.jpg') !important;
box-shadow: inset 0 0 200px rgba(0, 0, 0, .8) !important;
}
#floatingtoolbar {
background-color: rgba(0, 0, 0, .9) !important;
border: none !important;
box-shadow: none !important;
width: 50px !important;
}
#floatingtoolbar div.submenu {
left: 50px !important;
padding: 0 !important;
top: 0 !important;
}
#floatingtoolbar div.submenu .pictos,
#floatingtoolbar div.submenu .pictosthree,
#floatingtoolbar div.submenu .pictostwo {
left: 15px !important;
position: absolute !important;
text-align: center !important;
width: 20px !important;
}
#floatingtoolbar div.submenu ul {
border: 0 !important;
border-radius: 0 !important;
padding: 0 !important;
width: 200px !important;
}
#floatingtoolbar div.submenu ul li {
color: #444 !important;
padding-left: 45px !important;
padding-right: 20px !important;
}
#floatingtoolbar div.submenu ul li span {
padding: 0 !important;
}
#floatingtoolbar div.submenu ul li:hover {
background-color: #99d8ed !important;
}
#floatingtoolbar li {
border: 0 !important;
color: #ccc !important;
height: 50px !important;
line-height: 50px !important;
padding: 0 !important;
}
#floatingtoolbar li.activebutton,
#floatingtoolbar li:hover {
background-color: white !important;
color: #111 !important;
}
#floatingtoolbar li:last-child {
border-bottom: none !important;
}
#floatingtoolbar ul {
box-shadow: none !important;
}
#page-toolbar {
background-color: #111 !important;
border-radius: 0 !important;
height: 160px !important;
left: 0 !important;
right: 0 !important;
width: initial !important;
}
#page-toolbar .availablepage {
box-sizing: border-box !important;
height: 160px !important;
margin: 0 !important;
padding: 10px !important;
vertical-align: top !important;
width: 160px !important;
}
#page-toolbar .availablepage .pagethumb {
margin-top: 15px !important;
}
#page-toolbar .availablepage span {
bottom: 20px !important;
left: 0 !important;
right: 0 !important;
text-shadow: none !important;
color: #eee !important;
font-size: 12px !important;
}
#page-toolbar .container {
transition: opacity .4s ease-in-out !important;
}
#page-toolbar .handle {
background: #111 !important;
border-radius: 0 0 100% 100% !important;
bottom: -29px !important;
color: #eee !important;
height: 29px !important;
opacity: 1 !important;
width: 100px !important;
right: 50% !important;
margin-left: -50px !important;
padding: 0 !important;
}
#page-toolbar .handle .pictos {
display: none !important;
}
#page-toolbar .handle:after {
content: 'PAGES' !important;
font-size: 11px !important;
letter-spacing: 2px !important;
height: 100% !important;
left: 0 !important;
position: absolute !important;
top: 0 !important;
width: 100% !important;
}
#page-toolbar .playerbookmark {
left: 30px !important;
top: 25px !important;
}
#page-toolbar.closed .container {
box-shadow: 0 0 50px rgba(0, 0, 0, .15) !important;
opacity: 0 !important;
}
#playerzone {
bottom: 20px !important;
left: 20px !important;
}
#playerzone .player {
margin: 0 !important;
margin-right: 10px !important;
}
#playerzone .player .color_picker {
top: 0 !important;
}
#playerzone .player .playername {
background-color: #111 !important;
font-size: 14px !important;
line-height: 24px !important;
padding: 0 !important;
}
#rightsidebar {
-moz-border-radius-bottomleft: 0 !important;
-moz-border-radius-bottomright: 0 !important;
-moz-border-radius-topleft: 0 !important;
-moz-border-radius-topright: 0 !important;
-webkit-border-bottom-left-radius: 0 !important;
-webkit-border-bottom-right-radius: 0 !important;
-webkit-border-top-left-radius: 0 !important;
-webkit-border-top-right-radius: 0 !important;
border-bottom-left-radius: 0 !important;
border-bottom-right-radius: 0 !important;
border-top-left-radius: 0 !important;
border-top-right-radius: 0 !important;
border-style: none !important;
overflow: initial !important;
box-shadow: 0 0 50px rgba(0, 0, 0, .15) !important;
}
#secondary-toolbar {
background-color: #222 !important;
border: 0 !important;
box-shadow: none !important;
left: 90px !important;
opacity: 1 !important;
}
#secondary-toolbar .btn {
border: 0 !important;
border-radius: 0 !important;
margin: 5px !important;
}
#secondary-toolbar li {
border: 0 !important;
height: initial !important;
}
#textchat .message.system .spacer {
background-color: #ddd !important;
}
#rightsidebar ul.tabmenu {
position: fixed;
top: -6px;
right: 0;
width: 290px;
background-color: #d0c1b4;
z-index: 100;
border-radius: 0;
}
#rightsidebar {
-webkit-user-select: text;
position: absolute;
right: 0;
width: 300px;
background-color: #8a6b4d;
overflow: hidden;
border-left: 1px solid black;
height: 100%;
top: 0;
padding: 0;
margin: 0;
z-index: 100;
}
.ui-widget-content {
border: 1px solid #ef1313;
background: #3a0c14 url(https://d3clqjduf2gvxg.cloudfront.net/css/themes/bootstrap/images/ui-bg_glass_75_ffffff_1x400.png) 50% 50% repeat-x;
color: #404040;
}
.ui-dialog .characterdialog.ui-dialog-content {
padding: 0 20px 0 20px;
background-color: #3a0c14cf;
}
.ui-dialog .ui-dialog-title {
float: left;
color: #e8decd;
font-weight: bold;
margin-top: 5px;
margin-bottom: 5px;
padding: 5px;
}
.ui-dialog .charsheet input {
height: auto;
vertical-align: middle;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
background-color: #5a00001c;
}
.ui-widget-content a {
color: #f9f3e9;
}
#sidebarcontrol {
opacity: 1 !important;
padding: 0 !important;
-webkit-transform: translateX(0) rotate(-90deg) !important;
-moz-transform: translateX(0) rotate(-90deg) !important;
width: 100px !important;
text-align: center !important;
border: none !important;
font-size: 12px !important;
color: #dec6ae !important;
background-color: #6c6666 !important;
height: 30px !important;
line-height: 30px !important;
text-transform: uppercase !important;
letter-spacing: 2px !important;
-webkit-transform-origin: 100% 100% !important;
-moz-transform-origin: 100% 100% !important;
border-radius: 100% 100% 0 0 !important;
top: 50% !important;
margin-top: -75px !important;
}
.actions_menu {
width: 120px !important;
z-index: 110 !important;
/* above sidebar */
}
.actions_menu > ul {
width: initial !important;
padding: 0 !important;
border: 0 !important;
}
.actions_menu ul li {
padding: 0 10px !important;
line-height: 30px !important;
min-width: 90px !important;
border-color: #ddd !important;
white-space: nowrap !important;
}
.actions_menu ul li:lastchild {
border-bottom: 0 !important;
}
.actions_menu ul li ul.submenu {
left: 90px !important;
border: 0 !important;
width: initial !important;
opacity: 1 !important;
box-shadow: 0 1px 15px rgba(0, 0, 0, .1) !important;
}
#measure img {
-webkit-filter: brightness(2.3) !important;
}
.nav-tabs li a {
outline: none !important;
}
#sidebarcontrol {
opacity: 1 !important;
padding: 0 !important;
-webkit-transform: translateX(0) rotate(-90deg) !important;
-moz-transform: translateX(0) rotate(-90deg) !important;
width: 100px !important;
text-align: center !important;
border: none !important;
font-size: 12px !important;
color: #eee !important;
background-color: #111 !important;
height: 30px !important;
line-height: 30px !important;
text-transform: uppercase !important;
letter-spacing: 2px !important;
-webkit-transform-origin: 100% 100% !important;
-moz-transform-origin: 100% 100% !important;
border-radius: 100% 100% 0 0 !important;
top: 50% !important;
margin-top: -75px !important;
}
#sidebarcontrol .fonticon-menu {
display: none !important;
}
#sidebarcontrol:after {
content: 'Menu' !important;
}
body {
/* background: url('http://i.imgur.com/fBTyXhK.jpg') !important; */
/* background: url('http://i.imgur.com/fRaY82J.jpg') !important; */
background-image: none;
background-color: #000000;
/* box-shadow: inset 0 0 200px rgba(0,0,0,.8) !important; */
}
#floatingtoolbar {
background-color: rgba(0, 0, 0, .9) !important;
border: none !important;
box-shadow: none !important;
width: 50px !important;
font-family: "Lucida Console", Monaco, monospace !important;
}
#floatingtoolbar div.submenu {
left: 50px !important;
padding: 0 !important;
top: 0 !important;
}
#floatingtoolbar div.submenu .pictos,
#floatingtoolbar div.submenu .pictosthree,
#floatingtoolbar div.submenu .pictostwo {
left: 15px !important;
position: absolute !important;
text-align: center !important;
width: 20px !important;
}
#floatingtoolbar div.submenu ul {
border: 0 !important;
border-radius: 0 !important;
padding: 0 !important;
width: 200px !important;
}
#floatingtoolbar div.submenu ul li {
color: #444 !important;
padding-left: 45px !important;
padding-right: 20px !important;
}
#floatingtoolbar div.submenu ul li span {
padding: 0 !important;
}
#floatingtoolbar div.submenu ul li:hover {
background-color: #99d8ed !important;
}
#floatingtoolbar li {
border: 0 !important;
color: #ccc !important;
height: 50px !important;
line-height: 50px !important;
padding: 0 !important;
}
#floatingtoolbar li.activebutton,
#floatingtoolbar li:hover {
background-color: white !important;
color: #111 !important;
}
#floatingtoolbar li:last-child {
border-bottom: none !important;
}
#floatingtoolbar ul {
box-shadow: none !important;
}
#page-toolbar {
background-color: #4d4b48 !important;
border-radius: 0 !important;
height: 160px !important;
left: 0 !important;
right: 0 !important;
width: initial !important;
}
#page-toolbar .availablepage {
box-sizing: border-box !important;
height: 160px !important;
margin: 0 !important;
padding: 10px !important;
vertical-align: top !important;
width: 160px !important;
}
#page-toolbar .availablepage .pagethumb {
margin-top: 5px !important;
}
#page-toolbar .availablepage span {
bottom: 30px !important;
left: 0 !important;
right: 0 !important;
text-shadow: none !important;
color: #eee !important;
font-size: 12px !important;
}
#page-toolbar .container {
transition: opacity .4s ease-in-out !important;
}
#page-toolbar .handle {
background: #111 !important;
border-radius: 0 0 100% 100% !important;
bottom: -29px !important;
color: #eee !important;
height: 29px !important;
opacity: 1 !important;
width: 100px !important;
right: 50% !important;
margin-left: -50px !important;
padding: 0 !important;
}
#page-toolbar .handle .pictos {
display: none !important;
}
#page-toolbar .handle:after {
content: 'PAGES' !important;
font-size: 11px !important;
letter-spacing: 2px !important;
height: 100% !important;
left: 0 !important;
position: absolute !important;
top: 0 !important;
width: 100% !important;
}
/*
#page-toolbar .playerbookmark {
left: 30px !important;
top: 25px !important;
}
*/
#page-toolbar.closed .container {
box-shadow: 0 0 50px rgba(0, 0, 0, .15) !important;
opacity: 0 !important;
}
/*
#playerzone {
bottom: 20px !important;
left: 20px !important;
}
#playerzone .player {
margin: 0 !important;
margin-right: 10px !important;
}
#playerzone .player .color_picker {
top: 0 !important;
}
#playerzone .player .playername {
background-color: #111 !important;
font-size: 14px !important;
line-height: 24px !important;
padding: 0 !important;
}
*/
#rightsidebar {
-moz-border-radius-bottomleft: 0 !important;
-moz-border-radius-bottomright: 0 !important;
-moz-border-radius-topleft: 0 !important;
-moz-border-radius-topright: 0 !important;
-webkit-border-bottom-left-radius: 0 !important;
-webkit-border-bottom-right-radius: 0 !important;
-webkit-border-top-left-radius: 0 !important;
-webkit-border-top-right-radius: 0 !important;
border-bottom-left-radius: 0 !important;
border-bottom-right-radius: 0 !important;
border-top-left-radius: 0 !important;
border-top-right-radius: 0 !important;
border-style: none !important;
overflow: initial !important;
box-shadow: 0 0 50px rgba(0, 0, 0, .15) !important;
}
#secondary-toolbar {
background-color: #222 !important;
border: 0 !important;
box-shadow: none !important;
left: 90px !important;
opacity: 1 !important;
}
#secondary-toolbar .btn {
border: 0 !important;
border-radius: 0 !important;
margin: 5px !important;
}
#secondary-toolbar li {
border: 0 !important;
height: initial !important;
}
#textchat .message.system {
background-color: #4a4a4a !important;
color: #000000;
}
#textchat .message.system .spacer {
background-color: #ddd !important;
}
/*
.tabmenu {
height: 50px !important;
position: absolute !important;
left: 0 !important;
right: 0 !important;
margin: 0 !important;
padding: 0 !important;
top: 0 !important;
}
.tabmenu li {
height: 50px !important;
width: 16.667% !important;
text-align: center !important;
top: 0 !important;
}
.tabmenu li a {
padding: 0 !important;
margin: 0 !important;
line-height: 50px !important;
border: 0 !important;
width: 100% !important;
}
#rightsidebar .ui-tabs-panel {
top: 70px !important;
}
#rightsidebar .ui-tabs-panel#textchat {
position: absolute !important;
top: 50px !important;
height: initial !important;
bottom: 150px !important;
}
#textchat-input {
border-top: 0 !important;
padding: 10px !important;
height: initial !important;
min-width: 260px !important;
box-sizing: border-box !important;
}
#textchat-input * {
box-sizing: border-box !important;
}
#textchat-input textarea {
width: 100% !important;
height: 80px !important;
resize: none !important;
}
*/
.actions_menu {
width: 120px !important;
z-index: 110 !important;
/* above sidebar */
}
.actions_menu > ul {
width: initial !important;
padding: 0 !important;
border: 0 !important;
}
.actions_menu ul li {
padding: 0 10px !important;
line-height: 30px !important;
min-width: 90px !important;
border-color: #ddd !important;
white-space: nowrap !important;
}
.actions_menu ul li:lastchild {
border-bottom: 0 !important;
}
.actions_menu ul li ul.submenu {
left: 90px !important;
border: 0 !important;
width: initial !important;
opacity: 1 !important;
box-shadow: 0 1px 15px rgba(0, 0, 0, .1) !important;
}
#measure img {
-webkit-filter: brightness(2.3) !important;
}
.nav-tabs li a {
outline: none !important;
}
#sidebarcontrol {
opacity: 1 !important;
padding: 0 !important;
-webkit-transform: translateX(0) rotate(-90deg) !important;
-moz-transform: translateX(0) rotate(-90deg) !important;
width: 100px !important;
text-align: center !important;
border: none !important;
font-size: 12px !important;
color: #eee !important;
background-color: #111 !important;
height: 30px !important;
line-height: 30px !important;
text-transform: uppercase !important;
letter-spacing: 2px !important;
-webkit-transform-origin: 100% 100% !important;
-moz-transform-origin: 100% 100% !important;
border-radius: 100% 100% 0 0 !important;
top: 50% !important;
margin-top: -75px !important;
}
#sidebarcontrol .fonticon-menu {
display: none !important;
}
#sidebarcontrol:after {
content: 'Menu' !important;
}
#editor-wrapper {
overflow: hidden!important;
}
.ui-widget-content {
color: hsl(349, 68%, 29%)!important;
border: 1px solid black!important;
background: hsl(0, 0%, 20%)!important;
}
#rightsidebar {
background-color: hsl(0, 0%, 0%)!important;
}
::-webkit-scrollbar {
width: 12px;
height: 12px;
}
::-webkit-scrollbar-button {
width: 0px;
height: 0px;
}
::-webkit-scrollbar-thumb {
background: #a23636;
border: 0px none #ffffff;
border-radius: 0px;
}
::-webkit-scrollbar-thumb:hover {
background: #ca0d0d;
}
::-webkit-scrollbar-track {
background: #e38c8c;
border: 0px none #ffffff;
border-radius: 0px;
}
#rightsidebar .paddedtable .content {
padding: 10px;
color: #e26e68;
}
#textchat .message.rollresult {
border-color: hsl(200, 30%, 40%)!important;
color: #ff8484;
}
.diceroll .didroll {
text-shadow: 0 0 10px hsl(0, 0%, 0%)!important;
color: hsl(0, 0%, 98%)!important;
}
#textchat .message.system {
background-color: #292929 !important;
color: #af9d9d;
}
#textchat .userscript-sharelink a {
color: #00f3ff!important;
}
#textchat .userscript-sharelink {
background-color: #292929;
cursor: pointer;
display: block;
margin: 5px 0 5px 0;
opacity: .50;
}
#textchat .message.system .spacer {
background-color: hsl(0, 43%, 53%)!important;
}
code {
color: hsl(47, 69%, 71%)!important;
background-color: hsl(0, 0%, 20%)!important;
border: 1px solid hsl(0, 0%, 0%)!important;
}
::-webkit-scrollbar-corner {
background: transparent;
}
#textchat .formula,
#textchat .rolled {
background: hsl(0, 0%, 20%)!important;
border: 1px solid hsl(0, 0%, 0%)!important;
}
#textchat .message {
background-color: hsl(0, 0%, 10%)!important;
border: none!important;
}
#textchat .rolled {
color: hsl(0, 0%, 75%)!important;
}
#textchat .message.system {
border-color: hsl(100, 30%, 40%)!important;
}
#textchat .message.private {
border-color: hsl(50, 30%, 40%)!important;
}
#textchat .message.rollresult {
border-color: hsl(200, 30%, 40%)!important;
}
#textchat .message.private .spacer {
background-color: hsl(50, 30%, 40%)!important;
}
#textchat .message.rollresult .spacer {
background-color: hsl(200, 30%, 40%)!important;
}
#textchat .message .spacer {
background-color: hsl(0, 0%, 50%)!important;
margin-right: -5px!important;
height: 1px!important;
}
#textchat .formula,
#textchat .rolled {
background: hsl(0, 0%, 23%)!important;
border: 1px solid hsl(0, 0%, 0%)!important;
}
#textchat .message.emote {
border-color: hsl(25, 30%, 40%)!important;
color: hsl(25, 30%, 40%)!important;
}
#textchat .message.emote .spacer {
background-color: hsl(25, 30%, 40%)!important;
}
#rightsidebar ul.tabmenu {
position: fixed!important;
top: 2px!important;
right: 1px!important;
background-color: hsl(0, 92%, 4%)!important;
}
.ui-tabs .ui-tabs-nav {
padding: 1px 5px!important;
border-bottom: none!important;
}
.ui-state-default,
.ui-widget-content .ui-state-default,
.ui-widget-header .ui-state-default {
text-shadow: none!important;
}
#textchat-input {
position: absolute!important;
right: 0!important;
bottom: 0!important;
width: 300px !important;
background-color: hsl(0, 2%, 13%)!important;
padding: 12px 1px 5px 5px!important;
margin: 0 -5px 0 0!important;
border-top: 0 solid hsl(0, 0%, 0%)!important;
text-align: left!important;
}
.btn {
background: none!important;
text-shadow: none!important;
}
.btn:hover {
text-shadow: 0 0 5px hsl(200, 60%, 60%)!important;
color: hsl(0, 0%, 75%)!important;
}
textarea,
select,
.btn,
input {
background-color: hsl(22, 35%, 86%);
color: hsl(0, 84%, 39%);
border-color: black;
}
table {
border-color: black!important;
}
.diceroll .didroll {
text-shadow: 0 0 10px hsl(0, 0%, 0%)!important;
color: hsl(0, 0%, 75%)!important;
}
.diceroll.critfail .didroll {
text-shadow: 0 0 10px hsl(0, 100%, 50%)!important;
color: hsl(0, 80%, 50%)!important;
}
.diceroll.critsuccess .didroll {
text-shadow: 0 0 10px hsl(100, 50%, 50%)!important;
color: hsl(100, 50%, 50%)!important;
}
.ui-dialog .ui-dialog-buttonpane {
background-color: hsl(0, 0%, 15%)!important;
border-top: none!important;
box-shadow: none!important;
}
.ui-dialog .ui-dialog-titlebar {
border: none!important;
background-color: hsl(0, 0%, 15%)!important;
}
#initiativewindow ul li {
border-bottom: 1px solid hsl(0, 0%, 20%)!important;
background-color: hsl(0, 0%, 25%)!important;
text-shadow: none!important;
}
#initiativewindow ul li:first-child {
background-color: hsl(100, 30%, 25%)!important;
}
.ui-widget-content a,
.ui-dialog .ui-dialog-title,
label,
h1,
h2,
h3,
h4,
h5,
h6 {
color: hsl(0, 0%, 75%);
}
hr {
border-color: hsl(0, 0%, 15%)!important;
}
.table-striped tbody tr:nth-child(odd) td,
.table-striped tbody tr:nth-child(odd) th {
background-color: hsl(0, 0%, 25%)!important;
}
.table tbody tr:hover td,
.table tbody tr:hover th {
background-color: hsl(0, 0%, 30%)!important;
}
.table th,
.table td {
border-color: hsl(0, 0%, 20%)!important;
background-color: hsl(0, 0%, 25%)!important;
}
#imagedialog .searchbox {
background: none!important;
}
.dd-content {
color: #969696 !important;
}
.characterdialog {
background: #330404 !important;
}
.backing {
text-shadow: none!important;
}
.nav-tabs > .active > a,
.nav-tabs > .active > a:hover {
color: #022229;
background-color: #4f0303;
border: 1px solid #5bbacd;
}
.nav > li > a:hover {
background-color: #5e0606;
}
.ui-dialog ::-webkit-scrollbar {
width: 8px;
background-color: #19867e !important;
border: none;
}
.ui-dialog ::-webkit-scrollbar-corner {
background-color: #19867e !important;
border: none;
}
.ui-dialog ::-webkit-scrollbar-track {
background-color: #ce9090 !important;
border-left: 1px solid #ccc;
border: none;
}
.ui-dialog ::-webkit-scrollbar-thumb {
background-color: #a64545 !important;
border-radius: 0px !important;
border: none;
}
.ui-dialog ::-webkit-scrollbar-thumb:hover {
background-color: #ca0d0d !important;
border: none;
}
.redactor_editor.bio {
background-color: transparent !important;
color: #68949d;
font-family: "Lucida Console", "Lucida Sans Typewriter", monaco, "Bitstream Vera Sans Mono", monospace;
}
.attributesabilities .abil {
background-color: #103239;
padding: 10px;
}
.dropbox.filled {
border: 4px solid #333333;
}
.charactereditor .avatar {
width: 100%;
min-height: 150px;
}
.ui-dialog .ui-dialog-titlebar-close {
background-color: black;
}
.dd-handle {
color: #c0c0c0 !important;
background-color: #636363;
top: 6px;
}
.folderroot .dd-content {
border-top: 1px solid #262222;
}
.ui-tabs .ui-tabs-nav li:hover,
.ui-tabs .ui-tabs-nav li a:hover {
background: #373737;
border-bottom: 1px solid #373737;
}
#rightsidebar .ui-tabs-nav a {
color: #cbcbcb;
}
.pBody a {
border-bottom: 1px solid #EAEAEA;
color: #ecb657;
display: block;
padding: 0.35em 2px;
line-height: 80%;
}
#wiki-tools h2 {
color: #fdeaea !important;
font-size: 20px;
font-weight: bold;
padding: 0 0 0 20px;
margin-bottom: 5px;
margin-top: 10px;
}
#main-content {
background: none repeat scroll 0 0 #ffffff40;
border-radius: 10px 10px 10px 10px;
box-shadow: 1px 1px 4px rgba(0, 0, 0, 0.2);
padding: 10px 15px 40px;
overflow: hidden;
}
h1#page-title {
margin: 10px 0 15px;
font-size: 35px;
color: #fdeaea;
line-height: 1;
}
a:link {
color: #46bdd8;
text-decoration: none;
}
#toc {
background-color: #0000004d;
border: 1px solid #c31717;
padding: 0 5px;
}
} | 23.079615 | 291 | 0.628241 |
959a012d4904c8f899930fe8c77998e9874b33f8 | 1,943 | swift | Swift | Sources/WolfFoundation/Extensions/DataExtensions.swift | wolfmcnally/WolfFoundation | 8370e79858c238b584600374bd13484414796c72 | [
"MIT"
] | null | null | null | Sources/WolfFoundation/Extensions/DataExtensions.swift | wolfmcnally/WolfFoundation | 8370e79858c238b584600374bd13484414796c72 | [
"MIT"
] | null | null | null | Sources/WolfFoundation/Extensions/DataExtensions.swift | wolfmcnally/WolfFoundation | 8370e79858c238b584600374bd13484414796c72 | [
"MIT"
] | null | null | null | //
// DataExtensions.swift
// WolfFoundation
//
// Created by Wolf McNally on 6/8/16.
//
// 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, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
import Foundation
import WolfPipe
// Support the Serializable protocol used for caching
extension Data: Serializable {
public typealias ValueType = Data
public func serialize() -> Data {
return self
}
public static func deserialize(from data: Data) throws -> Data {
return data
}
public init(bytes: Slice<Data>) {
self.init(Array(bytes))
}
}
public func printDataAsString(_ data: Data) {
print(String(data: data, encoding: .utf8)!)
}
public func reversed(_ data: Data) -> Data {
return Data(data.reversed())
}
public func append(_ appendedData: Data) -> (_ data: Data) -> Data {
return { data in
var varData = data
varData.append(appendedData)
return varData
}
}
| 31.852459 | 82 | 0.708183 |
270449535b496b989764388f53338d8e5de33f9e | 304 | h | C | runtime/STMassgeManager.h | LFJComponent/LFJRunTime | 6a750c9ca509991a2bc316b0831c0fa04770aff7 | [
"MIT"
] | null | null | null | runtime/STMassgeManager.h | LFJComponent/LFJRunTime | 6a750c9ca509991a2bc316b0831c0fa04770aff7 | [
"MIT"
] | null | null | null | runtime/STMassgeManager.h | LFJComponent/LFJRunTime | 6a750c9ca509991a2bc316b0831c0fa04770aff7 | [
"MIT"
] | null | null | null | //
// STMassgeManager.h
// StevenShowMassage
//
// Created by 李方建 on 2018/6/9.
// Copyright © 2018年 李方建. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface STMassgeManager : NSObject
+ (STMassgeManager*)shared;
- (void)showMassage:(NSString *)massage;
@end
| 20.266667 | 47 | 0.713816 |
77bba6bb08508f3074df618e68137e8953a341bb | 2,469 | kt | Kotlin | collection/collection/src/commonTest/kotlin/androidx/collection/internal/LruHashMapTest.kt | AndroidX/androidx | 3605520a7da0e350bf00d7de489ad1759a7b9e70 | [
"Apache-2.0"
] | 7 | 2020-07-23T18:52:59.000Z | 2020-07-23T20:31:41.000Z | collection/collection/src/commonTest/kotlin/androidx/collection/internal/LruHashMapTest.kt | AndroidX/androidx | 3605520a7da0e350bf00d7de489ad1759a7b9e70 | [
"Apache-2.0"
] | 2 | 2020-07-23T19:17:07.000Z | 2020-07-23T19:43:42.000Z | collection/collection/src/commonTest/kotlin/androidx/collection/internal/LruHashMapTest.kt | AndroidX/androidx | 3605520a7da0e350bf00d7de489ad1759a7b9e70 | [
"Apache-2.0"
] | 5 | 2020-07-23T18:45:08.000Z | 2020-07-23T18:56:15.000Z | /*
* Copyright 2022 The Android Open Source Project
*
* 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 under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package androidx.collection.internal
import kotlin.test.Test
import kotlin.test.assertContentEquals
import kotlin.test.assertEquals
import kotlin.test.assertFalse
import kotlin.test.assertNull
import kotlin.test.assertTrue
internal class LruHashMapTest {
private val map = LruHashMap<String, String>(initialCapacity = 16, loadFactor = 0.75F)
@Test
fun isEmptyReturnsTrueIfEmpty() {
assertTrue(map.isEmpty)
}
@Test
fun isEmptyReturnsFalseIfInserted() {
map.put("a", "A")
assertFalse(map.isEmpty)
}
@Test
fun isEmptyReturnsTrueIfLastEntryRemoved() {
map.put("a", "A")
map.remove("a")
assertTrue(map.isEmpty)
}
@Test
fun getReturnsNullIfNotExists() {
val value = map["a"]
assertNull(value)
}
@Test
fun getReturnsValueIfExists() {
map.put("a", "A")
val value = map["a"]
assertEquals("A", value)
}
@Test
fun getReturnsNullIfValueRemoved() {
map.put("a", "A")
map.remove("a")
val value = map["a"]
assertNull(value)
}
@Test
fun iteratesInInsertionOrder() {
map.put("a", "A")
map.put("b", "B")
val list = map.entries.map { (k, v) -> k to v }
assertContentEquals(listOf("a" to "A", "b" to "B"), list)
}
@Test
fun getMovesEntryToTheEnd() {
map.put("a", "A")
map.put("b", "B")
map["a"]
val list = map.entries.map { (k, v) -> k to v }
assertContentEquals(listOf("b" to "B", "a" to "A"), list)
}
@Test
fun putMovesEntryToTheEnd() {
map.put("a", "A")
map.put("b", "B")
map.put("a", "A")
val list = map.entries.map { (k, v) -> k to v }
assertContentEquals(listOf("b" to "B", "a" to "A"), list)
}
} | 22.861111 | 90 | 0.601458 |
960c31ddca881367693ae37d138005b7c17eea64 | 1,160 | swift | Swift | Focus for YouTube/ChecklistRow.swift | kevcube/Focus-for-YouTube | a09e41bf0ccbc5171b35593c78e4c8f660a9858b | [
"MIT"
] | 12 | 2020-08-29T12:49:47.000Z | 2021-09-07T08:46:39.000Z | Focus for YouTube/ChecklistRow.swift | kevcube/Focus-for-YouTube | a09e41bf0ccbc5171b35593c78e4c8f660a9858b | [
"MIT"
] | 13 | 2020-10-11T21:40:29.000Z | 2021-09-08T15:51:09.000Z | Focus for YouTube/ChecklistRow.swift | kevcube/Focus-for-YouTube | a09e41bf0ccbc5171b35593c78e4c8f660a9858b | [
"MIT"
] | 2 | 2021-09-25T19:58:01.000Z | 2022-03-25T20:33:01.000Z | //
// BlockableElementRow.swift
// Focus for YouTube
//
// Created by Patrick Botros on 5/20/20.
// Copyright © 2020 Patrick Botros. All rights reserved.
//
import Cocoa
protocol DOMElementCellDelegate: AnyObject {
func updateDataSource(blocked: Bool, index: Int)
func updateBlockListJSON()
}
class ChecklistRow: NSTableRowView {
var elementName: String?
var rowNumber: Int?
weak var containingViewController: DOMElementCellDelegate?
var blockableElements: [BlockableElement]?
@IBAction func checkBoxClicked(_ sender: Any) {
if blockableElements![rowNumber!].blocked {
containingViewController?.updateDataSource(blocked: false, index: rowNumber!)
containingViewController?.updateBlockListJSON()
defaults.set(false, forKey: elementName!)
} else {
containingViewController?.updateDataSource(blocked: true, index: rowNumber!)
containingViewController?.updateBlockListJSON()
defaults.set(true, forKey: elementName!)
}
}
@IBOutlet weak var checkBoxImage: NSButton!
@IBOutlet weak var elementNameLabel: NSTextFieldCell!
}
| 32.222222 | 89 | 0.705172 |
8b6f5faef276c5c2835e31ec26a551d62f9e3a8d | 9,194 | lua | Lua | fairseq/test/test_tokenizer.lua | weixsong/Codeblock | 413e7acd6addc4950bffe2d57eb0cc7973c6fb7a | [
"MIT"
] | 4,180 | 2017-05-09T16:08:06.000Z | 2022-03-29T04:44:20.000Z | test/test_tokenizer.lua | xiuzbl/fairseq-1 | 39e98d640a74bc527cac3d8fe10ea5a4d77c8551 | [
"BSD-3-Clause"
] | 146 | 2017-05-09T18:45:59.000Z | 2022-02-17T23:51:24.000Z | test/test_tokenizer.lua | xiuzbl/fairseq-1 | 39e98d640a74bc527cac3d8fe10ea5a4d77c8551 | [
"BSD-3-Clause"
] | 755 | 2017-05-09T17:00:09.000Z | 2022-03-14T13:05:49.000Z | -- Copyright (c) 2017-present, Facebook, Inc.
-- All rights reserved.
--
-- This source code is licensed under the license found in the LICENSE file in
-- the root directory of this source tree. An additional grant of patent rights
-- can be found in the PATENTS file in the same directory.
--
--[[
--
-- Tests for tokenizer.
--
--]]
require 'fairseq'
local tokenizer = require 'fairseq.text.tokenizer'
local tnt = require 'torchnet'
local path = require 'pl.path'
local pltablex = require 'pl.tablex'
local plutils = require 'pl.utils'
local tester
local test = torch.TestSuite()
local testdir = path.abspath(path.dirname(debug.getinfo(1).source:sub(2)))
local testdata = testdir .. '/tst2012.en'
local testdataUrl = 'https://nlp.stanford.edu/projects/nmt/data/iwslt15.en-vi/tst2012.en'
if not path.exists(testdata) then
require 'os'
os.execute('curl ' .. testdataUrl .. ' > ' .. testdata)
if path.getsize(testdata) ~= 140250 then
error('Failed to download test data from ' .. testdataUrl)
end
local head = io.open(testdata):read(15)
if head ~= 'How can I speak' then
error('Failed to download test data from ' .. testdataUrl)
end
end
function test.Tokenizer_BuildDictionary()
local dict = tokenizer.buildDictionary{
filename = testdata,
threshold = 0,
}
tester:assertGeneralEq(3730, dict:size())
tester:assertGeneralEq(dict.unk_index, dict:getIndex('NotInCorpus'))
local dict2 = tokenizer.buildDictionary{
filename = testdata,
threshold = 100,
}
tester:assertGeneralEq(38, dict2:size())
-- Use a custom tokenizer that removes all 'the's
local dict3 = tokenizer.buildDictionary{
filename = testdata,
tokenize = function(line)
local words = tokenizer.tokenize(line)
return pltablex.filter(words, function (w) return w ~= 'the' end)
end,
threshold = 0,
}
tester:assertGeneralEq(dict3.unk_index, dict3:getIndex('the'))
tester:assertGeneralEq(3729, dict3:size())
end
function test.Tokenizer_BuildDictionaryMultipleFiles()
local dict2 = tokenizer.buildDictionary{
filenames = {testdata, testdata, testdata, testdata},
threshold = 100 * 4,
}
tester:assertGeneralEq(38, dict2:size())
end
function test.Tokenizer_Tensorize()
local dict = tokenizer.buildDictionary{
filename = testdata,
threshold = 0,
}
local data, stats = tokenizer.tensorize{
filename = testdata,
dict = dict,
}
local smap, words = data.smap, data.words
tester:assertGeneralEq({1553, 2}, smap:size():totable())
tester:assertGeneralEq({29536}, words:size():totable())
tester:assertGeneralEq(1553, stats.nseq)
tester:assertGeneralEq(29536, stats.ntok)
tester:assertGeneralEq(0, stats.nunk)
tester:assertGeneralEq('He is my grandfather . </s>', dict:getString(
words:narrow(1, smap[11][1], smap[11][2])
))
end
function test.Tokenizer_TensorizeString()
local dict = tokenizer.makeDictionary{
threshold = 0,
}
local tokens = plutils.split('aa bb cc', ' ')
for _, token in ipairs(tokens) do
dict:addSymbol(token)
end
local text = 'aa cc'
local tensor = tokenizer.tensorizeString{
text = text,
dict = dict,
}
for i, token in ipairs(plutils.split(text, ' ')) do
tester:assertGeneralEq(dict:getIndex(token), tensor[i])
end
end
function test.Tokenizer_TensorizeAlignment()
local alignmenttext = '0-1 1-2 2-1'
local tensor = tokenizer.tensorizeAlignment{
text = alignmenttext,
}
tester:assertGeneralEq(tensor:size(1), 3)
tester:assertGeneralEq(tensor:size(2), 2)
tester:assertGeneralEq(tensor[1][1], 0 + 1)
tester:assertGeneralEq(tensor[1][2], 1 + 1)
tester:assertGeneralEq(tensor[2][1], 1 + 1)
tester:assertGeneralEq(tensor[2][2], 2 + 1)
tester:assertGeneralEq(tensor[3][1], 2 + 1)
tester:assertGeneralEq(tensor[3][2], 1 + 1)
end
function test.Tokenizer_TensorizeThresh()
local dict = tokenizer.buildDictionary{
filename = testdata,
threshold = 50,
}
local data, stats = tokenizer.tensorize{
filename = testdata,
dict = dict,
}
local smap, words = data.smap, data.words
tester:assertGeneralEq({1553, 2}, smap:size():totable())
tester:assertGeneralEq({29536}, words:size():totable())
tester:assertGeneralEq(1553, stats.nseq)
tester:assertGeneralEq(29536, stats.ntok)
tester:assertGeneralEq(11485, stats.nunk)
tester:assertGeneralEq('<unk> is my <unk> . </s>', dict:getString(
words:narrow(1, smap[11][1], smap[11][2])
))
end
function test.Tokenizer_Binarize()
local dict = tokenizer.buildDictionary{
filename = testdata,
threshold = 0,
}
-- XXX A temporary directory function would be great
local dest = os.tmpname()
local res = tokenizer.binarize{
filename = testdata,
dict = dict,
indexfilename = dest .. '.idx',
datafilename = dest .. '.bin',
}
tester:assertGeneralEq(1553, res.nseq)
tester:assertGeneralEq(29536, res.ntok)
tester:assertGeneralEq(0, res.nunk)
local field = path.basename(dest)
local ds = tnt.IndexedDataset{
fields = {field},
path = paths.dirname(dest),
}
tester:assertGeneralEq(1553, ds:size())
tester:assertGeneralEq('He is my grandfather . </s>', dict:getString(
ds:get(11)[field]
))
end
function test.Tokenizer_BinarizeThresh()
local dict = tokenizer.buildDictionary{
filename = testdata,
threshold = 50,
}
-- XXX A temporary directory function would be great
local dest = os.tmpname()
local res = tokenizer.binarize{
filename = testdata,
dict = dict,
indexfilename = dest .. '.idx',
datafilename = dest .. '.bin',
}
tester:assertGeneralEq(1553, res.nseq)
tester:assertGeneralEq(29536, res.ntok)
tester:assertGeneralEq(11485, res.nunk)
local field = path.basename(dest)
local ds = tnt.IndexedDataset{
fields = {field},
path = paths.dirname(dest),
}
tester:assertGeneralEq(1553, ds:size())
tester:assertGeneralEq('<unk> is my <unk> . </s>', dict:getString(
ds:get(11)[field]
))
end
function test.Tokenizer_BinarizeAlignment()
local function makeFile(line)
local filename = os.tmpname()
local file = io.open(filename, 'w')
file:write(line .. '\n')
file:close(file)
return filename
end
local srcfile = makeFile('a b c a')
local srcdict = tokenizer.buildDictionary{
filename = srcfile,
threshold = 0,
}
local tgtfile = makeFile('x y z w x')
local tgtdict = tokenizer.buildDictionary{
filename = tgtfile,
threshold = 0,
}
local alignfile = makeFile('0-0 0-1 1-1 2-2 2-4 3-1 3-3')
local alignfreqmap = tokenizer.buildAlignFreqMap{
alignfile = alignfile,
srcfile = srcfile,
tgtfile = tgtfile,
srcdict = srcdict,
tgtdict = tgtdict,
}
tester:assertGeneralEq(alignfreqmap[srcdict:getEosIndex()], nil)
tester:assertGeneralEq(alignfreqmap[srcdict:getPadIndex()], nil)
tester:assertGeneralEq(alignfreqmap[srcdict:getUnkIndex()], nil)
tester:assertGeneralEq(
alignfreqmap[srcdict:getIndex('a')][tgtdict:getIndex('x')], 1)
tester:assertGeneralEq(
alignfreqmap[srcdict:getIndex('a')][tgtdict:getIndex('y')], 2)
tester:assertGeneralEq(
alignfreqmap[srcdict:getIndex('a')][tgtdict:getIndex('w')], 1)
tester:assertGeneralEq(
alignfreqmap[srcdict:getIndex('b')][tgtdict:getIndex('y')], 1)
tester:assertGeneralEq(
alignfreqmap[srcdict:getIndex('c')][tgtdict:getIndex('x')], 1)
tester:assertGeneralEq(
alignfreqmap[srcdict:getIndex('c')][tgtdict:getIndex('z')], 1)
local dest = os.tmpname()
local stats = tokenizer.binarizeAlignFreqMap{
freqmap = alignfreqmap,
srcdict = srcdict,
indexfilename = dest .. '.idx',
datafilename = dest .. '.bin',
ncandidates = 2,
}
tester:assertGeneralEq(stats.npairs, 5)
local reader = tnt.IndexedDatasetReader{
indexfilename = dest .. '.idx',
datafilename = dest .. '.bin',
}
tester:assertGeneralEq(reader:get(srcdict:getEosIndex()):dim(), 0)
tester:assertGeneralEq(reader:get(srcdict:getPadIndex()):dim(), 0)
tester:assertGeneralEq(reader:get(srcdict:getUnkIndex()):dim(), 0)
tester:assert(torch.all(torch.eq(
reader:get(srcdict:getIndex('a')),
torch.IntTensor{
{tgtdict:getIndex('y'), 2},
{tgtdict:getIndex('x'), 1}})))
tester:assert(torch.all(torch.eq(
reader:get(srcdict:getIndex('b')),
torch.IntTensor{{tgtdict:getIndex('y'), 1}})))
tester:assert(torch.all(torch.eq(
reader:get(srcdict:getIndex('c')),
torch.IntTensor{
{tgtdict:getIndex('z'), 1},
{tgtdict:getIndex('x'), 1}})))
end
return function(_tester_)
tester = _tester_
return test
end
| 31.060811 | 89 | 0.64466 |
b2f7fb8b602bfdd673abb75e7f89ca8dc32301c9 | 1,400 | py | Python | coretabs ATM py/withdraw.py | attia7/Test | c74f09816ba2e0798b0533e31ea8b72249dec598 | [
"MIT"
] | null | null | null | coretabs ATM py/withdraw.py | attia7/Test | c74f09816ba2e0798b0533e31ea8b72249dec598 | [
"MIT"
] | 11 | 2020-03-24T17:40:26.000Z | 2022-01-13T01:42:38.000Z | coretabs ATM py/withdraw.py | attia7/AttiaGit | c74f09816ba2e0798b0533e31ea8b72249dec598 | [
"MIT"
] | null | null | null | balance = 700
papers=[100, 50, 10, 5,4,3,2,1]
def withdraw(balance, request):
if balance < request :
print('Sorry, you are try withdraw: {0}, but Your balance just : {1}'.format(request, balance))
else:
print ('your balance >>', balance)
orgnal_request = request
while request > 0:
for i in papers:
while request >= i:
print('give', i)
request-=i
balance -= orgnal_request
return balance
def withdraw1(balance, request):
give = 0
if balance < request :
print('Sorry, you are try withdraw: {0}, but Your balance just : {1}'.format(request, balance))
else:
print ('your balance >>', balance)
balance -= request
while request > 0:
if request >= 100:
give = 100
elif request >= 50:
give = 50
elif request >= 10:
give = 10
elif request >= 5:
give = 5
else :
give = request
print('give',give)
request -= give
return balance
balance = withdraw(balance, 777)
balance = withdraw(balance, 276)
balance = withdraw1(balance, 276)
balance = withdraw(balance, 34)
balance = withdraw1(balance, 5)
balance = withdraw1(balance, 500) | 30.434783 | 103 | 0.512857 |
39bc43b2b6323c5063e3936b2183070cb8403634 | 109,929 | js | JavaScript | node_modules/@aws-cdk/core/test/test.stack.js | messagepluscoza/action-deploy-aws-static-site | 655a2de1d80273c754388874086f3b212cb7483d | [
"MIT"
] | null | null | null | node_modules/@aws-cdk/core/test/test.stack.js | messagepluscoza/action-deploy-aws-static-site | 655a2de1d80273c754388874086f3b212cb7483d | [
"MIT"
] | 19 | 2021-06-01T05:56:31.000Z | 2022-03-01T04:13:17.000Z | node_modules/@aws-cdk/core/test/test.stack.js | abaldawa/action-deploy-aws-static-site | eba96876ccf2d513b74d7d641ebec1927f29caa3 | [
"MIT"
] | null | null | null | "use strict";
const cxapi = require("@aws-cdk/cx-api");
const lib_1 = require("../lib");
const intrinsic_1 = require("../lib/private/intrinsic");
const refs_1 = require("../lib/private/refs");
const util_1 = require("../lib/util");
const util_2 = require("./util");
class StackWithPostProcessor extends lib_1.Stack {
// ...
_toCloudFormation() {
const template = super._toCloudFormation();
// manipulate template (e.g. rename "Key" to "key")
template.Resources.myResource.Properties.Environment.key =
template.Resources.myResource.Properties.Environment.Key;
delete template.Resources.myResource.Properties.Environment.Key;
return template;
}
}
module.exports = {
'a stack can be serialized into a CloudFormation template, initially it\'s empty'(test) {
const stack = new lib_1.Stack();
test.deepEqual(util_2.toCloudFormation(stack), {});
test.done();
},
'stack objects have some template-level propeties, such as Description, Version, Transform'(test) {
const stack = new lib_1.Stack();
stack.templateOptions.templateFormatVersion = 'MyTemplateVersion';
stack.templateOptions.description = 'This is my description';
stack.templateOptions.transforms = ['SAMy'];
test.deepEqual(util_2.toCloudFormation(stack), {
Description: 'This is my description',
AWSTemplateFormatVersion: 'MyTemplateVersion',
Transform: 'SAMy',
});
test.done();
},
'Stack.isStack indicates that a construct is a stack'(test) {
const stack = new lib_1.Stack();
const c = new lib_1.Construct(stack, 'Construct');
test.ok(lib_1.Stack.isStack(stack));
test.ok(!lib_1.Stack.isStack(c));
test.done();
},
'stack.id is not included in the logical identities of resources within it'(test) {
const stack = new lib_1.Stack(undefined, 'MyStack');
new lib_1.CfnResource(stack, 'MyResource', { type: 'MyResourceType' });
test.deepEqual(util_2.toCloudFormation(stack), { Resources: { MyResource: { Type: 'MyResourceType' } } });
test.done();
},
'stack.templateOptions can be used to set template-level options'(test) {
const stack = new lib_1.Stack();
stack.templateOptions.description = 'StackDescription';
stack.templateOptions.templateFormatVersion = 'TemplateVersion';
stack.templateOptions.transform = 'DeprecatedField';
stack.templateOptions.transforms = ['Transform'];
stack.templateOptions.metadata = {
MetadataKey: 'MetadataValue',
};
test.deepEqual(util_2.toCloudFormation(stack), {
Description: 'StackDescription',
Transform: ['Transform', 'DeprecatedField'],
AWSTemplateFormatVersion: 'TemplateVersion',
Metadata: { MetadataKey: 'MetadataValue' },
});
test.done();
},
'stack.templateOptions.transforms removes duplicate values'(test) {
const stack = new lib_1.Stack();
stack.templateOptions.transforms = ['A', 'B', 'C', 'A'];
test.deepEqual(util_2.toCloudFormation(stack), {
Transform: ['A', 'B', 'C'],
});
test.done();
},
'stack.addTransform() adds a transform'(test) {
const stack = new lib_1.Stack();
stack.addTransform('A');
stack.addTransform('B');
stack.addTransform('C');
test.deepEqual(util_2.toCloudFormation(stack), {
Transform: ['A', 'B', 'C'],
});
test.done();
},
// This approach will only apply to TypeScript code, but at least it's a temporary
// workaround for people running into issues caused by SDK-3003.
// We should come up with a proper solution that involved jsii callbacks (when they exist)
// so this can be implemented by jsii languages as well.
'Overriding `Stack._toCloudFormation` allows arbitrary post-processing of the generated template during synthesis'(test) {
const stack = new StackWithPostProcessor();
new lib_1.CfnResource(stack, 'myResource', {
type: 'AWS::MyResource',
properties: {
MyProp1: 'hello',
MyProp2: 'howdy',
Environment: {
Key: 'value',
},
},
});
test.deepEqual(stack._toCloudFormation(), { Resources: { myResource: { Type: 'AWS::MyResource',
Properties: { MyProp1: 'hello',
MyProp2: 'howdy',
Environment: { key: 'value' } } } } });
test.done();
},
'Stack.getByPath can be used to find any CloudFormation element (Parameter, Output, etc)'(test) {
const stack = new lib_1.Stack();
const p = new lib_1.CfnParameter(stack, 'MyParam', { type: 'String' });
const o = new lib_1.CfnOutput(stack, 'MyOutput', { value: 'boom' });
const c = new lib_1.CfnCondition(stack, 'MyCondition');
test.equal(stack.node.findChild(p.node.id), p);
test.equal(stack.node.findChild(o.node.id), o);
test.equal(stack.node.findChild(c.node.id), c);
test.done();
},
'Stack names can have hyphens in them'(test) {
const root = new lib_1.App();
new lib_1.Stack(root, 'Hello-World');
// Did not throw
test.done();
},
'Stacks can have a description given to them'(test) {
const stack = new lib_1.Stack(new lib_1.App(), 'MyStack', { description: 'My stack, hands off!' });
const output = util_2.toCloudFormation(stack);
test.equal(output.Description, 'My stack, hands off!');
test.done();
},
'Stack descriptions have a limited length'(test) {
const desc = `Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Consequat interdum varius sit amet mattis vulputate
enim nulla aliquet. At imperdiet dui accumsan sit amet nulla facilisi morbi. Eget lorem dolor sed
viverra ipsum. Diam volutpat commodo sed egestas egestas. Sit amet porttitor eget dolor morbi non.
Lorem dolor sed viverra ipsum. Id porta nibh venenatis cras sed felis. Augue interdum velit euismod
in pellentesque. Suscipit adipiscing bibendum est ultricies integer quis. Condimentum id venenatis a
condimentum vitae sapien pellentesque habitant morbi. Congue mauris rhoncus aenean vel elit scelerisque
mauris pellentesque pulvinar.
Faucibus purus in massa tempor nec. Risus viverra adipiscing at in. Integer feugiat scelerisque varius
morbi. Malesuada nunc vel risus commodo viverra maecenas accumsan lacus. Vulputate sapien nec sagittis
aliquam malesuada bibendum arcu vitae. Augue neque gravida in fermentum et sollicitudin ac orci phasellus.
Ultrices tincidunt arcu non sodales neque sodales.`;
test.throws(() => new lib_1.Stack(new lib_1.App(), 'MyStack', { description: desc }));
test.done();
},
'Include should support non-hash top-level template elements like "Description"'(test) {
const stack = new lib_1.Stack();
const template = {
Description: 'hello, world',
};
new lib_1.CfnInclude(stack, 'Include', { template });
const output = util_2.toCloudFormation(stack);
test.equal(typeof output.Description, 'string');
test.done();
},
'Pseudo values attached to one stack can be referenced in another stack'(test) {
// GIVEN
const app = new lib_1.App();
const stack1 = new lib_1.Stack(app, 'Stack1');
const account1 = new lib_1.ScopedAws(stack1).accountId;
const stack2 = new lib_1.Stack(app, 'Stack2');
// WHEN - used in another stack
new lib_1.CfnParameter(stack2, 'SomeParameter', { type: 'String', default: account1 });
// THEN
const assembly = app.synth();
const template1 = assembly.getStackByName(stack1.stackName).template;
const template2 = assembly.getStackByName(stack2.stackName).template;
test.deepEqual(template1, {
Outputs: {
ExportsOutputRefAWSAccountIdAD568057: {
Value: { Ref: 'AWS::AccountId' },
Export: { Name: 'Stack1:ExportsOutputRefAWSAccountIdAD568057' },
},
},
});
test.deepEqual(template2, {
Parameters: {
SomeParameter: {
Type: 'String',
Default: { 'Fn::ImportValue': 'Stack1:ExportsOutputRefAWSAccountIdAD568057' },
},
},
});
test.done();
},
'Cross-stack references are detected in resource properties'(test) {
// GIVEN
const app = new lib_1.App();
const stack1 = new lib_1.Stack(app, 'Stack1');
const resource1 = new lib_1.CfnResource(stack1, 'Resource', { type: 'BLA' });
const stack2 = new lib_1.Stack(app, 'Stack2');
// WHEN - used in another resource
new lib_1.CfnResource(stack2, 'SomeResource', { type: 'AWS::Some::Resource', properties: {
someProperty: new intrinsic_1.Intrinsic(resource1.ref),
} });
// THEN
const assembly = app.synth();
const template2 = assembly.getStackByName(stack2.stackName).template;
test.deepEqual(template2, {
Resources: {
SomeResource: {
Type: 'AWS::Some::Resource',
Properties: {
someProperty: { 'Fn::ImportValue': 'Stack1:ExportsOutputRefResource1D5D905A' },
},
},
},
});
test.done();
},
'cross-stack references in lazy tokens work'(test) {
// GIVEN
const app = new lib_1.App();
const stack1 = new lib_1.Stack(app, 'Stack1');
const account1 = new lib_1.ScopedAws(stack1).accountId;
const stack2 = new lib_1.Stack(app, 'Stack2');
// WHEN - used in another stack
new lib_1.CfnParameter(stack2, 'SomeParameter', { type: 'String', default: lib_1.Lazy.stringValue({ produce: () => account1 }) });
const assembly = app.synth();
const template1 = assembly.getStackByName(stack1.stackName).template;
const template2 = assembly.getStackByName(stack2.stackName).template;
// THEN
test.deepEqual(template1, {
Outputs: {
ExportsOutputRefAWSAccountIdAD568057: {
Value: { Ref: 'AWS::AccountId' },
Export: { Name: 'Stack1:ExportsOutputRefAWSAccountIdAD568057' },
},
},
});
test.deepEqual(template2, {
Parameters: {
SomeParameter: {
Type: 'String',
Default: { 'Fn::ImportValue': 'Stack1:ExportsOutputRefAWSAccountIdAD568057' },
},
},
});
test.done();
},
'Cross-stack use of Region and account returns nonscoped intrinsic because the two stacks must be in the same region anyway'(test) {
// GIVEN
const app = new lib_1.App();
const stack1 = new lib_1.Stack(app, 'Stack1');
const stack2 = new lib_1.Stack(app, 'Stack2');
// WHEN - used in another stack
new lib_1.CfnOutput(stack2, 'DemOutput', { value: stack1.region });
new lib_1.CfnOutput(stack2, 'DemAccount', { value: stack1.account });
// THEN
const assembly = app.synth();
const template2 = assembly.getStackByName(stack2.stackName).template;
test.deepEqual(template2, {
Outputs: {
DemOutput: {
Value: { Ref: 'AWS::Region' },
},
DemAccount: {
Value: { Ref: 'AWS::AccountId' },
},
},
});
test.done();
},
'cross-stack references in strings work'(test) {
// GIVEN
const app = new lib_1.App();
const stack1 = new lib_1.Stack(app, 'Stack1');
const account1 = new lib_1.ScopedAws(stack1).accountId;
const stack2 = new lib_1.Stack(app, 'Stack2');
// WHEN - used in another stack
new lib_1.CfnParameter(stack2, 'SomeParameter', { type: 'String', default: `TheAccountIs${account1}` });
const assembly = app.synth();
const template2 = assembly.getStackByName(stack2.stackName).template;
// THEN
test.deepEqual(template2, {
Parameters: {
SomeParameter: {
Type: 'String',
Default: { 'Fn::Join': ['', ['TheAccountIs', { 'Fn::ImportValue': 'Stack1:ExportsOutputRefAWSAccountIdAD568057' }]] },
},
},
});
test.done();
},
'cross stack references and dependencies work within child stacks (non-nested)'(test) {
// GIVEN
const app = new lib_1.App();
const parent = new lib_1.Stack(app, 'Parent');
const child1 = new lib_1.Stack(parent, 'Child1');
const child2 = new lib_1.Stack(parent, 'Child2');
const resourceA = new lib_1.CfnResource(child1, 'ResourceA', { type: 'RA' });
const resourceB = new lib_1.CfnResource(child1, 'ResourceB', { type: 'RB' });
// WHEN
const resource2 = new lib_1.CfnResource(child2, 'Resource1', {
type: 'R2',
properties: {
RefToResource1: resourceA.ref,
},
});
resource2.addDependsOn(resourceB);
// THEN
const assembly = app.synth();
const parentTemplate = assembly.getStackArtifact(parent.artifactId).template;
const child1Template = assembly.getStackArtifact(child1.artifactId).template;
const child2Template = assembly.getStackArtifact(child2.artifactId).template;
test.deepEqual(parentTemplate, {});
test.deepEqual(child1Template, {
Resources: {
ResourceA: { Type: 'RA' },
ResourceB: { Type: 'RB' },
},
Outputs: {
ExportsOutputRefResourceA461B4EF9: {
Value: { Ref: 'ResourceA' },
Export: { Name: 'ParentChild18FAEF419:Child1ExportsOutputRefResourceA7BF20B37' },
},
},
});
test.deepEqual(child2Template, {
Resources: {
Resource1: {
Type: 'R2',
Properties: {
RefToResource1: { 'Fn::ImportValue': 'ParentChild18FAEF419:Child1ExportsOutputRefResourceA7BF20B37' },
},
},
},
});
test.deepEqual(assembly.getStackArtifact(child1.artifactId).dependencies.map(x => x.id), []);
test.deepEqual(assembly.getStackArtifact(child2.artifactId).dependencies.map(x => x.id), ['ParentChild18FAEF419']);
test.done();
},
'CfnSynthesisError is ignored when preparing cross references'(test) {
// GIVEN
const app = new lib_1.App();
const stack = new lib_1.Stack(app, 'my-stack');
// WHEN
class CfnTest extends lib_1.CfnResource {
_toCloudFormation() {
return new util_1.PostResolveToken({
xoo: 1234,
}, props => {
lib_1.validateString(props).assertSuccess();
});
}
}
new CfnTest(stack, 'MyThing', { type: 'AWS::Type' });
// THEN
refs_1.resolveReferences(app);
test.done();
},
'Stacks can be children of other stacks (substack) and they will be synthesized separately'(test) {
// GIVEN
const app = new lib_1.App();
// WHEN
const parentStack = new lib_1.Stack(app, 'parent');
const childStack = new lib_1.Stack(parentStack, 'child');
new lib_1.CfnResource(parentStack, 'MyParentResource', { type: 'Resource::Parent' });
new lib_1.CfnResource(childStack, 'MyChildResource', { type: 'Resource::Child' });
// THEN
const assembly = app.synth();
test.deepEqual(assembly.getStackByName(parentStack.stackName).template, { Resources: { MyParentResource: { Type: 'Resource::Parent' } } });
test.deepEqual(assembly.getStackByName(childStack.stackName).template, { Resources: { MyChildResource: { Type: 'Resource::Child' } } });
test.done();
},
'cross-stack reference (substack references parent stack)'(test) {
// GIVEN
const app = new lib_1.App();
const parentStack = new lib_1.Stack(app, 'parent');
const childStack = new lib_1.Stack(parentStack, 'child');
// WHEN (a resource from the child stack references a resource from the parent stack)
const parentResource = new lib_1.CfnResource(parentStack, 'MyParentResource', { type: 'Resource::Parent' });
new lib_1.CfnResource(childStack, 'MyChildResource', {
type: 'Resource::Child',
properties: {
ChildProp: parentResource.getAtt('AttOfParentResource'),
},
});
// THEN
const assembly = app.synth();
test.deepEqual(assembly.getStackByName(parentStack.stackName).template, {
Resources: { MyParentResource: { Type: 'Resource::Parent' } },
Outputs: { ExportsOutputFnGetAttMyParentResourceAttOfParentResourceC2D0BB9E: {
Value: { 'Fn::GetAtt': ['MyParentResource', 'AttOfParentResource'] },
Export: { Name: 'parent:ExportsOutputFnGetAttMyParentResourceAttOfParentResourceC2D0BB9E' }
},
},
});
test.deepEqual(assembly.getStackByName(childStack.stackName).template, {
Resources: {
MyChildResource: {
Type: 'Resource::Child',
Properties: {
ChildProp: {
'Fn::ImportValue': 'parent:ExportsOutputFnGetAttMyParentResourceAttOfParentResourceC2D0BB9E',
},
},
},
},
});
test.done();
},
'cross-stack reference (parent stack references substack)'(test) {
// GIVEN
const app = new lib_1.App();
const parentStack = new lib_1.Stack(app, 'parent');
const childStack = new lib_1.Stack(parentStack, 'child');
// WHEN (a resource from the child stack references a resource from the parent stack)
const childResource = new lib_1.CfnResource(childStack, 'MyChildResource', { type: 'Resource::Child' });
new lib_1.CfnResource(parentStack, 'MyParentResource', {
type: 'Resource::Parent',
properties: {
ParentProp: childResource.getAtt('AttributeOfChildResource'),
},
});
// THEN
const assembly = app.synth();
test.deepEqual(assembly.getStackByName(parentStack.stackName).template, {
Resources: {
MyParentResource: {
Type: 'Resource::Parent',
Properties: {
ParentProp: { 'Fn::ImportValue': 'parentchild13F9359B:childExportsOutputFnGetAttMyChildResourceAttributeOfChildResource420052FC' },
},
},
},
});
test.deepEqual(assembly.getStackByName(childStack.stackName).template, {
Resources: {
MyChildResource: { Type: 'Resource::Child' }
},
Outputs: {
ExportsOutputFnGetAttMyChildResourceAttributeOfChildResource52813264: {
Value: { 'Fn::GetAtt': ['MyChildResource', 'AttributeOfChildResource'] },
Export: { Name: 'parentchild13F9359B:childExportsOutputFnGetAttMyChildResourceAttributeOfChildResource420052FC' },
},
},
});
test.done();
},
'cannot create cyclic reference between stacks'(test) {
// GIVEN
const app = new lib_1.App();
const stack1 = new lib_1.Stack(app, 'Stack1');
const account1 = new lib_1.ScopedAws(stack1).accountId;
const stack2 = new lib_1.Stack(app, 'Stack2');
const account2 = new lib_1.ScopedAws(stack2).accountId;
// WHEN
new lib_1.CfnParameter(stack2, 'SomeParameter', { type: 'String', default: account1 });
new lib_1.CfnParameter(stack1, 'SomeParameter', { type: 'String', default: account2 });
test.throws(() => {
app.synth();
// eslint-disable-next-line max-len
}, "'Stack2' depends on 'Stack1' (Stack2/SomeParameter -> Stack1.AWS::AccountId). Adding this dependency (Stack1/SomeParameter -> Stack2.AWS::AccountId) would create a cyclic reference.");
test.done();
},
'stacks know about their dependencies'(test) {
// GIVEN
const app = new lib_1.App();
const stack1 = new lib_1.Stack(app, 'Stack1');
const account1 = new lib_1.ScopedAws(stack1).accountId;
const stack2 = new lib_1.Stack(app, 'Stack2');
// WHEN
new lib_1.CfnParameter(stack2, 'SomeParameter', { type: 'String', default: account1 });
app.synth();
// THEN
test.deepEqual(stack2.dependencies.map(s => s.node.id), ['Stack1']);
test.done();
},
'cannot create references to stacks in other regions/accounts'(test) {
// GIVEN
const app = new lib_1.App();
const stack1 = new lib_1.Stack(app, 'Stack1', { env: { account: '123456789012', region: 'es-norst-1' } });
const account1 = new lib_1.ScopedAws(stack1).accountId;
const stack2 = new lib_1.Stack(app, 'Stack2', { env: { account: '123456789012', region: 'es-norst-2' } });
// WHEN
new lib_1.CfnParameter(stack2, 'SomeParameter', { type: 'String', default: account1 });
test.throws(() => {
app.synth();
}, /Stack "Stack2" cannot consume a cross reference from stack "Stack1"/);
test.done();
},
'urlSuffix does not imply a stack dependency'(test) {
// GIVEN
const app = new lib_1.App();
const first = new lib_1.Stack(app, 'First');
const second = new lib_1.Stack(app, 'Second');
// WHEN
new lib_1.CfnOutput(second, 'Output', {
value: first.urlSuffix,
});
// THEN
app.synth();
test.equal(second.dependencies.length, 0);
test.done();
},
'stack with region supplied via props returns literal value'(test) {
// GIVEN
const app = new lib_1.App();
const stack = new lib_1.Stack(app, 'Stack1', { env: { account: '123456789012', region: 'es-norst-1' } });
// THEN
test.equal(stack.resolve(stack.region), 'es-norst-1');
test.done();
},
'overrideLogicalId(id) can be used to override the logical ID of a resource'(test) {
// GIVEN
const stack = new lib_1.Stack();
const bonjour = new lib_1.CfnResource(stack, 'BonjourResource', { type: 'Resource::Type' });
// { Ref } and { GetAtt }
new lib_1.CfnResource(stack, 'RefToBonjour', { type: 'Other::Resource', properties: {
RefToBonjour: bonjour.ref,
GetAttBonjour: bonjour.getAtt('TheAtt').toString(),
} });
bonjour.overrideLogicalId('BOOM');
// THEN
test.deepEqual(util_2.toCloudFormation(stack), { Resources: { BOOM: { Type: 'Resource::Type' },
RefToBonjour: { Type: 'Other::Resource',
Properties: { RefToBonjour: { Ref: 'BOOM' },
GetAttBonjour: { 'Fn::GetAtt': ['BOOM', 'TheAtt'] } } } } });
test.done();
},
'Stack name can be overridden via properties'(test) {
// WHEN
const stack = new lib_1.Stack(undefined, 'Stack', { stackName: 'otherName' });
// THEN
test.deepEqual(stack.stackName, 'otherName');
test.done();
},
'Stack name is inherited from App name if available'(test) {
// WHEN
const root = new lib_1.App();
const app = new lib_1.Construct(root, 'Prod');
const stack = new lib_1.Stack(app, 'Stack');
// THEN
test.deepEqual(stack.stackName, 'ProdStackD5279B22');
test.done();
},
'stack construct id does not go through stack name validation if there is an explicit stack name'(test) {
// GIVEN
const app = new lib_1.App();
// WHEN
const stack = new lib_1.Stack(app, 'invalid as : stack name, but thats fine', {
stackName: 'valid-stack-name',
});
// THEN
const session = app.synth();
test.deepEqual(stack.stackName, 'valid-stack-name');
test.ok(session.tryGetArtifact(stack.artifactId));
test.done();
},
'stack validation is performed on explicit stack name'(test) {
// GIVEN
const app = new lib_1.App();
// THEN
test.throws(() => new lib_1.Stack(app, 'boom', { stackName: 'invalid:stack:name' }), /Stack name must match the regular expression/);
test.done();
},
'Stack.of(stack) returns the correct stack'(test) {
const stack = new lib_1.Stack();
test.same(lib_1.Stack.of(stack), stack);
const parent = new lib_1.Construct(stack, 'Parent');
const construct = new lib_1.Construct(parent, 'Construct');
test.same(lib_1.Stack.of(construct), stack);
test.done();
},
'Stack.of() throws when there is no parent Stack'(test) {
const root = new lib_1.Construct(undefined, 'Root');
const construct = new lib_1.Construct(root, 'Construct');
test.throws(() => lib_1.Stack.of(construct), /No stack could be identified for the construct at path/);
test.done();
},
'Stack.of() works for substacks'(test) {
// GIVEN
const app = new lib_1.App();
// WHEN
const parentStack = new lib_1.Stack(app, 'ParentStack');
const parentResource = new lib_1.CfnResource(parentStack, 'ParentResource', { type: 'parent::resource' });
// we will define a substack under the /resource/... just for giggles.
const childStack = new lib_1.Stack(parentResource, 'ChildStack');
const childResource = new lib_1.CfnResource(childStack, 'ChildResource', { type: 'child::resource' });
// THEN
test.same(lib_1.Stack.of(parentStack), parentStack);
test.same(lib_1.Stack.of(parentResource), parentStack);
test.same(lib_1.Stack.of(childStack), childStack);
test.same(lib_1.Stack.of(childResource), childStack);
test.done();
},
'stack.availabilityZones falls back to Fn::GetAZ[0],[2] if region is not specified'(test) {
// GIVEN
const app = new lib_1.App();
const stack = new lib_1.Stack(app, 'MyStack');
// WHEN
const azs = stack.availabilityZones;
// THEN
test.deepEqual(stack.resolve(azs), [
{ 'Fn::Select': [0, { 'Fn::GetAZs': '' }] },
{ 'Fn::Select': [1, { 'Fn::GetAZs': '' }] },
]);
test.done();
},
'stack.templateFile is the name of the template file emitted to the cloud assembly (default is to use the stack name)'(test) {
// GIVEN
const app = new lib_1.App();
// WHEN
const stack1 = new lib_1.Stack(app, 'MyStack1');
const stack2 = new lib_1.Stack(app, 'MyStack2', { stackName: 'MyRealStack2' });
// THEN
test.deepEqual(stack1.templateFile, 'MyStack1.template.json');
test.deepEqual(stack2.templateFile, 'MyRealStack2.template.json');
test.done();
},
'when feature flag is enabled we will use the artifact id as the template name'(test) {
// GIVEN
const app = new lib_1.App({
context: {
[cxapi.ENABLE_STACK_NAME_DUPLICATES_CONTEXT]: 'true',
},
});
// WHEN
const stack1 = new lib_1.Stack(app, 'MyStack1');
const stack2 = new lib_1.Stack(app, 'MyStack2', { stackName: 'MyRealStack2' });
// THEN
test.deepEqual(stack1.templateFile, 'MyStack1.template.json');
test.deepEqual(stack2.templateFile, 'MyStack2.template.json');
test.done();
},
'@aws-cdk/core:enableStackNameDuplicates': {
'disabled (default)': {
'artifactId and templateFile use the stack name'(test) {
// GIVEN
const app = new lib_1.App();
// WHEN
const stack1 = new lib_1.Stack(app, 'MyStack1', { stackName: 'thestack' });
const assembly = app.synth();
// THEN
test.deepEqual(stack1.artifactId, 'thestack');
test.deepEqual(stack1.templateFile, 'thestack.template.json');
test.deepEqual(assembly.getStackArtifact(stack1.artifactId).templateFile, 'thestack.template.json');
test.done();
},
},
'enabled': {
'allows using the same stack name for two stacks (i.e. in different regions)'(test) {
// GIVEN
const app = new lib_1.App({ context: { [cxapi.ENABLE_STACK_NAME_DUPLICATES_CONTEXT]: 'true' } });
// WHEN
const stack1 = new lib_1.Stack(app, 'MyStack1', { stackName: 'thestack' });
const stack2 = new lib_1.Stack(app, 'MyStack2', { stackName: 'thestack' });
const assembly = app.synth();
// THEN
test.deepEqual(assembly.getStackArtifact(stack1.artifactId).templateFile, 'MyStack1.template.json');
test.deepEqual(assembly.getStackArtifact(stack2.artifactId).templateFile, 'MyStack2.template.json');
test.deepEqual(stack1.templateFile, 'MyStack1.template.json');
test.deepEqual(stack2.templateFile, 'MyStack2.template.json');
test.done();
},
'artifactId and templateFile use the unique id and not the stack name'(test) {
// GIVEN
const app = new lib_1.App({ context: { [cxapi.ENABLE_STACK_NAME_DUPLICATES_CONTEXT]: 'true' } });
// WHEN
const stack1 = new lib_1.Stack(app, 'MyStack1', { stackName: 'thestack' });
const assembly = app.synth();
// THEN
test.deepEqual(stack1.artifactId, 'MyStack1');
test.deepEqual(stack1.templateFile, 'MyStack1.template.json');
test.deepEqual(assembly.getStackArtifact(stack1.artifactId).templateFile, 'MyStack1.template.json');
test.done();
},
},
},
'metadata is collected at the stack boundary'(test) {
// GIVEN
const app = new lib_1.App({
context: {
[cxapi.DISABLE_METADATA_STACK_TRACE]: 'true',
},
});
const parent = new lib_1.Stack(app, 'parent');
const child = new lib_1.Stack(parent, 'child');
// WHEN
child.node.addMetadata('foo', 'bar');
// THEN
const asm = app.synth();
test.deepEqual(asm.getStackByName(parent.stackName).findMetadataByType('foo'), []);
test.deepEqual(asm.getStackByName(child.stackName).findMetadataByType('foo'), [
{ path: '/parent/child', type: 'foo', data: 'bar' },
]);
test.done();
},
'stack tags are reflected in the stack cloud assembly artifact'(test) {
// GIVEN
const app = new lib_1.App({ stackTraces: false });
const stack1 = new lib_1.Stack(app, 'stack1');
const stack2 = new lib_1.Stack(stack1, 'stack2');
// WHEN
lib_1.Tag.add(app, 'foo', 'bar');
// THEN
const asm = app.synth();
const expected = [
{
type: 'aws:cdk:stack-tags',
data: [{ key: 'foo', value: 'bar' }],
},
];
test.deepEqual(asm.getStackArtifact(stack1.artifactId).manifest.metadata, { '/stack1': expected });
test.deepEqual(asm.getStackArtifact(stack2.artifactId).manifest.metadata, { '/stack1/stack2': expected });
test.done();
},
'Termination Protection is reflected in Cloud Assembly artifact'(test) {
// if the root is an app, invoke "synth" to avoid double synthesis
const app = new lib_1.App();
const stack = new lib_1.Stack(app, 'Stack', { terminationProtection: true });
const assembly = app.synth();
const artifact = assembly.getStackArtifact(stack.artifactId);
test.equals(artifact.terminationProtection, true);
test.done();
},
'users can (still) override "synthesize()" in stack'(test) {
let called = false;
class MyStack extends lib_1.Stack {
synthesize(session) {
called = true;
test.ok(session.outdir);
test.equal(session.assembly.outdir, session.outdir);
}
}
const app = new lib_1.App();
new MyStack(app, 'my-stack');
app.synth();
test.ok(called, 'synthesize() not called for Stack');
test.done();
},
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC5zdGFjay5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbInRlc3Quc3RhY2sudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLHlDQUF5QztBQUV6QyxnQ0FFeUc7QUFDekcsd0RBQXFEO0FBQ3JELDhDQUF3RDtBQUN4RCxzQ0FBK0M7QUFDL0MsaUNBQTBDO0FBbTNCMUMsTUFBTSxzQkFBdUIsU0FBUSxXQUFLO0lBRXhDLE1BQU07SUFFQyxpQkFBaUI7UUFDdEIsTUFBTSxRQUFRLEdBQUcsS0FBSyxDQUFDLGlCQUFpQixFQUFFLENBQUM7UUFFM0MsbURBQW1EO1FBQ25ELFFBQVEsQ0FBQyxTQ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IGZvciBTdGFjaycpO1xuICAgIHRlc3QuZG9uZSgpO1xuICB9LFxufTtcblxuY2xhc3MgU3RhY2tXaXRoUG9zdFByb2Nlc3NvciBleHRlbmRzIFN0YWNrIHtcblxuICAvLyAuLi5cblxuICBwdWJsaWMgX3RvQ2xvdWRGb3JtYXRpb24oKSB7XG4gICAgY29uc3QgdGVtcGxhdGUgPSBzdXBlci5fdG9DbG91ZEZvcm1hdGlvbigpO1xuXG4gICAgLy8gbWFuaXB1bGF0ZSB0ZW1wbGF0ZSAoZS5nLiByZW5hbWUgXCJLZXlcIiB0byBcImtleVwiKVxuICAgIHRlbXBsYXRlLlJlc291cmNlcy5teVJlc291cmNlLlByb3BlcnRpZXMuRW52aXJvbm1lbnQua2V5ID1cbiAgICAgIHRlbXBsYXRlLlJlc291cmNlcy5teVJlc291cmNlLlByb3BlcnRpZXMuRW52aXJvbm1lbnQuS2V5O1xuICAgIGRlbGV0ZSB0ZW1wbGF0ZS5SZXNvdXJjZXMubXlSZXNvdXJjZS5Qcm9wZXJ0aWVzLkVudmlyb25tZW50LktleTtcblxuICAgIHJldHVybiB0ZW1wbGF0ZTtcbiAgfVxufVxuIl19 | 149.971351 | 76,438 | 0.87179 |
11f9949bdcc3d7b78849393fd08d485277459b01 | 842 | htm | HTML | dist/game/data/html/gatekeeper/70023-13.htm | juninhorosa/L2JServer_C6_Interlude | f46627b75d86531fe863297544a5a4578388a6fe | [
"MIT"
] | 10 | 2019-07-27T13:12:11.000Z | 2022-01-15T19:13:26.000Z | dist/game/data/html/gatekeeper/70023-13.htm | juninhorosa/L2JServer_C6_Interlude | f46627b75d86531fe863297544a5a4578388a6fe | [
"MIT"
] | 2 | 2020-12-10T15:08:48.000Z | 2021-12-01T01:01:46.000Z | dist/game/data/html/gatekeeper/70023-13.htm | juninhorosa/L2JServer_C6_Interlude | f46627b75d86531fe863297544a5a4578388a6fe | [
"MIT"
] | 15 | 2020-05-08T20:41:06.000Z | 2022-02-24T01:36:58.000Z | <html>
<body>
<center>
<img src="L2UI_CH3.herotower_deco" width=256 height=32>
<tr>
<td><font color="FF0000">-= Talking Island Township =-</font></td>
</tr>
<tr>
<td> </td>
</tr>
<tr><td><img src="L2UI.SquareWhite" width=260 height=1></tr></td><br><br>
<a action="bypass -h custom_dotele goto 2504">TalkingIslandVillage</a><br>
<a action="bypass -h custom_dotele goto 2878">TalkingIslandHarbor</a><br>
<a action="bypass -h custom_dotele goto 2876">NorthernCoast</a><br>
<a action="bypass -h custom_dotele goto 2877">ObeliskOfVictory</a><br>
<a action="bypass -h custom_dotele goto 2875">ElvenRuins</a><br><br>
<tr><td><img src="L2UI.SquareWhite" width=260 height=1></tr></td><br>
<a action="bypass -h custom_dotele Chat 0">Back</a><br>
</center>
</body>
</html> | 40.095238 | 90 | 0.635392 |
e71ac2d82b6f6fd862d108319d658a499bb7fc8c | 5,740 | js | JavaScript | data/split-book-data/B01IRTEADI.1644007421618.js | npbluth/my-audible-library | 7eb3ab0c9fc5121949b3db30c7119a50ddfdf33d | [
"0BSD"
] | null | null | null | data/split-book-data/B01IRTEADI.1644007421618.js | npbluth/my-audible-library | 7eb3ab0c9fc5121949b3db30c7119a50ddfdf33d | [
"0BSD"
] | null | null | null | data/split-book-data/B01IRTEADI.1644007421618.js | npbluth/my-audible-library | 7eb3ab0c9fc5121949b3db30c7119a50ddfdf33d | [
"0BSD"
] | null | null | null | window.peopleAlsoBoughtJSON = [{"asin":"B00UKG14PE","authors":"Nick Offerman","cover":"61iTj6bARmL","length":"11 hrs and 42 mins","narrators":"Nick Offerman","subHeading":"Relighting the Torch of Freedom with America's Gutsiest Troublemakers","title":"Gumption"},{"asin":"0451485041","authors":"Nick Offerman","cover":"516XsCRA2WL","length":"11 hrs and 43 mins","narrators":"Nick Offerman","subHeading":"The Pastoral Observations of One Ignorant American Who Loves to Walk Outside","title":"Where the Deer and the Antelope Play"},{"asin":"B00FEKWQOO","authors":"Nick Offerman","cover":"61M+KqiBOHL","length":"10 hrs and 50 mins","narrators":"Nick Offerman","subHeading":"One Man's Fundamentals for Delicious Living","title":"Paddle Your Own Canoe"},{"asin":"B07L39ZZ2Q","authors":"Adam Savage","cover":"51YFlbefJIL","length":"7 hrs and 45 mins","narrators":"Adam Savage","subHeading":"Lessons from a Lifetime of Making","title":"Every Tool's a Hammer"},{"asin":"B07DKGM4C9","authors":"Megan Mullally, Nick Offerman","cover":"51ULNgne2gL","length":"6 hrs and 39 mins","narrators":"Nick Offerman, Megan Mullally","subHeading":"An Oral History","title":"The Greatest Love Story Ever Told"},{"asin":"0593399951","authors":"Nick Offerman","cover":"61SxvQooG-L","length":"1 hr and 45 mins","narrators":"Nick Offerman","subHeading":"Audio Perambulation","title":"All Rise"},{"asin":"1684571715","authors":"Eric Gorges, Jon Sternfeld - contributor","cover":"61vKf4DaxRL","length":"7 hrs and 30 mins","narrators":"Eric Gorges","subHeading":"Why Working with Our Hands Gives Us Meaning","title":"A Craftsman’s Legacy"},{"asin":"B099NMR24G","authors":"Sean Graham","cover":"51HL8gWXjXS","length":"4 hrs and 11 mins","narrators":"Helpful Matthew","subHeading":"A Beginner's Guide to the Art of Japanese Joinery and Carpentry","title":"Japanese Woodworking"},{"asin":"B08KWCBRL5","authors":"Nils Johansson","cover":"617wXmVphYL","length":"16 hrs and 34 mins","narrators":"Scott Clem","subHeading":"Woodworking Tips, Tools, Projects & Finishing Techniques","title":"Woodworking for Beginners: 3 Books in 1"},{"asin":"0063065738","authors":"Trent Preszler","cover":"51E4l9cp7ML","length":"9 hrs and 17 mins","narrators":"Matt Bomer","subHeading":"A Memoir","title":"Little and Often"},{"asin":"1984843613","authors":"Matthew B. Crawford","cover":"515jsRfoIdL","length":"6 hrs and 38 mins","narrators":"Max Bloomquist","subHeading":"An Inquiry into the Value of Work","title":"Shop Class as Soulcraft"},{"asin":"0063076128","authors":"Dave Grohl","cover":"51MQFMd-YWL","length":"10 hrs and 35 mins","narrators":"Dave Grohl","subHeading":"Tales of Life and Music","title":"The Storyteller"},{"asin":"B01478ZQOU","authors":"Rainn Wilson","cover":"51d8yzzs2vL","length":"8 hrs and 49 mins","narrators":"Rainn Wilson","subHeading":"My Life in Art, Faith, and Idiocy","title":"The Bassoon King"},{"asin":"1508296227","authors":"Mike Rowe","cover":"51gJspjNQXL","length":"7 hrs and 55 mins","narrators":"Mike Rowe","title":"The Way I Heard It"},{"asin":"B075QN88DB","authors":"J.J. Sandor","cover":"61sB0Udi-fL","length":"2 hrs and 2 mins","narrators":"Matthew Broadhead","subHeading":"Beginners Guide and Woodworking Projects","title":"Woodworking Basics"},{"asin":"1508294933","authors":"Mo Rocca","cover":"61kh2b3pbnL","length":"11 hrs and 45 mins","narrators":"Mo Rocca","title":"Mobituaries"},{"asin":"B013S5I6B8","authors":"Sarah Vowell","cover":"61nIzk6CNdL","length":"8 hrs and 7 mins","narrators":"Sarah Vowell, John Slattery, Nick Offerman, and others","title":"Lafayette in the Somewhat United States"},{"asin":"1541400259","authors":"Gary Rogowski","cover":"51pEt104nDL","length":"7 hrs and 18 mins","narrators":"BJ Harrison","subHeading":"Creative Focus in the Age of Distraction","title":"Handmade"}];
window.bookSummaryJSON = "<p><b>After two </b><b><i>New York Times</i></b><b> best sellers, Nick Offerman returns with the subject for which he’s known best - his incredible real-life woodshop - in a program that includes five original songs. </b> </p> <p>Nestled among the glitz and glitter of Tinseltown is a testament to American elbow grease and an honest-to-god hard day’s work: Offerman Woodshop. Captained by hirsute woodworker, actor, comedian, and writer Nick Offerman, the shop produces not only fine handcrafted furniture, but also fun stuff - kazoos, baseball bats, ukuleles, moustache combs, even cedar strip canoes.</p> <p>Now Nick shares his experience of working at the woodshop with his ragtag crew of champions, tells you all about his passion for the discipline of woodworking, and teaches you how to make two of the woodshop’s most popular projects along the way: a Pop Top bottle opener and a three-legged stool. This audiobook will take you behind the scenes of the woodshop, both inspiring and teaching you to make your own projects while besotting you with the infectious spirit behind the shop and its complement of dusty wood-elves.</p> <p>While working on their projects, listeners can also enjoy exclusive original songs by Nick and his pal Jeff Tweedy - “Music to Sand By”, “American White Oak”, “Raising the Grain”, “The Lazy Carpenter”, and the title track, “Good Clean Fun”.</p> <p><i>Good Clean Fun</i> also includes writings by Nick, humorous essays, odes to his own woodworking heroes, insights into the ethos of woodworking in modern America, and other assorted tomfoolery, all imbued with Nick Offerman’s brand of bucolic yet worldly wisdom. </p> <p><b>*Includes a Bonus PDF with Drawings, Visuals, and Original Song Lyrics.</b></p> <p><b>PLEASE NOTE: When you purchase this title, the accompanying PDF will be available in your Audible Library along with the audio.</b></p>";
| 1,913.333333 | 3,794 | 0.739373 |
f745d32c5bc1cb9fc345b5275bf68afb1afd7df9 | 1,706 | h | C | src/Libs/canls/smc-cam-rc/c-anls/suprc/inc/sup_math.h | rayscc/dev-track | 644a68bc49eae215c56ce587ff73fc68e8c3f0e9 | [
"MIT"
] | null | null | null | src/Libs/canls/smc-cam-rc/c-anls/suprc/inc/sup_math.h | rayscc/dev-track | 644a68bc49eae215c56ce587ff73fc68e8c3f0e9 | [
"MIT"
] | null | null | null | src/Libs/canls/smc-cam-rc/c-anls/suprc/inc/sup_math.h | rayscc/dev-track | 644a68bc49eae215c56ce587ff73fc68e8c3f0e9 | [
"MIT"
] | null | null | null | // Copyright 赛北智能车
// All rights reserved.
// 除注明出处外,以下所有内容版权均中国计量大学赛北智能车所有,未经允许,不得用于商业用途,
// 修改内容时必须保留赛北智能车的版权声明。
// file sup_math.h
// brief 数学运算支持(高效算法)
// author 赛北智能车 Rays(整理修改)
// version v2.0
// date 2018-08-11
#ifndef _SUP_MATH_H_
#define _SUP_MATH_H_
#define _imax( x, y ) ( ((x) > (y)) ? (x) : (y) ) //maximum value
#define _imin( x, y ) ( ((x) < (y)) ? (x) : (y) ) //minimum value
#define _imid( a, b, c) ((a-b) * (b-c) >= 0?b:((b-a) * (a-c) > 0?a:c))//intermediate value
#define _iinc( i, a, b) (i <= _imax(a,b) && i >= _imin(a,b)) //判断 i 在a,b之间
#define _iexc( i, a, b) (i > _imax(a,b) || i < _imin(a,b)) //判断 i 不在a,b之间
#define _ninc( i, a, b) (i >= a && i <= b)
#define _iiabs(x) (((int)(x) > 0) ? (int)(x) : (-(int)(x))) //求绝对值
#define _iidif(x,y) _iiabs((int)(x - y)) //求差
#define EPSINON (0.000001f) //浮点数精度值
#define PII (3.14159265358979323846)
#define FLOAT_ZERO(x) (x < EPSINON && x > -EPSINON)
//<!-- dichotomy accelerates the opening number -->
extern double _i2sqrt(int number);
//<!-- quick opening numbe -->
extern float _isqrt(float number);
extern double _isin(double rad);
extern double _icos(double rad);
//<!-- supports two primitive floating point types: float and double -->
extern float _ifabs(float number);
//<!-- inverse tangent (x, y corresponding to two dimensional plane's vertical and horizontal coordinates)-->
//<!-- radian - range:0 ~ PI and -PI ~ 0 -->
extern double _iatan_r(float x, float y);
//<!-- degree - range:0 ~ 180 and -180 ~ 0 -->
extern double _iatan_d(float x, float y);
//<!-- get the greatest common factor by rolling method-->
extern int _gcd(int x, int y);
#endif
| 33.45098 | 109 | 0.607268 |
5aea2df77a0c33fb974b8f38493e34a7d50a22cb | 1,747 | kt | Kotlin | app/src/main/java/cz/hlinkapp/gvpintranet/view_models/ArticleDetailViewModel.kt | gohlinka2/GVPIntranet | d5ee48c9bd06e330927801c79e5fc06d4ccf3319 | [
"Apache-2.0"
] | null | null | null | app/src/main/java/cz/hlinkapp/gvpintranet/view_models/ArticleDetailViewModel.kt | gohlinka2/GVPIntranet | d5ee48c9bd06e330927801c79e5fc06d4ccf3319 | [
"Apache-2.0"
] | null | null | null | app/src/main/java/cz/hlinkapp/gvpintranet/view_models/ArticleDetailViewModel.kt | gohlinka2/GVPIntranet | d5ee48c9bd06e330927801c79e5fc06d4ccf3319 | [
"Apache-2.0"
] | null | null | null | package cz.hlinkapp.gvpintranet.view_models
import androidx.lifecycle.LiveData
import androidx.lifecycle.ViewModel
import androidx.paging.PagedList
import cz.hlinkapp.gvpintranet.data.repositories.ArticleDetailRepository
import cz.hlinkapp.gvpintranet.data.utils.event_handling.RequestInfo
import cz.hlinkapp.gvpintranet.model.Article
import cz.hlinkapp.gvpintranet.model.Comment
import javax.inject.Inject
/**
* A ViewModel for the article-detail screen.
*/
class ArticleDetailViewModel @Inject constructor(articleDetailRepository: ArticleDetailRepository): ViewModel() {
private val mRepository = articleDetailRepository
private lateinit var mArticle : LiveData<Article>
private lateinit var mComments : LiveData<PagedList<Comment>>
val article : LiveData<Article> get() = mArticle
val comments : LiveData<PagedList<Comment>> get() = mComments
val commentsStatus : LiveData<RequestInfo> get() = mRepository.commentsStatus
val postCommentStatus : LiveData<RequestInfo> get() = mRepository.postCommentStatus
/**
* Initializes the view model's data.
* Loads both the comments and the article.
* The article is loaded only from the local db, while the comments are first loaded from the db and then an attempt to refresh them is made.
* You can observe the status of comments refreshing via [commentsStatus].
*/
fun init(articleId: Int) {
mArticle = mRepository.getArticle(articleId)
mComments = mRepository.getPagedComments(articleId)
}
/**
* Posts the given comment to the server.
* You can observe the operation status using [postCommentStatus].
*/
fun postComment(comment: Comment) {
mRepository.postComment(comment)
}
} | 38.822222 | 145 | 0.755009 |
9c31feff3b82d9dc779198b4a03e3f8a0e65f972 | 812 | js | JavaScript | index.js | panjunqiu/angular-sample | 97c24db1c86ed60ea714ee448f8d14e683ead3f2 | [
"MIT"
] | null | null | null | index.js | panjunqiu/angular-sample | 97c24db1c86ed60ea714ee448f8d14e683ead3f2 | [
"MIT"
] | null | null | null | index.js | panjunqiu/angular-sample | 97c24db1c86ed60ea714ee448f8d14e683ead3f2 | [
"MIT"
] | null | null | null | angular.module('sampleApp', ['ngRoute', 'pascalprecht.translate'])
.config(function($routeProvider, sampleList) {
var list = sampleList.list;
console.log(list);
// 下一步细化路由,细化模块结构
for (var i = 0, r; r = list[i]; i++) {
$routeProvider.when("/" + r, {
templateUrl: "modules/" + r + "/" + r + ".htm"
});
}
// 默认路由道list的第一项
$routeProvider.otherwise({
redirectTo: '/' + list[0]
});
})
.config(function($translateProvider) {
$translateProvider.translations('en', {
'key': 'Hello key',
'FOO': 'This is a paragraph'
});
$translateProvider.translations('zh', {
'key': '你好 关键字',
'FOO': '这是一幅图'
});
$translateProvider.preferredLanguage('zh');
})
.controller('navController', function($scope, sampleList) {
$scope.data = sampleList;
console.log(sampleList);
}) | 23.882353 | 66 | 0.618227 |
7abbe3bf720daea2c40d5db1c1db9d899f74cbcc | 235 | rb | Ruby | attributes/filesystem.rb | duedil-ltd/chef-monit-bin | 1e7780a1feedc43e8dc91762e6e5e91300128fc0 | [
"MIT"
] | null | null | null | attributes/filesystem.rb | duedil-ltd/chef-monit-bin | 1e7780a1feedc43e8dc91762e6e5e91300128fc0 | [
"MIT"
] | null | null | null | attributes/filesystem.rb | duedil-ltd/chef-monit-bin | 1e7780a1feedc43e8dc91762e6e5e91300128fc0 | [
"MIT"
] | null | null | null | default['monit']['filesystem']['targets'] = {
"rootfs" => {
"path" => "/",
"policies" => [
"if changed fsflags then alert",
"if space usage > 60 % then alert",
"if inode usage > 60 % then alert"
]
}
}
| 21.363636 | 45 | 0.502128 |
9c65416e8ae6e7aa1aa523dd29e14ad95a0b4ca2 | 3,962 | js | JavaScript | doc/files/src/engineLauncher/Egg-cs-Summary.js | Studio58Games/EGG-website | 85098a6472af4b53f5d5be55234eb5a66a37a70a | [
"CC-BY-3.0"
] | null | null | null | doc/files/src/engineLauncher/Egg-cs-Summary.js | Studio58Games/EGG-website | 85098a6472af4b53f5d5be55234eb5a66a37a70a | [
"CC-BY-3.0"
] | null | null | null | doc/files/src/engineLauncher/Egg-cs-Summary.js | Studio58Games/EGG-website | 85098a6472af4b53f5d5be55234eb5a66a37a70a | [
"CC-BY-3.0"
] | null | null | null | NDFramePage.OnPageTitleLoaded("File:src/engineLauncher/Egg.cs","Egg.cs");NDSummary.OnSummaryLoaded("File:src/engineLauncher/Egg.cs",[["C#","CSharp"]],[["Classes","Class"],["Constants","Constant"],["Enums","Enumeration"],["Functions","Function"],["Groups","Group"],["Properties","Property"],["Variables","Variable"]],[[3365,0,0,"<span class=\"Qualifier\">Engine.​src.​engineLauncher.</span>​Egg","Engine.src.engineLauncher.Egg"],[3366,0,4,"Types","Engine.src.engineLauncher.Egg.Types"],[3367,0,2,"Os","Engine.src.engineLauncher.Egg.Os"],[3368,0,4,"Constants","Engine.src.engineLauncher.Egg.Constants"],[3369,0,1,"os","Engine.src.engineLauncher.Egg.os"],[3370,0,4,"Variables","Engine.src.engineLauncher.Egg.Variables"],[3371,0,6,"SIZE","Engine.src.engineLauncher.Egg.SIZE"],[3372,0,6,"Width","Engine.src.engineLauncher.Egg.Width"],[3373,0,6,"Height","Engine.src.engineLauncher.Egg.Height"],[3374,0,6,"Size","Engine.src.engineLauncher.Egg.Size"],[3375,0,6,"Scale","Engine.src.engineLauncher.Egg.Scale"],[3376,0,6,"Quit","Engine.src.engineLauncher.Egg.Quit"],[3377,0,6,"editScene","Engine.src.engineLauncher.Egg.editScene"],[3378,0,6,"CurrentScene","Engine.src.engineLauncher.Egg.CurrentScene"],[3379,0,6,"graphics","Engine.src.engineLauncher.Egg.graphics"],[3380,0,6,"spriteBatch","Engine.src.engineLauncher.Egg.spriteBatch"],[3381,0,6,"Loader","Engine.src.engineLauncher.Egg.Loader"],[3382,0,6,"Renderer","Engine.src.engineLauncher.Egg.Renderer"],[3383,0,6,"Camera","Engine.src.engineLauncher.Egg.Camera"],[3384,0,6,"ContentManager","Engine.src.engineLauncher.Egg.ContentManager"],[3385,0,6,"AudioManager","Engine.src.engineLauncher.Egg.AudioManager"],[3386,0,6,"IsFullScreen","Engine.src.engineLauncher.Egg.IsFullScreen"],[3387,0,6,"EngineName","Engine.src.engineLauncher.Egg.EngineName"],[3388,0,6,"EngineVersion","Engine.src.engineLauncher.Egg.EngineVersion"],[3389,0,4,"Properties","Engine.src.engineLauncher.Egg.Properties"],[3390,0,5,"FullEngineName","Engine.src.engineLauncher.Egg.FullEngineName"],[3391,0,4,"Variables","Engine.src.engineLauncher.Egg.Variables(2)"],[3392,0,6,"WindowName","Engine.src.engineLauncher.Egg.WindowName"],[3393,0,4,"Properties","Engine.src.engineLauncher.Egg.Properties(2)"],[3394,0,5,"ProcessName","Engine.src.engineLauncher.Egg.ProcessName"],[3395,0,4,"Variables","Engine.src.engineLauncher.Egg.Variables(3)"],[3396,0,6,"VSync","Engine.src.engineLauncher.Egg.VSync"],[3397,0,6,"UPS","Engine.src.engineLauncher.Egg.UPS"],[3398,0,6,"LogicCounter","Engine.src.engineLauncher.Egg.LogicCounter"],[3399,0,6,"LogicTimeCounter","Engine.src.engineLauncher.Egg.LogicTimeCounter"],[3400,0,6,"FPS","Engine.src.engineLauncher.Egg.FPS"],[3401,0,6,"RenderCounter","Engine.src.engineLauncher.Egg.RenderCounter"],[3402,0,6,"RenderTimeCounter","Engine.src.engineLauncher.Egg.RenderTimeCounter"],[3403,0,6,"isPaused","Engine.src.engineLauncher.Egg.isPaused"],[3404,0,6,"goNextFrame","Engine.src.engineLauncher.Egg.goNextFrame"],[3405,0,4,"Functions","Engine.src.engineLauncher.Egg.Functions"],[3406,0,3,"Egg","Engine.src.engineLauncher.Egg.Egg"],[3407,0,3,"Window_ClientSizeChanged","Engine.src.engineLauncher.Egg.Window_ClientSizeChanged"],[3408,0,3,"Initialize","Engine.src.engineLauncher.Egg.Initialize"],[3409,0,3,"LoadContent","Engine.src.engineLauncher.Egg.LoadContent"],[3410,0,3,"Update","Engine.src.engineLauncher.Egg.Update"],[3411,0,3,"UpdateTime","Engine.src.engineLauncher.Egg.UpdateTime"],[3412,0,3,"UpdateInput","Engine.src.engineLauncher.Egg.UpdateInput"],[3413,0,3,"Draw","Engine.src.engineLauncher.Egg.Draw"],[3414,0,3,"OnExiting","Engine.src.engineLauncher.Egg.OnExiting"],[3415,0,3,"Close","Engine.src.engineLauncher.Egg.Close"],[3416,0,3,"CheckExitGame","Engine.src.engineLauncher.Egg.CheckExitGame"],[3417,0,3,"LoadScreen","Engine.src.engineLauncher.Egg.LoadScreen"],[3418,0,3,"FullScreen","Engine.src.engineLauncher.Egg.FullScreen"],[3419,0,3,"ChangeScene","Engine.src.engineLauncher.Egg.ChangeScene"]]); | 3,962 | 3,962 | 0.760475 |
2d7671333047e9c4a7fbfdb692ed62e845840aa8 | 1,837 | lua | Lua | _lua5.1-tests/verybig.lua | edunx/lua | 166c0e5e42e224516c056dd1dc96e48b3b2bff31 | [
"MIT"
] | 1 | 2021-03-25T03:04:33.000Z | 2021-03-25T03:04:33.000Z | _lua5.1-tests/verybig.lua | edunx/lua | 166c0e5e42e224516c056dd1dc96e48b3b2bff31 | [
"MIT"
] | null | null | null | _lua5.1-tests/verybig.lua | edunx/lua | 166c0e5e42e224516c056dd1dc96e48b3b2bff31 | [
"MIT"
] | null | null | null | if rawget(_G, "_soft") then return 10 end
print "testing large programs (>64k)"
-- template to create a very big test file
prog = [[$
local a,b
b = {$1$
b30009 = 65534,
b30010 = 65535,
b30011 = 65536,
b30012 = 65537,
b30013 = 16777214,
b30014 = 16777215,
b30015 = 16777216,
b30016 = 16777217,
b30017 = 4294967294,
b30018 = 4294967295,
b30019 = 4294967296,
b30020 = 4294967297,
b30021 = -65534,
b30022 = -65535,
b30023 = -65536,
b30024 = -4294967297,
b30025 = 15012.5,
$2$
};
assert(b.a50008 == 25004 and b["a11"] == 5.5)
assert(b.a33007 == 16503.5 and b.a50009 == 25004.5)
assert(b["b"..30024] == -4294967297)
function b:xxx (a,b) return a+b end
assert(b:xxx(10, 12) == 22) -- pushself with non-constant index
b.xxx = nil
s = 0; n=0
for a,b in pairs(b) do s=s+b; n=n+1 end
assert(s==13977183656.5 and n==70001)
require "checktable"
stat(b)
a = nil; b = nil
print'+'
function f(x) b=x end
a = f{$3$} or 10
assert(a==10)
assert(b[1] == "a10" and b[2] == 5 and b[table.getn(b)-1] == "a50009")
function xxxx (x) return b[x] end
assert(xxxx(3) == "a11")
a = nil; b=nil
xxxx = nil
return 10
]]
-- functions to fill in the $n$
F = {
function () -- $1$
for i=10,50009 do
io.write('a', i, ' = ', 5+((i-10)/2), ',\n')
end
end,
function () -- $2$
for i=30026,50009 do
io.write('b', i, ' = ', 15013+((i-30026)/2), ',\n')
end
end,
function () -- $3$
for i=10,50009 do
io.write('"a', i, '", ', 5+((i-10)/2), ',\n')
end
end,
}
file = os.tmpname()
io.output(file)
for s in string.gmatch(prog, "$([^$]+)") do
local n = tonumber(s)
if not n then io.write(s) else F[n]() end
end
io.close()
result = dofile(file)
assert(os.remove(file))
print'OK'
return result
| 18.188119 | 71 | 0.558519 |
383cfcdc1bde141fb7d65ced89b23de666732c92 | 1,833 | asm | Assembly | programs/oeis/134/A134062.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/134/A134062.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/134/A134062.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A134062: Row sums of triangle A134061.
; 1,8,18,38,78,158,318,638,1278,2558,5118,10238,20478,40958,81918,163838,327678,655358,1310718,2621438,5242878,10485758,20971518,41943038,83886078,167772158,335544318,671088638,1342177278,2684354558,5368709118,10737418238,21474836478,42949672958,85899345918,171798691838,343597383678,687194767358,1374389534718,2748779069438,5497558138878,10995116277758,21990232555518,43980465111038,87960930222078,175921860444158,351843720888318,703687441776638,1407374883553278,2814749767106558,5629499534213118,11258999068426238,22517998136852478,45035996273704958,90071992547409918,180143985094819838,360287970189639678,720575940379279358,1441151880758558718,2882303761517117438,5764607523034234878,11529215046068469758,23058430092136939518,46116860184273879038,92233720368547758078,184467440737095516158,368934881474191032318,737869762948382064638,1475739525896764129278,2951479051793528258558,5902958103587056517118,11805916207174113034238,23611832414348226068478,47223664828696452136958,94447329657392904273918,188894659314785808547838,377789318629571617095678,755578637259143234191358,1511157274518286468382718,3022314549036572936765438,6044629098073145873530878,12089258196146291747061758,24178516392292583494123518,48357032784585166988247038,96714065569170333976494078,193428131138340667952988158,386856262276681335905976318,773712524553362671811952638,1547425049106725343623905278,3094850098213450687247810558,6189700196426901374495621118,12379400392853802748991242238,24758800785707605497982484478,49517601571415210995964968958,99035203142830421991929937918,198070406285660843983859875838,396140812571321687967719751678,792281625142643375935439503358,1584563250285286751870879006718,3169126500570573503741758013438
mov $1,2
pow $1,$0
lpb $0
mov $0,0
mul $1,5
lpe
add $0,$1
trn $0,3
add $0,1
| 141 | 1,710 | 0.917621 |
ba6414190e8f1dfd072fba63df3722c2a9949bcb | 3,676 | kt | Kotlin | src/main/kotlin/org/arend/toolWindow/repl/ArendReplExecutionHandler.kt | knisht/intellij-arend | ef3cdcd131f9edfaa7d5cf8cfb66b729f11ffdab | [
"Apache-2.0"
] | null | null | null | src/main/kotlin/org/arend/toolWindow/repl/ArendReplExecutionHandler.kt | knisht/intellij-arend | ef3cdcd131f9edfaa7d5cf8cfb66b729f11ffdab | [
"Apache-2.0"
] | null | null | null | src/main/kotlin/org/arend/toolWindow/repl/ArendReplExecutionHandler.kt | knisht/intellij-arend | ef3cdcd131f9edfaa7d5cf8cfb66b729f11ffdab | [
"Apache-2.0"
] | null | null | null | package org.arend.toolWindow.repl
import com.intellij.execution.console.BaseConsoleExecuteActionHandler
import com.intellij.execution.console.LanguageConsoleBuilder
import com.intellij.execution.console.LanguageConsoleView
import com.intellij.execution.ui.ConsoleViewContentType
import com.intellij.icons.AllIcons
import com.intellij.openapi.Disposable
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.DefaultActionGroup
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.components.service
import com.intellij.openapi.project.DumbAwareAction
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.Disposer
import com.intellij.openapi.wm.ToolWindow
import org.arend.ArendLanguage
import org.arend.psi.ArendFile
import org.arend.repl.CommandHandler
import org.arend.repl.action.NormalizeCommand
import org.arend.settings.ArendProjectSettings
class ArendReplExecutionHandler(
project: Project,
private val toolWindow: ToolWindow
) : BaseConsoleExecuteActionHandler(true) {
private val repl = object : IntellijRepl(this, project) {
override fun print(anything: Any?) {
val s = anything.toString()
when {
s.startsWith("[INFO]") -> consoleView.print(s, ConsoleViewContentType.LOG_INFO_OUTPUT)
s.startsWith("[ERROR]") || s.startsWith("[FATAL]") -> consoleView.print(s, ConsoleViewContentType.ERROR_OUTPUT)
s.startsWith("[WARN]") || s.startsWith("[WARNING]") -> consoleView.print(s, ConsoleViewContentType.LOG_WARNING_OUTPUT)
else -> consoleView.print(s, ConsoleViewContentType.NORMAL_OUTPUT)
}
}
override fun eprintln(anything: Any?) =
consoleView.print("$anything\n", ConsoleViewContentType.ERROR_OUTPUT)
}
val consoleView = LanguageConsoleBuilder()
.executionEnabled { true }
.oneLineInput(false)
.initActions(this, ArendReplService.ID)
.build(project, ArendLanguage.INSTANCE)
val arendFile = consoleView.file as ArendFile
override fun execute(text: String, console: LanguageConsoleView) {
super.execute(text, console)
if (repl.repl(text) { "" }) {
toolWindow.hide()
repl.clearScope()
repl.resetCurrentLineScope()
resetRepl()
saveSettings()
}
}
init {
consoleView.isEditable = true
consoleView.isConsoleEditorEnabled = true
Disposer.register(consoleView, Disposable(::saveSettings))
val normalization = consoleView.project.service<ArendProjectSettings>().data
.replNormalizationMode
NormalizeCommand.INSTANCE.loadNormalize(normalization, repl, false)
repl.initialize()
resetRepl()
}
private fun saveSettings() {
consoleView.project.service<ArendProjectSettings>().data
.replNormalizationMode = repl.normalizationMode.toString()
}
private fun resetRepl() {
consoleView.clear()
consoleView.print("Type ", ConsoleViewContentType.NORMAL_OUTPUT)
consoleView.printHyperlink(":?") {
CommandHandler.HELP_COMMAND_INSTANCE("", repl) { "" }
}
consoleView.print(" for help.\n", ConsoleViewContentType.NORMAL_OUTPUT)
}
fun createActionGroup() = DefaultActionGroup(
object : DumbAwareAction("Clear", null, AllIcons.Actions.GC) {
override fun actionPerformed(event: AnActionEvent) = ApplicationManager.getApplication()
.invokeLater(this@ArendReplExecutionHandler::resetRepl)
}
)
} | 39.956522 | 134 | 0.705386 |
43952246e47182278a147e2a1479b7c37cf188e0 | 911 | go | Go | main.go | afiskon/golang-codec-example | 9e737f3dd4a1fbba5facf3d557014534ba296623 | [
"MIT"
] | null | null | null | main.go | afiskon/golang-codec-example | 9e737f3dd4a1fbba5facf3d557014534ba296623 | [
"MIT"
] | null | null | null | main.go | afiskon/golang-codec-example | 9e737f3dd4a1fbba5facf3d557014534ba296623 | [
"MIT"
] | null | null | null | package main
import (
"github.com/ugorji/go/codec"
. "github.com/afiskon/golang-codec-example/types"
"log"
)
func main() {
var (
cborHandle codec.CborHandle
err error
)
//v1 := Hero{ "Alex", 123, 456, &WarriorInfo{ BOW, 10 }, nil}
v1 := Hero{ "Bob", 234, 567, nil,
&MageInfo{ []Spell{FIREBALL, THUNDERBOLT}, 42 } }
var bs []byte
enc := codec.NewEncoderBytes(&bs, &cborHandle)
err = enc.Encode(v1)
if err != nil {
log.Fatalf("enc.Encode() failed, err = %v", err)
}
log.Printf("bs = %q, len = %d, cap = %d", bs, len(bs), cap(bs))
// Decode bs to v2
var v2 Hero
dec := codec.NewDecoderBytes(bs, &cborHandle)
err = dec.Decode(&v2)
if err != nil {
log.Fatalf("dec.Decode() failed, err = %v", err)
}
log.Printf("v2 = %v", v2)
if v2.WarriorInfo != nil{
log.Printf("WarriorInfo = %v", *v2.WarriorInfo)
}
if v2.MageInfo != nil {
log.Printf("MageInfo = %v", *v2.MageInfo)
}
}
| 20.704545 | 64 | 0.613611 |
7b9ec05d694e6f1cf3866623b9bb5ded016ed467 | 5,667 | kt | Kotlin | app/src/main/java/com/yadaniil/bitcurve/screens/tx/TxActivity.kt | YaDaniil/BitCurve | 7f592b5501c1fd5dc67ec3857de8d1341c9f81dd | [
"MIT"
] | null | null | null | app/src/main/java/com/yadaniil/bitcurve/screens/tx/TxActivity.kt | YaDaniil/BitCurve | 7f592b5501c1fd5dc67ec3857de8d1341c9f81dd | [
"MIT"
] | null | null | null | app/src/main/java/com/yadaniil/bitcurve/screens/tx/TxActivity.kt | YaDaniil/BitCurve | 7f592b5501c1fd5dc67ec3857de8d1341c9f81dd | [
"MIT"
] | null | null | null | package com.yadaniil.bitcurve.screens.tx
import android.content.ClipData
import android.content.ClipboardManager
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.view.MenuItem
import com.jakewharton.rxbinding2.widget.text
import com.yadaniil.bitcurve.R
import com.yadaniil.bitcurve.data.db.models.AccountEntity
import com.yadaniil.bitcurve.data.db.models.TxEntity
import com.yadaniil.bitcurve.logic.Coin
import com.yadaniil.bitcurve.utils.DateHelper
import com.yadaniil.bitcurve.utils.DenominationHelper
import com.yadaniil.bitcurve.utils.openUrl
import kotlinx.android.synthetic.main.activity_tx.*
import org.jetbrains.anko.onClick
import org.jetbrains.anko.onLongClick
import org.jetbrains.anko.toast
import org.koin.android.architecture.ext.viewModel
import java.util.*
/**
* Created by danielyakovlev on 3/27/18.
*/
class TxActivity : AppCompatActivity() {
private val viewModel by viewModel<TxViewModel>()
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_tx)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
val tx = viewModel.getTx(intent.getLongExtra("txEntityId", 0))
val account = viewModel.getAccountOfTx(tx.id)
renderTx(tx, account)
}
private fun renderTx(txEntity: TxEntity, accountEntity: AccountEntity?) {
val coin = accountEntity?.getCoin()
val confirmationsCount = txEntity.getTxConfirmationsCount(viewModel.getBlockchainHeight())
val isTxPending = txEntity.blockHeight <= 0 || confirmationsCount < TxEntity.CONFIRMATIONS_TO_BE_CONFIRMED
renderAmountAndDescription(txEntity, coin, isTxPending)
renderConfirmationStatus(confirmationsCount)
renderTxHash(txEntity)
// Render date
val dateAndTime = "${Date(txEntity.time * 1000)} " +
"(${DateHelper.buildTxFriendlyDateString(txEntity, this)})"
time_and_date.text = dateAndTime
// Render Fee
val feeAndFeePerByte = "${DenominationHelper.satoshiToBtc(txEntity.feeSatoshi)} " +
"${accountEntity?.getCoin()?.ticker} " +
"(${txEntity.feeSatoshi / txEntity.sizeBytes.toLong()} " +
"${getString(R.string.satoshi_lowercase)}/${getString(R.string.byte_lowercase)})"
fee.text = feeAndFeePerByte
// Render Size
val txSize = "${txEntity.sizeBytes} ${getString(R.string.bytes)}"
tx_size.text = txSize
// Render account balance after tx completed
val balance = "${DenominationHelper.satoshiToBtc(txEntity.balanceSatoshi)} ${accountEntity?.getCoin()?.ticker}"
account_balance.text = balance
renderInputs(txEntity)
renderOutputs(txEntity)
}
private fun renderAmountAndDescription(txEntity: TxEntity, coin: Coin?, isTxPending: Boolean) {
val formattedAmount = if (txEntity.isReceived == true)
"+${DenominationHelper.satoshiToBtc(txEntity.result)} ${coin?.ticker}"
else "${DenominationHelper.satoshiToBtc(txEntity.result)} ${coin?.ticker}"
if(txEntity.isReceived == true) {
amount?.background= resources.getDrawable(R.drawable.amount_income_background)
amount?.text = formattedAmount
val txDescription = "${getString(R.string.received)} ${coin?.name} " +
"${getString(R.string.from_lowercase)}\n ${txEntity.getSender()}"
tx_description.text = txDescription
} else {
amount?.background = resources.getDrawable(R.drawable.amount_outcome_background)
amount?.text = formattedAmount
val txDescription = "${getString(R.string.sent)} ${coin?.name} " +
"${getString(R.string.to_lowercase)}\n ${txEntity.getFirstReceiver()}"
tx_description.text = txDescription
}
if (isTxPending) amount?.background = resources.getDrawable(R.drawable.amount_pending_background)
}
private fun renderConfirmationStatus(confirmationsCount: Int) {
val txStatus = if (confirmationsCount < 6)
"${getString(R.string.pending)} ($confirmationsCount/6)"
else "${getString(R.string.confirmed)} ($confirmationsCount)"
val fullStatus = "${getString(R.string.status)}: $txStatus"
status.text = fullStatus
}
private fun renderTxHash(txEntity: TxEntity) {
tx_hash.text = txEntity.hash
tx_hash_layout.apply {
onLongClick {
val clipboardManager = getSystemService(AppCompatActivity.CLIPBOARD_SERVICE) as ClipboardManager
val clip = ClipData.newPlainText("hash", tx_hash.text.toString())
clipboardManager.primaryClip = clip
toast(R.string.hash_copied_to_clipboard)
true
}
onClick { openUrl(this@TxActivity, getString(R.string.show_tx_url, txEntity.hash)) }
}
}
private fun renderInputs(txEntity: TxEntity) {
txEntity.inputs?.forEach {
val addresses = "${inputs.text}${it.prevOutAddress}\n"
inputs.text = addresses
}
}
private fun renderOutputs(txEntity: TxEntity) {
txEntity.outputs?.forEach {
val addresses = "${outputs.text}${it.address}\n"
outputs.text = addresses
}
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
return when (item.itemId) {
android.R.id.home -> {
onBackPressed()
true
}
else -> super.onOptionsItemSelected(item)
}
}
} | 39.908451 | 119 | 0.669314 |
e50d092e0ce538d9098e9a899e6bee13f2ffacb1 | 663 | ts | TypeScript | src/shared/util.ts | dotlim/hooks | bfbd42f2ecb9d8de8207e6ad2f0ad61bec416dc8 | [
"MIT"
] | null | null | null | src/shared/util.ts | dotlim/hooks | bfbd42f2ecb9d8de8207e6ad2f0ad61bec416dc8 | [
"MIT"
] | null | null | null | src/shared/util.ts | dotlim/hooks | bfbd42f2ecb9d8de8207e6ad2f0ad61bec416dc8 | [
"MIT"
] | null | null | null | export const noop = () => {};
export function on<T extends Window | Document | HTMLElement | EventTarget>(
target: T | null,
...args: Parameters<T['addEventListener']> | [string, Function | null, ...any]
) {
if (target?.addEventListener) {
target.addEventListener(...(args as Parameters<HTMLElement['addEventListener']>));
}
}
export function off<T extends Window | Document | HTMLElement | EventTarget>(
target: T | null,
...args: Parameters<T['removeEventListener']> | [string, Function | null, ...any]
) {
if (target?.removeEventListener) {
target.removeEventListener(...(args as Parameters<HTMLElement['removeEventListener']>));
}
}
| 33.15 | 92 | 0.68175 |
c7a28d2076c6b08055e6480e3020b085e0d31bd3 | 803 | sql | SQL | quarantaenie.sql | Schlaumra/quarantaenie | 9aa6f76de43db1cb1c77cc2030743c932b2b9d79 | [
"MIT"
] | null | null | null | quarantaenie.sql | Schlaumra/quarantaenie | 9aa6f76de43db1cb1c77cc2030743c932b2b9d79 | [
"MIT"
] | null | null | null | quarantaenie.sql | Schlaumra/quarantaenie | 9aa6f76de43db1cb1c77cc2030743c932b2b9d79 | [
"MIT"
] | null | null | null | DROP DATABASE IF EXISTS quarantaenie;
DROP USER IF EXISTS quarantine@localhost;
CREATE DATABASE quarantaenie;
CREATE USER quarantine@localhost IDENTIFIED BY 'Kennwort0';
GRANT ALL PRIVILEGES ON quarantaenie.* TO quarantine@localhost;
USE quarantaenie;
CREATE TABLE class (
id integer AUTO_INCREMENT PRIMARY KEY,
name varchar(100)
);
CREATE TABLE student (
id integer AUTO_INCREMENT PRIMARY KEY,
firstName varchar(100),
lastName varchar(100),
class_fk integer
);
CREATE TABLE quarantine (
id integer AUTO_INCREMENT PRIMARY KEY,
qStart date,
qEnd date,
student_fk integer
);
ALTER TABLE student
ADD CONSTRAINT fk_student_class FOREIGN KEY(class_fk) REFERENCES class(id);
ALTER TABLE quarantine
ADD CONSTRAINT fk_quarantine_student FOREIGN KEY(student_fk) REFERENCES student(id); | 24.333333 | 84 | 0.797011 |
000ee1a564d896b18085cccaae15d70a7a6e6432 | 176 | sql | SQL | NewQuery.sql | Dashanan-Visharava-Kaikasi/AmpleRepository | 444b7016f7f2313a6a029e4820097c920a8a0247 | [
"MIT"
] | null | null | null | NewQuery.sql | Dashanan-Visharava-Kaikasi/AmpleRepository | 444b7016f7f2313a6a029e4820097c920a8a0247 | [
"MIT"
] | null | null | null | NewQuery.sql | Dashanan-Visharava-Kaikasi/AmpleRepository | 444b7016f7f2313a6a029e4820097c920a8a0247 | [
"MIT"
] | null | null | null | create table PointsTable
(
Id int primary key identity(1,1),
FStatus nvarchar(10) default('Del'),
UserId int foreign key References Users(Id),
Poinst float default(0)
); | 25.142857 | 45 | 0.732955 |
7e19dd2915417fa371324cf6d93c5a88f8ccc905 | 3,757 | css | CSS | base/base_files/myCustom.css | lengyue1084/git_learning | 4beab914b5facf55a6cbe8254ecdecf28bdefa41 | [
"MIT"
] | 1 | 2020-08-02T15:41:55.000Z | 2020-08-02T15:41:55.000Z | base/base_files/myCustom.css | lengyue1084/learning | 4beab914b5facf55a6cbe8254ecdecf28bdefa41 | [
"MIT"
] | null | null | null | base/base_files/myCustom.css | lengyue1084/learning | 4beab914b5facf55a6cbe8254ecdecf28bdefa41 | [
"MIT"
] | null | null | null | input {
outline: none !important;
background: transparent !important;
border: none !important;
outline: medium !important;
}
/**:focus {
outline: none !important;
background-color: transparent !important;
}*/
::selection {
background: transparent;
!important;
}
::-moz-selection {
background: transparent;
!important;
}
/*去掉谷哥浏览器输入框获取焦点有背景颜色*/
input:-webkit-autofill {
-webkit-box-shadow: 0 0 0px 1000px white inset !important;
outline: none;
}
.sider-contianr2 .sider-btns .b {
background: rgba(24, 44, 97, 0.6);
color: #fff;
}
.tit-box2 .select-box {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
font-size: 12px;
}
.haibao1 {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
/* flex-direction: column; */
}
/*新闻列表*/
.newslist .list .box img {
width: 300px;
height: 180px;
margin: 10px;
}
/*首页展区图标样式*/
.service-option2 li a {
z-index: 2;
-webkit-box-shadow: 0 15px 30px rgba(0, 0, 0, .1);
box-shadow: 0 15px 30px rgba(0, 0, 0, .1);
-webkit-transform: translate3d(0, -2px, 0);
transform: translate3d(0, -2px, 0);
}
@media only screen and (min-width: 750px) {
.qyml-box .box li a:hover {
background: #e10049;
}
.qyml-box .box li a:hover .info {
color: #fff;
}
.service-option2 li a:hover {
z-index: 2;
-webkit-box-shadow: 0 15px 30px rgba(0, 0, 0, .1);
box-shadow: 0 15px 30px rgba(0, 0, 0, .1);
-webkit-transform: translate3d(0, -2px, 0);
transform: translate3d(0, -2px, 0);
background: #e10049;
}
.service-option2 li a:hover p {
color: #fff;
}
.index-news-box li a:hover,
.index-news-box li a:hover span {
color: #e10049;
}
}
/*头部下拉菜单*/
.header .menu .m .child {
position: absolute;
background: #fff;
z-index: 9;
top: 80px;
width: 200px;
left: 50%;
margin-left: -100px;
border: 1px solid #f1f1f1;
display: none;
}
/*footer的行间距*/
.footer .information li {
line-height: 24px;
padding-bottom: 16px;
}
.supplylist .list .supply {
line-height: 24px;
color: #666;
margin-bottom: 15px;
/* text-overflow: -o-ellipsis-lastline;*/
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 100;
line-clamp: 100;
-webkit-box-orient: vertical;
}
.supplylist .list .supply1 {
line-height: 24px;
color: #666;
margin-bottom: 15px;
text-overflow: -o-ellipsis-lastline;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
line-clamp: 1;
-webkit-box-orient: vertical;
}
.index-swiper-container .btns {
position: absolute;
bottom: 40px;
left: 0;
width: 100%;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
z-index: 3;
}
.index-swiper-container .swiper-slide a>div {
width: 100%;
height: 100%;
overflow: hidden;
background-size: cover;
position: relative;
top: 80px;
}
.header .menu .m .t {
color: #FFFFFF;
cursor: pointer;
font-size: 14px;
}
.header .menu .m .t3 {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
color: #FFFFFF;
font-size: 14px;
}
.head-search .iconfont {
font-size: 24px;
cursor: pointer;
color: #ffffff;
} | 19.670157 | 62 | 0.601278 |
0b57f9e75344dd34d7fe38dc10faa58dd476ec48 | 4,270 | py | Python | events/utils.py | ewjoachim/pythondotorg | 382741cc6208fc56aa827cdd1da41983fb7e6ba8 | [
"Apache-2.0"
] | null | null | null | events/utils.py | ewjoachim/pythondotorg | 382741cc6208fc56aa827cdd1da41983fb7e6ba8 | [
"Apache-2.0"
] | null | null | null | events/utils.py | ewjoachim/pythondotorg | 382741cc6208fc56aa827cdd1da41983fb7e6ba8 | [
"Apache-2.0"
] | null | null | null | import datetime
import re
import pytz
from django.utils.timezone import make_aware, is_aware
def seconds_resolution(dt):
return dt - dt.microsecond * datetime.timedelta(0, 0, 1)
def minutes_resolution(dt):
return dt - dt.second * datetime.timedelta(0, 1, 0) - dt.microsecond * datetime.timedelta(0, 0, 1)
def date_to_datetime(date, tzinfo=None):
if tzinfo is None:
tzinfo = pytz.UTC
return datetime.datetime(*date.timetuple()[:6], tzinfo=tzinfo)
def extract_date_or_datetime(dt):
if isinstance(dt, datetime.datetime):
return convert_dt_to_aware(dt)
return dt
def convert_dt_to_aware(dt):
if not isinstance(dt, datetime.datetime):
dt = date_to_datetime(dt)
if not is_aware(dt):
# we don't want to use get_current_timezone() because
# settings.TIME_ZONE may be set something different than
# UTC in the future
return make_aware(dt, timezone=pytz.UTC)
return dt
def timedelta_nice_repr(timedelta, display='long', sep=', '):
"""
Turns a datetime.timedelta object into a nice string repr.
'display' can be 'minimal', 'short' or 'long' (default).
Taken from bitbucket.org/schinckel/django-timedelta-field.
'sql' and 'iso8601' support have been removed.
"""
if not isinstance(timedelta, datetime.timedelta):
raise TypeError('First argument must be a timedelta.')
result = []
weeks = int(timedelta.days / 7)
days = timedelta.days % 7
hours = int(timedelta.seconds / 3600)
minutes = int((timedelta.seconds % 3600) / 60)
seconds = timedelta.seconds % 60
if display == 'minimal':
words = ['w', 'd', 'h', 'm', 's']
elif display == 'short':
words = [' wks', ' days', ' hrs', ' min', ' sec']
elif display == 'long':
words = [' weeks', ' days', ' hours', ' minutes', ' seconds']
else:
# Use django template-style formatting.
# Valid values are d, g, G, h, H, i, s.
return re.sub(r'([dgGhHis])', lambda x: '%%(%s)s' % x.group(), display) % {
'd': days,
'g': hours,
'G': hours if hours > 9 else '0%s' % hours,
'h': hours,
'H': hours if hours > 9 else '0%s' % hours,
'i': minutes if minutes > 9 else '0%s' % minutes,
's': seconds if seconds > 9 else '0%s' % seconds
}
values = [weeks, days, hours, minutes, seconds]
for i in range(len(values)):
if values[i]:
if values[i] == 1 and len(words[i]) > 1:
result.append('%i%s' % (values[i], words[i].rstrip('s')))
else:
result.append('%i%s' % (values[i], words[i]))
# Values with less than one second, which are considered zeroes.
if len(result) == 0:
# Display as 0 of the smallest unit.
result.append('0%s' % (words[-1]))
return sep.join(result)
def timedelta_parse(string):
"""
Parse a string into a timedelta object.
Taken from bitbucket.org/schinckel/django-timedelta-field.
"""
string = string.strip()
if not string:
raise TypeError(f'{string!r} is not a valid time interval')
# This is the format we get from sometimes PostgreSQL, sqlite,
# and from serialization.
d = re.match(
r'^((?P<days>[-+]?\d+) days?,? )?(?P<sign>[-+]?)(?P<hours>\d+):'
r'(?P<minutes>\d+)(:(?P<seconds>\d+(\.\d+)?))?$',
string
)
if d:
d = d.groupdict(0)
if d['sign'] == '-':
for k in 'hours', 'minutes', 'seconds':
d[k] = '-' + d[k]
d.pop('sign', None)
else:
# This is the more flexible format.
d = re.match(
r'^((?P<weeks>-?((\d*\.\d+)|\d+))\W*w((ee)?(k(s)?)?)(,)?\W*)?'
r'((?P<days>-?((\d*\.\d+)|\d+))\W*d(ay(s)?)?(,)?\W*)?'
r'((?P<hours>-?((\d*\.\d+)|\d+))\W*h(ou)?(r(s)?)?(,)?\W*)?'
r'((?P<minutes>-?((\d*\.\d+)|\d+))\W*m(in(ute)?(s)?)?(,)?\W*)?'
r'((?P<seconds>-?((\d*\.\d+)|\d+))\W*s(ec(ond)?(s)?)?)?\W*$',
string
)
if not d:
raise TypeError(f'{string!r} is not a valid time interval')
d = d.groupdict(0)
return datetime.timedelta(**{k: float(v) for k, v in d.items()})
| 34.16 | 102 | 0.545902 |
65ebad56bffee1bcd3d0d3934634cf9f581a4a16 | 331 | rs | Rust | 7kyu/dominant-array-elements/src/lib.rs | lincot/rusted-katana | 3979ff39d5c10f5d413debf0447d9e7588f2478f | [
"BSD-2-Clause"
] | null | null | null | 7kyu/dominant-array-elements/src/lib.rs | lincot/rusted-katana | 3979ff39d5c10f5d413debf0447d9e7588f2478f | [
"BSD-2-Clause"
] | null | null | null | 7kyu/dominant-array-elements/src/lib.rs | lincot/rusted-katana | 3979ff39d5c10f5d413debf0447d9e7588f2478f | [
"BSD-2-Clause"
] | null | null | null | //! <https://www.codewars.com/kata/5a04133e32b8b998dc000089/train/rust>
pub fn solve(arr: &[u32]) -> Vec<u32> {
let mut res = Vec::with_capacity(arr.len());
let mut max = 0;
for &x in arr.iter().rev() {
if x > max {
res.push(x);
max = x;
}
}
res.reverse();
res
}
| 18.388889 | 71 | 0.501511 |
cf8a4d0a514762a626b64ffdceb72a779b652f9d | 462 | css | CSS | src/components/ScrollToTopButton/ScrollToTopButton.module.css | Aortix/portfolio-site-v2 | e0e5ae8a720619dc5bd0091913ac7bf70a554f75 | [
"MIT"
] | null | null | null | src/components/ScrollToTopButton/ScrollToTopButton.module.css | Aortix/portfolio-site-v2 | e0e5ae8a720619dc5bd0091913ac7bf70a554f75 | [
"MIT"
] | 4 | 2021-03-09T20:44:57.000Z | 2022-02-26T19:08:19.000Z | src/components/ScrollToTopButton/ScrollToTopButton.module.css | Aortix/portfolio-site-v2 | e0e5ae8a720619dc5bd0091913ac7bf70a554f75 | [
"MIT"
] | null | null | null | .mainContainer {
position: fixed;
bottom: 25px;
right: 25px;
border: 1px solid black;
height: 50px;
width: 50px;
border-radius: 50%;
cursor: pointer;
}
.mainContainerDark {
position: fixed;
bottom: 25px;
right: 25px;
border: 1px solid #f8f8f8;
height: 50px;
width: 50px;
border-radius: 50%;
cursor: pointer;
}
.arrowContainer {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
| 15.4 | 28 | 0.655844 |
b29bdce71f61e6d1e43fdf86fb65d96df7174994 | 3,202 | swift | Swift | apiserver/Sources/App/Models/Item.swift | corruptedzulu/shoppinglist | 3b227c20b89121ad165dc2e39fc34352804ab60f | [
"MIT"
] | null | null | null | apiserver/Sources/App/Models/Item.swift | corruptedzulu/shoppinglist | 3b227c20b89121ad165dc2e39fc34352804ab60f | [
"MIT"
] | null | null | null | apiserver/Sources/App/Models/Item.swift | corruptedzulu/shoppinglist | 3b227c20b89121ad165dc2e39fc34352804ab60f | [
"MIT"
] | null | null | null | //
// Item.swift
// apiserver
//
// Created by Spencer on 6/23/18.
//
import Foundation
import Vapor
import FluentMySQL
final class Item : Completable, MySQLModel {
var id: Int?;
var ownerId: Int;
var title: String;
var description: String;
var isComplete: Bool;
var createdTime: Int?;
var editedTime: Int?;
/// The parent relation is one side of a one-to-many database relation.
///
/// The parent relation will return the parent model that the supplied child references.
///
/// The opposite side of this relation is called `Children`.
///
/// final class Pet: Model {
/// var userID: UUID
/// ...
/// var user: Parent<Pet, User> {
/// return parent(\.userID)
/// }
/// }
///
/// final class User: Model {
/// var id: UUID?
/// ...
/// }
var owner: Parent<Item, User> {
return parent(\.ownerId);
}
init(){
ownerId = 0;
title = "";
description = "";
isComplete = false;
createdTime = 0;
editedTime = 0;
//createdTime = Date();
//editedTime = Date();
}
init(id: Int? = nil, titleString: String, descriptionString: String, completed : Bool, created: Int? = 0, edited: Int? = 0){
ownerId = 0;
title = titleString;
description = descriptionString;
isComplete = completed;
createdTime = created;
editedTime = edited;
}
func complete() -> Bool {
isComplete = true;
return isComplete;
}
/*func willUpdate(on conn: MySQLConnection) throws -> EventLoopFuture<Item> {
print("will update");
return Future.map(on: conn) { self }
}
func didUpdate(on conn: MySQLConnection) throws -> EventLoopFuture<Item> {
print("did update");
return Future.map(on: conn) { self }
}
func willCreate(on conn: MySQLConnection) throws -> EventLoopFuture<Item> {
print("will create");
return Future.map(on: conn) { self }
}*/
}
/// Allows `Todo` to be used as a dynamic migration.
extension Item: Migration {
static func prepare(on connection: MySQLConnection) -> Future<Void> {
return MySQLDatabase.create(self, on: connection) { builder in
try builder.field(for: \.id);
try builder.field(for: \.ownerId);
try builder.field(for: \.title);
try builder.field(for: \.description);
try builder.field(for: \.isComplete);
try builder.field(for: \.createdTime);
try builder.field(for: \.editedTime);
}
}
static func revert(on connection: MySQLConnection) -> Future<Void> {
return MySQLDatabase.delete(self, on: connection);
}
}
/// Allows `Todo` to be encoded to and decoded from HTTP messages.
extension Item: Content { }
/// Allows `Todo` to be used as a dynamic parameter in route definitions.
extension Item: Parameter { }
| 25.616 | 128 | 0.545909 |
c45f45db549340d639d05b7af6311cb6dda0d14b | 854 | h | C | GameServer/Source/TMonsterAI.h | sp3cialk/MU-S8EP2-Repack | 202856a74c905c203b9b2795fd161f564ca8b257 | [
"MIT"
] | 10 | 2019-04-09T23:36:43.000Z | 2022-02-10T19:20:52.000Z | GameServer/Source/TMonsterAI.h | microvn/mu-s8ep2-repack | 202856a74c905c203b9b2795fd161f564ca8b257 | [
"MIT"
] | 1 | 2019-09-25T17:12:36.000Z | 2019-09-25T17:12:36.000Z | GameServer/Source/TMonsterAI.h | microvn/mu-s8ep2-repack | 202856a74c905c203b9b2795fd161f564ca8b257 | [
"MIT"
] | 9 | 2019-09-25T17:12:57.000Z | 2021-08-18T01:21:25.000Z | // TMonsterAI.h: interface for the TMonsterAI class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_TMONSTERAI_H__0780F804_C72A_4667_BB23_25ECCA8C056A__INCLUDED_)
#define AFX_TMONSTERAI_H__0780F804_C72A_4667_BB23_25ECCA8C056A__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class TMonsterAI
{
public:
TMonsterAI();
virtual ~TMonsterAI();
static void MonsterMove(int iIndex);
static void MonsterMoveProc();
static void MonsterAIProc();
static BOOL RunAI(int iIndex, int iMonsterClass);
static BOOL UpdateCurrentAIUnit(int iIndex);
static void MonsterStateMsgProc(int iIndex);
static void ProcessStateMsg(LPOBJ lpObj, int iMsgCode, int iIndex, int aMsgSubCode);
private:
};
#endif // !defined(AFX_TMONSTERAI_H__0780F804_C72A_4667_BB23_25ECCA8C056A__INCLUDED_)
| 23.722222 | 86 | 0.728337 |
d2b2eaf73947650916b0e076a60b30e86501c691 | 308 | php | PHP | src/ExceptionUnrecognizedOperator.php | programster/package-query-builder-pgsql-driver | e0125507d7eed35c72318ea458ea69f397a857da | [
"MIT"
] | null | null | null | src/ExceptionUnrecognizedOperator.php | programster/package-query-builder-pgsql-driver | e0125507d7eed35c72318ea458ea69f397a857da | [
"MIT"
] | null | null | null | src/ExceptionUnrecognizedOperator.php | programster/package-query-builder-pgsql-driver | e0125507d7eed35c72318ea458ea69f397a857da | [
"MIT"
] | null | null | null | <?php
namespace Programster\QueryBuilderPgsqlDriver;
class ExceptionUnrecognizedOperator extends \Exception
{
public function __construct(string $operator)
{
parent::__construct("Unrecognized operator: {$operator}. Please check your JSON structure, or create an issue for this.");
}
}
| 23.692308 | 130 | 0.746753 |
2f4fc061a72241e1a4b52e075b1d3b4ba36bd677 | 5,817 | php | PHP | test/src/Fixtures/StatSnapshots/Base/StatsSnapshot.php | activecollab/databaseobject | 7cdcbf80fc9293fa808118ec34dcf7ead09afe05 | [
"MIT"
] | 1 | 2019-03-15T09:12:38.000Z | 2019-03-15T09:12:38.000Z | test/src/Fixtures/StatSnapshots/Base/StatsSnapshot.php | activecollab/databaseobject | 7cdcbf80fc9293fa808118ec34dcf7ead09afe05 | [
"MIT"
] | null | null | null | test/src/Fixtures/StatSnapshots/Base/StatsSnapshot.php | activecollab/databaseobject | 7cdcbf80fc9293fa808118ec34dcf7ead09afe05 | [
"MIT"
] | 2 | 2015-10-29T18:03:00.000Z | 2019-10-24T08:00:17.000Z | <?php
/*
* This file is part of the Active Collab DatabaseObject project.
*
* (c) A51 doo <info@activecollab.com>. All rights reserved.
*/
namespace ActiveCollab\DatabaseObject\Test\Fixtures\StatSnapshots\Base;
use ActiveCollab\DatabaseConnection\Record\ValueCaster;
use ActiveCollab\DatabaseConnection\Record\ValueCasterInterface;
use ActiveCollab\DatabaseObject\Entity\Entity;
use ActiveCollab\DatabaseObject\ValidatorInterface;
/**
* @package ActiveCollab\DatabaseObject\Test\Fixtures\StatSnapshots\Base
*/
abstract class StatsSnapshot extends Entity
{
/**
* Name of the table where records are stored.
*
* @var string
*/
protected $table_name = 'stats_snapshots';
/**
* Table fields that are managed by this entity.
*
* @var array
*/
protected $fields = ['id', 'account_id', 'day', 'stats'];
/**
* Generated fields that are loaded, but not managed by the entity.
*
* @var array
*/
protected $generated_fields = ['is_used_on_day', 'plan_name', 'number_of_users'];
/**
* List of default field values.
*
* @var array
*/
protected $default_field_values = [];
/**
* {@inheritdoc}
*/
protected function configure()
{
$this->setGeneratedFieldsValueCaster(new ValueCaster([
'is_used_on_day' => ValueCasterInterface::CAST_BOOL,
'plan_name' => ValueCasterInterface::CAST_STRING,
'number_of_users' => ValueCasterInterface::CAST_INT,
]));
}
/**
* Return value of account_id field.
*
* @return int
*/
public function getAccountId()
{
return $this->getFieldValue('account_id');
}
/**
* Set value of account_id field.
*
* @param int $value
* @return $this
*/
public function &setAccountId($value)
{
$this->setFieldValue('account_id', $value);
return $this;
}
/**
* Return value of day field.
*
* @return \ActiveCollab\DateValue\DateValueInterface|null
*/
public function getDay()
{
return $this->getFieldValue('day');
}
/**
* Set value of day field.
*
* @param \ActiveCollab\DateValue\DateValueInterface|null $value
* @return $this
*/
public function &setDay($value)
{
$this->setFieldValue('day', $value);
return $this;
}
/**
* Return value of is_used_on_day field.
*
* @return bool
*/
public function isUsedOnDay()
{
return $this->getFieldValue('is_used_on_day');
}
/**
* Return value of is_used_on_day field.
*
* @return bool
* @deprecated use isUsedOnDay()
*/
public function getIsUsedOnDay()
{
return $this->getFieldValue('is_used_on_day');
}
/**
* Return value of plan_name field.
*
* @return string
*/
public function getPlanName()
{
return $this->getFieldValue('plan_name');
}
/**
* Return value of number_of_users field.
*
* @return int
*/
public function getNumberOfUsers()
{
return $this->getFieldValue('number_of_users');
}
/**
* Return value of stats field.
*
* @return mixed
*/
public function getStats()
{
return $this->getFieldValue('stats');
}
/**
* Set value of stats field.
*
* @param mixed $value
* @return $this
*/
public function &setStats($value)
{
$this->setFieldValue('stats', $value);
return $this;
}
/**
* {@inheritdoc}
*/
public function getFieldValue($field, $default = null)
{
$value = parent::getFieldValue($field, $default);
if ($value === null) {
return null;
} else {
switch ($field) {
case 'stats':
return json_decode($value, true);
}
return $value;
}
}
/**
* {@inheritdoc}
*/
public function &setFieldValue($name, $value)
{
if ($value === null) {
parent::setFieldValue($name, null);
} else {
switch ($name) {
case 'id':
case 'account_id':
return parent::setFieldValue($name, (int) $value);
case 'day':
return parent::setFieldValue($name, $this->getDateTimeValueInstanceFrom($value));
case 'stats':
return parent::setFieldValue($name, $this->isLoading() ? $value : json_encode($value));
default:
if ($this->isLoading()) {
return parent::setFieldValue($name, $value);
} else {
if ($this->isGeneratedField($name)) {
throw new \LogicException("Generated field $name cannot be set by directly assigning a value");
} else {
throw new \InvalidArgumentException("Field $name does not exist in this table");
}
}
}
}
return $this;
}
/**
* {@inheritdoc}
*/
public function jsonSerialize()
{
return array_merge(parent::jsonSerialize(), [
'account_id' => $this->getAccountId(),
'day' => $this->getDay(),
'is_used_on_day' => $this->getIsUsedOnDay(),
'stats' => $this->getStats(),
]);
}
/**
* {@inheritdoc}
*/
public function validate(ValidatorInterface &$validator)
{
$validator->present('day');
$validator->present('account_id');
parent::validate($validator);
}
}
| 23.646341 | 123 | 0.536015 |
dfec1a1319a7be5839625cab1580cbc8bdd06a5e | 23,413 | tsx | TypeScript | client/src/core/components/FInput.tsx | cakeslice/flawk.js | dc29206525fee7b4085e42c98e0487bc0224d0b2 | [
"MIT"
] | null | null | null | client/src/core/components/FInput.tsx | cakeslice/flawk.js | dc29206525fee7b4085e42c98e0487bc0224d0b2 | [
"MIT"
] | null | null | null | client/src/core/components/FInput.tsx | cakeslice/flawk.js | dc29206525fee7b4085e42c98e0487bc0224d0b2 | [
"MIT"
] | null | null | null | /*
* Copyright (c) 2020 José Guerreiro. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import TrackedComponent from 'core/components/TrackedComponent'
import config from 'core/config'
import styles from 'core/styles'
import { format } from 'date-fns'
import { FormIKStruct, GlamorProps, Obj } from 'flawk-types'
import { FieldInputProps, FormikProps } from 'formik'
import { css, StyleAttribute } from 'glamor'
import React, { LegacyRef, Suspense } from 'react'
import MediaQuery from 'react-responsive'
import TextareaAutosize, { TextareaAutosizeProps } from 'react-textarea-autosize'
import './FInput.scss'
const invalidTextStyle = {
letterSpacing: 0,
fontSize: styles.invalidFontSize,
fontWeight: styles.invalidFontWeight,
color: styles.colors.red,
}
const Datetime = React.lazy(() => import('react-datetime'))
const InputMask = React.lazy(() => import('react-input-mask'))
const MaskedInput = (
props: {
formatChars?: Record<number, string>
mask: string | (string | RegExp)[]
placeholder?: string
autoFocus?: boolean
disabled?: boolean
required?: boolean
inputStyle: StyleAttribute
value?: string | number | undefined
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void
} & { inputRef: LegacyRef<HTMLInputElement> } & React.DetailedHTMLProps<
React.InputHTMLAttributes<HTMLInputElement>,
HTMLInputElement
>
) => (
<Suspense fallback={<></>}>
<InputMask
maskChar={'-'}
formatChars={props.formatChars}
mask={props.mask}
placeholder={props.placeholder}
value={props.value}
onChange={props.onChange}
autoFocus={props.autoFocus}
disabled={props.disabled}
>
{(
inputProps: React.DetailedHTMLProps<
React.InputHTMLAttributes<HTMLInputElement>,
HTMLInputElement
>
) => (
<input
ref={props.inputRef}
{...inputProps}
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
{...props.inputStyle}
autoFocus={props.autoFocus}
disabled={props.disabled}
required={props.required}
/>
)}
</InputMask>
</Suspense>
)
const TextAreaAuto = (
props: { inputRef: LegacyRef<HTMLTextAreaElement> } & TextareaAutosizeProps &
React.RefAttributes<HTMLTextAreaElement>
) => {
const { inputRef, ...other } = props
// @ts-ignore
return <TextareaAutosize ref={inputRef} minRows={2} maxRows={10} {...other}></TextareaAutosize>
}
const TextArea = (
props: { inputRef: LegacyRef<HTMLTextAreaElement> } & React.DetailedHTMLProps<
React.TextareaHTMLAttributes<HTMLTextAreaElement>,
HTMLTextAreaElement
>
) => {
const { inputRef, ...other } = props
return <textarea ref={inputRef} {...other}></textarea>
}
const Input = (
props: { inputRef: LegacyRef<HTMLInputElement> } & React.DetailedHTMLProps<
React.InputHTMLAttributes<HTMLInputElement>,
HTMLInputElement
>
) => {
const { inputRef, ...other } = props
return <input ref={inputRef} {...other}></input>
}
const DatePicker = (
props: {
foreground?: boolean
utc?: boolean
locale?: string
value?: string
onChange?: (value: string) => void
onBlur?: (event: React.FocusEvent<HTMLInputElement, Element>) => void
onFocus?: (event: React.FocusEvent<HTMLInputElement, Element>) => void
onKeyPress?: (event: React.KeyboardEvent<HTMLInputElement>) => void
isControlled?: boolean
isDisabled?: boolean
name?: string
placeholder?: string
required?: boolean
width?: number
inputStyle: StyleAttribute
} & { inputRef: LegacyRef<HTMLInputElement> }
) => (
<Suspense fallback={<></>}>
<Datetime
renderView={(mode, renderDefault) => {
if (mode === 'time') return <div>NOT IMPLEMENTED</div>
return (
<div
style={{
animation: 'openDown 0.2s ease-in-out',
color: styles.colors.black,
...(props.foreground && { position: 'fixed' }),
}}
className={
'rdtPickerCustom ' +
(global.nightMode ? 'rdtPickerNight' : 'rdtPickerDay')
}
>
{renderDefault()}
</div>
)
}}
//
closeOnSelect={true}
utc={props.utc}
locale={global.lang.moment}
timeFormat={false}
value={
props.value && props.value.includes && props.value.includes('T')
? new Date(props.value)
: props.value
}
// @ts-ignore
onChange={props.onChange}
renderInput={(p) => {
return (
<input
ref={props.inputRef}
{...props.inputStyle}
{...p}
value={props.value || !props.isControlled ? p.value : ''}
/>
)
}}
inputProps={{
disabled: props.isDisabled,
name: props.name,
required: props.required,
onBlur: props.onBlur,
onKeyPress: props.onKeyPress,
onFocus: props.onFocus,
placeholder: props.placeholder,
}}
/>
</Suspense>
)
type Props = {
style?: React.CSSProperties & GlamorProps
appearance?: string
center?: boolean
invalidType?: 'bottom' | 'label' | 'right'
label?: React.ReactNode
labelStyle?: React.CSSProperties
emptyLabel?: boolean
/**
* @deprecated Use leftChild/rightChild instead
*/
icon?: React.ReactNode
leftChild?: React.ReactNode
rightChild?: React.ReactNode
//
defaultValue?: number | string
autoFocus?: boolean
autoComplete?: string
placeholder?: string
required?: boolean | string
simpleDisabled?: boolean
bufferedInput?: boolean
bufferInterval?: number
type?: React.HTMLInputTypeAttribute
//
datePicker?: boolean
foreground?: boolean
//
field?: FieldInputProps<Obj>
form?: FormikProps<Obj>
onClick?: (event: React.MouseEvent<HTMLInputElement | HTMLTextAreaElement, MouseEvent>) => void
onChange?: (value: string | number | undefined) => void
onChangeNoBuffer?: (value: string | number | undefined) => void
onBlur?: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement, Element>) => void
onFocus?: (event: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement, Element>) => void
onKeyPress?: (event: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void
//
eventOverride?: 'focus' | 'hover'
} & (
| {
textArea?: boolean
textAreaFixed?: undefined
minRows?: undefined
maxRows?: undefined
}
| {
textArea: true
textAreaFixed?: boolean
minRows?: number
maxRows?: number
}
) &
(
| {
mask: string | (string | RegExp)[]
timeInput?: undefined
formatChars?: Record<number, string>
}
| {
mask?: undefined
timeInput: boolean
formatChars?: undefined
}
| {
mask?: undefined
timeInput?: undefined
formatChars?: undefined
}
) &
(
| {
value?: undefined
isControlled?: undefined
}
| {
value: number | string
isControlled: boolean
}
) &
(
| {
name: string
invalid?: string
isDisabled?: undefined
}
| {
name?: string
invalid?: undefined
isDisabled?: boolean
}
)
export default class FInput extends TrackedComponent<Props> {
trackedName = 'FInput'
shouldComponentUpdate(nextProps: Props, nextState: typeof this.state) {
super.shouldComponentUpdate(nextProps, nextState, false)
return this.deepEqualityCheck(nextProps, nextState)
}
constructor(props: Props) {
super(props)
this.setInputRef = this.setInputRef.bind(this)
}
internalValue: string | number | undefined = undefined
inputRef: HTMLElement | null = null
setInputRef(instance: HTMLElement | null) {
this.inputRef = instance
}
timer: ReturnType<typeof setTimeout> | undefined = undefined
bufferedValue: string | number | undefined = undefined
handleChangeBuffered = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
this.bufferedValue =
this.props.type === 'number'
? e.target.value === ''
? undefined
: Number(e.target.value)
: e.target.value === ''
? undefined
: e.target.value
if (this.timer) clearTimeout(this.timer)
this.timer = setTimeout(this.triggerChange, this.props.bufferInterval || 500)
}
handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => {
if (e.key === 'Enter') {
if (this.timer) clearTimeout(this.timer)
this.triggerChange()
}
}
triggerChange = () => {
this.props.onChange && this.props.onChange(this.bufferedValue)
}
componentWillUnmount() {
if (this.timer) clearTimeout(this.timer)
}
render() {
let formIK: FormIKStruct | undefined
if (this.props.field && this.props.form) {
const field = this.props.field
const form = this.props.form
const meta = form.getFieldMeta(field.name)
formIK = {
name: field.name,
value: meta.value,
error: meta.error,
touch: meta.touched,
setFieldValue: form.setFieldValue,
setFieldTouched: form.setFieldTouched,
handleBlur: form.handleBlur,
submitCount: form.submitCount,
changed: meta.value !== meta.initialValue, // TODO: Could be useful!
}
}
const name = (formIK && formIK.name) || this.props.name
const value = formIK ? (formIK.value as string | number | undefined) : this.props.value
const invalid =
formIK && (formIK.touch || formIK.submitCount > 0) ? formIK.error : this.props.invalid
//
const controlled = this.props.isControlled || formIK
let mainStyle: React.CSSProperties & GlamorProps = {
fontSize: styles.defaultFontSize,
fontFamily: styles.font,
textAlign: this.props.center ? 'center' : 'left',
fontWeight: styles.inputFontWeight || undefined,
borderRadius: styles.inputBorder === 'bottom' ? 0 : styles.defaultBorderRadius,
borderTopLeftRadius: styles.defaultBorderRadius,
borderTopRightRadius: styles.defaultBorderRadius,
...(this.props.textArea && {
borderRadius:
styles.defaultBorderRadius && styles.defaultBorderRadius <= 6
? styles.defaultBorderRadius
: 6,
borderTopLeftRadius:
styles.defaultBorderRadius && styles.defaultBorderRadius <= 6
? styles.defaultBorderRadius
: 6,
borderTopRightRadius:
styles.defaultBorderRadius && styles.defaultBorderRadius <= 6
? styles.defaultBorderRadius
: 6,
}),
borderTopStyle: styles.inputBorder === 'full' ? 'solid' : 'none',
borderBottomStyle:
styles.inputBorder === 'full' || styles.inputBorder === 'bottom' ? 'solid' : 'none',
borderLeftStyle: styles.inputBorder === 'full' ? 'solid' : 'none',
borderRightStyle: styles.inputBorder === 'full' ? 'solid' : 'none',
borderWidth: '1px',
boxSizing: 'border-box',
minHeight: styles.inputHeight,
minWidth: 66,
padding: this.props.textArea ? 10 : undefined,
margin: 0,
paddingLeft: this.props.center ? undefined : styles.inputPaddingLeft,
whiteSpace: this.props.textArea ? undefined : 'nowrap',
textOverflow: this.props.textArea ? undefined : 'ellipsis',
justifyContent: 'center',
alignItems: 'center',
display: 'flex',
color: styles.colors.black,
borderColor: styles.colors.borderColor,
opacity: 1,
'::placeholder': {
userSelect: 'none',
fontWeight: 400,
color: config.replaceAlpha(styles.colors.black, global.nightMode ? 0.25 : 0.5),
opacity: 1,
},
':hover': {
...(styles.inputBorder === 'bottom' && {
borderRadius: styles.defaultBorderRadius,
}),
borderColor: config.replaceAlpha(styles.colors.black, global.nightMode ? 0.3 : 0.3),
},
':focus': {
...(styles.inputBorder === 'bottom' && {
borderRadius: styles.defaultBorderRadius,
}),
outline: 'none',
boxShadow: styles.inputBoxShadow
? '0 0 0 2px ' + styles.colors.mainVeryLight
: undefined,
borderColor: styles.colors.mainLight,
},
background: styles.inputBackground || styles.colors.white,
transition:
'background 200ms, border-color 200ms, box-shadow 200ms, border-radius 200ms',
}
styles.inputAppearances &&
styles.inputAppearances().forEach((b) => {
if (this.props.appearance === b.name)
mainStyle = {
...mainStyle,
...b,
'::placeholder': {
...mainStyle['::placeholder'],
...b['::placeholder'],
},
':hover': {
...mainStyle[':hover'],
...b[':hover'],
},
':focus': {
...mainStyle[':focus'],
...b[':focus'],
},
}
})
let finalStyle: React.CSSProperties & GlamorProps = mainStyle
if (this.props.style)
finalStyle = {
...finalStyle,
...this.props.style,
'::placeholder': {
...mainStyle['::placeholder'],
...(this.props.style && this.props.style['::placeholder']),
},
':hover': {
...mainStyle[':hover'],
...(this.props.style && this.props.style[':hover']),
},
':focus': {
...mainStyle[':focus'],
...(this.props.style && this.props.style[':focus']),
},
}
finalStyle = {
...finalStyle,
...(invalid && {
boxShadow: styles.inputBoxShadow
? '0 0 0 2px ' + config.replaceAlpha(styles.colors.red, 0.2)
: undefined,
borderColor: config.replaceAlpha(
styles.colors.red,
global.nightMode ? styles.inputBorderFactorNight : styles.inputBorderFactorDay
),
...(styles.inputBorder === 'bottom' && {
borderRadius: styles.defaultBorderRadius,
}),
':hover': {
borderColor: styles.colors.red,
},
':focus': {
...finalStyle[':focus'],
borderColor: styles.colors.red,
...(styles.inputBoxShadow && {
boxShadow: '0 0 0 2px ' + config.replaceAlpha(styles.colors.red, 0.2),
}),
},
}),
}
finalStyle = {
...finalStyle,
...(this.props.isDisabled &&
!this.props.simpleDisabled && {
background: config.overlayColor(
styles.inputBackground || styles.colors.white,
config.replaceAlpha(styles.colors.black, global.nightMode ? 0.1 : 0.1)
),
color: config.replaceAlpha(styles.colors.black, global.nightMode ? 0.5 : 0.5),
'::placeholder': {
...finalStyle['::placeholder'],
color: config.replaceAlpha(
styles.colors.black,
global.nightMode ? 0.5 : 0.5
),
},
borderColor: config.replaceAlpha(
styles.colors.black,
global.nightMode ? 0.1 : 0.1
),
...(styles.inputBorder === 'bottom' && {
borderRadius: styles.defaultBorderRadius,
}),
opacity: 0.75,
}),
...(this.props.isDisabled && {
cursor: 'default',
':hover': {},
':focus': {},
}),
}
const label = this.props.label || (this.props.emptyLabel ? '\u200c' : undefined)
const invalidType = this.props.invalidType || 'label'
const placeholder = this.props.datePicker
? !value && new Date().toLocaleDateString(global.lang.date)
: this.props.timeInput
? !value && format(new Date(), 'HH:mm')
: undefined
const defaultWidth = (desktop: boolean) => {
return desktop ? 175 : '100%'
}
//
const commonProps = {
inputRef: this.setInputRef,
defaultValue: this.props.defaultValue,
autoFocus: this.props.autoFocus,
required: this.props.required ? true : false,
name: name,
autoComplete: this.props.autoComplete,
type: this.props.type ? this.props.type : 'text',
disabled: this.props.isDisabled,
placeholder: this.props.placeholder || placeholder || '',
}
const inputEventProps = {
onFocus: (e: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement, Element>) => {
e.target.placeholder = ''
this.props.onFocus && this.props.onFocus(e)
},
onKeyPress: (e: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => {
this.props.bufferedInput
? this.handleKeyDown(e)
: this.props.onKeyPress && this.props.onKeyPress(e)
if (!this.props.textArea && e.key === 'Enter') {
if (e.target instanceof HTMLElement) {
e.target.blur()
}
}
},
onBlur: (e: React.FocusEvent<HTMLInputElement | HTMLTextAreaElement, Element>) => {
e.target.placeholder = placeholder || this.props.placeholder || ''
this.props.onBlur && this.props.onBlur(e)
formIK && formIK.handleBlur && formIK.handleBlur(e)
},
}
const valueProps = {
value: controlled ? (value === undefined ? '' : value) : undefined,
onChange: (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
const v =
this.props.type === 'number'
? e.target.value === ''
? undefined
: Number(e.target.value)
: e.target.value === ''
? undefined
: e.target.value
this.internalValue = v
if (formIK && name && formIK.setFieldValue) formIK.setFieldValue(name, v)
if (this.props.bufferedInput && !formIK) {
if (this.props.onChangeNoBuffer) this.props.onChangeNoBuffer(v)
this.handleChangeBuffered(e)
} else {
this.props.onChange && this.props.onChange(v)
}
},
}
type DatePickerValue = (string & (string | number | readonly string[])) | undefined
const datePickerValueProps = {
isControlled: controlled ? true : false,
value: controlled ? (value === undefined ? '' : (value as DatePickerValue)) : undefined,
onChange: (e: string) => {
const v = e === '' ? undefined : e
this.internalValue = v
if (formIK && name && formIK.setFieldValue) formIK.setFieldValue(name, v)
this.props.onChange && this.props.onChange(v)
},
}
if (this.props.eventOverride)
// @ts-ignore
finalStyle = { ...finalStyle, ...finalStyle[':' + this.props.eventOverride] }
const cssDesktop = css({
...finalStyle,
width: finalStyle.width || defaultWidth(true),
...(this.props.textArea &&
!this.props.textAreaFixed && {
height: 'auto',
}),
})
const cssMobile = css({
...finalStyle,
width: finalStyle.width || defaultWidth(false),
...(this.props.textArea && {
height: 'auto',
resize: 'vertical',
}),
})
const inputStyleDesktop = css({
'::placeholder': finalStyle['::placeholder'],
width: '100%',
...(this.props.textArea
? {
minHeight: finalStyle.minHeight,
height: finalStyle.height,
resize: 'vertical',
}
: {
height: '100%',
}),
textAlign: 'inherit',
})
const inputStyleMobile = css({
'::placeholder': finalStyle['::placeholder'],
width: '100%',
...(this.props.textArea
? {
minHeight: finalStyle.minHeight,
height: finalStyle.height,
resize: 'vertical',
}
: {
height: '100%',
}),
textAlign: 'inherit',
})
return (
<MediaQuery minWidth={config.mobileWidthTrigger}>
{(desktop) => {
const cssStyle = desktop ? cssDesktop : cssMobile
const inputStyle = desktop ? inputStyleDesktop : inputStyleMobile
return (
<div
data-nosnippet
style={{
width: finalStyle.width || defaultWidth(desktop),
maxWidth: finalStyle.maxWidth,
flexGrow: finalStyle.flexGrow,
}}
>
{label && (
<div
style={{
display: 'flex',
justifyContent: 'space-between',
letterSpacing: 0.4,
textAlign:
typeof label === 'string' && label.length === 1
? 'end'
: undefined,
// @ts-ignore
fontSize: styles.defaultFontSize,
whiteSpace: 'nowrap',
...styles.inputLabelStyle,
...this.props.labelStyle,
opacity: 1,
}}
>
<label
htmlFor={name}
style={{
opacity: global.nightMode
? styles.inputLabelOpacityNight
: styles.inputLabelOpacityDay,
...(styles.inputLabelStyle &&
styles.inputLabelStyle.opacity && {
opacity: styles.inputLabelStyle.opacity,
}),
...(this.props.labelStyle &&
this.props.labelStyle.opacity && {
opacity: this.props.labelStyle.opacity,
}),
...(this.props.labelStyle &&
this.props.labelStyle.width && {
width: this.props.labelStyle.width,
}),
...(this.props.labelStyle &&
this.props.labelStyle.height && {
height: this.props.labelStyle.height,
}),
}}
>
{label}
</label>
{invalidType === 'label' &&
name &&
invalid &&
invalid.length > 0 && (
<span
style={{
marginLeft: 7.5,
...invalidTextStyle,
}}
>
{invalid}
</span>
)}
</div>
)}
{label && <div style={{ minHeight: 5 }}></div>}
<div style={{ display: 'flex', alignItems: 'center' }}>
<div
onClick={() => {
this.inputRef?.focus()
}}
{...cssStyle}
>
{this.props.leftChild}
{this.props.datePicker ? (
<DatePicker
{...commonProps}
{...datePickerValueProps}
{...inputEventProps}
foreground={this.props.foreground}
inputStyle={inputStyle}
/>
) : this.props.textArea ? (
this.props.textAreaFixed ? (
<TextArea
{...commonProps}
{...valueProps}
{...inputEventProps}
{...inputStyle}
/>
) : (
<TextAreaAuto
{...commonProps}
{...valueProps}
{...inputEventProps}
{...inputStyle}
minRows={this.props.minRows}
maxRows={this.props.maxRows}
/>
)
) : !this.props.mask && !this.props.timeInput ? (
<Input
{...commonProps}
{...valueProps}
{...inputEventProps}
{...inputStyle}
/>
) : (
<MaskedInput
{...commonProps}
{...valueProps}
{...inputEventProps}
inputStyle={inputStyle}
{...(this.props.mask
? {
mask: this.props.mask,
formatChars: this.props.formatChars,
}
: {
mask:
value && (value as string)[0] === '2'
? '23:59'
: '29:59',
formatChars: {
9: '[0-9]',
3: '[0-3]',
5: '[0-5]',
2: '[0-2]',
},
})}
/>
)}
{this.props.icon && (
<div
style={{
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
width: 40,
}}
>
{this.props.icon}
</div>
)}
{this.props.rightChild}
</div>
{invalidType === 'right' && name && (
<div style={{ minWidth: 16, display: 'flex' }}>
{!this.props.isDisabled &&
invalid &&
invalid.length > 0 && (
<div style={{ minWidth: 7.5 }}></div>
)}
{!this.props.isDisabled &&
invalid &&
invalid.length > 0 && (
<p style={invalidTextStyle}>{invalid}</p>
)}
</div>
)}
</div>
{invalidType === 'bottom' && name && (
<div style={{ minHeight: 26 }}>
{!this.props.isDisabled && invalid && invalid.length > 0 && (
<div style={{ minHeight: 5 }}></div>
)}
{!this.props.isDisabled && invalid && invalid.length > 0 && (
<p style={invalidTextStyle}>{invalid}</p>
)}
</div>
)}
</div>
)
}}
</MediaQuery>
)
}
}
| 27.674941 | 96 | 0.59783 |
810afef4f529224fac1df2091573646701493152 | 7,935 | rs | Rust | rg3d-core/src/lib.rs | martin-t/Fyrox | 90309500ee40b1e0eb492f3ad20e0f4c363b9f55 | [
"MIT"
] | null | null | null | rg3d-core/src/lib.rs | martin-t/Fyrox | 90309500ee40b1e0eb492f3ad20e0f4c363b9f55 | [
"MIT"
] | 1 | 2021-12-07T22:38:40.000Z | 2021-12-07T22:38:40.000Z | rg3d-core/src/lib.rs | martin-t/Fyrox | 90309500ee40b1e0eb492f3ad20e0f4c363b9f55 | [
"MIT"
] | null | null | null | //! Core data structures and algorithms used throughout rg3d.
//!
//! Some of them can be useful separately outside the engine.
#![allow(clippy::upper_case_acronyms)]
#![allow(clippy::from_over_into)]
#[macro_use]
extern crate memoffset;
#[macro_use]
extern crate lazy_static;
pub use arrayvec;
pub use byteorder;
pub use nalgebra as algebra;
pub use num_traits;
pub use parking_lot;
pub use rand;
pub use uuid;
use crate::visitor::{Visit, VisitResult, Visitor};
use fxhash::FxHashMap;
use std::{
borrow::Borrow,
hash::Hash,
path::{Path, PathBuf},
};
pub mod color;
pub mod color_gradient;
pub mod curve;
pub mod inspect;
pub mod io;
pub mod math;
pub mod numeric_range;
pub mod octree;
pub mod pool;
pub mod profiler;
pub mod quadtree;
pub mod rectpack;
pub mod sparse;
pub mod sstorage;
pub mod visitor;
pub use futures;
pub use instant;
#[cfg(target_arch = "wasm32")]
pub use js_sys;
use std::iter::FromIterator;
#[cfg(target_arch = "wasm32")]
pub use wasm_bindgen;
#[cfg(target_arch = "wasm32")]
pub use wasm_bindgen_futures;
#[cfg(target_arch = "wasm32")]
pub use web_sys;
/// Defines as_(variant), as_mut_(variant) and is_(variant) methods.
#[macro_export]
macro_rules! define_is_as {
($typ:tt : $kind:ident -> ref $result:ty => fn $is:ident, fn $as_ref:ident, fn $as_mut:ident) => {
/// Returns true if node is instance of given type.
pub fn $is(&self) -> bool {
match self {
$typ::$kind(_) => true,
_ => false,
}
}
/// Tries to cast shared reference to a node to given type, panics if
/// cast is not possible.
pub fn $as_ref(&self) -> &$result {
match self {
$typ::$kind(ref val) => val,
_ => panic!("Cast to {} failed!", stringify!($kind)),
}
}
/// Tries to cast mutable reference to a node to given type, panics if
/// cast is not possible.
pub fn $as_mut(&mut self) -> &mut $result {
match self {
$typ::$kind(ref mut val) => val,
_ => panic!("Cast to {} failed!", stringify!($kind)),
}
}
};
}
/// Utility function that replaces back slashes \ to forward /
/// It replaces slashes only on windows!
pub fn replace_slashes<P: AsRef<Path>>(path: P) -> PathBuf {
#[cfg(target_os = "windows")]
{
if path.as_ref().is_absolute() {
// Absolute Windows paths are incompatible with other operating systems so
// don't bother here and return existing path as owned.
path.as_ref().to_owned()
} else {
// Replace all \ to /. This is needed because on macos or linux \ is a valid symbol in
// file name, and not separator (except linux which understand both variants).
let mut os_str = std::ffi::OsString::new();
let count = path.as_ref().components().count();
for (i, component) in path.as_ref().components().enumerate() {
os_str.push(component.as_os_str());
if i != count - 1 {
os_str.push("/");
}
}
PathBuf::from(os_str)
}
}
#[cfg(not(target_os = "windows"))]
{
path.as_ref().to_owned()
}
}
#[derive(Clone, Debug)]
pub struct BiDirHashMap<K, V> {
forward_map: FxHashMap<K, V>,
backward_map: FxHashMap<V, K>,
}
impl<K: Hash + Eq + Clone, V: Hash + Eq + Clone> BiDirHashMap<K, V> {
pub fn insert(&mut self, key: K, value: V) -> Option<V> {
let existing = self.forward_map.insert(key.clone(), value.clone());
self.backward_map.insert(value, key);
existing
}
pub fn remove_by_key(&mut self, key: &K) -> Option<V> {
if let Some(value) = self.forward_map.remove(key) {
self.backward_map.remove(&value);
Some(value)
} else {
None
}
}
pub fn contains_key<Q: ?Sized>(&self, key: &Q) -> bool
where
K: Borrow<Q>,
Q: Hash + Eq,
{
self.forward_map.contains_key(key)
}
pub fn remove_by_value(&mut self, value: &V) -> Option<K> {
if let Some(key) = self.backward_map.remove(value) {
self.forward_map.remove(&key);
Some(key)
} else {
None
}
}
pub fn contains_value<Q: ?Sized>(&self, value: &Q) -> bool
where
V: Borrow<Q>,
Q: Hash + Eq,
{
self.backward_map.contains_key(value)
}
pub fn value_of(&self, node: &K) -> Option<&V> {
self.forward_map.get(node)
}
pub fn key_of(&self, value: &V) -> Option<&K> {
self.backward_map.get(value)
}
pub fn len(&self) -> usize {
self.forward_map.len()
}
pub fn is_empty(&self) -> bool {
self.forward_map.is_empty()
}
pub fn clear(&mut self) {
self.forward_map.clear();
self.backward_map.clear();
}
pub fn forward_map(&self) -> &FxHashMap<K, V> {
&self.forward_map
}
pub fn backward_map(&self) -> &FxHashMap<V, K> {
&self.backward_map
}
pub fn into_inner(self) -> (FxHashMap<K, V>, FxHashMap<V, K>) {
(self.forward_map, self.backward_map)
}
}
impl<K, V> Default for BiDirHashMap<K, V> {
fn default() -> Self {
Self {
forward_map: Default::default(),
backward_map: Default::default(),
}
}
}
impl<K: Hash + Eq + Clone, V: Hash + Eq + Clone> From<FxHashMap<K, V>> for BiDirHashMap<K, V> {
fn from(forward_map: FxHashMap<K, V>) -> Self {
let mut backward_map = FxHashMap::default();
for (k, v) in forward_map.iter() {
backward_map.insert(v.clone(), k.clone());
}
Self {
forward_map,
backward_map,
}
}
}
impl<K, V> Visit for BiDirHashMap<K, V>
where
K: Hash + Eq + Clone + Default + Visit,
V: Hash + Eq + Clone + Default + Visit,
{
fn visit(&mut self, name: &str, visitor: &mut Visitor) -> VisitResult {
visitor.enter_region(name)?;
self.forward_map.visit("ForwardMap", visitor)?;
self.backward_map.visit("BackwardMap", visitor)?;
visitor.leave_region()
}
}
impl<K, V> FromIterator<(K, V)> for BiDirHashMap<K, V>
where
K: Hash + Eq + Clone,
V: Hash + Eq + Clone,
{
fn from_iter<T: IntoIterator<Item = (K, V)>>(iter: T) -> Self {
let mut hm = Self::default();
for (k, v) in iter {
hm.forward_map.insert(k.clone(), v.clone());
hm.backward_map.insert(v, k);
}
hm
}
}
pub trait VecExtensions<T> {
/// Retains only the elements specified by the predicate.
///
/// In other words, remove all elements `e` such that `f(&mut e)` returns `false`.
/// This method operates in place, visiting each element exactly once in the
/// original order, and preserves the order of the retained elements.
///
/// # Notes
///
/// This method is the copy of `retain` method of Vec, but with ability to
/// modify each element.
fn retain_mut<F>(&mut self, f: F)
where
F: FnMut(&mut T) -> bool;
}
impl<T> VecExtensions<T> for Vec<T> {
fn retain_mut<F>(&mut self, mut f: F)
where
F: FnMut(&mut T) -> bool,
{
let len = self.len();
let mut del = 0;
{
let v = &mut **self;
for i in 0..len {
if !f(&mut v[i]) {
del += 1;
} else if del > 0 {
v.swap(i - del, i);
}
}
}
if del > 0 {
self.truncate(len - del);
}
}
}
#[inline]
pub fn hash_combine(lhs: u64, rhs: u64) -> u64 {
lhs ^ (rhs
.wrapping_add(0x9e3779b9)
.wrapping_add(lhs << 6)
.wrapping_add(lhs >> 2))
}
| 26.45 | 102 | 0.552237 |
7519df554059d261b9b71a1cae32f12bd3ecfdc9 | 261 | h | C | gotoVC/Router/PageClassManager.h | suifengqjn/gotoVC | b5019b98f01c947908dd54ad543f42f72793f6c6 | [
"Apache-2.0"
] | null | null | null | gotoVC/Router/PageClassManager.h | suifengqjn/gotoVC | b5019b98f01c947908dd54ad543f42f72793f6c6 | [
"Apache-2.0"
] | null | null | null | gotoVC/Router/PageClassManager.h | suifengqjn/gotoVC | b5019b98f01c947908dd54ad543f42f72793f6c6 | [
"Apache-2.0"
] | null | null | null | //
// PageClassManager.h
// gotoVC
//
// Created by qianjn on 2016/12/18.
// Copyright © 2016年 SF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface PageClassManager : NSObject
+ (Class)classWithPageName:(NSString *)pageName;
@end
| 13.736842 | 48 | 0.697318 |
eb0c1897096bef9301c46ff97b11846ca7b5fd4c | 2,135 | rs | Rust | examples/xlib_window.rs | atkurtul/vk-rs | e6ba04fe3d5987bada288fad3f5a08d732f74cf1 | [
"MIT"
] | 2 | 2020-07-25T19:54:47.000Z | 2020-07-26T23:56:53.000Z | examples/xlib_window.rs | atkurtul/vk-rs | e6ba04fe3d5987bada288fad3f5a08d732f74cf1 | [
"MIT"
] | null | null | null | examples/xlib_window.rs | atkurtul/vk-rs | e6ba04fe3d5987bada288fad3f5a08d732f74cf1 | [
"MIT"
] | null | null | null | #![cfg(feature="xlib")]
#![allow(non_upper_case_globals)]
extern crate x11;
extern crate vk_rs;
use vk_rs::*;
#[derive(Copy, Clone)]
pub struct Window {
pub display : u64,
pub window : u64,
pub surface : vk::SurfaceKHR,
pub size : vk::Extent2D,
}
impl Window {
pub unsafe fn new(width : u32, height : u32) -> Window {
use x11::*;
let display = xlib::XOpenDisplay(std::ptr::null());
let screen = xlib::XDefaultScreen(display);
let root = xlib::XRootWindow(display, screen);
let mut attributes: xlib::XSetWindowAttributes = std::mem::uninitialized();
attributes.background_pixel = xlib::XWhitePixel(display, screen);
let window = xlib::XCreateWindow(display, root,
0, 0, width, height,
0, 0,
xlib::InputOutput as _, std::ptr::null_mut(),
xlib::CWBackPixel, &mut attributes);
xlib::XSelectInput(display, window, xlib::ExposureMask | xlib::KeyPressMask);
xlib::XMapWindow(display, window);
let mut surface_info = vk::XlibSurfaceCreateInfoKHR::default();
surface_info.dpy = display as _;
surface_info.window = window;
let mut surface = 0;
vk::CreateXlibSurfaceKHR(&surface_info, &mut surface);
let mut supported = 0;
vk::GetPhysicalDeviceSurfaceSupportKHR(0, surface, &mut supported);
Window { display : display as _, window, surface, size : vk::Extent2D {width, height} }
}
pub unsafe fn poll(&self) -> bool {
use x11::*;
use x11::xlib::*;
if XPending(self.display as _) > 0 {
let mut event: x11::xlib::XEvent = std::mem::uninitialized();
XNextEvent(self.display as _, &mut event);
match event.get_type() {
KeyPress => {
println!("{}", event.key.keycode);
if event.key.keycode == 9 {
return false;
}
}
_ => ()
}
}
true
}
pub fn extent(&self) -> vk::Extent2D {
self.size
}
} | 33.359375 | 95 | 0.556909 |
0f2550fd836603cebb6f9b5dca96cea69e8c7b01 | 1,157 | swift | Swift | NEWS/Utility.swift | laant/UI-Imitation-DailyBeast | b9d3a0e3e7f25d95bfe67bfbc145847bbd8436a1 | [
"MIT"
] | 1 | 2016-02-01T07:19:48.000Z | 2016-02-01T07:19:48.000Z | NEWS/Utility.swift | laant/UI-Imitation-DailyBeast | b9d3a0e3e7f25d95bfe67bfbc145847bbd8436a1 | [
"MIT"
] | null | null | null | NEWS/Utility.swift | laant/UI-Imitation-DailyBeast | b9d3a0e3e7f25d95bfe67bfbc145847bbd8436a1 | [
"MIT"
] | null | null | null | //
// Utility.swift
// NEWS
//
// Created by BlissLog on 2016. 1. 19..
// Copyright © 2016년 BlissLog. All rights reserved.
//
import UIKit
class Utility {
// MARK : Screen Size
static func getScreenSize() -> CGSize {
let windowRect = UIScreen.main.bounds
return windowRect.size
}
// MARK : check exist image
static func getFilePath() -> String {
let paths = NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.cachesDirectory, FileManager.SearchPathDomainMask.allDomainsMask, true)
let documentDirectory = paths[0]
return documentDirectory
}
static func isExistImageFile(_ imageUrl:String) -> (is_exist:Bool, full_path:String) {
let arr = imageUrl.components(separatedBy: "/")
let fileName:NSString = arr[arr.count - 1] as NSString
let filePath = Utility.getFilePath()
let fileManager = FileManager.default
let fullPath = filePath + (fileName as String)
let isExist = fileManager.fileExists(atPath: fullPath)
return (is_exist:isExist, full_path:fullPath)
}
}
| 28.219512 | 159 | 0.650821 |
21daed3041e925536ee2578ef356bd2a813f2c4f | 910 | html | HTML | client/src/app/login/login.component.html | SEGH/workDash | 5a3a5fbc9f3edb691a8e5a0b8598ac01ae315bac | [
"Unlicense"
] | null | null | null | client/src/app/login/login.component.html | SEGH/workDash | 5a3a5fbc9f3edb691a8e5a0b8598ac01ae315bac | [
"Unlicense"
] | null | null | null | client/src/app/login/login.component.html | SEGH/workDash | 5a3a5fbc9f3edb691a8e5a0b8598ac01ae315bac | [
"Unlicense"
] | null | null | null | <div class="container">
<div class="jumbotron mt-5">
<form (submit)="login()">
<div class="form-group">
<label for="username">Username</label>
<input
type="text"
class="form-control"
name="username"
placeholder="Guest"
[(ngModel)]="user.username"
/>
</div>
<div class="form-group">
<label for="password">Password</label>
<input
type="password"
class="form-control"
name="password"
placeholder="password1234"
[(ngModel)]="user.password"
/>
</div>
<button type="submit" class="btn btn-default">Sign In</button>
</form>
</div>
</div> | 33.703704 | 74 | 0.405495 |
80201af861891354db15e7c82ac5b66d450530fd | 3,840 | sql | SQL | tubes_si.sql | GilangJulianS/Web-Waroeng-Steak | 876acb344f6afd95c4131ef4bacf96f8f1c72568 | [
"CC-BY-3.0"
] | null | null | null | tubes_si.sql | GilangJulianS/Web-Waroeng-Steak | 876acb344f6afd95c4131ef4bacf96f8f1c72568 | [
"CC-BY-3.0"
] | null | null | null | tubes_si.sql | GilangJulianS/Web-Waroeng-Steak | 876acb344f6afd95c4131ef4bacf96f8f1c72568 | [
"CC-BY-3.0"
] | null | null | null | -- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Apr 16, 2015 at 11:48 AM
-- Server version: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `tubes_si`
--
-- --------------------------------------------------------
--
-- Table structure for table `bahan`
--
CREATE TABLE IF NOT EXISTS `bahan` (
`id_pesanan` int(11) NOT NULL,
`nama_bahan` varchar(50) NOT NULL,
`jumlah` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `outlet`
--
CREATE TABLE IF NOT EXISTS `outlet` (
`id` int(11) NOT NULL,
`alamat` varchar(100) NOT NULL,
`area` varchar(100) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `outlet`
--
INSERT INTO `outlet` (`id`, `alamat`, `area`) VALUES
(1, 'Jl. jambu no. 1 Kec. Coblong Bandung', 'Coblong'),
(2, 'Jl. A. Yani no. 10 Kec. Cicadas Bandung', 'Cicadas');
-- --------------------------------------------------------
--
-- Table structure for table `pegawai`
--
CREATE TABLE IF NOT EXISTS `pegawai` (
`username` varchar(25) NOT NULL,
`nama` varchar(50) NOT NULL,
`id_outlet` int(11) NOT NULL,
`password` varchar(25) NOT NULL,
`email` varchar(50) NOT NULL,
`status` varchar(25) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `pegawai`
--
INSERT INTO `pegawai` (`username`, `nama`, `id_outlet`, `password`, `email`, `status`) VALUES
('gilang', 'Gilang Julian S.', 1, 'gilang', 'gilang@gilang.com', 'pemesanan'),
('windy', 'Windy Alay', 2, 'alay', 'windy@alay.com', 'pembelanjaan');
-- --------------------------------------------------------
--
-- Table structure for table `pesanan`
--
CREATE TABLE IF NOT EXISTS `pesanan` (
`id` int(11) NOT NULL,
`tanggal` date NOT NULL,
`username_pemesan` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `bahan`
--
ALTER TABLE `bahan`
ADD PRIMARY KEY (`id_pesanan`,`nama_bahan`);
--
-- Indexes for table `outlet`
--
ALTER TABLE `outlet`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `pegawai`
--
ALTER TABLE `pegawai`
ADD PRIMARY KEY (`username`,`id_outlet`), ADD KEY `id_outlet` (`id_outlet`);
--
-- Indexes for table `pesanan`
--
ALTER TABLE `pesanan`
ADD PRIMARY KEY (`id`,`username_pemesan`), ADD KEY `username_pemesan` (`username_pemesan`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `outlet`
--
ALTER TABLE `outlet`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `pesanan`
--
ALTER TABLE `pesanan`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `bahan`
--
ALTER TABLE `bahan`
ADD CONSTRAINT `bahan_ibfk_1` FOREIGN KEY (`id_pesanan`) REFERENCES `pesanan` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `pegawai`
--
ALTER TABLE `pegawai`
ADD CONSTRAINT `pegawai_ibfk_1` FOREIGN KEY (`id_outlet`) REFERENCES `outlet` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Constraints for table `pesanan`
--
ALTER TABLE `pesanan`
ADD CONSTRAINT `pesanan_ibfk_1` FOREIGN KEY (`username_pemesan`) REFERENCES `pegawai` (`username`) ON DELETE CASCADE ON UPDATE CASCADE;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| 24.458599 | 135 | 0.653385 |
33a95ab457b05aac6e70743c4d49dbfa986ed33a | 149 | sql | SQL | Listings/Listings/Kapitel 3/Listing 3.13.sql | captainabap/Einstieg-in-SQLScript | c5041bd0655e4e880bebcd07bc255e9a6e125383 | [
"MIT"
] | null | null | null | Listings/Listings/Kapitel 3/Listing 3.13.sql | captainabap/Einstieg-in-SQLScript | c5041bd0655e4e880bebcd07bc255e9a6e125383 | [
"MIT"
] | null | null | null | Listings/Listings/Kapitel 3/Listing 3.13.sql | captainabap/Einstieg-in-SQLScript | c5041bd0655e4e880bebcd07bc255e9a6e125383 | [
"MIT"
] | 1 | 2021-06-10T16:48:13.000Z | 2021-06-10T16:48:13.000Z | -- Listing 3.13.sql
-- Aufruf einer skalaren UDF in der Feldliste
SELECT get_parcel_price(width, height, depth, weight )
FROM parcels;
| 18.625 | 56 | 0.697987 |
62f26d781edb99f6ea22bc16a85151ac92aa0835 | 1,003 | sql | SQL | init-tables.sql | frozsgy/odtu-telegram-bot | 5f645b1fc3482002647ccb9091e67c7c633e2609 | [
"MIT"
] | 4 | 2020-02-26T17:24:43.000Z | 2020-03-01T20:47:22.000Z | init-tables.sql | frozsgy/odtu-telegram-bot | 5f645b1fc3482002647ccb9091e67c7c633e2609 | [
"MIT"
] | null | null | null | init-tables.sql | frozsgy/odtu-telegram-bot | 5f645b1fc3482002647ccb9091e67c7c633e2609 | [
"MIT"
] | 1 | 2021-02-13T14:05:11.000Z | 2021-02-13T14:05:11.000Z | CREATE TABLE IF NOT EXISTS settings (id SERIAL PRIMARY KEY, data varchar);
CREATE TABLE IF NOT EXISTS people (uid bigint NOT NULL UNIQUE , fname text, lname text, uname text);
CREATE TABLE IF NOT EXISTS groups (gid bigint NOT NULL UNIQUE, title text);
CREATE TABLE IF NOT EXISTS logs (uid bigint, mid bigint NOT NULL, time varchar, content text, gid bigint, FOREIGN KEY(uid) REFERENCES people(uid), FOREIGN KEY(gid) REFERENCES groups(gid));
CREATE TABLE IF NOT EXISTS services (id INTEGER PRIMARY KEY, name varchar);
CREATE TABLE IF NOT EXISTS subscriptions (uid bigint NOT NULL, service INTEGER, FOREIGN KEY(uid) REFERENCES people(uid), FOREIGN KEY(service) REFERENCES services(id));
CREATE TABLE IF NOT EXISTS servicedays (id INTEGER, day varchar, FOREIGN KEY(id) REFERENCES services(id));
INSERT into groups (gid, title) VALUES(0, 'private');
INSERT into settings (data) VALUES(0);
INSERT into settings (data) VALUES('YOUR-TELEGRAM-BOT-TOKEN');
INSERT into services (id, name) VALUES(1, 'yemekhane'); | 91.181818 | 188 | 0.771685 |
6073caad31d6fbb3a9557ec41574baf930aeac47 | 870 | html | HTML | views/directiveViews/field/natural.html | tellform/angular-tellform | cfd9d8ee69b3ad2cee3f6feb31063498737e9d8d | [
"MIT"
] | 42 | 2016-04-28T18:22:57.000Z | 2021-01-05T04:46:06.000Z | views/directiveViews/field/natural.html | tellform/angular-tellform | cfd9d8ee69b3ad2cee3f6feb31063498737e9d8d | [
"MIT"
] | 11 | 2016-04-28T14:21:44.000Z | 2018-12-02T13:54:09.000Z | views/directiveViews/field/natural.html | tellform/angular-tellform | cfd9d8ee69b3ad2cee3f6feb31063498737e9d8d | [
"MIT"
] | 15 | 2016-04-28T23:11:36.000Z | 2020-07-20T13:25:03.000Z | <div class="field row textfield natural" ng-click="setActiveField(field._id, index, true)">
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}"><h3><span class="fa fa-angle-double-right"></span> {{field.title}} <span class="required-error" ng-show="field.required && !field.fieldValue">*(required)</span></h3></div>
<div class="col-xs-12 field-input">
<input ng-focus="setActiveField(field._id, index, true)" ng-style="{'color': design.colors.answerColor, 'border-color': design.colors.answerColor}" type="text"
class="text-field-input"
ng-model="field.fieldValue"
ng-model-options="{ debounce: 250 }"
value="field.fieldValue"
ng-required="field.required"
ng-disabled="field.disabled">
</div>
<br>
<div class="col-xs-12">
<span ng-bind="field.fieldMatchValue"></span>
</div>
</div>
| 51.176471 | 260 | 0.674713 |
c7eb34402f16b2af87e23b4c83bed68438311fd1 | 4,527 | java | Java | dsl/camel-java-joor-dsl/src/main/java/org/apache/camel/dsl/java/joor/ClassRoutesBuilderLoader.java | adessaigne/camel | a10a9ccbfa60acc951d75848b9c66930056c7510 | [
"Apache-2.0"
] | null | null | null | dsl/camel-java-joor-dsl/src/main/java/org/apache/camel/dsl/java/joor/ClassRoutesBuilderLoader.java | adessaigne/camel | a10a9ccbfa60acc951d75848b9c66930056c7510 | [
"Apache-2.0"
] | null | null | null | dsl/camel-java-joor-dsl/src/main/java/org/apache/camel/dsl/java/joor/ClassRoutesBuilderLoader.java | adessaigne/camel | a10a9ccbfa60acc951d75848b9c66930056c7510 | [
"Apache-2.0"
] | null | null | null | /*
* 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 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 under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.camel.dsl.java.joor;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;
import org.apache.camel.CamelContextAware;
import org.apache.camel.RoutesBuilder;
import org.apache.camel.api.management.ManagedResource;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.dsl.support.ExtendedRouteBuilderLoaderSupport;
import org.apache.camel.spi.CompilePostProcessor;
import org.apache.camel.spi.Resource;
import org.apache.camel.spi.ResourceAware;
import org.apache.camel.spi.annotations.RoutesLoader;
import org.apache.camel.util.StringHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ManagedResource(description = "Managed ClassRoutesBuilderLoader")
@RoutesLoader(ClassRoutesBuilderLoader.EXTENSION)
public class ClassRoutesBuilderLoader extends ExtendedRouteBuilderLoaderSupport {
public static final String EXTENSION = "class";
private static final Logger LOG = LoggerFactory.getLogger(ClassRoutesBuilderLoader.class);
public ClassRoutesBuilderLoader() {
super(EXTENSION);
}
@Override
protected Collection<RoutesBuilder> doLoadRoutesBuilders(Collection<Resource> resources) throws Exception {
Collection<RoutesBuilder> answer = new ArrayList<>();
LOG.debug("Loading .class resources from: {}", resources);
// load all the byte code first from the resources
Map<String, byte[]> byteCodes = new LinkedHashMap<>();
for (Resource res : resources) {
String className = asClassName(res);
InputStream is = resourceInputStream(res);
if (is != null) {
byte[] code = is.readAllBytes();
byteCodes.put(className, code);
}
}
ByteArrayClassLoader cl = new ByteArrayClassLoader(byteCodes);
// instantiate classes from the byte codes
for (Resource res : resources) {
String className = asClassName(res);
Class<?> clazz = cl.findClass(className);
Object obj;
try {
// requires a default no-arg constructor otherwise we skip the class
obj = getCamelContext().getInjector().newInstance(clazz);
} catch (Exception e) {
LOG.debug("Loaded class: " + className + " must have a default no-arg constructor. Skipping.");
continue;
}
// inject context and resource
CamelContextAware.trySetCamelContext(obj, getCamelContext());
ResourceAware.trySetResource(obj, res);
// support custom annotation scanning post compilation
// such as to register custom beans, type converters, etc.
for (CompilePostProcessor pre : getCompilePostProcessors()) {
// do not pass in byte code as we do not need to write to disk again
pre.postCompile(getCamelContext(), className, clazz, null, obj);
}
if (obj instanceof RouteBuilder) {
RouteBuilder builder = (RouteBuilder) obj;
answer.add(builder);
}
}
return answer;
}
private static String asClassName(Resource resource) {
String className = resource.getLocation();
if (className.contains(":")) {
// remove scheme such as classpath:foo.class
className = StringHelper.after(className, ":");
}
className = className.replace('/', '.');
if (className.endsWith(".class")) {
className = className.substring(0, className.length() - 6);
}
return className;
}
}
| 39.025862 | 111 | 0.671747 |
020687371d265f0df3ffee704666810ba60ad28e | 1,573 | kt | Kotlin | app/src/main/java/io/github/coffeegerm/betterbarista/ui/children/drinks/DrinksAdapter.kt | Coffeegerm/Better-Barista | 4d1a98616d88a9b65aa0d4d4b7467717f78bff1e | [
"Apache-2.0"
] | null | null | null | app/src/main/java/io/github/coffeegerm/betterbarista/ui/children/drinks/DrinksAdapter.kt | Coffeegerm/Better-Barista | 4d1a98616d88a9b65aa0d4d4b7467717f78bff1e | [
"Apache-2.0"
] | null | null | null | app/src/main/java/io/github/coffeegerm/betterbarista/ui/children/drinks/DrinksAdapter.kt | Coffeegerm/Better-Barista | 4d1a98616d88a9b65aa0d4d4b7467717f78bff1e | [
"Apache-2.0"
] | null | null | null | /*
* Copyright 2017 Coffee and Cream Studios
*
* 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 under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.github.coffeegerm.betterbarista.ui.children.drinks
import androidx.recyclerview.widget.RecyclerView
import android.view.LayoutInflater
import android.view.ViewGroup
import io.github.coffeegerm.betterbarista.R
import io.github.coffeegerm.betterbarista.data.model.Drink
/**
* TODO: Add class comment header
*/
class DrinksAdapter : androidx.recyclerview.widget.RecyclerView.Adapter<DrinksViewHolder>() {
private var drinks: ArrayList<Drink> = mutableListOf<Drink>() as ArrayList<Drink>
fun setDrinks(providedDrinks: ArrayList<Drink>) {
this.drinks = providedDrinks
}
override fun onBindViewHolder(holder: DrinksViewHolder, position: Int) = holder.bindDrink(drinks[position])
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): DrinksViewHolder =
DrinksViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.item_drink, parent, false))
override fun getItemCount(): Int = drinks.size
}
| 34.955556 | 109 | 0.765416 |
c3b874e4acd3c2443de1051ac2d88e43e9be06af | 859 | go | Go | testing/testserver_test.go | emrearmagan/Hvv-REST-API | 06cdc596ac5803f3bf7e76cbec0a5460d688c52f | [
"MIT"
] | 1 | 2019-06-13T16:15:42.000Z | 2019-06-13T16:15:42.000Z | testing/testserver_test.go | emrearmagan/Hvv-REST-API | 06cdc596ac5803f3bf7e76cbec0a5460d688c52f | [
"MIT"
] | null | null | null | testing/testserver_test.go | emrearmagan/Hvv-REST-API | 06cdc596ac5803f3bf7e76cbec0a5460d688c52f | [
"MIT"
] | null | null | null | package testing
import (
"fmt"
"log"
"net/http"
"net/http/httptest"
)
// Create a Test HTTP Server that will return a response with HTTP code and body.
func testServer(code int, body string) *httptest.Server {
serv := testServerForQuery("", code, body)
return serv
}
// testServerForQuery returns a mock server that only responds to a particular query string.
func testServerForQuery(query string, code int, body string) *httptest.Server {
server := &httptest.Server{}
server = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if query != "" && r.URL.RawQuery != query {
log.Printf("Query != Expected Query: %s != %s", query, r.URL.RawQuery)
http.Error(w, "fail", 999)
return
}
w.WriteHeader(code)
w.Header().Set("Content-Type", "application/json")
fmt.Fprintln(w, body)
}))
return server
}
| 26.030303 | 92 | 0.700815 |
cb1f21728a07df57465e1bd982dc1dc21878ae5a | 2,342 | h | C | src/operators/RadialResample/QvisRadialResampleWindow.h | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/operators/RadialResample/QvisRadialResampleWindow.h | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/operators/RadialResample/QvisRadialResampleWindow.h | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | // Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
// Project developers. See the top-level LICENSE file for dates and other
// details. No copyright assignment is required to contribute to VisIt.
#ifndef QVISRADIALRESAMPLEWINDOW_H
#define QVISRADIALRESAMPLEWINDOW_H
#include <QvisOperatorWindow.h>
#include <AttributeSubject.h>
class RadialResampleAttributes;
class QLabel;
class QCheckBox;
class QLineEdit;
// ****************************************************************************
// Class: QvisRadialResampleWindow
//
// Purpose:
// Defines QvisRadialResampleWindow class.
//
// Notes: Autogenerated by xml2window.
//
// Programmer: xml2window
// Creation: omitted
//
// Modifications:
//
// ****************************************************************************
class QvisRadialResampleWindow : public QvisOperatorWindow
{
Q_OBJECT
public:
QvisRadialResampleWindow(const int type,
RadialResampleAttributes *subj,
const QString &caption = QString(),
const QString &shortName = QString(),
QvisNotepadArea *notepad = 0);
virtual ~QvisRadialResampleWindow();
virtual void CreateWindowContents();
protected:
void UpdateWindow(bool doAll);
virtual void GetCurrentValues(int which_widget);
private slots:
void isFastChanged(bool val);
void minThetaProcessText();
void maxThetaProcessText();
void deltaThetaProcessText();
void radiusProcessText();
void deltaRadiusProcessText();
void centerProcessText();
void is3DChanged(bool val);
void minAzimuthProcessText();
void maxAzimuthProcessText();
void deltaAzimuthProcessText();
private:
QCheckBox *isFast;
QLineEdit *minTheta;
QLineEdit *maxTheta;
QLineEdit *deltaTheta;
QLineEdit *radius;
QLineEdit *deltaRadius;
QLineEdit *center;
QCheckBox *is3D;
QLineEdit *minAzimuth;
QLineEdit *maxAzimuth;
QLineEdit *deltaAzimuth;
QLabel *minThetaLabel;
QLabel *maxThetaLabel;
QLabel *deltaThetaLabel;
QLabel *radiusLabel;
QLabel *deltaRadiusLabel;
QLabel *centerLabel;
QLabel *minAzimuthLabel;
QLabel *maxAzimuthLabel;
QLabel *deltaAzimuthLabel;
RadialResampleAttributes *atts;
};
#endif
| 27.552941 | 79 | 0.65585 |
9bcfc95e3bd3c2fe5a56e4bed6652524059cff6b | 2,029 | js | JavaScript | Improved-Training-of-Wasserstein-GANs/page/wasserstein-gan.js | toonnyy8/PPT | 03595b5e635a830890900d296458810fd5553893 | [
"MIT"
] | 1 | 2021-01-25T16:30:25.000Z | 2021-01-25T16:30:25.000Z | Improved-Training-of-Wasserstein-GANs/page/wasserstein-gan.js | toonnyy8/PPT | 03595b5e635a830890900d296458810fd5553893 | [
"MIT"
] | 10 | 2020-01-06T10:26:04.000Z | 2022-02-11T00:15:04.000Z | Improved-Training-of-Wasserstein-GANs/page/wasserstein-gan.js | toonnyy8/PPT | 03595b5e635a830890900d296458810fd5553893 | [
"MIT"
] | null | null | null | ///<reference path="../src/html.js">
///<reference path="../src/css.js">
///<reference path="./template.js">
const wasserstein_gan =
(() => {
return [
template.default_page(
'Wasserstein GAN',
template.div_hc(0)([
html.img({ src: './img/d2c-1.png', style: [css.w.percent(75)] }),
]),
),
template.page2(0)(
'Wasserstein GAN',
'判別器 => 評估器',
template.div_hc(0)([
html.p()`解決梯度消失的問題`,
html.ol({ style: [css.tx.justify(), css.p.l(100)] })([
html.li()`移除輸出的 Sigmoid`,
html.li()`移除 loss 的 log`,
]),
html.img({ src: './img/d2c-2.png', style: [css.w.percent(100)] }),
]),
),
template.page2(0)(
'Wasserstein GAN',
'判別器 => 評估器',
template.div_hc(0)([
html.img({ src: './img/wrong-way-to-update.png', style: [css.w.percent(80)] }),
html.p()`不做限制的話可能會導致權重無限制增長`
]),
),
template.page2(0)(
'Wasserstein GAN',
'Weight Clipping',
template.div_hc(0)([
html.table()([
html.tr()([
html.td({ style: [css.w.percent(60)] })([
html.img({ src: './img/weight-clipping.png', style: [css.w.percent(90)] }),
]),
html.td({ class: ["text-lg"], style: [css.tx.justify()] })([
html.p()`在 WGAN 原文中使用 Weight Clipping 來限制權重大小。`,
html.br(),
html.p()`但卻會造成梯度消失或爆炸。`,
])
]),
]),
]),
),
]
})() | 38.283019 | 107 | 0.347462 |
7b44db40e4eab52dd0a5179b191f142aa9d056f3 | 1,980 | rb | Ruby | lib/autodesk_vida/authentication.rb | keram/autodesk_vida | 8aa095417d63881f7161aac7b4fb36ab2607967d | [
"MIT"
] | null | null | null | lib/autodesk_vida/authentication.rb | keram/autodesk_vida | 8aa095417d63881f7161aac7b4fb36ab2607967d | [
"MIT"
] | null | null | null | lib/autodesk_vida/authentication.rb | keram/autodesk_vida | 8aa095417d63881f7161aac7b4fb36ab2607967d | [
"MIT"
] | null | null | null | require_relative 'base'
require_relative 'request'
require_relative 'access_token'
module AutodeskVida
class Authentication < Base
def initialize(client_id:, client_secret:, grant_type:)
@credentials = {
client_id: client_id,
client_secret: client_secret,
grant_type: grant_type
}
end
# Error responses
#
# {"developerMessage":"content-type header missing or unsupported
# content-type used, must use application/x-www-form-urlencoded",
# "userMessage":"","errorCode":"AUTH-007",
# "more info":
# "http://developer.api.autodesk.com/documentation/v1/errors/AUTH-007"}
# {"developerMessage":"The required parameter(s) client_id,
# client_secret,grant_type not present in the request","userMessage":"",
# "errorCode":"AUTH-008",
# "more info":
# "http://developer.api.autodesk.com/documentation/v1/errors/AUTH-008"}
# {"developerMessage":"Unsupported grant_type 4 specified.
# The grant_type must be either client_credentials or authorization_code
# or refresh_token.","userMessage":"","errorCode":"AUTH-009",
# "more info":
# "http://developer.api.autodesk.com/documentation/v1/errors/AUTH-009"}
# { "developerMessage":"The client_id specified does not have access
# to the api product","userMessage":"", "errorCode":"AUTH-001",
# "more info":
# "http://developer.api.autodesk.com/documentation/v1/errors/AUTH-001"}
# {"developerMessage":"The client_id (application key)/client_secret
# are not valid","userMessage":"","errorCode":"AUTH-003",
# "more info":
# "http://developer.api.autodesk.com/documentation/v1/errors/AUTH-003"}
#
# Success response
# {
# "token_type":"Bearer",
# "expires_in":1799,
# "access_token":"m3avgSSFyr9fKUmo2CMsHhsT1Z8W"
# }
def perform
AccessToken.new(
request(endpoint).post(@credentials)
)
end
end
end
| 36.666667 | 78 | 0.657576 |
33310d445d44da6d57d70c0d985520626d8989bd | 1,473 | py | Python | scrape.py | ilemhadri/fb_messenger | c5da22ec40e0caa4c11236016226e258bf181c64 | [
"MIT"
] | 11 | 2018-11-18T18:16:13.000Z | 2022-02-07T14:14:33.000Z | scrape.py | ilemhadri/fb_messenger | c5da22ec40e0caa4c11236016226e258bf181c64 | [
"MIT"
] | 1 | 2021-01-16T16:54:14.000Z | 2021-01-17T09:28:34.000Z | scrape.py | ilemhadri/fb_messenger | c5da22ec40e0caa4c11236016226e258bf181c64 | [
"MIT"
] | 10 | 2019-02-28T18:01:51.000Z | 2022-03-24T16:43:57.000Z | import os
import sys
from collections import defaultdict
import datetime
import pickle
import re
import time
import json
from selenium import webdriver
def main():
driver = webdriver.Chrome() # Optional argument, if not specified will search path.
#load login cookie
driver.get('https://www.messenger.com')
cookies=pickle.load(open('data/logincookies.pkl','rb'))
for c in cookies:
driver.add_cookie(c)
driver.get('https://www.messenger.com')
#get page source
source=(driver.page_source).encode('utf8','replace')
#get last active times and add them to database
v=re.compile("lastActiveTimes\":(.*),\"chatNotif")
lolo=json.loads(v.findall(source)[0])
d=defaultdict(lambda:[0],json.load(open("data/lastActiveTimes.json",'r')))
for k in lolo:
if lolo[k]!=d[k][-1]:
d[k].append(lolo[k])
json.dump(d,open("data/lastActiveTimes.json",'w'))
#maintain up to date database of friends profiles
v=re.compile("shortProfiles\":(.*),\"nearby")
lala=json.loads(v.findall(source)[0])
d=json.load(open('data/shortProfiles.json','r'))
d.update(lala)
json.dump(d,open('data/shortProfiles.json','w'))
driver.quit()
if not os.path.exists('data/logincookies.pkl'):
print ('missing cookie. Have you run init.py?')
sys.exit()
while True:
main()
with open('data/lastScrapeTime.txt','a') as f:
f.write(str(datetime.datetime.now())+'\n')
time.sleep(600)
| 30.061224 | 87 | 0.663951 |
fb7a755c3f316f4ddb55439a46dcd8257b3e5f21 | 1,599 | h | C | export/windows/cpp/obj/include/openfl/_legacy/gl/GLRenderbuffer.h | TinyPlanetStudios/Project-Crash-Land | 365f196be4212602d32251566f26b53fb70693f6 | [
"MIT"
] | null | null | null | export/windows/cpp/obj/include/openfl/_legacy/gl/GLRenderbuffer.h | TinyPlanetStudios/Project-Crash-Land | 365f196be4212602d32251566f26b53fb70693f6 | [
"MIT"
] | null | null | null | export/windows/cpp/obj/include/openfl/_legacy/gl/GLRenderbuffer.h | TinyPlanetStudios/Project-Crash-Land | 365f196be4212602d32251566f26b53fb70693f6 | [
"MIT"
] | null | null | null | // Generated by Haxe 3.3.0
#ifndef INCLUDED_openfl__legacy_gl_GLRenderbuffer
#define INCLUDED_openfl__legacy_gl_GLRenderbuffer
#ifndef HXCPP_H
#include <hxcpp.h>
#endif
#ifndef INCLUDED_openfl__legacy_gl_GLObject
#include <openfl/_legacy/gl/GLObject.h>
#endif
HX_DECLARE_CLASS3(openfl,_legacy,gl,GLObject)
HX_DECLARE_CLASS3(openfl,_legacy,gl,GLRenderbuffer)
namespace openfl{
namespace _legacy{
namespace gl{
class HXCPP_CLASS_ATTRIBUTES GLRenderbuffer_obj : public ::openfl::_legacy::gl::GLObject_obj
{
public:
typedef ::openfl::_legacy::gl::GLObject_obj super;
typedef GLRenderbuffer_obj OBJ_;
GLRenderbuffer_obj();
public:
void __construct(Int version, ::Dynamic id);
inline void *operator new(size_t inSize, bool inContainer=true,const char *inName="openfl._legacy.gl.GLRenderbuffer")
{ return hx::Object::operator new(inSize,inContainer,inName); }
inline void *operator new(size_t inSize, int extra)
{ return hx::Object::operator new(inSize+extra,true,"openfl._legacy.gl.GLRenderbuffer"); }
static hx::ObjectPtr< GLRenderbuffer_obj > __new(Int version, ::Dynamic id);
static Dynamic __CreateEmpty();
static Dynamic __Create(hx::DynamicArray inArgs);
//~GLRenderbuffer_obj();
HX_DO_RTTI_ALL;
hx::Val __Field(const ::String &inString, hx::PropertyAccess inCallProp);
static void __register();
::String __ToString() const { return HX_HCSTRING("GLRenderbuffer","\x9b","\xfa","\x9f","\x86"); }
::String getType();
};
} // end namespace openfl
} // end namespace _legacy
} // end namespace gl
#endif /* INCLUDED_openfl__legacy_gl_GLRenderbuffer */
| 30.75 | 119 | 0.763602 |
f083f81f215c3c4bed5141eca94e83edfda1ebf3 | 1,040 | lua | Lua | build/premake-inc/sys-openssl.lua | Unbundlesss/OUROVEON | 34dda511eda2a28b8522a724cfc9500a7914ea03 | [
"MIT"
] | 6 | 2022-01-27T20:33:17.000Z | 2022-02-16T18:29:43.000Z | build/premake-inc/sys-openssl.lua | Unbundlesss/OUROVEON | 34dda511eda2a28b8522a724cfc9500a7914ea03 | [
"MIT"
] | 4 | 2022-01-30T16:16:53.000Z | 2022-02-20T20:07:25.000Z | build/premake-inc/sys-openssl.lua | Unbundlesss/OUROVEON | 34dda511eda2a28b8522a724cfc9500a7914ea03 | [
"MIT"
] | null | null | null | -- ==============================================================================
ModuleRefInclude["openssl"] = function()
filter "system:Windows"
sysincludedirs
{
GetPrebuiltLibs_Win64() .. "openssl/include"
}
filter {}
filter "system:macosx"
sysincludedirs
{
GetMacOSPackgesDir() .. "openssl@1.1/include/",
}
filter {}
end
-- ==============================================================================
ModuleRefLink["openssl"] = function()
filter "system:Windows"
libdirs ( GetPrebuiltLibs_Win64() .. "openssl/lib" )
links
{
"libcrypto-1_1.lib",
"libssl-1_1.lib",
}
postbuildcommands { "copy \"" .. GetPrebuiltLibs_Win64_VSMacro() .. "openssl\\bin\\*.dll\" \"$(TargetDir)\"" }
filter {}
filter "system:linux"
links
{
"ssl",
"crypto",
}
filter {}
filter "system:macosx"
libdirs ( GetPrebuiltLibs_MacUniversal() )
links
{
"ssl",
"crypto",
}
filter {}
end
| 21.22449 | 114 | 0.469231 |
74cdebe3befc311a89e8447ba698b651ae4467b8 | 5,144 | js | JavaScript | example/index.ios.js | moschan/react-native-responsive-keybord-view | 8504bfefaa5650f146a84e6a2d5fa9b5293dee91 | [
"MIT"
] | null | null | null | example/index.ios.js | moschan/react-native-responsive-keybord-view | 8504bfefaa5650f146a84e6a2d5fa9b5293dee91 | [
"MIT"
] | null | null | null | example/index.ios.js | moschan/react-native-responsive-keybord-view | 8504bfefaa5650f146a84e6a2d5fa9b5293dee91 | [
"MIT"
] | null | null | null | /**
* Sample React Native App
* https://github.com/facebook/react-native
*/
'use strict';
// import ResponsiveKeyboardView from './index.js'
import ResponsiveKeyboardView from 'react-native-responsive-keyboard-view'
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
View,
TextInput,
ScrollView,
} = React;
var ResponsiveKeyboardViewExample = React.createClass({
render: function() {
return (
<ScrollView
automaticallyAdjustContentInsets={false}
horizontal={false}
>
<ResponsiveKeyboardView style={styles.container}>
<Text style={styles.welcome}>ResponsiveKeyboardViewExample</Text>
<Text style={styles.instructions}>Ipsum veritatis rem ad iste facere aliquam exercitationem distinctio. Voluptates quaerat est quibusdam et unde totam. Porro quasi cupiditate voluptatibus dignissimos distinctio dolore. Rem numquam fugiat consequatur id est voluptatem!</Text>
<Text style={styles.instructions}>Ipsum veritatis rem ad iste facere aliquam exercitationem distinctio. Voluptates quaerat est quibusdam et unde totam. Porro quasi cupiditate voluptatibus dignissimos distinctio dolore. Rem numquam fugiat consequatur id est voluptatem!</Text>
<Text style={styles.instructions}>Ipsum veritatis rem ad iste facere aliquam exercitationem distinctio. Voluptates quaerat est quibusdam et unde totam. Porro quasi cupiditate voluptatibus dignissimos distinctio dolore. Rem numquam fugiat consequatur id est voluptatem!</Text>
<Text style={styles.instructions}>Ipsum veritatis rem ad iste facere aliquam exercitationem distinctio. Voluptates quaerat est quibusdam et unde totam. Porro quasi cupiditate voluptatibus dignissimos distinctio dolore. Rem numquam fugiat consequatur id est voluptatem!</Text>
<Text style={styles.instructions}>Ipsum veritatis rem ad iste facere aliquam exercitationem distinctio. Voluptates quaerat est quibusdam et unde totam. Porro quasi cupiditate voluptatibus dignissimos distinctio dolore. Rem numquam fugiat consequatur id est voluptatem!</Text>
<Text style={styles.instructions}>Ipsum veritatis rem ad iste facere aliquam exercitationem distinctio. Voluptates quaerat est quibusdam et unde totam. Porro quasi cupiditate voluptatibus dignissimos distinctio dolore. Rem numquam fugiat consequatur id est voluptatem!</Text>
<Text style={styles.instructions}>Ipsum veritatis rem ad iste facere aliquam exercitationem distinctio. Voluptates quaerat est quibusdam et unde totam. Porro quasi cupiditate voluptatibus dignissimos distinctio dolore. Rem numquam fugiat consequatur id est voluptatem!</Text>
<TextInput style={{height:40, borderColor: 'red', borderWidth: 1,}} />
<Text style={styles.instructions}>Ipsum veritatis rem ad iste facere aliquam exercitationem distinctio. Voluptates quaerat est quibusdam et unde totam. Porro quasi cupiditate voluptatibus dignissimos distinctio dolore. Rem numquam fugiat consequatur id est voluptatem!</Text>
<Text style={styles.instructions}>Ipsum veritatis rem ad iste facere aliquam exercitationem distinctio. Voluptates quaerat est quibusdam et unde totam. Porro quasi cupiditate voluptatibus dignissimos distinctio dolore. Rem numquam fugiat consequatur id est voluptatem!</Text>
<Text style={styles.instructions}>Ipsum veritatis rem ad iste facere aliquam exercitationem distinctio. Voluptates quaerat est quibusdam et unde totam. Porro quasi cupiditate voluptatibus dignissimos distinctio dolore. Rem numquam fugiat consequatur id est voluptatem!</Text>
<TextInput style={{height:40, borderColor: 'blue', borderWidth: 1,}} />
<Text style={styles.instructions}>Ipsum veritatis rem ad iste facere aliquam exercitationem distinctio. Voluptates quaerat est quibusdam et unde totam. Porro quasi cupiditate voluptatibus dignissimos distinctio dolore. Rem numquam fugiat consequatur id est voluptatem!</Text>
<Text style={styles.instructions}>Ipsum veritatis rem ad iste facere aliquam exercitationem distinctio. Voluptates quaerat est quibusdam et unde totam. Porro quasi cupiditate voluptatibus dignissimos distinctio dolore. Rem numquam fugiat consequatur id est voluptatem!</Text>
<Text style={styles.instructions}>Ipsum veritatis rem ad iste facere aliquam exercitationem distinctio. Voluptates quaerat est quibusdam et unde totam. Porro quasi cupiditate voluptatibus dignissimos distinctio dolore. Rem numquam fugiat consequatur id est voluptatem!</Text>
<TextInput style={{height:40, borderColor: 'green', borderWidth: 1,}} />
</ResponsiveKeyboardView>
</ScrollView>
);
}
});
var styles = StyleSheet.create({
container: {
padding: 10,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
AppRegistry.registerComponent('ResponsiveKeyboardViewExample', () => ResponsiveKeyboardViewExample);
| 72.450704 | 285 | 0.767302 |
d5c2fecb7a82d01722ce9338eee6acbb1c577873 | 307 | h | C | ZBLiveBarrage/ZBTestLiveBarrageCell.h | itzhangbao/ZBLiveBarrage | 4bcf74de1e45789ea1eeea68d07cc98479e5e8e2 | [
"MIT"
] | 14 | 2017-08-08T01:35:00.000Z | 2021-09-28T22:06:10.000Z | ZBLiveBarrage/ZBTestLiveBarrageCell.h | itzhangbao/ZBLiveBarrage | 4bcf74de1e45789ea1eeea68d07cc98479e5e8e2 | [
"MIT"
] | 1 | 2021-08-10T01:39:40.000Z | 2021-08-16T10:02:46.000Z | ZBLiveBarrage/ZBTestLiveBarrageCell.h | itzhangbao/ZBLiveBarrage | 4bcf74de1e45789ea1eeea68d07cc98479e5e8e2 | [
"MIT"
] | 6 | 2017-08-01T00:35:46.000Z | 2021-08-13T06:51:27.000Z | //
// ZBTestLiveBarrageCell.h
// ZBLiveBarrage
//
// Created by zhangbao on 2017/3/15.
// Copyright © 2017年 张宝. All rights reserved.
//
#import "ZBLiveBarrageCell.h"
@class ZBTestModel;
@interface ZBTestLiveBarrageCell : ZBLiveBarrageCell
@property (nonatomic, strong) ZBTestModel *testModel;
@end
| 17.055556 | 53 | 0.739414 |
56fb871c3dd8d1635381ce7b29464bd2209e20e4 | 2,917 | ts | TypeScript | blend/src/dom/ClassList.ts | blendsdk/material-blend | 43900f9d16e4aed033794c25593578cb35a44224 | [
"Apache-2.0"
] | null | null | null | blend/src/dom/ClassList.ts | blendsdk/material-blend | 43900f9d16e4aed033794c25593578cb35a44224 | [
"Apache-2.0"
] | null | null | null | blend/src/dom/ClassList.ts | blendsdk/material-blend | 43900f9d16e4aed033794c25593578cb35a44224 | [
"Apache-2.0"
] | null | null | null | /**
* Copyright 2016 TrueSoftware B.V. All Rights Reserved.
*
* 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 under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace Blend.dom {
/**
* Implements a classList provider for the Blend.dom.Element
*/
export class ClassList {
protected list: Array<string>;
public constructor(htmlElement: HTMLElement) {
var me = this;
me.list = [];
me.initList((htmlElement.getAttribute("class") || "").trim());
}
private initList(css: string) {
var me = this;
(css === "" ? [] : css.split(" ")).forEach(function(c: string) {
c = c.trim();
if (c.length !== 0 && c !== "") {
me.list.push(c);
}
});
}
public serializeTo(htmlElement: HTMLElement) {
var me = this,
css = me.toString();
if (css !== null && css !== "" && css.length !== 0) {
htmlElement.setAttribute("class", css);
} else {
htmlElement.removeAttribute("class");
}
}
public removeLike(list: Array<string>) {
var me = this, i = -1, n: Array<string> = [];
list.forEach(function(r: string) {
me.list.forEach(function(i: string) {
if (!i.startsWith(r)) {
n.push(i);
}
});
});
me.list = n;
}
public remove(list: Array<string>) {
var me = this, i = -1;
list.forEach(function(r: string) {
i = me.list.indexOf(r);
if (i !== -1) {
me.list.splice(i, 1);
}
});
}
public add(list: Array<string>) {
var me = this;
list.forEach(function(i: string) {
if (!me.has(i)) {
me.list.push(i);
}
});
}
public clear() {
this.list = [];
}
public has(n: string) {
return this.list.indexOf(n) !== -1;
}
public toString(): string {
var r = this.list.join(" ").trim();
return r === "" ? null : r;
}
public toArray(): Array<string> {
return this.list;
}
}
} | 29.464646 | 76 | 0.468632 |
a1b75a2ad035390745ed18c10ad2eb8fee8e951b | 1,601 | go | Go | src/checklist/checklist.go | landau/agile-results | 671419e1a70ac71c11a73e03e22b8ebef8bcb107 | [
"Unlicense"
] | null | null | null | src/checklist/checklist.go | landau/agile-results | 671419e1a70ac71c11a73e03e22b8ebef8bcb107 | [
"Unlicense"
] | null | null | null | src/checklist/checklist.go | landau/agile-results | 671419e1a70ac71c11a73e03e22b8ebef8bcb107 | [
"Unlicense"
] | null | null | null | package checklist
import (
"github.com/adlio/trello"
)
type trelloChecklistHandler interface {
CreateChecklist(card *trello.Card, name string, extraArgs trello.Arguments) (*trello.Checklist, error)
CreateCheckItem(checklist *trello.Checklist, name string, extraArgs trello.Arguments) (*trello.CheckItem, error)
}
// Creator -
type Creator interface {
Create(card *trello.Card, items []string) (*trello.Checklist, error)
}
// TrelloCreator -
type TrelloCreator struct {
handler trelloChecklistHandler
}
// Create -
func (c *TrelloCreator) Create(card *trello.Card, items []string) (*trello.Checklist, error) {
checklist, err := c.handler.CreateChecklist(card, "Checklist", trello.Defaults())
if err != nil {
return nil, err
}
for _, name := range items {
_, err = c.handler.CreateCheckItem(checklist, name, trello.Defaults())
if err != nil {
return nil, err
}
}
return checklist, nil
}
type (
// MockCreator -
MockCreator struct {
Calls []*MockCreateCall
CreateReturnValue MockCreateReturnValue
}
// MockCreateCall -
MockCreateCall struct {
Card *trello.Card
Items []string
}
// MockCreateReturnValue -
MockCreateReturnValue struct {
checklist *trello.Checklist
err error
}
)
// Create -
func (c *MockCreator) Create(card *trello.Card, items []string) (*trello.Checklist, error) {
c.Calls = append(c.Calls, &MockCreateCall{Card: card, Items: items})
return c.CreateReturnValue.checklist, c.CreateReturnValue.err
}
// New -
func New(handler trelloChecklistHandler) *TrelloCreator {
return &TrelloCreator{handler: handler}
}
| 22.549296 | 113 | 0.720175 |
3be6cc3edd64111ebec81dbc4933f4b145fec6fc | 240 | sql | SQL | telegram_messages_after_insert.sql | Pinx0/telegram-bot | dfabd673e76b6003ed7dab5638e7e2d62110c659 | [
"MIT"
] | null | null | null | telegram_messages_after_insert.sql | Pinx0/telegram-bot | dfabd673e76b6003ed7dab5638e7e2d62110c659 | [
"MIT"
] | null | null | null | telegram_messages_after_insert.sql | Pinx0/telegram-bot | dfabd673e76b6003ed7dab5638e7e2d62110c659 | [
"MIT"
] | null | null | null | CREATE TRIGGER `telegram_messages_after_insert` AFTER INSERT ON `telegram_messages` FOR EACH ROW BEGIN
IF NEW.message_text IS NOT NULL AND LENGTH(NEW.message_text) > 1
THEN
CALL `bot_save_phrase`(NEW.message_text, NEW.chat_id);
END IF;
END | 40 | 102 | 0.8125 |
6e0e5f9d60ce0697db610e5e5de1897d34a25b00 | 720 | swift | Swift | Twitter/TableViewBase.swift | rpandey1234/twitter_ios_codepath | c5dc20dc08cedd53c43bb8f42ad1b506a8fdecaa | [
"Apache-2.0"
] | null | null | null | Twitter/TableViewBase.swift | rpandey1234/twitter_ios_codepath | c5dc20dc08cedd53c43bb8f42ad1b506a8fdecaa | [
"Apache-2.0"
] | null | null | null | Twitter/TableViewBase.swift | rpandey1234/twitter_ios_codepath | c5dc20dc08cedd53c43bb8f42ad1b506a8fdecaa | [
"Apache-2.0"
] | null | null | null | //
// TableViewBase.swift
// Twitter
//
// Created by Rahul Pandey on 11/6/16.
// Copyright © 2016 Rahul Pandey. All rights reserved.
//
import UIKit
class TableBaseView: NSObject, UITableViewDataSource {
var tweets: [Tweet]!
func hello() {
print("hello")
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "TweetTableViewCell", for: indexPath) as! TweetTableViewCell
cell.tweet = tweets[indexPath.row]
return cell
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 0
}
}
| 24 | 125 | 0.658333 |
9c39f4ec8e841bcc89809b87aa4e5949a283d7c6 | 36,350 | js | JavaScript | DiceCTF/2021/pwn/AdultCSP/mojo_bindings/gen/third_party/blink/public/mojom/file_system_access/file_system_access_file_writer.mojom.js | mystickev/ctf-archives | 89e99a5cd5fb6b2923cad3fe1948d3ff78649b4e | [
"MIT"
] | 1 | 2021-11-02T20:53:58.000Z | 2021-11-02T20:53:58.000Z | DiceCTF/2021/pwn/AdultCSP/mojo_bindings/gen/third_party/blink/public/mojom/file_system_access/file_system_access_file_writer.mojom.js | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | null | null | null | DiceCTF/2021/pwn/AdultCSP/mojo_bindings/gen/third_party/blink/public/mojom/file_system_access/file_system_access_file_writer.mojom.js | ruhan-islam/ctf-archives | 8c2bf6a608c821314d1a1cfaa05a6cccef8e3103 | [
"MIT"
] | 1 | 2021-12-19T11:06:24.000Z | 2021-12-19T11:06:24.000Z | // third_party/blink/public/mojom/file_system_access/file_system_access_file_writer.mojom.js is auto generated by mojom_bindings_generator.py, do not edit
// Copyright 2014 The Chromium 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 strict';
(function() {
var mojomId = 'third_party/blink/public/mojom/file_system_access/file_system_access_file_writer.mojom';
if (mojo.internal.isMojomLoaded(mojomId)) {
console.warn('The following mojom is loaded multiple times: ' + mojomId);
return;
}
mojo.internal.markMojomLoaded(mojomId);
var bindings = mojo;
var associatedBindings = mojo;
var codec = mojo.internal;
var validator = mojo.internal;
var exports = mojo.internal.exposeNamespace('blink.mojom');
var blob$ =
mojo.internal.exposeNamespace('blink.mojom');
if (mojo.config.autoLoadMojomDeps) {
mojo.internal.loadMojomIfNecessary(
'third_party/blink/public/mojom/blob/blob.mojom', '../blob/blob.mojom.js');
}
var file_system_access_error$ =
mojo.internal.exposeNamespace('blink.mojom');
if (mojo.config.autoLoadMojomDeps) {
mojo.internal.loadMojomIfNecessary(
'third_party/blink/public/mojom/file_system_access/file_system_access_error.mojom', 'file_system_access_error.mojom.js');
}
function FileSystemAccessFileWriter_Write_Params(values) {
this.initDefaults_();
this.initFields_(values);
}
FileSystemAccessFileWriter_Write_Params.prototype.initDefaults_ = function() {
this.offset = 0;
this.data = new blob$.BlobPtr();
};
FileSystemAccessFileWriter_Write_Params.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
FileSystemAccessFileWriter_Write_Params.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 24}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate FileSystemAccessFileWriter_Write_Params.data
err = messageValidator.validateInterface(offset + codec.kStructHeaderSize + 8, false);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
FileSystemAccessFileWriter_Write_Params.encodedSize = codec.kStructHeaderSize + 16;
FileSystemAccessFileWriter_Write_Params.decode = function(decoder) {
var packed;
var val = new FileSystemAccessFileWriter_Write_Params();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.offset =
decoder.decodeStruct(codec.Uint64);
val.data =
decoder.decodeStruct(new codec.Interface(blob$.BlobPtr));
return val;
};
FileSystemAccessFileWriter_Write_Params.encode = function(encoder, val) {
var packed;
encoder.writeUint32(FileSystemAccessFileWriter_Write_Params.encodedSize);
encoder.writeUint32(0);
encoder.encodeStruct(codec.Uint64, val.offset);
encoder.encodeStruct(new codec.Interface(blob$.BlobPtr), val.data);
};
function FileSystemAccessFileWriter_Write_ResponseParams(values) {
this.initDefaults_();
this.initFields_(values);
}
FileSystemAccessFileWriter_Write_ResponseParams.prototype.initDefaults_ = function() {
this.result = null;
this.bytesWritten = 0;
};
FileSystemAccessFileWriter_Write_ResponseParams.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
FileSystemAccessFileWriter_Write_ResponseParams.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 24}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate FileSystemAccessFileWriter_Write_ResponseParams.result
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, file_system_access_error$.FileSystemAccessError, false);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
FileSystemAccessFileWriter_Write_ResponseParams.encodedSize = codec.kStructHeaderSize + 16;
FileSystemAccessFileWriter_Write_ResponseParams.decode = function(decoder) {
var packed;
var val = new FileSystemAccessFileWriter_Write_ResponseParams();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.result =
decoder.decodeStructPointer(file_system_access_error$.FileSystemAccessError);
val.bytesWritten =
decoder.decodeStruct(codec.Uint64);
return val;
};
FileSystemAccessFileWriter_Write_ResponseParams.encode = function(encoder, val) {
var packed;
encoder.writeUint32(FileSystemAccessFileWriter_Write_ResponseParams.encodedSize);
encoder.writeUint32(0);
encoder.encodeStructPointer(file_system_access_error$.FileSystemAccessError, val.result);
encoder.encodeStruct(codec.Uint64, val.bytesWritten);
};
function FileSystemAccessFileWriter_WriteStream_Params(values) {
this.initDefaults_();
this.initFields_(values);
}
FileSystemAccessFileWriter_WriteStream_Params.prototype.initDefaults_ = function() {
this.offset = 0;
this.stream = null;
};
FileSystemAccessFileWriter_WriteStream_Params.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
FileSystemAccessFileWriter_WriteStream_Params.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 24}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate FileSystemAccessFileWriter_WriteStream_Params.stream
err = messageValidator.validateHandle(offset + codec.kStructHeaderSize + 8, false)
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
FileSystemAccessFileWriter_WriteStream_Params.encodedSize = codec.kStructHeaderSize + 16;
FileSystemAccessFileWriter_WriteStream_Params.decode = function(decoder) {
var packed;
var val = new FileSystemAccessFileWriter_WriteStream_Params();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.offset =
decoder.decodeStruct(codec.Uint64);
val.stream =
decoder.decodeStruct(codec.Handle);
decoder.skip(1);
decoder.skip(1);
decoder.skip(1);
decoder.skip(1);
return val;
};
FileSystemAccessFileWriter_WriteStream_Params.encode = function(encoder, val) {
var packed;
encoder.writeUint32(FileSystemAccessFileWriter_WriteStream_Params.encodedSize);
encoder.writeUint32(0);
encoder.encodeStruct(codec.Uint64, val.offset);
encoder.encodeStruct(codec.Handle, val.stream);
encoder.skip(1);
encoder.skip(1);
encoder.skip(1);
encoder.skip(1);
};
function FileSystemAccessFileWriter_WriteStream_ResponseParams(values) {
this.initDefaults_();
this.initFields_(values);
}
FileSystemAccessFileWriter_WriteStream_ResponseParams.prototype.initDefaults_ = function() {
this.result = null;
this.bytesWritten = 0;
};
FileSystemAccessFileWriter_WriteStream_ResponseParams.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
FileSystemAccessFileWriter_WriteStream_ResponseParams.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 24}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate FileSystemAccessFileWriter_WriteStream_ResponseParams.result
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, file_system_access_error$.FileSystemAccessError, false);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
FileSystemAccessFileWriter_WriteStream_ResponseParams.encodedSize = codec.kStructHeaderSize + 16;
FileSystemAccessFileWriter_WriteStream_ResponseParams.decode = function(decoder) {
var packed;
var val = new FileSystemAccessFileWriter_WriteStream_ResponseParams();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.result =
decoder.decodeStructPointer(file_system_access_error$.FileSystemAccessError);
val.bytesWritten =
decoder.decodeStruct(codec.Uint64);
return val;
};
FileSystemAccessFileWriter_WriteStream_ResponseParams.encode = function(encoder, val) {
var packed;
encoder.writeUint32(FileSystemAccessFileWriter_WriteStream_ResponseParams.encodedSize);
encoder.writeUint32(0);
encoder.encodeStructPointer(file_system_access_error$.FileSystemAccessError, val.result);
encoder.encodeStruct(codec.Uint64, val.bytesWritten);
};
function FileSystemAccessFileWriter_Truncate_Params(values) {
this.initDefaults_();
this.initFields_(values);
}
FileSystemAccessFileWriter_Truncate_Params.prototype.initDefaults_ = function() {
this.length = 0;
};
FileSystemAccessFileWriter_Truncate_Params.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
FileSystemAccessFileWriter_Truncate_Params.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 16}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
FileSystemAccessFileWriter_Truncate_Params.encodedSize = codec.kStructHeaderSize + 8;
FileSystemAccessFileWriter_Truncate_Params.decode = function(decoder) {
var packed;
var val = new FileSystemAccessFileWriter_Truncate_Params();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.length =
decoder.decodeStruct(codec.Uint64);
return val;
};
FileSystemAccessFileWriter_Truncate_Params.encode = function(encoder, val) {
var packed;
encoder.writeUint32(FileSystemAccessFileWriter_Truncate_Params.encodedSize);
encoder.writeUint32(0);
encoder.encodeStruct(codec.Uint64, val.length);
};
function FileSystemAccessFileWriter_Truncate_ResponseParams(values) {
this.initDefaults_();
this.initFields_(values);
}
FileSystemAccessFileWriter_Truncate_ResponseParams.prototype.initDefaults_ = function() {
this.result = null;
};
FileSystemAccessFileWriter_Truncate_ResponseParams.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
FileSystemAccessFileWriter_Truncate_ResponseParams.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 16}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate FileSystemAccessFileWriter_Truncate_ResponseParams.result
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, file_system_access_error$.FileSystemAccessError, false);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
FileSystemAccessFileWriter_Truncate_ResponseParams.encodedSize = codec.kStructHeaderSize + 8;
FileSystemAccessFileWriter_Truncate_ResponseParams.decode = function(decoder) {
var packed;
var val = new FileSystemAccessFileWriter_Truncate_ResponseParams();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.result =
decoder.decodeStructPointer(file_system_access_error$.FileSystemAccessError);
return val;
};
FileSystemAccessFileWriter_Truncate_ResponseParams.encode = function(encoder, val) {
var packed;
encoder.writeUint32(FileSystemAccessFileWriter_Truncate_ResponseParams.encodedSize);
encoder.writeUint32(0);
encoder.encodeStructPointer(file_system_access_error$.FileSystemAccessError, val.result);
};
function FileSystemAccessFileWriter_Close_Params(values) {
this.initDefaults_();
this.initFields_(values);
}
FileSystemAccessFileWriter_Close_Params.prototype.initDefaults_ = function() {
};
FileSystemAccessFileWriter_Close_Params.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
FileSystemAccessFileWriter_Close_Params.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 8}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
FileSystemAccessFileWriter_Close_Params.encodedSize = codec.kStructHeaderSize + 0;
FileSystemAccessFileWriter_Close_Params.decode = function(decoder) {
var packed;
var val = new FileSystemAccessFileWriter_Close_Params();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
return val;
};
FileSystemAccessFileWriter_Close_Params.encode = function(encoder, val) {
var packed;
encoder.writeUint32(FileSystemAccessFileWriter_Close_Params.encodedSize);
encoder.writeUint32(0);
};
function FileSystemAccessFileWriter_Close_ResponseParams(values) {
this.initDefaults_();
this.initFields_(values);
}
FileSystemAccessFileWriter_Close_ResponseParams.prototype.initDefaults_ = function() {
this.result = null;
};
FileSystemAccessFileWriter_Close_ResponseParams.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
FileSystemAccessFileWriter_Close_ResponseParams.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 16}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate FileSystemAccessFileWriter_Close_ResponseParams.result
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, file_system_access_error$.FileSystemAccessError, false);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
FileSystemAccessFileWriter_Close_ResponseParams.encodedSize = codec.kStructHeaderSize + 8;
FileSystemAccessFileWriter_Close_ResponseParams.decode = function(decoder) {
var packed;
var val = new FileSystemAccessFileWriter_Close_ResponseParams();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.result =
decoder.decodeStructPointer(file_system_access_error$.FileSystemAccessError);
return val;
};
FileSystemAccessFileWriter_Close_ResponseParams.encode = function(encoder, val) {
var packed;
encoder.writeUint32(FileSystemAccessFileWriter_Close_ResponseParams.encodedSize);
encoder.writeUint32(0);
encoder.encodeStructPointer(file_system_access_error$.FileSystemAccessError, val.result);
};
function FileSystemAccessFileWriter_Abort_Params(values) {
this.initDefaults_();
this.initFields_(values);
}
FileSystemAccessFileWriter_Abort_Params.prototype.initDefaults_ = function() {
};
FileSystemAccessFileWriter_Abort_Params.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
FileSystemAccessFileWriter_Abort_Params.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 8}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
FileSystemAccessFileWriter_Abort_Params.encodedSize = codec.kStructHeaderSize + 0;
FileSystemAccessFileWriter_Abort_Params.decode = function(decoder) {
var packed;
var val = new FileSystemAccessFileWriter_Abort_Params();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
return val;
};
FileSystemAccessFileWriter_Abort_Params.encode = function(encoder, val) {
var packed;
encoder.writeUint32(FileSystemAccessFileWriter_Abort_Params.encodedSize);
encoder.writeUint32(0);
};
function FileSystemAccessFileWriter_Abort_ResponseParams(values) {
this.initDefaults_();
this.initFields_(values);
}
FileSystemAccessFileWriter_Abort_ResponseParams.prototype.initDefaults_ = function() {
this.result = null;
};
FileSystemAccessFileWriter_Abort_ResponseParams.prototype.initFields_ = function(fields) {
for(var field in fields) {
if (this.hasOwnProperty(field))
this[field] = fields[field];
}
};
FileSystemAccessFileWriter_Abort_ResponseParams.validate = function(messageValidator, offset) {
var err;
err = messageValidator.validateStructHeader(offset, codec.kStructHeaderSize);
if (err !== validator.validationError.NONE)
return err;
var kVersionSizes = [
{version: 0, numBytes: 16}
];
err = messageValidator.validateStructVersion(offset, kVersionSizes);
if (err !== validator.validationError.NONE)
return err;
// validate FileSystemAccessFileWriter_Abort_ResponseParams.result
err = messageValidator.validateStructPointer(offset + codec.kStructHeaderSize + 0, file_system_access_error$.FileSystemAccessError, false);
if (err !== validator.validationError.NONE)
return err;
return validator.validationError.NONE;
};
FileSystemAccessFileWriter_Abort_ResponseParams.encodedSize = codec.kStructHeaderSize + 8;
FileSystemAccessFileWriter_Abort_ResponseParams.decode = function(decoder) {
var packed;
var val = new FileSystemAccessFileWriter_Abort_ResponseParams();
var numberOfBytes = decoder.readUint32();
var version = decoder.readUint32();
val.result =
decoder.decodeStructPointer(file_system_access_error$.FileSystemAccessError);
return val;
};
FileSystemAccessFileWriter_Abort_ResponseParams.encode = function(encoder, val) {
var packed;
encoder.writeUint32(FileSystemAccessFileWriter_Abort_ResponseParams.encodedSize);
encoder.writeUint32(0);
encoder.encodeStructPointer(file_system_access_error$.FileSystemAccessError, val.result);
};
var kFileSystemAccessFileWriter_Write_Name = 0;
var kFileSystemAccessFileWriter_WriteStream_Name = 1;
var kFileSystemAccessFileWriter_Truncate_Name = 2;
var kFileSystemAccessFileWriter_Close_Name = 3;
var kFileSystemAccessFileWriter_Abort_Name = 4;
function FileSystemAccessFileWriterPtr(handleOrPtrInfo) {
this.ptr = new bindings.InterfacePtrController(FileSystemAccessFileWriter,
handleOrPtrInfo);
}
function FileSystemAccessFileWriterAssociatedPtr(associatedInterfacePtrInfo) {
this.ptr = new associatedBindings.AssociatedInterfacePtrController(
FileSystemAccessFileWriter, associatedInterfacePtrInfo);
}
FileSystemAccessFileWriterAssociatedPtr.prototype =
Object.create(FileSystemAccessFileWriterPtr.prototype);
FileSystemAccessFileWriterAssociatedPtr.prototype.constructor =
FileSystemAccessFileWriterAssociatedPtr;
function FileSystemAccessFileWriterProxy(receiver) {
this.receiver_ = receiver;
}
FileSystemAccessFileWriterPtr.prototype.write = function() {
return FileSystemAccessFileWriterProxy.prototype.write
.apply(this.ptr.getProxy(), arguments);
};
FileSystemAccessFileWriterProxy.prototype.write = function(offset, data) {
var params_ = new FileSystemAccessFileWriter_Write_Params();
params_.offset = offset;
params_.data = data;
return new Promise(function(resolve, reject) {
var builder = new codec.MessageV1Builder(
kFileSystemAccessFileWriter_Write_Name,
codec.align(FileSystemAccessFileWriter_Write_Params.encodedSize),
codec.kMessageExpectsResponse, 0);
builder.encodeStruct(FileSystemAccessFileWriter_Write_Params, params_);
var message = builder.finish();
this.receiver_.acceptAndExpectResponse(message).then(function(message) {
var reader = new codec.MessageReader(message);
var responseParams =
reader.decodeStruct(FileSystemAccessFileWriter_Write_ResponseParams);
resolve(responseParams);
}).catch(function(result) {
reject(Error("Connection error: " + result));
});
}.bind(this));
};
FileSystemAccessFileWriterPtr.prototype.writeStream = function() {
return FileSystemAccessFileWriterProxy.prototype.writeStream
.apply(this.ptr.getProxy(), arguments);
};
FileSystemAccessFileWriterProxy.prototype.writeStream = function(offset, stream) {
var params_ = new FileSystemAccessFileWriter_WriteStream_Params();
params_.offset = offset;
params_.stream = stream;
return new Promise(function(resolve, reject) {
var builder = new codec.MessageV1Builder(
kFileSystemAccessFileWriter_WriteStream_Name,
codec.align(FileSystemAccessFileWriter_WriteStream_Params.encodedSize),
codec.kMessageExpectsResponse, 0);
builder.encodeStruct(FileSystemAccessFileWriter_WriteStream_Params, params_);
var message = builder.finish();
this.receiver_.acceptAndExpectResponse(message).then(function(message) {
var reader = new codec.MessageReader(message);
var responseParams =
reader.decodeStruct(FileSystemAccessFileWriter_WriteStream_ResponseParams);
resolve(responseParams);
}).catch(function(result) {
reject(Error("Connection error: " + result));
});
}.bind(this));
};
FileSystemAccessFileWriterPtr.prototype.truncate = function() {
return FileSystemAccessFileWriterProxy.prototype.truncate
.apply(this.ptr.getProxy(), arguments);
};
FileSystemAccessFileWriterProxy.prototype.truncate = function(length) {
var params_ = new FileSystemAccessFileWriter_Truncate_Params();
params_.length = length;
return new Promise(function(resolve, reject) {
var builder = new codec.MessageV1Builder(
kFileSystemAccessFileWriter_Truncate_Name,
codec.align(FileSystemAccessFileWriter_Truncate_Params.encodedSize),
codec.kMessageExpectsResponse, 0);
builder.encodeStruct(FileSystemAccessFileWriter_Truncate_Params, params_);
var message = builder.finish();
this.receiver_.acceptAndExpectResponse(message).then(function(message) {
var reader = new codec.MessageReader(message);
var responseParams =
reader.decodeStruct(FileSystemAccessFileWriter_Truncate_ResponseParams);
resolve(responseParams);
}).catch(function(result) {
reject(Error("Connection error: " + result));
});
}.bind(this));
};
FileSystemAccessFileWriterPtr.prototype.close = function() {
return FileSystemAccessFileWriterProxy.prototype.close
.apply(this.ptr.getProxy(), arguments);
};
FileSystemAccessFileWriterProxy.prototype.close = function() {
var params_ = new FileSystemAccessFileWriter_Close_Params();
return new Promise(function(resolve, reject) {
var builder = new codec.MessageV1Builder(
kFileSystemAccessFileWriter_Close_Name,
codec.align(FileSystemAccessFileWriter_Close_Params.encodedSize),
codec.kMessageExpectsResponse, 0);
builder.encodeStruct(FileSystemAccessFileWriter_Close_Params, params_);
var message = builder.finish();
this.receiver_.acceptAndExpectResponse(message).then(function(message) {
var reader = new codec.MessageReader(message);
var responseParams =
reader.decodeStruct(FileSystemAccessFileWriter_Close_ResponseParams);
resolve(responseParams);
}).catch(function(result) {
reject(Error("Connection error: " + result));
});
}.bind(this));
};
FileSystemAccessFileWriterPtr.prototype.abort = function() {
return FileSystemAccessFileWriterProxy.prototype.abort
.apply(this.ptr.getProxy(), arguments);
};
FileSystemAccessFileWriterProxy.prototype.abort = function() {
var params_ = new FileSystemAccessFileWriter_Abort_Params();
return new Promise(function(resolve, reject) {
var builder = new codec.MessageV1Builder(
kFileSystemAccessFileWriter_Abort_Name,
codec.align(FileSystemAccessFileWriter_Abort_Params.encodedSize),
codec.kMessageExpectsResponse, 0);
builder.encodeStruct(FileSystemAccessFileWriter_Abort_Params, params_);
var message = builder.finish();
this.receiver_.acceptAndExpectResponse(message).then(function(message) {
var reader = new codec.MessageReader(message);
var responseParams =
reader.decodeStruct(FileSystemAccessFileWriter_Abort_ResponseParams);
resolve(responseParams);
}).catch(function(result) {
reject(Error("Connection error: " + result));
});
}.bind(this));
};
function FileSystemAccessFileWriterStub(delegate) {
this.delegate_ = delegate;
}
FileSystemAccessFileWriterStub.prototype.write = function(offset, data) {
return this.delegate_ && this.delegate_.write && this.delegate_.write(offset, data);
}
FileSystemAccessFileWriterStub.prototype.writeStream = function(offset, stream) {
return this.delegate_ && this.delegate_.writeStream && this.delegate_.writeStream(offset, stream);
}
FileSystemAccessFileWriterStub.prototype.truncate = function(length) {
return this.delegate_ && this.delegate_.truncate && this.delegate_.truncate(length);
}
FileSystemAccessFileWriterStub.prototype.close = function() {
return this.delegate_ && this.delegate_.close && this.delegate_.close();
}
FileSystemAccessFileWriterStub.prototype.abort = function() {
return this.delegate_ && this.delegate_.abort && this.delegate_.abort();
}
FileSystemAccessFileWriterStub.prototype.accept = function(message) {
var reader = new codec.MessageReader(message);
switch (reader.messageName) {
default:
return false;
}
};
FileSystemAccessFileWriterStub.prototype.acceptWithResponder =
function(message, responder) {
var reader = new codec.MessageReader(message);
switch (reader.messageName) {
case kFileSystemAccessFileWriter_Write_Name:
var params = reader.decodeStruct(FileSystemAccessFileWriter_Write_Params);
this.write(params.offset, params.data).then(function(response) {
var responseParams =
new FileSystemAccessFileWriter_Write_ResponseParams();
responseParams.result = response.result;
responseParams.bytesWritten = response.bytesWritten;
var builder = new codec.MessageV1Builder(
kFileSystemAccessFileWriter_Write_Name,
codec.align(FileSystemAccessFileWriter_Write_ResponseParams.encodedSize),
codec.kMessageIsResponse, reader.requestID);
builder.encodeStruct(FileSystemAccessFileWriter_Write_ResponseParams,
responseParams);
var message = builder.finish();
responder.accept(message);
});
return true;
case kFileSystemAccessFileWriter_WriteStream_Name:
var params = reader.decodeStruct(FileSystemAccessFileWriter_WriteStream_Params);
this.writeStream(params.offset, params.stream).then(function(response) {
var responseParams =
new FileSystemAccessFileWriter_WriteStream_ResponseParams();
responseParams.result = response.result;
responseParams.bytesWritten = response.bytesWritten;
var builder = new codec.MessageV1Builder(
kFileSystemAccessFileWriter_WriteStream_Name,
codec.align(FileSystemAccessFileWriter_WriteStream_ResponseParams.encodedSize),
codec.kMessageIsResponse, reader.requestID);
builder.encodeStruct(FileSystemAccessFileWriter_WriteStream_ResponseParams,
responseParams);
var message = builder.finish();
responder.accept(message);
});
return true;
case kFileSystemAccessFileWriter_Truncate_Name:
var params = reader.decodeStruct(FileSystemAccessFileWriter_Truncate_Params);
this.truncate(params.length).then(function(response) {
var responseParams =
new FileSystemAccessFileWriter_Truncate_ResponseParams();
responseParams.result = response.result;
var builder = new codec.MessageV1Builder(
kFileSystemAccessFileWriter_Truncate_Name,
codec.align(FileSystemAccessFileWriter_Truncate_ResponseParams.encodedSize),
codec.kMessageIsResponse, reader.requestID);
builder.encodeStruct(FileSystemAccessFileWriter_Truncate_ResponseParams,
responseParams);
var message = builder.finish();
responder.accept(message);
});
return true;
case kFileSystemAccessFileWriter_Close_Name:
var params = reader.decodeStruct(FileSystemAccessFileWriter_Close_Params);
this.close().then(function(response) {
var responseParams =
new FileSystemAccessFileWriter_Close_ResponseParams();
responseParams.result = response.result;
var builder = new codec.MessageV1Builder(
kFileSystemAccessFileWriter_Close_Name,
codec.align(FileSystemAccessFileWriter_Close_ResponseParams.encodedSize),
codec.kMessageIsResponse, reader.requestID);
builder.encodeStruct(FileSystemAccessFileWriter_Close_ResponseParams,
responseParams);
var message = builder.finish();
responder.accept(message);
});
return true;
case kFileSystemAccessFileWriter_Abort_Name:
var params = reader.decodeStruct(FileSystemAccessFileWriter_Abort_Params);
this.abort().then(function(response) {
var responseParams =
new FileSystemAccessFileWriter_Abort_ResponseParams();
responseParams.result = response.result;
var builder = new codec.MessageV1Builder(
kFileSystemAccessFileWriter_Abort_Name,
codec.align(FileSystemAccessFileWriter_Abort_ResponseParams.encodedSize),
codec.kMessageIsResponse, reader.requestID);
builder.encodeStruct(FileSystemAccessFileWriter_Abort_ResponseParams,
responseParams);
var message = builder.finish();
responder.accept(message);
});
return true;
default:
return false;
}
};
function validateFileSystemAccessFileWriterRequest(messageValidator) {
var message = messageValidator.message;
var paramsClass = null;
switch (message.getName()) {
case kFileSystemAccessFileWriter_Write_Name:
if (message.expectsResponse())
paramsClass = FileSystemAccessFileWriter_Write_Params;
break;
case kFileSystemAccessFileWriter_WriteStream_Name:
if (message.expectsResponse())
paramsClass = FileSystemAccessFileWriter_WriteStream_Params;
break;
case kFileSystemAccessFileWriter_Truncate_Name:
if (message.expectsResponse())
paramsClass = FileSystemAccessFileWriter_Truncate_Params;
break;
case kFileSystemAccessFileWriter_Close_Name:
if (message.expectsResponse())
paramsClass = FileSystemAccessFileWriter_Close_Params;
break;
case kFileSystemAccessFileWriter_Abort_Name:
if (message.expectsResponse())
paramsClass = FileSystemAccessFileWriter_Abort_Params;
break;
}
if (paramsClass === null)
return validator.validationError.NONE;
return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes());
}
function validateFileSystemAccessFileWriterResponse(messageValidator) {
var message = messageValidator.message;
var paramsClass = null;
switch (message.getName()) {
case kFileSystemAccessFileWriter_Write_Name:
if (message.isResponse())
paramsClass = FileSystemAccessFileWriter_Write_ResponseParams;
break;
case kFileSystemAccessFileWriter_WriteStream_Name:
if (message.isResponse())
paramsClass = FileSystemAccessFileWriter_WriteStream_ResponseParams;
break;
case kFileSystemAccessFileWriter_Truncate_Name:
if (message.isResponse())
paramsClass = FileSystemAccessFileWriter_Truncate_ResponseParams;
break;
case kFileSystemAccessFileWriter_Close_Name:
if (message.isResponse())
paramsClass = FileSystemAccessFileWriter_Close_ResponseParams;
break;
case kFileSystemAccessFileWriter_Abort_Name:
if (message.isResponse())
paramsClass = FileSystemAccessFileWriter_Abort_ResponseParams;
break;
}
if (paramsClass === null)
return validator.validationError.NONE;
return paramsClass.validate(messageValidator, messageValidator.message.getHeaderNumBytes());
}
var FileSystemAccessFileWriter = {
name: 'blink.mojom.FileSystemAccessFileWriter',
kVersion: 0,
ptrClass: FileSystemAccessFileWriterPtr,
proxyClass: FileSystemAccessFileWriterProxy,
stubClass: FileSystemAccessFileWriterStub,
validateRequest: validateFileSystemAccessFileWriterRequest,
validateResponse: validateFileSystemAccessFileWriterResponse,
};
FileSystemAccessFileWriterStub.prototype.validator = validateFileSystemAccessFileWriterRequest;
FileSystemAccessFileWriterProxy.prototype.validator = validateFileSystemAccessFileWriterResponse;
exports.FileSystemAccessFileWriter = FileSystemAccessFileWriter;
exports.FileSystemAccessFileWriterPtr = FileSystemAccessFileWriterPtr;
exports.FileSystemAccessFileWriterAssociatedPtr = FileSystemAccessFileWriterAssociatedPtr;
})(); | 38.58811 | 154 | 0.736561 |
f14c27f6533c6dca09147d6c61d29bc4d63829b7 | 6,180 | rb | Ruby | test/lib/docparser/parser_test.rb | jurriaan/docparser | 0a0a9cbcbbfb5b3fc4555a85e614990a4ba6b86f | [
"MIT"
] | 10 | 2015-01-10T12:46:32.000Z | 2021-04-08T22:41:09.000Z | test/lib/docparser/parser_test.rb | jurriaan/docparser | 0a0a9cbcbbfb5b3fc4555a85e614990a4ba6b86f | [
"MIT"
] | 51 | 2020-04-17T18:49:59.000Z | 2021-08-03T04:46:49.000Z | test/lib/docparser/parser_test.rb | jurriaan/docparser | 0a0a9cbcbbfb5b3fc4555a85e614990a4ba6b86f | [
"MIT"
] | 1 | 2015-07-08T23:30:36.000Z | 2015-07-08T23:30:36.000Z | # frozen_string_literal: true
require_relative '../../test_helper'
describe DocParser::Parser do
before do
SimpleCov.at_exit {}
end
after do
SimpleCov.at_exit do
SimpleCov.result.format!
end
end
it 'should initialize correctly' do
parser = DocParser::Parser.new(quiet: true)
parser.must_be_instance_of DocParser::Parser
end
it 'should only process the files in range' do
files = (0..20).map { |i| "file_#{i}" }
parser = DocParser::Parser.new(quiet: true,
files: files,
range: 0...10)
parser.files.length.must_equal 10
parser.files.must_equal files[0...10]
end
it 'should set the correct number of processes' do
parser = DocParser::Parser.new(quiet: true)
default = Parallel.processor_count + 1
parser.num_processes.must_equal(default)
parser = DocParser::Parser.new(quiet: true,
num_processes: 4,
parallel: false)
parser.num_processes.must_equal(1)
parser = DocParser::Parser.new(quiet: true,
num_processes: 4,
parallel: true)
parser.num_processes.must_equal(4)
end
it 'should set the correct encoding' do
parser = DocParser::Parser.new(quiet: true)
parser.encoding.must_equal 'utf-8'
parser = DocParser::Parser.new(quiet: true, encoding: 'iso-8859-1')
parser.encoding.must_equal 'iso-8859-1'
file = Tempfile.new('foo')
file.write('<html />')
file.close
parser = DocParser::Parser.new(quiet: true, encoding: 'iso-8859-1',
files: [file.path],
parallel: false)
parser.parse! do
$encoding = encoding
end
$encoding.must_equal 'iso-8859-1'
end
it 'should give an Exception if output is not supported' do
lambda do
DocParser::Parser.new(quiet: true, output: 1)
end.must_raise(ArgumentError)
end
it 'should support one output' do
mock_output = SimpleMock.new DocParser::NilOutput.new
mock_output.expect :close, nil
mock_output.expect :is_a?, true, [DocParser::Output]
testfile = File.join($SUPPORT_DIR, 'test_html.html')
parser = DocParser::Parser.new(quiet: true, encoding: 'iso-8859-1',
files: [testfile],
parallel: false,
output: mock_output)
parser.parse! do
# do nothing
end
mock_output.verify.must_equal true
end
it 'should support multiple outputs' do
mock_output = SimpleMock.new DocParser::NilOutput.new
mock_output.expect :close, nil
mock_output.expect :is_a?, true, [DocParser::Output]
mock_output2 = SimpleMock.new DocParser::NilOutput.new
mock_output2.expect :close, nil
mock_output2.expect :is_a?, true, [DocParser::Output]
testfile = File.join($SUPPORT_DIR, 'test_html.html')
parser = DocParser::Parser.new(quiet: true, encoding: 'iso-8859-1',
files: [testfile],
parallel: false,
output: [mock_output, mock_output2])
parser.parse! do
# do nothing
end
parser.outputs.length.must_equal 2
mock_output.verify.must_equal true
mock_output2.verify.must_equal true
end
it 'should write to the outputs' do
mock_output = SimpleMock.new DocParser::NilOutput.new
mock_output.expect :close, nil
mock_output.expect :is_a?, true, [DocParser::Output]
mock_output.expect :add_row, true, [['output 0']]
mock_output2 = SimpleMock.new DocParser::NilOutput.new
mock_output2.expect :close, nil
mock_output2.expect :is_a?, true, [DocParser::Output]
mock_output2.expect :add_row, true, [['output 1']]
testfile = File.join($SUPPORT_DIR, 'test_html.html')
parser = DocParser::Parser.new(quiet: true, encoding: 'iso-8859-1',
files: [testfile],
parallel: false,
output: [mock_output, mock_output2])
parser.parse! do
add_row 'output 0', output: 0
add_row 'output 1', output: 1
end
parser.outputs.length.must_equal 2
mock_output.verify.must_equal true
mock_output2.verify.must_equal true
end
it 'should write to the outputs directly' do
mock_output = SimpleMock.new DocParser::NilOutput.new
mock_output.expect :close, nil
mock_output.expect :is_a?, true, [DocParser::Output]
mock_output.expect :add_row, true, [['output 0']]
mock_output2 = SimpleMock.new DocParser::NilOutput.new
mock_output2.expect :close, nil
mock_output2.expect :is_a?, true, [DocParser::Output]
mock_output2.expect :add_row, true, [['output 1']]
testfile = File.join($SUPPORT_DIR, 'test_html.html')
parser = DocParser::Parser.new(quiet: true, encoding: 'iso-8859-1',
files: [testfile],
parallel: false,
output: [mock_output, mock_output2])
parser.parse! do
add_row 'output 1', output: mock_output2
add_row 'output 0', output: mock_output
end
parser.outputs.length.must_equal 2
mock_output.verify.must_equal true
mock_output2.verify.must_equal true
end
it 'should support parallel processing' do
mock_output = SimpleMock.new DocParser::NilOutput.new
mock_output.expect :close, nil
mock_output.expect :is_a?, true, [DocParser::Output]
mock_output.expect :add_row, nil, [['Test HTML']]
mock_output.expect :add_row, nil, [['Test HTML']]
testfile = File.join($SUPPORT_DIR, 'test_html.html')
DocParser::Kernel = SimpleMock.new Kernel
parser = DocParser::Parser.new(quiet: true, encoding: 'iso-8859-1',
files: [testfile, testfile],
parallel: true,
output: mock_output)
parser.parse! do
add_row title
end
mock_output.verify.must_equal true
end
end
| 37.005988 | 71 | 0.612136 |
0cc7dbac1b53714dc8579ed543f77deb34610c57 | 1,705 | py | Python | src/users/management/commands/populate_tables.py | pimpale/BQuest-Backend | b32833ee5053db1c47fa28f57273632eae43a5cc | [
"MIT"
] | null | null | null | src/users/management/commands/populate_tables.py | pimpale/BQuest-Backend | b32833ee5053db1c47fa28f57273632eae43a5cc | [
"MIT"
] | 51 | 2018-01-24T05:53:15.000Z | 2022-01-13T00:44:24.000Z | src/users/management/commands/populate_tables.py | pimpale/BQuest-Backend | b32833ee5053db1c47fa28f57273632eae43a5cc | [
"MIT"
] | 3 | 2020-04-22T03:21:37.000Z | 2020-12-15T22:45:52.000Z | from django.core.management.base import BaseCommand
from users.models import Major, Minor, Course
from django.db import IntegrityError
from os import path
import json
class Command(BaseCommand):
def _create_majors(self):
base_path = path.dirname(__file__)
majors_path = path.abspath(path.join(base_path, "..", "..", "majors.json"))
with open(majors_path) as majors_file:
majors = json.load(majors_file)
for major in majors:
major_entry = Major(name=major)
try:
major_entry.save()
except IntegrityError:
pass
def _create_minors(self):
base_path = path.dirname(__file__)
minors_path = path.abspath(path.join(base_path, "..", "..", "minors.json"))
with open(minors_path) as minors_file:
minors = json.load(minors_file)
for minor in minors:
minor_entry = Minor(name=minor)
try:
minor_entry.save()
except IntegrityError:
pass
def _create_courses(self):
base_path = path.dirname(__file__)
courses_path = path.abspath(path.join(base_path, "..", "..", "courses.json"))
with open(courses_path) as courses_file:
courses = json.load(courses_file)
for course in courses:
course_entry = Course(name=course)
try:
course_entry.save()
except IntegrityError:
pass
def handle(self, *args, **kwargs):
self._create_majors()
self._create_minors()
self._create_courses() | 32.788462 | 85 | 0.567742 |
7557348eee56033c0110116118f50d994182d992 | 96 | h | C | td02/td02b/proj/Bibliotheques/Tri/sort.h | zdimension/tdsys | c248b3dfaacb89436db88461f5d47ba68122e603 | [
"MIT"
] | 1 | 2021-05-12T18:39:18.000Z | 2021-05-12T18:39:18.000Z | td02/td02b/proj/Bibliotheques/Tri/sort.h | zdimension/tdsys | c248b3dfaacb89436db88461f5d47ba68122e603 | [
"MIT"
] | null | null | null | td02/td02b/proj/Bibliotheques/Tri/sort.h | zdimension/tdsys | c248b3dfaacb89436db88461f5d47ba68122e603 | [
"MIT"
] | 6 | 2021-05-13T12:20:41.000Z | 2022-03-23T09:09:35.000Z | #ifndef _SORT_H_
#define _SORT_H_
_declspec(dllexport) void sort(int list[], int size);
#endif | 16 | 53 | 0.760417 |
fb0685bfee6b40f3b78bf49ec43e568304d046c0 | 5,316 | h | C | lib/python/util.h | pathak22/ccnn | aa3d3b2b0c194640fc2b887dbff04d9a5c032392 | [
"BSD-4-Clause-UC"
] | 69 | 2015-12-10T15:23:19.000Z | 2021-05-18T06:36:34.000Z | lib/python/util.h | chocl8camellia/ccnn | aa3d3b2b0c194640fc2b887dbff04d9a5c032392 | [
"BSD-4-Clause-UC"
] | 3 | 2016-05-31T19:31:31.000Z | 2018-07-25T09:14:11.000Z | lib/python/util.h | chocl8camellia/ccnn | aa3d3b2b0c194640fc2b887dbff04d9a5c032392 | [
"BSD-4-Clause-UC"
] | 30 | 2015-12-09T22:48:23.000Z | 2020-01-05T20:35:50.000Z | // --------------------------------------------------------
// CCNN
// 2015. Modified by Deepak Pathak, Philipp Krähenbühl
// --------------------------------------------------------
/*
Copyright (c) 2014, Philipp Krähenbühl
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 conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the Stanford University nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY Philipp Krähenbühl ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL Philipp Krähenbühl BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include <boost/version.hpp>
#include <boost/python.hpp>
#include <stdexcept>
#include <memory>
#include <vector>
using namespace boost::python;
// Make older boost versions happy
#if BOOST_VERSION < 105300
template<typename T> T* get_pointer(const std::shared_ptr<T>& p) { return p.get(); }
#endif
template<typename OBJ>
struct SaveLoad_pickle_suite : pickle_suite {
static object getstate(const OBJ& obj) {
std::stringstream ss;
obj.save( ss );
std::string data = ss.str();
return object( handle<>( PyBytes_FromStringAndSize( data.data(), data.size() ) ) );
}
static void setstate(OBJ& obj, const object & state) {
if(!PyBytes_Check(state.ptr()))
throw std::invalid_argument("Failed to unpickle, unexpected type!");
std::stringstream ss( std::string( PyBytes_AS_STRING(state.ptr()), PyBytes_Size(state.ptr()) ) );
obj.load( ss );
}
};
template<typename OBJ>
struct SaveLoad_pickle_suite_shared_ptr : pickle_suite {
static object getstate(const std::shared_ptr<OBJ>& obj) {
std::stringstream ss;
obj->save( ss );
std::string data = ss.str();
return object( handle<>( PyBytes_FromStringAndSize( data.data(), data.size() ) ) );
}
static void setstate(std::shared_ptr<OBJ> obj, const object & state) {
if(!PyBytes_Check(state.ptr()))
throw std::invalid_argument("Failed to unpickle, unexpected type!");
std::stringstream ss( std::string( PyBytes_AS_STRING(state.ptr()), PyBytes_Size(state.ptr()) ) );
obj->load( ss );
}
};
template<typename OBJ>
struct VectorSaveLoad_pickle_suite_shared_ptr : pickle_suite {
static object getstate(const std::vector< std::shared_ptr<OBJ> > & obj) {
std::stringstream ss;
const int nobj = obj.size();
ss.write( (const char*)&nobj, sizeof(nobj) );
for( int i=0; i<nobj; i++ )
obj[i]->save( ss );
std::string data = ss.str();
return object( handle<>( PyBytes_FromStringAndSize( data.data(), data.size() ) ) );
}
static void setstate(std::vector< std::shared_ptr<OBJ> > & obj, const object & state) {
if(!PyBytes_Check(state.ptr()))
throw std::invalid_argument("Failed to unpickle, unexpected type!");
std::stringstream ss( std::string( PyBytes_AS_STRING(state.ptr()), PyBytes_Size(state.ptr()) ) );
int nobj = 0;
ss.read( (char*)&nobj, sizeof(nobj) );
obj.resize( nobj );
for( int i=0; i<nobj; i++ ) {
obj[i] = std::make_shared<OBJ>();
obj[i]->load( ss );
}
}
};
template<typename T>
struct VectorInitSuite: public def_visitor< VectorInitSuite<T> > {
typedef typename T::value_type D;
static T * init_list( const list & l ) {
T * r = new T;
const int N = len(l);
for ( int i=0; i<N; i++ )
(*r).push_back( extract<D>(l[i]) );
return r;
}
// template <class C> static C * init_list( const list & l ) {
// C * r = new C;
// const int N = len(l);
// for ( int i=0; i<N; i++ )
// (*r).push_back( extract<D>(l[i]) );
// return r;
// }
template <class C>
void visit(C& cl) const
{
cl
.def("__init__", make_constructor(&VectorInitSuite<T>::init_list));
// .def("__init__", make_constructor(&init_generator));
}
};
template<typename T>
std::vector<T> to_vector( const list & l ) {
std::vector<T> r;
for( int i=0; i<len(l); i++ )
r.push_back( extract<T>(l[i]) );
return r;
}
void defineUtil();
class ScopedGILRelease
{
public:
inline ScopedGILRelease() {
m_thread_state = PyEval_SaveThread();
}
inline ~ScopedGILRelease() {
PyEval_RestoreThread(m_thread_state);
m_thread_state = NULL;
}
private:
PyThreadState * m_thread_state;
ScopedGILRelease( const ScopedGILRelease & o ) { }
};
| 34.076923 | 99 | 0.680399 |
5c592ecd0153071a02ffa5c9648cec73418c114f | 436 | h | C | src/settings.h | cfrank/shot | d188752c1c850a6f16b272364ca716cbe13ed698 | [
"BSD-3-Clause"
] | 1 | 2018-04-13T16:34:05.000Z | 2018-04-13T16:34:05.000Z | src/settings.h | cfrank/shot | d188752c1c850a6f16b272364ca716cbe13ed698 | [
"BSD-3-Clause"
] | null | null | null | src/settings.h | cfrank/shot | d188752c1c850a6f16b272364ca716cbe13ed698 | [
"BSD-3-Clause"
] | null | null | null | #pragma once
#include <stdbool.h>
#include <stdint.h>
enum scrot_type {
CUSTOM,
FULL,
SCREEN,
WINDOW,
};
struct settings {
enum scrot_type type;
const char *dimensions;
uint32_t timeout;
int8_t screen_num;
const char *custom_out;
bool flush;
};
static struct settings *init_settings(void);
static void destroy_settings(struct settings *shot_settings);
| 18.166667 | 61 | 0.630734 |
18e2a7e24af24ce805292881677bfa2f55e1f8a1 | 114 | sql | SQL | src/test/resources/sql/create_function/4c400f05.sql | Shuttl-Tech/antlr_psql | fcf83192300abe723f3fd3709aff5b0c8118ad12 | [
"MIT"
] | 66 | 2018-06-15T11:34:03.000Z | 2022-03-16T09:24:49.000Z | src/test/resources/sql/create_function/4c400f05.sql | Shuttl-Tech/antlr_psql | fcf83192300abe723f3fd3709aff5b0c8118ad12 | [
"MIT"
] | 13 | 2019-03-19T11:56:28.000Z | 2020-08-05T04:20:50.000Z | src/test/resources/sql/create_function/4c400f05.sql | Shuttl-Tech/antlr_psql | fcf83192300abe723f3fd3709aff5b0c8118ad12 | [
"MIT"
] | 28 | 2019-01-05T19:59:02.000Z | 2022-03-24T11:55:50.000Z | -- file:plpgsql.sql ln:2157 expect:true
create function missing_return_expr() returns int as $$
begin
return
| 22.8 | 55 | 0.754386 |
3dcff636c7ece9518436287327f5d47c335f8b08 | 149 | rs | Rust | packages/core/src/lib.rs | flix477/rustyboy | 1ab3b588eae0964939fae3ec3f5b202693e50173 | [
"MIT"
] | 6 | 2019-02-07T02:02:46.000Z | 2020-05-20T20:35:58.000Z | packages/core/src/lib.rs | flix477/rustyboy | 1ab3b588eae0964939fae3ec3f5b202693e50173 | [
"MIT"
] | 15 | 2019-07-06T02:19:27.000Z | 2022-02-26T11:50:57.000Z | packages/core/src/lib.rs | flix477/rustyboy | 1ab3b588eae0964939fae3ec3f5b202693e50173 | [
"MIT"
] | null | null | null | pub mod bus;
pub mod cartridge;
pub mod config;
pub mod debugger;
pub mod gameboy;
pub mod hardware;
pub mod processor;
pub mod util;
pub mod video;
| 14.9 | 18 | 0.758389 |
ddf337831b185d9f46faeddb2b66d8a8637fd231 | 936 | php | PHP | application/views/templates/categories_box.php | vuonghuynhthanhtu/administrator.lacasa.com | 8021ad6122241f05fe2c9fe42c94f3f3dac31c4f | [
"MIT"
] | null | null | null | application/views/templates/categories_box.php | vuonghuynhthanhtu/administrator.lacasa.com | 8021ad6122241f05fe2c9fe42c94f3f3dac31c4f | [
"MIT"
] | null | null | null | application/views/templates/categories_box.php | vuonghuynhthanhtu/administrator.lacasa.com | 8021ad6122241f05fe2c9fe42c94f3f3dac31c4f | [
"MIT"
] | null | null | null | <div class="category-box multiple">
<?php foreach ($categories_limit as $key => $category): ?>
<?php
$count = count($categories_limit);
if ($count == 3 || $key == 0):
$col = 'col-md-6 col-sm-6';
else:
$col = 'col-md-3 col-sm-3';
endif;
?>
<?php if ($count > 0) : ?>
<div class="categories-item <?php echo $col ?>">
<div class="category-wrapper">
<div class="category-button">
<a href="<?php echo base_url() . 'category' . '/' . $category['cat_id']; ?>" class="btn btn-default"><?php echo $category['cat_name'] ?></a>
</div>
<div class="category-bg" style="background: url(<?php echo base_url() . $category['cat_imageurl'] ?>) no-repeat center center; background-size: cover;">
<img style="opacity: 0; visibility: hidden;" src="<?php echo base_url() . $category['cat_imageurl'] ?>" alt="<?php echo $category['cat_name'] ?>">
</div>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
</div> | 37.44 | 155 | 0.598291 |
d03ba23e3d7b423e4bb62b38b579e0db8af13a7f | 1,473 | css | CSS | styles/components/Hero.module.css | yokoyamahirokazu/ltd_nextjs | 20bac0ded0ce2dc2b8edd1d40715d388d4f25c90 | [
"Apache-2.0"
] | null | null | null | styles/components/Hero.module.css | yokoyamahirokazu/ltd_nextjs | 20bac0ded0ce2dc2b8edd1d40715d388d4f25c90 | [
"Apache-2.0"
] | null | null | null | styles/components/Hero.module.css | yokoyamahirokazu/ltd_nextjs | 20bac0ded0ce2dc2b8edd1d40715d388d4f25c90 | [
"Apache-2.0"
] | null | null | null | .hero {
width: 100%;
height: 50vw;
max-height: 640px;
background-color: #ddd;
position: relative;
background-color: var(--secondary-Main);
}
.heroInner {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
display: flex;
align-items: center;
justify-content: flex-start;
}
.heroContent {
width: 100%;
box-sizing: content-box;
padding: 4vw;
margin: 0 auto;
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
.heroCopy {
font-size: 5vw;
letter-spacing: 0.5rem;
font-weight: normal;
color: #fff;
order: 1;
display: block;
margin: 0 4vw 0 0;
}
.heroImg {
width: 40vw;
max-width: 360px;
position: relative;
order: 2;
}
.heroImg::before {
padding: 134% 0 0 0;
display: block;
content: ' ';
}
.heroImgInner {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
}
@media screen and (min-width: 1400px) {
.heroCopy {
font-size: 70px;
}
}
@media screen and (max-width: 1100px) {
.heroImg {
max-width: 30vw;
}
}
@media screen and (max-width: 480px) {
.hero {
height: 161vw;
}
.heroInner {
display: flex;
}
.heroContent {
width: 100%;
padding: 30px;
margin: 0 auto;
text-align: center;
flex-wrap: wrap;
align-items: center;
}
.heroCopy {
font-size: 9vw;
letter-spacing: 0.1rem;
margin: 0;
}
.heroImg {
width: 100%;
max-width: 50vw;
margin: 30px auto 0;
}
}
| 14.441176 | 42 | 0.600136 |
c1d6d26b44b81182cffeb127379499d58d0e82ef | 2,614 | sql | SQL | app/Common/Custom/dbinit/cms_single_page.sql | realphp/fund | d975784b31c7be81a0dd4cb562fac1a0e591a223 | [
"Apache-2.0"
] | null | null | null | app/Common/Custom/dbinit/cms_single_page.sql | realphp/fund | d975784b31c7be81a0dd4cb562fac1a0e591a223 | [
"Apache-2.0"
] | null | null | null | app/Common/Custom/dbinit/cms_single_page.sql | realphp/fund | d975784b31c7be81a0dd4cb562fac1a0e591a223 | [
"Apache-2.0"
] | null | null | null | DROP TABLE IF EXISTS <--db-prefix-->cms_single_page;
CREATE TABLE `<--db-prefix-->cms_single_page` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`url` varchar(200) NOT NULL DEFAULT '' COMMENT '访问URL路径',
`title` varchar(200) NOT NULL DEFAULT '' COMMENT '页面标题',
`keywords` varchar(200) DEFAULT '' COMMENT '页面关键词(Keywords)',
`description` text COMMENT '页面描述(Description)',
`content` text COMMENT '内容',
PRIMARY KEY (`id`),
KEY `url` (`url`),
KEY `title` (`title`),
KEY `keywords` (`keywords`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
INSERT INTO `<--db-prefix-->cms_single_page` VALUES
('1','about','关于我们','关于我们','关于我们','<p><img src=\"data/image/201504/18/71949_nMQP_7254.png\" title=\"Screen Shot 2015-04-18 at 03.58.38.png\" alt=\"Screen Shot 2015-04-18 at 03.58.38.png\" width=\"283\" height=\"210\" style=\"width: 283px; height: 210px; float: left;\"/></p><p style=\"text-indent: 2em; text-align: left;\">Co.MZ 是一款轻量级企业网站管理系统,基于PHP+Mysql架构的,可运行在Linux、Windows、MacOSX、Solaris等各种平台上,系统基于ThinkPHP,支持自定义伪静态,前台模板采用DIV+CSS设计,后台界面设计简洁明了,功能简单易具有良好的用户体验,稳定性好、扩展性及安全性强,可面向中小型站点提供网站建设解决方案。</p><p style=\"text-indent: 2em; text-align: left;\"><span style=\"text-indent: 32px;\">某某公司</span>是一家面向全球提供IT解决方案与服务的公司,致力于通过创新的信息化技术来推动社会的发展与变革,为个人创造新的生活方式,为社会创造价值。公司创立于1991年,目前拥有20000名员工,在中国建立了8个区域总部,10个软件研发基地, 16个软件开发与技术支持中心,在60多个城市建立营销与服务网络; 在美国、日本、欧洲、中东、南美设有子公司。</p><p style=\"text-indent: 2em; text-align: left;\">某某公司以软件技术为核心,提供行业解决方案和产品工程解决方案以及相关软件产品、平台及服务。</p><p style=\"text-indent: 2em; text-align: left;\">面向行业客户,<span style=\"text-indent: 32px;\">某某公司</span>提供满足行业智慧发展与管理的解决方案、产品及服务,涵盖领域包括:电信、能源、金融、政府、制造业、商贸流通业、医疗卫生、教育与文化、交通、移动互联网、传媒、环保等。<span style=\"text-indent: 32px;\">某某公司</span>在众多行业领域拥有领先的市场占有率,并参与多项中国国家级信息化标准制定。</p><p><br style=\"text-indent: 2em; text-align: left;\"/></p>'),
('2','contact','联系我们','联系我们','联系我们','<p style=\"text-indent: 2em; text-align: left;\">Co.MZ的为您的公司提供最便捷的服务。</p><p style=\"text-indent: 2em; text-align: left;\">客服电话工作时间为周一至周日 8:00-20:00,节假日不休息,免长途话费。</p><p style=\"text-indent: 2em; text-align: left;\">我们将随时为您献上真诚的服务。</p><hr/><p style=\"white-space: normal; text-indent: 2em; text-align: left;\">邮箱:example@163.com</p><p style=\"white-space: normal; text-indent: 2em; text-align: left;\">手机:13100000000</p><p style=\"white-space: normal; text-indent: 2em; text-align: left;\">QQ :88888888</p><p style=\"text-align: center;\"><img width=\"530\" height=\"340\" src=\"http://api.map.baidu.com/staticimage?center=121.387616,31.213301&zoom=13&width=530&height=340&markers=121.387616,31.213301\"/></p>'),
('3','awards','荣誉资质','荣誉资质','荣誉资质','<p>荣誉资质</p>'); | 153.764706 | 1,195 | 0.712318 |
1a5a7364811fc084d1d708ae47d368a611bb3d6c | 310 | kt | Kotlin | app/src/main/java/com/teamnoyes/majorparksinseoul/model/SearchParkInfoService.kt | kjh9589/Android-Major-Parks-In-Seoul | 0c12c5b787730eb36263afcc3de0ab7163c8692a | [
"Apache-2.0"
] | null | null | null | app/src/main/java/com/teamnoyes/majorparksinseoul/model/SearchParkInfoService.kt | kjh9589/Android-Major-Parks-In-Seoul | 0c12c5b787730eb36263afcc3de0ab7163c8692a | [
"Apache-2.0"
] | null | null | null | app/src/main/java/com/teamnoyes/majorparksinseoul/model/SearchParkInfoService.kt | kjh9589/Android-Major-Parks-In-Seoul | 0c12c5b787730eb36263afcc3de0ab7163c8692a | [
"Apache-2.0"
] | null | null | null | package com.teamnoyes.majorparksinseoul.model
import com.google.gson.annotations.SerializedName
data class SearchParkInfoService(
@SerializedName("list_total_count")
val listTotalCount: Int?,
@SerializedName("RESULT")
val rESULT: RESULT?,
@SerializedName("row")
val row: List<Row>?
) | 23.846154 | 49 | 0.741935 |
ebe8c6ed6446b902c8dd007bd05de9e8a6df3995 | 588 | rs | Rust | src/essentials/on_event/left.rs | sonicrules1234/sonicbot-matrix | e4090a5baedd355ad50df211010230fe68950711 | [
"BSD-3-Clause"
] | null | null | null | src/essentials/on_event/left.rs | sonicrules1234/sonicbot-matrix | e4090a5baedd355ad50df211010230fe68950711 | [
"BSD-3-Clause"
] | null | null | null | src/essentials/on_event/left.rs | sonicrules1234/sonicbot-matrix | e4090a5baedd355ad50df211010230fe68950711 | [
"BSD-3-Clause"
] | null | null | null | //use ruma::api::client::r0::sync::sync_events::*;
use crate::{Instructions, instruction_generators::RoomTypeData, EventArgs};
//use std::collections::BTreeMap;
pub fn help() -> String {
String::from("Runs on all syncs that have left rooms states")
}
pub fn main(event_args: EventArgs) -> Vec<Instructions> {
let mut instructions: Vec<Instructions> = Vec::new();
if let RoomTypeData::Left(ref x) = event_args.room_data {
for (room_id, _left_room) in x.iter() {
instructions.push(Instructions::DelRoom(room_id.clone()))
}
}
instructions
}
| 32.666667 | 75 | 0.671769 |
b999a58f87783948c2bb20b8595b1213b3f2dc1b | 360 | h | C | RuntimeKVOByReactive/RuntimeKVOByReactive/NSObject+KVO.h | AAYuan/RAC | 9aaa9f823401af358b5460ad3294fb4fa62fbe69 | [
"Apache-2.0"
] | null | null | null | RuntimeKVOByReactive/RuntimeKVOByReactive/NSObject+KVO.h | AAYuan/RAC | 9aaa9f823401af358b5460ad3294fb4fa62fbe69 | [
"Apache-2.0"
] | null | null | null | RuntimeKVOByReactive/RuntimeKVOByReactive/NSObject+KVO.h | AAYuan/RAC | 9aaa9f823401af358b5460ad3294fb4fa62fbe69 | [
"Apache-2.0"
] | null | null | null | //
// NSObject+KVO.h
// RuntimeKVOByReactive
//
// Created by AYuan on 16/5/23.
// Copyright © 2016年 AYuan. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSObject (KVO)
- (void)lty_addObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath options:(NSKeyValueObservingOptions)options context:(nullable void *)context;
@end
| 21.176471 | 153 | 0.736111 |
bcb8f512c2059488ceeb2cf7a51ea24a33eacf52 | 2,114 | js | JavaScript | components/form/index.js | taran-pierce/wffd | 46fc9c769fd3afbc95273b40355b02ca1cfae702 | [
"MIT"
] | null | null | null | components/form/index.js | taran-pierce/wffd | 46fc9c769fd3afbc95273b40355b02ca1cfae702 | [
"MIT"
] | null | null | null | components/form/index.js | taran-pierce/wffd | 46fc9c769fd3afbc95273b40355b02ca1cfae702 | [
"MIT"
] | null | null | null | import React from 'react';
import {
string,
func,
object
} from 'prop-types';
import styles from './form.module.scss';
export default function Form(props) {
const {
handleSubmit,
changeHandler,
formInputPlaceRef,
formInputLocationRef,
placePlaceholder,
locationPlaceholder,
buttonText,
buttonStyle,
customId,
} = props;
const placeId = customId ? `${customId}-place` : 'place';
const locationId = customId ? `${customId}-location` : 'location';
return (
<>
<form
onSubmit={handleSubmit}
className={styles.form}
>
<fieldset className={styles.formRow}>
<label htmlFor={placeId}>Place:</label>
<input
className={styles.inputText}
type={'text'}
name={placeId}
id={placeId}
ref={formInputPlaceRef}
onChange={changeHandler}
placeholder={placePlaceholder}
/>
</fieldset>
<fieldset className={styles.formRow}>
<label htmlFor={locationId}>Location:</label>
<input
className={styles.inputText}
type={'text'}
name={locationId}
id={locationId}
ref={formInputLocationRef}
onChange={changeHandler}
placeholder={locationPlaceholder}
/>
</fieldset>
<fieldset className={styles.buttonRow}>
<button
type={'submit'}
className={buttonStyle ? styles[buttonStyle] : styles.button}
>
{buttonText}
</button>
</fieldset>
</form>
</>
);
}
Form.defaultProps = {
placePlaceholder: 'Five Guys',
locationPlaceholder: 'Burlington MA',
buttonText: 'Submit',
buttonStyle: '',
customId: '',
};
Form.propTypes = {
placePlaceholder: string,
buttonText: string,
changeHandler: func.isRequired,
handleSubmit: func.isRequired,
formInputPlaceRef: object.isRequired,
formInputLocationRef: object.isRequired,
buttonStyle: string,
locationPlaceholder: string,
customId: string,
};
| 24.298851 | 73 | 0.589877 |
5f05486ecb4cd0deccb9c22f4045902c7c515e36 | 4,361 | ts | TypeScript | cocos/core/gfx/base/texture.ts | SteveLau-GameDeveloper/engine | 159e5acd0f5115a878d59ed59f924ce7627a5466 | [
"Apache-2.0",
"MIT"
] | null | null | null | cocos/core/gfx/base/texture.ts | SteveLau-GameDeveloper/engine | 159e5acd0f5115a878d59ed59f924ce7627a5466 | [
"Apache-2.0",
"MIT"
] | null | null | null | cocos/core/gfx/base/texture.ts | SteveLau-GameDeveloper/engine | 159e5acd0f5115a878d59ed59f924ce7627a5466 | [
"Apache-2.0",
"MIT"
] | null | null | null | /*
Copyright (c) 2020 Xiamen Yaji Software Co., Ltd.
https://www.cocos.com/
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated engine source code (the "Software"), a limited,
worldwide, royalty-free, non-assignable, revocable and non-exclusive license
to use Cocos Creator solely to develop games on your target platforms. You shall
not use Cocos Creator software for developing other software or tools that's
used for developing games. You are not granted to publish, distribute,
sublicense, and/or sell copies of Cocos Creator.
The software or tools in this License Agreement are licensed, not sold.
Xiamen Yaji Software Co., Ltd. reserves all rights not expressly granted to you.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/**
* @packageDocumentation
* @module gfx
*/
import {
Format,
GFXObject,
ObjectType,
SampleCount,
TextureFlags,
TextureType,
TextureUsage,
TextureInfo,
TextureViewInfo,
ISwapchainTextureInfo,
} from './define';
/**
* @en GFX texture.
* @zh GFX 纹理。
*/
export abstract class Texture extends GFXObject {
/**
* @en Get texture type.
* @zh 纹理类型。
*/
get type (): TextureType {
return this._info.type;
}
/**
* @en Get texture usage.
* @zh 纹理使用方式。
*/
get usage (): TextureUsage {
return this._info.usage;
}
/**
* @en Get texture format.
* @zh 纹理格式。
*/
get format (): Format {
return this._info.format;
}
/**
* @en Get texture width.
* @zh 纹理宽度。
*/
get width (): number {
return this._info.width;
}
/**
* @en Get texture height.
* @zh 纹理高度。
*/
get height (): number {
return this._info.height;
}
/**
* @en Get texture depth.
* @zh 纹理深度。
*/
get depth (): number {
return this._info.depth;
}
/**
* @en Get texture array layer.
* @zh 纹理数组层数。
*/
get layerCount (): number {
return this._info.layerCount;
}
/**
* @en Get texture mip level.
* @zh 纹理 mip 层级数。
*/
get levelCount (): number {
return this._info.levelCount;
}
/**
* @en Get texture samples.
* @zh 纹理采样数。
*/
get samples (): SampleCount {
return this._info.samples;
}
/**
* @en Get texture flags.
* @zh 纹理标识位。
*/
get flags (): TextureFlags {
return this._info.flags;
}
/**
* @en Get texture size.
* @zh 纹理大小。
*/
get size (): number {
return this._size;
}
/**
* @en Get texture info.
* @zh 纹理信息。
*/
get info (): Readonly<TextureInfo> {
return this._info;
}
/**
* @en Get view info.
* @zh 纹理视图信息。
*/
get viewInfo (): Readonly<TextureViewInfo> {
return this._viewInfo;
}
/**
* @en Get texture type.
* @zh 是否为纹理视图。
*/
get isTextureView (): boolean {
return this._isTextureView;
}
protected _info: TextureInfo = new TextureInfo();
protected _viewInfo: TextureViewInfo = new TextureViewInfo();
protected _isPowerOf2 = false;
protected _isTextureView = false;
protected _size = 0;
constructor () {
super(ObjectType.TEXTURE);
}
public abstract initialize (info: Readonly<TextureInfo> | Readonly<TextureViewInfo>): void;
public abstract destroy (): void;
/**
* @en Resize texture.
* @zh 重置纹理大小。
* @param width The new width.
* @param height The new height.
*/
public abstract resize (width: number, height: number): void;
protected abstract initAsSwapchainTexture (info: Readonly<ISwapchainTextureInfo>): void;
public static getLevelCount (width: number, height: number): number {
return Math.floor(Math.log2(Math.max(width, height)));
}
}
| 22.952632 | 95 | 0.609493 |
b929b8e9cabe846ca1e47de09d599a1cba19c43b | 1,438 | h | C | atca_config.h | kmwebnet/ECC608-TNG-AES-Test-raspi | 313c41c8ab0dd5543937c9b64be9e14dc3e0f4c4 | [
"MIT"
] | null | null | null | atca_config.h | kmwebnet/ECC608-TNG-AES-Test-raspi | 313c41c8ab0dd5543937c9b64be9e14dc3e0f4c4 | [
"MIT"
] | null | null | null | atca_config.h | kmwebnet/ECC608-TNG-AES-Test-raspi | 313c41c8ab0dd5543937c9b64be9e14dc3e0f4c4 | [
"MIT"
] | null | null | null | /* Auto-generated config file atca_config.h */
#ifndef ATCA_CONFIG_H
#define ATCA_CONFIG_H
/* Included HALS */
#define ATCA_HAL_I2C
/* Included device support */
#define ATCA_ATECC608_SUPPORT
/** Device Override - Library Assumes ATECC608B support in checks */
#define ATCA_ATECC608A_SUPPORT
/* \brief How long to wait after an initial wake failure for the POST to
* complete.
* If Power-on self test (POST) is enabled, the self test will run on waking
* from sleep or during power-on, which delays the wake reply.
*/
#ifndef ATCA_POST_DELAY_MSEC
#define ATCA_POST_DELAY_MSEC 25
#endif
/***************** Diagnostic & Test Configuration Section *****************/
/** Enable debug messages */
#define ATCA_PRINTF
/******************** Features Configuration Section ***********************/
/** Define certificate templates to be supported. */
#define ATCA_TNGTLS_SUPPORT
/** Define Software Crypto Library to Use - if none are defined use the
cryptoauthlib version where applicable */
#define ATCA_OPENSSL
/** Define to build atcab_ functions rather that defining them as macros */
#define ATCA_USE_ATCAB_FUNCTIONS
/******************** Platform Configuration Section ***********************/
/** Define platform malloc/free */
#define ATCA_PLATFORM_MALLOC malloc
#define ATCA_PLATFORM_FREE free
#define atca_delay_ms hal_delay_ms
#define atca_delay_us hal_delay_us
#endif // ATCA_CONFIG_H
| 26.145455 | 77 | 0.698887 |
c1f517db9365e39c813e43c66ede3ae5cea42c64 | 2,338 | rs | Rust | src/app/reducers/symlink_reducer.rs | mihaigalos/sfm | 3daf892e1c65728eacc061e4f2fd5e2f0ade2f79 | [
"MIT"
] | 17 | 2021-02-02T19:18:03.000Z | 2022-03-09T01:18:31.000Z | src/app/reducers/symlink_reducer.rs | mihaigalos/sfm | 3daf892e1c65728eacc061e4f2fd5e2f0ade2f79 | [
"MIT"
] | 4 | 2021-12-22T17:25:32.000Z | 2022-03-23T17:10:37.000Z | src/app/reducers/symlink_reducer.rs | mihaigalos/sfm | 3daf892e1c65728eacc061e4f2fd5e2f0ade2f79 | [
"MIT"
] | 3 | 2021-04-10T22:37:24.000Z | 2022-03-19T18:40:05.000Z | use std::{fmt::Debug, path::PathBuf};
use crate::app::{
actions::{PanelSide, SymlinkAction},
file_system::FileSystem,
state::{AppState, PanelState, TabIdx, TabState},
};
pub fn symlink_reducer<TFileSystem: Clone + Debug + Default + FileSystem>(
state: AppState<TFileSystem>,
action: SymlinkAction,
) -> AppState<TFileSystem> {
match action {
SymlinkAction::Create {
symlink_path,
panel,
} => create_symlink(state, symlink_path, panel),
_ => state,
}
}
fn create_symlink<TFileSystem: Clone + Debug + Default + FileSystem>(
mut state: AppState<TFileSystem>,
symlink_path: PathBuf,
panel: crate::app::actions::PanelInfo,
) -> AppState<TFileSystem> {
match panel.side {
PanelSide::Left => AppState {
left_panel: PanelState {
tabs: create_symlink_in_tab(
symlink_path,
panel.tab,
panel.path,
&mut state.file_system,
state.left_panel.tabs,
),
..state.left_panel
},
..state
},
PanelSide::Right => AppState {
right_panel: PanelState {
tabs: create_symlink_in_tab(
symlink_path,
panel.tab,
panel.path,
&mut state.file_system,
state.right_panel.tabs,
),
..state.right_panel
},
..state
},
}
}
fn create_symlink_in_tab<TFileSystem: Clone + Debug + Default + FileSystem>(
symlink_path: PathBuf,
tab: TabIdx,
path: PathBuf,
file_system: &mut TFileSystem,
tabs: Vec<TabState<TFileSystem>>,
) -> Vec<TabState<TFileSystem>> {
let mut result = Vec::<TabState<TFileSystem>>::new();
for (idx, tab_state) in tabs.iter().enumerate() {
if idx == tab {
match file_system.create_symlink(&symlink_path, &path) {
Ok(_) => result.push(tab_state.clone()),
Err(err) => {
eprintln!("{}", err);
result.push(tab_state.clone())
}
}
} else {
result.push(tab_state.clone());
}
}
result
}
| 28.512195 | 76 | 0.51497 |
4606e898b80cd477faf3b2d8ee426fdd76afdfa7 | 87 | sql | SQL | fluxtream-web/db/0.9.0015/02_default_storage_engine.sql | gpatel123/fluxtream-app-master | 0e0f0225fd893b72aa43273daad0d20290b4c545 | [
"Apache-2.0"
] | 89 | 2015-01-21T20:15:47.000Z | 2021-11-08T09:58:39.000Z | fluxtream-web/db/0.9.0015/02_default_storage_engine.sql | tanajilondhefidel/fluxtream-app-master | 73c1aefb449acaf2bc9726718c25f62ded9fc36c | [
"Apache-2.0"
] | 30 | 2020-01-13T05:27:46.000Z | 2021-08-02T17:08:02.000Z | fluxtream-web/db/0.9.0015/02_default_storage_engine.sql | tanajilondhefidel/fluxtream-app-master | 73c1aefb449acaf2bc9726718c25f62ded9fc36c | [
"Apache-2.0"
] | 31 | 2015-02-18T06:16:01.000Z | 2022-03-29T15:09:39.000Z | ALTER TABLE Facet_VisitedCity ENGINE = MYISAM;
ALTER TABLE cities1000 ENGINE = MYISAM;
| 29 | 46 | 0.816092 |
e3cfbc249cd8e3515f1f3d95e418b757d5a41cc4 | 4,300 | go | Go | emails_templates_service_test.go | kvarts/sendpulse-sdk-go | ac96af8014b416063691f977e7534dc2958fb5bd | [
"MIT"
] | 13 | 2019-05-25T17:35:51.000Z | 2022-02-23T07:08:35.000Z | emails_templates_service_test.go | kvarts/sendpulse-sdk-go | ac96af8014b416063691f977e7534dc2958fb5bd | [
"MIT"
] | null | null | null | emails_templates_service_test.go | kvarts/sendpulse-sdk-go | ac96af8014b416063691f977e7534dc2958fb5bd | [
"MIT"
] | 7 | 2019-09-19T11:43:17.000Z | 2022-01-04T18:56:38.000Z | package sendpulse_sdk_go
import (
"context"
"fmt"
"net/http"
)
func (suite *SendpulseTestSuite) TestEmailsService_TemplatesService_Create() {
suite.mux.HandleFunc("/template", func(w http.ResponseWriter, r *http.Request) {
suite.Equal(http.MethodPost, r.Method)
fmt.Fprintf(w, `{"result": true,"real_id":1}`)
})
tplID, err := suite.client.Emails.Templates.CreateTemplate(context.Background(), "First template", "<h1>Message</h1>", "ru")
suite.NoError(err)
suite.Equal(1, tplID)
}
func (suite *SendpulseTestSuite) TestEmailsService_TemplatesService_Update() {
suite.mux.HandleFunc("/template/edit/1", func(w http.ResponseWriter, r *http.Request) {
suite.Equal(http.MethodPost, r.Method)
fmt.Fprintf(w, `{"result": true}`)
})
err := suite.client.Emails.Templates.UpdateTemplate(context.Background(), 1, "<h1>Message</h1>", "ru")
suite.NoError(err)
}
func (suite *SendpulseTestSuite) TestEmailsService_TemplatesService_Get() {
suite.mux.HandleFunc("/template/1", func(w http.ResponseWriter, r *http.Request) {
suite.Equal(http.MethodGet, r.Method)
fmt.Fprintf(w, `{
"id": "1",
"real_id": 1,
"name": "Тестовый шаблон 1",
"name_slug": "testovyy-shablon-1",
"meta_description": null,
"full_description": null,
"category": "",
"category_info": [],
"mark": null,
"mark_count": null,
"body": "PGgxPtCf0YDQrtCy0LXRgiE8L2gxPg==",
"tags": {
"digest": "digest",
"blog": "blog",
"exhibition": "exhibition",
"invite": "invite"
},
"created": "2021-06-19 19:18:32",
"preview": "https://login.sendpulse.com/files/emailservice/userfiles/templates/preview/123/12345.png",
"owner": "me",
"is_structure": false
}`)
})
tpl, err := suite.client.Emails.Templates.GetTemplate(context.Background(), 1)
suite.NoError(err)
suite.Equal(1, tpl.RealID)
}
func (suite *SendpulseTestSuite) TestEmailsService_TemplatesService_List() {
suite.mux.HandleFunc("/templates", func(w http.ResponseWriter, r *http.Request) {
suite.Equal(http.MethodGet, r.Method)
fmt.Fprintf(w, `[
{
"id": "f3266876955c9d21e214deed49b97446",
"real_id": 1153018,
"lang": "en",
"name": "Webinar Speakers",
"name_slug": "",
"created": "2020-09-04 13:54:30",
"full_description": "Use this template as a webinar invitation for your subscribers. Specify who is going to host the webinar and what it will be about. Remember to include the date and time of the webinar.",
"is_structure": true,
"category": "education",
"category_info": {
"id": 109,
"name": "Education",
"meta_description": "These “Education” free email templates were developed by SendPulse for all those who wish to make their email communication colorful and unforgettable. You can use these templates to create your email campaigns in SendPulse.",
"full_description": "",
"code": "education",
"sort": 6
},
"tags": {
"webinar": "webinar",
"study": "study",
"marketing": "marketing",
"museum": "museum",
"exhibition": "exhibition"
},
"owner": "sendpulse",
"preview": "https://login.sendpulse.com/files/emailservice/userfiles/templates/preview/f3266876955c9d21e214deed49b97446_thumbnail_300.png"
},
{
"id": "2a7c59e5bcb0db1dee02c60208fbb498",
"real_id": 1153017,
"lang": "en",
"name": "Offline conference",
"name_slug": "education-events",
"created": "2020-09-04 13:54:21",
"full_description": "Use this template to invite your subscribers to an online or offline event. Indicate its name, date, and time. Add information about the location if it's an offline event. Upload photos of your speakers and give a short description of their presentation. That’s it! Now you can send your email campaign!",
"is_structure": true,
"category": "education",
"category_info": [],
"tags": {
"digest": "digest",
"blog": "blog",
"exhibition": "exhibition",
"invite": "invite"
},
"owner": "sendpulse",
"preview": "https://login.sendpulse.com/files/emailservice/userfiles/templates/preview/2a7c59e5bcb0db1dee02c60208fbb498_thumbnail_300.png"
}]`)
})
templates, err := suite.client.Emails.Templates.GetTemplates(context.Background(), 10, 0, "me")
suite.NoError(err)
suite.Equal(2, len(templates))
}
| 35.833333 | 331 | 0.680465 |
0cca7a33169b15c0dca26a3d1d4121500e7fe51e | 7,735 | py | Python | robot.py | dragonrobotics/2018-PowerUp | 0fb6be22420b1488ca3d6abb04588e8564d768b9 | [
"MIT"
] | 2 | 2018-02-08T23:29:21.000Z | 2018-12-27T22:45:12.000Z | robot.py | dragonrobotics/2018-PowerUp | 0fb6be22420b1488ca3d6abb04588e8564d768b9 | [
"MIT"
] | 2 | 2018-02-10T20:25:16.000Z | 2018-02-20T12:47:33.000Z | robot.py | dragonrobotics/2018-PowerUp | 0fb6be22420b1488ca3d6abb04588e8564d768b9 | [
"MIT"
] | 8 | 2018-01-15T14:53:52.000Z | 2018-02-14T22:34:30.000Z | import wpilib
import constants
import swerve
import lift
import winch
import sys
from teleop import Teleop
from autonomous.baseline_simple import Autonomous
from sensors.imu import IMU
def log(src, msg):
try:
full_msg = "[{:.3f}] [{}] {}".format(
wpilib.Timer.getMatchTime(), str(src), str(msg)
)
print(full_msg, file=sys.stderr)
except: # noqa: E772
full_msg = "[{:.3f}] [log] Caught exception when logging: {} {}".format( # noqa: E501
wpilib.Timer.getMatchTime(),
str(sys.exc_info()[0]),
str(sys.exc_info()[1])
)
print(full_msg, file=sys.stderr)
def log_exception(src, locstr):
# i.e. caught {ValueError} {in my_method}: {could not cast X to Y}
log(src, "Caught {} {}: {}".format(
str(sys.exc_info()[0]), locstr, str(sys.exc_info()[1])
))
class Robot(wpilib.IterativeRobot):
def robotInit(self):
constants.load_control_config()
wpilib.CameraServer.launch('driver_vision.py:main')
self.autoPositionSelect = wpilib.SendableChooser()
self.autoPositionSelect.addDefault('Middle-Baseline', 'Middle-Baseline')
self.autoPositionSelect.addObject('Middle-Placement', 'Middle-Placement') # noqa: E501
self.autoPositionSelect.addObject('Left', 'Left')
self.autoPositionSelect.addObject('Right', 'Right')
wpilib.SmartDashboard.putData(
'Robot Starting Position',
self.autoPositionSelect)
self.drivetrain = swerve.SwerveDrive(
constants.chassis_length,
constants.chassis_width,
constants.swerve_config
)
self.drivetrain.load_config_values()
self.lift = lift.ManualControlLift(
constants.lift_ids['left'],
constants.lift_ids['right'],
constants.lift_limit_channel,
constants.start_limit_channel
)
self.winch = winch.Winch(
constants.winch_id
)
self.throttle = wpilib.Joystick(1)
self.claw = lift.Claw(
constants.claw_id,
constants.claw_follower_id
)
self.imu = IMU(wpilib.SPI.Port.kMXP)
self.sd_update_timer = wpilib.Timer()
self.sd_update_timer.reset()
self.sd_update_timer.start()
def disabledInit(self):
pass
def disabledPeriodic(self):
try:
self.lift.load_config_values()
self.drivetrain.load_config_values()
except: # noqa: E772
log_exception('disabled', 'when loading config')
try:
self.drivetrain.update_smart_dashboard()
self.imu.update_smart_dashboard()
self.lift.update_smart_dashboard()
self.winch.update_smart_dashboard()
wpilib.SmartDashboard.putNumber(
"Throttle Pos", self.throttle.getRawAxis(constants.liftAxis)
)
except: # noqa: E772
log_exception('disabled', 'when updating SmartDashboard')
try:
self.lift.checkLimitSwitch()
pass
except: # noqa: E772
log_exception('disabled', 'when checking lift limit switch')
self.drivetrain.update_smart_dashboard()
def autonomousInit(self):
try:
self.drivetrain.load_config_values()
self.lift.load_config_values()
except: # noqa: E772
log_exception('auto-init', 'when loading config')
self.autoPos = None
try:
self.autoPos = self.autoPositionSelect.getSelected()
except: # noqa: E772
self.autoPos = None
log_exception('auto-init', 'when getting robot start position')
try:
if self.autoPos is not None and self.autoPos != 'None':
self.auto = Autonomous(self, self.autoPos)
else:
log('auto-init', 'Disabling autonomous...')
except: # noqa: E772
log_exception('auto-init', 'in Autonomous constructor')
try:
self.lift.checkLimitSwitch()
pass
except: # noqa: E772
log_exception('auto-init', 'when checking lift limit switch')
def autonomousPeriodic(self):
try:
if self.sd_update_timer.hasPeriodPassed(0.5):
self.auto.update_smart_dashboard()
self.imu.update_smart_dashboard()
self.drivetrain.update_smart_dashboard()
self.lift.update_smart_dashboard()
self.winch.update_smart_dashboard()
except: # noqa: E772
log_exception('auto', 'when updating SmartDashboard')
try:
if self.autoPos is not None and self.autoPos != 'None':
self.auto.periodic()
except: # noqa: E772
# Stop everything.
self.drivetrain.immediate_stop()
self.lift.setLiftPower(0)
self.claw.set_power(0)
self.winch.stop()
log_exception('auto', 'in auto :periodic()')
try:
self.lift.checkLimitSwitch()
pass
except: # noqa: E772
log_exception('auto', 'when checking lift limit switch')
def teleopInit(self):
try:
self.teleop = Teleop(self)
except: # noqa: E772
log_exception('teleop-init', 'in Teleop constructor')
try:
self.drivetrain.load_config_values()
self.lift.load_config_values()
constants.load_control_config()
except: # noqa: E772
log_exception('teleop-init', 'when loading config')
try:
self.lift.checkLimitSwitch()
pass
except: # noqa: E772
log_exception('teleop-init', 'when checking lift limit switch')
def teleopPeriodic(self):
try:
self.teleop.drive()
except: # noqa: E772
log_exception('teleop', 'in drive control')
self.drivetrain.immediate_stop()
try:
self.teleop.buttons()
except: # noqa: E772
log_exception('teleop', 'in button handler')
try:
self.teleop.lift_control()
except: # noqa: E772
log_exception('teleop', 'in lift_control')
self.lift.setLiftPower(0)
try:
self.teleop.claw_control()
except: # noqa: E772
log_exception('teleop', 'in claw_control')
self.claw.set_power(0)
try:
self.teleop.winch_control()
except: # noqa: E772
log_exception('teleop', 'in winch_control')
self.winch.stop()
try:
self.lift.checkLimitSwitch()
pass
except: # noqa: E772
log_exception('teleop', 'in lift.checkLimitSwitch')
if self.sd_update_timer.hasPeriodPassed(0.5):
try:
constants.load_control_config()
self.drivetrain.load_config_values()
self.lift.load_config_values()
except: # noqa: E772
log_exception('teleop', 'when loading config')
try:
self.drivetrain.update_smart_dashboard()
self.teleop.update_smart_dashboard()
self.imu.update_smart_dashboard()
self.lift.update_smart_dashboard()
self.winch.update_smart_dashboard()
except: # noqa: E772
log_exception('teleop', 'when updating SmartDashboard')
# for module in self.drivetrain.modules:
# module.set_steer_angle(0)
if __name__ == "__main__":
wpilib.run(Robot)
| 31.315789 | 95 | 0.576083 |
4a3f9dda44318f32f6fb960a0b2554edfa4bce53 | 415 | js | JavaScript | git-it.js | psainii/git-it | 85b31b48a2b1f22dcd332fd846ee94feab9b2b7a | [
"BSD-2-Clause"
] | 1,627 | 2015-01-02T13:32:57.000Z | 2022-03-23T15:01:38.000Z | git-it.js | 2071473367/git-it | 85b31b48a2b1f22dcd332fd846ee94feab9b2b7a | [
"BSD-2-Clause"
] | 112 | 2015-01-03T18:36:42.000Z | 2022-03-05T18:23:49.000Z | git-it.js | 2071473367/git-it | 85b31b48a2b1f22dcd332fd846ee94feab9b2b7a | [
"BSD-2-Clause"
] | 608 | 2015-01-02T00:15:51.000Z | 2022-03-07T14:22:10.000Z | #!/usr/bin/env node
const Workshopper = require('workshopper-jlord'),
path = require('path')
process.env.LANG = 'C'
Workshopper({
name: 'git-it',
title: 'GIT + GITHUB : VERSION CONTROL + SOCIAL CODING',
appDir: __dirname,
helpFile: path.join(__dirname, 'help.txt'),
menu: {
fg: /^win/.test(process.platform) ? 'white' : 231,
bg: /^win/.test(process.platform) ? 'blue' : 33
}
}).init()
| 23.055556 | 58 | 0.624096 |
4969b7aac36f07a3937d59eaba276011931b076a | 1,661 | swift | Swift | Aurora/PropertyButton.swift | barrymcandrews/aurora-ios | 7b472dbb739bc995664ef82944ee5af6c4abe2fe | [
"BSD-2-Clause"
] | null | null | null | Aurora/PropertyButton.swift | barrymcandrews/aurora-ios | 7b472dbb739bc995664ef82944ee5af6c4abe2fe | [
"BSD-2-Clause"
] | null | null | null | Aurora/PropertyButton.swift | barrymcandrews/aurora-ios | 7b472dbb739bc995664ef82944ee5af6c4abe2fe | [
"BSD-2-Clause"
] | null | null | null | //
// PropertyButton.swift
// Aurora
//
// Created by Barry McAndrews on 5/9/17.
// Copyright © 2017 Barry McAndrews. All rights reserved.
//
import UIKit
class PropertyButton: UIButton {
override var canBecomeFirstResponder: Bool { get{ return true } }
private var iv: UIView?
override var inputView: UIView? {
get {
return self.iv
}
set(new) {
self.iv = new
}
}
private var iav: UIView?
override var inputAccessoryView: UIView? {
get {
return self.iav
}
set(new) {
self.iav = new
}
}
var keyText: String = "" {
didSet {
updateTitle()
}
}
var valueText: String = "" {
didSet {
updateTitle()
}
}
var checked: Bool = false {
didSet {
valueText = (checked ? "Yes" : "No")
}
}
func updateTitle() {
let attr: [String: Any] = [NSFontAttributeName: UIFont(name: "Futura-Medium", size: 15.0)!, NSForegroundColorAttributeName: UIColor.white]
let key = NSMutableAttributedString(string: keyText + ": ", attributes: attr)
let attr2: [String: Any] = [NSFontAttributeName: UIFont(name: "Futura-MediumItalic", size: 15.0)! , NSForegroundColorAttributeName: UIColor.white]
let value = NSAttributedString(string: valueText, attributes: attr2)
key.append(value)
self.setAttributedTitle(key, for: .normal)
}
func toggleChecked() -> Bool {
checked = !checked
return checked
}
}
| 23.728571 | 154 | 0.544852 |
9c70b51e7646bab8a3999f49cb92c54d3a2b7683 | 3,437 | js | JavaScript | _tpl/theme.js | dak0rn/sfftfth | 359ad48d6582c8f12729da084159728a4f53823a | [
"Apache-2.0"
] | null | null | null | _tpl/theme.js | dak0rn/sfftfth | 359ad48d6582c8f12729da084159728a4f53823a | [
"Apache-2.0"
] | null | null | null | _tpl/theme.js | dak0rn/sfftfth | 359ad48d6582c8f12729da084159728a4f53823a | [
"Apache-2.0"
] | null | null | null | /**
* Example theme
*/
/**
* Renders the beginning of the document.
*
* @param {string} title Page title
* @param {string} baseUrl Base URL o fthe page
* @return {string} HTML
*/
const head = (title, baseUrl) => `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>${title}</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="${baseUrl}/page.css" />
</head>
<body>
<div class="page-container">`;
/**
* Renders the end of the document.
*
* @return {string} HTML
*/
const tail = () => `</div>
</body>
</html>`;
/**
* Renders the page header with the navigation.
*
* @param {array<object>} files All files
* @param {boolean=} renderBack Render the back button? Default false.
* @return {string} HTML
*/
const pageHeader = (files, renderBack) => `<div id="page-header">
<h1 class="page-title">sfftfth</h1>
<ul class="page-list">
${ renderBack ? '<li class="page"><a href="${baseUrl}/">«</a></li>' : '' }${
files.filter( file => !! file.meta.static )
.map( file => `<li class="page"><a href="${file.uri}">${file.meta.title}</a></li>` )
.join('')
}</ul>
</div>`;
module.exports = {
/**
* Function invoked for the index page.
*
* @param {array<object>} files List of files
* @param {object} config Page configuration
* @return {string} HTML
*/
index(files, config) {
return `${head(config.title, config.baseUrl)}
<div class="page-content" id="index-page">
${ pageHeader(files) }
<ul class="post-list">${
files.filter( file => ! file.meta.static )
.map( file => `<li class="post">
<a href="${file.uri}">${file.meta.title}</a>
<span class="post-date">(${ file.meta.date })</span>
</li>` )
.join('')
}</ul>
</div>
${tail()}`;
},
/**
* Function invoked to render a post.
*
* @param {string} contents HTML contents
* @param {object} meta Meta information
* @param {object} config Page configuration
* @param {object} file Whole file object
* @param {array<object>} files List of file objects
* @return {string} HTML
*/
post(contents, meta, config, file, files) {
return `${head(meta.title, config.baseUrl)}
${ pageHeader(files, true) }
<div class="page-content" id="post-page">
${ contents }
<div class="page-meta">
${ meta.date }
</div>
</div>
${tail()}`;
},
/**
* Function invoked to render a page, that is, a post that has `static: true` in its meta.
*
* @param {string} contents HTML contents
* @param {object} meta Meta information
* @param {object} config Page configuration
* @param {object} file Whole file object
* @param {array<object>} files List of file objects
* @return {string} HTML
*/
page() {
return this.post.apply(this, arguments);
}
}; | 31.245455 | 96 | 0.499855 |
4d5f5e03c5ed3b642039efa0149677df063871ef | 653 | kt | Kotlin | app/src/main/java/com/chotaling/ownlibrary/ui/books/BookSeachViewModel.kt | chotaling1/ownLibrary-Android | 1c10ce7ee8a0f22d49475ed33df6d8ccd6b017e2 | [
"Apache-2.0"
] | null | null | null | app/src/main/java/com/chotaling/ownlibrary/ui/books/BookSeachViewModel.kt | chotaling1/ownLibrary-Android | 1c10ce7ee8a0f22d49475ed33df6d8ccd6b017e2 | [
"Apache-2.0"
] | 9 | 2021-04-09T20:40:53.000Z | 2021-04-12T20:35:51.000Z | app/src/main/java/com/chotaling/ownlibrary/ui/books/BookSeachViewModel.kt | chotaling1/ownLibrary-Android | 1c10ce7ee8a0f22d49475ed33df6d8ccd6b017e2 | [
"Apache-2.0"
] | null | null | null | package com.chotaling.ownlibrary.ui.books
import android.content.Context
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import com.chotaling.ownlibrary.domain.services.BookService
import com.chotaling.ownlibrary.infrastructure.dto.Google.GoogleBookDto
import com.chotaling.ownlibrary.ui.BaseViewModel
class BookSeachViewModel : BaseViewModel() {
val author : MutableLiveData<String> by lazy {
MutableLiveData<String>()
}
val isbn : MutableLiveData<String> by lazy {
MutableLiveData<String>()
}
val title : MutableLiveData<String> by lazy {
MutableLiveData<String>()
}
} | 28.391304 | 71 | 0.761103 |
73b5812f6d0d08ad7c69facfef056b091ebee8be | 9,759 | rs | Rust | lib/src/project/mod.rs | forbjok/chandler3 | d6addb6da67f9973a678e9caea11858a7ac37e64 | [
"Apache-2.0",
"MIT"
] | null | null | null | lib/src/project/mod.rs | forbjok/chandler3 | d6addb6da67f9973a678e9caea11858a7ac37e64 | [
"Apache-2.0",
"MIT"
] | null | null | null | lib/src/project/mod.rs | forbjok/chandler3 | d6addb6da67f9973a678e9caea11858a7ac37e64 | [
"Apache-2.0",
"MIT"
] | null | null | null | use std::collections::{BTreeSet, HashSet};
use std::path::{Path, PathBuf};
use chrono::{DateTime, Utc};
use tracing::info;
use url::Url;
pub mod common;
mod v2;
mod v3;
use common::LinkInfo;
use crate::config;
use crate::config::chandler::ChandlerConfig;
use crate::config::sites::SitesConfig;
use crate::error::*;
use crate::misc::site_resolver::{self, SiteResolver};
use crate::threadupdater::{ParserType, ThreadUpdater};
use crate::ui::*;
const DEFAULT_DOWNLOAD_EXTENSIONS: &[&str] = &["css", "gif", "ico", "jpeg", "jpg", "png", "webm"];
#[derive(Clone, Copy, Debug)]
pub enum ProjectFormat {
V2,
V3,
}
#[derive(Debug)]
pub struct ProjectUpdateResult {
pub was_updated: bool,
pub is_dead: bool,
pub new_post_count: u32,
pub new_file_count: u32,
}
pub struct ProjectState {
pub root_path: PathBuf,
pub thread_file_path: PathBuf,
pub originals_path: PathBuf,
pub thread_url: String,
pub download_extensions: BTreeSet<String>,
pub parser: ParserType,
pub link_path_generator: Box<dyn LinkPathGenerator>,
pub thread: Option<Box<dyn ThreadUpdater>>,
pub last_modified: Option<DateTime<Utc>>,
pub is_dead: bool,
pub new_links: Vec<LinkInfo>,
pub failed_links: Vec<LinkInfo>,
pub seen_links: HashSet<String>,
}
#[derive(Default)]
pub struct CreateProjectBuilder {
/// Thread URL.
url: Option<String>,
/// Path to create project at.
path: Option<PathBuf>,
/// Project format to use when creating a new project.
format: Option<ProjectFormat>,
/// Parser type to use for the created project.
parser: Option<ParserType>,
/// Chandler configuration to use.
config: Option<ChandlerConfig>,
/// Config file to try to load if no config was explicitly specified.
config_file: Option<PathBuf>,
/// Sites file to try to load if no site resolver was explicitly specified.
sites_file: Option<PathBuf>,
/// Whether to try to load the user's config.toml file if no config was explicitly passed.
use_chandler_config: bool,
/// Whether to try to load the user's sites.toml file if no site
use_sites_config: bool,
/// Path to load configuration files from.
config_path: Option<PathBuf>,
site_resolver: Option<Box<dyn SiteResolver>>,
}
pub trait LinkPathGenerator {
fn generate_path(&self, url: &str) -> Result<Option<String>, ChandlerError>;
}
pub trait Project {
fn update(&mut self, ui_handler: &mut dyn ChandlerUiHandler) -> Result<ProjectUpdateResult, ChandlerError>;
fn download_content(&mut self, ui_handler: &mut dyn ChandlerUiHandler) -> Result<(), ChandlerError>;
fn rebuild(&mut self, ui_handler: &mut dyn ChandlerUiHandler) -> Result<(), ChandlerError>;
fn save(&self) -> Result<(), ChandlerError>;
fn get_path(&self) -> &Path;
}
pub trait ProjectLoader {
type P: Project;
fn create(path: &Path, url: &str, parser: ParserType) -> Result<Self::P, ChandlerError>;
fn load(path: &Path) -> Result<Self::P, ChandlerError>;
fn exists_at(path: &Path) -> bool;
}
impl ProjectState {
pub fn write_thread(&self) -> Result<(), ChandlerError> {
let thread_file_path = self.root_path.join(&self.thread_file_path);
info!("Writing thread HTML: {}", thread_file_path.display());
if let Some(thread) = self.thread.as_ref() {
thread.write_file(&thread_file_path)?;
}
Ok(())
}
}
pub fn exists_at(path: impl AsRef<Path>) -> Option<ProjectFormat> {
let path = path.as_ref();
if v3::V3Project::exists_at(path) {
Some(ProjectFormat::V3)
} else if v2::V2Project::exists_at(path) {
Some(ProjectFormat::V2)
} else {
None
}
}
pub fn load(path: impl AsRef<Path>) -> Result<Box<dyn Project>, ChandlerError> {
let path = path.as_ref();
if v3::V3Project::exists_at(path) {
Ok(Box::new(v3::V3Project::load(path)?))
} else if v2::V2Project::exists_at(path) {
Ok(Box::new(v2::V2Project::load(path)?))
} else {
Err(ChandlerError::LoadProject("No project found".into()))
}
}
pub fn builder() -> CreateProjectBuilder {
CreateProjectBuilder::default()
}
impl CreateProjectBuilder {
pub fn url(mut self, url: &str) -> Self {
self.url = Some(url.to_owned());
self
}
pub fn path(mut self, path: Option<&Path>) -> Self {
self.path = path.map(|p| p.to_path_buf());
self
}
pub fn format(mut self, format: Option<ProjectFormat>) -> Self {
self.format = format;
self
}
pub fn parser(mut self, parser: Option<ParserType>) -> Self {
self.parser = parser;
self
}
pub fn site_resolver(mut self, site_resolver: Option<Box<dyn SiteResolver>>) -> Self {
self.site_resolver = site_resolver;
self
}
pub fn config_path(mut self, path: Option<&Path>) -> Self {
self.config_path = path.map(|p| p.to_path_buf());
self
}
pub fn config_file(mut self, path: Option<&Path>) -> Self {
self.config_file = path.map(|p| p.to_path_buf());
self
}
pub fn sites_file(mut self, path: Option<&Path>) -> Self {
self.sites_file = path.map(|p| p.to_path_buf());
self
}
pub fn use_chandler_config(mut self, v: bool) -> Result<Self, ChandlerError> {
self.use_chandler_config = v;
Ok(self)
}
pub fn use_sites_config(mut self, v: bool) -> Result<Self, ChandlerError> {
//self.site_resolver = Some(Box::new(crate::config::sites::load_sites_config()?));
self.use_sites_config = v;
Ok(self)
}
pub fn load_or_create(self) -> Result<Box<dyn Project>, ChandlerError> {
if let Some(path) = &self.path {
if exists_at(&path).is_some() {
return load(&path);
}
}
if let Some(url) = self.url {
let mut path = self.path;
let format = self.format;
let mut parser = self.parser;
// Use specified config path, or try to get the default one.
let config_path = self.config_path.or_else(config::get_default_config_path);
let config = if let Some(config) = self.config {
// If a config was explicitly specified, use it.
Some(config)
} else if let Some(config_file) = &self.config_file {
// ... otherwise, if a specific file was specified, try to load it.
Some(ChandlerConfig::from_file(config_file)?)
} else if self.use_chandler_config {
// ... otherwise, if it was specified to load the user's config ...
if let Some(config_path) = &config_path {
// If a config path was available, try to load the config from it.
Some(ChandlerConfig::from_location(config_path)?)
} else {
None
}
} else {
None
};
let config = config.unwrap_or_default().resolve()?;
let site_resolver = if let Some(site_resolver) = self.site_resolver {
Some(site_resolver)
} else if let Some(sites_file) = &self.sites_file {
// ... otherwise, if a specific file was specified, try to load it.
Some(Box::new(SitesConfig::from_file(sites_file)?) as Box<dyn SiteResolver>)
} else if self.use_sites_config {
// ... otherwise, if it was specified to load the user's sites config ...
if let Some(config_path) = &config_path {
// If a config path was available, try to load the sites config from it.
Some(Box::new(SitesConfig::from_location(config_path)?) as Box<dyn SiteResolver>)
} else {
None
}
} else {
None
};
if let Some(site_resolver) = site_resolver {
let site_info = if let Some(site_info) = site_resolver.resolve_site(&url)? {
site_info
} else {
site_resolver::unknown_site(&url)?
};
if path.is_none() {
let new_path = config.download_path.join(site_info.name).join(site_info.path);
// If a project already exists at the generated path, load it.
if exists_at(&new_path).is_some() {
return load(&new_path);
}
path = Some(new_path);
}
if parser.is_none() {
parser = Some(site_info.parser);
}
}
let path = path.ok_or_else(|| ChandlerError::CreateProject("No project path was specified!".into()))?;
let format = format.unwrap_or(ProjectFormat::V3);
let parser = parser.ok_or_else(|| ChandlerError::CreateProject("No parser type was specified!".into()))?;
let url = {
let mut url = Url::parse(&url)
.map_err(|err| ChandlerError::Other(format!("Error parsing thread URL: {err}").into()))?;
url.set_fragment(None);
url.to_string()
};
Ok(match format {
ProjectFormat::V2 => Box::new(v2::V2Project::create(&path, &url, parser)?),
ProjectFormat::V3 => Box::new(v3::V3Project::create(&path, &url, parser)?),
})
} else {
Err(ChandlerError::LoadProject(
"Project does not exist at path, and no URL was specified!".into(),
))
}
}
}
| 31.480645 | 117 | 0.586536 |
fed7ed90c28ed95e22fbb641d83cec8bd622f80e | 58,524 | html | HTML | docs/html/GeometryStage_8h_source.html | kostrykin/Carna | 099783bb7f8a6f52fcc8ccd4666e491cf0aa864c | [
"BSD-3-Clause"
] | null | null | null | docs/html/GeometryStage_8h_source.html | kostrykin/Carna | 099783bb7f8a6f52fcc8ccd4666e491cf0aa864c | [
"BSD-3-Clause"
] | null | null | null | docs/html/GeometryStage_8h_source.html | kostrykin/Carna | 099783bb7f8a6f52fcc8ccd4666e491cf0aa864c | [
"BSD-3-Clause"
] | null | null | null | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Carna: include/Carna/base/GeometryStage.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doc_extra.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Carna
 <span id="projectnumber">Version 3.3.2</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_ac977412f978244b06c42d30252b3e06.html">Carna</a></li><li class="navelem"><a class="el" href="dir_62505fd74ca3ce5ce51851622ceb72c0.html">base</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">GeometryStage.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="GeometryStage_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * Copyright (C) 2010 - 2015 Leonid Kostrykin</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * Chair of Medical Engineering (mediTEC)</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * RWTH Aachen University</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * Pauwelsstr. 20</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> * 52074 Aachen</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> * Germany</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> *</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> */</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> </div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor">#ifndef GEOMETRYSTAGE_H_6014714286</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="preprocessor">#define GEOMETRYSTAGE_H_6014714286</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> </div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="preprocessor">#include <<a class="code" href="FrameRenderer_8h.html">Carna/base/FrameRenderer.h</a>></span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="preprocessor">#include <<a class="code" href="RenderStage_8h.html">Carna/base/RenderStage.h</a>></span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#include <<a class="code" href="RenderQueue_8h.html">Carna/base/RenderQueue.h</a>></span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include <<a class="code" href="GeometryFeature_8h.html">Carna/base/GeometryFeature.h</a>></span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#include <<a class="code" href="math_8h.html">Carna/base/math.h</a>></span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include <memory></span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include <map></span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="keyword">namespace </span><a class="code" href="namespaceCarna.html">Carna</a></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> {</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="keyword">namespace </span>base</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> {</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> </div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> </div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="comment">// ----------------------------------------------------------------------------------</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="comment">// GeometryStage</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment">// ----------------------------------------------------------------------------------</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="keyword">template</span>< <span class="keyword">typename</span> RenderableCompare ></div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="classCarna_1_1base_1_1GeometryStage.html"> 59</a></span> <span class="keyword">class </span><a class="code" href="classCarna_1_1base_1_1GeometryStage.html">GeometryStage</a> : <span class="keyword">public</span> <a class="code" href="classCarna_1_1base_1_1RenderStage.html">RenderStage</a></div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> {</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> </div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <span class="keyword">typedef</span> <a class="code" href="classCarna_1_1base_1_1GeometryFeature_1_1ManagedInterface.html">GeometryFeature::ManagedInterface</a> <a class="code" href="classCarna_1_1base_1_1GeometryFeature_1_1ManagedInterface.html">VideoResource</a>;</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> </div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <a class="code" href="classCarna_1_1base_1_1Node.html">Node</a>* root;</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  std::size_t passesRendered;</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  std::map< GeometryFeature*, VideoResource* > acquiredFeatures;</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> </div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="keyword">protected</span>:</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> </div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="classCarna_1_1base_1_1GeometryStage.html#a19f72e739017069d2280801be2e5b20f"> 73</a></span>  <a class="code" href="classCarna_1_1base_1_1RenderQueue.html">RenderQueue< RenderableCompare ></a> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html#a19f72e739017069d2280801be2e5b20f">rq</a>;</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> </div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span> <span class="keyword">public</span>:</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span> </div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <a class="code" href="classCarna_1_1base_1_1GeometryStage.html#a98733d0736e18fdcddb8c1069d382a68">GeometryStage</a></div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  ( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html#a05fa7ad09a3e539f005b6d9ecde78846">geometryType</a></div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  , <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html#aec1cd4806178b857071f70a1f18e25e6">geometryTypeMask</a> = <a class="code" href="classCarna_1_1base_1_1RenderQueue.html">RenderQueue< RenderableCompare >::EXACT_MATCH_GEOMETRY_TYPE_MASK</a> );</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  </div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="classCarna_1_1base_1_1GeometryStage.html#a05fa7ad09a3e539f005b6d9ecde78846"> 87</a></span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html#a05fa7ad09a3e539f005b6d9ecde78846">geometryType</a>; </div><div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="classCarna_1_1base_1_1GeometryStage.html#aec1cd4806178b857071f70a1f18e25e6"> 88</a></span>  <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html#aec1cd4806178b857071f70a1f18e25e6">geometryTypeMask</a>; </div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span> </div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <span class="keyword">virtual</span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html#a2ee5dac700ce96488541848edde9a28e">~GeometryStage</a>();</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span> </div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html#a23b7b4eba3731b69041b17c8131190e1">prepareFrame</a>( <a class="code" href="classCarna_1_1base_1_1Node.html">Node</a>& root ) <span class="keyword">override</span>;</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span> </div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html#a92cf426f3d2b7c4f917103ddd110676f">renderPass</a>( <span class="keyword">const</span> <a class="code" href="namespaceCarna_1_1base_1_1math.html#a991a0f5376e1e66d3d97eafed6d057ef">math::Matrix4f</a>& viewTransform, <a class="code" href="classCarna_1_1base_1_1RenderTask.html">RenderTask</a>& rt, <span class="keyword">const</span> <a class="code" href="classCarna_1_1base_1_1Viewport.html">Viewport</a>& vp ) <span class="keyword">override</span>;</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span> </div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  std::size_t <a class="code" href="classCarna_1_1base_1_1GeometryStage.html#ad5162e45a98c86b5cf63ec39e6352bac">renderedPassesCount</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  </div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="keyword">template</span>< <span class="keyword">typename</span> GeometryFeatureType ></div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <span class="keyword">typename</span> GeometryFeatureType::ManagedInterface& <a class="code" href="classCarna_1_1base_1_1GeometryStage.html#ac7a41e16197f44711b83839cc9733b51">videoResource</a>( GeometryFeatureType& geometryFeature ) <span class="keyword">const</span>;</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  </div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="keyword">template</span>< <span class="keyword">typename</span> GeometryFeatureType ></div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <span class="keyword">const</span> <span class="keyword">typename</span> GeometryFeatureType::ManagedInterface& <a class="code" href="classCarna_1_1base_1_1GeometryStage.html#ac7a41e16197f44711b83839cc9733b51">videoResource</a>( <span class="keyword">const</span> GeometryFeatureType& geometryFeature ) <span class="keyword">const</span>;</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span> </div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span> <span class="keyword">protected</span>:</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span> </div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  <span class="keywordtype">void</span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html#a2203d2913d493bef1e530f5807dbade4">activateGLContext</a>() <span class="keyword">const</span>;</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  </div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html#a9dfe86e58ba7d83e4f7c78dafbf9fb02">buildRenderQueues</a>( <a class="code" href="classCarna_1_1base_1_1Node.html">Node</a>& root, <span class="keyword">const</span> <a class="code" href="namespaceCarna_1_1base_1_1math.html#a991a0f5376e1e66d3d97eafed6d057ef">math::Matrix4f</a>& viewTransform );</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span> </div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html#a78ba5c71c663ea7f93501b22ba692ae1">rewindRenderQueues</a>();</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span> </div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html#afb14ab3e52d2b433af0d73d8bd9b1834">updateRenderQueues</a>( <span class="keyword">const</span> <a class="code" href="namespaceCarna_1_1base_1_1math.html#a991a0f5376e1e66d3d97eafed6d057ef">math::Matrix4f</a>& viewTransform );</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span> </div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html#aa1e8790888f87bf5229ed71ffc8ab25e">render</a>( <span class="keyword">const</span> <a class="code" href="classCarna_1_1base_1_1Renderable.html">Renderable</a>& renderable ) = 0;</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span> </div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span> }; <span class="comment">// GeometryStage</span></div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span> </div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span> </div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span> <span class="keyword">template</span>< <span class="keyword">typename</span> RenderableCompare ></div><div class="line"><a name="l00152"></a><span class="lineno"><a class="line" href="classCarna_1_1base_1_1GeometryStage.html#a98733d0736e18fdcddb8c1069d382a68"> 152</a></span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html#a98733d0736e18fdcddb8c1069d382a68">GeometryStage< RenderableCompare >::GeometryStage</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html#a05fa7ad09a3e539f005b6d9ecde78846">geometryType</a>, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html#aec1cd4806178b857071f70a1f18e25e6">geometryTypeMask</a> )</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  : root( nullptr )</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  , passesRendered( 0 )</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  , <a class="code" href="classCarna_1_1base_1_1GeometryStage.html#a19f72e739017069d2280801be2e5b20f">rq</a>( geometryType, geometryTypeMask )</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  , geometryType( geometryType )</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  , geometryTypeMask( geometryTypeMask )</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span> {</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span> }</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span> </div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span> </div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span> <span class="keyword">template</span>< <span class="keyword">typename</span> RenderableCompare ></div><div class="line"><a name="l00163"></a><span class="lineno"><a class="line" href="classCarna_1_1base_1_1GeometryStage.html#a2ee5dac700ce96488541848edde9a28e"> 163</a></span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html">GeometryStage< RenderableCompare >::~GeometryStage</a>()</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span> {</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  activateGLContext();</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  std::for_each( acquiredFeatures.begin(), acquiredFeatures.end(),</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  [&]( <span class="keyword">const</span> std::pair< GeometryFeature*, VideoResource* >& entry )</div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  {</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  <span class="keywordflow">if</span>( entry.second != <span class="keyword">nullptr</span> )</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  {</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  <span class="keyword">delete</span> entry.second;</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  }</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  }</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  );</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span> }</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span> </div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span> </div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span> <span class="keyword">template</span>< <span class="keyword">typename</span> RenderableCompare ></div><div class="line"><a name="l00179"></a><span class="lineno"><a class="line" href="classCarna_1_1base_1_1GeometryStage.html#a2203d2913d493bef1e530f5807dbade4"> 179</a></span> <span class="keywordtype">void</span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html">GeometryStage< RenderableCompare >::activateGLContext</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00180"></a><span class="lineno"> 180</span> <span class="keyword"></span>{</div><div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  <span class="keywordflow">if</span>( isInitialized() )</div><div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  {</div><div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  renderer().glContext().makeCurrent();</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  }</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span> }</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span> </div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span> </div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span> <span class="keyword">template</span>< <span class="keyword">typename</span> RenderableCompare ></div><div class="line"><a name="l00189"></a><span class="lineno"><a class="line" href="classCarna_1_1base_1_1GeometryStage.html#a23b7b4eba3731b69041b17c8131190e1"> 189</a></span> <span class="keywordtype">void</span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html">GeometryStage< RenderableCompare >::prepareFrame</a>( <a class="code" href="classCarna_1_1base_1_1Node.html">Node</a>& root )</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span> {</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  RenderStage::prepareFrame( root );</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  this->root = &root;</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  this->passesRendered = 0;</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span> }</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span> </div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span> </div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span> <span class="keyword">template</span>< <span class="keyword">typename</span> RenderableCompare ></div><div class="line"><a name="l00198"></a><span class="lineno"><a class="line" href="classCarna_1_1base_1_1GeometryStage.html#ad5162e45a98c86b5cf63ec39e6352bac"> 198</a></span> std::size_t <a class="code" href="classCarna_1_1base_1_1GeometryStage.html">GeometryStage< RenderableCompare >::renderedPassesCount</a>()<span class="keyword"> const</span></div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span> <span class="keyword"></span>{</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  <span class="keywordflow">return</span> passesRendered;</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span> }</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span> </div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span> </div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span> <span class="keyword">template</span>< <span class="keyword">typename</span> RenderableCompare ></div><div class="line"><a name="l00205"></a><span class="lineno"><a class="line" href="classCarna_1_1base_1_1GeometryStage.html#a9dfe86e58ba7d83e4f7c78dafbf9fb02"> 205</a></span> <span class="keywordtype">void</span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html">GeometryStage< RenderableCompare >::buildRenderQueues</a>( <a class="code" href="classCarna_1_1base_1_1Node.html">Node</a>& root, <span class="keyword">const</span> <a class="code" href="namespaceCarna_1_1base_1_1math.html#a991a0f5376e1e66d3d97eafed6d057ef">math::Matrix4f</a>& viewTransform )</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span> {</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  rq.build( root, viewTransform );</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span> }</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span> </div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span> </div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span> <span class="keyword">template</span>< <span class="keyword">typename</span> RenderableCompare ></div><div class="line"><a name="l00212"></a><span class="lineno"><a class="line" href="classCarna_1_1base_1_1GeometryStage.html#a78ba5c71c663ea7f93501b22ba692ae1"> 212</a></span> <span class="keywordtype">void</span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html">GeometryStage< RenderableCompare >::rewindRenderQueues</a>()</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span> {</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  rq.rewind();</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span> }</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span> </div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span> </div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span> <span class="keyword">template</span>< <span class="keyword">typename</span> RenderableCompare ></div><div class="line"><a name="l00219"></a><span class="lineno"><a class="line" href="classCarna_1_1base_1_1GeometryStage.html#afb14ab3e52d2b433af0d73d8bd9b1834"> 219</a></span> <span class="keywordtype">void</span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html">GeometryStage< RenderableCompare >::updateRenderQueues</a>( <span class="keyword">const</span> <a class="code" href="namespaceCarna_1_1base_1_1math.html#a991a0f5376e1e66d3d97eafed6d057ef">math::Matrix4f</a>& viewTransform )</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span> {</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  rq.updateModelViewTransforms( viewTransform );</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span> }</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span> </div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span> </div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span> <span class="keyword">template</span>< <span class="keyword">typename</span> RenderableCompare ></div><div class="line"><a name="l00226"></a><span class="lineno"><a class="line" href="classCarna_1_1base_1_1GeometryStage.html#a92cf426f3d2b7c4f917103ddd110676f"> 226</a></span> <span class="keywordtype">void</span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html">GeometryStage< RenderableCompare >::renderPass</a>( <span class="keyword">const</span> <a class="code" href="namespaceCarna_1_1base_1_1math.html#a991a0f5376e1e66d3d97eafed6d057ef">math::Matrix4f</a>& viewTransform, <a class="code" href="classCarna_1_1base_1_1RenderTask.html">RenderTask</a>& rt, <span class="keyword">const</span> <a class="code" href="classCarna_1_1base_1_1Viewport.html">Viewport</a>& vp )</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span> {</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  <span class="keyword">const</span> <span class="keywordtype">bool</span> isFirstPass = passesRendered == 0;</div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  </div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <span class="comment">/* Maintain the render queues.</span></div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span> <span class="comment"> */</span></div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  <span class="keywordflow">if</span>( isFirstPass )</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  {</div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  buildRenderQueues( *root, viewTransform );</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  }</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  {</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  rewindRenderQueues();</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  <span class="keywordflow">if</span>( isViewTransformFixed() )</div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  {</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  updateRenderQueues( viewTransform );</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  }</div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  }</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span> </div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  std::set< GeometryFeature* > usedFeatures;</div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  <span class="keywordflow">while</span>( !rq.isEmpty() )</div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  {</div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  <span class="keyword">const</span> <a class="code" href="classCarna_1_1base_1_1Renderable.html">Renderable</a>& renderable = rq.poll();</div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  <span class="keywordflow">if</span>( isFirstPass )</div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  {</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  renderable.<a class="code" href="classCarna_1_1base_1_1Renderable.html#ab47c4e25c1624b198ba1b2f87061673c">geometry</a>().<a class="code" href="classCarna_1_1base_1_1Geometry.html#ab4eab2e6849e35ae79888bffdcf22841">visitFeatures</a>( [&]( <a class="code" href="classCarna_1_1base_1_1GeometryFeature.html">GeometryFeature</a>& gf, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> role )</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  {</div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  <span class="comment">/* Denote that the geometry feature was used.</span></div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span> <span class="comment"> */</span></div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  usedFeatures.insert( &gf );</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span> </div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  <span class="comment">/* Check whether video resources need to be acquired.</span></div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span> <span class="comment"> */</span></div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  <span class="keywordflow">if</span>( acquiredFeatures.find( &gf ) == acquiredFeatures.end() )</div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  {</div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  <a class="code" href="classCarna_1_1base_1_1GeometryFeature_1_1ManagedInterface.html">VideoResource</a>* <span class="keyword">const</span> vr = gf.<a class="code" href="classCarna_1_1base_1_1GeometryFeature.html#aa329e1b493c6fc70922482e201d938c2">acquireVideoResource</a>();</div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  acquiredFeatures[ &gf ] = vr;</div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  }</div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  }</div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  );</div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  }</div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  render( renderable );</div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  }</div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  <span class="keywordflow">if</span>( isFirstPass )</div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  {</div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  <span class="comment">/* Release unused video resources.</span></div><div class="line"><a name="l00272"></a><span class="lineno"> 272</span> <span class="comment"> */</span></div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  <span class="keywordflow">for</span>( <span class="keyword">auto</span> itr = acquiredFeatures.begin(); itr != acquiredFeatures.end(); )</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  {</div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  <span class="keywordflow">if</span>( usedFeatures.find( itr->first ) == usedFeatures.end() )</div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  {</div><div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  <span class="keywordflow">if</span>( itr->second != <span class="keyword">nullptr</span> )</div><div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  {</div><div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  <span class="keyword">delete</span> itr->second;</div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  }</div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  acquiredFeatures.erase( itr++ );</div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  }</div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  {</div><div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  ++itr;</div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  }</div><div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  }</div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  }</div><div class="line"><a name="l00289"></a><span class="lineno"> 289</span> }</div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span> </div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span> </div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span> <span class="keyword">template</span>< <span class="keyword">typename</span> RenderableCompare ></div><div class="line"><a name="l00293"></a><span class="lineno"> 293</span> <span class="keyword">template</span>< <span class="keyword">typename</span> GeometryFeatureType ></div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span> <span class="keyword">typename</span> GeometryFeatureType::ManagedInterface& <a class="code" href="classCarna_1_1base_1_1GeometryStage.html">GeometryStage< RenderableCompare ></a></div><div class="line"><a name="l00295"></a><span class="lineno"><a class="line" href="classCarna_1_1base_1_1GeometryStage.html#ac7a41e16197f44711b83839cc9733b51"> 295</a></span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html"> ::videoResource</a>( GeometryFeatureType& gf )<span class="keyword"> const</span></div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span> <span class="keyword"></span>{</div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span>  <span class="keyword">const</span> <span class="keyword">auto</span> itr = acquiredFeatures.find( &gf );</div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  <a class="code" href="CarnaException_8h.html#a6ca91617487e21fad9536a151e1aa74f">CARNA_ASSERT</a>( itr != acquiredFeatures.end() );</div><div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  <span class="keywordflow">return</span> <span class="keyword">static_cast<</span> typename GeometryFeatureType::ManagedInterface& <span class="keyword">></span>( *itr->second );</div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span> }</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span> </div><div class="line"><a name="l00302"></a><span class="lineno"> 302</span> </div><div class="line"><a name="l00303"></a><span class="lineno"> 303</span> <span class="keyword">template</span>< <span class="keyword">typename</span> RenderableCompare ></div><div class="line"><a name="l00304"></a><span class="lineno"> 304</span> <span class="keyword">template</span>< <span class="keyword">typename</span> GeometryFeatureType ></div><div class="line"><a name="l00305"></a><span class="lineno"> 305</span> <span class="keyword">const</span> <span class="keyword">typename</span> GeometryFeatureType::ManagedInterface& <a class="code" href="classCarna_1_1base_1_1GeometryStage.html">GeometryStage< RenderableCompare ></a></div><div class="line"><a name="l00306"></a><span class="lineno"><a class="line" href="classCarna_1_1base_1_1GeometryStage.html#a9e705c44373111f533e056ba2827aaf4"> 306</a></span> <a class="code" href="classCarna_1_1base_1_1GeometryStage.html"> ::videoResource</a>( <span class="keyword">const</span> GeometryFeatureType& gf )<span class="keyword"> const</span></div><div class="line"><a name="l00307"></a><span class="lineno"> 307</span> <span class="keyword"></span>{</div><div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  <span class="keywordflow">return</span> videoResource( const_cast< GeometryFeatureType& >( gf ) );</div><div class="line"><a name="l00309"></a><span class="lineno"> 309</span> }</div><div class="line"><a name="l00310"></a><span class="lineno"> 310</span> </div><div class="line"><a name="l00311"></a><span class="lineno"> 311</span> </div><div class="line"><a name="l00312"></a><span class="lineno"> 312</span> </div><div class="line"><a name="l00313"></a><span class="lineno"> 313</span> } <span class="comment">// namespace Carna :: base</span></div><div class="line"><a name="l00314"></a><span class="lineno"> 314</span> </div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span> } <span class="comment">// namespace Carna</span></div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span> </div><div class="line"><a name="l00317"></a><span class="lineno"> 317</span> <span class="preprocessor">#endif // GEOMETRYSTAGE_H_6014714286</span></div><div class="ttc" id="math_8h_html"><div class="ttname"><a href="math_8h.html">math.h</a></div><div class="ttdoc">Defines Carna::base::math namespace and CARNA_FOR_VECTOR3UI. </div></div>
<div class="ttc" id="classCarna_1_1base_1_1GeometryStage_html_a78ba5c71c663ea7f93501b22ba692ae1"><div class="ttname"><a href="classCarna_1_1base_1_1GeometryStage.html#a78ba5c71c663ea7f93501b22ba692ae1">Carna::base::GeometryStage::rewindRenderQueues</a></div><div class="ttdeci">virtual void rewindRenderQueues()</div><div class="ttdoc">Rewinds the rendering queues of this stage. </div><div class="ttdef"><b>Definition:</b> <a href="GeometryStage_8h_source.html#l00212">GeometryStage.h:212</a></div></div>
<div class="ttc" id="classCarna_1_1base_1_1GeometryStage_html_aec1cd4806178b857071f70a1f18e25e6"><div class="ttname"><a href="classCarna_1_1base_1_1GeometryStage.html#aec1cd4806178b857071f70a1f18e25e6">Carna::base::GeometryStage::geometryTypeMask</a></div><div class="ttdeci">const unsigned int geometryTypeMask</div><div class="ttdoc">Renders such geometries whose type AND-linked with this equals geometryType. </div><div class="ttdef"><b>Definition:</b> <a href="GeometryStage_8h_source.html#l00088">GeometryStage.h:88</a></div></div>
<div class="ttc" id="classCarna_1_1base_1_1GeometryStage_html_a2203d2913d493bef1e530f5807dbade4"><div class="ttname"><a href="classCarna_1_1base_1_1GeometryStage.html#a2203d2913d493bef1e530f5807dbade4">Carna::base::GeometryStage::activateGLContext</a></div><div class="ttdeci">void activateGLContext() const</div><div class="ttdoc">Ensures that the OpenGL context of the hosting Carna::base::FrameRenderer is the current one...</div><div class="ttdef"><b>Definition:</b> <a href="GeometryStage_8h_source.html#l00179">GeometryStage.h:179</a></div></div>
<div class="ttc" id="classCarna_1_1base_1_1GeometryStage_html_a9dfe86e58ba7d83e4f7c78dafbf9fb02"><div class="ttname"><a href="classCarna_1_1base_1_1GeometryStage.html#a9dfe86e58ba7d83e4f7c78dafbf9fb02">Carna::base::GeometryStage::buildRenderQueues</a></div><div class="ttdeci">virtual void buildRenderQueues(Node &root, const math::Matrix4f &viewTransform)</div><div class="ttdoc">Builds the rendering queues of this stage. </div><div class="ttdef"><b>Definition:</b> <a href="GeometryStage_8h_source.html#l00205">GeometryStage.h:205</a></div></div>
<div class="ttc" id="classCarna_1_1base_1_1GeometryStage_html_a19f72e739017069d2280801be2e5b20f"><div class="ttname"><a href="classCarna_1_1base_1_1GeometryStage.html#a19f72e739017069d2280801be2e5b20f">Carna::base::GeometryStage::rq</a></div><div class="ttdeci">RenderQueue< RenderableCompare > rq</div><div class="ttdoc">Holds the predefined rendering queue of this rendering stage. </div><div class="ttdef"><b>Definition:</b> <a href="GeometryStage_8h_source.html#l00073">GeometryStage.h:73</a></div></div>
<div class="ttc" id="classCarna_1_1base_1_1GeometryStage_html_ad5162e45a98c86b5cf63ec39e6352bac"><div class="ttname"><a href="classCarna_1_1base_1_1GeometryStage.html#ad5162e45a98c86b5cf63ec39e6352bac">Carna::base::GeometryStage::renderedPassesCount</a></div><div class="ttdeci">std::size_t renderedPassesCount() const</div><div class="ttdoc">Tells the number of passes rendered so far since the beginning of the current frame. </div><div class="ttdef"><b>Definition:</b> <a href="GeometryStage_8h_source.html#l00198">GeometryStage.h:198</a></div></div>
<div class="ttc" id="classCarna_1_1base_1_1GeometryStage_html"><div class="ttname"><a href="classCarna_1_1base_1_1GeometryStage.html">Carna::base::GeometryStage</a></div><div class="ttdoc">Partially implements a rendering stage that uses at least one render queue for rendering geometry fro...</div><div class="ttdef"><b>Definition:</b> <a href="GeometryStage_8h_source.html#l00059">GeometryStage.h:59</a></div></div>
<div class="ttc" id="GeometryFeature_8h_html"><div class="ttname"><a href="GeometryFeature_8h.html">GeometryFeature.h</a></div><div class="ttdoc">Defines Carna::base::GeometryFeature. </div></div>
<div class="ttc" id="FrameRenderer_8h_html"><div class="ttname"><a href="FrameRenderer_8h.html">FrameRenderer.h</a></div><div class="ttdoc">Defines Carna::base::FrameRenderer. </div></div>
<div class="ttc" id="classCarna_1_1base_1_1RenderQueue_html"><div class="ttname"><a href="classCarna_1_1base_1_1RenderQueue.html">Carna::base::RenderQueue</a></div><div class="ttdoc">Gathers renderable geometry nodes from scene graph and provides those in a particular order...</div><div class="ttdef"><b>Definition:</b> <a href="RenderQueue_8h_source.html#l00063">RenderQueue.h:63</a></div></div>
<div class="ttc" id="classCarna_1_1base_1_1GeometryFeature_html"><div class="ttname"><a href="classCarna_1_1base_1_1GeometryFeature.html">Carna::base::GeometryFeature</a></div><div class="ttdoc">Represents "components" that are aggregated by Geometry objects. Closer description is given here...</div><div class="ttdef"><b>Definition:</b> <a href="GeometryFeature_8h_source.html#l00041">GeometryFeature.h:41</a></div></div>
<div class="ttc" id="classCarna_1_1base_1_1GeometryFeature_html_aa329e1b493c6fc70922482e201d938c2"><div class="ttname"><a href="classCarna_1_1base_1_1GeometryFeature.html#aa329e1b493c6fc70922482e201d938c2">Carna::base::GeometryFeature::acquireVideoResource</a></div><div class="ttdeci">virtual ManagedInterface * acquireVideoResource()=0</div><div class="ttdoc">Acquires the video resources from this GeometryFeature by returning new instance of a class derived f...</div></div>
<div class="ttc" id="classCarna_1_1base_1_1GeometryFeature_1_1ManagedInterface_html"><div class="ttname"><a href="classCarna_1_1base_1_1GeometryFeature_1_1ManagedInterface.html">Carna::base::GeometryFeature::ManagedInterface</a></div><div class="ttdoc">Represents an acquisition of the video resources from a particular GeometryFeature. This acquisition realizes the RAII idiom. </div><div class="ttdef"><b>Definition:</b> <a href="GeometryFeature_8h_source.html#l00110">GeometryFeature.h:110</a></div></div>
<div class="ttc" id="classCarna_1_1base_1_1GeometryStage_html_a92cf426f3d2b7c4f917103ddd110676f"><div class="ttname"><a href="classCarna_1_1base_1_1GeometryStage.html#a92cf426f3d2b7c4f917103ddd110676f">Carna::base::GeometryStage::renderPass</a></div><div class="ttdeci">virtual void renderPass(const math::Matrix4f &viewTransform, RenderTask &rt, const Viewport &vp) override</div><div class="ttdoc">Called once per pass. </div><div class="ttdef"><b>Definition:</b> <a href="GeometryStage_8h_source.html#l00226">GeometryStage.h:226</a></div></div>
<div class="ttc" id="classCarna_1_1base_1_1Node_html"><div class="ttname"><a href="classCarna_1_1base_1_1Node.html">Carna::base::Node</a></div><div class="ttdoc">Defines the inner node of a scene graph. Implements a spatial scene element that is allowed to have c...</div><div class="ttdef"><b>Definition:</b> <a href="Node_8h_source.html#l00044">Node.h:44</a></div></div>
<div class="ttc" id="classCarna_1_1base_1_1RenderTask_html"><div class="ttname"><a href="classCarna_1_1base_1_1RenderTask.html">Carna::base::RenderTask</a></div><div class="ttdoc">Invokes the rendering stages of the frame renderer successively. </div><div class="ttdef"><b>Definition:</b> <a href="RenderTask_8h_source.html#l00040">RenderTask.h:40</a></div></div>
<div class="ttc" id="classCarna_1_1base_1_1Geometry_html_ab4eab2e6849e35ae79888bffdcf22841"><div class="ttname"><a href="classCarna_1_1base_1_1Geometry.html#ab4eab2e6849e35ae79888bffdcf22841">Carna::base::Geometry::visitFeatures</a></div><div class="ttdeci">void visitFeatures(const std::function< void(GeometryFeature &gf, unsigned int role) > &visit) const</div><div class="ttdoc">Invokes visit once on each attached geometry feature. </div></div>
<div class="ttc" id="classCarna_1_1base_1_1GeometryStage_html_a2ee5dac700ce96488541848edde9a28e"><div class="ttname"><a href="classCarna_1_1base_1_1GeometryStage.html#a2ee5dac700ce96488541848edde9a28e">Carna::base::GeometryStage::~GeometryStage</a></div><div class="ttdeci">virtual ~GeometryStage()</div><div class="ttdoc">Releases acquired video resources. </div><div class="ttdef"><b>Definition:</b> <a href="GeometryStage_8h_source.html#l00163">GeometryStage.h:163</a></div></div>
<div class="ttc" id="RenderQueue_8h_html"><div class="ttname"><a href="RenderQueue_8h.html">RenderQueue.h</a></div><div class="ttdoc">Defines Carna::base::RenderQueue. </div></div>
<div class="ttc" id="classCarna_1_1base_1_1GeometryStage_html_a23b7b4eba3731b69041b17c8131190e1"><div class="ttname"><a href="classCarna_1_1base_1_1GeometryStage.html#a23b7b4eba3731b69041b17c8131190e1">Carna::base::GeometryStage::prepareFrame</a></div><div class="ttdeci">virtual void prepareFrame(Node &root) override</div><div class="ttdoc">Called once before each frame. </div><div class="ttdef"><b>Definition:</b> <a href="GeometryStage_8h_source.html#l00189">GeometryStage.h:189</a></div></div>
<div class="ttc" id="namespaceCarna_1_1base_1_1math_html_a991a0f5376e1e66d3d97eafed6d057ef"><div class="ttname"><a href="namespaceCarna_1_1base_1_1math.html#a991a0f5376e1e66d3d97eafed6d057ef">Carna::base::math::Matrix4f</a></div><div class="ttdeci">Eigen::Matrix< float, 4, 4, Eigen::ColMajor > Matrix4f</div><div class="ttdoc">Defines matrix. </div><div class="ttdef"><b>Definition:</b> <a href="math_8h_source.html#l00193">math.h:193</a></div></div>
<div class="ttc" id="classCarna_1_1base_1_1Renderable_html_ab47c4e25c1624b198ba1b2f87061673c"><div class="ttname"><a href="classCarna_1_1base_1_1Renderable.html#ab47c4e25c1624b198ba1b2f87061673c">Carna::base::Renderable::geometry</a></div><div class="ttdeci">const Geometry & geometry() const</div><div class="ttdoc">References the geometry node. </div></div>
<div class="ttc" id="classCarna_1_1base_1_1RenderStage_html"><div class="ttname"><a href="classCarna_1_1base_1_1RenderStage.html">Carna::base::RenderStage</a></div><div class="ttdoc">Base abstract class of each rendering stage. Refer to the documentation of the rendering process...</div><div class="ttdef"><b>Definition:</b> <a href="RenderStage_8h_source.html#l00042">RenderStage.h:42</a></div></div>
<div class="ttc" id="classCarna_1_1base_1_1Viewport_html"><div class="ttname"><a href="classCarna_1_1base_1_1Viewport.html">Carna::base::Viewport</a></div><div class="ttdoc">Defines a rendering viewport. The viewport is a property of the current OpenGL context. </div><div class="ttdef"><b>Definition:</b> <a href="Viewport_8h_source.html#l00048">Viewport.h:48</a></div></div>
<div class="ttc" id="namespaceCarna_html"><div class="ttname"><a href="namespaceCarna.html">Carna</a></div><div class="ttdef"><b>Definition:</b> <a href="doc__CoordinateSystems_8dox_source.html#l00001">doc_CoordinateSystems.dox:1</a></div></div>
<div class="ttc" id="classCarna_1_1base_1_1GeometryStage_html_ac7a41e16197f44711b83839cc9733b51"><div class="ttname"><a href="classCarna_1_1base_1_1GeometryStage.html#ac7a41e16197f44711b83839cc9733b51">Carna::base::GeometryStage::videoResource</a></div><div class="ttdeci">GeometryFeatureType::ManagedInterface & videoResource(GeometryFeatureType &geometryFeature) const</div><div class="ttdoc">Interfaces the geometryFeature video resources that were acquired by this rendering stage...</div><div class="ttdef"><b>Definition:</b> <a href="GeometryStage_8h_source.html#l00295">GeometryStage.h:295</a></div></div>
<div class="ttc" id="classCarna_1_1base_1_1GeometryStage_html_a05fa7ad09a3e539f005b6d9ecde78846"><div class="ttname"><a href="classCarna_1_1base_1_1GeometryStage.html#a05fa7ad09a3e539f005b6d9ecde78846">Carna::base::GeometryStage::geometryType</a></div><div class="ttdeci">const unsigned int geometryType</div><div class="ttdoc">Renders such geometries whose type AND-linked with geometryTypeMask equals this. </div><div class="ttdef"><b>Definition:</b> <a href="GeometryStage_8h_source.html#l00087">GeometryStage.h:87</a></div></div>
<div class="ttc" id="classCarna_1_1base_1_1Renderable_html"><div class="ttname"><a href="classCarna_1_1base_1_1Renderable.html">Carna::base::Renderable</a></div><div class="ttdoc">Represents a Geometry object that has been queued into a RenderQueue. The object&#39;s model-view transfo...</div><div class="ttdef"><b>Definition:</b> <a href="Renderable_8h_source.html#l00045">Renderable.h:45</a></div></div>
<div class="ttc" id="classCarna_1_1base_1_1GeometryStage_html_a98733d0736e18fdcddb8c1069d382a68"><div class="ttname"><a href="classCarna_1_1base_1_1GeometryStage.html#a98733d0736e18fdcddb8c1069d382a68">Carna::base::GeometryStage::GeometryStage</a></div><div class="ttdeci">GeometryStage(unsigned int geometryType, unsigned int geometryTypeMask=RenderQueue< RenderableCompare >::EXACT_MATCH_GEOMETRY_TYPE_MASK)</div><div class="ttdoc">Instantiates s.t. the predefined rendering queue enqueues such Carna::base::Geometry scene graph node...</div><div class="ttdef"><b>Definition:</b> <a href="GeometryStage_8h_source.html#l00152">GeometryStage.h:152</a></div></div>
<div class="ttc" id="classCarna_1_1base_1_1GeometryStage_html_afb14ab3e52d2b433af0d73d8bd9b1834"><div class="ttname"><a href="classCarna_1_1base_1_1GeometryStage.html#afb14ab3e52d2b433af0d73d8bd9b1834">Carna::base::GeometryStage::updateRenderQueues</a></div><div class="ttdeci">virtual void updateRenderQueues(const math::Matrix4f &viewTransform)</div><div class="ttdoc">Recomputes the model-view transforms of the renderables enqueued by this stage. </div><div class="ttdef"><b>Definition:</b> <a href="GeometryStage_8h_source.html#l00219">GeometryStage.h:219</a></div></div>
<div class="ttc" id="CarnaException_8h_html_a6ca91617487e21fad9536a151e1aa74f"><div class="ttname"><a href="CarnaException_8h.html#a6ca91617487e21fad9536a151e1aa74f">CARNA_ASSERT</a></div><div class="ttdeci">#define CARNA_ASSERT(expression)</div><div class="ttdoc">If the given expression is false, a break point is raised in debug mode and an AssertionFailure throw...</div><div class="ttdef"><b>Definition:</b> <a href="CarnaException_8h_source.html#l00212">CarnaException.h:212</a></div></div>
<div class="ttc" id="RenderStage_8h_html"><div class="ttname"><a href="RenderStage_8h.html">RenderStage.h</a></div><div class="ttdoc">Defines Carna::base::RenderStage. </div></div>
<div class="ttc" id="classCarna_1_1base_1_1GeometryStage_html_aa1e8790888f87bf5229ed71ffc8ab25e"><div class="ttname"><a href="classCarna_1_1base_1_1GeometryStage.html#aa1e8790888f87bf5229ed71ffc8ab25e">Carna::base::GeometryStage::render</a></div><div class="ttdeci">virtual void render(const Renderable &renderable)=0</div><div class="ttdoc">Renders the renderable. </div></div>
</div><!-- fragment --></div><!-- contents -->
<hr class="footer"/>
<address class="footer">
<small>
Written by <a href="http://evoid.de">Leonid Kostrykin</a> at the
Chair of Medical Engineering (mediTEC),
RWTH Aachen University <p>
Documentation generated by <a href="http://www.doxygen.org/index.html"> Doxygen </a>
</small>
</address>
</body>
</html>
| 475.804878 | 40,547 | 0.701917 |
dde4bc5a48fe45eb2fbdaa0e1761bd084350affb | 1,015 | php | PHP | Modules/Installer/Events/LaravelInstallerFinished.php | thuandinhglink/laravel5-to-heroku | a0c629a4bbb76289fc67da4bad712c061e56d7e4 | [
"MIT"
] | null | null | null | Modules/Installer/Events/LaravelInstallerFinished.php | thuandinhglink/laravel5-to-heroku | a0c629a4bbb76289fc67da4bad712c061e56d7e4 | [
"MIT"
] | null | null | null | Modules/Installer/Events/LaravelInstallerFinished.php | thuandinhglink/laravel5-to-heroku | a0c629a4bbb76289fc67da4bad712c061e56d7e4 | [
"MIT"
] | 1 | 2021-12-23T14:28:08.000Z | 2021-12-23T14:28:08.000Z | <?php
namespace Modules\Installer\Events;
use Illuminate\Queue\SerializesModels;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
/**
* Class LaravelInstallerFinished
*
* The class is Defined for LaravelInstallerFinished.
*
* PHP version 7.1.3
*
* @category Administration
* @package Modules\LaravelInstallerFinished
* @author Vipul Patel <vipul@chetsapp.com>
* @copyright 2019 Chetsapp Group
* @license Chetsapp Private Limited
* @version Release: @1.0@
* @link http://chetsapp.com
* @since Class available since Release 1.0
*/
class LaravelInstallerFinished
{
use Dispatchable, InteractsWithSockets, SerializesModels;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Get the channels the event should be broadcast on.
*
* @return array
*/
public function broadcastOn()
{
return [];
}
}
| 21.145833 | 61 | 0.66601 |
73872034eb5dad88718770db114e8972532cc262 | 5,659 | rs | Rust | src/results/svg_graph.rs | DTM9025/feh-sim-seed | e20a0b59b1c17bbeed26200351712f274f9a902a | [
"MIT"
] | 4 | 2019-06-08T10:58:47.000Z | 2022-02-22T03:16:46.000Z | src/results/svg_graph.rs | DTM9025/feh-sim-seed | e20a0b59b1c17bbeed26200351712f274f9a902a | [
"MIT"
] | null | null | null | src/results/svg_graph.rs | DTM9025/feh-sim-seed | e20a0b59b1c17bbeed26200351712f274f9a902a | [
"MIT"
] | 1 | 2021-01-22T02:09:24.000Z | 2021-01-22T02:09:24.000Z | use seed::prelude::*;
use std::fmt::Write;
use wasm_bindgen::JsCast;
use crate::counter::Counter;
use crate::stats;
use crate::Msg;
const XMIN: f32 = 0.0;
const YMIN: f32 = 0.0;
const WIDTH: f32 = 100.0;
const HEIGHT: f32 = 60.0;
/// SVG elements for displaying the results within the graph. If `highlight` is
/// given, places a label on the graph at the specified point. Otherwise, labels
/// are placed at pre-set locations. Returns two elements, one for the line and
/// one for the collection of labels.
fn graph_line(data: &Counter, highlight: Option<f32>) -> (Node<Msg>, Node<Msg>) {
// Sample every 0.1% in ranges 0%-10% and 90%-100%, and every 1% in between.
// Probabilities only change sharply near the extremes, so this makes things
// render more quickly without hurting smoothness.
let sample_points = (0..100)
.map(|x| x as f32 / 1000.0)
.chain((10..90).map(|x| x as f32 / 100.0))
.chain((900..1000).map(|x| x as f32 / 1000.0))
.collect::<Vec<_>>();
let data_points = stats::percentiles(data, &sample_points);
// Helper functions for converting between data values and graph coordinates.
let x = |pct: f32| pct as f32 * WIDTH + XMIN;
let y = |val: f32| {
let max = *data_points.last().unwrap() as f32;
HEIGHT - (val / max) * HEIGHT
};
let mut path = String::new();
if !data.is_empty() {
write!(
path,
"M {} {} ",
x(sample_points[0]),
y(data_points[0] as f32)
)
.unwrap();
for i in 1..data_points.len() {
if data_points[i] != data_points[i - 1] {
write!(
path,
"L {} {}",
x(sample_points[i]),
y(data_points[i] as f32)
)
.unwrap();
}
}
}
let path_el = path![
id!["graph_line"],
attrs![
"d" => path;
],
];
let mut points_el = g![id!["graph_highlights"],];
let mut add_point = |pct: f32| {
let value = stats::percentile(data, pct) as f32;
points_el.add_child(circle![attrs![
"cx" => x(pct);
"cy" => y(value);
"r" => "0.75px";
]]);
let label_text = format!("{}%: {} orbs", (pct * 1000.0).round() / 10.0, value);
points_el.add_child(text![
attrs![
"font-size" => "15%";
],
// By default, put the label up and to the left of the point.
if pct > 0.24 {
attrs![
"dx" => x(pct) - 1.0;
"dy" => y(value) - 1.0;
"text-anchor" => "end";
"dominant-baseline" => "baseline";
]
} else {
// If the point is too far to the left for the label to fit,
// then put it down and to the right if there is room there.
if y(value) < HEIGHT * 0.9 {
attrs![
"dx" => x(pct) + 1.0;
"dy" => y(value) + 1.0;
"text-anchor" => "begin";
"dominant-baseline" => "hanging";
]
} else {
// If there isn't room in either of those places, then just
// snap it to the left edge, high enough to not intersect
// the graph line.
attrs![
"dx" => 1.0;
"dy" => y(stats::percentile(data, 0.24) as f32) - 1.0;
"text-anchor" => "begin";
"dominant-baseline" => "baseline";
]
}
},
label_text,
]);
};
if !data.is_empty() {
if let Some(highlight) = highlight {
add_point(highlight);
} else {
for &pct in &[0.25, 0.5, 0.75, 0.9, 0.99] {
add_point(pct);
}
}
}
(path_el, points_el)
}
/// Graph for displaying the results. If `highlight` is given, places a label
/// on the graph at the specified point. Otherwise, labels are placed at pre-set
/// locations.
pub fn graph(data: &Counter, highlight: Option<f32>) -> Node<Msg> {
let (path_el, points_el) = graph_line(data, highlight);
fn get_graph_width(event: &web_sys::Event) -> Option<f64> {
let target = event.target()?;
let target_el: &web_sys::Element = target.dyn_ref::<web_sys::SvgsvgElement>()?.as_ref();
let width = target_el.get_bounding_client_rect().width();
Some(width)
}
svg![
id!["graph"],
mouse_ev(Ev::Click, |click| {
if let Some(width) = get_graph_width(&click) {
let width_frac = (click.offset_x() as f32 / width as f32).min(0.999).max(0.0);
Msg::GraphHighlight {
frac: (1000.0 * width_frac).round() / 1000.0,
}
} else {
Msg::Null
}
}),
attrs![
At::ViewBox => format!("{} {} {} {}", XMIN, YMIN, WIDTH, HEIGHT);
],
path_el,
if !data.is_empty() {
text![
id!["graph_sample_count"],
attrs![
"dominant-baseline" => "hanging";
"font-size" => "10%";
],
format!("{} samples", data.iter().sum::<u32>()),
]
} else {
seed::empty()
},
points_el,
]
}
| 34.506098 | 96 | 0.4651 |
3eed958f450b5cd4d72535645a1d10188d3245bd | 5,918 | h | C | aws-cpp-sdk-cloudformation/include/aws/cloudformation/model/DeleteChangeSetRequest.h | curiousjgeorge/aws-sdk-cpp | 09b65deba03cfbef9a1e5d5986aa4de71bc03cd8 | [
"Apache-2.0"
] | null | null | null | aws-cpp-sdk-cloudformation/include/aws/cloudformation/model/DeleteChangeSetRequest.h | curiousjgeorge/aws-sdk-cpp | 09b65deba03cfbef9a1e5d5986aa4de71bc03cd8 | [
"Apache-2.0"
] | null | null | null | aws-cpp-sdk-cloudformation/include/aws/cloudformation/model/DeleteChangeSetRequest.h | curiousjgeorge/aws-sdk-cpp | 09b65deba03cfbef9a1e5d5986aa4de71bc03cd8 | [
"Apache-2.0"
] | null | null | null | /*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
#pragma once
#include <aws/cloudformation/CloudFormation_EXPORTS.h>
#include <aws/cloudformation/CloudFormationRequest.h>
#include <aws/core/utils/memory/stl/AWSString.h>
#include <utility>
namespace Aws
{
namespace CloudFormation
{
namespace Model
{
/**
* <p>The input for the <a>DeleteChangeSet</a> action.</p><p><h3>See Also:</h3>
* <a
* href="http://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DeleteChangeSetInput">AWS
* API Reference</a></p>
*/
class AWS_CLOUDFORMATION_API DeleteChangeSetRequest : public CloudFormationRequest
{
public:
DeleteChangeSetRequest();
// Service request name is the Operation name which will send this request out,
// each operation should has unique request name, so that we can get operation's name from this request.
// Note: this is not true for response, multiple operations may have the same response name,
// so we can not get operation's name from response.
inline virtual const char* GetServiceRequestName() const override { return "DeleteChangeSet"; }
Aws::String SerializePayload() const override;
protected:
void DumpBodyToUrl(Aws::Http::URI& uri ) const override;
public:
/**
* <p>The name or Amazon Resource Name (ARN) of the change set that you want to
* delete.</p>
*/
inline const Aws::String& GetChangeSetName() const{ return m_changeSetName; }
/**
* <p>The name or Amazon Resource Name (ARN) of the change set that you want to
* delete.</p>
*/
inline bool ChangeSetNameHasBeenSet() const { return m_changeSetNameHasBeenSet; }
/**
* <p>The name or Amazon Resource Name (ARN) of the change set that you want to
* delete.</p>
*/
inline void SetChangeSetName(const Aws::String& value) { m_changeSetNameHasBeenSet = true; m_changeSetName = value; }
/**
* <p>The name or Amazon Resource Name (ARN) of the change set that you want to
* delete.</p>
*/
inline void SetChangeSetName(Aws::String&& value) { m_changeSetNameHasBeenSet = true; m_changeSetName = std::move(value); }
/**
* <p>The name or Amazon Resource Name (ARN) of the change set that you want to
* delete.</p>
*/
inline void SetChangeSetName(const char* value) { m_changeSetNameHasBeenSet = true; m_changeSetName.assign(value); }
/**
* <p>The name or Amazon Resource Name (ARN) of the change set that you want to
* delete.</p>
*/
inline DeleteChangeSetRequest& WithChangeSetName(const Aws::String& value) { SetChangeSetName(value); return *this;}
/**
* <p>The name or Amazon Resource Name (ARN) of the change set that you want to
* delete.</p>
*/
inline DeleteChangeSetRequest& WithChangeSetName(Aws::String&& value) { SetChangeSetName(std::move(value)); return *this;}
/**
* <p>The name or Amazon Resource Name (ARN) of the change set that you want to
* delete.</p>
*/
inline DeleteChangeSetRequest& WithChangeSetName(const char* value) { SetChangeSetName(value); return *this;}
/**
* <p>If you specified the name of a change set to delete, specify the stack name
* or ID (ARN) that is associated with it.</p>
*/
inline const Aws::String& GetStackName() const{ return m_stackName; }
/**
* <p>If you specified the name of a change set to delete, specify the stack name
* or ID (ARN) that is associated with it.</p>
*/
inline bool StackNameHasBeenSet() const { return m_stackNameHasBeenSet; }
/**
* <p>If you specified the name of a change set to delete, specify the stack name
* or ID (ARN) that is associated with it.</p>
*/
inline void SetStackName(const Aws::String& value) { m_stackNameHasBeenSet = true; m_stackName = value; }
/**
* <p>If you specified the name of a change set to delete, specify the stack name
* or ID (ARN) that is associated with it.</p>
*/
inline void SetStackName(Aws::String&& value) { m_stackNameHasBeenSet = true; m_stackName = std::move(value); }
/**
* <p>If you specified the name of a change set to delete, specify the stack name
* or ID (ARN) that is associated with it.</p>
*/
inline void SetStackName(const char* value) { m_stackNameHasBeenSet = true; m_stackName.assign(value); }
/**
* <p>If you specified the name of a change set to delete, specify the stack name
* or ID (ARN) that is associated with it.</p>
*/
inline DeleteChangeSetRequest& WithStackName(const Aws::String& value) { SetStackName(value); return *this;}
/**
* <p>If you specified the name of a change set to delete, specify the stack name
* or ID (ARN) that is associated with it.</p>
*/
inline DeleteChangeSetRequest& WithStackName(Aws::String&& value) { SetStackName(std::move(value)); return *this;}
/**
* <p>If you specified the name of a change set to delete, specify the stack name
* or ID (ARN) that is associated with it.</p>
*/
inline DeleteChangeSetRequest& WithStackName(const char* value) { SetStackName(value); return *this;}
private:
Aws::String m_changeSetName;
bool m_changeSetNameHasBeenSet;
Aws::String m_stackName;
bool m_stackNameHasBeenSet;
};
} // namespace Model
} // namespace CloudFormation
} // namespace Aws
| 36.530864 | 127 | 0.68148 |
75ec1d619b793162c0e5c61084d94293d55db0d8 | 317 | php | PHP | resources/views/clientes/resultado.blade.php | diogoko/fatec_t13 | ab5bf4705857749f94c1bef4fde48ac82161533e | [
"MIT"
] | null | null | null | resources/views/clientes/resultado.blade.php | diogoko/fatec_t13 | ab5bf4705857749f94c1bef4fde48ac82161533e | [
"MIT"
] | null | null | null | resources/views/clientes/resultado.blade.php | diogoko/fatec_t13 | ab5bf4705857749f94c1bef4fde48ac82161533e | [
"MIT"
] | null | null | null | @extends('layout')
@section('conteudo')
<div>
<p>Nome</p>
<p>{{ $nome }}</p>
</div>
<div>
<p>Nascimento</p>
<p>{{ $nascimento }}</p>
</div>
<div>
<p>Idade</p>
<p>{{ $idade }}</p>
</div>
@endsection
@section('titulo', 'Resultado da operação')
| 15.85 | 43 | 0.435331 |
0b61d6924578e04d8bbfa01176c73eece0bd32ef | 2,484 | py | Python | nova/tests/test_hooks.py | bopopescu/zknova | 8dd09199f5678697be228ffceeaf2c16f6d7319d | [
"Apache-2.0"
] | null | null | null | nova/tests/test_hooks.py | bopopescu/zknova | 8dd09199f5678697be228ffceeaf2c16f6d7319d | [
"Apache-2.0"
] | null | null | null | nova/tests/test_hooks.py | bopopescu/zknova | 8dd09199f5678697be228ffceeaf2c16f6d7319d | [
"Apache-2.0"
] | 1 | 2020-07-24T08:25:25.000Z | 2020-07-24T08:25:25.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 OpenStack, LLC.
# All Rights Reserved.
#
# 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 under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""Tests for hook customization."""
import stevedore
from nova import hooks
from nova import test
class SampleHookA(object):
name = "a"
def _add_called(self, op, kwargs):
called = kwargs.get('called', None)
if called is not None:
called.append(op + self.name)
def pre(self, *args, **kwargs):
self._add_called("pre", kwargs)
class SampleHookB(SampleHookA):
name = "b"
def post(self, rv, *args, **kwargs):
self._add_called("post", kwargs)
class MockEntryPoint(object):
def __init__(self, cls):
self.cls = cls
def load(self):
return self.cls
class HookTestCase(test.TestCase):
def _mock_load_plugins(self, iload, iargs, ikwargs):
return [
stevedore.extension.Extension('test_hook',
MockEntryPoint(SampleHookA), SampleHookA, SampleHookA()),
stevedore.extension.Extension('test_hook',
MockEntryPoint(SampleHookB), SampleHookB, SampleHookB()),
]
def setUp(self):
super(HookTestCase, self).setUp()
hooks.reset()
self.stubs.Set(stevedore.extension.ExtensionManager, '_load_plugins',
self._mock_load_plugins)
@hooks.add_hook('test_hook')
def _hooked(self, a, b=1, c=2, called=None):
return 42
def test_basic(self):
self.assertEqual(42, self._hooked(1))
mgr = hooks._HOOKS['test_hook']
self.assertEqual(2, len(mgr.extensions))
self.assertEqual(SampleHookA, mgr.extensions[0].plugin)
self.assertEqual(SampleHookB, mgr.extensions[1].plugin)
def test_order_of_execution(self):
called_order = []
self._hooked(42, called=called_order)
self.assertEqual(['prea', 'preb', 'postb'], called_order)
| 28.227273 | 78 | 0.654187 |
e49918e5329ac582eff34892048cb6cb06da0b3e | 666 | lua | Lua | lib/acid/bisect.lua | wenbobuaa/lua-acid | 906260e1dc42b26353c3b8fa24ca94653536e56e | [
"MIT"
] | 10 | 2017-03-02T05:54:11.000Z | 2018-02-27T07:06:27.000Z | lib/acid/bisect.lua | wenbobuaa/lua-acid | 906260e1dc42b26353c3b8fa24ca94653536e56e | [
"MIT"
] | 37 | 2017-04-11T06:33:49.000Z | 2018-04-03T03:56:11.000Z | lib/acid/bisect.lua | wenbobuaa/lua-acid | 906260e1dc42b26353c3b8fa24ca94653536e56e | [
"MIT"
] | 4 | 2017-08-28T08:36:06.000Z | 2018-03-22T03:00:43.000Z | local tableutil = require('acid.tableutil')
local _M = {}
function _M.search(array, key, opts)
-- Return boolean `found` and int `index` so that:
--
-- array[index] <= key < array[index + 1]
opts = opts or {}
local cmp = opts.cmp or tableutil.cmp_list
local l = 0
local r = #array + 1
local mid
while l < r - 1 do
mid = l + r
mid = (mid - mid % 2) / 2
local rst = cmp(key, array[mid])
if rst == 0 then
return true, mid
elseif rst > 0 then
l = mid
elseif rst < 0 then
r = mid
end
end
return false, l
end
return _M
| 17.076923 | 54 | 0.503003 |
ddf587878b1ba887179c8802a36529f8e83c94e0 | 3,947 | php | PHP | resources/views/users/index.blade.php | sultan1311/saga | d05bc6a7c939c98d0c627504291f260be7785e43 | [
"MIT"
] | null | null | null | resources/views/users/index.blade.php | sultan1311/saga | d05bc6a7c939c98d0c627504291f260be7785e43 | [
"MIT"
] | null | null | null | resources/views/users/index.blade.php | sultan1311/saga | d05bc6a7c939c98d0c627504291f260be7785e43 | [
"MIT"
] | null | null | null | @extends('template.header')
@section('content')
<div class="content-page">
<!-- Start content -->
<div class="content">
<div class="container">
<div class="row">
<div class="col-sm-12">
<div class="card-box table-responsive">
<a href="{{ route('user.create') }}"
class="btn btn-primary waves-effect waves-light m-b-5 pull-right"> <i
class="fa fa-plus"></i> <span>Add User</span> </a>
<h4 class="header-title m-t-0 m-b-30">Users List</h4>
<table id="datatable" style="width: 100%;" class="table table-striped table-bordered datatable">
<thead>
<tr>
<th style="width: 5%;">No</th>
<th style="width: 35%;">Full Name</th>
<th style="width: 35%;">Email</th>
<th style="width: 35%;">Avatar</th>
<th style="width: 25%;">Action</th>
</tr>
</thead>
<tbody>
@foreach ($data as $key => $value)
<tr>
<td> {{ ($key + 1) }} </td>
<td> {{ $value->name }} </td>
<td> {{ $value->email }} </td>
<td>
@if ( $value->avatar)
@if (File::exists('images/'. $value->avatar))
@php
$avatar = asset('images/'. $value->avatar);
@endphp
@else
@php
$avatar = $value->avatar;
@endphp
@endif
@else
@php
$avatar = 'admin/images/users/avatar-1.jpg';
@endphp
@endif
<img src="{{ $avatar }}"
style="max-width: 100%; max-height: 100%;" alt="{{ $value->name }}">
</td>
<td>
<a href="{{ url('user/'. $value->id .'/edit') }}"
class="btn btn-icon waves-effect waves-light btn-warning m-b-5"> <i
class="fa fa-pencil"></i> </a>
{!! Form::open(['url' => 'user/'. $value->id]) !!}
@method('DELETE')
<button type="submit"
class="btn btn-icon waves-effect waves-light btn-danger m-b-5"> <i
class="fa fa-trash"></i> </button>
{!! Form::close() !!}
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div><!-- end col -->
</div>
</div> <!-- container -->
</div> <!-- content -->
</div>
| 51.25974 | 120 | 0.266785 |