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
6a8b912ec3de1a9374c74515afdf8d709e54863e
2,126
dart
Dart
lib/home/widgets/app_bar/app_bar_widget.dart
carlosalexandre3107/dev-quiz-flutter
5ffa24cd79a14d2389a8a8c827a23b18bb592f08
[ "MIT" ]
null
null
null
lib/home/widgets/app_bar/app_bar_widget.dart
carlosalexandre3107/dev-quiz-flutter
5ffa24cd79a14d2389a8a8c827a23b18bb592f08
[ "MIT" ]
null
null
null
lib/home/widgets/app_bar/app_bar_widget.dart
carlosalexandre3107/dev-quiz-flutter
5ffa24cd79a14d2389a8a8c827a23b18bb592f08
[ "MIT" ]
null
null
null
import 'dart:ffi'; import 'package:DevQuiz/core/core.dart'; import 'package:DevQuiz/home/widgets/score_card/score_card_widget.dart'; import 'package:flutter/material.dart'; class AppBarWidget extends PreferredSize { AppBarWidget() : super( preferredSize: Size.fromHeight(260), child: Container( height: 250, child: Stack( children: [ Container( padding: const EdgeInsets.symmetric(horizontal: 20), height: 161, width: double.maxFinite, decoration: BoxDecoration( gradient: AppGradients.linear, ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text.rich( TextSpan( text: "Olá, ", style: AppTextStyles.title, children: [ TextSpan( text: 'Carlos Alexandre', style: AppTextStyles.titleBold) ]), ), Container( height: 48, width: 48, decoration: BoxDecoration( border: Border.fromBorderSide( BorderSide(color: AppColors.purple)), borderRadius: BorderRadius.circular(10), image: DecorationImage( image: NetworkImage( 'https://avatars.githubusercontent.com/u/25990537?v=4'), ), ), ), ], ), ), Align( alignment: Alignment(0.0, 1.1), child: ScoreCardWidget(), ), ], ), ), ); }
35.433333
88
0.389464
b78999d63c63e1142df5d31378bd11523c838165
3,489
cs
C#
src/UITesting.ProviderPortal/StepDefinitions/AddCourse_AddDescriptionSteps.cs
usmanzaheerkhan/dfc-providerportal-automatedtests-master
7b059932c1568c8803e18c9c4ac225948b64a70b
[ "MIT" ]
null
null
null
src/UITesting.ProviderPortal/StepDefinitions/AddCourse_AddDescriptionSteps.cs
usmanzaheerkhan/dfc-providerportal-automatedtests-master
7b059932c1568c8803e18c9c4ac225948b64a70b
[ "MIT" ]
null
null
null
src/UITesting.ProviderPortal/StepDefinitions/AddCourse_AddDescriptionSteps.cs
usmanzaheerkhan/dfc-providerportal-automatedtests-master
7b059932c1568c8803e18c9c4ac225948b64a70b
[ "MIT" ]
null
null
null
using System; using UITesting.Framework.Helpers; using UITesting.ProviderPortal.Pages.Course_Management; using UITesting.ProviderPortal.Pages; using UITesting.ProviderPortal.TestSupport; using OpenQA.Selenium; using TechTalk.SpecFlow; namespace UITesting.ProviderPortal.StepDefinitions { [Binding] public class AddCourse_AddDescriptionSteps : BaseTest { [Given(@"I am on the add a course form")] public void GivenIAmOnTheAddACourseForm() { webDriver.Url = Configurator.GetConfiguratorInstance().GetBaseUrlCourses() + "/AddCourseSection1"; Console.WriteLine("url=" + webDriver.Url); AddCoursePage AddCoursePage = new AddCoursePage(webDriver); } [Given(@"I have specified who the course is for (.*)")] public void GivenIHaveSpecifiedWhoTheCourseIsFor(string p0) { AddCoursePage AddCoursePage = new AddCoursePage(webDriver); AddCoursePage.EnterWhoCourseFor(p0); } [Given(@"I have entered the entry requirements (.*)")] public void GivenIHaveEnteredTheEntryRequirements(string p0) { AddCoursePage AddCoursePage = new AddCoursePage(webDriver); AddCoursePage.EnterEntryRequirements(p0); } [Given(@"I have entered what the student will learn (.*)")] public void GivenIHaveEnteredWhatTheStudentWillLearn(string p0) { AddCoursePage AddCoursePage = new AddCoursePage(webDriver); AddCoursePage.EnterWhatWillLearn(p0); } [Given(@"I have entered how the student will learn (.*)")] public void GivenIHaveEnteredHowTheStudentWillLearn(string p0) { AddCoursePage AddCoursePage = new AddCoursePage(webDriver); AddCoursePage.EnterHowYoullLearn(p0); } [Given(@"I have entered what equipment will be needed (.*)")] public void GivenIHaveEnteredWhatEquipmentWillBeNeeded(string p0) { AddCoursePage AddCoursePage = new AddCoursePage(webDriver); AddCoursePage.EnterWhoCourseFor(p0); } [Given(@"I have entered how the student will be assessed (.*)")] public void GivenIHaveEnteredHowTheStudentWillBeAssessed(string p0) { AddCoursePage AddCoursePage = new AddCoursePage(webDriver); AddCoursePage.EnterWhoCourseFor(p0); } [Given(@"I have enter the next step following completion of the course (.*)")] public void GivenIHaveEnterTheNextStepFollowingCompletionOfTheCourse(string p0) { AddCoursePage AddCoursePage = new AddCoursePage(webDriver); AddCoursePage.EnterWhoCourseFor(p0); } [Given(@"I have enter the next step following completion of the course (.*)")] public void GivenIHaveEnterTheNextStepFollowingCompletionOfTheCourseLevelOfThisCourse(string p0) { AddCoursePage AddCoursePage = new AddCoursePage(webDriver); AddCoursePage.EnterWhoCourseFor(p0); } [When(@"I click Next Button")] public void WhenIClickNextButton() { AddCoursePage AddCoursePage = new AddCoursePage(webDriver); AddCoursePage.ClickNext(); } [Then(@"I progess to next page")] public void ThenIProgessToNextPage() { ScenarioContext.Current.Pending(); } } }
35.969072
110
0.650616
6dbff62c2818508191a7474d65ccbd7dd233e050
436
h
C
src/gls.h
jaredhuling/rfunctions
ee118166ce4b31b871e4c1d4e7fc35518098423a
[ "MIT" ]
19
2015-04-07T21:52:41.000Z
2021-12-08T01:12:53.000Z
src/gls.h
jaredhuling/rfunctions
ee118166ce4b31b871e4c1d4e7fc35518098423a
[ "MIT" ]
5
2016-02-24T20:48:15.000Z
2020-03-06T05:08:23.000Z
src/gls.h
jaredhuling/rfunctions
ee118166ce4b31b871e4c1d4e7fc35518098423a
[ "MIT" ]
4
2016-04-13T06:47:30.000Z
2021-12-07T22:20:41.000Z
#ifndef _rfunctions_LINOP_H #define _rfunctions_LINOP_H #include <Rcpp.h> #include <RcppEigen.h> #include <Eigen/SVD> #include <vector> #include <functional> #include <algorithm> #include <iostream> #include <cmath> using namespace Rcpp; using namespace RcppEigen; RcppExport SEXP gls(SEXP, SEXP, SEXP, SEXP, SEXP); RcppExport SEXP gls_half_cg(SEXP, SEXP, SEXP, SEXP, SEXP); RcppExport SEXP gls_direct(SEXP, SEXP, SEXP); #endif
19.818182
58
0.759174
c3997e16fa4666a5807f2b4f9a722153c04cce06
217
cs
C#
Cadastro_de_Series/Dio.Series/Interfaces/ISerieRepositorio.cs
mckatoo/localiza-bootcamp-2
e008f5d009e91666665e9c8f11f7e0af01ffe7d6
[ "CC0-1.0" ]
null
null
null
Cadastro_de_Series/Dio.Series/Interfaces/ISerieRepositorio.cs
mckatoo/localiza-bootcamp-2
e008f5d009e91666665e9c8f11f7e0af01ffe7d6
[ "CC0-1.0" ]
null
null
null
Cadastro_de_Series/Dio.Series/Interfaces/ISerieRepositorio.cs
mckatoo/localiza-bootcamp-2
e008f5d009e91666665e9c8f11f7e0af01ffe7d6
[ "CC0-1.0" ]
null
null
null
namespace Dio.Series.Interfaces { public interface ISerieRepositorio : IRepositorio<Serie> { List<Serie> PorGenero(Genero genero); List<Serie> ListaContemTitulo(string titulo); } }
24.111111
61
0.668203
8d6e85adc37ec7f24cfc458137ec51764e0504ca
6,315
lua
Lua
yatm_data_logic/tests/data_math_test.lua
IceDragon200/mt-yatm
7452f2905e1f4121dc9d244d18a23e76b11ebe5d
[ "Apache-2.0" ]
3
2019-03-15T03:17:36.000Z
2020-02-19T19:50:49.000Z
yatm_data_logic/tests/data_math_test.lua
IceDragon200/mt-yatm
7452f2905e1f4121dc9d244d18a23e76b11ebe5d
[ "Apache-2.0" ]
24
2019-12-02T06:01:04.000Z
2021-04-08T04:09:27.000Z
yatm_data_logic/tests/data_math_test.lua
IceDragon200/mt-yatm
7452f2905e1f4121dc9d244d18a23e76b11ebe5d
[ "Apache-2.0" ]
null
null
null
local Luna = assert(foundation.com.Luna) local m = yatm_data_logic.data_math local case = Luna:new("yatm_data_logic.data_math") local CONFIG = { -- determines how long a number can be in bytes this affects normal operations byte_size = 16, -- the maximum number of elements expected in a vector type vector_size = 16, -- how many bytes does each element in the vector occupy vector_element_byte_size = 1, } case:describe("new_number/2", function (t2) t2:test("can initialize a byte vector string", function (t3) t3:assert_eq(m.new_number("\x00", CONFIG), m.new_number("\x00", CONFIG)) end) end) case:describe("identity/2", function (t2) t2:test("can return the first non-zero value", function (t3) t3:assert_eq(m.identity("\x00", "\x00", CONFIG), m.new_number("\x00", CONFIG)) t3:assert_eq(m.identity("\x00", "\x01", CONFIG), m.new_number("\x01", CONFIG)) t3:assert_eq(m.identity("\x02", "\x01", CONFIG), m.new_number("\x02", CONFIG)) end) end) case:describe("add/2", function (t2) t2:test("adds 2 numbers", function (t3) t3:assert_eq(m.add("\x00", "\x00", CONFIG), m.new_number("\x00", CONFIG)) t3:assert_eq(m.add("\x01", "\x01", CONFIG), m.new_number("\x02", CONFIG)) t3:assert_eq(m.add("\xFF", "\x01", CONFIG), m.new_number("\x00\x01", CONFIG)) t3:assert_eq(m.add("\xFF", "\x02", CONFIG), m.new_number("\x01\x01", CONFIG)) t3:assert_eq(m.add("\xFF\x00", "\x00\x02", CONFIG), m.new_number("\xFF\x02", CONFIG)) end) end) case:describe("subtract/2", function (t2) t2:test("subtracts 2 numbers", function (t3) t3:assert_eq(m.subtract("\x00", "\x00", CONFIG), m.new_number("\x00", CONFIG)) t3:assert_eq(m.subtract("\x01", "\x01", CONFIG), m.new_number("\x00", CONFIG)) t3:assert_eq(m.subtract("\xFF", "\x01", CONFIG), m.new_number("\xFE", CONFIG)) t3:assert_eq(m.subtract("\xFF\x01", "\x01", CONFIG), m.new_number("\xFE\x01", CONFIG)) t3:assert_eq(m.subtract("\x00\x01", "\x01", CONFIG), m.new_number("\xFF", CONFIG)) end) end) case:describe("multiply/2", function (t2) t2:test("multiples 2 numbers", function (t3) t3:assert_eq(m.multiply("\x00", "\x00", CONFIG), m.new_number("\x00", CONFIG)) t3:assert_eq(m.multiply("\x02", "\x04", CONFIG), m.new_number("\x08", CONFIG)) t3:assert_eq(m.multiply("\x10", "\x10", CONFIG), m.new_number("\x00\x01", CONFIG)) t3:assert_eq(m.multiply("\x11", "\x10", CONFIG), m.new_number("\x10\x01", CONFIG)) end) end) case:describe("divide/2", function (t2) t2:xtest("divide 2 numbers", function (t3) t3:assert_eq(m.divide("\x00", "\x00", CONFIG), m.new_number(nil, CONFIG, "\xFF")) t3:assert_eq(m.divide("\x08", "\x02", CONFIG), m.new_number("\x04", CONFIG)) t3:assert_eq(m.divide("\x00\x01", "\x02", CONFIG), m.new_number("\x80", CONFIG)) end) end) case:describe("modulo/2", function (t2) t2:xtest("modulo 2 numbers", function (t3) t3:assert_eq(m.modulo("\x00", "\x00", CONFIG), m.new_number("\x00", CONFIG)) t3:assert_eq(m.modulo("\x08", "\x02", CONFIG), m.new_number("\x00", CONFIG)) t3:assert_eq(m.modulo("\x07", "\x02", CONFIG), m.new_number("\x01", CONFIG)) end) end) case:describe("max/2", function (t2) t2:test("determines the largest number between operands", function (t3) t3:assert_eq(m.max("\x00", "\x00", CONFIG), m.new_number("\x00", CONFIG)) t3:assert_eq(m.max("\x01", "\x02", CONFIG), m.new_number("\x02", CONFIG)) t3:assert_eq(m.max("\xFF", "\x00\x01", CONFIG), m.new_number("\x00\x01", CONFIG)) end) end) case:describe("min/2", function (t2) t2:test("determines the smallest number between operands", function (t3) t3:assert_eq(m.min("\x00", "\x00", CONFIG), m.new_number("\x00", CONFIG)) t3:assert_eq(m.min("\x01", "\x02", CONFIG), m.new_number("\x01", CONFIG)) t3:assert_eq(m.min("\xFF", "\x00\x01", CONFIG), m.new_number("\xFF", CONFIG)) end) end) case:describe("identity_vector/2", function (t2) t2:test("returns all existing values between vectors", function (t3) t3:assert_eq(m.identity_vector("\x00\x00\x00", "\x00\x00\x00", CONFIG), m.new_number("\x00\x00\x00", CONFIG)) t3:assert_eq(m.identity_vector("\x01\x00\x04", "\x00\x02\x08", CONFIG), m.new_number("\x01\x02\x04", CONFIG)) end) end) case:describe("add_vector/2", function (t2) t2:test("add all existing values in vectors", function (t3) t3:assert_eq(m.add_vector("\x00\x00\x00", "\x00\x00\x00", CONFIG), m.new_number("\x00\x00\x00", CONFIG)) t3:assert_eq(m.add_vector("\x01\x02\x04", "\x10\x20\x30", CONFIG), m.new_number("\x11\x22\x34", CONFIG)) end) end) case:describe("subtract_vector/2", function (t2) t2:test("subtracts all existing values in vectors", function (t3) t3:assert_eq(m.subtract_vector("\x00\x00\x00", "\x00\x00\x00", CONFIG), m.new_number("\x00\x00\x00", CONFIG)) t3:assert_eq(m.subtract_vector("\x10\x20\x30", "\x04\x08\x0C", CONFIG), m.new_number("\x0C\x18\x24", CONFIG)) end) end) case:describe("multiply_vector/2", function (t2) t2:test("multiplies all existing values in vectors", function (t3) t3:assert_eq(m.multiply_vector("\x00\x00\x00", "\x00\x00\x00", CONFIG), m.new_number("\x00\x00\x00", CONFIG)) end) end) case:describe("divide_vector/2", function (t2) t2:test("can handle zeroes safely", function (t3) t3:assert_eq(m.divide_vector("\x00\x00\x00", "\x00\x00\x00", CONFIG), m.new_number("\xFF\xFF\xFF", CONFIG, "\xFF")) end) t2:test("divide all existing values in vectors", function (t3) t3:assert_eq(m.divide_vector("\x04\x0A\x10", "\x02\x02\x04", CONFIG), m.new_number("\x02\x05\x04", CONFIG, "\xFF")) end) end) case:describe("modulo_vector/2", function (t2) t2:test("can handle zeroes safely", function (t3) t3:assert_eq(m.modulo_vector("\x00\x00\x00", "\x00\x00\x00", CONFIG), m.new_number("", CONFIG, "\xFF")) end) t2:test("modulo all existing values in vectors", function (t3) t3:assert_eq(m.modulo_vector("\x04\x0A\x10", "\x03\x04\x06", CONFIG), m.new_number("\x01\x02\x04", CONFIG, "\xFF")) end) end) case:describe("max_vector/2", function (t2) t2:test("determines the max values in vectors", function (t3) end) end) case:describe("min_vector/2", function (t2) t2:test("determines the min values in vectors", function (t3) end) end) case:execute() case:display_stats() case:maybe_error()
42.1
119
0.666825
c9cb4d08816d7064fdce33d4615558ca85ff0399
3,468
tsx
TypeScript
src/pages/users.tsx
sdip15fa/notes
f0db136a548385068aa0969e18b42a0fcbe37767
[ "MIT" ]
null
null
null
src/pages/users.tsx
sdip15fa/notes
f0db136a548385068aa0969e18b42a0fcbe37767
[ "MIT" ]
null
null
null
src/pages/users.tsx
sdip15fa/notes
f0db136a548385068aa0969e18b42a0fcbe37767
[ "MIT" ]
null
null
null
import React from "react"; import axios from "axios"; import hash from "hash.js"; import { testserver } from "../lib/common"; import './users.css'; let url = "https://api-notes.wcyat.me"; class Main extends React.Component { username = ''; password = ''; state = { warning : '' } sign (inup:string) { if (!(this.username && this.password)) { this.setState({warning : "Username / password cannot be empty."}); } else { axios.post(`${url}/users/sign${inup}`, {username : this.username, password : hash.sha256().update(this.password).digest('hex')}) .then(res => { localStorage.k = res.data; localStorage.username = this.username; localStorage.password = hash.sha512().update(this.password).digest('hex'); if (localStorage.alerted) { delete localStorage.alerted; } if (inup === "up") { axios.post(`${url}/notes/users/${localStorage.k}`, {key : localStorage.k, 1 : ''}) .then (() => { window.location.replace(`/notes/?signup=successful`); }) } else { window.location.replace(`/notes/?sign${inup}=successful`); } }) .catch(error => { this.setState({warning : error.response.data}) }); } } render () { return ( <div className="content-body"> <div className="form-wrapper"> <h1 className="heading text-center">Signin / Signup</h1> <h3 className="sub-heading text-center">Notes</h3> <br /> <div className="field"> <input type="text" onChange={(evt) => {this.username = evt.target.value}} id="username" name="username" className="input" placeholder=" " /> <label htmlFor="username" className="label">username</label> </div> <br /> <div className="field"> <input type="password" onChange={(evt) => {this.password = evt.target.value}} id="password" name="password" className="input" placeholder=" " /> <label htmlFor="password" className="label">password</label> </div> <p className="description-text"> <span style={{color : "red"}} id="warning">{this.state.warning}</span> </p> <div className="form-action"> <button onClick={() => {this.sign("up")}} id="signup" className="btn users-btn primary"> Sign up </button> <button onClick={() => {this.sign("in")}} id="signin" className="btn users-btn primary"> Sign in </button> </div> </div> </div> ) } } async function init () { url = await testserver(); } const Users = () => { if (localStorage.username && localStorage.k) { if (localStorage.alerted) { delete localStorage.alerted; } window.location.replace('/notes?signedin=true'); } init(); return ( <div> <Main/> </div> ) } export default Users;
33.346154
139
0.475779
d229476abf63b55af1437f68b9b717946f09901d
4,032
rs
Rust
src/codegen/memory.rs
geky-test-org/aWsm
ab1bfb69d8bfe1fe8babc8f18ceda7829c457e47
[ "BSD-3-Clause" ]
1
2021-03-16T01:56:07.000Z
2021-03-16T01:56:07.000Z
src/codegen/memory.rs
geky-test-org/aWsm
ab1bfb69d8bfe1fe8babc8f18ceda7829c457e47
[ "BSD-3-Clause" ]
1
2020-08-10T07:46:33.000Z
2020-08-10T07:46:33.000Z
src/codegen/memory.rs
geky-test-org/aWsm
ab1bfb69d8bfe1fe8babc8f18ceda7829c457e47
[ "BSD-3-Clause" ]
2
2020-08-10T00:30:12.000Z
2020-08-10T00:44:11.000Z
use llvm::Builder; use llvm::Compile; use llvm::FunctionType; use llvm::PointerType; use llvm::Sub; use llvm::Value; use wasmparser::ResizableLimits; use crate::wasm::DataInitializer; use crate::wasm::ImplementedFunction; use crate::wasm::Instruction; use crate::codegen::ModuleCtx; use crate::codegen::function::compile_function; use crate::codegen::type_conversions::wasm_func_type_to_llvm_type; // We add in globals to tell the runtime how much memory to allocate and startup // (And what the max amount of allocated memory should be) pub fn add_memory_size_globals(ctx: &ModuleCtx, limits: &ResizableLimits) { info!("memory limits {:?}", limits); let starting_pages_global = ctx .llvm_module .add_global_variable("starting_pages", limits.initial.compile(ctx.llvm_ctx)); starting_pages_global.set_constant(true); let maximum: u32 = limits.maximum.unwrap_or(0); let max_pages_global = ctx .llvm_module .add_global_variable("max_pages", maximum.compile(ctx.llvm_ctx)); max_pages_global.set_constant(true); } pub fn generate_memory_initialization_stub(ctx: &ModuleCtx, initializers: Vec<DataInitializer>) { let mut initialization_data: Vec<(&llvm::Function, Vec<u8>)> = Vec::new(); for (n, i) in initializers.into_iter().enumerate() { // We need to translate the offset expression into a usable value // So we compile a function that evaluates the expression, and use that let offset_func = generate_offset_function(ctx, "memory", n, i.offset_expression); let mut full_data = Vec::new(); for mut d in i.body { full_data.append(&mut d); } initialization_data.push((&*offset_func, full_data)); } // The runtime assumes the existence of a setup_memory function that sets up the memory // We provide this, by compiling it here let setup_function = ctx.llvm_module.add_function( "populate_memory", FunctionType::new(<()>::get_type(ctx.llvm_ctx), &[]).to_super(), ); let bb = setup_function.append("entry"); let b = Builder::new(ctx.llvm_ctx); b.position_at_end(bb); for (i, (offset_func, data)) in initialization_data.into_iter().enumerate() { let offset = b.build_call(offset_func, &[]); let data_vec: Vec<&Value> = data.iter().map(|byte| byte.compile(ctx.llvm_ctx)).collect(); let data_value = Value::new_vector(&data_vec); let data_global = ctx .llvm_module .add_global_variable(&format!("init_vector_{}", i), data_value); data_global.set_constant(true); let data_ptr = data_global.to_super(); let data_raw_ptr = b.build_bit_cast(data_ptr, PointerType::new(<i8>::get_type(ctx.llvm_ctx))); b.build_call( ctx.llvm_module.get_function("initialize_region").unwrap(), &[ offset, (data.len() as i32).compile(ctx.llvm_ctx), data_raw_ptr, ], ); } b.build_ret_void(); } pub fn generate_offset_function<'a>( ctx: &'a ModuleCtx, prefix: &str, n: usize, mut offset_expression: Vec<Instruction>, ) -> &'a llvm::Function { let offset_func_name = format!("init_{}_offset_{}", prefix, n); let offset_func_type = wasmparser::FuncType { form: wasmparser::Type::Func, params: Box::new([]), returns: Box::new([wasmparser::Type::I32]), }; offset_expression.push(Instruction::End); // Compile function assumes the function is already prototyped let offset_func = ctx.llvm_module.add_function( &offset_func_name, wasm_func_type_to_llvm_type(ctx.llvm_ctx, &offset_func_type), ); compile_function( ctx, &ImplementedFunction { generated_name: offset_func_name.clone(), ty: Some(offset_func_type), ty_index: None, locals: Vec::new(), code: offset_expression, }, ); offset_func }
33.882353
97
0.65253
26911969bce0e8ba5cdf0df9c42ed952fd548255
2,077
swift
Swift
iOS/Example/BeagleDemo/BeagleDemo/Screens/PageViewScreen.swift
BizarreNULL/beagle
e1b0a87f9d1fd8c0c123aac7d5fb98b0bfdb7d2c
[ "Apache-2.0" ]
null
null
null
iOS/Example/BeagleDemo/BeagleDemo/Screens/PageViewScreen.swift
BizarreNULL/beagle
e1b0a87f9d1fd8c0c123aac7d5fb98b0bfdb7d2c
[ "Apache-2.0" ]
1
2020-08-10T15:53:40.000Z
2020-08-10T15:53:40.000Z
iOS/Example/BeagleDemo/BeagleDemo/Screens/PageViewScreen.swift
BizarreNULL/beagle
e1b0a87f9d1fd8c0c123aac7d5fb98b0bfdb7d2c
[ "Apache-2.0" ]
null
null
null
/* * Copyright 2020 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA * * 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. */ import UIKit import Beagle import BeagleSchema struct PageViewScreen: DeeplinkScreen { init(path: String, data: [String: String]?) { } func screenController() -> UIViewController { return Beagle.screen(.declarative(screen)) } var screen: Screen { return Screen(navigationBar: NavigationBar(title: "PageView")) { Container(context: Context(id: "currentPage", value: 2), widgetProperties: .init(Flex().grow(1))) { PageIndicator(numberOfPages: 4, currentPage: "@{currentPage}") PageView( children: Array(repeating: Page(), count: 4).map { $0.content }, pageIndicator: PageIndicator(), onPageChange: [SetContext(contextId: "currentPage", value: "@{onPageChange}")], currentPage: "@{currentPage}" ) } } } } struct Page { var content: Container { return Container(widgetProperties: .init(Flex().justifyContent(.spaceBetween).grow(1))) { Text("Text with alignment attribute set to center", alignment: Expression.value(.center)) Text("Text with alignment attribute set to right", alignment: Expression.value(.right)) Text("Text with alignment attribute set to left", alignment: Expression.value(.left)) Image(.remote(.init(url: .networkImageBeagle))) } } }
38.462963
111
0.638902
a36ea478e94a373f465b441f302f8eceeed1e7b5
417
java
Java
rpc-server/src/main/java/com/hughes/service/MessageSendService.java
HughesLou/GRpcProject
219cd541988825f64dd9cb10f2c9654ccad19cac
[ "MIT" ]
null
null
null
rpc-server/src/main/java/com/hughes/service/MessageSendService.java
HughesLou/GRpcProject
219cd541988825f64dd9cb10f2c9654ccad19cac
[ "MIT" ]
1
2022-03-12T14:18:20.000Z
2022-03-12T14:18:20.000Z
rpc-server/src/main/java/com/hughes/service/MessageSendService.java
HughesLou/gRpc
219cd541988825f64dd9cb10f2c9654ccad19cac
[ "MIT" ]
null
null
null
package com.hughes.service; import com.hughes.protobuf.message.SendRequest; import com.hughes.protobuf.message.SendResponse; import com.hughes.service.impl.MessageSendServiceImpl; /** * @author HughesLou * Created on 2022-03-09 */ public interface MessageSendService { SendResponse send(SendRequest request); static MessageSendService getClient() { return new MessageSendServiceImpl(); } }
21.947368
54
0.760192
2ccf1fd3136f9d26b667d8944b6768de66393420
1,592
py
Python
album/views.py
221BBakerSt/django_to_heroku
c9416814a6a79af82755cc415fdd8bd9cbc66343
[ "MIT" ]
null
null
null
album/views.py
221BBakerSt/django_to_heroku
c9416814a6a79af82755cc415fdd8bd9cbc66343
[ "MIT" ]
null
null
null
album/views.py
221BBakerSt/django_to_heroku
c9416814a6a79af82755cc415fdd8bd9cbc66343
[ "MIT" ]
null
null
null
from django.shortcuts import render, redirect, get_object_or_404 from django.http import request, HttpResponse from django.core.paginator import * from .models import * # the number of photos shown on every page NUM_ON_EACH_PAGE = 16 def album(request): slide_pics = Slide.objects.all() galleries = Gallery.objects.all() context = { "slide_pics": slide_pics, "galleries": galleries, } return render(request, "album.html", context) def gallery(request, name): gallery = get_object_or_404(Gallery, name=name) photos = Photo.objects.filter(gallery__name=name) """ beginning of pagination process """ # set the number of photos shown on every page paginator = Paginator(photos, NUM_ON_EACH_PAGE) # set the page request variable page_request_var = "page" # get the page number in URL parameter page_num = request.GET.get(page_request_var) if None == page_num or "" == page_num: page_num = 1 elif str == type(page_num): page_num = int(page_num) paginated_photos = paginator.get_page(page_num) # display range: [current_page - 2, current_page + 2] page_range = list(range(max(page_num - 2, 1), page_num)) + list(range(page_num, min(page_num + 2, paginator.num_pages) + 1)) """ end of pagination process """ context = { "gallery": gallery, "photos": paginated_photos, "page_range": page_range, "last_page": paginator.num_pages, "page_request_var": page_request_var, } return render(request, "gallery.html", context)
32.489796
128
0.673995
3b5406d83868c251c379ff70628b8f989d917715
1,077
swift
Swift
Samples/iOS-Swift/iOS-Swift/AppDelegate.swift
rcancro/sentry-cocoa
91da0e5da95d005b5ad8ff0f9d96684a18aaf87a
[ "MIT" ]
null
null
null
Samples/iOS-Swift/iOS-Swift/AppDelegate.swift
rcancro/sentry-cocoa
91da0e5da95d005b5ad8ff0f9d96684a18aaf87a
[ "MIT" ]
5
2022-01-24T09:22:23.000Z
2022-03-21T09:39:57.000Z
Samples/iOS-Swift/iOS-Swift/AppDelegate.swift
rcancro/sentry-cocoa
91da0e5da95d005b5ad8ff0f9d96684a18aaf87a
[ "MIT" ]
null
null
null
import Sentry import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? static let defaultDSN = "https://a92d50327ac74b8b9aa4ea80eccfb267@o447951.ingest.sentry.io/5428557" func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // For testing purposes, we want to be able to change the DSN and store it to disk. In a real app, you shouldn't need this behavior. let dsn = DSNStorage.shared.getDSN() ?? AppDelegate.defaultDSN DSNStorage.shared.saveDSN(dsn: dsn) SentrySDK.start { options in options.dsn = dsn options.beforeSend = { event in return event } options.debug = true // Sampling 100% - In Production you probably want to adjust this options.tracesSampleRate = 1.0 options.sessionTrackingIntervalMillis = 5_000 } return true } }
34.741935
145
0.647168
f4451e32c553d4924471fe08336aef5ad877b259
2,555
cs
C#
workers/unity/Packages/com.improbable.gdk.core/GameObjectRepresentation/Injection/InjectableStore.cs
filod/gdk-for-unity
3f16bde43942b3484cd3384be7325e109e6821ec
[ "MIT" ]
null
null
null
workers/unity/Packages/com.improbable.gdk.core/GameObjectRepresentation/Injection/InjectableStore.cs
filod/gdk-for-unity
3f16bde43942b3484cd3384be7325e109e6821ec
[ "MIT" ]
null
null
null
workers/unity/Packages/com.improbable.gdk.core/GameObjectRepresentation/Injection/InjectableStore.cs
filod/gdk-for-unity
3f16bde43942b3484cd3384be7325e109e6821ec
[ "MIT" ]
null
null
null
using System.Collections.Generic; using UnityEngine; namespace Improbable.Gdk.GameObjectRepresentation { /// <summary> /// Stores IInjectables and provides methods suited for the required access patterns: adding / removing by /// MonoBehaviour as dictated by the MonoBehaviourActivationManager, and querying by InjectableId for use /// by the GameObjectComponentDispatchers. /// </summary> public class InjectableStore { private readonly Dictionary<MonoBehaviour, Dictionary<InjectableId, IInjectable[]>> injectablesForBehaviours = new Dictionary<MonoBehaviour, Dictionary<InjectableId, IInjectable[]>>(); private readonly Dictionary<InjectableId, List<IInjectable>> injectablesForIds = new Dictionary<InjectableId, List<IInjectable>>(); public void AddInjectablesForBehaviour(MonoBehaviour behaviour, Dictionary<InjectableId, IInjectable[]> incomingInjectableArraysFromIds) { injectablesForBehaviours.Add(behaviour, incomingInjectableArraysFromIds); foreach (var idToIncomingInjectables in incomingInjectableArraysFromIds) { var id = idToIncomingInjectables.Key; var incomingInjectables = idToIncomingInjectables.Value; if (!injectablesForIds.TryGetValue(id, out var allInjectablesForId)) { allInjectablesForId = new List<IInjectable>(); injectablesForIds.Add(id, allInjectablesForId); } foreach (var injectable in incomingInjectables) { allInjectablesForId.Add(injectable); } } } public void RemoveInjectablesForBehaviour(MonoBehaviour behaviour) { foreach (var idToInjectableArray in injectablesForBehaviours[behaviour]) { var id = idToInjectableArray.Key; var injectables = idToInjectableArray.Value; var allInjectablesForId = injectablesForIds[id]; foreach (var injectable in injectables) { allInjectablesForId.Remove(injectable); } } injectablesForBehaviours.Remove(behaviour); } public bool TryGetInjectablesForComponent(InjectableId injectableId, out List<IInjectable> injectables) { return injectablesForIds.TryGetValue(injectableId, out injectables); } } }
41.209677
116
0.641096
89c69fc93a2e51eca26debc4da70ce1b847f89ff
6,665
swift
Swift
CollectionsTests/PriorityQueueTests.swift
massada/swift-collections
7b0504fe9b19b4a59e2c98fb39a4df99c9457ce4
[ "Apache-2.0" ]
null
null
null
CollectionsTests/PriorityQueueTests.swift
massada/swift-collections
7b0504fe9b19b4a59e2c98fb39a4df99c9457ce4
[ "Apache-2.0" ]
null
null
null
CollectionsTests/PriorityQueueTests.swift
massada/swift-collections
7b0504fe9b19b4a59e2c98fb39a4df99c9457ce4
[ "Apache-2.0" ]
null
null
null
// // PriorityQueueTests.swift // Collections // // Copyright (c) 2016 José Massada <jose.massada@gmail.com> // // 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. // import XCTest @testable import Collections class PriorityQueueTests : XCTestCase { override func setUp() { super.setUp() } override func tearDown() { super.tearDown() } func testInitialises() { let queue = PriorityQueue<Int>() XCTAssertTrue(queue.isEmpty) XCTAssertEqual(0, queue.count) XCTAssertEqual(nil, queue.front) } func testInitialisesWithNaturalOrdering() { let queue = PriorityQueue<Int>(isOrdered: <) XCTAssertTrue(queue.isEmpty) XCTAssertEqual(0, queue.count) XCTAssertEqual(nil, queue.front) } func testInitialisesWithNonNaturalOrdering() { let queue = PriorityQueue<Int>(isOrdered: >) XCTAssertTrue(queue.isEmpty) XCTAssertEqual(0, queue.count) XCTAssertEqual(nil, queue.front) } func testInitialisesFromEmptyArrayLiteral() { let queue: PriorityQueue<Int> = [] XCTAssertTrue(queue.isEmpty) XCTAssertEqual(0, queue.count) XCTAssertEqual(nil, queue.front) } func testInitialisesFromArrayLiteral() { let queue: PriorityQueue<Int> = [1, 2, 3] XCTAssertFalse(queue.isEmpty) XCTAssertEqual(3, queue.count) XCTAssertEqual(1, queue.front) for (i, element) in queue.enumerated() { XCTAssertEqual(i + 1, element) } } func testInitialisesFromEmptySequence() { let queue = PriorityQueue<Int>([]) XCTAssertTrue(queue.isEmpty) XCTAssertEqual(0, queue.count) XCTAssertEqual(nil, queue.front) } func testInitialisesFromEmptySequenceWithNaturalOrdering() { let queue = PriorityQueue<Int>([], isOrdered: <) XCTAssertTrue(queue.isEmpty) XCTAssertEqual(0, queue.count) XCTAssertEqual(nil, queue.front) } func testInitialisesFromEmptySequenceWithNonNaturalOrdering() { let queue = PriorityQueue<Int>([], isOrdered: >) XCTAssertTrue(queue.isEmpty) XCTAssertEqual(0, queue.count) XCTAssertEqual(nil, queue.front) } func testInitialisesFromSequence() { let queue = PriorityQueue<Int>([1, 2, 3]) XCTAssertFalse(queue.isEmpty) XCTAssertEqual(3, queue.count) XCTAssertEqual(1, queue.front) for (i, element) in queue.enumerated() { XCTAssertEqual(i + 1, element) } } func testInitialisesFromSequenceWithNaturalOrdering() { let queue = PriorityQueue<Int>([1, 2, 3], isOrdered: <) XCTAssertFalse(queue.isEmpty) XCTAssertEqual(3, queue.count) XCTAssertEqual(1, queue.front) for (i, element) in queue.enumerated() { XCTAssertEqual(i + 1, element) } } func testInitialisesFromSequenceWithNonNaturalOrdering() { let queue = PriorityQueue<Int>([1, 2, 3], isOrdered: >) XCTAssertFalse(queue.isEmpty) XCTAssertEqual(3, queue.count) XCTAssertEqual(3, queue.front) for (i, element) in queue.enumerated() { XCTAssertEqual(3 - i, element) } } func testClears() { var queue: PriorityQueue = [1, 2, 3] queue.clear() XCTAssertTrue(queue.isEmpty) XCTAssertEqual(0, queue.count) XCTAssertEqual(nil, queue.front) } func testPushesElement() { var queue = PriorityQueue<Int>() queue.enqueue(1) XCTAssertFalse(queue.isEmpty) XCTAssertEqual(1, queue.count) XCTAssertEqual(1, queue.front) } func testPushesElements() { var queue = PriorityQueue<Int>() queue.enqueue(1) queue.enqueue(2) queue.enqueue(3) XCTAssertFalse(queue.isEmpty) XCTAssertEqual(3, queue.count) XCTAssertEqual(1, queue.front) for (i, element) in queue.enumerated() { XCTAssertEqual(i + 1, element) } } func testPushesElementsWithNonNaturalOrdering() { var queue = PriorityQueue<Int>(isOrdered: >) queue.enqueue(1) queue.enqueue(2) queue.enqueue(3) XCTAssertFalse(queue.isEmpty) XCTAssertEqual(3, queue.count) XCTAssertEqual(3, queue.front) for i in 0..<3 { XCTAssertEqual(3 - i, queue.dequeue()) } } func testPopsElement() { var queue: PriorityQueue = [1] XCTAssertEqual(1, queue.dequeue()) XCTAssertTrue(queue.isEmpty) XCTAssertEqual(0, queue.count) XCTAssertEqual(nil, queue.front) } func testPopsElements() { var queue: PriorityQueue = [1, 2, 3] XCTAssertEqual(1, queue.dequeue()) XCTAssertEqual(2, queue.dequeue()) XCTAssertEqual(3, queue.dequeue()) XCTAssertTrue(queue.isEmpty) XCTAssertEqual(0, queue.count) XCTAssertEqual(nil, queue.front) } func testPopsElementsWithNonNaturalOrdering() { var queue = PriorityQueue([1, 2, 3], isOrdered: >) XCTAssertEqual(3, queue.dequeue()) XCTAssertEqual(2, queue.dequeue()) XCTAssertEqual(1, queue.dequeue()) XCTAssertTrue(queue.isEmpty) XCTAssertEqual(0, queue.count) XCTAssertEqual(nil, queue.front) } func testEquals() { XCTAssertTrue(PriorityQueue<Int>() == []) XCTAssertTrue([] == PriorityQueue<Int>([])) XCTAssertTrue(PriorityQueue<Int>() == PriorityQueue<Int>([])) let queue: PriorityQueue = [1, 2, 3] var anotherQueue: PriorityQueue = [1, 2] XCTAssertTrue(queue != anotherQueue) anotherQueue.enqueue(3) XCTAssertTrue(queue == anotherQueue) } func testPushingPerformance() { measure { var queue = PriorityQueue<Int>() for i in 0..<100_000 { queue.enqueue(i) } } } func testPushingPoppingPerformance() { measure { var queue = PriorityQueue<Int>() for i in 0..<100_000 { queue.enqueue(i) XCTAssertEqual(i, queue.dequeue()) } } } func testGetsDescriptions() { var queue: PriorityQueue<Int> = [] XCTAssertEqual(queue.description, "[]") XCTAssertEqual(queue.debugDescription, "PriorityQueue([])") queue = [1, 2] XCTAssertEqual(queue.description, "[1, 2]") XCTAssertEqual(queue.debugDescription, "PriorityQueue([1, 2])") } }
25.438931
75
0.660765
4d82d042a27aeb5f5bfe4bc7b1d4e319eaf2f82f
2,457
cs
C#
StackingEntities.Model/Entities/EntityBase.cs
Sidneys1/MinecraftMultitool
5687d7dd56d3b044fe1d208e9cab1a7d22e8deea
[ "MIT" ]
null
null
null
StackingEntities.Model/Entities/EntityBase.cs
Sidneys1/MinecraftMultitool
5687d7dd56d3b044fe1d208e9cab1a7d22e8deea
[ "MIT" ]
null
null
null
StackingEntities.Model/Entities/EntityBase.cs
Sidneys1/MinecraftMultitool
5687d7dd56d3b044fe1d208e9cab1a7d22e8deea
[ "MIT" ]
null
null
null
using System; using System.Text; using StackingEntities.Model.Enums; using StackingEntities.Model.Helpers; using StackingEntities.Model.Interface; using StackingEntities.Model.Metadata; using StackingEntities.Model.Objects.SimpleTypes; using DoubleList = System.Collections.ObjectModel.ObservableCollection<StackingEntities.Model.Objects.SimpleTypes.SimpleDouble>; namespace StackingEntities.Model.Entities { [Serializable] public abstract class EntityBase : Displayable, IJsonAble { public EntityType Type { get; set; } #region Motion [EntityDescriptor("Entity Options", "Velocity", fixedSize: true, dgRowPath: "Name")] public DoubleList Velocity { get; } = new DoubleList { new SimpleDouble("X"), new SimpleDouble("Y"), new SimpleDouble("Z") }; #endregion #region Invulnerable bool _invulnerable; [EntityDescriptor("Entity Options", "Invulnerable", "Makes this Entity resistant to Damage")] public bool Invulnerable { get { return _invulnerable; } set { _invulnerable = value; PropChanged(); PropChanged("Display"); } } #endregion #region Fire int _fire; [EntityDescriptor("Entity Options", "Fire (Ticks)"), MinMax(-1, null)] public int Fire { get { return _fire; } set { _fire = value; PropChanged(); PropChanged("Display"); } } #endregion #region Silent bool _silent; [EntityDescriptor("Entity Options", "Silent", "Disable noise for this Entity")] public bool Silent { get { return _silent; } set { _silent = value; PropChanged(); PropChanged("Display"); } } #endregion #region UI public override string Display => (Silent ? "Silent " : "") + (Invulnerable ? "Invulnerable " : "") + (Fire != 0 ? string.Format("Flaming ({0}) ", JsonTools.TicksToTime(Fire)) : ""); #endregion #region Process public virtual string GenerateJson(bool topLevel) { var b = new StringBuilder("{"); if (!topLevel) b.AppendFormat("id:\"{0}\",", Type.ToString().EscapeJsonString()); if (Invulnerable) b.Append("Invulnerable:1b,"); double Dx = Velocity[0].Value, Dy = Velocity[1].Value, Dz = Velocity[2].Value; if (Math.Abs(Dx) > 0 || Math.Abs(Dy) > 0 || Math.Abs(Dz) > 0) b.AppendFormat("Motion:[{0:0.0},{1:0.0},{2:0.0}],", Dx, Dy, Dz); if (Fire != 0) b.AppendFormat("Fire:{0},", Fire); if (Silent) b.Append("Silent:1b,"); return b.ToString(); } #endregion } }
22.135135
184
0.662597
0a4370a1d3c183d6f8f6125ec785f6a17d28942d
2,324
cs
C#
T4-Template-POCO-Example/Export/T_WZList.cs
qq863391602/demo
c640967d9c9d69e85cfc887485de94ce45522e53
[ "Apache-2.0" ]
null
null
null
T4-Template-POCO-Example/Export/T_WZList.cs
qq863391602/demo
c640967d9c9d69e85cfc887485de94ce45522e53
[ "Apache-2.0" ]
null
null
null
T4-Template-POCO-Example/Export/T_WZList.cs
qq863391602/demo
c640967d9c9d69e85cfc887485de94ce45522e53
[ "Apache-2.0" ]
1
2020-06-28T04:11:48.000Z
2020-06-28T04:11:48.000Z
using System; using NPoco; using System.ComponentModel.DataAnnotations; namespace Electric.Domain.Entities { /// <summary> /// Represents a T_WZList. /// NOTE: 这个类是从T4模板生成的——你不应该手动修改它。 /// </summary> [MetadataType(typeof(WZListMetadata))] [PrimaryKey("CarNo")] [TableName("[dbo].[T_WZList]")] public class T_WZList { #region ResultColumn #endregion #region Ignore #endregion private class WZListMetadata{ [StringLength(50, ErrorMessage = "{0}不能超过50个字符!")] [Required(ErrorMessage = "请填写{0}!")] [Display(Name = "车牌号")] [Column("CarNo")] public string Id { get; set; } [StringLength(2, ErrorMessage = "{0}不能超过2个字符!")] [Required(ErrorMessage = "请填写{0}!")] [Display(Name = "01:大车02:小车51:新能源大车52:新能源小车26:香港出入境(只有广东支持)27:澳门出入境(只有广东支持)15:挂车(只有广东支持)")] [Column("CarType")] public string CarType { get; set; } [StringLength(50, ErrorMessage = "{0}不能超过50个字符!")] [Required(ErrorMessage = "请填写{0}!")] [Display(Name = "发动机号")] [Column("EngineNumber")] public string EngineNumber { get; set; } [StringLength(50, ErrorMessage = "{0}不能超过50个字符!")] [Required(ErrorMessage = "请填写{0}!")] [Display(Name = "车架号")] [Column("FrameNumber")] public string FrameNumber { get; set; } [StringLength(10, ErrorMessage = "{0}不能超过10个字符!")] [Display(Name = "违章条数")] [Column("VioNum")] public string VioNum { get; set; } [StringLength(10, ErrorMessage = "{0}不能超过10个字符!")] [Display(Name = "违章罚款合计")] [Column("FineTotal")] public string FineTotal { get; set; } [StringLength(2, ErrorMessage = "{0}不能超过2个字符!")] [Display(Name = "违章积分合计")] [Column("IntegralTotal")] public string IntegralTotal { get; set; } [StringLength(4, ErrorMessage = "{0}不能超过4个字符!")] [Required(ErrorMessage = "请填写{0}!")] [Display(Name = "查询次数")] [Column("QueryNum")] public int QueryNum { get; set; } [StringLength(8, ErrorMessage = "{0}不能超过8个字符!")] [Required(ErrorMessage = "请填写{0}!")] [Display(Name = "")] [Column("CreateTime")] public DateTime CreateTime { get; set; } [StringLength(8, ErrorMessage = "{0}不能超过8个字符!")] [Required(ErrorMessage = "请填写{0}!")] [Display(Name = "修改时间")] [Column("UpdateTime")] public DateTime UpdateTime { get; set; } } } }
27.341176
94
0.623924
389268921a5a1276b74f80dc359d69f7578fe21b
2,101
php
PHP
resources/views/admin/member_profile_attributes/states/edit.blade.php
fazlur10/mahar
5004234394473043d22a78eee831d055f059be27
[ "MIT" ]
null
null
null
resources/views/admin/member_profile_attributes/states/edit.blade.php
fazlur10/mahar
5004234394473043d22a78eee831d055f059be27
[ "MIT" ]
null
null
null
resources/views/admin/member_profile_attributes/states/edit.blade.php
fazlur10/mahar
5004234394473043d22a78eee831d055f059be27
[ "MIT" ]
null
null
null
@extends('admin.layouts.app') @section('content') <div class="row"> <div class="col-lg-6 mx-auto"> <div class="card"> <div class="card-header"> <h5 class="mb-0 h6">{{translate('Edit State Info')}}</h5> </div> <div class="card-body"> <form action="{{ route('states.update', $state->id) }}" method="POST"> <input name="_method" type="hidden" value="PATCH"> @csrf <div class="form-group mb-3"> <label for="name">{{translate('Country')}}</label> <select class="form-control aiz-selectpicker" data-live-search="true" name="country_id" required> @foreach($countries as $country) <option value="{{$country->id}}" @if($country->id == $state->country_id) selected @endif>{{ $country->name }}</option> @endforeach </select> @error('religion') <small class="form-text text-danger">{{ $message }}</small> @enderror </div> <div class="form-group mb-3"> <label for="name">{{translate('State Name')}}</label> <input type="text" id="name" name="name" value="{{$state->name}}" class="form-control" required> @error('name') <small class="form-text text-danger">{{ $message }}</small> @enderror </div> <div class="form-group mb-3 text-right"> <button type="submit" class="btn btn-primary">{{translate('Update')}}</button> </div> </form> </div> </div> </div> </div> @endsection
47.75
154
0.39981
1abd556125d043fc2f9f315b56110a5e4b8976be
2,565
py
Python
webremote.py
GerhardBenkovsky/CharlieOSX
6db9ba860f57256e1f4141a4538ae16f5db4d91f
[ "MIT" ]
null
null
null
webremote.py
GerhardBenkovsky/CharlieOSX
6db9ba860f57256e1f4141a4538ae16f5db4d91f
[ "MIT" ]
null
null
null
webremote.py
GerhardBenkovsky/CharlieOSX
6db9ba860f57256e1f4141a4538ae16f5db4d91f
[ "MIT" ]
null
null
null
import picoweb, _thread, time class Webremote(): '''Main class for the Webremote''' def __init__(self, config, robot, brick): self.__config = config self.robot = robot self.brick = brick self.app = picoweb.WebApp("app") self.outDict = {'x': 0, 'y': 0, 'a1': 0, 'maxSpeed': 100} self.weblock = _thread.allocate_lock() self.newData = True @self.app.route("/") def index(req, resp): yield from picoweb.start_response(resp, content_type = "text/html") htmlFile = open('site/site.html', 'r') for line in htmlFile: yield from resp.awrite(line) @self.app.route("/api") def api(req, resp): yield from picoweb.start_response(resp, content_type = "text/html") proc = req.qs.split("&") for elm in proc: temp = elm.split("=") try: self.outDict[temp[0]] = int(temp[1]) except: self.outDict[temp[0]] = temp[1] self.newData = True ''' Serving all resources needed for the Webremote ''' @self.app.route("/style.css") def style(req, resp): yield from picoweb.start_response(resp, content_type = "text/css") htmlFile = open('site/style.css', 'r') for line in htmlFile: yield from resp.awrite(line) @self.app.route("/code.js") def style(req, resp): yield from picoweb.start_response(resp, content_type = "text/javascript") htmlFile = open('site/code.js', 'r') for line in htmlFile: yield from resp.awrite(line) def run(self): self.startServerThread() while not any(self.brick.buttons.pressed()): if self.newDataAvailable(): data = self.getResponseData() self.robot.setRemoteValues(data) #print(data) time.sleep(0.05) def startServerThread(self): def runWebserver(): with self.weblock: self.app.run(debug = -1, host = self.__config['localIP']) _thread.start_new_thread(runWebserver, ()) def getResponseData(self): return self.outDict def newDataAvailable(self): if self.newData: self.newData = False return True else: return False
29.825581
85
0.516179
3facb5e2da280e2540cfaf47becc513b0ffa131b
1,076
kt
Kotlin
rainbow-cake-channels/src/main/java/co/zsmb/rainbowcake/channels/Produce.kt
marazmarci/rainbowcake
3e559425e1e5d00ff2fc5aeaae1fb11396573f67
[ "Apache-2.0" ]
null
null
null
rainbow-cake-channels/src/main/java/co/zsmb/rainbowcake/channels/Produce.kt
marazmarci/rainbowcake
3e559425e1e5d00ff2fc5aeaae1fb11396573f67
[ "Apache-2.0" ]
null
null
null
rainbow-cake-channels/src/main/java/co/zsmb/rainbowcake/channels/Produce.kt
marazmarci/rainbowcake
3e559425e1e5d00ff2fc5aeaae1fb11396573f67
[ "Apache-2.0" ]
null
null
null
package co.zsmb.rainbowcake.channels import kotlinx.coroutines.CompletionHandler import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.InternalCoroutinesApi import kotlinx.coroutines.channels.ProducerScope import kotlinx.coroutines.channels.ReceiveChannel import kotlinx.coroutines.channels.produce /** * Launches a new coroutine in the IO coroutine context (and in [GlobalScope]) to produce a stream * of values by sending them to a channel, and returns the created [ReceiveChannel]. * * For more details, see the [GlobalScope.produce] function that this function delegates to. */ @Suppress("EXPERIMENTAL_API_USAGE") @UseExperimental(InternalCoroutinesApi::class) fun <T> produceInIOContext( capacity: Int = 0, onCompletion: CompletionHandler? = null, block: suspend ProducerScope<T>.() -> Unit ): ReceiveChannel<T> { return GlobalScope.produce( context = Dispatchers.IO, capacity = capacity, onCompletion = onCompletion, block = block ) }
34.709677
98
0.745353
0a267ee9e12a08461aa31dd72bf2ea8b00332e3e
968
rs
Rust
examples/idle_behavior.rs
aclysma/small-task
3d3fdfbdfe9706b34c30da2fc45d870dcedb37c6
[ "Apache-2.0", "MIT" ]
11
2020-08-23T19:11:49.000Z
2021-03-24T11:16:05.000Z
examples/idle_behavior.rs
aclysma/small-task
3d3fdfbdfe9706b34c30da2fc45d870dcedb37c6
[ "Apache-2.0", "MIT" ]
3
2020-08-23T16:54:24.000Z
2020-08-23T20:15:42.000Z
examples/idle_behavior.rs
aclysma/small-task
3d3fdfbdfe9706b34c30da2fc45d870dcedb37c6
[ "Apache-2.0", "MIT" ]
2
2020-08-24T01:02:22.000Z
2021-03-24T11:16:06.000Z
use smalltask::TaskPool; // This sample demonstrates a thread pool with one thread per logical core and only one task // spinning. Other than the one thread, the system should remain idle, demonstrating good behavior // for small workloads. fn main() { let pool = TaskPool::builder() .thread_name("Idle Behavior ThreadPool".to_string()) .build(); pool.scope(|s| { for i in 0..1 { s.spawn(async move { println!("Blocking for 10 seconds"); let now = std::time::Instant::now(); while std::time::Instant::now() - now < std::time::Duration::from_millis(10000) { // spin, simulating work being done } println!( "Thread {:?} index {} finished", std::thread::current().id(), i ); }) } }); println!("all tasks finished"); }
30.25
98
0.515496
a00f10e6b775644218edcf214d158cabfdf3e2ee
94,835
ts
TypeScript
src/utils/icon.spec.ts
Sidoine/Ovale
dd4da104a8010836dbe2047a4178882ad2590bdd
[ "MIT" ]
55
2016-08-01T00:04:46.000Z
2021-01-07T07:39:55.000Z
src/utils/icon.spec.ts
Sidoine/Ovale
dd4da104a8010836dbe2047a4178882ad2590bdd
[ "MIT" ]
791
2016-07-31T00:36:45.000Z
2022-03-24T05:03:33.000Z
src/utils/icon.spec.ts
ultijlam/Ovale
82bfcfe4f8b53c6a38ffcca10431efaea823ec8f
[ "MIT" ]
93
2016-07-31T19:50:43.000Z
2022-01-06T22:54:18.000Z
import { test, expect } from "@jest/globals"; import { assertDefined, assertIs } from "../tests/helpers"; import { executeDump } from "./icon"; const dump = `{ "atTime": 317520.842, "serial": 175, "index": 1, "script": "sc_t25_priest_shadow", "nodes": { "291": {"result": {"type": "none","serial": 175,"timeSpan": [317593.896,inf]}, "type": "group", "asString": null } ,"291": {"result": {"type": "none","serial": 175,"timeSpan": [317593.896,inf]}, "type": "group", "asString": null } ,"85": {"result": {"type": "value","timeSpan": [0,inf],"value": 14914,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": null } ,"86": {"result": {"type": "value","timeSpan": [0,inf],"value": "holy","rate": 0,"serial": 175,"origin": 0}, "type": "string", "asString": "holy" } ,"87": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "function", "asString": "specialization(holy)" } ,"157": {"result": {"type": "value","timeSpan": [0,inf],"value": 23127,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "searing_nightmare_talent" } ,"158": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "function", "asString": "hastalent(searing_nightmare_talent)" } ,"291": {"result": {"type": "none","serial": 175,"timeSpan": [317593.896,inf]}, "type": "group", "asString": null } ,"298": {"result": {"type": "value","timeSpan": [0,inf],"value": 50,"rate": 0,"serial": 175,"origin": 0}, "type": "function", "asString": "level()" } ,"294": {"result": {"type": "none","serial": 175,"timeSpan": [0,inf]}, "type": "function", "asString": "checkboxon(\\"self_power_infusion\\")" } ,"297": {"result": {"type": "none","serial": 175,"timeSpan": [0,inf]}, "type": "logical", "asString": null } ,"298": {"result": {"type": "value","timeSpan": [0,inf],"value": 50,"rate": 0,"serial": 175,"origin": 0}, "type": "function", "asString": "level()" } ,"300": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "compare", "asString": null } ,"301": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"306": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"318": {"result": {"type": "value","timeSpan": [0,inf],"value": 228260,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "void_eruption" } ,"309": {"result": {"type": "none","serial": 175,"timeSpan": [0,inf]}, "type": "compare", "asString": null } ,"317": {"result": {"type": "none","serial": 175,"timeSpan": [0,inf]}, "type": "logical", "asString": null } ,"318": {"result": {"type": "value","timeSpan": [0,inf],"value": 228260,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "void_eruption" } ,"319": {"result": {"type": "value","timeSpan": [0,inf],"value": 0,"rate": -1,"serial": 175,"origin": 317593.896}, "type": "function", "asString": "spellcooldown(void_eruption)" } ,"320": {"result": {"type": "none","serial": 175,"timeSpan": [0,317593.896]}, "type": "compare", "asString": null } ,"321": {"result": {"type": "none","serial": 175,"timeSpan": [317593.896,inf]}, "type": "logical", "asString": null } ,"322": {"result": {"type": "none","serial": 175,"timeSpan": [317593.896,inf]}, "type": "logical", "asString": null } ,"323": {"result": {"type": "none","serial": 175,"timeSpan": [317593.896,inf]}, "type": "logical", "asString": null } ,"325": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "group", "asString": null } ,"326": {"result": {"type": "value","timeSpan": [0,inf],"value": 1,"rate": 0,"serial": 175,"origin": 0}, "type": "function", "asString": "enemies()" } ,"327": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "compare", "asString": null } ,"330": {"result": {"type": "value","timeSpan": [0,inf],"value": 589,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "shadow_word_pain" } ,"336": {"result": {"type": "none","serial": 175,"timeSpan": [317506.906,317511.768]}, "type": "typed_function", "asString": "target.debuffpresent(shadow_word_pain)" } ,"337": {"result": {"type": "value","timeSpan": [0,inf],"value": 34914,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "vampiric_touch" } ,"343": {"result": {"type": "none","serial": 175,"timeSpan": [317516.591,317516.741]}, "type": "typed_function", "asString": "target.debuffpresent(vampiric_touch)" } ,"354": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "group", "asString": null } ,"369": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"475": {"result": {"type": "value","timeSpan": [0,inf],"value": 34914,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "vampiric_touch" } ,"476": {"result": {"actionCooldownStart": 0,"actionIsCurrent": false,"timeSpan": [0,inf],"actionCooldownDuration": 0,"actionTarget": "target","actionResourceExtend": 0,"type": "action","options": {},"castTime": 1.317,"actionCharges": 0,"actionId": 34914,"actionEnable": 1,"actionShortcut": "A","actionTexture": 135978,"actionInRange": true,"actionType": "spell","serial": 175,"actionUsable": true}, "type": "action", "asString": "spell(vampiric_touch)" } ,"551": {"result": {"actionCooldownStart": 0,"actionIsCurrent": false,"timeSpan": {},"actionCooldownDuration": 0,"actionTarget": "target","actionResourceExtend": 0,"type": "none","options": {},"castTime": 0,"actionCharges": 0,"actionId": 205448,"actionShortcut": "3","actionTexture": 1035040,"actionEnable": 1,"actionInRange": true,"actionType": "spell","serial": 175,"actionUsable": true}, "type": "group", "asString": null } ,"552": {"result": {"type": "value","timeSpan": [0,inf],"value": 327661,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "fae_guardians" } ,"558": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "typed_function", "asString": "buffpresent(fae_guardians)" } ,"567": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"568": {"result": {"type": "value","timeSpan": [0,inf],"value": 589,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "shadow_word_pain" } ,"569": {"result": {"actionCooldownStart": 0,"actionIsCurrent": false,"timeSpan": [0,inf],"actionCooldownDuration": 0,"actionTarget": "target","actionResourceExtend": 0,"type": "action","options": {},"castTime": 0,"actionCharges": 0,"actionId": 589,"actionEnable": 1,"actionShortcut": "B4","actionTexture": 136207,"actionInRange": true,"actionType": "spell","serial": 175,"actionUsable": true}, "type": "action", "asString": "spell(shadow_word_pain)" } ,"570": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "if", "asString": null } ,"571": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "custom_function", "asString": "shadowcdsmainactions()" } ,"572": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "custom_function", "asString": "shadowcdsmainpostconditions()" } ,"573": {"result": {"actionCooldownStart": 0,"actionIsCurrent": false,"timeSpan": {},"actionEnable": 1,"actionTarget": "target","actionResourceExtend": 0,"type": "action","options": {},"castTime": 0,"actionCharges": 0,"actionId": 205448,"actionShortcut": "3","actionTexture": 1035040,"actionCooldownDuration": 0,"actionInRange": true,"actionType": "spell","serial": 175,"actionUsable": true}, "type": "group", "asString": null } ,"580": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"589": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"596": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"599": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "if", "asString": null } ,"600": {"result": {"type": "value","timeSpan": [317520.842,inf],"value": 100,"rate": 0.0010000000474975,"serial": 175,"origin": 317520.842}, "type": "function", "asString": "insanity()" } ,"602": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "compare", "asString": null } ,"612": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"612": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"615": {"result": {"actionCooldownStart": 0,"actionIsCurrent": false,"actionTexture": 1035040,"actionCooldownDuration": 0,"actionTarget": "target","actionResourceExtend": 0,"type": "action","options": {},"castTime": 0,"actionCharges": 0,"actionId": 205448,"actionUsable": true,"timeSpan": {},"actionShortcut": "3","actionInRange": true,"actionType": "spell","serial": 175,"actionEnable": 1}, "type": "if", "asString": null } ,"624": {"result": {"type": "none","serial": 175,"timeSpan": [317593.896,inf]}, "type": "custom_function", "asString": "pi_or_vf_sync_condition()" } ,"617": {"result": {"type": "value","timeSpan": [0,inf],"value": 335467,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "devouring_plague" } ,"619": {"result": {"type": "none","serial": 175,"timeSpan": [0,inf]}, "type": "function", "asString": "target.refreshable(devouring_plague)" } ,"623": {"result": {"type": "none","serial": 175,"timeSpan": [0,inf]}, "type": "logical", "asString": null } ,"624": {"result": {"type": "none","serial": 175,"timeSpan": [317593.896,inf]}, "type": "custom_function", "asString": "pi_or_vf_sync_condition()" } ,"625": {"result": {"type": "none","serial": 175,"timeSpan": [0,317593.896]}, "type": "logical", "asString": null } ,"626": {"result": {"type": "none","serial": 175,"timeSpan": [0,317593.896]}, "type": "logical", "asString": null } ,"637": {"result": {"type": "none","serial": 175,"timeSpan": [0,317593.896]}, "type": "logical", "asString": null } ,"630": {"result": {"type": "none","serial": 175,"timeSpan": [0,inf]}, "type": "logical", "asString": null } ,"633": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "custom_function", "asString": "searing_nightmare_cutoff()" } ,"636": {"result": {"type": "none","serial": 175,"timeSpan": [0,inf]}, "type": "logical", "asString": null } ,"637": {"result": {"type": "none","serial": 175,"timeSpan": [0,317593.896]}, "type": "logical", "asString": null } ,"638": {"result": {"type": "value","timeSpan": [0,inf],"value": 335467,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "devouring_plague" } ,"639": {"result": {"actionCooldownStart": 0,"actionIsCurrent": false,"timeSpan": [0,inf],"actionCooldownDuration": 0,"actionTarget": "target","actionResourceExtend": 0,"type": "action","options": {},"castTime": 0,"actionCharges": 0,"actionId": 335467,"actionUsable": false,"actionTexture": 252997,"actionEnable": 1,"actionInRange": true,"actionType": "spell","serial": 175,"actionShortcut": "Y"}, "type": "action", "asString": "spell(devouring_plague)" } ,"640": {"result": {"actionCooldownStart": 0,"actionIsCurrent": false,"actionTexture": 252997,"actionEnable": 1,"actionTarget": "target","actionResourceExtend": 0,"type": "action","options": {},"castTime": 0,"actionCharges": 0,"actionId": 335467,"actionUsable": false,"actionShortcut": "Y","timeSpan": [0,317593.896],"actionInRange": true,"actionType": "spell","serial": 175,"actionCooldownDuration": 0}, "type": "if", "asString": null } ,"642": {"result": {"type": "value","timeSpan": [0,inf],"value": 115,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "dissonant_echoes_conduit" } ,"643": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "function", "asString": "conduit(dissonant_echoes_conduit)" } ,"644": {"result": {"type": "value","timeSpan": [0,inf],"value": 4,"rate": 0,"serial": 175,"origin": 317520.842}, "type": "arithmetic", "asString": null } ,"645": {"result": {"type": "none","serial": 175,"timeSpan": [0,inf]}, "type": "compare", "asString": null } ,"647": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "compare", "asString": null } ,"648": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"651": {"result": {"actionCooldownStart": 0,"actionIsCurrent": false,"actionTexture": 1035040,"actionCooldownDuration": 0,"actionTarget": "target","actionResourceExtend": 0,"type": "action","options": {},"castTime": 0,"actionCharges": 0,"actionId": 205448,"actionUsable": true,"timeSpan": {},"actionShortcut": "3","actionInRange": true,"actionType": "spell","serial": 175,"actionEnable": 1}, "type": "if", "asString": null } ,"654": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "compare", "asString": null } ,"655": {"result": {"type": "value","timeSpan": [0,inf],"value": 341207,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "dark_thought" } ,"661": {"result": {"type": "none","serial": 175,"timeSpan": [317511.389,317512.11]}, "type": "typed_function", "asString": "buffpresent(dark_thought)" } ,"662": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"665": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "if", "asString": null } ,"673": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "custom_function", "asString": "dots_up()" } ,"674": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"675": {"result": {"type": "value","timeSpan": [0,inf],"value": 15407,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "mind_flay" } ,"676": {"result": {"actionCooldownStart": 0,"actionIsCurrent": false,"timeSpan": [0,inf],"actionCooldownDuration": 0,"actionTarget": "target","actionResourceExtend": 0,"type": "action","options": {},"castTime": 0,"actionCharges": 0,"actionId": 15407,"actionEnable": 1,"actionShortcut": "R","actionTexture": 136208,"actionInRange": true,"actionType": "spell","serial": 175,"actionUsable": true}, "type": "action", "asString": "spell(mind_flay)" } ,"677": {"result": {"actionCooldownStart": 0,"actionIsCurrent": false,"actionTexture": 136208,"actionEnable": 1,"actionTarget": "target","actionResourceExtend": 0,"type": "action","options": {},"castTime": 0,"actionCharges": 0,"actionId": 15407,"actionShortcut": "R","actionUsable": true,"timeSpan": {},"actionInRange": true,"actionType": "spell","serial": 175,"actionCooldownDuration": 0}, "type": "if", "asString": null } ,"680": {"result": {"type": "value","timeSpan": [0,inf],"value": 8092,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "mind_blast" } ,"681": {"result": {"type": "value","timeSpan": [0,inf],"value": 1.317,"rate": 0,"serial": 175,"origin": 0}, "type": "function", "asString": "casttime(mind_blast)" } ,"683": {"result": {"type": "value","timeSpan": [0,inf],"value": 1.817,"rate": 0,"serial": 175,"origin": 317520.842}, "type": "arithmetic", "asString": null } ,"684": {"result": {"type": "none","serial": 175,"timeSpan": [0,inf]}, "type": "compare", "asString": null } ,"685": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"688": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"689": {"result": {"type": "value","timeSpan": [0,inf],"value": 8092,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "mind_blast" } ,"690": {"result": {"actionCooldownStart": 317518.425,"actionIsCurrent": false,"timeSpan": [317525.008,inf],"actionCooldownDuration": 6.583,"actionTarget": "target","actionResourceExtend": 0,"type": "action","options": {},"castTime": 1.317,"actionCharges": 0,"actionId": 8092,"actionEnable": 1,"actionShortcut": "E","actionTexture": 136224,"actionInRange": true,"actionType": "spell","serial": 175,"actionUsable": true}, "type": "action", "asString": "spell(mind_blast)" } ,"691": {"result": {"actionCooldownStart": 317505.191,"actionIsCurrent": false,"actionTexture": 136224,"actionEnable": 1,"actionTarget": "target","actionResourceExtend": 0,"type": "action","options": {},"castTime": 1.32,"actionCharges": 0,"actionId": 8092,"actionShortcut": "E","actionUsable": true,"timeSpan": {},"actionInRange": true,"actionType": "spell","serial": 175,"actionCooldownDuration": 6.601}, "type": "if", "asString": null } ,"692": {"result": {"type": "value","timeSpan": [0,inf],"value": 34914,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "vampiric_touch" } ,"694": {"result": {"type": "none","serial": 175,"timeSpan": [317510.441,inf]}, "type": "function", "asString": "target.refreshable(vampiric_touch)" } ,"696": {"result": {"type": "value","timeSpan": [317520.842,inf],"value": 1011.4330997943,"rate": -1,"serial": 175,"origin": 317520.842}, "type": "function", "asString": "target.timetodie()" } ,"697": {"result": {"type": "none","serial": 175,"timeSpan": [317520.842,318526.27509979]}, "type": "compare", "asString": null } ,"698": {"result": {"type": "none","serial": 175,"timeSpan": [317520.842,318526.27509979]}, "type": "logical", "asString": null } ,"699": {"result": {"type": "value","timeSpan": [0,inf],"value": 23126,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "misery_talent" } ,"700": {"result": {"type": "none","serial": 175,"timeSpan": [0,inf]}, "type": "function", "asString": "hastalent(misery_talent)" } ,"701": {"result": {"type": "value","timeSpan": [0,inf],"value": 589,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "shadow_word_pain" } ,"704": {"result": {"type": "none","serial": 175,"timeSpan": [317508.168,inf]}, "type": "function", "asString": "target.debuffrefreshable(shadow_word_pain)" } ,"705": {"result": {"type": "none","serial": 175,"timeSpan": [317508.168,inf]}, "type": "logical", "asString": null } ,"706": {"result": {"type": "none","serial": 175,"timeSpan": [317508.168,inf]}, "type": "logical", "asString": null } ,"707": {"result": {"type": "value","timeSpan": [0,inf],"value": 341291,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "unfurling_darkness" } ,"713": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "typed_function", "asString": "buffpresent(unfurling_darkness)" } ,"714": {"result": {"type": "none","serial": 175,"timeSpan": [317508.168,inf]}, "type": "logical", "asString": null } ,"717": {"result": {"actionCooldownStart": 0,"actionIsCurrent": false,"actionTexture": 135978,"actionEnable": 1,"actionTarget": "target","actionResourceExtend": 0,"type": "action","options": {},"castTime": 1.317,"actionCharges": 0,"actionId": 34914,"actionShortcut": "A","timeSpan": [317508.168,inf],"actionUsable": true,"actionInRange": true,"actionType": "spell","serial": 175,"actionCooldownDuration": 0}, "type": "if", "asString": null } ,"718": {"result": {"type": "value","timeSpan": [0,inf],"value": 589,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "shadow_word_pain" } ,"720": {"result": {"type": "none","serial": 175,"timeSpan": [317508.168,inf]}, "type": "function", "asString": "target.refreshable(shadow_word_pain)" } ,"723": {"result": {"type": "none","serial": 175,"timeSpan": [317520.842,318528.27509979]}, "type": "compare", "asString": null } ,"724": {"result": {"type": "none","serial": 175,"timeSpan": [317520.842,318528.27509979]}, "type": "logical", "asString": null } ,"727": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"728": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"731": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"734": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"737": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "if", "asString": null } ,"743": {"result": {"type": "none","serial": 175,"timeSpan": [317520.842,318528.27509979]}, "type": "compare", "asString": null } ,"744": {"result": {"type": "none","serial": 175,"timeSpan": [317520.842,318528.27509979]}, "type": "logical", "asString": null } ,"747": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"748": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"758": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"769": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"769": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"772": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "if", "asString": null } ,"775": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "compare", "asString": null } ,"778": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "if", "asString": null } ,"783": {"result": {"actionCooldownStart": 0,"actionIsCurrent": false,"actionTexture": 1035040,"actionCooldownDuration": 0,"actionTarget": "target","actionResourceExtend": 0,"type": "action","options": {},"castTime": 0,"actionCharges": 0,"actionId": 205448,"actionShortcut": "3","timeSpan": {},"actionUsable": true,"actionInRange": true,"actionType": "spell","serial": 175,"actionEnable": 1}, "type": "unless", "asString": null } ,"983": {"result": {"type": "value","timeSpan": [0,inf],"value": 1.3167711780564,"rate": 0,"serial": 175,"origin": 0}, "type": "function", "asString": "gcd()" } ,"1832": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "group", "asString": null } ,"1833": {"result": {"type": "value","timeSpan": [0,inf],"value": 299300,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "memory_of_lucid_dreams" } ,"1834": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "action", "asString": "spell(memory_of_lucid_dreams)" } ,"1835": {"result": {"type": "value","timeSpan": [0,inf],"value": 297969,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "blood_of_the_enemy" } ,"1836": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "action", "asString": "spell(blood_of_the_enemy)" } ,"1837": {"result": {"type": "value","timeSpan": [0,inf],"value": 295368,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "concentrated_flame" } ,"1838": {"result": {"type": "value","timeSpan": [0,inf],"value": 0,"rate": 1,"serial": 175,"origin": 0}, "type": "function", "asString": "timesincepreviousspell(concentrated_flame)" } ,"1839": {"result": {"type": "none","serial": 175,"timeSpan": [6,inf]}, "type": "compare", "asString": null } ,"1852": {"result": {"type": "none","serial": 175,"timeSpan": [6,inf]}, "type": "logical", "asString": null } ,"1841": {"result": {"type": "value","timeSpan": [317506.76,inf],"value": 0,"rate": 1,"serial": 175,"origin": 317506.76}, "type": "function", "asString": "timeincombat()" } ,"1842": {"result": {"type": "none","serial": 175,"timeSpan": [317506.76,317516.76]}, "type": "compare", "asString": null } ,"1843": {"result": {"type": "value","timeSpan": [0,inf],"value": 295368,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "concentrated_flame" } ,"1844": {"result": {"type": "value","timeSpan": [0,inf],"value": 0,"rate": 0,"serial": 175,"origin": 0}, "type": "function", "asString": "spellfullrecharge(concentrated_flame)" } ,"1846": {"result": {"type": "none","serial": 175,"timeSpan": [0,inf]}, "type": "compare", "asString": null } ,"1847": {"result": {"type": "none","serial": 175,"timeSpan": [0,inf]}, "type": "logical", "asString": null } ,"1851": {"result": {"type": "none","serial": 175,"timeSpan": [0,inf]}, "type": "logical", "asString": null } ,"1852": {"result": {"type": "none","serial": 175,"timeSpan": [6,inf]}, "type": "logical", "asString": null } ,"1853": {"result": {"type": "value","timeSpan": [0,inf],"value": 295368,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "concentrated_flame" } ,"1854": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "action", "asString": "spell(concentrated_flame)" } ,"1855": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "if", "asString": null } ,"1856": {"result": {"type": "value","timeSpan": [0,inf],"value": 299306,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "ripple_in_space" } ,"1857": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "action", "asString": "spell(ripple_in_space)" } ,"1858": {"result": {"type": "value","timeSpan": [0,inf],"value": 298606,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "worldvein_resonance" } ,"1859": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "action", "asString": "spell(worldvein_resonance)" } ,"1860": {"result": {"type": "value","timeSpan": [0,inf],"value": 299321,"rate": 0,"serial": 175,"origin": 0}, "type": "value", "asString": "the_unbound_force" } ,"1861": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "action", "asString": "spell(the_unbound_force)" } ,"1863": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "group", "asString": null } ,"2018": {"result": {"actionCooldownStart": 317518.425,"actionIsCurrent": false,"actionTexture": 136224,"actionEnable": 1,"actionTarget": "target","actionResourceExtend": 0,"type": "action","options": {},"castTime": 1.317,"actionCharges": 0,"actionId": 8092,"actionShortcut": "E","timeSpan": [317525.008,inf],"actionUsable": true,"actionInRange": true,"actionType": "spell","serial": 175,"actionCooldownDuration": 6.583}, "type": "group", "asString": null } ,"2022": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"2028": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "compare", "asString": null } ,"2029": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"2030": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"2033": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "if", "asString": null } ,"2040": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"2043": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"2046": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "if", "asString": null } ,"2050": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "group", "asString": null } ,"2126": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "group", "asString": null } ,"2127": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "custom_function", "asString": "shadowessencesmainactions()" } ,"2129": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "group", "asString": null } ,"2130": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "custom_function", "asString": "shadowessencesmainpostconditions()" } ,"2161": {"result": {"actionCooldownStart": 317518.425,"actionIsCurrent": false,"actionTexture": 136224,"actionCooldownDuration": 6.583,"actionTarget": "target","actionResourceExtend": 0,"type": "action","options": {},"castTime": 1.317,"actionCharges": 0,"actionId": 8092,"actionShortcut": "E","timeSpan": [317525.008,inf],"actionUsable": true,"actionInRange": true,"actionType": "spell","serial": 175,"actionEnable": 1}, "type": "group", "asString": null } ,"2162": {"result": {"actionCooldownStart": 317518.425,"actionIsCurrent": false,"timeSpan": [317525.008,inf],"actionEnable": 1,"actionTarget": "target","actionResourceExtend": 0,"type": "action","options": {},"castTime": 1.317,"actionCharges": 0,"actionId": 8092,"actionShortcut": "E","actionTexture": 136224,"actionCooldownDuration": 6.583,"actionInRange": true,"actionType": "spell","serial": 175,"actionUsable": true}, "type": "custom_function", "asString": "shadowcwcmainactions()" } ,"2163": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "custom_function", "asString": "shadowcwcmainpostconditions()" } ,"2166": {"result": {"actionCooldownStart": 0,"actionIsCurrent": false,"timeSpan": {},"actionEnable": 1,"actionTarget": "target","actionResourceExtend": 0,"type": "none","options": {},"castTime": 0,"actionCharges": 0,"actionId": 205448,"actionShortcut": "3","actionTexture": 1035040,"actionCooldownDuration": 0,"actionInRange": true,"actionType": "spell","serial": 175,"actionUsable": true}, "type": "unless", "asString": null } ,"2165": {"result": {"actionCooldownStart": 0,"actionIsCurrent": false,"actionTexture": 1035040,"actionEnable": 1,"actionTarget": "target","actionResourceExtend": 0,"type": "none","options": {},"castTime": 0,"actionCharges": 0,"actionId": 205448,"actionShortcut": "3","timeSpan": {},"actionUsable": true,"actionInRange": true,"actionType": "spell","serial": 175,"actionCooldownDuration": 0}, "type": "custom_function", "asString": "shadowmainmainactions()" } ,"2166": {"result": {"actionCooldownStart": 0,"actionIsCurrent": false,"timeSpan": {},"actionEnable": 1,"actionTarget": "target","actionResourceExtend": 0,"type": "none","options": {},"castTime": 0,"actionCharges": 0,"actionId": 205448,"actionShortcut": "3","actionTexture": 1035040,"actionCooldownDuration": 0,"actionInRange": true,"actionType": "spell","serial": 175,"actionUsable": true}, "type": "unless", "asString": null } ,"2232": {"result": {"type": "value","timeSpan": [0,inf],"value": "shadow","rate": 0,"serial": 175,"origin": 0}, "type": "string", "asString": "shadow" } ,"2233": {"result": {"type": "none","serial": 175,"timeSpan": [0,inf]}, "type": "function", "asString": "specialization(shadow)" } ,"2234": {"result": {"type": "value","timeSpan": [0,inf],"value": "main","rate": 0,"serial": 175,"origin": 0}, "type": "string", "asString": null } ,"2235": {"result": {"actionCooldownStart": 317518.425,"actionIsCurrent": false,"timeSpan": [317525.008,inf],"actionCooldownDuration": 6.583,"actionTarget": "target","actionResourceExtend": 0,"type": "action","options": {},"castTime": 1.317,"actionCharges": 0,"actionId": 8092,"actionShortcut": "E","actionTexture": 136224,"actionEnable": 1,"actionInRange": true,"actionType": "spell","serial": 175,"actionUsable": true}, "type": "group", "asString": null } ,"2236": {"result": {"type": "none","serial": 175,"timeSpan": [0,inf]}, "type": "function", "asString": "incombat()" } ,"2237": {"result": {"type": "none","serial": 175,"timeSpan": {}}, "type": "logical", "asString": null } ,"2239": {"result": {"actionCooldownStart": 317492.486,"actionIsCurrent": true,"actionTexture": 135978,"actionCooldownDuration": 0,"actionTarget": "target","actionResourceExtend": 0,"type": "action","options": {},"castTime": 1.324,"actionCharges": 0,"actionId": 34914,"actionShortcut": "A","timeSpan": {},"actionUsable": true,"actionInRange": true,"actionType": "spell","serial": 175,"actionEnable": 1}, "type": "if", "asString": null } ,"2240": {"result": {"actionCooldownStart": 317518.425,"actionIsCurrent": false,"timeSpan": [317525.008,inf],"actionCooldownDuration": 6.583,"actionTarget": "target","actionResourceExtend": 0,"type": "action","options": {},"castTime": 1.317,"actionCharges": 0,"actionId": 8092,"actionShortcut": "E","actionTexture": 136224,"actionEnable": 1,"actionInRange": true,"actionType": "spell","serial": 175,"actionUsable": true}, "type": "custom_function", "asString": "shadow_defaultmainactions()" } }, "result": {"actionCooldownStart": 317518.425,"actionIsCurrent": false,"timeSpan": [317525.008,inf],"actionCooldownDuration": 6.583,"actionTarget": "target","actionResourceExtend": 0,"type": "action","options": {},"castTime": 1.317,"actionCharges": 0,"actionId": 8092,"actionShortcut": "E","actionTexture": 136224,"actionEnable": 1,"actionInRange": true,"actionType": "spell","serial": 175,"actionUsable": true} }`; const expectedLogs = `Reset state with current time = 317520.842000 nextCast = 317520.842000 [2233] >>> Computing 'specialization(shadow)' at time=317520.842000 [2232] >>> Computing 'shadow' at time=317520.842000 [2232] value is shadow [2232] <<< 'shadow' returns (0, inf) with value = value "shadow" [2233] condition 'specialization' returns 0, inf, nil, nil, nil [2233] <<< 'specialization(shadow)' returns (0, inf) with value = none [2234] >>> Computing 'string' at time=317520.842000 [2234] value is main [2234] <<< 'string' returns (0, inf) with value = value "main" [2236] >>> Computing 'incombat()' at time=317520.842000 [2236] condition 'incombat' returns 0, inf, nil, nil, nil [2236] <<< 'incombat()' returns (0, inf) with value = none [2237] >>> Computing 'logical' at time=317520.842000 [2236] >>> Returning for 'incombat()' cached value none at (0, inf) [2237] logical 'not' returns empty set [2237] <<< 'logical' returns empty set with value = none [2235] 'logical' will trigger short-circuit evaluation of parent node [2239] with zero-measure time span. [2239] >>> Computing 'if' at time=317520.842000 [2237] >>> Returning for 'logical' cached value none at empty set [2239] 'if' returns empty set with zero measure [2239] <<< 'if' returns empty set with value = action spell 34914 [2240] >>> Computing 'shadow_defaultmainactions()' at time=317520.842000 [2240]: calling custom function [2161] shadow_defaultmainactions [2162] >>> Computing 'shadowcwcmainactions()' at time=317520.842000 [2162]: calling custom function [2018] shadowcwcmainactions [633] >>> Computing 'searing_nightmare_cutoff()' at time=317520.842000 [633]: calling custom function [325] searing_nightmare_cutoff [326] >>> Computing 'enemies()' at time=317520.842000 [326] condition 'enemies' returns 0, inf, 1, 0, 0 [326] <<< 'enemies()' returns (0, inf) with value = value 1 + (t - 0) * 0 [327] >>> Computing 'compare' at time=317520.842000 [326] >>> Returning for 'enemies()' cached value value 1 + (t - 0) * 0 at (0, inf) [327] 1+(t-0)*0 > 3+(t-0)*0 [327] compare '>' returns empty set [327] <<< 'compare' returns empty set with value = none [325] >>> Computing 'group' at time=317520.842000 [325] group checking child [327-[compare]] [327] >>> Returning for 'compare' cached value none at empty set [325] group checking child [327-[compare]] result: empty set [325] child [327] measure is 0, skipping [325] group no best action returns none at empty set [325] <<< 'group' returns empty set with value = none [633]: [325] searing_nightmare_cutoff is returning none [633] <<< 'searing_nightmare_cutoff()' returns empty set with value = none [2018] 'custom_function' will trigger short-circuit evaluation of parent node [2022] with zero measure. [2022] >>> Computing 'logical' at time=317520.842000 [633] >>> Returning for 'searing_nightmare_cutoff()' cached value none at empty set [2022] logical 'and' short-circuits with zero measure left argument [2022] logical 'and' returns empty set [2022] <<< 'logical' returns empty set with value = none [704] >>> Computing 'target.debuffrefreshable(shadow_word_pain)' at time=317520.842000 [701] >>> Computing 'shadow_word_pain' at time=317520.842000 [701] value is 589 [701] <<< 'shadow_word_pain' returns (0, inf) with value = value 589 + (t - 0) * 0 Found aura with stack = 1 Aura 589 found on Creature-0-3770-0-5276-153292-0000548E1B with (317492.77, 317511.768) [stacks=1] [704] condition 'debuffrefreshable' returns 317508.168, inf, nil, nil, nil [704] <<< 'target.debuffrefreshable(shadow_word_pain)' returns (317508.168, inf) with value = none [326] >>> Returning for 'enemies()' cached value value 1 + (t - 0) * 0 at (0, inf) [2028] >>> Computing 'compare' at time=317520.842000 [326] >>> Returning for 'enemies()' cached value value 1 + (t - 0) * 0 at (0, inf) [2028] 1+(t-0)*0 > 1+(t-0)*0 [2028] compare '>' returns empty set [2028] <<< 'compare' returns empty set with value = none [2029] >>> Computing 'logical' at time=317520.842000 [704] >>> Returning for 'target.debuffrefreshable(shadow_word_pain)' cached value none at (317508.168, inf) [2028] >>> Returning for 'compare' cached value none at empty set [2029] logical 'and' returns empty set [2029] <<< 'logical' returns empty set with value = none [2030] >>> Computing 'logical' at time=317520.842000 [2022] >>> Returning for 'logical' cached value none at empty set [2029] >>> Returning for 'logical' cached value none at empty set [2030] logical 'or' returns empty set [2030] <<< 'logical' returns empty set with value = none [2018] 'logical' will trigger short-circuit evaluation of parent node [2033] with zero-measure time span. [2033] >>> Computing 'if' at time=317520.842000 [2030] >>> Returning for 'logical' cached value none at empty set [2033] 'if' returns empty set with zero measure [2033] <<< 'if' returns empty set with value = none [158] >>> Computing 'hastalent(searing_nightmare_talent)' at time=317520.842000 [157] >>> Computing 'searing_nightmare_talent' at time=317520.842000 [157] value is 23127 [157] <<< 'searing_nightmare_talent' returns (0, inf) with value = value 23127 + (t - 0) * 0 [158] condition 'hastalent' returns nil, nil, nil, nil, nil [158] <<< 'hastalent(searing_nightmare_talent)' returns empty set with value = none [2018] 'function' will trigger short-circuit evaluation of parent node [2040] with zero measure. [2040] >>> Computing 'logical' at time=317520.842000 [158] >>> Returning for 'hastalent(searing_nightmare_talent)' cached value none at empty set [2040] logical 'and' short-circuits with zero measure left argument [2040] logical 'and' returns empty set [2040] <<< 'logical' returns empty set with value = none [2018] 'logical' will trigger short-circuit evaluation of parent node [2043] with zero measure. [2043] >>> Computing 'logical' at time=317520.842000 [2040] >>> Returning for 'logical' cached value none at empty set [2043] logical 'and' short-circuits with zero measure left argument [2043] logical 'and' returns empty set [2043] <<< 'logical' returns empty set with value = none [2018] 'logical' will trigger short-circuit evaluation of parent node [2046] with zero-measure time span. [2046] >>> Computing 'if' at time=317520.842000 [2043] >>> Returning for 'logical' cached value none at empty set [2046] 'if' returns empty set with zero measure [2046] <<< 'if' returns empty set with value = none [690] >>> Computing 'spell(mind_blast)' at time=317520.842000 [690] evaluating action: spell() [689] >>> Computing 'mind_blast' at time=317520.842000 [689] value is 8092 [689] <<< 'mind_blast' returns (0, inf) with value = value 8092 + (t - 0) * 0 [87] >>> Computing 'specialization(holy)' at time=317520.842000 [86] >>> Computing 'holy' at time=317520.842000 [86] value is holy [86] <<< 'holy' returns (0, inf) with value = value "holy" [87] condition 'specialization' returns nil, nil, nil, nil, nil [87] <<< 'specialization(holy)' returns empty set with value = none [85] >>> Computing 'value' at time=317520.842000 [85] value is 14914 [85] <<< 'value' returns (0, inf) with value = value 14914 + (t - 0) * 0 Found spell info about 8092 (isKnown = true) Spell has cost of %d for %s Spell has cost of 0 for insanity Spell has cost of 0 for insanity Spell has cost of %d for %s Spell ID '8092' passed power requirements. OvaleSpells:IsUsableSpell(8092, 317520.842000, Creature-0-3770-0-5276-153292-0000548E1B) returned true, false Didn't find an existing cd in next, look for one in current Call GetSpellCooldown which returned 317518.625000, 6.583000, 1 GlobalCooldown is 0, 0 It returned 317518.525000, 6.583000 Cooldown of spell 8092 is 317518.425000 + 6.583000 GetSpellCooldown returned 317518.425000, 6.583000 Cooldown of spell 8092 is 317518.425000 + 6.583000 [690] Action spell (actionCharges=0) [690] Action spell is on cooldown (start=317518.425000, duration=6.583000). [690] start=317525.008000 atTime=317520.842000 [690] Action spell can start at 317525.008000. [690] <<< 'spell(mind_blast)' returns (317525.008, inf) with value = action spell 8092 [2018] >>> Computing 'group' at time=317520.842000 [2018] group checking child [2033-[if]] [2033] >>> Returning for 'if' cached value none at empty set [2018] group checking child [2033-[if]] result: empty set [2018] child [2033] measure is 0, skipping [2018] group checking child [2046-[if]] [2046] >>> Returning for 'if' cached value none at empty set [2018] group checking child [2046-[if]] result: empty set [2018] child [2046] measure is 0, skipping [2018] group checking child [690-spell(mind_blast)] [690] >>> Returning for 'spell(mind_blast)' cached value action spell 8092 at (317525.008, inf) [2018] group checking child [690-spell(mind_blast)] result: (317525.008, inf) [2018] group first best is [690-spell(mind_blast)]: (317525.008, inf) [2018] group best action remains action spell 8092 at (317525.008, inf) [2018] <<< 'group' returns (317525.008, inf) with value = action spell 8092 [2162]: [2018] shadowcwcmainactions is returning action spell 8092 [2162] <<< 'shadowcwcmainactions()' returns (317525.008, inf) with value = action spell 8092 [2163] >>> Computing 'shadowcwcmainpostconditions()' at time=317520.842000 [2163]: calling custom function [2050] shadowcwcmainpostconditions [2050] >>> Computing 'group' at time=317520.842000 [2050] group no best action returns none at empty set [2050] <<< 'group' returns empty set with value = none [2163]: [2050] shadowcwcmainpostconditions is returning none [2163] <<< 'shadowcwcmainpostconditions()' returns empty set with value = none [2165] >>> Computing 'shadowmainmainactions()' at time=317520.842000 [2165]: calling custom function [551] shadowmainmainactions [558] >>> Computing 'buffpresent(fae_guardians)' at time=317520.842000 computing positional parameters [552] >>> Computing 'fae_guardians' at time=317520.842000 [552] value is 327661 [552] <<< 'fae_guardians' returns (0, inf) with value = value 327661 + (t - 0) * 0 Aura 327661 is missing on Player-1315-05C8DCE1 (mine=true). [558] condition 'buffpresent' returns nil, nil, nil, nil, nil [558] <<< 'buffpresent(fae_guardians)' returns empty set with value = none [551] 'typed_function' will trigger short-circuit evaluation of parent node [567] with zero measure. [567] >>> Computing 'logical' at time=317520.842000 [558] >>> Returning for 'buffpresent(fae_guardians)' cached value none at empty set [567] logical 'and' short-circuits with zero measure left argument [567] logical 'and' returns empty set [567] <<< 'logical' returns empty set with value = none [551] 'logical' will trigger short-circuit evaluation of parent node [570] with zero-measure time span. [570] >>> Computing 'if' at time=317520.842000 [567] >>> Returning for 'logical' cached value none at empty set [570] 'if' returns empty set with zero measure [570] <<< 'if' returns empty set with value = none [571] >>> Computing 'shadowcdsmainactions()' at time=317520.842000 [571]: calling custom function [2126] shadowcdsmainactions [2127] >>> Computing 'shadowessencesmainactions()' at time=317520.842000 [2127]: calling custom function [1832] shadowessencesmainactions [1834] >>> Computing 'spell(memory_of_lucid_dreams)' at time=317520.842000 [1834] evaluating action: spell() [1833] >>> Computing 'memory_of_lucid_dreams' at time=317520.842000 [1833] value is 299300 [1833] <<< 'memory_of_lucid_dreams' returns (0, inf) with value = value 299300 + (t - 0) * 0 Unknown spell ID '299300'. [1834] <<< 'spell(memory_of_lucid_dreams)' returns empty set with value = none [1836] >>> Computing 'spell(blood_of_the_enemy)' at time=317520.842000 [1836] evaluating action: spell() [1835] >>> Computing 'blood_of_the_enemy' at time=317520.842000 [1835] value is 297969 [1835] <<< 'blood_of_the_enemy' returns (0, inf) with value = value 297969 + (t - 0) * 0 Unknown spell ID '297969'. [1836] <<< 'spell(blood_of_the_enemy)' returns empty set with value = none [1838] >>> Computing 'timesincepreviousspell(concentrated_flame)' at time=317520.842000 [1837] >>> Computing 'concentrated_flame' at time=317520.842000 [1837] value is 295368 [1837] <<< 'concentrated_flame' returns (0, inf) with value = value 295368 + (t - 0) * 0 [1838] condition 'timesincepreviousspell' returns 0, inf, 0, 0, 1 [1838] <<< 'timesincepreviousspell(concentrated_flame)' returns (0, inf) with value = value 0 + (t - 0) * 1 [1839] >>> Computing 'compare' at time=317520.842000 [1838] >>> Returning for 'timesincepreviousspell(concentrated_flame)' cached value value 0 + (t - 0) * 1 at (0, inf) [1839] 0+(t-0)*1 > 6+(t-0)*0 [1839] intersection at t = 6 [1839] compare '>' returns (6, inf) [1839] <<< 'compare' returns (6, inf) with value = none [1841] >>> Computing 'timeincombat()' at time=317520.842000 [1841] condition 'timeincombat' returns 317506.76, inf, 0, 317506.76, 1 [1841] <<< 'timeincombat()' returns (317506.76, inf) with value = value 0 + (t - 317506.76) * 1 [1842] >>> Computing 'compare' at time=317520.842000 [1841] >>> Returning for 'timeincombat()' cached value value 0 + (t - 317506.76) * 1 at (317506.76, inf) [1842] 0+(t-317506.76)*1 <= 10+(t-0)*0 [1842] intersection at t = 317516.76 [1842] compare '<=' returns (317506.76, 317516.76) [1842] <<< 'compare' returns (317506.76, 317516.76) with value = none [1844] >>> Computing 'spellfullrecharge(concentrated_flame)' at time=317520.842000 [1843] >>> Computing 'concentrated_flame' at time=317520.842000 [1843] value is 295368 [1843] <<< 'concentrated_flame' returns (0, inf) with value = value 295368 + (t - 0) * 0 Didn't find an existing cd in next, look for one in current Call GetSpellCooldown which returned 0.000000, 0.000000, 1 It returned -0.100000, 0.000000 Spell cooldown is in the past Cooldown of spell 295368 is 0.000000 + 0.000000 [1844] condition 'spellfullrecharge' returns 0, inf, 0, 0, 0 [1844] <<< 'spellfullrecharge(concentrated_flame)' returns (0, inf) with value = value 0 + (t - 0) * 0 [983] >>> Computing 'gcd()' at time=317520.842000 [983] condition 'gcd' returns 0, inf, 1.3167711780564, 0, 0 [983] <<< 'gcd()' returns (0, inf) with value = value 1.3167711780564 + (t - 0) * 0 [1846] >>> Computing 'compare' at time=317520.842000 [1844] >>> Returning for 'spellfullrecharge(concentrated_flame)' cached value value 0 + (t - 0) * 0 at (0, inf) [983] >>> Returning for 'gcd()' cached value value 1.3167711780564 + (t - 0) * 0 at (0, inf) [1846] 0+(t-0)*0 < 1.3167711780564+(t-0)*0 [1846] compare '<' returns (0, inf) [1846] <<< 'compare' returns (0, inf) with value = none [1847] >>> Computing 'logical' at time=317520.842000 [1842] >>> Returning for 'compare' cached value none at (317506.76, 317516.76) [1846] >>> Returning for 'compare' cached value none at (0, inf) [1847] logical 'or' returns (0, inf) [1847] <<< 'logical' returns (0, inf) with value = none [1832] 'logical' will trigger short-circuit evaluation of parent node [1851] with universe as time span. [1851] >>> Computing 'logical' at time=317520.842000 [1847] >>> Returning for 'logical' cached value none at (0, inf) [1851] logical 'or' short-circuits with universe as left argument [1851] logical 'or' returns (0, inf) [1851] <<< 'logical' returns (0, inf) with value = none [1852] >>> Computing 'logical' at time=317520.842000 [1839] >>> Returning for 'compare' cached value none at (6, inf) [1851] >>> Returning for 'logical' cached value none at (0, inf) [1852] logical 'and' returns (6, inf) [1852] <<< 'logical' returns (6, inf) with value = none [1854] >>> Computing 'spell(concentrated_flame)' at time=317520.842000 [1854] evaluating action: spell() [1853] >>> Computing 'concentrated_flame' at time=317520.842000 [1853] value is 295368 [1853] <<< 'concentrated_flame' returns (0, inf) with value = value 295368 + (t - 0) * 0 Unknown spell ID '295368'. [1854] <<< 'spell(concentrated_flame)' returns empty set with value = none [1855] >>> Computing 'if' at time=317520.842000 [1852] >>> Returning for 'logical' cached value none at (6, inf) [1854] >>> Returning for 'spell(concentrated_flame)' cached value none at empty set [1855] 'if' returns empty set (intersection of (6, inf) and empty set) [1855] <<< 'if' returns empty set with value = none [1857] >>> Computing 'spell(ripple_in_space)' at time=317520.842000 [1857] evaluating action: spell() [1856] >>> Computing 'ripple_in_space' at time=317520.842000 [1856] value is 299306 [1856] <<< 'ripple_in_space' returns (0, inf) with value = value 299306 + (t - 0) * 0 Unknown spell ID '299306'. [1857] <<< 'spell(ripple_in_space)' returns empty set with value = none [1859] >>> Computing 'spell(worldvein_resonance)' at time=317520.842000 [1859] evaluating action: spell() [1858] >>> Computing 'worldvein_resonance' at time=317520.842000 [1858] value is 298606 [1858] <<< 'worldvein_resonance' returns (0, inf) with value = value 298606 + (t - 0) * 0 Unknown spell ID '298606'. [1859] <<< 'spell(worldvein_resonance)' returns empty set with value = none [1861] >>> Computing 'spell(the_unbound_force)' at time=317520.842000 [1861] evaluating action: spell() [1860] >>> Computing 'the_unbound_force' at time=317520.842000 [1860] value is 299321 [1860] <<< 'the_unbound_force' returns (0, inf) with value = value 299321 + (t - 0) * 0 Unknown spell ID '299321'. [1861] <<< 'spell(the_unbound_force)' returns empty set with value = none [1832] >>> Computing 'group' at time=317520.842000 [1832] group checking child [1834-spell(memory_of_lucid_dreams)] [1834] >>> Returning for 'spell(memory_of_lucid_dreams)' cached value none at empty set [1832] group checking child [1834-spell(memory_of_lucid_dreams)] result: empty set [1832] child [1834] measure is 0, skipping [1832] group checking child [1836-spell(blood_of_the_enemy)] [1836] >>> Returning for 'spell(blood_of_the_enemy)' cached value none at empty set [1832] group checking child [1836-spell(blood_of_the_enemy)] result: empty set [1832] child [1836] measure is 0, skipping [1832] group checking child [1855-[if]] [1855] >>> Returning for 'if' cached value none at empty set [1832] group checking child [1855-[if]] result: empty set [1832] child [1855] measure is 0, skipping [1832] group checking child [1857-spell(ripple_in_space)] [1857] >>> Returning for 'spell(ripple_in_space)' cached value none at empty set [1832] group checking child [1857-spell(ripple_in_space)] result: empty set [1832] child [1857] measure is 0, skipping [1832] group checking child [1859-spell(worldvein_resonance)] [1859] >>> Returning for 'spell(worldvein_resonance)' cached value none at empty set [1832] group checking child [1859-spell(worldvein_resonance)] result: empty set [1832] child [1859] measure is 0, skipping [1832] group checking child [1861-spell(the_unbound_force)] [1861] >>> Returning for 'spell(the_unbound_force)' cached value none at empty set [1832] group checking child [1861-spell(the_unbound_force)] result: empty set [1832] child [1861] measure is 0, skipping [1832] group no best action returns none at empty set [1832] <<< 'group' returns empty set with value = none [2127]: [1832] shadowessencesmainactions is returning none [2127] <<< 'shadowessencesmainactions()' returns empty set with value = none [2126] >>> Computing 'group' at time=317520.842000 [2126] group checking child [2127-shadowessencesmainactions()] [2127] >>> Returning for 'shadowessencesmainactions()' cached value none at empty set [2126] group checking child [2127-shadowessencesmainactions()] result: empty set [2126] child [2127] measure is 0, skipping [2126] group no best action returns none at empty set [2126] <<< 'group' returns empty set with value = none [571]: [2126] shadowcdsmainactions is returning none [571] <<< 'shadowcdsmainactions()' returns empty set with value = none [572] >>> Computing 'shadowcdsmainpostconditions()' at time=317520.842000 [572]: calling custom function [2129] shadowcdsmainpostconditions [2130] >>> Computing 'shadowessencesmainpostconditions()' at time=317520.842000 [2130]: calling custom function [1863] shadowessencesmainpostconditions [1863] >>> Computing 'group' at time=317520.842000 [1863] group no best action returns none at empty set [1863] <<< 'group' returns empty set with value = none [2130]: [1863] shadowessencesmainpostconditions is returning none [2130] <<< 'shadowessencesmainpostconditions()' returns empty set with value = none [2129] >>> Computing 'group' at time=317520.842000 [2129] group checking child [2130-shadowessencesmainpostconditions()] [2130] >>> Returning for 'shadowessencesmainpostconditions()' cached value none at empty set [2129] group checking child [2130-shadowessencesmainpostconditions()] result: empty set [2129] child [2130] measure is 0, skipping [2129] group no best action returns none at empty set [2129] <<< 'group' returns empty set with value = none [572]: [2129] shadowcdsmainpostconditions is returning none [572] <<< 'shadowcdsmainpostconditions()' returns empty set with value = none [158] >>> Returning for 'hastalent(searing_nightmare_talent)' cached value none at empty set [551] 'function' will trigger short-circuit evaluation of parent node [580] with zero measure. [580] >>> Computing 'logical' at time=317520.842000 [158] >>> Returning for 'hastalent(searing_nightmare_talent)' cached value none at empty set [580] logical 'and' short-circuits with zero measure left argument [580] logical 'and' returns empty set [580] <<< 'logical' returns empty set with value = none [551] 'logical' will trigger short-circuit evaluation of parent node [589] with zero measure. [589] >>> Computing 'logical' at time=317520.842000 [580] >>> Returning for 'logical' cached value none at empty set [589] logical 'and' short-circuits with zero measure left argument [589] logical 'and' returns empty set [589] <<< 'logical' returns empty set with value = none [551] 'logical' will trigger short-circuit evaluation of parent node [596] with zero measure. [596] >>> Computing 'logical' at time=317520.842000 [589] >>> Returning for 'logical' cached value none at empty set [596] logical 'and' short-circuits with zero measure left argument [596] logical 'and' returns empty set [596] <<< 'logical' returns empty set with value = none [551] 'logical' will trigger short-circuit evaluation of parent node [599] with zero-measure time span. [599] >>> Computing 'if' at time=317520.842000 [596] >>> Returning for 'logical' cached value none at empty set [599] 'if' returns empty set with zero measure [599] <<< 'if' returns empty set with value = none [600] >>> Computing 'insanity()' at time=317520.842000 [600] condition 'insanity' returns 317520.842, inf, 100, 317520.842, 0.0010000000474975 [600] <<< 'insanity()' returns (317520.842, inf) with value = value 100 + (t - 317520.842) * 0.0010000000474975 [602] >>> Computing 'compare' at time=317520.842000 [600] >>> Returning for 'insanity()' cached value value 100 + (t - 317520.842) * 0.0010000000474975 at (317520.842, inf) [602] 100+(t-317520.842)*0.0010000000474975 <= 85+(t-0)*0 [602] intersection at t = 302520.84271246 [602] compare '<=' returns empty set [602] <<< 'compare' returns empty set with value = none [551] 'compare' will trigger short-circuit evaluation of parent node [612] with zero measure. [612] >>> Computing 'logical' at time=317520.842000 [602] >>> Returning for 'compare' cached value none at empty set [612] logical 'and' short-circuits with zero measure left argument [612] logical 'and' returns empty set [612] <<< 'logical' returns empty set with value = none [551] 'logical' will trigger short-circuit evaluation of parent node [615] with zero-measure time span. [615] >>> Computing 'if' at time=317520.842000 [612] >>> Returning for 'logical' cached value none at empty set [615] 'if' returns empty set with zero measure [615] <<< 'if' returns empty set with value = action spell 205448 [619] >>> Computing 'target.refreshable(devouring_plague)' at time=317520.842000 [617] >>> Computing 'devouring_plague' at time=317520.842000 [617] value is 335467 [617] <<< 'devouring_plague' returns (0, inf) with value = value 335467 + (t - 0) * 0 Aura 335467 is missing on Creature-0-3770-0-5276-153292-0000548E1B (mine=true). [619] condition 'refreshable' returns 0, inf, nil, nil, nil [619] <<< 'target.refreshable(devouring_plague)' returns (0, inf) with value = none [551] 'function' will trigger short-circuit evaluation of parent node [623] with universe as time span. [623] >>> Computing 'logical' at time=317520.842000 [619] >>> Returning for 'target.refreshable(devouring_plague)' cached value none at (0, inf) [623] logical 'or' short-circuits with universe as left argument [623] logical 'or' returns (0, inf) [623] <<< 'logical' returns (0, inf) with value = none [624] >>> Computing 'pi_or_vf_sync_condition()' at time=317520.842000 [624]: calling custom function [291] pi_or_vf_sync_condition [294] >>> Computing 'checkboxon("self_power_infusion")' at time=317520.842000 [294] condition 'checkboxon' returns 0, inf, nil, nil, nil [294] <<< 'checkboxon("self_power_infusion")' returns (0, inf) with value = none [291] 'function' will trigger short-circuit evaluation of parent node [297] with universe as time span. [297] >>> Computing 'logical' at time=317520.842000 [294] >>> Returning for 'checkboxon("self_power_infusion")' cached value none at (0, inf) [297] logical 'or' short-circuits with universe as left argument [297] logical 'or' returns (0, inf) [297] <<< 'logical' returns (0, inf) with value = none [298] >>> Computing 'level()' at time=317520.842000 [298] condition 'level' returns 0, inf, 50, 0, 0 [298] <<< 'level()' returns (0, inf) with value = value 50 + (t - 0) * 0 [300] >>> Computing 'compare' at time=317520.842000 [298] >>> Returning for 'level()' cached value value 50 + (t - 0) * 0 at (0, inf) [300] 50+(t-0)*0 >= 58+(t-0)*0 [300] compare '>=' returns empty set [300] <<< 'compare' returns empty set with value = none [301] >>> Computing 'logical' at time=317520.842000 [297] >>> Returning for 'logical' cached value none at (0, inf) [300] >>> Returning for 'compare' cached value none at empty set [301] logical 'and' returns empty set [301] <<< 'logical' returns empty set with value = none [291] 'logical' will trigger short-circuit evaluation of parent node [306] with zero measure. [306] >>> Computing 'logical' at time=317520.842000 [301] >>> Returning for 'logical' cached value none at empty set [306] logical 'and' short-circuits with zero measure left argument [306] logical 'and' returns empty set [306] <<< 'logical' returns empty set with value = none [309] >>> Computing 'compare' at time=317520.842000 [298] >>> Returning for 'level()' cached value value 50 + (t - 0) * 0 at (0, inf) [309] 50+(t-0)*0 < 58+(t-0)*0 [309] compare '<' returns (0, inf) [309] <<< 'compare' returns (0, inf) with value = none [291] 'compare' will trigger short-circuit evaluation of parent node [317] with universe as time span. [317] >>> Computing 'logical' at time=317520.842000 [309] >>> Returning for 'compare' cached value none at (0, inf) [317] logical 'or' short-circuits with universe as left argument [317] logical 'or' returns (0, inf) [317] <<< 'logical' returns (0, inf) with value = none [319] >>> Computing 'spellcooldown(void_eruption)' at time=317520.842000 [318] >>> Computing 'void_eruption' at time=317520.842000 [318] value is 228260 [318] <<< 'void_eruption' returns (0, inf) with value = value 228260 + (t - 0) * 0 Didn't find an existing cd in next, look for one in current Call GetSpellCooldown which returned 317504.096000, 90.000000, 1 GlobalCooldown is 0, 0 It returned 317503.996000, 90.000000 Cooldown of spell 228260 is 317503.896000 + 90.000000 [319] condition 'spellcooldown' returns 0, inf, 0, 317593.896, -1 [319] <<< 'spellcooldown(void_eruption)' returns (0, inf) with value = value 0 + (t - 317593.896) * -1 [320] >>> Computing 'compare' at time=317520.842000 [319] >>> Returning for 'spellcooldown(void_eruption)' cached value value 0 + (t - 317593.896) * -1 at (0, inf) [320] 0+(t-317593.896)*-1 > 0+(t-0)*0 [320] intersection at t = 317593.896 [320] compare '>' returns (0, 317593.896) [320] <<< 'compare' returns (0, 317593.896) with value = none [321] >>> Computing 'logical' at time=317520.842000 [320] >>> Returning for 'compare' cached value none at (0, 317593.896) [321] logical 'not' returns (317593.896, inf) [321] <<< 'logical' returns (317593.896, inf) with value = none [322] >>> Computing 'logical' at time=317520.842000 [317] >>> Returning for 'logical' cached value none at (0, inf) [321] >>> Returning for 'logical' cached value none at (317593.896, inf) [322] logical 'and' returns (317593.896, inf) [322] <<< 'logical' returns (317593.896, inf) with value = none [323] >>> Computing 'logical' at time=317520.842000 [306] >>> Returning for 'logical' cached value none at empty set [322] >>> Returning for 'logical' cached value none at (317593.896, inf) [323] logical 'or' returns (317593.896, inf) [323] <<< 'logical' returns (317593.896, inf) with value = none [291] >>> Computing 'group' at time=317520.842000 [291] group checking child [323-[logical]] [323] >>> Returning for 'logical' cached value none at (317593.896, inf) [291] group checking child [323-[logical]] result: (317593.896, inf) [291] group first best is [323-[logical]]: (317593.896, inf) [291] group best action remains none at (317593.896, inf) [291] <<< 'group' returns (317593.896, inf) with value = none [624]: [291] pi_or_vf_sync_condition is returning none [624] <<< 'pi_or_vf_sync_condition()' returns (317593.896, inf) with value = none [625] >>> Computing 'logical' at time=317520.842000 [624] >>> Returning for 'pi_or_vf_sync_condition()' cached value none at (317593.896, inf) [625] logical 'not' returns (0, 317593.896) [625] <<< 'logical' returns (0, 317593.896) with value = none [626] >>> Computing 'logical' at time=317520.842000 [623] >>> Returning for 'logical' cached value none at (0, inf) [625] >>> Returning for 'logical' cached value none at (0, 317593.896) [626] logical 'and' returns (0, 317593.896) [626] <<< 'logical' returns (0, 317593.896) with value = none [630] >>> Computing 'logical' at time=317520.842000 [158] >>> Returning for 'hastalent(searing_nightmare_talent)' cached value none at empty set [630] logical 'not' returns (0, inf) [630] <<< 'logical' returns (0, inf) with value = none [551] 'logical' will trigger short-circuit evaluation of parent node [636] with universe as time span. [636] >>> Computing 'logical' at time=317520.842000 [630] >>> Returning for 'logical' cached value none at (0, inf) [636] logical 'or' short-circuits with universe as left argument [636] logical 'or' returns (0, inf) [636] <<< 'logical' returns (0, inf) with value = none [637] >>> Computing 'logical' at time=317520.842000 [626] >>> Returning for 'logical' cached value none at (0, 317593.896) [636] >>> Returning for 'logical' cached value none at (0, inf) [637] logical 'and' returns (0, 317593.896) [637] <<< 'logical' returns (0, 317593.896) with value = none [639] >>> Computing 'spell(devouring_plague)' at time=317520.842000 [639] evaluating action: spell() [638] >>> Computing 'devouring_plague' at time=317520.842000 [638] value is 335467 [638] <<< 'devouring_plague' returns (0, inf) with value = value 335467 + (t - 0) * 0 Found spell info about 335467 (isKnown = true) Spell has cost of %d for %s Spell has cost of 5000 for insanity Spell ID '335467' does not have enough power. OvaleSpells:IsUsableSpell(335467, 317520.842000, Creature-0-3770-0-5276-153292-0000548E1B) returned false, true Didn't find an existing cd in next, look for one in current Call GetSpellCooldown which returned 0.000000, 0.000000, 1 It returned -0.100000, 0.000000 Spell cooldown is in the past Cooldown of spell 335467 is 0.000000 + 0.000000 GetSpellCooldown returned 0.000000, 0.000000 Spell cooldown is in the past Cooldown of spell 335467 is 0.000000 + 0.000000 [639] Action spell still has 0.000000 charges but is on GCD (start=0.000000). [639] start=0.000000 atTime=317520.842000 [639] Action spell is waiting for the global cooldown. [639] Action spell can start at 0.000000. [639] <<< 'spell(devouring_plague)' returns (0, inf) with value = action spell 335467 [640] >>> Computing 'if' at time=317520.842000 [637] >>> Returning for 'logical' cached value none at (0, 317593.896) [639] >>> Returning for 'spell(devouring_plague)' cached value action spell 335467 at (0, inf) [640] 'if' returns (0, 317593.896) (intersection of (0, 317593.896) and (0, inf)) [640] <<< 'if' returns (0, 317593.896) with value = action spell 335467 [643] >>> Computing 'conduit(dissonant_echoes_conduit)' at time=317520.842000 [642] >>> Computing 'dissonant_echoes_conduit' at time=317520.842000 [642] value is 115 [642] <<< 'dissonant_echoes_conduit' returns (0, inf) with value = value 115 + (t - 0) * 0 [643] condition 'conduit' returns nil, nil, nil, nil, nil [643] <<< 'conduit(dissonant_echoes_conduit)' returns empty set with value = none [644] >>> Computing 'arithmetic' at time=317520.842000 [643] >>> Returning for 'conduit(dissonant_echoes_conduit)' cached value none at empty set [644] 4+(t-0)*0 + 0+(t-0)*0 [644] arithmetic '+' returns 4+(t-317520.842)*0 [644] <<< 'arithmetic' returns (0, inf) with value = value 4 + (t - 317520.842) * 0 [645] >>> Computing 'compare' at time=317520.842000 [326] >>> Returning for 'enemies()' cached value value 1 + (t - 0) * 0 at (0, inf) [644] >>> Returning for 'arithmetic' cached value value 4 + (t - 317520.842) * 0 at (0, inf) [645] 1+(t-0)*0 < 4+(t-317520.842)*0 [645] compare '<' returns (0, inf) [645] <<< 'compare' returns (0, inf) with value = none [647] >>> Computing 'compare' at time=317520.842000 [600] >>> Returning for 'insanity()' cached value value 100 + (t - 317520.842) * 0.0010000000474975 at (317520.842, inf) [647] 100+(t-317520.842)*0.0010000000474975 <= 85+(t-0)*0 [647] intersection at t = 302520.84271246 [647] compare '<=' returns empty set [647] <<< 'compare' returns empty set with value = none [648] >>> Computing 'logical' at time=317520.842000 [645] >>> Returning for 'compare' cached value none at (0, inf) [647] >>> Returning for 'compare' cached value none at empty set [648] logical 'and' returns empty set [648] <<< 'logical' returns empty set with value = none [551] 'logical' will trigger short-circuit evaluation of parent node [651] with zero-measure time span. [651] >>> Computing 'if' at time=317520.842000 [648] >>> Returning for 'logical' cached value none at empty set [651] 'if' returns empty set with zero measure [651] <<< 'if' returns empty set with value = action spell 205448 [654] >>> Computing 'compare' at time=317520.842000 [326] >>> Returning for 'enemies()' cached value value 1 + (t - 0) * 0 at (0, inf) [654] 1+(t-0)*0 > 1+(t-0)*0 [654] compare '>' returns empty set [654] <<< 'compare' returns empty set with value = none [551] 'compare' will trigger short-circuit evaluation of parent node [662] with zero measure. [662] >>> Computing 'logical' at time=317520.842000 [654] >>> Returning for 'compare' cached value none at empty set [662] logical 'and' short-circuits with zero measure left argument [662] logical 'and' returns empty set [662] <<< 'logical' returns empty set with value = none [551] 'logical' will trigger short-circuit evaluation of parent node [665] with zero-measure time span. [665] >>> Computing 'if' at time=317520.842000 [662] >>> Returning for 'logical' cached value none at empty set [665] 'if' returns empty set with zero measure [665] <<< 'if' returns empty set with value = none [673] >>> Computing 'dots_up()' at time=317520.842000 [673]: calling custom function [354] dots_up [336] >>> Computing 'target.debuffpresent(shadow_word_pain)' at time=317520.842000 computing positional parameters [330] >>> Computing 'shadow_word_pain' at time=317520.842000 [330] value is 589 [330] <<< 'shadow_word_pain' returns (0, inf) with value = value 589 + (t - 0) * 0 Found aura with stack = 1 Aura 589 found on Creature-0-3770-0-5276-153292-0000548E1B with (317492.77, 317511.768) [stacks=1] [336] condition 'debuffpresent' returns 317506.906, 317511.768, nil, nil, nil [336] <<< 'target.debuffpresent(shadow_word_pain)' returns (317506.906, 317511.768) with value = none [343] >>> Computing 'target.debuffpresent(vampiric_touch)' at time=317520.842000 computing positional parameters [337] >>> Computing 'vampiric_touch' at time=317520.842000 [337] value is 34914 [337] <<< 'vampiric_touch' returns (0, inf) with value = value 34914 + (t - 0) * 0 Found aura with stack = 1 Aura 34914 found on Creature-0-3770-0-5276-153292-0000548E1B with (317492.823, 317516.741) [stacks=1] [343] condition 'debuffpresent' returns 317516.591, 317516.741, nil, nil, nil [343] <<< 'target.debuffpresent(vampiric_touch)' returns (317516.591, 317516.741) with value = none [369] >>> Computing 'logical' at time=317520.842000 [336] >>> Returning for 'target.debuffpresent(shadow_word_pain)' cached value none at (317506.906, 317511.768) [343] >>> Returning for 'target.debuffpresent(vampiric_touch)' cached value none at (317516.591, 317516.741) [369] logical 'and' returns empty set [369] <<< 'logical' returns empty set with value = none [354] >>> Computing 'group' at time=317520.842000 [354] group checking child [369-[logical]] [369] >>> Returning for 'logical' cached value none at empty set [354] group checking child [369-[logical]] result: empty set [354] child [369] measure is 0, skipping [354] group no best action returns none at empty set [354] <<< 'group' returns empty set with value = none [673]: [354] dots_up is returning none [673] <<< 'dots_up()' returns empty set with value = none [674] >>> Computing 'logical' at time=317520.842000 [661] >>> Computing 'buffpresent(dark_thought)' at time=317520.842000 computing positional parameters [655] >>> Computing 'dark_thought' at time=317520.842000 [655] value is 341207 [655] <<< 'dark_thought' returns (0, inf) with value = value 341207 + (t - 0) * 0 Found aura with stack = 1 Aura 341207 found on Player-1315-05C8DCE1 with (317511.389, 317512.11) [stacks=1] [661] condition 'buffpresent' returns 317511.389, 317512.11, nil, nil, nil [661] <<< 'buffpresent(dark_thought)' returns (317511.389, 317512.11) with value = none [673] >>> Returning for 'dots_up()' cached value none at empty set [674] logical 'and' returns empty set [674] <<< 'logical' returns empty set with value = none [551] 'logical' will trigger short-circuit evaluation of parent node [677] with zero-measure time span. [677] >>> Computing 'if' at time=317520.842000 [674] >>> Returning for 'logical' cached value none at empty set [677] 'if' returns empty set with zero measure [677] <<< 'if' returns empty set with value = action spell 15407 [681] >>> Computing 'casttime(mind_blast)' at time=317520.842000 [680] >>> Computing 'mind_blast' at time=317520.842000 [680] value is 8092 [680] <<< 'mind_blast' returns (0, inf) with value = value 8092 + (t - 0) * 0 [681] condition 'casttime' returns 0, inf, 1.317, 0, 0 [681] <<< 'casttime(mind_blast)' returns (0, inf) with value = value 1.317 + (t - 0) * 0 [683] >>> Computing 'arithmetic' at time=317520.842000 [681] >>> Returning for 'casttime(mind_blast)' cached value value 1.317 + (t - 0) * 0 at (0, inf) [683] 1.317+(t-0)*0 + 0.5+(t-0)*0 [683] arithmetic '+' returns 1.817+(t-317520.842)*0 [683] <<< 'arithmetic' returns (0, inf) with value = value 1.817 + (t - 317520.842) * 0 [684] >>> Computing 'compare' at time=317520.842000 [683] >>> Returning for 'arithmetic' cached value value 1.817 + (t - 317520.842) * 0 at (0, inf) [684] 600+(t-0)*0 > 1.817+(t-317520.842)*0 [684] compare '>' returns (0, inf) [684] <<< 'compare' returns (0, inf) with value = none [685] >>> Computing 'logical' at time=317520.842000 [673] >>> Returning for 'dots_up()' cached value none at empty set [685] logical 'and' short-circuits with zero measure left argument [685] logical 'and' returns empty set [685] <<< 'logical' returns empty set with value = none [551] 'logical' will trigger short-circuit evaluation of parent node [688] with zero measure. [688] >>> Computing 'logical' at time=317520.842000 [685] >>> Returning for 'logical' cached value none at empty set [688] logical 'and' short-circuits with zero measure left argument [688] logical 'and' returns empty set [688] <<< 'logical' returns empty set with value = none [551] 'logical' will trigger short-circuit evaluation of parent node [691] with zero-measure time span. [691] >>> Computing 'if' at time=317520.842000 [688] >>> Returning for 'logical' cached value none at empty set [691] 'if' returns empty set with zero measure [691] <<< 'if' returns empty set with value = action spell 8092 [694] >>> Computing 'target.refreshable(vampiric_touch)' at time=317520.842000 [692] >>> Computing 'vampiric_touch' at time=317520.842000 [692] value is 34914 [692] <<< 'vampiric_touch' returns (0, inf) with value = value 34914 + (t - 0) * 0 Found aura with stack = 1 Aura 34914 found on Creature-0-3770-0-5276-153292-0000548E1B with (317492.823, 317516.741) [stacks=1] [694] condition 'refreshable' returns 317510.441, inf, nil, nil, nil [694] <<< 'target.refreshable(vampiric_touch)' returns (317510.441, inf) with value = none [696] >>> Computing 'target.timetodie()' at time=317520.842000 [696] condition 'timetodie' returns 317520.842, inf, 1011.4330997943, 317520.842, -1 [696] <<< 'target.timetodie()' returns (317520.842, inf) with value = value 1011.4330997943 + (t - 317520.842) * -1 [697] >>> Computing 'compare' at time=317520.842000 [696] >>> Returning for 'target.timetodie()' cached value value 1011.4330997943 + (t - 317520.842) * -1 at (317520.842, inf) [697] 1011.4330997943+(t-317520.842)*-1 > 6+(t-0)*0 [697] intersection at t = 318526.27509979 [697] compare '>' returns (317520.842, 318526.27509979) [697] <<< 'compare' returns (317520.842, 318526.27509979) with value = none [698] >>> Computing 'logical' at time=317520.842000 [694] >>> Returning for 'target.refreshable(vampiric_touch)' cached value none at (317510.441, inf) [697] >>> Returning for 'compare' cached value none at (317520.842, 318526.27509979) [698] logical 'and' returns (317520.842, 318526.27509979) [698] <<< 'logical' returns (317520.842, 318526.27509979) with value = none [700] >>> Computing 'hastalent(misery_talent)' at time=317520.842000 [699] >>> Computing 'misery_talent' at time=317520.842000 [699] value is 23126 [699] <<< 'misery_talent' returns (0, inf) with value = value 23126 + (t - 0) * 0 [700] condition 'hastalent' returns 0, inf, nil, nil, nil [700] <<< 'hastalent(misery_talent)' returns (0, inf) with value = none [704] >>> Returning for 'target.debuffrefreshable(shadow_word_pain)' cached value none at (317508.168, inf) [705] >>> Computing 'logical' at time=317520.842000 [700] >>> Returning for 'hastalent(misery_talent)' cached value none at (0, inf) [704] >>> Returning for 'target.debuffrefreshable(shadow_word_pain)' cached value none at (317508.168, inf) [705] logical 'and' returns (317508.168, inf) [705] <<< 'logical' returns (317508.168, inf) with value = none [706] >>> Computing 'logical' at time=317520.842000 [698] >>> Returning for 'logical' cached value none at (317520.842, 318526.27509979) [705] >>> Returning for 'logical' cached value none at (317508.168, inf) [706] logical 'or' returns (317508.168, inf) [706] <<< 'logical' returns (317508.168, inf) with value = none [713] >>> Computing 'buffpresent(unfurling_darkness)' at time=317520.842000 computing positional parameters [707] >>> Computing 'unfurling_darkness' at time=317520.842000 [707] value is 341291 [707] <<< 'unfurling_darkness' returns (0, inf) with value = value 341291 + (t - 0) * 0 Aura 341291 is missing on Player-1315-05C8DCE1 (mine=true). [713] condition 'buffpresent' returns nil, nil, nil, nil, nil [713] <<< 'buffpresent(unfurling_darkness)' returns empty set with value = none [714] >>> Computing 'logical' at time=317520.842000 [706] >>> Returning for 'logical' cached value none at (317508.168, inf) [713] >>> Returning for 'buffpresent(unfurling_darkness)' cached value none at empty set [714] logical 'or' returns (317508.168, inf) [714] <<< 'logical' returns (317508.168, inf) with value = none [476] >>> Computing 'spell(vampiric_touch)' at time=317520.842000 [476] evaluating action: spell() [475] >>> Computing 'vampiric_touch' at time=317520.842000 [475] value is 34914 [475] <<< 'vampiric_touch' returns (0, inf) with value = value 34914 + (t - 0) * 0 Found spell info about 34914 (isKnown = true) Spell has cost of %d for %s Spell has cost of -500 for insanity Spell has cost of -500 for insanity Spell has cost of %d for %s Spell ID '34914' passed power requirements. OvaleSpells:IsUsableSpell(34914, 317520.842000, Creature-0-3770-0-5276-153292-0000548E1B) returned true, false Didn't find an existing cd in next, look for one in current Call GetSpellCooldown which returned 0.000000, 0.000000, 1 It returned -0.100000, 0.000000 Spell cooldown is in the past Cooldown of spell 34914 is 0.000000 + 0.000000 GetSpellCooldown returned 0.000000, 0.000000 Spell cooldown is in the past Cooldown of spell 34914 is 0.000000 + 0.000000 [476] Action spell still has 0.000000 charges but is on GCD (start=0.000000). [476] start=0.000000 atTime=317520.842000 [476] Action spell is waiting for the global cooldown. [476] Action spell can start at 0.000000. [476] <<< 'spell(vampiric_touch)' returns (0, inf) with value = action spell 34914 [717] >>> Computing 'if' at time=317520.842000 [714] >>> Returning for 'logical' cached value none at (317508.168, inf) [476] >>> Returning for 'spell(vampiric_touch)' cached value action spell 34914 at (0, inf) [717] 'if' returns (317508.168, inf) (intersection of (317508.168, inf) and (0, inf)) [717] <<< 'if' returns (317508.168, inf) with value = action spell 34914 [720] >>> Computing 'target.refreshable(shadow_word_pain)' at time=317520.842000 [718] >>> Computing 'shadow_word_pain' at time=317520.842000 [718] value is 589 [718] <<< 'shadow_word_pain' returns (0, inf) with value = value 589 + (t - 0) * 0 Found aura with stack = 1 Aura 589 found on Creature-0-3770-0-5276-153292-0000548E1B with (317492.77, 317511.768) [stacks=1] [720] condition 'refreshable' returns 317508.168, inf, nil, nil, nil [720] <<< 'target.refreshable(shadow_word_pain)' returns (317508.168, inf) with value = none [723] >>> Computing 'compare' at time=317520.842000 [696] >>> Returning for 'target.timetodie()' cached value value 1011.4330997943 + (t - 317520.842) * -1 at (317520.842, inf) [723] 1011.4330997943+(t-317520.842)*-1 > 4+(t-0)*0 [723] intersection at t = 318528.27509979 [723] compare '>' returns (317520.842, 318528.27509979) [723] <<< 'compare' returns (317520.842, 318528.27509979) with value = none [724] >>> Computing 'logical' at time=317520.842000 [720] >>> Returning for 'target.refreshable(shadow_word_pain)' cached value none at (317508.168, inf) [723] >>> Returning for 'compare' cached value none at (317520.842, 318528.27509979) [724] logical 'and' returns (317520.842, 318528.27509979) [724] <<< 'logical' returns (317520.842, 318528.27509979) with value = none [727] >>> Computing 'logical' at time=317520.842000 [700] >>> Returning for 'hastalent(misery_talent)' cached value none at (0, inf) [727] logical 'not' returns empty set [727] <<< 'logical' returns empty set with value = none [728] >>> Computing 'logical' at time=317520.842000 [724] >>> Returning for 'logical' cached value none at (317520.842, 318528.27509979) [727] >>> Returning for 'logical' cached value none at empty set [728] logical 'and' returns empty set [728] <<< 'logical' returns empty set with value = none [551] 'logical' will trigger short-circuit evaluation of parent node [731] with zero measure. [731] >>> Computing 'logical' at time=317520.842000 [728] >>> Returning for 'logical' cached value none at empty set [731] logical 'and' short-circuits with zero measure left argument [731] logical 'and' returns empty set [731] <<< 'logical' returns empty set with value = none [551] 'logical' will trigger short-circuit evaluation of parent node [734] with zero measure. [734] >>> Computing 'logical' at time=317520.842000 [731] >>> Returning for 'logical' cached value none at empty set [734] logical 'and' short-circuits with zero measure left argument [734] logical 'and' returns empty set [734] <<< 'logical' returns empty set with value = none [551] 'logical' will trigger short-circuit evaluation of parent node [737] with zero-measure time span. [737] >>> Computing 'if' at time=317520.842000 [734] >>> Returning for 'logical' cached value none at empty set [737] 'if' returns empty set with zero measure [737] <<< 'if' returns empty set with value = none [743] >>> Computing 'compare' at time=317520.842000 [696] >>> Returning for 'target.timetodie()' cached value value 1011.4330997943 + (t - 317520.842) * -1 at (317520.842, inf) [743] 1011.4330997943+(t-317520.842)*-1 > 4+(t-0)*0 [743] intersection at t = 318528.27509979 [743] compare '>' returns (317520.842, 318528.27509979) [743] <<< 'compare' returns (317520.842, 318528.27509979) with value = none [744] >>> Computing 'logical' at time=317520.842000 [720] >>> Returning for 'target.refreshable(shadow_word_pain)' cached value none at (317508.168, inf) [743] >>> Returning for 'compare' cached value none at (317520.842, 318528.27509979) [744] logical 'and' returns (317520.842, 318528.27509979) [744] <<< 'logical' returns (317520.842, 318528.27509979) with value = none [747] >>> Computing 'logical' at time=317520.842000 [700] >>> Returning for 'hastalent(misery_talent)' cached value none at (0, inf) [747] logical 'not' returns empty set [747] <<< 'logical' returns empty set with value = none [748] >>> Computing 'logical' at time=317520.842000 [744] >>> Returning for 'logical' cached value none at (317520.842, 318528.27509979) [747] >>> Returning for 'logical' cached value none at empty set [748] logical 'and' returns empty set [748] <<< 'logical' returns empty set with value = none [551] 'logical' will trigger short-circuit evaluation of parent node [758] with zero measure. [758] >>> Computing 'logical' at time=317520.842000 [748] >>> Returning for 'logical' cached value none at empty set [758] logical 'and' short-circuits with zero measure left argument [758] logical 'and' returns empty set [758] <<< 'logical' returns empty set with value = none [551] 'logical' will trigger short-circuit evaluation of parent node [769] with zero measure. [769] >>> Computing 'logical' at time=317520.842000 [758] >>> Returning for 'logical' cached value none at empty set [769] logical 'and' short-circuits with zero measure left argument [769] logical 'and' returns empty set [769] <<< 'logical' returns empty set with value = none [551] 'logical' will trigger short-circuit evaluation of parent node [772] with zero-measure time span. [772] >>> Computing 'if' at time=317520.842000 [769] >>> Returning for 'logical' cached value none at empty set [772] 'if' returns empty set with zero measure [772] <<< 'if' returns empty set with value = none [775] >>> Computing 'compare' at time=317520.842000 [326] >>> Returning for 'enemies()' cached value value 1 + (t - 0) * 0 at (0, inf) [775] 1+(t-0)*0 > 1+(t-0)*0 [775] compare '>' returns empty set [775] <<< 'compare' returns empty set with value = none [551] 'compare' will trigger short-circuit evaluation of parent node [778] with zero-measure time span. [778] >>> Computing 'if' at time=317520.842000 [775] >>> Returning for 'compare' cached value none at empty set [778] 'if' returns empty set with zero measure [778] <<< 'if' returns empty set with value = none [573] >>> Computing 'group' at time=317520.842000 [573] group checking child [599-[if]] [599] >>> Returning for 'if' cached value none at empty set [573] group checking child [599-[if]] result: empty set [573] child [599] measure is 0, skipping [573] group checking child [615-[if]] [615] >>> Returning for 'if' cached value action spell 205448 at empty set [573] group checking child [615-[if]] result: empty set [573] child [615] measure is 0, skipping [573] group checking child [640-[if]] [640] >>> Returning for 'if' cached value action spell 335467 at (0, 317593.896) [573] group checking child [640-[if]] result: (317520.842, 317593.896) [573] group first best is [640-[if]]: (317520.842, 317593.896) [573] group checking child [651-[if]] [651] >>> Returning for 'if' cached value action spell 205448 at empty set [573] group checking child [651-[if]] result: (317520.842, 317593.896) [573] group new best is [651-[if]]: empty set [573] group checking child [665-[if]] [665] >>> Returning for 'if' cached value none at empty set [573] group checking child [665-[if]] result: (317520.842, 317593.896) [573] group best is still action spell 205448: (317520.842, 317593.896) [573] group checking child [677-[if]] [677] >>> Returning for 'if' cached value action spell 15407 at empty set [573] group checking child [677-[if]] result: (317520.842, 317593.896) [573] group best is still action spell 205448: (317520.842, 317593.896) [573] group checking child [691-[if]] [691] >>> Returning for 'if' cached value action spell 8092 at empty set [573] group checking child [691-[if]] result: (317520.842, 317593.896) [573] group best is still action spell 205448: (317520.842, 317593.896) [573] group checking child [717-[if]] [717] >>> Returning for 'if' cached value action spell 34914 at (317508.168, inf) [573] group checking child [717-[if]] result: (317520.842, inf) [573] group best is still action spell 205448: (317520.842, 317593.896) [573] group checking child [737-[if]] [737] >>> Returning for 'if' cached value none at empty set [573] group checking child [737-[if]] result: (317520.842, inf) [573] group best is still action spell 205448: (317520.842, 317593.896) [573] group checking child [772-[if]] [772] >>> Returning for 'if' cached value none at empty set [573] group checking child [772-[if]] result: (317520.842, inf) [573] group best is still action spell 205448: (317520.842, 317593.896) [573] group checking child [778-[if]] [778] >>> Returning for 'if' cached value none at empty set [573] group checking child [778-[if]] result: (317520.842, inf) [573] group best is still action spell 205448: (317520.842, 317593.896) [573] group checking child [676-spell(mind_flay)] [676] >>> Computing 'spell(mind_flay)' at time=317520.842000 [676] evaluating action: spell() [675] >>> Computing 'mind_flay' at time=317520.842000 [675] value is 15407 [675] <<< 'mind_flay' returns (0, inf) with value = value 15407 + (t - 0) * 0 Found spell info about 15407 (isKnown = true) Spell has cost of %d for %s Spell has cost of %d for %s Spell has cost of %d for %s Spell has cost of %d for %s Spell ID '15407' passed power requirements. OvaleSpells:IsUsableSpell(15407, 317520.842000, Creature-0-3770-0-5276-153292-0000548E1B) returned true, false Didn't find an existing cd in next, look for one in current Call GetSpellCooldown which returned 0.000000, 0.000000, 1 It returned -0.100000, 0.000000 Spell cooldown is in the past Cooldown of spell 15407 is 0.000000 + 0.000000 GetSpellCooldown returned 0.000000, 0.000000 Spell cooldown is in the past Cooldown of spell 15407 is 0.000000 + 0.000000 [676] Action spell still has 0.000000 charges but is on GCD (start=0.000000). [676] start=0.000000 atTime=317520.842000 [676] Action spell is waiting for the global cooldown. [676] Action spell can start at 0.000000. [676] <<< 'spell(mind_flay)' returns (0, inf) with value = action spell 15407 [573] group checking child [676-spell(mind_flay)] result: (317520.842, inf) [573] group best is still action spell 205448: (317520.842, 317593.896) [573] group checking child [569-spell(shadow_word_pain)] [569] >>> Computing 'spell(shadow_word_pain)' at time=317520.842000 [569] evaluating action: spell() [568] >>> Computing 'shadow_word_pain' at time=317520.842000 [568] value is 589 [568] <<< 'shadow_word_pain' returns (0, inf) with value = value 589 + (t - 0) * 0 Found spell info about 589 (isKnown = true) Spell has cost of %d for %s Spell has cost of -400 for insanity Spell has cost of -400 for insanity Spell has cost of %d for %s Spell ID '589' passed power requirements. OvaleSpells:IsUsableSpell(589, 317520.842000, Creature-0-3770-0-5276-153292-0000548E1B) returned true, false Didn't find an existing cd in next, look for one in current Call GetSpellCooldown which returned 0.000000, 0.000000, 1 It returned -0.100000, 0.000000 Spell cooldown is in the past Cooldown of spell 589 is 0.000000 + 0.000000 GetSpellCooldown returned 0.000000, 0.000000 Spell cooldown is in the past Cooldown of spell 589 is 0.000000 + 0.000000 [569] Action spell still has 0.000000 charges but is on GCD (start=0.000000). [569] start=0.000000 atTime=317520.842000 [569] Action spell is waiting for the global cooldown. [569] Action spell can start at 0.000000. [569] <<< 'spell(shadow_word_pain)' returns (0, inf) with value = action spell 589 [573] group checking child [569-spell(shadow_word_pain)] result: (317520.842, inf) [573] group best is still action spell 205448: (317520.842, 317593.896) [573] group best action remains action spell 205448 at empty set [573] <<< 'group' returns empty set with value = action spell 205448 [783] >>> Computing 'unless' at time=317520.842000 [572] >>> Returning for 'shadowcdsmainpostconditions()' cached value none at empty set [573] >>> Returning for 'group' cached value action spell 205448 at empty set [783] 'unless' returns empty set (intersection of (0, inf) and empty set) [783] <<< 'unless' returns empty set with value = action spell 205448 [551] >>> Computing 'group' at time=317520.842000 [551] group checking child [570-[if]] [570] >>> Returning for 'if' cached value none at empty set [551] group checking child [570-[if]] result: empty set [551] child [570] measure is 0, skipping [551] group checking child [571-shadowcdsmainactions()] [571] >>> Returning for 'shadowcdsmainactions()' cached value none at empty set [551] group checking child [571-shadowcdsmainactions()] result: empty set [551] child [571] measure is 0, skipping [551] group checking child [783-[unless]] [783] >>> Returning for 'unless' cached value action spell 205448 at empty set [551] group checking child [783-[unless]] result: empty set [551] child [783] measure is 0, skipping [551] group no best action returns none at empty set [551] <<< 'group' returns empty set with value = none [2165]: [551] shadowmainmainactions is returning none [2165] <<< 'shadowmainmainactions()' returns empty set with value = none [2166] >>> Computing 'unless' at time=317520.842000 [2163] >>> Returning for 'shadowcwcmainpostconditions()' cached value none at empty set [2165] >>> Returning for 'shadowmainmainactions()' cached value none at empty set [2166] 'unless' returns empty set (intersection of (0, inf) and empty set) [2166] <<< 'unless' returns empty set with value = none [2161] >>> Computing 'group' at time=317520.842000 [2161] group checking child [2162-shadowcwcmainactions()] [2162] >>> Returning for 'shadowcwcmainactions()' cached value action spell 8092 at (317525.008, inf) [2161] group checking child [2162-shadowcwcmainactions()] result: (317525.008, inf) [2161] group first best is [2162-shadowcwcmainactions()]: (317525.008, inf) [2161] group checking child [2166-[unless]] [2166] >>> Returning for 'unless' cached value none at empty set [2161] group checking child [2166-[unless]] result: (317525.008, inf) [2161] group best is still action spell 8092: (317525.008, inf) [2161] group best action remains action spell 8092 at (317525.008, inf) [2161] <<< 'group' returns (317525.008, inf) with value = action spell 8092 [2240]: [2161] shadow_defaultmainactions is returning action spell 8092 [2240] <<< 'shadow_defaultmainactions()' returns (317525.008, inf) with value = action spell 8092 [2235] >>> Computing 'group' at time=317520.842000 [2235] group checking child [2239-[if]] [2239] >>> Returning for 'if' cached value action spell 34914 at empty set [2235] group checking child [2239-[if]] result: empty set [2235] child [2239] measure is 0, skipping [2235] group checking child [2240-shadow_defaultmainactions()] [2240] >>> Returning for 'shadow_defaultmainactions()' cached value action spell 8092 at (317525.008, inf) [2235] group checking child [2240-shadow_defaultmainactions()] result: (317525.008, inf) [2235] group first best is [2240-shadow_defaultmainactions()]: (317525.008, inf) [2235] group best action remains action spell 8092 at (317525.008, inf) [2235] <<< 'group' returns (317525.008, inf) with value = action spell 8092`; test.skip("test icon tool", () => { const [result, iconDump, nodeList, logs] = executeDump(dump); assertDefined(result); expect(logs).toBe(expectedLogs); assertIs(result.type, "action"); for (const [k, v] of Object.entries(iconDump.nodes)) { const node = nodeList[parseInt(k)]; if (v.asString === null) expect(node.asString).toBeUndefined(); else expect(node.asString).toBe(v.asString); expect(node.type).toBe(v.type); } for (const [k, v] of Object.entries(iconDump.nodes)) { const node = nodeList[parseInt(k)]; expect(node.result).toEqual(v); } expect(result).toEqual(iconDump.result); });
78.44086
496
0.674519
a834307bc6242ba01bd50beee0409b3587681cfc
1,490
dart
Dart
lib/home/home_movie_cover_view.dart
apollohero/apollo-video-app
11f1184b1f0d7c35039a0e72511cc711ffb83e5c
[ "MIT" ]
null
null
null
lib/home/home_movie_cover_view.dart
apollohero/apollo-video-app
11f1184b1f0d7c35039a0e72511cc711ffb83e5c
[ "MIT" ]
null
null
null
lib/home/home_movie_cover_view.dart
apollohero/apollo-video-app
11f1184b1f0d7c35039a0e72511cc711ffb83e5c
[ "MIT" ]
null
null
null
import 'package:flutter/material.dart'; import 'package:movie_recommend/public.dart'; import '../app/app_color.dart'; class HomeMovieCoverView extends StatelessWidget { final MovieItem movie; HomeMovieCoverView(this.movie); @override Widget build(BuildContext context) { // 单个电影的宽度 // 一行放置 3 个 电影 var width = (Screen.width - 15 * 4) / 3; return GestureDetector( onTap: () { AppNavigator.pushMovieDetail(context, movie); }, child: Container( width: width, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[ MovieCoverImage(movie.images.small, width: width, height: width / 0.75,), SizedBox(height: 5,), Text( movie.title, overflow: TextOverflow.ellipsis, style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold,color: AppColor.white), maxLines: 1, ), SizedBox(height: 3,), Row( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: <Widget>[ new StaticRatingBar(size: 13.0,rate: movie.rating.average/2,), SizedBox(width: 5,), Text(movie.rating.average.toString(),style: TextStyle(color: AppColor.white, fontSize: 12.0),) ], ), ], ), ), ); } }
29.215686
110
0.569799
fd96ed25e5c2d9a812ca2a96727d8df322271199
2,225
css
CSS
openbacteria/laboratory/static/laboratory/openbacteria/laboratory/static/laboratory/estilo_laboratorio.css
TheOpenBacteriaProject/webapp
e4ffa08868ef0c059346bc90f43c71b3cd446885
[ "Apache-2.0" ]
1
2018-06-12T18:00:40.000Z
2018-06-12T18:00:40.000Z
openbacteria/laboratory/static/laboratory/openbacteria/laboratory/static/laboratory/estilo_laboratorio.css
TheOpenBacteriaProject/webapp
e4ffa08868ef0c059346bc90f43c71b3cd446885
[ "Apache-2.0" ]
11
2017-12-04T17:59:04.000Z
2018-04-30T11:05:44.000Z
openbacteria/laboratory/static/laboratory/openbacteria/laboratory/static/laboratory/estilo_laboratorio.css
TheOpenBacteriaProject/webapp
e4ffa08868ef0c059346bc90f43c71b3cd446885
[ "Apache-2.0" ]
null
null
null
input[type=text] {padding:0; border:0 solid #ccc; -webkit-border-radius: 5px; border-radius: 5px; } input[type=text]:focus {border-color:#333; } input[type=submit] {padding:0; background:#ccc; border:0 none; cursor:pointer; -webkit-border-radius: 5px; border-radius: 5px; } .parent { position: relative; top: 0; left: 0; } .image1 { position: relative; top: 0; left: 0; } .image2 { position: absolute; top:0; left:230px; } .ajustar_input{ text-align: right; font-size: 13px; } .dropbtn { background-color: #4CAF50; color: white; padding: 16px; font-size: 16px; border: none; } .dropdown { position: relative; display: inline-block; } .dropdown-content { display: none; position: absolute; background-color: #f1f1f1; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1; } .dropdown-content a { color: black; padding: 12px 16px; text-decoration: none; display: block; } .dropdown-content a:hover {background-color: #ddd} .dropdown:hover .dropdown-content { display: block; } .dropdown:hover .dropbtn { background-color: #3e8e41; } /* Remove the navbar's default margin-bottom and rounded borders */ .navbar { margin-bottom: 0; border-radius: 0; } /* Set height of the grid so .sidenav can be 100% (adjust as needed) */ .row.content {height: 450px} /* Set gray background color and 100% height */ .sidenav { padding-top: 18px; background-color: #f1f1f1; height: 100%; } /* Set black background color, white text and some padding */ footer { background-color: #555; color: white; padding: 15px; } /* On small screens, set height to 'auto' for sidenav and grid */ @media screen and (max-width: 767px) { .sidenav { height: auto; padding: 15px; } .row.content {height:auto;} } button { background: transparent; border: none !important; }
19.347826
75
0.562247
6621d1499ab80ddc6b2cb7b324668bc31890978b
2,778
py
Python
hydroDL/app/waterQuality/wqLoad.py
fkwai/geolearn
30cb4353d22af5020a48100d07ab04f465a315b0
[ "MIT" ]
null
null
null
hydroDL/app/waterQuality/wqLoad.py
fkwai/geolearn
30cb4353d22af5020a48100d07ab04f465a315b0
[ "MIT" ]
null
null
null
hydroDL/app/waterQuality/wqLoad.py
fkwai/geolearn
30cb4353d22af5020a48100d07ab04f465a315b0
[ "MIT" ]
2
2021-04-04T02:45:59.000Z
2022-03-19T09:41:39.000Z
import numpy as np import os import pandas as pd import json from hydroDL.master import basins from hydroDL import kPath, utils from hydroDL.app import waterQuality # adhoc codes to simplify current scripts def loadModel(siteNoLst, outNameLSTM, codeLst): # load all sequence # LSTM dictLSTM = dict() for k, siteNo in enumerate(siteNoLst): print('\t LSTM site {}/{}'.format(k, len(siteNoLst)), end='\r') df = basins.loadSeq(outNameLSTM, siteNo) dictLSTM[siteNo] = df # WRTDS dictWRTDS = dict() dirWRTDS = os.path.join(kPath.dirWQ, 'modelStat', 'WRTDS-W', 'B10') for k, siteNo in enumerate(siteNoLst): print('\t WRTDS site {}/{}'.format(k, len(siteNoLst)), end='\r') saveFile = os.path.join(dirWRTDS, siteNo) df = pd.read_csv(saveFile, index_col=None).set_index('date') # df = utils.time.datePdf(df) dictWRTDS[siteNo] = df # Observation dictObs = dict() for k, siteNo in enumerate(siteNoLst): print('\t USGS site {}/{}'.format(k, len(siteNoLst)), end='\r') df = waterQuality.readSiteTS( siteNo, varLst=['00060']+codeLst, freq='W', rmFlag=True) dictObs[siteNo] = df return dictLSTM, dictWRTDS, dictObs, def dictErr(dictLSTM, dictWRTDS, dictObs, codeLst): # calculate correlation tt = np.datetime64('2010-01-01') t0 = np.datetime64('1980-01-01') siteNoLst = list(dictObs.keys()) # codeLst = dictObs[siteNoLst[0]].columns.tolist() t = dictObs[siteNoLst[0]].index.values ind1 = np.where((t < tt) & (t >= t0))[0] ind2 = np.where(t >= tt)[0] corrMat = np.full([len(siteNoLst), len(codeLst), 3], np.nan) rmseMat = np.full([len(siteNoLst), len(codeLst), 3], np.nan) for ic, code in enumerate(codeLst): for siteNo in siteNoLst: indS = siteNoLst.index(siteNo) v1 = dictLSTM[siteNo][code].iloc[ind2].values v2 = dictWRTDS[siteNo][code].iloc[ind2].values v3 = dictObs[siteNo][code].iloc[ind2].values dfQ1 = dictObs[siteNo][['00060', code]].iloc[ind1].dropna() (vv1, vv2, vv3), indV = utils.rmNan([v1, v2, v3]) if (len(indV) < 50) or (len(dfQ1) < 50): # print(code, siteNo) pass else: rmse1, corr1 = utils.stat.calErr(vv1, vv2) rmse2, corr2 = utils.stat.calErr(vv1, vv3) rmse3, corr3 = utils.stat.calErr(vv2, vv3) corrMat[indS, ic, 0] = corr1 corrMat[indS, ic, 1] = corr2 corrMat[indS, ic, 2] = corr3 rmseMat[indS, ic, 0] = rmse1 rmseMat[indS, ic, 1] = rmse2 rmseMat[indS, ic, 2] = rmse3 return corrMat, rmseMat
38.583333
72
0.584593
fa7abda8b5547f98731651bef417a02372a31638
17,166
cpp
C++
caff-parser/parser.cpp
gurubib/pangolin-webshop
35e109b355c9824a203f10df1340ec0bec513c44
[ "MIT" ]
null
null
null
caff-parser/parser.cpp
gurubib/pangolin-webshop
35e109b355c9824a203f10df1340ec0bec513c44
[ "MIT" ]
6
2020-09-22T17:05:18.000Z
2020-11-14T22:29:54.000Z
caff-parser/parser.cpp
gurubib/pangolin-webshop
35e109b355c9824a203f10df1340ec0bec513c44
[ "MIT" ]
null
null
null
#include <iostream> #include <fstream> #include <vector> #include <regex> #include <Magick++.h> // Reasonable upper values #define MAX_FILE_SIZE 1000000000 // 1 GB #define MAX_CREATOR_LEN 10001 // 10000 Chars + '\0' #define MAX_CAPTION_SIZE 10001 // 10000 Chars + '\0' #define MAX_NUMER_OF_ANIMATIONS 1000000 // Reasonable? #define MAX_DURATION_LENGTH 6000 // 1 Minute #define MAX_CIFF_HEADER_SIZE 100000 // Meta + Caption + Tags #define MAX_CIFF_CONTENT_SIZE 30000000 // Allows for 10.000.000 pixels in an image #define MAX_TAGS_LENGTH 10000 // 10000 Chars altogether, including the '\0'-s // Block IDs #define CAFF_HEADER 0x1 #define CAFF_CREDITS 0x2 #define CAFF_ANIMATION 0x3 // The actual file size unsigned int FILE_SIZE = 0; using namespace std; using namespace Magick; int64_t parseInt64(char bytes[8]) { int64_t value = 0; for (int i = 0; i < 8; i++) { value = value | (unsigned char)(bytes[i]) << (i * 8); } return value; } struct Pixel { int R; int G; int B; Pixel(char R, char G, char B) { this->R = (unsigned char)R; this->G = (unsigned char)G; this->B = (unsigned char)B; } }; struct Header { int64_t header_size; int64_t num_anim; void print() { // For testing purposes only! cout << "--- HEADER ---" << endl; cout << "Size: " << header_size << ", Anim: " << num_anim << endl << endl; } void parse(char *input_buffer, unsigned int &bytes_read) { char integer_of_8_bytes[8]; // Header Magic if (bytes_read + 4 > FILE_SIZE) { cerr << "Error, unexpectedly reached EOF!"; exit(1); } char magic_value[4 + 1]; strncpy(magic_value, input_buffer + bytes_read, sizeof(magic_value)); magic_value[4] = '\0'; bytes_read += 4; if (strcmp(magic_value, "CAFF") != 0) { cerr << "Incorrect magic value!"; exit(1); } // Header Size if (bytes_read + sizeof(integer_of_8_bytes) > FILE_SIZE) { cerr << "Error, unexpectedly reached EOF!"; exit(1); } strncpy(integer_of_8_bytes, input_buffer + bytes_read, sizeof(integer_of_8_bytes)); header_size = parseInt64(integer_of_8_bytes); bytes_read += 8; if (header_size != 20) { // Header should be exactly 4 + 8 + 8 bytes long! cerr << "Incorrect header format!"; exit(1); } // Num Anim if (bytes_read + sizeof(integer_of_8_bytes) > FILE_SIZE) { cerr << "Error, unexpectedly reached EOF!"; exit(1); } strncpy(integer_of_8_bytes, input_buffer + bytes_read, sizeof(integer_of_8_bytes)); num_anim = parseInt64(integer_of_8_bytes); bytes_read += 8; if (num_anim >= MAX_NUMER_OF_ANIMATIONS) { cerr << "The number of animation blocks should be less than " << MAX_NUMER_OF_ANIMATIONS << "!"; exit(1); } } }; struct Credits { int year; int month; int day; int hour; int minute; char creator[MAX_CREATOR_LEN]; void print() { // For testing purposes only! cout << "--- CREDITS ---" << endl; cout << "Date: " << year << "." << month << "." << day << " " << hour << ":" << minute << endl; cout << "Creator: " << creator << endl << endl; } void parse(char *input_buffer, unsigned int &bytes_read) { char integer_of_8_bytes[8]; // Checking for EOF in case of YYMDhm together. if (bytes_read + 6 > FILE_SIZE) { cerr << "Error, unexpectedly reached EOF!"; exit(1); } // Credits Year year = (unsigned char)(input_buffer[bytes_read]) | (unsigned char)(input_buffer[bytes_read + 1]) << 8; bytes_read += 2; // Credits Month month = input_buffer[bytes_read]; bytes_read += 1; // Credits Day day = input_buffer[bytes_read]; bytes_read += 1; // Credits Hour hour = input_buffer[bytes_read]; bytes_read += 1; // Credits Minute minute = input_buffer[bytes_read]; bytes_read += 1; // Creator Len if (bytes_read + sizeof(integer_of_8_bytes) > FILE_SIZE) { cerr << "Error, unexpectedly reached EOF!"; exit(1); } int64_t creator_len; strncpy(integer_of_8_bytes, input_buffer + bytes_read, sizeof(integer_of_8_bytes)); creator_len = parseInt64(integer_of_8_bytes); bytes_read += 8; if (creator_len >= MAX_CREATOR_LEN - 1) { // Space for the '\0'! cerr << "The length of the creator should be less than " << MAX_CREATOR_LEN - 1 << " characters!"; exit(1); } // Creator if (bytes_read + creator_len > FILE_SIZE) { cerr << "Error, unexpectedly reached EOF!"; exit(1); } strncpy(creator, input_buffer + bytes_read, creator_len); creator[creator_len] = '\0'; bytes_read += creator_len; } }; struct Animation { int64_t duration; int64_t header_size; int64_t content_size; int64_t width; int64_t height; char caption[MAX_CAPTION_SIZE]; vector<string> tags; vector<Pixel> pixels; void print() { // For testing purposes only! cout << "--- ANIMATION ---" << endl; cout << "Duration: " << duration << ", Height: " << height << ", Width: " << width << endl; cout << "Caption: " << caption << endl; for (unsigned int i = 0; i < tags.size(); i++) { cout << "Tag" << i << ": " << tags[i] << endl; } cout << "First 2 Pixels:" << endl; for (unsigned int i = 0; i < pixels.size(); i++) { cout << "RGB(" << pixels[i].R << ", " << pixels[i].G << ", " << pixels[i].B << ")" << endl; if (i == 1) { break; } } cout << endl; } void parse(char *input_buffer, unsigned int &bytes_read) { char integer_of_8_bytes[8]; // Duration if (bytes_read + sizeof(integer_of_8_bytes) > FILE_SIZE) { cerr << "Error, unexpectedly reached EOF!"; exit(1); } strncpy(integer_of_8_bytes, input_buffer + bytes_read, sizeof(integer_of_8_bytes)); duration = parseInt64(integer_of_8_bytes); bytes_read += 8; if (duration >= MAX_DURATION_LENGTH) { cerr << "The duration of an animation should be less than " << MAX_DURATION_LENGTH << "ms!"; exit(1); } // Header Magic if (bytes_read + 4 > FILE_SIZE) { cerr << "Error, unexpectedly reached EOF!"; exit(1); } char magic_value[4 + 1]; strncpy(magic_value, input_buffer + bytes_read, sizeof(magic_value)); magic_value[4] = '\0'; bytes_read += 4; if (strcmp(magic_value, "CIFF") != 0) { cerr << "Incorrect magic value!"; exit(1); } // Header Size if (bytes_read + sizeof(integer_of_8_bytes) > FILE_SIZE) { cerr << "Error, unexpectedly reached EOF!"; exit(1); } strncpy(integer_of_8_bytes, input_buffer + bytes_read, sizeof(integer_of_8_bytes)); header_size = parseInt64(integer_of_8_bytes); bytes_read += 8; // TODO: Max Header Size? if (header_size >= MAX_CIFF_HEADER_SIZE) { cerr << "The size of the CIFF header should be less than " << MAX_CIFF_HEADER_SIZE << " bytes!"; exit(1); } // Content Size if (bytes_read + sizeof(integer_of_8_bytes) > FILE_SIZE) { cerr << "Error, unexpectedly reached EOF!"; exit(1); } strncpy(integer_of_8_bytes, input_buffer + bytes_read, sizeof(integer_of_8_bytes)); content_size = parseInt64(integer_of_8_bytes); bytes_read += 8; // TODO: Max Content Size? if (header_size >= MAX_CIFF_CONTENT_SIZE) { cerr << "The size of the CIFF content should be less than " << MAX_CIFF_CONTENT_SIZE << " bytes!"; exit(1); } // Width if (bytes_read + sizeof(integer_of_8_bytes) > FILE_SIZE) { cerr << "Error, unexpectedly reached EOF!"; exit(1); } strncpy(integer_of_8_bytes, input_buffer + bytes_read, sizeof(integer_of_8_bytes)); width = parseInt64(integer_of_8_bytes); bytes_read += 8; // Height if (bytes_read + sizeof(integer_of_8_bytes) > FILE_SIZE) { cerr << "Error, unexpectedly reached EOF!"; exit(1); } strncpy(integer_of_8_bytes, input_buffer + bytes_read, sizeof(integer_of_8_bytes)); height = parseInt64(integer_of_8_bytes); bytes_read += 8; // This also verifies that if the width or the height is 0, then no pixels are present. if (content_size != width*height*3) { cerr << "Incorrect animation content size!"; exit(1); } // Caption int caption_size = 0; for (int i = 0; i < header_size; i++) { if (bytes_read + i >= FILE_SIZE) { cerr << "Error, unexpectedly reached EOF!"; exit(1); } if (input_buffer[bytes_read + i] == '\n') { caption_size = i; break; } // If there's no '\n' within header_size characters, then there's no caption. } if (caption_size >= MAX_CAPTION_SIZE - 1) { // Space for the '\0'! cerr << "The length of the caption should be less than " << MAX_CAPTION_SIZE - 1 << " characters!"; exit(1); } if (bytes_read + caption_size > FILE_SIZE) { cerr << "Error, unexpectedly reached EOF!"; exit(1); } strncpy(caption, input_buffer + bytes_read, caption_size); caption[caption_size] = '\0'; bytes_read += caption_size; if (caption_size != 0) { bytes_read += 1; // Skip the '\n' because we didn't copy it! } // Tags int tag_number = 0; for (int i = 0; i < header_size; i++) { if (bytes_read + i >= FILE_SIZE) { cerr << "Error, unexpectedly reached EOF!"; exit(1); } if (input_buffer[bytes_read + i] == '\0') { tag_number++; } } for (int i = 0; i < tag_number; i++) { int tag_size = 0; for (int j = 0; j < header_size; j++) { if (bytes_read + j >= FILE_SIZE) { cerr << "Error, unexpectedly reached EOF!"; exit(1); } if (input_buffer[bytes_read + j] == '\0') { tag_size = j; char tag[tag_size + 1]; strncpy(tag, input_buffer + bytes_read, tag_size + 1); // We copy the '\0'-s also! tags.push_back(tag); bytes_read += tag_size + 1; break; } } } // Pixels int i = 0; while (i < content_size - 2) { if (bytes_read + i >= FILE_SIZE || bytes_read + i + 1 >= FILE_SIZE || bytes_read + i + 2>= FILE_SIZE) { cerr << "Error, unexpectedly reached EOF!"; exit(1); } Pixel pixel(input_buffer[bytes_read + i], input_buffer[bytes_read + i + 1], input_buffer[bytes_read + i + 2]); pixels.push_back(pixel); i += 3; } bytes_read += content_size; } }; int main(int argc, char *argv[]) { if (argc < 2) { cerr << "File name not provided!"; exit(1); } if (argc > 2) { cerr << "Too many arguments provided!"; exit(1); } string file_name = argv[1]; if (!regex_match(file_name, regex("^(.*).caff$"))) { cerr << "Invalid file name!"; exit(1); } ifstream input_file(file_name, ios::in | ios::binary); if (!input_file.good()) { cerr << "File with the given name does not exists!"; exit(1); } input_file.seekg(0, ios::end); FILE_SIZE = input_file.tellg(); input_file.seekg(0, ios::beg); if (FILE_SIZE == 0) { // Well, this is a problem. cerr << "Error, the size of the file size is 0 bytes!"; exit(1); } if (FILE_SIZE >= MAX_FILE_SIZE) { cerr << "File is too large! The size should be less than " << MAX_FILE_SIZE << " bytes!"; exit(1); } char input_buffer[FILE_SIZE]; input_file.read(input_buffer, FILE_SIZE); unsigned int bytes_read = 0; // Counts the number of bytes read so far. // Temp Buffers char block_id; char integer_of_8_bytes[8]; int64_t block_length; /* * Read 1st block (Header) */ // Block ID block_id = input_buffer[0]; bytes_read += 1; if (block_id != CAFF_HEADER) { cerr << "A CAFF file should always start with a header!"; exit(1); } // Block Length if (bytes_read + sizeof(integer_of_8_bytes) > FILE_SIZE) { cerr << "Error, unexpectedly reached EOF!"; exit(1); } strncpy(integer_of_8_bytes, input_buffer + bytes_read, sizeof(integer_of_8_bytes)); block_length = parseInt64(integer_of_8_bytes); if (block_length < 0) { cerr << "The length of a block cannot be negative!"; exit(1); } bytes_read += 8; Header header; header.parse(input_buffer, bytes_read); /* * Read rest of the Blocks (Credits or Animations) */ Credits credits; vector<Animation> animations; bool credits_block_read = false; int animation_blocks_read = 0; // There should be exactly 1 Credits Block and num_anim Animation Blocks left! for (int i = 0; i < header.num_anim + 1; i++) { // Block ID block_id = input_buffer[bytes_read]; bytes_read += 1; // Block Length if (bytes_read + sizeof(integer_of_8_bytes) > FILE_SIZE) { cerr << "Error, unexpectedly reached EOF!"; exit(1); } strncpy(integer_of_8_bytes, input_buffer + bytes_read, sizeof(integer_of_8_bytes)); block_length = parseInt64(integer_of_8_bytes); if (block_length < 0) { cerr << "The length of a block cannot be negative!"; exit(1); } bytes_read += 8; if (block_id == CAFF_CREDITS) { if (credits_block_read) { cerr << "Invalid file format! There should be only one Credits Block!"; exit(1); } credits.parse(input_buffer, bytes_read); credits_block_read = true; } else if (block_id == CAFF_ANIMATION) { Animation animation; animation.parse(input_buffer, bytes_read); animations.push_back(animation); animation_blocks_read++; } else { cerr << "Invalid file format! A header must be followed by a Credits or an Animation Block!"; exit(1); } } if (bytes_read != FILE_SIZE) { cerr << "Invalid file format, EOF was expected but data was found!"; exit(1); } for (unsigned int i = bytes_read; i < FILE_SIZE; i++) { cout << input_buffer[bytes_read]; } if (animation_blocks_read == 0) { cerr << "Invalid file format! There should be at least one Animation Block!"; exit(1); } // PRINT (Debug) cout << "--------------------" << endl << "PARSING SUCCESSFUL:" << endl << "--------------------" << endl << endl; header.print(); credits.print(); for (unsigned int i = 0; i < animations.size(); i++) { animations[i].print(); } /* * Create GIF from animations */ InitializeMagick(nullptr); vector<Image> frames; for (unsigned int i = 0; i < animations.size(); i++) { const unsigned int width_ = animations[i].width; const unsigned int height_ = animations[i].height; std::string map_ = "RGB"; const StorageType type_ = CharPixel; const unsigned int delay_ = animations[i].duration / 10; vector<unsigned char> pixels_; for (unsigned int j = 0; j < width_ * height_; j++){ pixels_.push_back(animations[i].pixels[j].R); pixels_.push_back(animations[i].pixels[j].G); pixels_.push_back(animations[i].pixels[j].B); } const unsigned char *pixelsArray_ = &pixels_[0]; Image frame(width_, height_, map_, type_, pixelsArray_); frame.animationDelay(delay_); frames.push_back(frame); } string gifFileName = file_name + ".gif"; writeImages(frames.begin(), frames.end(), gifFileName); cout << "CAFF parsed to " << gifFileName << endl; return 0; }
30.382301
122
0.545322
d08eb1945ddc8d67756dd8b46458299a852be90b
2,772
sql
SQL
blog.sql
hupozhu/blog
df48757e858ebd5355d231e2ac61ab820ca90c22
[ "Apache-2.0" ]
null
null
null
blog.sql
hupozhu/blog
df48757e858ebd5355d231e2ac61ab820ca90c22
[ "Apache-2.0" ]
null
null
null
blog.sql
hupozhu/blog
df48757e858ebd5355d231e2ac61ab820ca90c22
[ "Apache-2.0" ]
null
null
null
-- SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; -- SET time_zone = "+00:00"; -- -- CREATE TABLE `admin` ( -- `id` INT (10) unsigned NOT NULL COMMENT '用户ID' primary key auto_increment, -- `group_id` INT (11) NOT NULL DEFAULT '1' COMMENT '用户组id', -- `username` CHAR (16) NOT NULL COMMENT '用户名', -- `password` CHAR (32) NOT NULL COMMENT '密码', -- `last_login_time` TIMESTAMP NULL DEFAULT NULL COMMENT '最后登录时间', -- `last_login_ip` text COMMENT '最后登录IP' -- )ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='管理员表'; -- -- INSERT INTO `admin` VALUES (1,1,'sampson','b68a89a9d6a1a538dc8b5ce1a88519f0','2017-05-03 07:58:17','127.0.0.1'); -- -- CREATE TABLE `auth_group`( -- `id` INT (8) unsigned NOT NULL primary key auto_increment, -- `title` CHAR (100) NOT NULL DEFAULT '', -- `status` INT (1) NOT NULL DEFAULT '1' COMMENT '1:启用 0:禁用', -- `rules` text NOT NULL -- )ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='组权限表'; -- -- INSERT INTO `auth_group` VALUES (1,'超级管理员',1,'1,2,3,4,5,6,7,8,9,10'); -- -- CREATE TABLE `auth_group_access` ( -- `id` int(10) unsigned NOT NULL primary key auto_increment, -- `uid` int(11) NOT NULL, -- `group_id` int(11) NOT NULL -- ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='管理员权限对照表'; -- -- INSERT INTO `auth_group_access` VALUES (1, 1, 1); -- -- CREATE TABLE `article_category`( -- `id` INT (8) unsigned NOT NULL primary key auto_increment, -- `pid` INT (8) unsigned NOT NULL DEFAULT 0 COMMENT '上级', -- `name` text NOT NULL COMMENT '目录名称', -- `layered_name` text NOT NULL COMMENT '目录带层级名称', -- `status` int(11) NOT NULL COMMENT '1:开启0:关闭', -- `remark` text NOT NULL COMMENT '备注', -- `count` INT (10) unsigned NOT NULL DEFAULT 0 COMMENT '文章总数', -- `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP -- )ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='文章类型'; -- -- CREATE TABLE `article`( -- `id` INT (8) unsigned NOT NULL primary key auto_increment, -- `category_id` INT (8) unsigned NOT NULL DEFAULT 0 COMMENT '类别id', -- `title` text NOT NULL DEFAULT '' COMMENT '文章标题', -- `brief` text NOT NULL COMMENT '简介', -- `content` text NOT NULL COMMENT '文章内容', -- `remark` text, -- `layered_name` text NOT NULL CONTENT '目录路径' -- `visiter` int(11) NOT NULL DEFAULT '0', -- `status` int(11) NOT NULL COMMENT '1:开启0:关闭', -- `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, -- `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP -- )ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT '文章表'; -- -- ALTER TABLE `admin` -- ADD UNIQUE KEY `username` (`username`), -- ADD KEY `status` (`status`);
46.2
115
0.68254
0d502aabc25447d35ecbb640beaa3c4edba11c09
856
h
C
UITableViewSwipeView.h
MStumpp/UITableViewSwipeView
d1c105b89f0fe9ce61f749c7d9f1db76d2a81f3f
[ "MIT" ]
1
2015-11-20T02:40:02.000Z
2015-11-20T02:40:02.000Z
UITableViewSwipeView.h
MStumpp/UITableViewSwipeView
d1c105b89f0fe9ce61f749c7d9f1db76d2a81f3f
[ "MIT" ]
null
null
null
UITableViewSwipeView.h
MStumpp/UITableViewSwipeView
d1c105b89f0fe9ce61f749c7d9f1db76d2a81f3f
[ "MIT" ]
null
null
null
// // UITableViewSwipeView.h // Ytubeapp // // Created by Matthias Stumpp on 31.12.12. // Copyright (c) 2012 Matthias Stumpp. All rights reserved. // #import <Foundation/Foundation.h> @protocol UITableViewSwipeViewDelegate; @interface UITableViewSwipeView : NSObject - (id)initWithTableView:(UITableView *)tableView delegate:(id<UITableViewSwipeViewDelegate>)delegate; @end @protocol UITableViewSwipeViewDelegate <NSObject> @optional - (BOOL)tableViewSwipeViewCanSwipeLeft:(UITableView *)view rowAtIndexPath:(NSIndexPath *)indexPath; - (void)tableViewSwipeViewDidSwipeLeft:(UITableView *)view rowAtIndexPath:(NSIndexPath *)indexPath; - (BOOL)tableViewSwipeViewCanSwipeRight:(UITableView *)view rowAtIndexPath:(NSIndexPath *)indexPath; - (void)tableViewSwipeViewDidSwipeRight:(UITableView *)view rowAtIndexPath:(NSIndexPath *)indexPath; @end
27.612903
101
0.796729
a35c74de6a66a4485839b8d1cd2250e3927e81e4
2,926
h
C
imperative/src/include/megbrain/imperative/transformations/eval.h
bealwang/MegEngine
df4153dc718b4544e720c58e439a0623c018cee2
[ "Apache-2.0" ]
null
null
null
imperative/src/include/megbrain/imperative/transformations/eval.h
bealwang/MegEngine
df4153dc718b4544e720c58e439a0623c018cee2
[ "Apache-2.0" ]
null
null
null
imperative/src/include/megbrain/imperative/transformations/eval.h
bealwang/MegEngine
df4153dc718b4544e720c58e439a0623c018cee2
[ "Apache-2.0" ]
null
null
null
/** * \file imperative/src/include/megbrain/imperative/eval.h * MegEngine is Licensed under the Apache License, Version 2.0 (the "License") * * Copyright (c) 2014-2021 Megvii Inc. All rights reserved. * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ #pragma once #include "megbrain/imperative/dispatch.h" #include "megbrain/imperative/interpreter.h" #include "megbrain/imperative/ops/autogen.h" #include "megbrain/imperative/utils/helper.h" namespace mgb::imperative { struct InterpreterInfo { public: using Handle = interpreter::Interpreter::Handle; using Channel = interpreter::Interpreter::Channel; private: std::shared_ptr<Handle> m_handle = nullptr; std::string m_name; public: InterpreterInfo() = default; InterpreterInfo(std::shared_ptr<Handle> handle, std::string name = {}) : m_handle(handle), m_name(name) {} std::shared_ptr<Handle> handle() const { return m_handle; } std::string name() const { return m_name; } }; class InterpreterValue final : public MixinValueImpl<InterpreterValue, InterpreterInfo> { public: using MixinValueImpl::MixinValueImpl; std::string to_string() const override { return ssprintf( "Handle{ptr=%p, name=%s}", handle().get(), imperative::quoted(name()).c_str()); } }; /** * \brief interpret operations with interpreter * * This is the most basic and simplest transformation. It read operation requests and * forwards them to interpreter. Not all tensor requests would be handled by it, * some were resolved by CompiledTransformation or LazyEvalTransformation. */ class InterpreterTransformation final : public Transformation { public: using Interpreter = interpreter::Interpreter; using Handle = Interpreter::Handle; using Channel = Interpreter::Channel; private: std::unique_ptr<Channel> m_channel; public: explicit InterpreterTransformation(std::unique_ptr<Channel> channel) : m_channel{std::move(channel)} {} Channel* channel() { return m_channel.get(); } std::vector<ValueRef> apply_transformation( const Operator& op, Span<ValueRef> inputs) override; ValueRef unwrap(ValueRef value) override { mgb_assert(!value.is<InterpreterValue>()); return value; } std::string name() const override { return "InterpreterTransformation"; } std::shared_ptr<Handle> share_handle(Handle handle) { return std::shared_ptr<Handle>( new Handle(handle), [channel = m_channel.get()](Handle* ptr) { if (ptr) { channel->del(*ptr); delete ptr; } }); } }; } // namespace mgb::imperative
30.479167
89
0.672591
439d99235bbf1bb61c09dfb93ac9a580f621dd6d
10,343
tsx
TypeScript
frontend/src/assets/Dashboard/TimeSeries.tsx
Tazer/signoz
d7fa503f049ecdafd3ff7ae6d16b2dc2d615df20
[ "MIT" ]
1
2022-02-28T06:41:49.000Z
2022-02-28T06:41:49.000Z
frontend/src/assets/Dashboard/TimeSeries.tsx
Tazer/signoz
d7fa503f049ecdafd3ff7ae6d16b2dc2d615df20
[ "MIT" ]
7
2021-10-18T16:19:30.000Z
2022-03-30T04:14:59.000Z
frontend/src/assets/Dashboard/TimeSeries.tsx
Tazer/signoz
d7fa503f049ecdafd3ff7ae6d16b2dc2d615df20
[ "MIT" ]
1
2022-03-21T19:47:46.000Z
2022-03-21T19:47:46.000Z
import React from 'react'; const TimeSeries = (props: TimeSeriesProps): JSX.Element => ( <React.Fragment> <svg width="81" height="46" viewBox="0 0 81 46" fill="none" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink" > <rect width="81" height="46" fill="url(#pattern0)" /> <defs> <pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1" > <use xlinkHref="#image0" transform="translate(0 -0.0365149) scale(0.015625 0.0275136)" /> </pattern> <image id="image0" width="64" height="39" xlinkHref="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAnCAYAAAC/mE48AAAMbmlDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnluSkJDQAghICb0J0gkgJYQWQHoRbIQkkFBiTAgqdnRRwbUiIljRVRHFtgJix64sir0vFlSUdVEXGypvQgK67ivfO9839/45c+Y/5c7k3gOA5geuRJKHagGQLy6QJoQHM8akpTNInYAETIA2cAPeXJ5MwoqLiwZQBu9/l3c3AKK4X3VScP1z/r+KDl8g4wGAjIM4ky/j5UN8HAB8LU8iLQCAqNBbTimQKPAciHWlMECIyxU4W4m3K3CmEh8esElKYEN8GQA1KpcrzQZA4x7UMwp52ZBH4zPELmK+SAyA5giIA3hCLh9iRewj8vMnKXAlxHbQXgIxjAcwM7/jzP4bf+YQP5ebPYSVeQ2IWohIJsnjTvs/S/O/JT9PPujDBg6qUBqRoMgf1vBW7qQoBaZC3C3OjIlV1BriDyK+su4AoBShPCJZaY8a82RsWD+gD7ELnxsSBbExxGHivJholT4zSxTGgRjuFnSqqICTBLEBxAsFstBElc1G6aQElS+0IUvKZqn057jSAb8KXw/kucksFf8boYCj4sc0ioRJqRBTILYqFKXEQKwBsbMsNzFKZTOqSMiOGbSRyhMU8VtBnCAQhwcr+bHCLGlYgsq+NF82mC+2USjixKjwvgJhUoSyPtgpHncgfpgLdlkgZiUP8ghkY6IHc+ELQkKVuWPPBeLkRBXPB0lBcIJyLU6R5MWp7HELQV64Qm8BsYesMFG1Fk8pgJtTyY9nSQrikpRx4kU53Mg4ZTz4MhAN2CAEMIAcjkwwCeQAUVt3Yzf8pZwJA1wgBdlAAJxUmsEVqQMzYnhNBEXgD4gEQDa0LnhgVgAKof7LkFZ5dQJZA7OFAytywVOI80EUyIO/5QOrxEPeUsATqBH9wzsXDh6MNw8Oxfy/1w9qv2lYUBOt0sgHPTI0By2JocQQYgQxjGiPG+EBuB8eDa9BcLjhTNxnMI9v9oSnhHbCI8J1Qgfh9kRRsfSHKEeDDsgfpqpF5ve1wG0gpycejPtDdsiM6+NGwAn3gH5YeCD07Am1bFXciqowfuD+WwbfPQ2VHdmFjJKHkYPIdj+u1HDQ8BxiUdT6+/ooY80cqjd7aOZH/+zvqs+H96gfLbGF2H7sLHYCO48dxhoBAzuGNWGt2BEFHtpdTwZ216C3hIF4ciGP6B/+uCqfikrKXOpculw+K+cKBFMLFAePPUkyTSrKFhYwWPDtIGBwxDznEQw3FzdXABTvGuXf19v4gXcIot/6TTfvdwD8j/X39x/6pos8BsBeb3j8D37T2TEB0FYH4NxBnlxaqNThigsB/ktowpNmCEyBJbCD+bgBL+AHgkAoiASxIAmkgQmwykK4z6VgCpgB5oISUAaWgVWgCmwAm8F2sAvsA43gMDgBzoCL4DK4Du7C3dMJXoIe8A70IQhCQmgIHTFEzBBrxBFxQ5hIABKKRCMJSBqSgWQjYkSOzEDmIWXICqQK2YTUInuRg8gJ5DzSjtxGHiJdyBvkE4qhVFQXNUFt0JEoE2WhUWgSOh7NRiejReh8dAlaidagO9EG9AR6Eb2OdqAv0V4MYOqYPmaOOWFMjI3FYulYFibFZmGlWAVWg9VjzfA5X8U6sG7sI07E6TgDd4I7OAJPxnn4ZHwWvhivwrfjDfgp/Cr+EO/BvxJoBGOCI8GXwCGMIWQTphBKCBWErYQDhNPwLHUS3hGJRH2iLdEbnsU0Yg5xOnExcR1xN/E4sZ34mNhLIpEMSY4kf1IsiUsqIJWQ1pB2ko6RrpA6SR/U1NXM1NzUwtTS1cRqxWoVajvUjqpdUXum1kfWIluTfcmxZD55GnkpeQu5mXyJ3Enuo2hTbCn+lCRKDmUupZJSTzlNuUd5q66ubqHuox6vLlKfo16pvkf9nPpD9Y9UHaoDlU0dR5VTl1C3UY9Tb1Pf0mg0G1oQLZ1WQFtCq6WdpD2gfdCgazhrcDT4GrM1qjUaNK5ovNIka1prsjQnaBZpVmju17yk2a1F1rLRYmtxtWZpVWsd1Lqp1atN13bVjtXO116svUP7vPZzHZKOjU6oDl9nvs5mnZM6j+kY3ZLOpvPo8+hb6KfpnbpEXVtdjm6ObpnuLt023R49HT0PvRS9qXrVekf0OvQxfRt9jn6e/lL9ffo39D8NMxnGGiYYtmhY/bArw94bDDcIMhAYlBrsNrhu8MmQYRhqmGu43LDR8L4RbuRgFG80xWi90Wmj7uG6w/2G84aXDt83/I4xauxgnGA83Xizcatxr4mpSbiJxGSNyUmTblN90yDTHNNy06OmXWZ0swAzkVm52TGzFww9BouRx6hknGL0mBubR5jLzTeZt5n3WdhaJFsUW+y2uG9JsWRaZlmWW7ZY9liZWY22mmFVZ3XHmmzNtBZar7Y+a/3extYm1WaBTaPNc1sDW45tkW2d7T07ml2g3WS7Grtr9kR7pn2u/Tr7yw6og6eD0KHa4ZIj6ujlKHJc59g+gjDCZ4R4RM2Im05UJ5ZToVOd00Nnfedo52LnRudXI61Gpo9cPvLsyK8uni55Lltc7rrquEa6Frs2u75xc3DjuVW7XXOnuYe5z3Zvcn/t4egh8FjvccuT7jnac4Fni+cXL28vqVe9V5e3lXeG91rvm0xdZhxzMfOcD8En2Ge2z2Gfj75evgW++3z/9HPyy/Xb4fd8lO0owagtox77W/hz/Tf5dwQwAjICNgZ0BJoHcgNrAh8FWQbxg7YGPWPZs3JYO1mvgl2CpcEHgt+zfdkz2cdDsJDwkNKQtlCd0OTQqtAHYRZh2WF1YT3hnuHTw49HECKiIpZH3OSYcHicWk5PpHfkzMhTUdSoxKiqqEfRDtHS6ObR6OjI0StH34uxjhHHNMaCWE7sytj7cbZxk+MOxRPj4+Kr458muCbMSDibSE+cmLgj8V1ScNLSpLvJdsny5JYUzZRxKbUp71NDUlekdowZOWbmmItpRmmitKZ0UnpK+tb03rGhY1eN7RznOa5k3I3xtuOnjj8/wWhC3oQjEzUncifuzyBkpGbsyPjMjeXWcHszOZlrM3t4bN5q3kt+EL+c3yXwF6wQPMvyz1qR9TzbP3tldpcwUFgh7BaxRVWi1zkRORty3ufG5m7L7c9Lzdudr5afkX9QrCPOFZ+aZDpp6qR2iaOkRNIx2Xfyqsk90ijpVhkiGy9rKtCFH/Wtcjv5T/KHhQGF1YUfpqRM2T9Ve6p4aus0h2mLpj0rCiv6ZTo+nTe9ZYb5jLkzHs5kzdw0C5mVOatltuXs+bM754TP2T6XMjd37m/FLsUriv+alzqveb7J/DnzH/8U/lNdiUaJtOTmAr8FGxbiC0UL2xa5L1qz6Gspv/RCmUtZRdnnxbzFF352/bny5/4lWUvalnotXb+MuEy87MbywOXbV2ivKFrxeOXolQ3ljPLS8r9WTVx1vsKjYsNqymr56o7K6MqmNVZrlq35XCWsul4dXL17rfHaRWvfr+Ovu7I+aH39BpMNZRs+bRRtvLUpfFNDjU1NxWbi5sLNT7ekbDn7C/OX2q1GW8u2ftkm3taxPWH7qVrv2todxjuW1qF18rquneN2Xt4Vsqup3ql+02793WV7wB75nhd7M/be2Be1r2U/c3/9r9a/rj1AP1DagDRMa+hpFDZ2NKU1tR+MPNjS7Nd84JDzoW2HzQ9XH9E7svQo5ej8o/3Hio71Hpcc7z6RfeJxy8SWuyfHnLx2Kv5U2+mo0+fOhJ05eZZ19tg5/3OHz/ueP3iBeaHxotfFhlbP1gO/ef52oM2rreGS96Wmyz6Xm9tHtR+9EnjlxNWQq2euca5dvB5zvf1G8o1bN8fd7LjFv/X8dt7t13cK7/TdnXOPcK/0vtb9igfGD2p+t/99d4dXx5GHIQ9bHyU+uvuY9/jlE9mTz53zn9KeVjwze1b73O354a6wrssvxr7ofCl52ddd8of2H2tf2b369c+gP1t7xvR0vpa+7n+z+K3h221/efzV0hvX++Bd/ru+96UfDD9s/8j8ePZT6qdnfVM+kz5XfrH/0vw16uu9/vz+fglXyh34FMDgQLOyAHizDQBaGgB02LdRxip7wQFBlP3rAAL/CSv7xQHxAqAefr/Hd8Ovm5sA7NkC2y/Irwl71TgaAEk+AHV3HxoqkWW5uym5qLBPITzo738LezbSSgC+LOvv76vp7/+yGQYLe8fjYmUPqhAi7Bk2cr5k5meCfyPK/vS7HH+8A0UEHuDH+78AhB+RBatyf5wAAABWZVhJZk1NACoAAAAIAAGHaQAEAAAAAQAAABoAAAAAAAOShgAHAAAAEgAAAESgAgAEAAAAAQAAAECgAwAEAAAAAQAAACcAAAAAQVNDSUkAAABTY3JlZW5zaG906UURvQAAAdRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDYuMC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6ZXhpZj0iaHR0cDovL25zLmFkb2JlLmNvbS9leGlmLzEuMC8iPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+Mzk8L2V4aWY6UGl4ZWxZRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+NjQ8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpVc2VyQ29tbWVudD5TY3JlZW5zaG90PC9leGlmOlVzZXJDb21tZW50PgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4Kd1qoIQAADORJREFUaAXlWltw1tUR31zJBQIkgVwgTUgQUCwQaosDOkJs0QEJgy2jVZ/q1Ie2j23f67Mz1bHtjA86daTlwRGxhBFjgQgyyiSYcKnUoeQKuZCQACF38v37292z///5fwnYjlgeeobvXHb37G93z57L94WUAIVmKUxM8ekgBCAYjWeluIHKejOsK21AAWbZPFVpAj5AvD9DAoRvAz/VYNlMv6Qkx8VzXuRSInl1znPReNJ6ztsU9kSKEeDcPcJPNVzPTCW55fUTJDKXM8GcSHaFx+CJcCQTGzoyZ8a9xk+P+8FmRq4dPFinzrDBkhHMk4HareJgamFeQAkMOK5wjzMgASryTAKAlWcJCWqqOi/aJNiQ8DA0IxzAXcLfvm27Gur2L6tNZwoblCJGCJIKiaOptH3bNsREDREnwGUpLhE1TlGuV8tEVHZoeCzuRvgyclynU0AiJGbG0ZSnk/y+U8MNyLqYjubZIQGwVWXVcmCxHinoCJpCGrBxfapOUU0SGRayCdLaQAMXZzOPNSThM9mbG2ng2aZeqV+L7zmtsjo/VQYxEFB4LDTmOvF4w/hSlCy7WROFqeF8lWEV/iGnbjLPUf8X+HYwi3lqL+NjJ5oLYo+wUUnR9XQSYqSLiwmgVfJtmE5Ory8nw3DhLaBnAouJFVI5OZnL/buEb5hJ+DieFNBtc4G1SuxhE+RwQgcEo5nM17Usrwjeavs+3gHfdH+b+LoFGClmFMbitHPX9g9kTOyOgWCm+5g8z4z6bjYa14sUsy1c7jI+o8+GH24BBZVaKzjNN0NooC8AoiiLM6PJnE4Q8LMuYhL1X7lKv3v5ZXrzrTch5inxunpjKHdqaooaGhroSv8VVaPqvej52tGfBd9XHRoGG5EBLi4swV1f0oBC/SqrjilzYnwi5FrHdDrNMScTiQS9v/892vHUU3Tt2hB1d/fpNKgbHhmO44PDOg7W1VF7ezt9+OEhkfXxdXK8vhO+SHoHIj9HtFgnZPKetWig9bosOjoySl2XLtGly5epu6cbGcsPIC4GryOtTTnRJ8eOUd68PFpfvZ5qamqovv4QDd8cpta2Vuq+3E1tbRfp1q1bood1nTx5kvr6++iF51+gifFxOnP6rFuyWO44eUa7M766AXukg1vAOjxVixnLrX1VABiGvHqDQ1eptbUV6TgAR+ZSZeUyMaizo4umwdc1U03RM1pD2d3dTaeaTtGOHbWib9X9D9C1oWt0uqWZiotLaOXKlTR/4ULq7OxCEKax6h10/Phx+umzz1FaRjrt3LmTPqr/kMbGxgQgCgF749s9C75jSwNxzaIUeAhKLGYaImjgTjigvt5eugjHJyYmqbS0lCoqymn+/AVyThSXlNJcBKOttR38CT2/2CQ7PIGWmJ6m9/ftoyeffILS4UwPZw4+NY/XUAtWNTs7S6zOX5BPCxfMp/Pnv6R3332Xdu/eTXl5eeJeUVERrVtXTYcO6VYwp6fdLRVeVjD7MnS/8sor1NHRId6Gic0o8FkCga4ssQ2YF+4vEVEOhyEjM4Oqli2jkuJiyspSY1meC0sVFBRQcdEirF4nTU1OyCrdGL5BAwP91NPbQ/vgfO68eZSZkUmXkQlZ2dlUVVlJa9asQSbNo+bmZtHF+PPy5tGx45/S6tUP0tKypW4ZdDG2bN4sGcJbJpGYpsHBQWpvbaPJqUk9N6Glr6+X9u7dS0//+GkqL/9O6K1oQKWaBC7McR2BpS6jNmlHK8gvoNS0NARIJXgCR/yrr74KRefCkbKyMurs6qIrfVdoZHgEUqkw8ip1gbZ7909oxcoVVIlA5ufnwzDVtXXrVjp69CjdYicw44MP/kZLkFUbNvyAurCCnD3mRVpGBm3d+iPav+99YF+gyclJKsL26WzvlCBc6e+nPXv2UG1tLQJc5eapy4KGSlHBQpHvAtrlWneVCdo+ifj+5IAOHz5Mn544QRsffpi2PvGEiHF2VGJlU1P1/GAD/7LnHarF/s3NyQlVsUmSlgArRlbxnBMnPqOMOZl0FQF78WcvSsB5AgdvyZKldBOH5fVr1ygbGCVLSkHvpFX3rxKHikqK6Ny5f9CRvx+mbdu30YoVK0Is80tXVd03fDvldBXZKH+aBM7uAo2isNG9+K9WAJ6l3/7m10hppPh7++SQZH5qdLfIfl2+4j5aXpW8GlDigW2pqaGGTxroUz70nnmW0pBtzC4oyKfCRYvp4sULNDY6RkUlxTh/ltGunbvo9OkWvCn0Gp2emqajR47Q2nXr5GAWO71Kn0GsUf2QpZZhkMBh7ZVwmAjq6uo8RtQdGRkJcMAE7R0dQsS1Fezd+9fgnT3vBJOTUyoIPdgewWuvvRbgTMAt6cihftOnhOnEdNDe3hZcHbjqGHFBbAObELbNLS3BG2+8EVy/fj149dXfB41NjcHNmyPBhQsXAgQrlGPwugPqSyKuNkAG2DK4FXZDixNHzHHCeO7fv5+qq6upvAwHDAqv1jNYtby58+jtt/9MY7ivx8bH6MCBA7Rr1y5cYZkCw3r4R5IzZ89gv/Jdz0UBU3EelJdXUD5WnEuEqfgpbksJ01Xr1qylDJwJr7/+B5wXD9ND33uIcnNzqLikBO+TS+F1yScbHzeG7+t3P4iwYZwUIirqU3AAeCcC7utBWrAwnxqbmmjk5ihtqdnizIBa/OP5tbU76fCRw/TWm29RYWE+rV27hsqWljk5NHgnnMJpz84cQ7rzDbB48WI5TGfD19i4FVHztRZPoA+s559/jqbxZsjm88XR5+bmylV9GUFYXnVf5LxYovpMq/4g4ka6TyJ7vTuBTn3xBe76PGrAaf3SSz9XdAHEZNOG9nHc6yOjo/IN8vGaHzpeQFPYo01NjTjAsmld9VoawgOopaWFenp6cN2tpvR0/nXOFKkNN24MyzXaPzBAOXgncIbwm4BPT1kq4GdmzkHlbJbpystBQJaULg3xQyPFZhcpTJMA6HQlhiwoC+z1AOKjjzxKr//pj7SsosIZi1kMKBOiuUys3bEDQRiR3wJZNz+OPvv8JN4JRbRy1Som0UK8+B7b/Bid//KfyIZPaP36apqTnUP9uMYG8crsHxzA2yOTFhcsokpgDg8PU9OpU5SDG6C8vJyKS0sABQNmwWezEvI0TwgW22S+8M3mB1q3AMSECGWs00pKgrWjgNaAN3wZrqJNGzfR53CmCqc6X13Mkyppbm52LjNwdd2U93xV5XKqWKZnhuVqKt4Iq1c/gHu8iJpbziCVb+HEL6TCxYto1QP3U9YcrK4zqBBbpRKYfb191NbRTl+eP08VFRV4QWbLXh8fw+ML5874+Cg+k3iMTcpja8uWzWJHCn6cZVx1XqImZugWYBF+1fjeMw1jFu0A4NkzZ+mXv/oFjMqigsJCpG8zHjt9VIJnMR86c7Ba5hhP5cAMDQ0h7Zvowe8+KG99XS3HlEYNKcQr8tFHNuGJnMHUWHGmhjQOFn84sB34rsCZMQdZkTs3B8HLF6ezs3KwNeK6JAN0+aFLVg0NtHt3RdR1V0Vd3UGlJV0dJoj9GzS3NAf1H9UHjY2NAd72wS13XfX29gb1H9cHAwMDJh610IcUjcbJvWRW8jiUn8mYSVHhuoPelQ4hw/fOAASGA4LgWCKk2FdcF7BwGVynuKhYXnHT0wnqxfubvx6fO3eOSpcuod6eXtrw/Q2UNx+HliwjV9zVJORayE6XY8bww6y8Db4KqwLVZdqdUgPgVr4pRfec4WsATJCd9+ZG734TYEX4mJBr09JSceKWyoefvvzjxaaNGyUdRZ3IqbDXDZ/CoU4wVcrB2EqEArPjM4anXSClMmWilwcafAPhHaABMMFwalIkeYY5niwrdGPiRsKjR9/hTNNiXGuZKn3TZa2TZ64z1VH+c/zQzqgjPcabDR8vQaQFc1zRrlpkdgnN2RCXw2wRMklww6512BktmvTWd8Q74EcS6EGJZ2bY/6b48hTWTHOuS6N9Ve4cAEkdcXLOOnPOjJ3Z+hJeCKDGNN0OX3XdLXy2YyY+AmDFGSqNExQLIwfMYJ4xM2uUK9qsKy0fPFFRbaCgE2lmvhtJ4xlqdEioHpX77/Fjs0P8MABxM8EHQsxADOLjyC2le1x7QUrr7WaboqkVusTuz4bP9LB8Q3yxbhb8dAmrKI8cYDn5cgISvhLj72dYEfQDVLw2LKkyTFMTueFoypAF8AqVP4s7AjvI5KiwJtCYD4ZqFmHRIbKocGHfJXzFEXxnCFuEhTYXmOWsEankcTJvFnGZp3JhzZFzgJFacMMrLqTOotDH9Ptuziwk80FZqL8GX7ZAFAO2lKfyhwvG0uVK96VxmMu6I1nrq7dhzR2e5Mc5yfl7ia8ZIP5FTtoWnrFy7ONtigUmFhONwowZMVnm3kP8/5//HxBmteayrk1A/wZIeQM45whS1wAAAABJRU5ErkJggg==" /> </defs> </svg> </React.Fragment> ); export interface TimeSeriesProps{ fillColor: React.CSSProperties['color']; } export default TimeSeries;
240.534884
9,547
0.941313
da4fda602efe31766ef38248b2147afecd9660f2
36,969
php
PHP
resources/views/admin/qualificationsApps/edit.blade.php
reeddyy/sms
162014d43da3012d41505a7701a67d778d2e3729
[ "MIT" ]
null
null
null
resources/views/admin/qualificationsApps/edit.blade.php
reeddyy/sms
162014d43da3012d41505a7701a67d778d2e3729
[ "MIT" ]
2
2021-11-23T06:45:31.000Z
2021-12-02T08:12:11.000Z
resources/views/admin/qualificationsApps/edit.blade.php
reeddyy/sms
162014d43da3012d41505a7701a67d778d2e3729
[ "MIT" ]
null
null
null
@extends('layouts.admin') @section('content') <div class="card"> <div class="card-header"> {{ trans('global.edit') }} {{ trans('cruds.qualificationsApp.title_singular') }} </div> <div class="card-body"> <form method="POST" action="{{ route("admin.qualifications-apps.update", [$qualificationsApp->id]) }}" enctype="multipart/form-data"> @method('PUT') @csrf <div class="form-group"> <label for="statuses">{{ trans('cruds.qualificationsApp.fields.status') }}</label> <div style="padding-bottom: 4px"> <span class="btn btn-info btn-xs select-all" style="border-radius: 0">{{ trans('global.select_all') }}</span> <span class="btn btn-info btn-xs deselect-all" style="border-radius: 0">{{ trans('global.deselect_all') }}</span> </div> <select class="form-control select2 {{ $errors->has('statuses') ? 'is-invalid' : '' }}" name="statuses[]" id="statuses" multiple> @foreach($statuses as $id => $status) <option value="{{ $id }}" {{ (in_array($id, old('statuses', [])) || $qualificationsApp->statuses->contains($id)) ? 'selected' : '' }}>{{ $status }}</option> @endforeach </select> @if($errors->has('statuses')) <div class="invalid-feedback"> {{ $errors->first('statuses') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.status_helper') }}</span> </div> <div class="form-group"> <label class="required" for="application_no">{{ trans('cruds.qualificationsApp.fields.application_no') }}</label> <input class="form-control {{ $errors->has('application_no') ? 'is-invalid' : '' }}" type="text" name="application_no" id="application_no" value="{{ old('application_no', $qualificationsApp->application_no) }}" required> @if($errors->has('application_no')) <div class="invalid-feedback"> {{ $errors->first('application_no') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.application_no_helper') }}</span> </div> <div class="form-group"> <label for="sponsorship">{{ trans('cruds.qualificationsApp.fields.sponsorship') }}</label> <input class="form-control {{ $errors->has('sponsorship') ? 'is-invalid' : '' }}" type="text" name="sponsorship" id="sponsorship" value="{{ old('sponsorship', $qualificationsApp->sponsorship) }}"> @if($errors->has('sponsorship')) <div class="invalid-feedback"> {{ $errors->first('sponsorship') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.sponsorship_helper') }}</span> </div> <div class="form-group"> <label for="level">{{ trans('cruds.qualificationsApp.fields.level') }}</label> <input class="form-control {{ $errors->has('level') ? 'is-invalid' : '' }}" type="text" name="level" id="level" value="{{ old('level', $qualificationsApp->level) }}"> @if($errors->has('level')) <div class="invalid-feedback"> {{ $errors->first('level') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.level_helper') }}</span> </div> <div class="form-group"> <label for="course">{{ trans('cruds.qualificationsApp.fields.course') }}</label> <input class="form-control {{ $errors->has('course') ? 'is-invalid' : '' }}" type="text" name="course" id="course" value="{{ old('course', $qualificationsApp->course) }}"> @if($errors->has('course')) <div class="invalid-feedback"> {{ $errors->first('course') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.course_helper') }}</span> </div> <div class="form-group"> <label for="commencement">{{ trans('cruds.qualificationsApp.fields.commencement') }}</label> <input class="form-control {{ $errors->has('commencement') ? 'is-invalid' : '' }}" type="text" name="commencement" id="commencement" value="{{ old('commencement', $qualificationsApp->commencement) }}"> @if($errors->has('commencement')) <div class="invalid-feedback"> {{ $errors->first('commencement') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.commencement_helper') }}</span> </div> <div class="form-group"> <label for="hear_about_us">{{ trans('cruds.qualificationsApp.fields.hear_about_us') }}</label> <input class="form-control {{ $errors->has('hear_about_us') ? 'is-invalid' : '' }}" type="text" name="hear_about_us" id="hear_about_us" value="{{ old('hear_about_us', $qualificationsApp->hear_about_us) }}"> @if($errors->has('hear_about_us')) <div class="invalid-feedback"> {{ $errors->first('hear_about_us') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.hear_about_us_helper') }}</span> </div> <div class="form-group"> <label for="company_name">{{ trans('cruds.qualificationsApp.fields.company_name') }}</label> <input class="form-control {{ $errors->has('company_name') ? 'is-invalid' : '' }}" type="text" name="company_name" id="company_name" value="{{ old('company_name', $qualificationsApp->company_name) }}"> @if($errors->has('company_name')) <div class="invalid-feedback"> {{ $errors->first('company_name') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.company_name_helper') }}</span> </div> <div class="form-group"> <label for="company_address">{{ trans('cruds.qualificationsApp.fields.company_address') }}</label> <input class="form-control {{ $errors->has('company_address') ? 'is-invalid' : '' }}" type="text" name="company_address" id="company_address" value="{{ old('company_address', $qualificationsApp->company_address) }}"> @if($errors->has('company_address')) <div class="invalid-feedback"> {{ $errors->first('company_address') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.company_address_helper') }}</span> </div> <div class="form-group"> <label for="company_country">{{ trans('cruds.qualificationsApp.fields.company_country') }}</label> <input class="form-control {{ $errors->has('company_country') ? 'is-invalid' : '' }}" type="text" name="company_country" id="company_country" value="{{ old('company_country', $qualificationsApp->company_country) }}"> @if($errors->has('company_country')) <div class="invalid-feedback"> {{ $errors->first('company_country') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.company_country_helper') }}</span> </div> <div class="form-group"> <label for="company_postal_code">{{ trans('cruds.qualificationsApp.fields.company_postal_code') }}</label> <input class="form-control {{ $errors->has('company_postal_code') ? 'is-invalid' : '' }}" type="number" name="company_postal_code" id="company_postal_code" value="{{ old('company_postal_code', $qualificationsApp->company_postal_code) }}" step="1"> @if($errors->has('company_postal_code')) <div class="invalid-feedback"> {{ $errors->first('company_postal_code') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.company_postal_code_helper') }}</span> </div> <div class="form-group"> <label for="officer_name">{{ trans('cruds.qualificationsApp.fields.officer_name') }}</label> <input class="form-control {{ $errors->has('officer_name') ? 'is-invalid' : '' }}" type="text" name="officer_name" id="officer_name" value="{{ old('officer_name', $qualificationsApp->officer_name) }}"> @if($errors->has('officer_name')) <div class="invalid-feedback"> {{ $errors->first('officer_name') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.officer_name_helper') }}</span> </div> <div class="form-group"> <label for="officer_designation">{{ trans('cruds.qualificationsApp.fields.officer_designation') }}</label> <input class="form-control {{ $errors->has('officer_designation') ? 'is-invalid' : '' }}" type="text" name="officer_designation" id="officer_designation" value="{{ old('officer_designation', $qualificationsApp->officer_designation) }}"> @if($errors->has('officer_designation')) <div class="invalid-feedback"> {{ $errors->first('officer_designation') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.officer_designation_helper') }}</span> </div> <div class="form-group"> <label for="officer_contact">{{ trans('cruds.qualificationsApp.fields.officer_contact') }}</label> <input class="form-control {{ $errors->has('officer_contact') ? 'is-invalid' : '' }}" type="text" name="officer_contact" id="officer_contact" value="{{ old('officer_contact', $qualificationsApp->officer_contact) }}"> @if($errors->has('officer_contact')) <div class="invalid-feedback"> {{ $errors->first('officer_contact') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.officer_contact_helper') }}</span> </div> <div class="form-group"> <label for="officer_email">{{ trans('cruds.qualificationsApp.fields.officer_email') }}</label> <input class="form-control {{ $errors->has('officer_email') ? 'is-invalid' : '' }}" type="text" name="officer_email" id="officer_email" value="{{ old('officer_email', $qualificationsApp->officer_email) }}"> @if($errors->has('officer_email')) <div class="invalid-feedback"> {{ $errors->first('officer_email') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.officer_email_helper') }}</span> </div> <div class="form-group"> <label for="applicant_name">{{ trans('cruds.qualificationsApp.fields.applicant_name') }}</label> <input class="form-control {{ $errors->has('applicant_name') ? 'is-invalid' : '' }}" type="text" name="applicant_name" id="applicant_name" value="{{ old('applicant_name', $qualificationsApp->applicant_name) }}"> @if($errors->has('applicant_name')) <div class="invalid-feedback"> {{ $errors->first('applicant_name') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.applicant_name_helper') }}</span> </div> <div class="form-group"> <label for="gender">{{ trans('cruds.qualificationsApp.fields.gender') }}</label> <input class="form-control {{ $errors->has('gender') ? 'is-invalid' : '' }}" type="text" name="gender" id="gender" value="{{ old('gender', $qualificationsApp->gender) }}"> @if($errors->has('gender')) <div class="invalid-feedback"> {{ $errors->first('gender') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.gender_helper') }}</span> </div> <div class="form-group"> <label for="id_type">{{ trans('cruds.qualificationsApp.fields.id_type') }}</label> <input class="form-control {{ $errors->has('id_type') ? 'is-invalid' : '' }}" type="text" name="id_type" id="id_type" value="{{ old('id_type', $qualificationsApp->id_type) }}"> @if($errors->has('id_type')) <div class="invalid-feedback"> {{ $errors->first('id_type') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.id_type_helper') }}</span> </div> <div class="form-group"> <label for="id_no">{{ trans('cruds.qualificationsApp.fields.id_no') }}</label> <input class="form-control {{ $errors->has('id_no') ? 'is-invalid' : '' }}" type="text" name="id_no" id="id_no" value="{{ old('id_no', $qualificationsApp->id_no) }}"> @if($errors->has('id_no')) <div class="invalid-feedback"> {{ $errors->first('id_no') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.id_no_helper') }}</span> </div> <div class="form-group"> <label for="dob">{{ trans('cruds.qualificationsApp.fields.dob') }}</label> <input class="form-control date {{ $errors->has('dob') ? 'is-invalid' : '' }}" type="text" name="dob" id="dob" value="{{ old('dob', $qualificationsApp->dob) }}"> @if($errors->has('dob')) <div class="invalid-feedback"> {{ $errors->first('dob') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.dob_helper') }}</span> </div> <div class="form-group"> <label for="nationality">{{ trans('cruds.qualificationsApp.fields.nationality') }}</label> <input class="form-control {{ $errors->has('nationality') ? 'is-invalid' : '' }}" type="text" name="nationality" id="nationality" value="{{ old('nationality', $qualificationsApp->nationality) }}"> @if($errors->has('nationality')) <div class="invalid-feedback"> {{ $errors->first('nationality') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.nationality_helper') }}</span> </div> <div class="form-group"> <label for="address">{{ trans('cruds.qualificationsApp.fields.address') }}</label> <input class="form-control {{ $errors->has('address') ? 'is-invalid' : '' }}" type="text" name="address" id="address" value="{{ old('address', $qualificationsApp->address) }}"> @if($errors->has('address')) <div class="invalid-feedback"> {{ $errors->first('address') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.address_helper') }}</span> </div> <div class="form-group"> <label for="country">{{ trans('cruds.qualificationsApp.fields.country') }}</label> <input class="form-control {{ $errors->has('country') ? 'is-invalid' : '' }}" type="text" name="country" id="country" value="{{ old('country', $qualificationsApp->country) }}"> @if($errors->has('country')) <div class="invalid-feedback"> {{ $errors->first('country') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.country_helper') }}</span> </div> <div class="form-group"> <label for="postal_code">{{ trans('cruds.qualificationsApp.fields.postal_code') }}</label> <input class="form-control {{ $errors->has('postal_code') ? 'is-invalid' : '' }}" type="number" name="postal_code" id="postal_code" value="{{ old('postal_code', $qualificationsApp->postal_code) }}" step="1"> @if($errors->has('postal_code')) <div class="invalid-feedback"> {{ $errors->first('postal_code') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.postal_code_helper') }}</span> </div> <div class="form-group"> <label for="contact_no">{{ trans('cruds.qualificationsApp.fields.contact_no') }}</label> <input class="form-control {{ $errors->has('contact_no') ? 'is-invalid' : '' }}" type="text" name="contact_no" id="contact_no" value="{{ old('contact_no', $qualificationsApp->contact_no) }}"> @if($errors->has('contact_no')) <div class="invalid-feedback"> {{ $errors->first('contact_no') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.contact_no_helper') }}</span> </div> <div class="form-group"> <label for="email">{{ trans('cruds.qualificationsApp.fields.email') }}</label> <input class="form-control {{ $errors->has('email') ? 'is-invalid' : '' }}" type="text" name="email" id="email" value="{{ old('email', $qualificationsApp->email) }}"> @if($errors->has('email')) <div class="invalid-feedback"> {{ $errors->first('email') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.email_helper') }}</span> </div> <div class="form-group"> <label for="company_name_1">{{ trans('cruds.qualificationsApp.fields.company_name_1') }}</label> <input class="form-control {{ $errors->has('company_name_1') ? 'is-invalid' : '' }}" type="text" name="company_name_1" id="company_name_1" value="{{ old('company_name_1', $qualificationsApp->company_name_1) }}"> @if($errors->has('company_name_1')) <div class="invalid-feedback"> {{ $errors->first('company_name_1') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.company_name_1_helper') }}</span> </div> <div class="form-group"> <label for="designation_1">{{ trans('cruds.qualificationsApp.fields.designation_1') }}</label> <input class="form-control {{ $errors->has('designation_1') ? 'is-invalid' : '' }}" type="text" name="designation_1" id="designation_1" value="{{ old('designation_1', $qualificationsApp->designation_1) }}"> @if($errors->has('designation_1')) <div class="invalid-feedback"> {{ $errors->first('designation_1') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.designation_1_helper') }}</span> </div> <div class="form-group"> <label for="duration_1">{{ trans('cruds.qualificationsApp.fields.duration_1') }}</label> <input class="form-control {{ $errors->has('duration_1') ? 'is-invalid' : '' }}" type="number" name="duration_1" id="duration_1" value="{{ old('duration_1', $qualificationsApp->duration_1) }}" step="1"> @if($errors->has('duration_1')) <div class="invalid-feedback"> {{ $errors->first('duration_1') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.duration_1_helper') }}</span> </div> <div class="form-group"> <label for="company_name_2">{{ trans('cruds.qualificationsApp.fields.company_name_2') }}</label> <input class="form-control {{ $errors->has('company_name_2') ? 'is-invalid' : '' }}" type="text" name="company_name_2" id="company_name_2" value="{{ old('company_name_2', $qualificationsApp->company_name_2) }}"> @if($errors->has('company_name_2')) <div class="invalid-feedback"> {{ $errors->first('company_name_2') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.company_name_2_helper') }}</span> </div> <div class="form-group"> <label for="designation_2">{{ trans('cruds.qualificationsApp.fields.designation_2') }}</label> <input class="form-control {{ $errors->has('designation_2') ? 'is-invalid' : '' }}" type="text" name="designation_2" id="designation_2" value="{{ old('designation_2', $qualificationsApp->designation_2) }}"> @if($errors->has('designation_2')) <div class="invalid-feedback"> {{ $errors->first('designation_2') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.designation_2_helper') }}</span> </div> <div class="form-group"> <label for="duration_2">{{ trans('cruds.qualificationsApp.fields.duration_2') }}</label> <input class="form-control {{ $errors->has('duration_2') ? 'is-invalid' : '' }}" type="number" name="duration_2" id="duration_2" value="{{ old('duration_2', $qualificationsApp->duration_2) }}" step="1"> @if($errors->has('duration_2')) <div class="invalid-feedback"> {{ $errors->first('duration_2') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.duration_2_helper') }}</span> </div> <div class="form-group"> <label for="company_name_3">{{ trans('cruds.qualificationsApp.fields.company_name_3') }}</label> <input class="form-control {{ $errors->has('company_name_3') ? 'is-invalid' : '' }}" type="text" name="company_name_3" id="company_name_3" value="{{ old('company_name_3', $qualificationsApp->company_name_3) }}"> @if($errors->has('company_name_3')) <div class="invalid-feedback"> {{ $errors->first('company_name_3') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.company_name_3_helper') }}</span> </div> <div class="form-group"> <label for="designation_3">{{ trans('cruds.qualificationsApp.fields.designation_3') }}</label> <input class="form-control {{ $errors->has('designation_3') ? 'is-invalid' : '' }}" type="text" name="designation_3" id="designation_3" value="{{ old('designation_3', $qualificationsApp->designation_3) }}"> @if($errors->has('designation_3')) <div class="invalid-feedback"> {{ $errors->first('designation_3') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.designation_3_helper') }}</span> </div> <div class="form-group"> <label for="duration_3">{{ trans('cruds.qualificationsApp.fields.duration_3') }}</label> <input class="form-control {{ $errors->has('duration_3') ? 'is-invalid' : '' }}" type="number" name="duration_3" id="duration_3" value="{{ old('duration_3', $qualificationsApp->duration_3) }}" step="1"> @if($errors->has('duration_3')) <div class="invalid-feedback"> {{ $errors->first('duration_3') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.duration_3_helper') }}</span> </div> <div class="form-group"> <label for="qualification_1">{{ trans('cruds.qualificationsApp.fields.qualification_1') }}</label> <input class="form-control {{ $errors->has('qualification_1') ? 'is-invalid' : '' }}" type="text" name="qualification_1" id="qualification_1" value="{{ old('qualification_1', $qualificationsApp->qualification_1) }}"> @if($errors->has('qualification_1')) <div class="invalid-feedback"> {{ $errors->first('qualification_1') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.qualification_1_helper') }}</span> </div> <div class="form-group"> <label for="level_1">{{ trans('cruds.qualificationsApp.fields.level_1') }}</label> <input class="form-control {{ $errors->has('level_1') ? 'is-invalid' : '' }}" type="text" name="level_1" id="level_1" value="{{ old('level_1', $qualificationsApp->level_1) }}"> @if($errors->has('level_1')) <div class="invalid-feedback"> {{ $errors->first('level_1') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.level_1_helper') }}</span> </div> <div class="form-group"> <label for="institute_1">{{ trans('cruds.qualificationsApp.fields.institute_1') }}</label> <input class="form-control {{ $errors->has('institute_1') ? 'is-invalid' : '' }}" type="text" name="institute_1" id="institute_1" value="{{ old('institute_1', $qualificationsApp->institute_1) }}"> @if($errors->has('institute_1')) <div class="invalid-feedback"> {{ $errors->first('institute_1') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.institute_1_helper') }}</span> </div> <div class="form-group"> <label for="year_attained_1">{{ trans('cruds.qualificationsApp.fields.year_attained_1') }}</label> <input class="form-control {{ $errors->has('year_attained_1') ? 'is-invalid' : '' }}" type="number" name="year_attained_1" id="year_attained_1" value="{{ old('year_attained_1', $qualificationsApp->year_attained_1) }}" step="1"> @if($errors->has('year_attained_1')) <div class="invalid-feedback"> {{ $errors->first('year_attained_1') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.year_attained_1_helper') }}</span> </div> <div class="form-group"> <label for="qualification_2">{{ trans('cruds.qualificationsApp.fields.qualification_2') }}</label> <input class="form-control {{ $errors->has('qualification_2') ? 'is-invalid' : '' }}" type="text" name="qualification_2" id="qualification_2" value="{{ old('qualification_2', $qualificationsApp->qualification_2) }}"> @if($errors->has('qualification_2')) <div class="invalid-feedback"> {{ $errors->first('qualification_2') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.qualification_2_helper') }}</span> </div> <div class="form-group"> <label for="level_2">{{ trans('cruds.qualificationsApp.fields.level_2') }}</label> <input class="form-control {{ $errors->has('level_2') ? 'is-invalid' : '' }}" type="text" name="level_2" id="level_2" value="{{ old('level_2', $qualificationsApp->level_2) }}"> @if($errors->has('level_2')) <div class="invalid-feedback"> {{ $errors->first('level_2') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.level_2_helper') }}</span> </div> <div class="form-group"> <label for="institute_2">{{ trans('cruds.qualificationsApp.fields.institute_2') }}</label> <input class="form-control {{ $errors->has('institute_2') ? 'is-invalid' : '' }}" type="text" name="institute_2" id="institute_2" value="{{ old('institute_2', $qualificationsApp->institute_2) }}"> @if($errors->has('institute_2')) <div class="invalid-feedback"> {{ $errors->first('institute_2') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.institute_2_helper') }}</span> </div> <div class="form-group"> <label for="year_attained_2">{{ trans('cruds.qualificationsApp.fields.year_attained_2') }}</label> <input class="form-control {{ $errors->has('year_attained_2') ? 'is-invalid' : '' }}" type="number" name="year_attained_2" id="year_attained_2" value="{{ old('year_attained_2', $qualificationsApp->year_attained_2) }}" step="1"> @if($errors->has('year_attained_2')) <div class="invalid-feedback"> {{ $errors->first('year_attained_2') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.year_attained_2_helper') }}</span> </div> <div class="form-group"> <label for="qualification_3">{{ trans('cruds.qualificationsApp.fields.qualification_3') }}</label> <input class="form-control {{ $errors->has('qualification_3') ? 'is-invalid' : '' }}" type="text" name="qualification_3" id="qualification_3" value="{{ old('qualification_3', $qualificationsApp->qualification_3) }}"> @if($errors->has('qualification_3')) <div class="invalid-feedback"> {{ $errors->first('qualification_3') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.qualification_3_helper') }}</span> </div> <div class="form-group"> <label for="level_3">{{ trans('cruds.qualificationsApp.fields.level_3') }}</label> <input class="form-control {{ $errors->has('level_3') ? 'is-invalid' : '' }}" type="text" name="level_3" id="level_3" value="{{ old('level_3', $qualificationsApp->level_3) }}"> @if($errors->has('level_3')) <div class="invalid-feedback"> {{ $errors->first('level_3') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.level_3_helper') }}</span> </div> <div class="form-group"> <label for="institute_3">{{ trans('cruds.qualificationsApp.fields.institute_3') }}</label> <input class="form-control {{ $errors->has('institute_3') ? 'is-invalid' : '' }}" type="text" name="institute_3" id="institute_3" value="{{ old('institute_3', $qualificationsApp->institute_3) }}"> @if($errors->has('institute_3')) <div class="invalid-feedback"> {{ $errors->first('institute_3') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.institute_3_helper') }}</span> </div> <div class="form-group"> <label for="year_attained_3">{{ trans('cruds.qualificationsApp.fields.year_attained_3') }}</label> <input class="form-control {{ $errors->has('year_attained_3') ? 'is-invalid' : '' }}" type="text" name="year_attained_3" id="year_attained_3" value="{{ old('year_attained_3', $qualificationsApp->year_attained_3) }}"> @if($errors->has('year_attained_3')) <div class="invalid-feedback"> {{ $errors->first('year_attained_3') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.year_attained_3_helper') }}</span> </div> <div class="form-group"> <label for="id_front">{{ trans('cruds.qualificationsApp.fields.id_front') }}</label> <input class="form-control {{ $errors->has('id_front') ? 'is-invalid' : '' }}" type="text" name="id_front" id="id_front" value="{{ old('id_front', $qualificationsApp->id_front) }}"> @if($errors->has('id_front')) <div class="invalid-feedback"> {{ $errors->first('id_front') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.id_front_helper') }}</span> </div> <div class="form-group"> <label for="id_back">{{ trans('cruds.qualificationsApp.fields.id_back') }}</label> <input class="form-control {{ $errors->has('id_back') ? 'is-invalid' : '' }}" type="text" name="id_back" id="id_back" value="{{ old('id_back', $qualificationsApp->id_back) }}"> @if($errors->has('id_back')) <div class="invalid-feedback"> {{ $errors->first('id_back') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.id_back_helper') }}</span> </div> <div class="form-group"> <label for="certificate">{{ trans('cruds.qualificationsApp.fields.certificate') }}</label> <input class="form-control {{ $errors->has('certificate') ? 'is-invalid' : '' }}" type="text" name="certificate" id="certificate" value="{{ old('certificate', $qualificationsApp->certificate) }}"> @if($errors->has('certificate')) <div class="invalid-feedback"> {{ $errors->first('certificate') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.certificate_helper') }}</span> </div> <div class="form-group"> <label for="note">{{ trans('cruds.qualificationsApp.fields.note') }}</label> <textarea class="form-control {{ $errors->has('note') ? 'is-invalid' : '' }}" name="note" id="note">{{ old('note', $qualificationsApp->note) }}</textarea> @if($errors->has('note')) <div class="invalid-feedback"> {{ $errors->first('note') }} </div> @endif <span class="help-block">{{ trans('cruds.qualificationsApp.fields.note_helper') }}</span> </div> <div class="form-group"> <button class="btn btn-danger" type="submit"> {{ trans('global.save') }} </button> </div> </form> </div> </div> @endsection
68.208487
263
0.527442
e84b5cc45439a8cae464485cffd5e7f64a6b2c7f
3,395
cs
C#
src/Stratis.Bitcoin.Features.SmartContracts.Tests/Lifecycle/SmartContractRestorerTests.cs
zeptin/StratisBitcoinFullNode
63c52829a3bb6af174a433c6316389ac237c4750
[ "MIT" ]
null
null
null
src/Stratis.Bitcoin.Features.SmartContracts.Tests/Lifecycle/SmartContractRestorerTests.cs
zeptin/StratisBitcoinFullNode
63c52829a3bb6af174a433c6316389ac237c4750
[ "MIT" ]
null
null
null
src/Stratis.Bitcoin.Features.SmartContracts.Tests/Lifecycle/SmartContractRestorerTests.cs
zeptin/StratisBitcoinFullNode
63c52829a3bb6af174a433c6316389ac237c4750
[ "MIT" ]
null
null
null
using System.Reflection; using Microsoft.Extensions.Logging; using Moq; using Stratis.SmartContracts; using Stratis.SmartContracts.Core; using Stratis.SmartContracts.Executor.Reflection; using Stratis.SmartContracts.Executor.Reflection.Lifecycle; using Xunit; using InternalHashHelper = Stratis.SmartContracts.Core.Hashing.InternalHashHelper; namespace Stratis.Bitcoin.Features.SmartContracts.Tests.Lifecycle { public class SmartContractRestorerTests { private readonly ILoggerFactory loggerFactory; private readonly ISmartContractState state; public SmartContractRestorerTests() { this.loggerFactory = new Mock<ILoggerFactory>().Object; this.state = new SmartContractState( new Block(0, new Address()), new Message(new Address(), new Address(), 0, (Gas)0), new PersistentState(null, 0, null), new GasMeter((Gas)1000), new InternalTransactionExecutor(null, null, new BasicKeyEncodingStrategy(), this.loggerFactory, network: null), new InternalHashHelper(), () => 10000); } [Fact] public void SmartContract_Restorer_NonpublicStateFieldsSetSuccess() { LifecycleResult result = SmartContractRestorer .Restore(typeof(NoParamContract), this.state); Assert.True(result.Success); SmartContract contract = result.Object; FieldInfo[] fields = typeof(SmartContract).GetFields( BindingFlags.Instance | BindingFlags.NonPublic ); foreach (FieldInfo field in fields) { object value = field.GetValue(contract); switch (field.Name) { case "Block": Assert.Equal(this.state.Block, value); break; case "Message": Assert.Equal(this.state.Message, value); break; case "PersistentState": Assert.Equal(this.state.PersistentState, value); break; case "gasMeter": Assert.Equal(this.state.GasMeter, value); break; case "getBalance": Assert.Equal(this.state.GetBalance, value); break; case "internalTransactionExecutor": Assert.Equal(this.state.InternalTransactionExecutor, value); break; case "internalHashHelper": Assert.Equal(this.state.InternalHashHelper, value); break; case "smartContractState": Assert.Equal(this.state, value); break; } } } [Fact] public void SmartContract_Restorer_ConstructorNotInvokedSuccess() { LifecycleResult result = SmartContractRestorer .Restore(typeof(ConstructorInvokedContract), this.state); Assert.True(result.Success); Assert.NotNull(result.Object); Assert.False(((ConstructorInvokedContract)result.Object).ConstructorInvoked); } } }
37.307692
123
0.559352
0a97ed2f802baa77a98eb875821c931461f220cb
2,064
kt
Kotlin
auth-service/src/test/kotlin/RevokeRoleTest.kt
icerockdev/auth-service
24e28f9412677cabe13d5e927574e2f32a524e5c
[ "Apache-2.0" ]
3
2020-02-11T04:55:32.000Z
2020-04-28T03:03:40.000Z
auth-service/src/test/kotlin/RevokeRoleTest.kt
icerockdev/auth-service
24e28f9412677cabe13d5e927574e2f32a524e5c
[ "Apache-2.0" ]
1
2022-03-22T04:24:58.000Z
2022-03-22T04:24:58.000Z
auth-service/src/test/kotlin/RevokeRoleTest.kt
icerockdev/auth-service
24e28f9412677cabe13d5e927574e2f32a524e5c
[ "Apache-2.0" ]
null
null
null
/* * Copyright 2020 IceRock MAG Inc. Use of this source code is governed by the Apache 2.0 license. */ import com.icerockdev.service.auth.revoke.IRevokeTokenService import com.icerockdev.service.auth.revoke.ITokenDataRepository import com.icerockdev.service.auth.revoke.RevokeTokenService import com.icerockdev.service.auth.revoke.TokenNotifyBus import com.icerockdev.service.auth.revoke.UserKey import kotlin.test.Test import kotlin.test.assertFalse import kotlin.test.assertTrue class RevokeRoleTest { companion object { const val TOKEN_TTL: Long = 3600 * 1000L val now = System.currentTimeMillis() } class TokenRepository : ITokenDataRepository<UserKey> { override suspend fun getAllNotExpired(): Map<UserKey, Long> { return mapOf( UserKey(1, 1) to now - 10 * 1000L, UserKey(2, 2) to now - TOKEN_TTL ) } override fun insertOrUpdate(key: UserKey, revokeAt: Long): Boolean { return true } override fun cleanUp() { } } @Test fun testTtl() { val notifier = TokenNotifyBus<UserKey>() val service: IRevokeTokenService<UserKey> = RevokeTokenService( TokenRepository() ) { this.tokenTtl = TOKEN_TTL this.notifier = notifier } // await cache loading Thread.sleep(1000) assertTrue { service.checkIsActive(UserKey(1, 1), now) } assertTrue { service.checkIsActive(UserKey(1, 1),now - 1 * 1000L) } assertFalse { service.checkIsActive(UserKey(1, 1),now - TOKEN_TTL + 1000L) } assertFalse { service.checkIsActive(UserKey(1, 1),now - TOKEN_TTL - 1000L) } assertTrue { service.checkIsActive(UserKey(2, 2),now - TOKEN_TTL) } assertTrue { service.checkIsActive(UserKey(3, 2), now) } notifier.sendEvent(UserKey(4, 2), now) assertFalse { service.checkIsActive(UserKey(4, 2),now - 1) } assertTrue { service.checkIsActive(UserKey(4, 2), now + 1) } } }
31.272727
97
0.645349
14ed1180045913c79a93430f0ba238ae9afabe3b
1,427
hpp
C++
core/interface/i_math_transform.hpp
auyunli/enhance
ca99530c80b42842e713ed4b62e40d12e56ee24a
[ "BSD-2-Clause" ]
null
null
null
core/interface/i_math_transform.hpp
auyunli/enhance
ca99530c80b42842e713ed4b62e40d12e56ee24a
[ "BSD-2-Clause" ]
null
null
null
core/interface/i_math_transform.hpp
auyunli/enhance
ca99530c80b42842e713ed4b62e40d12e56ee24a
[ "BSD-2-Clause" ]
null
null
null
#ifndef E2_I_MATH_TRANSFORM_HPP #define E2_I_MATH_TRANSFORM_HPP #include <cstring> namespace e2 { namespace interface { template< class T > class i_math_transform { public: static bool dim( int * d, T * ){ return false; } static bool magnitude( double * m, T * ){ return false; } static bool normalize( T * ){ return false; } static bool assign( T *, T * ){ return false; } static bool sub( T *, T *, T * ){ return false; } static bool add( T *, T *, T * ){ return false; } static bool mult( T *, T *, T * ){ return false; } static bool div( T *, T *, T * ){ return false; } static bool is_equal( bool * b, T *, T * ){ return false; } template< class R > static bool index( R *, T *, int ){ return false; } template< class R > static bool index( R *, T *, int, int ){ return false; } template< class R > static bool index( R *, T *, int, int, int ){ return false; } static bool dot( double *, T *, T * ){ return false; } static bool cross( T *, T *, T * ){ return false; } static bool from_array( T *, int dim, float * arr ){ return false; } static bool from_array( T *, int dim, double * arr ){ return false; } static bool to_array( float * arr, int dim, T * ){ return false; } static bool to_array( double * arr, int dim, T * ){ return false; } static bool scale_add( T *, T *, double s, double add ){ return false; } }; } } #endif
37.552632
76
0.598458
9eaacde8dc047b0aab82b646ce4a101b917d6aa0
3,816
sql
SQL
blog.sql
haryoid/blog
499867aa437f350ad84f6c5a91214bfebe2ce0be
[ "MIT" ]
null
null
null
blog.sql
haryoid/blog
499867aa437f350ad84f6c5a91214bfebe2ce0be
[ "MIT" ]
null
null
null
blog.sql
haryoid/blog
499867aa437f350ad84f6c5a91214bfebe2ce0be
[ "MIT" ]
null
null
null
-- phpMyAdmin SQL Dump -- version 4.6.6deb5 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Dec 31, 2019 at 10:28 AM -- Server version: 10.1.43-MariaDB-0ubuntu0.18.04.1 -- PHP Version: 7.2.24-0ubuntu0.18.04.1 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 utf8mb4 */; -- -- Database: `blog` -- -- -------------------------------------------------------- -- -- Table structure for table `category` -- CREATE TABLE `category` ( `id_category` int(11) NOT NULL, `c_name` varchar(40) DEFAULT NULL, `c_details` varchar(255) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -------------------------------------------------------- -- -- Table structure for table `penulis` -- CREATE TABLE `penulis` ( `id_penulis` int(11) NOT NULL, `firstname` varchar(255) NOT NULL, `lastname` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `password` char(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `penulis` -- INSERT INTO `penulis` (`id_penulis`, `firstname`, `lastname`, `email`, `password`) VALUES (1, 'Dwi', 'Haryo', 'haryo@example.com', '25d55ad283aa400af464c76d713c07ad'), (2, 'asd', 'qwerty', 'asdf@mail.com', '25d55ad283aa400af464c76d713c07ad'), (4, 'achmad', 'dwi', 'dwi@mail.com', '202cb962ac59075b964b07152d234b70'), (5, 'achmaddd', 'dwiii', 'dwii@mail.com', '202cb962ac59075b964b07152d234b70'), (6, 'achmad', 'achmad', 'achmad@mail.com', '81dc9bdb52d04dc20036dbd8313ed055'), (7, 'xyz', 'xyz', 'xzy@xyz.com', '202cb962ac59075b964b07152d234b70'), (8, 'xyz', 'asd', 'xyz@mail.com', '202cb962ac59075b964b07152d234b70'); -- -------------------------------------------------------- -- -- Table structure for table `post` -- CREATE TABLE `post` ( `id_post` int(11) NOT NULL, `p_title` varchar(255) NOT NULL, `p_subtitle` varchar(255) NOT NULL, `id_category` int(11) NOT NULL, `id_penulis` int(12) NOT NULL, `text` longtext, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modify` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `aktif` enum('Y','N') NOT NULL DEFAULT 'N' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Indexes for dumped tables -- -- -- Indexes for table `category` -- ALTER TABLE `category` ADD PRIMARY KEY (`id_category`); -- -- Indexes for table `penulis` -- ALTER TABLE `penulis` ADD PRIMARY KEY (`id_penulis`); -- -- Indexes for table `post` -- ALTER TABLE `post` ADD PRIMARY KEY (`id_post`), ADD KEY `id_category` (`id_category`), ADD KEY `id_penulis` (`id_penulis`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `category` -- ALTER TABLE `category` MODIFY `id_category` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `penulis` -- ALTER TABLE `penulis` MODIFY `id_penulis` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `post` -- ALTER TABLE `post` MODIFY `id_post` int(11) NOT NULL AUTO_INCREMENT; -- -- Constraints for dumped tables -- -- -- Constraints for table `category` -- ALTER TABLE `category` ADD CONSTRAINT `category_ibfk_1` FOREIGN KEY (`id_category`) REFERENCES `post` (`id_category`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Constraints for table `post` -- ALTER TABLE `post` ADD CONSTRAINT `post_ibfk_1` FOREIGN KEY (`id_penulis`) REFERENCES `penulis` (`id_penulis`) ON DELETE NO ACTION ON UPDATE NO ACTION; /*!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 */;
26.873239
137
0.674528
a41058417b4cd10f27f9f98aa171318c36895f75
1,659
bash
Shell
e2e/teardown.bash
easyenglishcoding/gitkube
111107aa7041d6c7ac026a57609c6bb0e2893ddc
[ "Apache-2.0" ]
3,723
2018-03-12T15:19:44.000Z
2022-03-30T01:33:38.000Z
e2e/teardown.bash
easyenglishcoding/gitkube
111107aa7041d6c7ac026a57609c6bb0e2893ddc
[ "Apache-2.0" ]
82
2018-03-13T03:36:34.000Z
2021-10-05T11:51:19.000Z
e2e/teardown.bash
easyenglishcoding/gitkube
111107aa7041d6c7ac026a57609c6bb0e2893ddc
[ "Apache-2.0" ]
229
2018-03-13T13:54:35.000Z
2022-03-01T07:45:35.000Z
#!/usr/bin/env bash # Teardown resources created by test.bash USAGE="./$(basename "$0") [optional-directory]" # Some helpful functions yell() { echo "FAILED> $*" >&2; } die() { yell "$*"; exit 1; } try() { "$@" || die "failed executing: $*"; } log() { echo "--> $*"; } # set WORDKDIR # run from project root WORKDIR=$(dirname ${BASH_SOURCE})/.. # set temporary output directory OUTPUT_DIR="$WORKDIR/e2e/_output" GITKUBE_NAMESPACE_STRING="namespace: kube-system" TEST_NAMESPACE_STRING="namespace: default" # set kubernetes config file set_kubeconfig() { if [ -n "$KUBECONFIG" ]; then KCONFIG=${KUBECONFIG} else KCONFIG=$HOME/.kube/config fi log "current kubectl context: $(kctl config current-context)" log "derived from: $KCONFIG" } # kubectl helper function kctl() { kubectl --kubeconfig "$KCONFIG" "$@" } # read output variables written by test.bash read_output_vars() { GITKUBE_NAMESPACE=$(cat "$OUTPUT_DIR/gitkube-namespace") TEST_NAMESPACE=$(cat "$OUTPUT_DIR/test-namespace") REMOTE_NAME=$(cat "$OUTPUT_DIR/remote-name") TEMP_REPO_DIR=$(cat "$OUTPUT_DIR/temp-repo-dir") } # teardown all resources teardown() { log "deleting gitkube resources from $GITKUBE_NAMESPACE" cat "$WORKDIR/manifests/gitkube-setup.yaml" | sed -e "s/$GITKUBE_NAMESPACE_STRING/namespace: $GITKUBE_NAMESPACE/" | kctl delete -f - kctl delete namespace $GITKUBE_NAMESPACE log "deleting test namespace $TEST_NAMESPACE" kctl delete namespace $TEST_NAMESPACE log "removing temp git repo" rm -rf "$TEMP_REPO_DIR" } # set kubeconfig and teardown set_kubeconfig && read_output_vars && teardown
26.758065
136
0.693791
467fbbebc7acd5aea86ca53ca61173ed4e7b0d94
6,475
swift
Swift
20_Basic-App/MatchGame/MatchGame/Controller/MainViewController.swift
nua-schroers/mvvm-frp
093d9fb128da2cd46b8a2606e21c21580bbc8dc1
[ "MIT" ]
null
null
null
20_Basic-App/MatchGame/MatchGame/Controller/MainViewController.swift
nua-schroers/mvvm-frp
093d9fb128da2cd46b8a2606e21c21580bbc8dc1
[ "MIT" ]
null
null
null
20_Basic-App/MatchGame/MatchGame/Controller/MainViewController.swift
nua-schroers/mvvm-frp
093d9fb128da2cd46b8a2606e21c21580bbc8dc1
[ "MIT" ]
null
null
null
// // ViewController.swift // MatchGame // // Created by Dr. Wolfram Schroers on 5/26/16. // Copyright © 2016 Wolfram Schroers. All rights reserved. // import UIKit /// Accept changes to the data model settings. protocol CanAcceptSettings: class { /// Accept the current settings. func settingsChanged(_ strategySelector: Int, initialMatchOunt: Int, removeMax: Int) } /// The view controller of the first screen responsible for the game. class MainViewController: UIViewController, CanAcceptSettings { // MARK: Lifecycle/workflow management override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) // Start a new game. self.startNewGame() } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "settings" { let controller = segue.destination as! SettingsViewController // Set the initial state of the settings screen. controller.initialMatchCount = self.matchModel.initialCount controller.removeMax = self.matchModel.removeMax switch self.matchModel.strategy { case .dumb: controller.strategy = 0 case .wild: controller.strategy = 1 case .smart: controller.strategy = 2 } controller.delegate = self } } // MARK: CanAcceptSettings func settingsChanged(_ strategySelector: Int, initialMatchOunt: Int, removeMax: Int) { self.matchModel.initialCount = initialMatchOunt switch strategySelector { case 0: self.matchModel.strategy = .dumb case 1: self.matchModel.strategy = .wild default: self.matchModel.strategy = .smart } self.matchModel.removeMax = removeMax } // MARK: Data Model /// Data model for the game state. var matchModel = MatchModel() // MARK: User Interface /// The label at the top displaying the current game state. @IBOutlet weak var gameStateLabel: UILabel! /// The move report label beneath the game state label. @IBOutlet weak var moveReportLabel: UILabel! /// The graphical match pile. @IBOutlet weak var matchPileView: MatchPileView! /// The "Take 2" button. It can be disabled if needed. @IBOutlet weak var takeTwoButton: UIButton! /// The "Take 3" button. It can be disabled if needed. @IBOutlet weak var takeThreeButton: UIButton! /// Response to user tapping "Take 1". @IBAction func userTappedTakeOne(_ sender: AnyObject) { self.userMove(1) } /// Response to user tapping "Take 2". @IBAction func userTappedTakeTwo(_ sender: AnyObject) { self.userMove(2) } /// Response to user tapping "Take 3". @IBAction func userTappedTakeThree(_ sender: AnyObject) { self.userMove(3) } // MARK: Game flow/controller /// - returns: A number of matches with proper unit. func prettyMatchString(_ count:Int) -> String { switch count { case 1: return NSLocalizedString("1 match", comment: "") default: return String(format: NSLocalizedString("%d matches", comment: ""), count) } } /// Start a new game. func startNewGame() { // Update the data model. self.matchModel.restart() // Configure the view. self.moveReportLabel.text = NSLocalizedString("Please start", comment: "") self.updateGameStateLabel() self.updateButtons() self.matchPileView.setMatches(self.matchModel.matchCount) } /// Update the game state label. func updateGameStateLabel() { self.gameStateLabel.text = prettyMatchString(self.matchModel.matchCount) } /// Adjust the buttons -- disable "Take 2" and/or "Take 3" when needed. func updateButtons() { switch min(self.matchModel.matchCount, self.matchModel.removeMax) { case 2: self.takeTwoButton.isEnabled = true self.takeThreeButton.isEnabled = false case 1: self.takeTwoButton.isEnabled = false self.takeThreeButton.isEnabled = false default: self.takeTwoButton.isEnabled = true self.takeThreeButton.isEnabled = true } } /// End a single game. func gameOver(_ message: String) { let messageController = UIAlertController(title: NSLocalizedString("The game is over", comment: ""), message: message, preferredStyle: .alert) let buttonResponse = UIAlertAction(title: NSLocalizedString("New game", comment: ""), style: .default) { (_) in self.startNewGame() } messageController.addAction(buttonResponse) self.present(messageController, animated: true, completion: nil) } /// Execute a user move. func userMove(_ count: Int) { // Update the data model. self.matchModel.performUserMove(count) // Update the UI. self.matchPileView.removeMatches(count) // Check if the user lost. if self.matchModel.isGameOver() { // The user has lost. self.gameOver(NSLocalizedString("You have lost", comment: "")) } else { // The computer moves. let computerMove = self.matchModel.performComputerMove() // Update the UI. self.matchPileView.removeMatches(computerMove) // Check if the computer lost. if self.matchModel.isGameOver() { // The computer lost. self.gameOver(NSLocalizedString("I have lost", comment: "")) } else { // Update the UI again (print the computer move). self.moveReportLabel.text = String(format: NSLocalizedString("I remove %@", comment: ""), self.prettyMatchString(computerMove)) } } // Update the UI once more. self.updateGameStateLabel() self.updateButtons() } }
32.054455
108
0.583938
7964074608ed69bbec819c4a745171351f58673d
1,210
php
PHP
libraries/joomla/crypt/cipher.php
zikfrid/lvivbud.dev
58686f5a0126d6e672363abd81fdba4f60899f33
[ "PostgreSQL" ]
1
2018-12-26T08:20:06.000Z
2018-12-26T08:20:06.000Z
libraries/joomla/crypt/cipher.php
zikfrid/lvivbud.dev
58686f5a0126d6e672363abd81fdba4f60899f33
[ "PostgreSQL" ]
null
null
null
libraries/joomla/crypt/cipher.php
zikfrid/lvivbud.dev
58686f5a0126d6e672363abd81fdba4f60899f33
[ "PostgreSQL" ]
1
2021-08-29T13:17:52.000Z
2021-08-29T13:17:52.000Z
<?php /** * @package Joomla.Platform * @subpackage Crypt * * @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; /** * JCrypt cipher interface. * * @since 12.1 */ interface JCryptCipher { /** * Method to decrypt a data string. * * @param string $data The encrypted string to decrypt. * @param JCryptKey $key The key[/pair] object to use for decryption. * * @return string The decrypted data string. * * @since 12.1 */ public function decrypt($data, JCryptKey $key); /** * Method to encrypt a data string. * * @param string $data The data string to encrypt. * @param JCryptKey $key The key[/pair] object to use for encryption. * * @return string The encrypted data string. * * @since 12.1 */ public function encrypt($data, JCryptKey $key); /** * Method to generate a new encryption key[/pair] object. * * @param array $options Key generation options. * * @return JCryptKey * * @since 12.1 */ public function generateKey(array $options = array()); }
22.407407
88
0.636364
23e572ef9d2286ce73d16fee3b01a1170956b3f0
256
js
JavaScript
app/vuex/modules/counter.js
vianvio/babyMoveCounter
b6f52ce42b9abbf352d324ff30c58d4ce98c032b
[ "MIT" ]
6
2016-07-04T08:49:33.000Z
2020-02-14T07:49:25.000Z
app/vuex/modules/counter.js
vianvio/babyMoveCounter
b6f52ce42b9abbf352d324ff30c58d4ce98c032b
[ "MIT" ]
1
2022-03-07T07:35:26.000Z
2022-03-07T07:35:26.000Z
app/vuex/modules/counter.js
vianvio/babyMoveCounter
b6f52ce42b9abbf352d324ff30c58d4ce98c032b
[ "MIT" ]
null
null
null
import { INCREMENT_TOTAL_COUNT } from '../mutation-types' // initial state const state = { totalMoveCount: 0 } // mutations const mutations = { [INCREMENT_TOTAL_COUNT](state) { state.totalMoveCount += 1 } } export default { state, mutations }
13.473684
62
0.691406
8e5665af7a53bcabebb35394213d0fb0eb1848aa
1,017
js
JavaScript
action.getEnergy.js
colieham76/fantastic-trains-master2
9f9eac1de274774d67953fb68ae60b857096fa08
[ "MIT" ]
null
null
null
action.getEnergy.js
colieham76/fantastic-trains-master2
9f9eac1de274774d67953fb68ae60b857096fa08
[ "MIT" ]
null
null
null
action.getEnergy.js
colieham76/fantastic-trains-master2
9f9eac1de274774d67953fb68ae60b857096fa08
[ "MIT" ]
null
null
null
module.exports = { run: function(creep) { var [resourceID, ifDropped] = evaluateEnergyResources(creep, true, true, true, false); // find energy function in myFunctions if (resourceID !== undefined) { energy = Game.getObjectById(resourceID); if (ifDropped) { // if energy is dropped if (creep.pickup(energy) === ERR_NOT_IN_RANGE) { creep.travelTo(energy); } } } /* else { // energy is from container, storage or link if (creep.withdraw(energy, RESOURCE_ENERGY) === ERR_NOT_IN_RANGE) { creep.travelTo(energy); } } else { // room level too low, go for resources if (creep.harvest(Game.getObjectById(ifDropped)) === ERR_NOT_IN_RANGE) { creep.travelTo(Game.getObjectById(ifDropped)); } } */ } };
29.057143
82
0.491642
3efec316c301cede294498929813b1db3a14b7d0
1,494
js
JavaScript
environment-configs/database.js
punitrathore/live-coding-repos
d2457ba974b7ea731cf61bae68b019aec64f4490
[ "MIT" ]
null
null
null
environment-configs/database.js
punitrathore/live-coding-repos
d2457ba974b7ea731cf61bae68b019aec64f4490
[ "MIT" ]
null
null
null
environment-configs/database.js
punitrathore/live-coding-repos
d2457ba974b7ea731cf61bae68b019aec64f4490
[ "MIT" ]
null
null
null
const pgp = require('pg-promise')() const {getConfig, getEnv} = require('./config/config'); const config = getConfig(getEnv()) const connectionString = process.env.DATABASE_URL || config.dbUrl const db = pgp(connectionString) const createContact = function(contact, callback){ return db.query(` INSERT INTO contacts (first_name, last_name) VALUES ($1::text, $2::text) RETURNING * `, [ contact.first_name, contact.last_name, ]) .then(data => data) .catch(error => error); } const getContacts = function(){ return db.query(` SELECT * FROM contacts `, []) .then(data => data) .catch(error => error); } const getContact = function(contactId){ return db.one(` SELECT * FROM contacts WHERE id=$1::int LIMIT 1 `, [contactId]) .then(data => data) .catch(error => error); } const deleteContact = function(contactId){ return db.query(` DELETE FROM contacts WHERE id=$1::int `, [contactId]) .then(data => data) .catch(error => error); } const searchForContact = function(searchQuery){ return db.query(` SELECT * FROM contacts WHERE lower(first_name || ' ' || last_name) LIKE $1::text `, [`%${searchQuery.toLowerCase().replace(/\s+/,'%')}%`]) .then(data => data) .catch(error => error); } module.exports = { createContact, getContacts, getContact, deleteContact, searchForContact, }
19.153846
65
0.599732
2c83d6c6d98de50292a039b0f0d8c42a9f4bd009
1,022
py
Python
setup.py
giantas/configreader
9d35b4fc13bb20343d52eeeb1154ac464627d164
[ "MIT" ]
null
null
null
setup.py
giantas/configreader
9d35b4fc13bb20343d52eeeb1154ac464627d164
[ "MIT" ]
null
null
null
setup.py
giantas/configreader
9d35b4fc13bb20343d52eeeb1154ac464627d164
[ "MIT" ]
null
null
null
from setuptools import setup try: import pypandoc long_description = pypandoc.convert_file('README.md', 'rst') except (ImportError, OSError, RuntimeError): long_description = 'Usage available at http://github.com/giantas/pyconfigreader' setup(name='pyconfigreader', version='0.10.0', description='A module for handling simple configuration requirements', long_description=long_description, url='http://github.com/giantas/pyconfigreader', author='Aswa Paul', license='MIT', packages=['pyconfigreader'], install_requires=[], zip_safe=False, python_requires='>3.4, <3.10', classifiers=[ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", ] )
34.066667
84
0.632094
18489c312149ee70d7cf128a71238dca8fd17967
3,906
swift
Swift
navigatAR/navigatAR/Location.swift
samsgates/navigatAR
aebfc30edfd0730c1c173c04af4d561a0b0c1323
[ "MIT" ]
null
null
null
navigatAR/navigatAR/Location.swift
samsgates/navigatAR
aebfc30edfd0730c1c173c04af4d561a0b0c1323
[ "MIT" ]
null
null
null
navigatAR/navigatAR/Location.swift
samsgates/navigatAR
aebfc30edfd0730c1c173c04af4d561a0b0c1323
[ "MIT" ]
2
2019-04-30T13:17:28.000Z
2020-08-13T06:20:17.000Z
// // Location.swift // navigatAR // // Created by Nick Clifford on 2/3/18. // Copyright © 2018 MICDS Programming. All rights reserved. // import CoreLocation import IndoorAtlas // NOTE: This is used instead of just IALocation because of Codable conformance. struct Location: Codable { let latitude: CLLocationDegrees let longitude: CLLocationDegrees let altitude: CLLocationDistance let floor: Int let verticalAccuracy: CLLocationAccuracy let horizontalAccuracy: CLLocationAccuracy init(fromIALocation ial: IALocation) { latitude = ial.location!.coordinate.latitude longitude = ial.location!.coordinate.longitude altitude = ial.location!.altitude floor = ial.floor!.level verticalAccuracy = ial.location!.verticalAccuracy horizontalAccuracy = ial.location!.horizontalAccuracy } func distanceDeltas(with other: Location) -> (latitude: Double, longitude: Double, altitude: Double) { // // https://en.wikipedia.org/wiki/Geographic_coordinate_system#Expressing_latitude_and_longitude_as_linear_units // let latRadians = degreesToRadians(latitude) // // Swift compiler is having difficulty parsing these all inlined for whatever reason // let val1 = 559.82 * cos(2 * latRadians) // let val2 = 1.175 * cos(4 * latRadians) // let val3 = 0.0023 * cos(6 * latRadians) // let metersPerLatitude = 111132.92 - val1 + val2 - val3 // // let longRadians = degreesToRadians(longitude) // let metersPerLongitude = (111412.84 * cos(longRadians)) - (93.5 * cos(3 * longRadians)) + (0.118 * cos(5 * longRadians)) // // return (latitude: (other.latitude - latitude) * metersPerLatitude, longitude: (other.longitude - longitude) * metersPerLongitude, altitude: (other.altitude - altitude)) let latDiff = other.latitude - latitude let longDiff = other.longitude - longitude let altDiff = other.altitude - altitude // Calculate offset (in meters) // https://gis.stackexchange.com/a/2964 let averageLat = (latitude + other.latitude) / 2 let longOffset = longDiff * 111111 let latOffset = latDiff * 111111 * cos(degreesToRadians(averageLat)) return (latitude: latOffset, longitude: longOffset, altitude: altDiff) } func distanceTo(_ other: Location) -> Double { let (deltaLat, deltaLong, deltaAlt) = distanceDeltas(with: other) return sqrt(pow(deltaLat, 2) + pow(deltaLong, 2) + pow(deltaAlt, 2)) } func toCLLocationCoordinate2D() -> CLLocationCoordinate2D { return CLLocationCoordinate2D(latitude: self.latitude, longitude: self.longitude) } } extension CLLocation { func distanceDeltas(with other: Location) -> (latitude: Double, longitude: Double, altitude: Double) { // // https://en.wikipedia.org/wiki/Geographic_coordinate_system#Expressing_latitude_and_longitude_as_linear_units // let latRadians = degreesToRadians(latitude) // // Swift compiler is having difficulty parsing these all inlined for whatever reason // let val1 = 559.82 * cos(2 * latRadians) // let val2 = 1.175 * cos(4 * latRadians) // let val3 = 0.0023 * cos(6 * latRadians) // let metersPerLatitude = 111132.92 - val1 + val2 - val3 // // let longRadians = degreesToRadians(longitude) // let metersPerLongitude = (111412.84 * cos(longRadians)) - (93.5 * cos(3 * longRadians)) + (0.118 * cos(5 * longRadians)) // // return (latitude: (other.latitude - latitude) * metersPerLatitude, longitude: (other.longitude - longitude) * metersPerLongitude, altitude: (other.altitude - altitude)) let latDiff = other.latitude - coordinate.latitude let longDiff = other.longitude - coordinate.longitude let altDiff = other.altitude - altitude // Calculate offset (in meters) // https://gis.stackexchange.com/a/2964 let averageLat = (coordinate.latitude + other.latitude) / 2 let longOffset = longDiff * 111111 let latOffset = latDiff * 111111 * cos(degreesToRadians(averageLat)) return (latitude: latOffset, longitude: longOffset, altitude: altDiff) } }
39.857143
172
0.736559
2cd1ac3fb25fb98b56eaa28c3651066337683585
5,618
cpp
C++
Engine/Source/Runtime/Projects/Private/PluginReferenceDescriptor.cpp
windystrife/UnrealEngine_NVIDIAGameWork
b50e6338a7c5b26374d66306ebc7807541ff815e
[ "MIT" ]
1
2022-01-29T18:36:12.000Z
2022-01-29T18:36:12.000Z
Engine/Source/Runtime/Projects/Private/PluginReferenceDescriptor.cpp
windystrife/UnrealEngine_NVIDIAGameWork
b50e6338a7c5b26374d66306ebc7807541ff815e
[ "MIT" ]
null
null
null
Engine/Source/Runtime/Projects/Private/PluginReferenceDescriptor.cpp
windystrife/UnrealEngine_NVIDIAGameWork
b50e6338a7c5b26374d66306ebc7807541ff815e
[ "MIT" ]
null
null
null
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. #include "PluginReferenceDescriptor.h" #include "Misc/FileHelper.h" #include "Serialization/JsonReader.h" #include "Serialization/JsonSerializer.h" #include "ProjectDescriptor.h" #define LOCTEXT_NAMESPACE "PluginDescriptor" FPluginReferenceDescriptor::FPluginReferenceDescriptor( const FString& InName, bool bInEnabled ) : Name(InName) , bEnabled(bInEnabled) , bOptional(false) { } bool FPluginReferenceDescriptor::IsEnabledForPlatform( const FString& Platform ) const { // If it's not enabled at all, return false if(!bEnabled) { return false; } // If there is a list of whitelisted platforms, and this isn't one of them, return false if(WhitelistPlatforms.Num() > 0 && !WhitelistPlatforms.Contains(Platform)) { return false; } // If this platform is blacklisted, also return false if(BlacklistPlatforms.Contains(Platform)) { return false; } return true; } bool FPluginReferenceDescriptor::IsEnabledForTarget(const FString& Target) const { // If it's not enabled at all, return false if (!bEnabled) { return false; } // If there is a list of whitelisted platforms, and this isn't one of them, return false if (WhitelistTargets.Num() > 0 && !WhitelistTargets.Contains(Target)) { return false; } // If this platform is blacklisted, also return false if (BlacklistTargets.Contains(Target)) { return false; } return true; } bool FPluginReferenceDescriptor::IsSupportedTargetPlatform(const FString& Platform) const { return SupportedTargetPlatforms.Num() == 0 || SupportedTargetPlatforms.Contains(Platform); } bool FPluginReferenceDescriptor::Read( const FJsonObject& Object, FText& OutFailReason ) { // Get the name if(!Object.TryGetStringField(TEXT("Name"), Name)) { OutFailReason = LOCTEXT("PluginReferenceWithoutName", "Plugin references must have a 'Name' field"); return false; } // Get the enabled field if(!Object.TryGetBoolField(TEXT("Enabled"), bEnabled)) { OutFailReason = LOCTEXT("PluginReferenceWithoutEnabled", "Plugin references must have an 'Enabled' field"); return false; } // Read the optional field Object.TryGetBoolField(TEXT("Optional"), bOptional); // Read the metadata for users that don't have the plugin installed Object.TryGetStringField(TEXT("Description"), Description); Object.TryGetStringField(TEXT("MarketplaceURL"), MarketplaceURL); // Get the platform lists Object.TryGetStringArrayField(TEXT("WhitelistPlatforms"), WhitelistPlatforms); Object.TryGetStringArrayField(TEXT("BlacklistPlatforms"), BlacklistPlatforms); // Get the target lists Object.TryGetStringArrayField(TEXT("WhitelistTargets"), WhitelistTargets); Object.TryGetStringArrayField(TEXT("BlacklistTargets"), BlacklistTargets); // Get the supported platform list Object.TryGetStringArrayField(TEXT("SupportedTargetPlatforms"), SupportedTargetPlatforms); return true; } bool FPluginReferenceDescriptor::ReadArray( const FJsonObject& Object, const TCHAR* Name, TArray<FPluginReferenceDescriptor>& OutPlugins, FText& OutFailReason ) { const TArray< TSharedPtr<FJsonValue> > *Array; if (Object.TryGetArrayField(Name, Array)) { for (const TSharedPtr<FJsonValue> &Item : *Array) { const TSharedPtr<FJsonObject> *ObjectPtr; if (Item.IsValid() && Item->TryGetObject(ObjectPtr)) { FPluginReferenceDescriptor Plugin; if (!Plugin.Read(*ObjectPtr->Get(), OutFailReason)) { return false; } OutPlugins.Add(Plugin); } } } return true; } void FPluginReferenceDescriptor::Write( TJsonWriter<>& Writer ) const { Writer.WriteObjectStart(); Writer.WriteValue(TEXT("Name"), Name); Writer.WriteValue(TEXT("Enabled"), bEnabled); if (bEnabled && bOptional) { Writer.WriteValue(TEXT("Optional"), bOptional); } if (Description.Len() > 0) { Writer.WriteValue(TEXT("Description"), Description); } if (MarketplaceURL.Len() > 0) { Writer.WriteValue(TEXT("MarketplaceURL"), MarketplaceURL); } if (WhitelistPlatforms.Num() > 0) { Writer.WriteArrayStart(TEXT("WhitelistPlatforms")); for (int Idx = 0; Idx < WhitelistPlatforms.Num(); Idx++) { Writer.WriteValue(WhitelistPlatforms[Idx]); } Writer.WriteArrayEnd(); } if (BlacklistPlatforms.Num() > 0) { Writer.WriteArrayStart(TEXT("BlacklistPlatforms")); for (int Idx = 0; Idx < BlacklistPlatforms.Num(); Idx++) { Writer.WriteValue(BlacklistPlatforms[Idx]); } Writer.WriteArrayEnd(); } if (WhitelistTargets.Num() > 0) { Writer.WriteArrayStart(TEXT("WhitelistTargets")); for (int Idx = 0; Idx < WhitelistTargets.Num(); Idx++) { Writer.WriteValue(WhitelistTargets[Idx]); } Writer.WriteArrayEnd(); } if (BlacklistTargets.Num() > 0) { Writer.WriteArrayStart(TEXT("BlacklistTargets")); for (int Idx = 0; Idx < BlacklistTargets.Num(); Idx++) { Writer.WriteValue(BlacklistTargets[Idx]); } Writer.WriteArrayEnd(); } if (SupportedTargetPlatforms.Num() > 0) { Writer.WriteArrayStart(TEXT("SupportedTargetPlatforms")); for (int Idx = 0; Idx < SupportedTargetPlatforms.Num(); Idx++) { Writer.WriteValue(SupportedTargetPlatforms[Idx]); } Writer.WriteArrayEnd(); } Writer.WriteObjectEnd(); } void FPluginReferenceDescriptor::WriteArray( TJsonWriter<>& Writer, const TCHAR* Name, const TArray<FPluginReferenceDescriptor>& Plugins ) { if( Plugins.Num() > 0) { Writer.WriteArrayStart(Name); for (int Idx = 0; Idx < Plugins.Num(); Idx++) { Plugins[Idx].Write(Writer); } Writer.WriteArrayEnd(); } } #undef LOCTEXT_NAMESPACE
23.805085
160
0.719829
ddcee47745756e805909101828d574844ab37c08
2,719
java
Java
mavenbook-coding-parent/test-rocketmq-client/src/main/java/org/jobshen/producers/demo/MutliProducerTest.java
kitdine/some_research
cf0a2969804bdfb588f0ade8284e7eb14ed1df10
[ "Apache-2.0" ]
null
null
null
mavenbook-coding-parent/test-rocketmq-client/src/main/java/org/jobshen/producers/demo/MutliProducerTest.java
kitdine/some_research
cf0a2969804bdfb588f0ade8284e7eb14ed1df10
[ "Apache-2.0" ]
null
null
null
mavenbook-coding-parent/test-rocketmq-client/src/main/java/org/jobshen/producers/demo/MutliProducerTest.java
kitdine/some_research
cf0a2969804bdfb588f0ade8284e7eb14ed1df10
[ "Apache-2.0" ]
null
null
null
/** * Filename MutliProducerTest.java Create on 2015年6月25日 Copyright 2015 ddsoucai All Rights Reserved. */ package org.jobshen.producers.demo; import org.apache.log4j.Level; import org.apache.log4j.Logger; import com.alibaba.rocketmq.client.producer.DefaultMQProducer; import com.alibaba.rocketmq.client.producer.SendResult; import com.alibaba.rocketmq.common.message.Message; /** * Description: * * @author <a href="mailto:shenchenbo@ddsoucai.cn">Job Shen</a> * @since version1.0 */ public class MutliProducerTest { public static final Logger logger = Logger.getLogger(MutliProducerTest.class); public static void main(String[] args) { /** * 一个应用创建一个Producer,由应用来维护此对象,可以设置为全局对象或者单例 注意:ProducerGroupName需要由应用来保证唯一 * ProducerGroup这个概念发送普通的消息时,作用不大,但是发送分布式事务消息时,比较关键, 因为服务器会回查这个Group下的任意一个Producer */ DefaultMQProducer producer = new DefaultMQProducer("ProducerGroupName"); producer.setNamesrvAddr("192.168.3.71:9876"); producer.setInstanceName("Producer"); try { /** * Producer对象在使用之前必须要调用start初始化,初始化一次即可<br> * 注意:切记不可以在每次发送消息时,都调用start方法 */ producer.start(); Message msg = new Message("PushTopic", // topic "push", // tag "1", // key "Just a test.".getBytes() // body ); SendResult result = producer.send(msg); if (logger.isEnabledFor(Level.INFO)) { logger.info("id:" + result.getMsgId() + ",result:" + result.getSendStatus()); } msg = new Message("PushTopic", "pull", "2", "Just a test.".getBytes()); result = producer.send(msg); if (logger.isEnabledFor(Level.INFO)) { logger.info("id:" + result.getMsgId() + ",result:" + result.getSendStatus()); } msg = new Message("PullTopic", "push", "3", "Just a test.".getBytes()); result = producer.send(msg); if (logger.isEnabledFor(Level.INFO)) { logger.info("id:" + result.getMsgId() + ",result:" + result.getSendStatus()); } /** * 应用退出时,要调用shutdown来清理资源,关闭网络连接,从MetaQ服务器上注销自己 * 注意:我们建议应用在JBOSS、Tomcat等容器的退出钩子里调用shutdown方法 */ // producer.shutdown(); } catch (Exception e) { if (logger.isEnabledFor(Level.INFO)) { logger.info("something wrong when send mq!"); logger.info(e.getMessage()); } } } }
36.253333
100
0.558293
5807acc4bcf6f1f7a6caf181540182bd704ce4c9
113
css
CSS
test/fixtures/baz.css
Joris-van-der-Wel/node-module-references
bd900cea921add4230e17847b94d03b1bc970d39
[ "MIT" ]
null
null
null
test/fixtures/baz.css
Joris-van-der-Wel/node-module-references
bd900cea921add4230e17847b94d03b1bc970d39
[ "MIT" ]
1
2015-05-26T10:37:22.000Z
2015-05-26T10:37:22.000Z
test/fixtures/baz.css
Joris-van-der-Wel/node-module-references
bd900cea921add4230e17847b94d03b1bc970d39
[ "MIT" ]
null
null
null
/* baz.css */ /* This will cause a syntax error if it is included as a node module */ p { opacity: 0.8; }
22.6
71
0.60177
bb575ba0a690a965f09b7e679210545978c65f6c
590
cs
C#
MvvmCross/ViewModels/IMvxChildViewModelCache.cs
sm-g/MvvmCross
1fb5ad71c6b72533c92364ec405936bda8aa8873
[ "MS-PL" ]
3
2017-08-17T08:31:44.000Z
2019-09-02T12:58:48.000Z
MvvmCross/ViewModels/IMvxChildViewModelCache.cs
sm-g/MvvmCross
1fb5ad71c6b72533c92364ec405936bda8aa8873
[ "MS-PL" ]
3
2020-02-26T00:10:38.000Z
2021-09-27T22:25:58.000Z
MvvmCross/ViewModels/IMvxChildViewModelCache.cs
sm-g/MvvmCross
1fb5ad71c6b72533c92364ec405936bda8aa8873
[ "MS-PL" ]
5
2019-04-29T23:17:25.000Z
2020-01-16T07:22:10.000Z
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MS-PL license. // See the LICENSE file in the project root for more information. using System; using MvvmCross.ViewModels; namespace MvvmCross.ViewModels { public interface IMvxChildViewModelCache { int Cache(IMvxViewModel viewModel); IMvxViewModel Get(int index); IMvxViewModel Get(Type viewModelType); void Remove(int index); void Remove(Type viewModelType); bool Exists(Type viewModelType); } }
23.6
73
0.70678
a69cfbed8eb4a84c050466cc10e5c8137172682d
343
dart
Dart
lib/screen/Home/models/repository.dart
nnecec/fluhub
af29fbb74c6767d37506a0d22a71ad129a71abad
[ "MIT" ]
null
null
null
lib/screen/Home/models/repository.dart
nnecec/fluhub
af29fbb74c6767d37506a0d22a71ad129a71abad
[ "MIT" ]
null
null
null
lib/screen/Home/models/repository.dart
nnecec/fluhub
af29fbb74c6767d37506a0d22a71ad129a71abad
[ "MIT" ]
null
null
null
final String repositoryDocument = ''' query ReadRepositories(\$owner: String!, \$name: String!){ repository(owner: \$owner, name: \$name) { owner{ login } name primaryLanguage{ color name } description stargazers{ totalCount } updatedAt } } ''';
18.052632
60
0.516035
e2a7cccb11aa1d6ab91152275fb7347ced998c4e
19,207
sql
SQL
DB/proyecto.sql
codigosanha/proyecto
c3eb990ac18a301b6a68396a2a20b55ef8c73531
[ "MIT" ]
null
null
null
DB/proyecto.sql
codigosanha/proyecto
c3eb990ac18a301b6a68396a2a20b55ef8c73531
[ "MIT" ]
null
null
null
DB/proyecto.sql
codigosanha/proyecto
c3eb990ac18a301b6a68396a2a20b55ef8c73531
[ "MIT" ]
null
null
null
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 20-07-2019 a las 22:15:02 -- Versión del servidor: 10.1.38-MariaDB -- Versión de PHP: 7.3.3 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; 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 utf8mb4 */; -- -- Base de datos: `proyecto` -- -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `activos` -- CREATE TABLE `activos` ( `id` int(11) NOT NULL, `nombre` varchar(45) DEFAULT NULL, `precio` varchar(45) DEFAULT NULL, `empleado_id` int(11) DEFAULT NULL, `estado` tinyint(1) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `categorias` -- CREATE TABLE `categorias` ( `id` int(11) NOT NULL, `nombre` varchar(45) DEFAULT NULL, `estado` tinyint(1) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Volcado de datos para la tabla `categorias` -- INSERT INTO `categorias` (`id`, `nombre`, `estado`) VALUES (1, 'Antibioticos', 1), (2, 'Vitaminas', 1), (3, 'Analgesicos', 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `clientes` -- CREATE TABLE `clientes` ( `id` int(11) NOT NULL, `nombres` varchar(45) DEFAULT NULL, `direccion` varchar(45) DEFAULT NULL, `telefono` varchar(10) DEFAULT NULL, `estado` tinyint(1) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `compras` -- CREATE TABLE `compras` ( `id` int(11) NOT NULL, `fecha` varchar(45) DEFAULT NULL, `total` varchar(45) DEFAULT NULL, `proveedor_id` int(11) DEFAULT NULL, `usuario_id` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `departamentos` -- CREATE TABLE `departamentos` ( `id` int(11) NOT NULL, `nombre` varchar(45) DEFAULT NULL, `estado` tinyint(1) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Volcado de datos para la tabla `departamentos` -- INSERT INTO `departamentos` (`id`, `nombre`, `estado`) VALUES (1, 'Alta Verapaz', 1), (2, 'Baja Verapaz', 1), (3, 'Chimaltenango', 1), (4, 'Chiquimula', 1), (5, 'Peten', 1), (6, 'El Progreso', 1), (7, 'Quiche', 1), (8, 'Escuintla', 1), (9, 'Guatemala', 1), (10, 'Huehutenango', 1), (11, 'Izabal', 1), (12, 'Jalapa', 1), (13, 'Jutiapa', 1), (14, 'Quetzaltenango', 1), (15, 'Retalhuleu', 1), (16, 'Sacatepequez', 1), (17, 'San Marcos', 1), (18, 'Santa Rosa', 1), (19, 'Solola', 1), (20, 'Suchitepequez', 1), (21, 'Totonicapan', 1), (22, 'Zacapa', 1), (23, 'Prueba', 0); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `detalle_compra` -- CREATE TABLE `detalle_compra` ( `id` int(11) NOT NULL, `compra_id` int(11) DEFAULT NULL, `producto_id` int(11) DEFAULT NULL, `cantidad` varchar(45) DEFAULT NULL, `importe` varchar(45) DEFAULT NULL, `precio` decimal(8,2) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `detalle_pedido` -- CREATE TABLE `detalle_pedido` ( `id` int(11) NOT NULL, `pedido_id` int(11) DEFAULT NULL, `producto_id` int(11) DEFAULT NULL, `cantidad` int(11) DEFAULT NULL, `precio` decimal(8,2) DEFAULT NULL, `importe` decimal(8,2) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `detalle_venta` -- CREATE TABLE `detalle_venta` ( `id` int(11) NOT NULL, `venta_id` int(11) DEFAULT NULL, `producto_id` int(11) DEFAULT NULL, `cantidad` int(11) DEFAULT NULL, `importe` decimal(8,2) DEFAULT NULL, `precio` decimal(8,2) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `empleados` -- CREATE TABLE `empleados` ( `id` int(11) NOT NULL, `nombre` varchar(45) DEFAULT NULL, `apellido` varchar(45) DEFAULT NULL, `puesto_trabajo` varchar(45) DEFAULT NULL, `sueldo` varchar(45) DEFAULT NULL, `sucursal_id` int(11) DEFAULT NULL, `estado` tinyint(1) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Volcado de datos para la tabla `empleados` -- INSERT INTO `empleados` (`id`, `nombre`, `apellido`, `puesto_trabajo`, `sueldo`, `sucursal_id`, `estado`) VALUES (1, 'Gary', 'Cano', 'Vendedor', '3500', 1, 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `inventario` -- CREATE TABLE `inventario` ( `id` int(11) NOT NULL, `sucursal_id` int(11) DEFAULT NULL, `producto_id` int(11) DEFAULT NULL, `stock` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `marcas` -- CREATE TABLE `marcas` ( `id` int(11) NOT NULL, `nombre` varchar(45) DEFAULT NULL, `estado` tinyint(1) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Volcado de datos para la tabla `marcas` -- INSERT INTO `marcas` (`id`, `nombre`, `estado`) VALUES (1, 'Bayer', 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `pagos` -- CREATE TABLE `pagos` ( `id` int(11) NOT NULL, `empleado_id` int(11) DEFAULT NULL, `fecha` date DEFAULT NULL, `mes` varchar(45) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `pedidos` -- CREATE TABLE `pedidos` ( `id` int(11) NOT NULL, `cliente_id` int(11) DEFAULT NULL, `fecha` datetime DEFAULT NULL, `fecha_entrega` datetime DEFAULT NULL, `forma_pago` varchar(45) DEFAULT NULL, `estado` tinyint(1) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `presentaciones` -- CREATE TABLE `presentaciones` ( `id` int(11) NOT NULL, `nombre` varchar(45) DEFAULT NULL, `estado` tinyint(1) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Volcado de datos para la tabla `presentaciones` -- INSERT INTO `presentaciones` (`id`, `nombre`, `estado`) VALUES (1, 'Tableta', 1), (2, 'Frasco', 1), (3, 'Gotero', 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `productos` -- CREATE TABLE `productos` ( `id` int(11) NOT NULL, `cod_barras` varchar(45) DEFAULT NULL, `nombre` varchar(45) DEFAULT NULL, `precio_compra` decimal(8,2) DEFAULT NULL, `precio_venta` decimal(8,2) DEFAULT NULL, `descripcion` varchar(45) DEFAULT NULL, `categoria_id` int(11) DEFAULT NULL, `marca_id` int(11) DEFAULT NULL, `presentacion_id` int(11) DEFAULT NULL, `estado` tinyint(1) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `proveedores` -- CREATE TABLE `proveedores` ( `id` int(11) NOT NULL, `nit` varchar(45) DEFAULT NULL, `razon_social` varchar(50) DEFAULT NULL, `direccion` varchar(45) DEFAULT NULL, `telefono` varchar(45) DEFAULT NULL, `estado` tinyint(1) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Volcado de datos para la tabla `proveedores` -- INSERT INTO `proveedores` (`id`, `nit`, `razon_social`, `direccion`, `telefono`, `estado`) VALUES (1, '4788965-1', 'Lanfer', '1a Av 12 Calle Zona 1 ', '22321907', 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `sucursal` -- CREATE TABLE `sucursal` ( `id` int(11) NOT NULL, `nombre` varchar(45) DEFAULT NULL, `telefono` varchar(45) DEFAULT NULL, `departamento_id` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Volcado de datos para la tabla `sucursal` -- INSERT INTO `sucursal` (`id`, `nombre`, `telefono`, `departamento_id`) VALUES (1, 'Pradera Xela', '77887777', 14), (2, 'Interplaza', '45459898', 14); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `usuarios` -- CREATE TABLE `usuarios` ( `id` int(11) NOT NULL, `username` varchar(45) DEFAULT NULL, `password` varchar(45) DEFAULT NULL, `empleado_id` int(11) DEFAULT NULL, `rol` int(11) DEFAULT NULL, `estado` tinyint(1) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Volcado de datos para la tabla `usuarios` -- INSERT INTO `usuarios` (`id`, `username`, `password`, `empleado_id`, `rol`, `estado`) VALUES (1, 'gcano', 'b2ffdbeb87e8e6331d350b482b328d309bc5a321', 1, 1, 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `ventas` -- CREATE TABLE `ventas` ( `id` int(11) NOT NULL, `serie` varchar(10) DEFAULT NULL, `correlativo` varchar(45) DEFAULT NULL, `fecha` varchar(45) DEFAULT NULL, `total` varchar(45) DEFAULT NULL, `cliente_id` int(11) DEFAULT NULL, `usuario_id` int(11) DEFAULT NULL, `estado` tinyint(1) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Índices para tablas volcadas -- -- -- Indices de la tabla `activos` -- ALTER TABLE `activos` ADD PRIMARY KEY (`id`), ADD KEY `fk_activo_empleado_idx` (`empleado_id`); -- -- Indices de la tabla `categorias` -- ALTER TABLE `categorias` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `nombre_UNIQUE` (`nombre`); -- -- Indices de la tabla `clientes` -- ALTER TABLE `clientes` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `nombres_UNIQUE` (`nombres`); -- -- Indices de la tabla `compras` -- ALTER TABLE `compras` ADD PRIMARY KEY (`id`), ADD KEY `fk_proveedor_id_idx` (`proveedor_id`), ADD KEY `fk_usuario_id_idx` (`usuario_id`); -- -- Indices de la tabla `departamentos` -- ALTER TABLE `departamentos` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `detalle_compra` -- ALTER TABLE `detalle_compra` ADD PRIMARY KEY (`id`), ADD KEY `fk_detalle_compra_compra_idx` (`compra_id`), ADD KEY `fk_detalle_compra_producto_idx` (`producto_id`); -- -- Indices de la tabla `detalle_pedido` -- ALTER TABLE `detalle_pedido` ADD PRIMARY KEY (`id`), ADD KEY `fk_detalle_pedido_pedido_idx` (`pedido_id`), ADD KEY `fk_detalle_pedido_producto_idx` (`producto_id`); -- -- Indices de la tabla `detalle_venta` -- ALTER TABLE `detalle_venta` ADD PRIMARY KEY (`id`), ADD KEY `fk_detalle_venta_venta_idx` (`venta_id`), ADD KEY `fk_detalle_venta_producto_idx` (`producto_id`); -- -- Indices de la tabla `empleados` -- ALTER TABLE `empleados` ADD PRIMARY KEY (`id`), ADD KEY `fk_empleado_sucursal_idx` (`sucursal_id`); -- -- Indices de la tabla `inventario` -- ALTER TABLE `inventario` ADD PRIMARY KEY (`id`), ADD KEY `fk_inventario_sucursal_idx` (`sucursal_id`), ADD KEY `fk_inventario_producto_idx` (`producto_id`); -- -- Indices de la tabla `marcas` -- ALTER TABLE `marcas` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `pagos` -- ALTER TABLE `pagos` ADD PRIMARY KEY (`id`), ADD KEY `fk_pago_empleado_idx` (`empleado_id`); -- -- Indices de la tabla `pedidos` -- ALTER TABLE `pedidos` ADD PRIMARY KEY (`id`), ADD KEY `fk_pedido_cliente_idx` (`cliente_id`); -- -- Indices de la tabla `presentaciones` -- ALTER TABLE `presentaciones` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `productos` -- ALTER TABLE `productos` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `nombre_UNIQUE` (`nombre`), ADD KEY `fk_producto_categoria_idx` (`categoria_id`), ADD KEY `fk_producto_marca_idx` (`marca_id`), ADD KEY `fk_producto_presentacion_idx` (`presentacion_id`); -- -- Indices de la tabla `proveedores` -- ALTER TABLE `proveedores` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `sucursal` -- ALTER TABLE `sucursal` ADD PRIMARY KEY (`id`), ADD KEY `fk_sucursal_departamento_idx` (`departamento_id`); -- -- Indices de la tabla `usuarios` -- ALTER TABLE `usuarios` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `username_UNIQUE` (`username`), ADD KEY `fk_usuario_empleado_idx` (`empleado_id`); -- -- Indices de la tabla `ventas` -- ALTER TABLE `ventas` ADD PRIMARY KEY (`id`), ADD KEY `fk_venta_usuario_idx` (`usuario_id`), ADD KEY `fk_venta_cliente_idx` (`cliente_id`); -- -- AUTO_INCREMENT de las tablas volcadas -- -- -- AUTO_INCREMENT de la tabla `activos` -- ALTER TABLE `activos` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `categorias` -- ALTER TABLE `categorias` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT de la tabla `clientes` -- ALTER TABLE `clientes` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `compras` -- ALTER TABLE `compras` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `departamentos` -- ALTER TABLE `departamentos` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24; -- -- AUTO_INCREMENT de la tabla `detalle_compra` -- ALTER TABLE `detalle_compra` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `detalle_pedido` -- ALTER TABLE `detalle_pedido` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `detalle_venta` -- ALTER TABLE `detalle_venta` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `empleados` -- ALTER TABLE `empleados` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT de la tabla `inventario` -- ALTER TABLE `inventario` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `marcas` -- ALTER TABLE `marcas` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT de la tabla `pagos` -- ALTER TABLE `pagos` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `pedidos` -- ALTER TABLE `pedidos` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `presentaciones` -- ALTER TABLE `presentaciones` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT de la tabla `productos` -- ALTER TABLE `productos` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `proveedores` -- ALTER TABLE `proveedores` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT de la tabla `sucursal` -- ALTER TABLE `sucursal` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT de la tabla `usuarios` -- ALTER TABLE `usuarios` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT de la tabla `ventas` -- ALTER TABLE `ventas` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- Restricciones para tablas volcadas -- -- -- Filtros para la tabla `activos` -- ALTER TABLE `activos` ADD CONSTRAINT `fk_activo_empleado` FOREIGN KEY (`empleado_id`) REFERENCES `empleados` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `compras` -- ALTER TABLE `compras` ADD CONSTRAINT `fk_proveedor_id` FOREIGN KEY (`proveedor_id`) REFERENCES `proveedores` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_usuario_id` FOREIGN KEY (`usuario_id`) REFERENCES `usuarios` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `detalle_compra` -- ALTER TABLE `detalle_compra` ADD CONSTRAINT `fk_detalle_compra_compra` FOREIGN KEY (`compra_id`) REFERENCES `compras` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_detalle_compra_producto` FOREIGN KEY (`producto_id`) REFERENCES `productos` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `detalle_pedido` -- ALTER TABLE `detalle_pedido` ADD CONSTRAINT `fk_detalle_pedido_pedido` FOREIGN KEY (`pedido_id`) REFERENCES `pedidos` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_detalle_pedido_producto` FOREIGN KEY (`producto_id`) REFERENCES `productos` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `detalle_venta` -- ALTER TABLE `detalle_venta` ADD CONSTRAINT `fk_detalle_venta_producto` FOREIGN KEY (`producto_id`) REFERENCES `productos` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_detalle_venta_venta` FOREIGN KEY (`venta_id`) REFERENCES `ventas` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `empleados` -- ALTER TABLE `empleados` ADD CONSTRAINT `fk_empleado_sucursal` FOREIGN KEY (`sucursal_id`) REFERENCES `sucursal` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `inventario` -- ALTER TABLE `inventario` ADD CONSTRAINT `fk_inventario_producto` FOREIGN KEY (`producto_id`) REFERENCES `productos` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_inventario_sucursal` FOREIGN KEY (`sucursal_id`) REFERENCES `sucursal` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `pagos` -- ALTER TABLE `pagos` ADD CONSTRAINT `fk_pago_empleado` FOREIGN KEY (`empleado_id`) REFERENCES `empleados` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `pedidos` -- ALTER TABLE `pedidos` ADD CONSTRAINT `fk_pedido_cliente` FOREIGN KEY (`cliente_id`) REFERENCES `clientes` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `productos` -- ALTER TABLE `productos` ADD CONSTRAINT `fk_producto_categoria` FOREIGN KEY (`categoria_id`) REFERENCES `categorias` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_producto_marca` FOREIGN KEY (`marca_id`) REFERENCES `marcas` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_producto_presentacion` FOREIGN KEY (`presentacion_id`) REFERENCES `presentaciones` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `sucursal` -- ALTER TABLE `sucursal` ADD CONSTRAINT `fk_sucursal_departamento` FOREIGN KEY (`departamento_id`) REFERENCES `departamentos` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `usuarios` -- ALTER TABLE `usuarios` ADD CONSTRAINT `fk_usuario_empleado` FOREIGN KEY (`empleado_id`) REFERENCES `empleados` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Filtros para la tabla `ventas` -- ALTER TABLE `ventas` ADD CONSTRAINT `fk_venta_cliente` FOREIGN KEY (`cliente_id`) REFERENCES `clientes` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `fk_venta_usuario` FOREIGN KEY (`usuario_id`) REFERENCES `usuarios` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION; COMMIT; /*!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 */;
26.167575
151
0.660384
79a984e5f456e9d6cbc41cdb5ad3fc4e98c7e884
4,708
php
PHP
resources/views/my_modal_krok_2.blade.php
migdalius/blog
c11183eba35547bd8f4dcd78394641b13458c223
[ "MIT" ]
null
null
null
resources/views/my_modal_krok_2.blade.php
migdalius/blog
c11183eba35547bd8f4dcd78394641b13458c223
[ "MIT" ]
null
null
null
resources/views/my_modal_krok_2.blade.php
migdalius/blog
c11183eba35547bd8f4dcd78394641b13458c223
[ "MIT" ]
null
null
null
<div id="myModal" class="modal fade" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <h4 class="modal-title"></h4> <button type="button" class="close" data-dismiss="modal">&times;</button> </div> <div class="modal-body"> <form class="form-horizontal" role="form"> <div class="form-group"> <label class="control-label col-sm-2" for="id">ID:</label> <div class="col-sm-10"> <input type="number" class="form-control" id="id" disabled> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="dostawcadb">DOSTAWCA:</label> <div class="col-sm-10"> <input type="text" class="form-control" id="dostawcadb" disabled> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="kategoria">KATEGORIA:</label> <div class="col-sm-10"> <input type="text" class="form-control" id="kategoria" disabled> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="tag1">Tag1:</label> <div class="col-sm-10"> <input type="text" class="form-control" id="tag1"> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="tag2">Tag2:</label> <div class="col-sm-10"> <input type="text" class="form-control" id="tag2"> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="tag3">Tag3:</label> <div class="col-sm-10"> <input type="text" class="form-control" id="tag3"> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="tag4">Tag4:</label> <div class="col-sm-10"> <input type="text" class="form-control" id="tag4"> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="tag5">Tag5:</label> <div class="col-sm-10"> <input type="text" class="form-control" id="tag5"> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="tag6">Tag6:</label> <div class="col-sm-10"> <input type="text" class="form-control" id="tag6"> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="tag7">Tag7:</label> <div class="col-sm-10"> <input type="text" class="form-control" id="tag7"> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="tag8">Tag8:</label> <div class="col-sm-10"> <input type="text" class="form-control" id="tag8"> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="tag9">Tag9:</label> <div class="col-sm-10"> <input type="text" class="form-control" id="tag9"> </div> </div> <div class="form-group"> <label class="control-label col-sm-2" for="tag10">Tag10:</label> <div class="col-sm-10"> <input type="text" class="form-control" id="tag10"> </div> </div> </form> <div class="deleteContent"> Are you Sure you want to delete <span class="dname"></span> ? <span class="hidden did"></span> </div> <div class="modal-footer"> <button type="button" class="edit btn actionBtn" data-dismiss="modal"> <span id="footer_action_button" class='glyphicon'> </span> </button> <button type="button" class="btn btn-warning" data-dismiss="modal"> <span class='glyphicon glyphicon-remove'></span> Zamknij </button> </div> </div> </div> </div> </div>
40.93913
88
0.453271
3f53c227b7aa7a85a9e0a63479e37809ea6f51a1
531
rb
Ruby
projects/fourier/lib/fourier/services/lint/cocoapods_interactor.rb
erkekin/tuist
8ee2dd87a6953b4172e766154bc01090c10e3327
[ "MIT" ]
2,550
2018-07-23T12:22:36.000Z
2022-03-31T22:30:00.000Z
projects/fourier/lib/fourier/services/lint/cocoapods_interactor.rb
erkekin/tuist
8ee2dd87a6953b4172e766154bc01090c10e3327
[ "MIT" ]
2,445
2018-07-24T18:18:02.000Z
2022-03-31T18:16:47.000Z
projects/fourier/lib/fourier/services/lint/cocoapods_interactor.rb
erkekin/tuist
8ee2dd87a6953b4172e766154bc01090c10e3327
[ "MIT" ]
277
2018-07-25T18:25:06.000Z
2022-03-31T08:33:57.000Z
# frozen_string_literal: true module Fourier module Services module Lint class CocoapodsInteractor < Base attr_reader :fix def initialize(fix:) @fix = fix end def call directories = [ Constants::COCOAPODS_INTERACTOR_DIRECTORY, ] Utilities::RubocopLinter.lint( from: Constants::COCOAPODS_INTERACTOR_DIRECTORY, fix: fix, directories: directories ) end end end end end
19.666667
60
0.561205
b7fcd2f4e2ecfb6f1d5e23e919b6846c8ca73b77
424
cs
C#
CSharp/Syntax/10951/Program.cs
VontineDev/repos
0e98250a00d3deb0da4907898c3972222f14a5c8
[ "MIT" ]
null
null
null
CSharp/Syntax/10951/Program.cs
VontineDev/repos
0e98250a00d3deb0da4907898c3972222f14a5c8
[ "MIT" ]
null
null
null
CSharp/Syntax/10951/Program.cs
VontineDev/repos
0e98250a00d3deb0da4907898c3972222f14a5c8
[ "MIT" ]
null
null
null
using System; namespace _10952 { class Program { static void Main(string[] args) { string str; while ((str = Console.ReadLine()) != null) { string[] arr = str.Split(' '); int a = int.Parse(arr[0]); int b = int.Parse(arr[1]); Console.WriteLine($"{a}, {b}"); } } } }
23.555556
54
0.389151
01918cf877777417e2e2ac4c749cbc75c21c0866
1,633
sql
SQL
database/calendar.sql
medyalivacom/codeigniter-fullcalendar
4652ebe7195b34290d4380a0f4a6b7ee39aaae25
[ "MIT" ]
11
2017-01-17T14:31:03.000Z
2021-11-17T10:59:46.000Z
database/calendar.sql
medyalivacom/codeigniter-fullcalendar
4652ebe7195b34290d4380a0f4a6b7ee39aaae25
[ "MIT" ]
2
2018-10-13T22:13:36.000Z
2019-02-28T14:17:47.000Z
database/calendar.sql
medyalivacom/codeigniter-fullcalendar
4652ebe7195b34290d4380a0f4a6b7ee39aaae25
[ "MIT" ]
10
2018-10-06T21:47:52.000Z
2021-12-07T07:42:07.000Z
/* Navicat MySQL Data Transfer Source Server : LOCAL Source Server Version : 50505 Source Host : localhost:3306 Source Database : maid-chan Target Server Type : MYSQL Target Server Version : 50505 File Encoding : 65001 Date: 2017-01-16 23:20:37 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for calendar -- ---------------------------- DROP TABLE IF EXISTS `calendar`; CREATE TABLE `calendar` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(126) DEFAULT NULL, `description` text, `color` varchar(24) DEFAULT NULL, `start_date` date DEFAULT NULL, `end_date` date DEFAULT NULL, `create_at` datetime DEFAULT NULL, `create_by` varchar(64) DEFAULT NULL, `modified_at` datetime DEFAULT NULL, `modified_by` varchar(64) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1; -- ---------------------------- -- Records of calendar -- ---------------------------- INSERT INTO `calendar` VALUES ('1', 'KODEKU Event', '<p><b>Montepless </b>arbi</p>', '#FFD700', '2017-01-16', '2017-01-20', '2017-01-12 18:29:20', 'admin@maidchan.com', null, null); INSERT INTO `calendar` VALUES ('8', 'AREMA', '', '#40E0D0', '2017-01-01', '2017-01-03', '2017-01-12 20:04:49', 'admin@maidchan.com', null, null); INSERT INTO `calendar` VALUES ('9', 'Ngepil', '<p>asdasdsa</p>', '#008000', '2017-01-07', '2017-01-09', '2017-01-12 20:05:13', 'admin@maidchan.com', null, null); INSERT INTO `calendar` VALUES ('10', 'AREMA ', '', '#0071c5', '2017-01-01', '2017-01-02', '2017-01-12 20:05:50', 'admin@maidchan.com', null, null);
37.976744
181
0.620943
854356bd45052797b379fc7d094815baa6ae0cde
396
cs
C#
WebBlocks/WebBlocks.Interfaces/IBlockViewModel.cs
davidmason100/Web-Blocks
06ddc1e94ddedbcf4566c429d39ced62974af9ae
[ "MIT" ]
null
null
null
WebBlocks/WebBlocks.Interfaces/IBlockViewModel.cs
davidmason100/Web-Blocks
06ddc1e94ddedbcf4566c429d39ced62974af9ae
[ "MIT" ]
8
2018-06-02T01:17:00.000Z
2018-06-22T05:18:23.000Z
WebBlocks/WebBlocks.Interfaces/IBlockViewModel.cs
davidmason100/Web-Blocks
06ddc1e94ddedbcf4566c429d39ced62974af9ae
[ "MIT" ]
2
2020-02-06T13:45:55.000Z
2020-07-08T16:02:17.000Z
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WebBlocks.Interfaces { public interface IBlockViewModel { string Tag { get; set; } string Classes { get; set; } string Html { get; set; } bool ShouldRerender { get; set; } List<IBlockElementAttribute> Attributes { get; set; } } }
23.294118
62
0.616162
a36b1bcdf1339b27e6842c2ff3c21019cb5218b8
1,463
java
Java
src/main/java/edu/kit/ksri/paperfinder/util/FileUtils.java
scheja/paperfinder
6eebd41bb9df8b261d22a6ba992c3e7d40523a86
[ "MIT" ]
1
2016-01-22T11:36:10.000Z
2016-01-22T11:36:10.000Z
src/main/java/edu/kit/ksri/paperfinder/util/FileUtils.java
scheja/paperfinder
6eebd41bb9df8b261d22a6ba992c3e7d40523a86
[ "MIT" ]
null
null
null
src/main/java/edu/kit/ksri/paperfinder/util/FileUtils.java
scheja/paperfinder
6eebd41bb9df8b261d22a6ba992c3e7d40523a86
[ "MIT" ]
null
null
null
package edu.kit.ksri.paperfinder.util; /** * Created by janscheurenbrand on 10.08.14. */ import java.io.*; public class FileUtils { public static String readFile(String path) { File myFile = new File(path); FileInputStream fIn; try { if (!myFile.exists()) { if (myFile.getParentFile() != null) { myFile.getParentFile().mkdirs(); } myFile.createNewFile(); return ""; } fIn = new FileInputStream(myFile); BufferedReader myReader = new BufferedReader(new InputStreamReader(fIn)); String aDataRow = ""; String aBuffer = ""; while ((aDataRow = myReader.readLine()) != null) { aBuffer += aDataRow; } myReader.close(); return aBuffer; } catch (IOException e) { e.printStackTrace(); } return ""; } public static void writeFile(String content, String path) { File myFile = new File(path); try { myFile.createNewFile(); FileOutputStream fOut = new FileOutputStream(myFile); OutputStreamWriter myOutWriter = new OutputStreamWriter(fOut); myOutWriter.append(content); myOutWriter.close(); fOut.close(); } catch (IOException e) { e.printStackTrace(); } } }
28.686275
85
0.522898
ef84dc00f59ac15f9f70a50b0a708d10fe2f0e2c
515
h
C
HWCoreFramework/Utils/Foundation/NSArray+HWAdd.h
parallelWorld/HWCoreFramework
e8a4996d0413eece0186f0ecd52b03dd9ac14d83
[ "MIT" ]
1
2016-08-23T21:48:19.000Z
2016-08-23T21:48:19.000Z
HWCoreFramework/Utils/Foundation/NSArray+HWAdd.h
parallelWorld/HWCoreFramework
e8a4996d0413eece0186f0ecd52b03dd9ac14d83
[ "MIT" ]
null
null
null
HWCoreFramework/Utils/Foundation/NSArray+HWAdd.h
parallelWorld/HWCoreFramework
e8a4996d0413eece0186f0ecd52b03dd9ac14d83
[ "MIT" ]
null
null
null
#import <Foundation/Foundation.h> @interface NSArray (HWAdd) - (id)hw_objectOrNilAtIndex:(NSUInteger)index; @end @interface NSMutableArray (HWAdd) - (void)hw_insertObject:(id)anObject atIndex:(NSUInteger)index; - (void)hw_insertObjects:(NSArray *)objects atIndex:(NSUInteger)index; - (void)hw_reverse; #pragma mark - Stack & Queue - (void)hw_push:(id)anObject, ... NS_REQUIRES_NIL_TERMINATION; - (id)hw_pop; - (id)hw_shift; - (NSUInteger)hw_unshift:(id)anObject, ... NS_REQUIRES_NIL_TERMINATION; @end
17.758621
71
0.745631
27d212e49b8cd57aace13bd5c6042b827573aabb
737
html
HTML
_posts/2009-04-02-twitter.html
tommy-carlier/www.tcx.be
e20889d32158e0a57396136b781a5f6abc5fa958
[ "MIT" ]
null
null
null
_posts/2009-04-02-twitter.html
tommy-carlier/www.tcx.be
e20889d32158e0a57396136b781a5f6abc5fa958
[ "MIT" ]
null
null
null
_posts/2009-04-02-twitter.html
tommy-carlier/www.tcx.be
e20889d32158e0a57396136b781a5f6abc5fa958
[ "MIT" ]
null
null
null
--- layout: post title: "Twitter" --- <p>I’ve been trying out <a href="https://twitter.com/">Twitter</a> for about a week now. I’m still a bit skeptical about it, but I can see at least 1 advantage: there’s a very close contact between followers and followees. It’s a lot easier to write a quick tweet to someone than it is to comment on their blog. There’s a very convenient bi-directional communication. The 140 character limit is something to get used to, but it also makes you think about what you write. I do like the conventions of replying to someone or mentioning someone via <kbd>@</kbd>, or referencing an event via <kbd>#</kbd>. <p>My twitter address: <a href="https://twitter.com/tommycarlier"><var>@tommycarlier</var></a>.
92.125
601
0.744912
902d59f4e8be81022c47fb067274ba5c4dae94d5
813
go
Go
app/job/main/activity/dao/bnj/dao.go
78182648/blibli-go
7c717cc07073ff3397397fd3c01aa93234b142e3
[ "MIT" ]
22
2019-04-27T06:44:41.000Z
2022-02-04T16:54:14.000Z
app/job/main/activity/dao/bnj/dao.go
YouthAge/blibli-go
7c717cc07073ff3397397fd3c01aa93234b142e3
[ "MIT" ]
null
null
null
app/job/main/activity/dao/bnj/dao.go
YouthAge/blibli-go
7c717cc07073ff3397397fd3c01aa93234b142e3
[ "MIT" ]
34
2019-05-07T08:22:27.000Z
2022-03-25T08:14:56.000Z
package bnj import ( "time" "go-common/app/job/main/activity/conf" "go-common/library/cache/memcache" "go-common/library/net/http/blademaster" ) // Dao . type Dao struct { c *conf.Config client *blademaster.Client mc *memcache.Pool broadcastURL string messageURL string timeFinishExpire int32 lessTimeExpire int32 } // New . func New(c *conf.Config) *Dao { d := &Dao{ c: c, client: blademaster.NewClient(c.HTTPClient), mc: memcache.NewPool(c.Memcache.Like), } d.broadcastURL = d.c.Host.APICo + _broadURL d.messageURL = d.c.Host.MsgCo + _messageURL d.timeFinishExpire = int32(time.Duration(c.Memcache.TimeFinishExpire) / time.Second) d.lessTimeExpire = int32(time.Duration(c.Memcache.LessTimeExpire) / time.Second) return d }
23.228571
85
0.680197
3e890cc8dc9810d17013921e754ae98ac36d305f
808
sql
SQL
million-red-roses/src/test/resources/data.sql
pashkazp/red-roses
6536b7be2b3bdc3d06d2632c78171a25f54eceeb
[ "MIT" ]
null
null
null
million-red-roses/src/test/resources/data.sql
pashkazp/red-roses
6536b7be2b3bdc3d06d2632c78171a25f54eceeb
[ "MIT" ]
null
null
null
million-red-roses/src/test/resources/data.sql
pashkazp/red-roses
6536b7be2b3bdc3d06d2632c78171a25f54eceeb
[ "MIT" ]
null
null
null
INSERT INTO contacts (id,name) VALUES (1,'auctor non, feugiat nec,'); INSERT INTO contacts (id,name) VALUES (2,'mi fringilla mi lacinia mattis. Integer'); INSERT INTO contacts (id,name) VALUES (3,'arcu eu odio tristique'); INSERT INTO contacts (id,name) VALUES (4,'eros turpis non enim. Mauris quis turpis vitae purus gravida'); INSERT INTO contacts (id,name) VALUES (5,'Sed dictum.'); INSERT INTO contacts (id,name) VALUES (6,'leo. Morbi neque tellus, imperdiet non, vestibulum'); INSERT INTO contacts (id,name) VALUES (7,'Suspendisse sagittis.'); INSERT INTO contacts (id,name) VALUES (8,'ac urna. Ut'); INSERT INTO contacts (id,name) VALUES (9,'Nunc lectus pede, ultrices a, auctor non, feugiat nec, diam.'); INSERT INTO contacts (id,name) VALUES (10,'Aliquam ultrices iaculis odio. Nam interdum enim');
67.333333
105
0.737624
1aae66f1385b85c749d1a8e7e3b4123259c5c707
12,216
py
Python
annotation-cli.py
uclnlp/torch-imle
f595cd8d527466f6b5db79276f6ceee01d100a1c
[ "MIT" ]
205
2021-11-01T11:03:38.000Z
2022-02-17T07:47:28.000Z
annotation-cli.py
uclnlp/torch-imle
f595cd8d527466f6b5db79276f6ceee01d100a1c
[ "MIT" ]
1
2021-11-28T18:46:04.000Z
2021-11-28T18:46:04.000Z
annotation-cli.py
uclnlp/torch-imle
f595cd8d527466f6b5db79276f6ceee01d100a1c
[ "MIT" ]
7
2021-11-01T11:58:14.000Z
2022-02-17T11:19:28.000Z
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import numpy as np import torch from torch import nn, Tensor from imle.wrapper import imle from imle.target import TargetDistribution from imle.noise import SumOfGammaNoiseDistribution from solvers.dijkstra import get_solver import multiprocessing import ray import random import seaborn as sns import matplotlib.pyplot as plt from matplotlib import animation def set_seed(seed: int, is_deterministic: bool = True): # set the seeds random.seed(seed) np.random.seed(seed) torch.manual_seed(seed) if torch.cuda.is_available(): torch.cuda.manual_seed(seed) torch.cuda.manual_seed_all(seed) if is_deterministic is True: torch.backends.cudnn.deterministic = True torch.backends.cudnn.benchmark = False return def maybe_parallelize(function, arg_list): if ray.is_initialized(): ray_fn = ray.remote(function) return ray.get([ray_fn.remote(arg) for arg in arg_list]) else: return [function(arg) for arg in arg_list] class HammingLoss(torch.nn.Module): def forward(self, suggested, target): errors = suggested * (1.0 - target) + (1.0 - suggested) * target return errors.mean(dim=0).sum() def main(argv): neighbourhood_fn = "8-grid" solver = get_solver(neighbourhood_fn) grid_size = [16, 16] def torch_solver(weights_batch: Tensor) -> Tensor: r""" Wrapper around the `solver` function, which implements Dijkstra's Shortest Path Algorithm. Note that I-MLE assumes that the solver solves a maximisation problem, but here the `solver` function solves a minimisation problem, by finding the path that minimises the total travel cost. As a consequence, here we flip the sign of the weights: `solver` will find the path with minimal total cost, while `torch_solver` will find the path that maximises the total gain (all weights are now negative). Args: weights_batch (Tensor): PyTorch tensor with shape [BATCH_SIZE, MAP_WIDTH, MAP_HEIGHT] """ weights_batch = - 1.0 * weights_batch.detach().cpu().numpy() # y_batch = np.asarray([solver(w) for w in list(weights_batch)]) y_batch = np.asarray(maybe_parallelize(solver, arg_list=list(weights_batch))) return torch.tensor(y_batch, requires_grad=False) with torch.inference_mode(): weights = np.empty(shape=[1] + grid_size, dtype=float) weights.fill(-1) weights_batch = torch.tensor(weights) y_batch = torch_solver(weights_batch) loss_fn = HammingLoss() def generate_distribution(input_noise_temperature: float = 5.0): weights = np.empty(shape=[1] + grid_size, dtype=float) weights.fill(-1) weights[0, 1:6, 0:12] = -100 weights[0, 8:12, 1:] = -100 weights[0, 14:, 6:10] = -100 weights_tensor = torch.tensor(weights) weights_params = nn.Parameter(weights_tensor, requires_grad=True) y_tensor = torch.tensor(y_batch.detach().cpu().numpy()) target_distribution = TargetDistribution(alpha=1.0, beta=10.0) noise_distribution = SumOfGammaNoiseDistribution(k=grid_size[0] * 1.3, nb_iterations=100) # imle_solver = imle(torch_solver, # target_distribution=target_distribution, # noise_distribution=noise_distribution, # input_noise_temperature=input_noise_temperature, # target_noise_temperature=5.0) @imle(target_distribution=target_distribution, noise_distribution=noise_distribution, input_noise_temperature=input_noise_temperature, target_noise_temperature=5.0) def imle_solver(weights_batch: Tensor) -> Tensor: return torch_solver(weights_batch) imle_y_tensor = imle_solver(weights_params) loss = loss_fn(imle_y_tensor, y_tensor) loss.backward() return weights, imle_y_tensor, y_tensor, weights_params # Inference weights, imle_y_tensor, y_tensor, weights_params = generate_distribution(0.0) sns.set_theme() ax = sns.heatmap(weights[0]) ax.set_title(f'Map') fig = ax.get_figure() fig.savefig("figures/map.png") plt.clf() sampled_paths_lst = [] for i in range(110): weights, imle_y_tensor, y_tensor, weights_params = generate_distribution(1.0) sampled_paths_lst += [imle_y_tensor[0].detach().cpu().numpy()] def init_fwd(): nonlocal sampled_paths_lst plt.clf() sns.set_theme() ax = sns.heatmap(sampled_paths_lst[0]) #, vmin=0.0, vmax=1.0) ax.set_title(f'Sampled path -- temperature 1.0, iteration: {0}') def animate_fwd(i): nonlocal sampled_paths_lst plt.clf() sns.set_theme() ax = sns.heatmap(sampled_paths_lst[i]) #, vmin=0.0, vmax=1.0) ax.set_title(f'Sampled path -- temperature 1.0, iteration: {i}') fig = plt.figure() anim = animation.FuncAnimation(fig, animate_fwd, init_func=init_fwd, frames=100, repeat=False) anim.save('figures/paths.gif', writer='imagemagick', fps=8) plt.clf() def init_fwd(): nonlocal sampled_paths_lst plt.clf() sns.set_theme() ax = sns.heatmap(sampled_paths_lst[0]) #, vmin=0.0, vmax=1.0) ax.set_title(f'Distribution over paths -- temperature 1.0, iteration: {0}') def animate_fwd(i): nonlocal sampled_paths_lst plt.clf() sns.set_theme() ax = sns.heatmap(np.mean(sampled_paths_lst[:i + 1], axis=0)) #, vmin=0.0, vmax=1.0) ax.set_title(f'Distribution over paths -- temperature 1.0, iteration: {i}') fig = plt.figure() anim = animation.FuncAnimation(fig, animate_fwd, init_func=init_fwd, frames=100, repeat=False) anim.save('figures/distribution.gif', writer='imagemagick', fps=8) plt.clf() def learning(argv): set_seed(0) neighbourhood_fn = "8-grid" solver = get_solver(neighbourhood_fn) grid_size = [16, 16] def torch_solver(weights_batch: Tensor) -> Tensor: r""" Wrapper around the `solver` function, which implements Dijkstra's Shortest Path Algorithm. Note that I-MLE assumes that the solver solves a maximisation problem, but here the `solver` function solves a minimisation problem, by finding the path that minimises the total travel cost. As a consequence, here we flip the sign of the weights: `solver` will find the path with minimal total cost, while `torch_solver` will find the path that maximises the total gain (all weights are now negative). Args: weights_batch (Tensor): PyTorch tensor with shape [BATCH_SIZE, MAP_WIDTH, MAP_HEIGHT] """ weights_batch = - 1.0 * weights_batch.detach().cpu().numpy() # y_batch = np.asarray([solver(w) for w in list(weights_batch)]) y_batch = np.asarray(maybe_parallelize(solver, arg_list=list(weights_batch))) return torch.tensor(y_batch, requires_grad=False) for input_noise_temperature in [0.0, 1.0, 2.0, 5.0]: for target_noise_temperature in [0.0, 1.0, 2.0, 5.0]: for nb_samples in [1, 10, 100]: # Gradients true_weights = np.empty(shape=[1] + grid_size, dtype=float) true_weights.fill(-1) true_weights[0, 1:6, 0:12] = -100 true_weights[0, 8:12, 1:] = -100 true_weights[0, 14:, 6:10] = -100 true_y = torch_solver(torch.tensor(true_weights)).detach() plt.clf() sns.set_theme() ax = sns.heatmap(np.copy(true_y[0].cpu().numpy())) ax.set_title(f'Gold path') fig = ax.get_figure() fig.savefig(f"figures/gold_int={input_noise_temperature}_tnt={target_noise_temperature}_ns={nb_samples}.png") weights = np.random.uniform(low=-0.1, high=0.1, size=[1] + grid_size) weights_tensor = torch.tensor(weights, dtype=torch.float) weights_params = nn.Parameter(weights_tensor, requires_grad=True) optimizer = torch.optim.Adam([weights_params], lr=0.005) evolving_weights_lst = [] evolving_paths_lst = [] loss_fn = HammingLoss() for t in range(1100): target_distribution = TargetDistribution(alpha=1.0, beta=10.0) noise_distribution = SumOfGammaNoiseDistribution(k=grid_size[0] * 1.3, nb_iterations=100) @imle(target_distribution=target_distribution, noise_distribution=noise_distribution, input_noise_temperature=input_noise_temperature, target_noise_temperature=target_noise_temperature, nb_samples=nb_samples) def imle_solver(weights_batch: Tensor) -> Tensor: return torch_solver(weights_batch) imle_y_tensor = imle_solver(weights_params) evolving_weights_lst += [np.copy(weights_params[0].detach().cpu().numpy())] evolving_paths_lst += [np.copy(imle_y_tensor[0].detach().cpu().numpy())] loss = loss_fn(imle_y_tensor, true_y) if t % 10: print(f"Iteration: {t}\tLoss: {loss.item():.2f}") optimizer.zero_grad() loss.backward() optimizer.step() def init_paths(): nonlocal evolving_paths_lst plt.clf() sns.set_theme() ax = sns.heatmap(evolving_paths_lst[0]) #, vmin=0.0, vmax=1.0) ax.set_title(f'Inferred path -- Input noise {input_noise_temperature}, ' f'target noise {target_noise_temperature}, iteration: {0}') def animate_paths(i): nonlocal evolving_paths_lst plt.clf() sns.set_theme() ax = sns.heatmap(evolving_paths_lst[i * 10]) #, vmin=0.0, vmax=1.0) ax.set_title(f'Inferred path -- Input noise {input_noise_temperature}, ' f'target noise {target_noise_temperature}, iteration: {i}') fig = plt.figure() anim = animation.FuncAnimation(fig, animate_paths, init_func=init_paths, frames=100, repeat=False) anim.save(f'figures/learning_paths_int={input_noise_temperature}_tnt={target_noise_temperature}_ns={nb_samples}.gif', writer='imagemagick', fps=8) def init_weights(): nonlocal evolving_paths_lst plt.clf() sns.set_theme() ax = sns.heatmap(evolving_weights_lst[0]) #, vmin=0.0, vmax=1.0) ax.set_title(f'Inferred weights -- Input noise {input_noise_temperature}, ' f'target noise {target_noise_temperature}, iteration: {0}') def animate_weights(i): nonlocal evolving_paths_lst plt.clf() sns.set_theme() ax = sns.heatmap(evolving_weights_lst[i * 10]) #, vmin=0.0, vmax=1.0) ax.set_title(f'Inferred weights -- Input noise {input_noise_temperature}, ' f'target noise {target_noise_temperature}, iteration: {i}') fig = plt.figure() anim = animation.FuncAnimation(fig, animate_weights, init_func=init_weights, frames=100, repeat=False) anim.save(f'figures/learning_weights_int={input_noise_temperature}_tnt={target_noise_temperature}_ns={nb_samples}.gif', writer='imagemagick', fps=8) plt.clf() if __name__ == '__main__': ray.init(num_cpus=multiprocessing.cpu_count()) main(sys.argv[1:]) learning(sys.argv[1:])
38.536278
135
0.612066
2c36bba0e4d2b7932d1156c8b338dc2c00fc5d4b
1,575
py
Python
simulator/parsers/DtnLookupRouterParser.py
seakers/dtnsim
9ea1da84e0565d97b3ea184facb597302bf4d99e
[ "Apache-2.0" ]
4
2020-03-06T19:39:08.000Z
2022-02-22T13:12:36.000Z
simulator/parsers/DtnLookupRouterParser.py
seakers/dtnsim
9ea1da84e0565d97b3ea184facb597302bf4d99e
[ "Apache-2.0" ]
null
null
null
simulator/parsers/DtnLookupRouterParser.py
seakers/dtnsim
9ea1da84e0565d97b3ea184facb597302bf4d99e
[ "Apache-2.0" ]
2
2021-07-30T14:09:20.000Z
2022-02-27T10:28:58.000Z
from .DtnAbstractParser import DtnAbstractParser from enum import Enum from pydantic import PositiveInt, PositiveFloat import sys from typing import List, Optional, Set, Union class RouterMode(str, Enum): FAST = 'fast' SLOW = 'slow' class RouterAlgorithm(str, Enum): CGR = 'cgr' BFS = 'bfs' class DtnLookupRouterParser(DtnAbstractParser): """ Validator for YAML configuration parameters of DtnCGRouter """ # Excel file containing routes routes: str # Router mode mode: RouterMode = RouterMode.FAST # If True, all routes will be recomputed even if they there is a # route file provided recompute_routes: bool = False # Excluded routes specified as a list # Example: [['MOC', 'PSH', 'MCC'], ['MCC', 'MRO', 'MCC']] excluded_routes: Optional[List[List[str]]] = None # Maximum number of hops a valid route can have max_relay_hops: PositiveInt = sys.maxsize # Number of cores to use during the computation of the routes num_cores: PositiveInt = 1 # Maximum number of neighbors to send a critical bundle. # e.g. if a node has 10 neighbors and ``max_crit=2``, then only the # two best neighbors will be used max_crit: Optional[int] = None # List of nodes that can be used as relays relays: Union[Set[str], List[str], str] = set() # Maximum speed of any node in the system in [miles/sec] # Based on latest SABR specification max_speed: PositiveFloat = 125 # Algorithm to use for route computation. algorithm: RouterAlgorithm = RouterAlgorithm.BFS
28.125
71
0.693968
442bacb79b01df544306890f19f6c0819c5a5929
1,467
py
Python
content/migrations/0011_auto_20200224_1318.py
Revibe-Music/core-services
6b11cf16ad2c35d948f3a5c0e7a161e5b7cfc1b2
[ "MIT" ]
2
2022-01-24T23:30:18.000Z
2022-01-26T00:21:22.000Z
content/migrations/0011_auto_20200224_1318.py
Revibe-Music/core-services
6b11cf16ad2c35d948f3a5c0e7a161e5b7cfc1b2
[ "MIT" ]
null
null
null
content/migrations/0011_auto_20200224_1318.py
Revibe-Music/core-services
6b11cf16ad2c35d948f3a5c0e7a161e5b7cfc1b2
[ "MIT" ]
null
null
null
# Generated by Django 3.0 on 2020-02-24 19:18 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('content', '0010_auto_20200218_1124'), ] operations = [ migrations.AddField( model_name='song', name='streams_last_month', field=models.IntegerField(default=0, help_text='Number of streams recorded in DynamoDB in the last 30 days. Will be updated automatically.', verbose_name='streams in the last 30 days'), ), migrations.AddField( model_name='song', name='streams_last_week', field=models.IntegerField(blank=True, default=0, help_text='Number of streams recorded in DynamoDB in the last 7 days. Will be updated automatically.', verbose_name='streams in the last 7 days'), ), migrations.AddField( model_name='song', name='streams_this_year', field=models.IntegerField(default=0, help_text='Number of streams recorded in DynamoDB during this calendar year. Will be updated automatically.', verbose_name='streams this calendar year'), ), migrations.AddField( model_name='song', name='streams_yesterday', field=models.IntegerField(blank=True, default=0, help_text='Number of streams recorded in DynamoDB yesterday. Will be updated automatically.', verbose_name='streams yesterday'), ), ]
43.147059
207
0.660532
d313cdf9e2239829a4d92416845c26ab54f2ead4
1,679
cs
C#
Hazel.UnitTests/UdpReliabilityTests.cs
Elsensee/Hazel-Networking
574dee5c11cb1b54936065cbb002a6584411bb61
[ "MIT" ]
1
2020-12-27T22:11:26.000Z
2020-12-27T22:11:26.000Z
Hazel.UnitTests/UdpReliabilityTests.cs
Elsensee/Hazel-Networking
574dee5c11cb1b54936065cbb002a6584411bb61
[ "MIT" ]
1
2020-11-01T02:34:34.000Z
2020-11-01T02:34:34.000Z
Hazel.UnitTests/UdpReliabilityTests.cs
Elsensee/Hazel-Networking
574dee5c11cb1b54936065cbb002a6584411bb61
[ "MIT" ]
null
null
null
using System; using System.Collections.Generic; using Hazel.Udp; using Microsoft.VisualStudio.TestTools.UnitTesting; namespace Hazel.UnitTests { [TestClass] public class UdpReliabilityTests { [TestMethod] public void TestThatAllMessagesAreReceived() { List<MessageReader> messagesReceived = new List<MessageReader>(); UdpConnectionTestHarness dut = new UdpConnectionTestHarness(); dut.DataReceived += evt => { messagesReceived.Add(evt.Message); }; MessageWriter data = MessageWriter.Get(SendOption.Reliable); for (int i = 1; i < ushort.MaxValue * 2; ++i) { // Send a new message, it should be received and ack'd SetReliableId(data, i); dut.Test_Receive(data); // Resend an old message, it should be ignored if (i > 2) { SetReliableId(data, i - 1); dut.Test_Receive(data); // It should still be ack'd Assert.AreEqual(2, dut.BytesSent.Count); dut.BytesSent.RemoveAt(1); } Assert.AreEqual(1, messagesReceived.Count); messagesReceived.Clear(); Assert.AreEqual(1, dut.BytesSent.Count); dut.BytesSent.Clear(); } } private static void SetReliableId(MessageWriter data, int i) { ushort id = (ushort)i; data.Buffer[1] = (byte)(id >> 8); data.Buffer[2] = (byte)id; } } }
29.45614
77
0.520548
3a88cd3e94d4ab85a58ce416af34be664f421682
65
sql
SQL
packages/server/accounts/prisma/migrations/20210906210506_alter_table_establishments_make_restaurateur_id_as_not_unique/migration.sql
gbartoczevicz/moosic
003ff5cff628505093cc08ad0fbd273272172a51
[ "MIT" ]
3
2021-09-30T00:41:31.000Z
2022-03-15T00:14:23.000Z
packages/server/accounts/prisma/migrations/20210906210506_alter_table_establishments_make_restaurateur_id_as_not_unique/migration.sql
gbartoczevicz/moosic
003ff5cff628505093cc08ad0fbd273272172a51
[ "MIT" ]
13
2021-09-20T22:29:52.000Z
2021-12-05T01:59:34.000Z
packages/server/accounts/prisma/migrations/20210906210506_alter_table_establishments_make_restaurateur_id_as_not_unique/migration.sql
gabrielbartoczevicz/moosic
003ff5cff628505093cc08ad0fbd273272172a51
[ "MIT" ]
1
2021-11-10T22:11:55.000Z
2021-11-10T22:11:55.000Z
-- DropIndex DROP INDEX "establishments.restaurateur_id_unique";
21.666667
51
0.830769
2161bad2d439da2f77d3cdd3f86db2399bb77860
11,273
js
JavaScript
src/bootstrap-periods.js
rinold/bootstrap-periodsChooser
9eb768a33f726449a4801e0b6f5ad7435518bbbc
[ "MIT" ]
null
null
null
src/bootstrap-periods.js
rinold/bootstrap-periodsChooser
9eb768a33f726449a4801e0b6f5ad7435518bbbc
[ "MIT" ]
null
null
null
src/bootstrap-periods.js
rinold/bootstrap-periodsChooser
9eb768a33f726449a4801e0b6f5ad7435518bbbc
[ "MIT" ]
null
null
null
(function ( $ ) { $.fn.periodsChooser = function (options) { $container = $(this); var triggerUpdateEvent = false; if (!$container.data('periods-opts')) { var opts = $.extend(true, {}, $.fn.periodsChooser.defaults, options); $container.attr('data-periods-opts', ''); $container.data('periods-opts', opts); } else { triggerUpdateEvent = true; var opts = $container.data('periods-opts'); if (['month', 'quarter', 'year'].includes(options)) { opts.choiceMode = options; } else { $.extend(true, opts, options); } $container.data('periods-opts', opts); } $container.empty(); var $chooser = $('<div>', { 'class': 'periods-container btn-group', attr: { 'data-range': (opts.rangeEnabled && opts.rangeToggleDefault), 'data-mode': opts.choiceMode, } }); var date = opts.choiceDefault; var sizedBtnClass = 'btn btn-' + opts.buttonClass; if (opts.buttonSize) { sizedBtnClass += ' btn-' + opts.buttonSize; } function updateDropdownText($dd) { var year = $dd.data('year'); var value = $dd.data(opts.choiceMode); $dd.trigger('periods.update.text', [year, value]); $dd.find('.dropdown-toggle').text( opts.formatDropdownDate[opts.choiceMode](year, value) ); } function createDropdown(rangeSide) { var $dropdown = $('<div>', { 'class': 'periods-dropdown btn-group', attr: { 'data-range': rangeSide, 'data-year': date.getFullYear(), 'data-quarter': date.getQuarter(), 'data-month': date.getMonth(), }, on: { 'hide.bs.dropdown': function () { updateDropdownText($(this)); } }, }); var $dropdownBtn = $('<button>', { 'class': 'periods-dropdown-btn dropdown-toggle ' + sizedBtnClass, attr: { 'data-toggle': 'dropdown', } }) .dropdown() .appendTo($dropdown); var $dropdownMenu = $('<div>', { 'class': 'periods-menu dropdown-menu dropdown-menu-right', click: function (event) { event.stopImmediatePropagation(); event.preventDefault(); }, }); var $yearChoice = $('<div>', { 'class': 'periods-year-choice text-center px-2', }); $('<button>', { 'class': sizedBtnClass + ' btn-arrow pull-left', html: '<i class="fa fa-arrow-left"></i>', attr: { 'data-inc': -1, }, }) .appendTo($yearChoice); var $yearText = $('<span>', { 'class': 'btn periods-year', text: date.getFullYear(), }) .appendTo($yearChoice); if (opts.buttonSize) { $yearText.addClass('btn-' + opts.buttonSize); } $('<button>', { 'class': sizedBtnClass + ' btn-arrow pull-right', html: '<i class="fa fa-arrow-right"></i>', attr: { 'data-inc': 1, }, }) .appendTo($yearChoice); $yearChoice.on('click', '.btn-arrow', function () { var year = $dropdown.data('year') + $(this).data('inc'); $yearChoice.find('.periods-year').text(year); $dropdown.data('year', year); }); $dropdownMenu .append($yearChoice) .append('<div class="dropdown-divider"></div>') .appendTo($dropdown); $choiceGroup = $('<div class="periods-choice-group">') .appendTo($dropdownMenu); function createQuarterChoices($choiceGroup) { var $itemsGroup = $('<div>', { 'class': "periods-quarter-group btn-group px-2", }) .appendTo($choiceGroup); for (var i = 1; i < 5; i++) { var $quarter = $('<button>', { 'class': sizedBtnClass + ' periods-choice', text: 'Q' + i, attr: { 'data-quarter': i, }, }) .appendTo($itemsGroup); if (i == date.getQuarter()) { $quarter.addClass('active'); } } } function createMonthChoices($choiceGroup) { for (var n = 0; n < 3; n++) { var $itemsGroup = $('<div>', { 'class': "periods-month-group btn-group w-100 px-2", }) .appendTo($choiceGroup); for (var m = 0; m < 4; m++) { var i = m + 4 * n; var supI = (i < 9) ? '0' : ''; var $month = $('<button>', { 'class': sizedBtnClass + ' periods-choice w-25', html: $.fn.periodsChooser.monthNames[i] + ' <sup>' + supI + (i + 1) + '</sup>' , attr: { 'data-month': i, }, }) .appendTo($itemsGroup); if (n == 1) { $month.addClass('my-2'); } if (i == date.getMonth()) { $month.addClass('active'); } } } } var createChoices = { 'year' : function () {}, 'quarter': createQuarterChoices, 'month': createMonthChoices, }; createChoices[opts.choiceMode]($choiceGroup); $dropdownMenu.on('click', '.periods-choice', function () { var $this = $(this); $dropdownMenu.find('.periods-choice').removeClass('active'); $this.addClass('active'); var value = $this.data(opts.choiceMode); $dropdown.data(opts.choiceMode, value); $dropdown.dropdown('toggle'); }); if (opts.size) { $dropdown.addClass('btn-group-'+opts.size); } return $dropdown; } var $chooser = $('<div>', { 'class': 'periods-container btn-group', attr: { 'data-range': (opts.rangeEnabled && opts.rangeToggleDefault), 'data-mode': opts.choiceMode, } }); if (opts.rangeToggle) { var $btnToggleRange = $('<button>', { 'class': sizedBtnClass + ' periods-range-toggle', html: '<i class="fa fa-calendar-plus-o"></i>', click: function () { $(this).find('i').toggleClass('fa-calendar-minus-o fa-calendar-plus-o'); $chooser.find('.periods-togglable').toggle(); $chooser.data('range', !$chooser.data('range')); dateChanged(); } }) .appendTo($chooser); } var $fromDropdown = createDropdown('from').addClass('periods-togglable'); var $toDropdown = createDropdown('to'); var $fromToArrow = $('<span>', { 'class': 'btn periods-togglable', html: '<i class="fa fa-long-arrow-right"></i>', }); if (opts.buttonSize) { $fromToArrow.addClass('btn-' + opts.buttonSize); } $chooser .append($fromDropdown) .append($fromToArrow) .append($toDropdown) .appendTo($container); updateDropdownText($fromDropdown); updateDropdownText($toDropdown); function dateChanged() { $this = $chooser; var $end = $toDropdown; var $start = $this.data('range') ? $fromDropdown : $end; var startYear = $start.data('year'); var endYear = $end.data('year'); if (opts.choiceMode == 'quarter') { var startQuarter = $start.data('quarter'); var startMonth = startQuarter * 3 - 3; var endQuarter = $end.data('quarter'); var endMonth = endQuarter * 3 - 1; } else if (opts.choiceMode == 'month') { var startMonth = $start.data('month'); var endMonth = $end.data('month'); } else { var startMonth = 0; var endMonth = 11; } var startDate = new Date(startYear, startMonth, 1); var endDate = new Date(endYear, endMonth + 1, 0, 23, 59, 59, 999); $container.trigger('periods.date.changed', { from: startDate, to: endDate, }); } $chooser.on('hide.bs.dropdown', '.periods-dropdown', dateChanged); if (!opts.rangeToggleDefault) { $chooser.find('.periods-togglable').hide(); } if (triggerUpdateEvent) { dateChanged(); } return $container; }; $.fn.periodsChooser.monthNames = [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]; $.fn.periodsChooser.defaults = { choiceMode: 'month', // year, quarter, month choiceDefault: new Date(), // TODO: default range from-to? // From-to range choice configuration rangeEnabled: true, rangeToggle: true, rangeToggleDefault: false, // Bootstrap classes styling buttonSize: 'sm', // could be '', 'sm' or 'lg' buttonClass: 'secondary', // Dropdown date formatters formatDropdownDate: { year: function (year) { return year; }, quarter: function (year, quarter) { return 'Q' + quarter + '\'' + year.toString().substring(2, 4); }, month: function (year, month) { return $.fn.periodsChooser.monthNames[month] + ' ' + year.toString().substring(2, 4); }, month_num: function (year, month) { var zero = (month < 9) ? '0' : ''; return zero + (month + 1).toString() + '/' + year.toString().substring(2, 4); }, }, }; Date.prototype.getQuarter = function () { return Math.floor(this.getMonth() / 3) + 1; } } ( jQuery ));
34.160606
108
0.429167
72bfeec458b9af7825d5cfeaf40038659712fa34
357
cs
C#
Basics/HelloWorld/Program.cs
giawa/gameduino4netduino
37825882037167659ef3e88886bd743e7f690b29
[ "BSD-3-Clause" ]
4
2015-07-24T17:27:26.000Z
2020-02-13T20:35:15.000Z
Basics/HelloWorld/Program.cs
giawa/gameduino4netduino
37825882037167659ef3e88886bd743e7f690b29
[ "BSD-3-Clause" ]
null
null
null
Basics/HelloWorld/Program.cs
giawa/gameduino4netduino
37825882037167659ef3e88886bd743e7f690b29
[ "BSD-3-Clause" ]
null
null
null
using Gameduino; using System.Threading; namespace HelloWorld { public class Program { public static void Main() { GD2.Init(); GD2.ClearColorRGB(0x103000); GD2.Clear(); GD2.DisplayText(240, 136, 31, GD2.Options.Center, "Hello, Netduino!"); GD2.Swap(); } } }
18.789474
82
0.526611
c3d67f5949bb9accc916a0019c0672c60daed391
8,841
cs
C#
Hacker Jeopardy!/Assets/Tests/GameEditorTests/GameEditorTests.cs
mahermatrix/HackerJeopardy
f44e2c8574289a0164c13d9cfa23e90b94079656
[ "MIT" ]
1
2020-04-27T06:05:03.000Z
2020-04-27T06:05:03.000Z
Hacker Jeopardy!/Assets/Tests/GameEditorTests/GameEditorTests.cs
mahermatrix/HackerJeopardy
f44e2c8574289a0164c13d9cfa23e90b94079656
[ "MIT" ]
null
null
null
Hacker Jeopardy!/Assets/Tests/GameEditorTests/GameEditorTests.cs
mahermatrix/HackerJeopardy
f44e2c8574289a0164c13d9cfa23e90b94079656
[ "MIT" ]
null
null
null
using System.Collections; using System.Collections.Generic; using UnityEngine; using NUnit.Framework; using UnityEngine.UI; using TMPro; public class GameEditorTests : MonoBehaviour { /* Some Info About this Test : Befor running this test you have to comment the start method in the GameEditor Class * this DataBase Contains 2 Games and 6 Categories * Becarful when you using SaveGame or SaveCategory methods , this will make changes on the DataBase that we use to test our GameEditor * the first Game with the name (as) contains 3 Categories and tow dailyDoubles * the second Game with the name (k) Contains 2 Categories and Two DailyDoubles */ GameEditor editor; [SetUp] public void Setup() { GameObject gameGameObject = MonoBehaviour.Instantiate(Resources.Load<GameObject>("Canvas")); editor = gameGameObject.GetComponent<GameEditor>(); editor.ConnectToSql("URI=file:" + Application.dataPath + "/Tests/GameEditorTests/GameEditorDBTest.sqlite"); editor.LoadData(); } [Test] public void TestAddedCatsNumber() { Debug.Log(editor.categories.Count); Assert.AreEqual(6, editor.categories.Count); Assert.AreEqual(6, editor.CategoriesInDataBase.Count); } [Test] public void SelectTwoCategory() { editor.InitGame(); int i = 2; foreach (GameObject cat in editor.CategoriesInDataBase.Values) { if (i > 0) { Toggle toggle = cat.GetComponentInChildren<Toggle>(); toggle.isOn = true; i--; } } Assert.AreEqual(2, editor.selectedcategoryObjects.Count); } [Test] public void UnSelectTwoCategory() { editor.InitGame(); int i = 2; foreach (GameObject cat in editor.CategoriesInDataBase.Values) { Toggle toggle = cat.GetComponentInChildren<Toggle>(); toggle.isOn = true; } Assert.AreEqual(6, editor.selectedcategoryObjects.Count); foreach (GameObject cat in editor.CategoriesInDataBase.Values) { if (i > 0) { Toggle toggle = cat.GetComponentInChildren<Toggle>(); toggle.isOn = false; i--; } } Assert.AreEqual(4, editor.selectedcategoryObjects.Count); } [Test] public void CreatFiveClues() { editor.InitGame(); editor.InitCategory(); editor.categoryName.text = "A"; editor.description.text = "A"; for (int i = 0; i < 5; i++) { editor.setCurrentClueIndex(i); editor.clueText1.text = (i + 1).ToString(); editor.answerText.text = (i + 1).ToString(); editor.CreateClue(); } Assert.AreEqual(5, editor.currentCategory.getClues().Count); } [Test] public void LoadClue() { editor.InitGame(); editor.InitCategory(); editor.setCurrentClueIndex(1); editor.clueText1.text = "1"; editor.answerText.text = "1"; editor.CreateClue(); editor.setCurrentClueIndex(0); editor.LoadClue(); Assert.AreEqual("" + "", editor.clueText1.text + editor.answerText.text); editor.setCurrentClueIndex(1); editor.LoadClue(); Assert.AreEqual("1" + "1", editor.clueText1.text + editor.answerText.text); } [Test] public void CheckClueType() { editor.InitCategory(); editor.setCurrentClueIndex(0); editor.LoadClue(); editor.clueText1.text = "A"; editor.clueText2.text = "B"; editor.answerText.text = "Dual"; editor.CreateClue(); editor.setCurrentClueIndex(1); editor.LoadClue(); editor.clueText1.text = ""; editor.answerText.text = "Single"; editor.CreateClue(); Assert.IsFalse(string.IsNullOrWhiteSpace(editor.warningTextClue.text)); editor.clueText1.text = "A"; editor.CreateClue(); Clue c = editor.currentCategory.getClues()[0]; Clue c1 = editor.currentCategory.getClues()[1]; Assert.True(c.IsDual()); Assert.False(c1.IsDual()); DualClue dual = (DualClue)c; SingleClue single = (SingleClue)c1; Assert.AreEqual(dual.GetType1(), Clue_Type.TEXT); Assert.AreEqual(dual.GetType2(), Clue_Type.TEXT); Assert.AreEqual(single.GetClueType(), Clue_Type.TEXT); } [Test] public void AddEditAndDeleteGame() { ///////////// Add New Game //////////////////// editor.InitGame(); editor.gameName.text = "NewGame"; editor.SetFinalJeopardyFlag(true); editor.LoadClue(); editor.ShowHideFJCatInputField(); editor.finalJeopardyCat.GetComponentInChildren<TMP_InputField>().text = ""; editor.clueText1.text = "FinalClue"; editor.answerText.text = "FinalAnswer"; editor.CreateClue(); Assert.IsFalse (string.IsNullOrWhiteSpace(editor.warningTextClue.text)); editor.finalJeopardyCat.GetComponentInChildren<TMP_InputField>().text = "Final"; editor.CreateClue(); int i = 2; foreach (GameObject cat in editor.CategoriesInDataBase.Values) { if (i > 0) { Toggle toggle = cat.GetComponentInChildren<Toggle>(); toggle.isOn = true; i--; } } Assert.AreEqual(2, editor.selectedcategoryObjects.Count); editor.SaveGame(); Assert.AreEqual(3, editor.GetGames().Count); Assert.AreEqual("NewGame", editor.GetGames()[2].GetGameName()); Assert.AreEqual(2, editor.GetGames()[2].getCategoriesNum()); SingleClue final = (SingleClue)editor.GetGames()[2].GetFinalJeopardyClue(); Assert.AreEqual("FinalClue" + "FinalAnswer", final.GetClue() + final.GetAnswer()); Assert.AreEqual(4, editor.dropdown.options.Count); Assert.AreEqual(4, editor.chooseGameDropDown.options.Count); ///////////////////////////////Edit the New Game /////////////////////// editor.dropdown.value = 3; editor.LoadGame(); editor.SetGameEditFlag(); editor.DisableCatsButtons(false); Assert.AreEqual(2, editor.GetGames()[2].getCategoriesNum()); editor.gameName.text = "ba"; editor.SaveGame(); Assert.AreEqual(3, editor.GetGames().Count); editor.dropdown.value = 3; editor.SetGameEditFlag(); editor.LoadGame(); Assert.AreEqual("ba", editor.GetGames()[2].GetGameName()); ////////////////Delete the New Game ////////////// /// editor.dropdown.value = 3; editor.DeleteGame(); Assert.AreEqual(2, editor.GetGames().Count); Assert.AreEqual(3, editor.dropdown.options.Count); Assert.AreEqual(3, editor.chooseGameDropDown.options.Count); } [Test] public void AddEditAndDeleteCategory() { ////////////// Add New Cat ///////////// editor.InitGame(); editor.InitCategory(); editor.categoryName.text = ""; editor.description.text = "NewDes"; for (int i = 0; i < 5; i++) { editor.setCurrentClueIndex(i); editor.clueText1.text = (i + 1).ToString(); editor.answerText.text = (i + 1).ToString(); editor.CreateClue(); } Assert.AreEqual(5, editor.currentCategory.getClues().Count); editor.SaveCategory(); Assert.IsFalse(string.IsNullOrWhiteSpace(editor.warningTextCategory.text)); editor.categoryName.text = "NewCat"; editor.SaveCategory(); int id = editor.currentCategory.getId(); Assert.AreEqual(7, editor.categories.Count); Assert.AreEqual(7, editor.CategoriesInDataBase.Count); ////////////// Edit the New Cat ///////////// Category newCat = editor.categories[id]; // The Category with ID = 2 in this DataBase called CSS GameObject newCatObject = editor.CategoriesInDataBase[id]; Button[] buttons = newCatObject.GetComponentsInChildren<Button>(); Button edit = buttons[0]; // Edit Button edit.onClick.Invoke(); editor.description.text = "modified"; editor.SaveCategory(); Assert.AreEqual("modified", newCat.getDescription()); Assert.AreEqual(7, editor.categories.Count); Assert.AreEqual(7, editor.CategoriesInDataBase.Count); ////////////// Delete the New Cat ///////////// editor.DeleteCategory(id); Assert.AreEqual(6, editor.CategoriesInDataBase.Count); Assert.AreEqual(6, editor.categories.Count); } }
33.61597
141
0.593485
8d75d80b57ffb2af0f9f0e12b5380079a499cfa6
2,589
js
JavaScript
12306/scripts/tool.js
zytomorrow/JSBOX
aa94fb777645741fb0fc847a3b877dc424919127
[ "MIT" ]
3
2020-03-30T06:08:49.000Z
2020-05-26T18:18:29.000Z
12306/scripts/tool.js
zytomorrow/JSBOX
aa94fb777645741fb0fc847a3b877dc424919127
[ "MIT" ]
null
null
null
12306/scripts/tool.js
zytomorrow/JSBOX
aa94fb777645741fb0fc847a3b877dc424919127
[ "MIT" ]
2
2019-05-15T05:30:24.000Z
2020-05-26T18:18:31.000Z
module.exports = { currentDate: currentDate(), currentYear: currentYear(), currentMonth: currentMonth(), currentDay: currentDay(), excessTicket: excessTicket } function currentDate() { // 获取当前日期 var date = new Date(); // 获取当前月份 var nowMonth = date.getMonth() + 1; // 获取当前是几号 var strDate = date.getDate(); // 添加分隔符“-” var seperator = "-"; // 对月份进行处理,1-9月在前面添加一个“0” if (nowMonth >= 1 && nowMonth <= 9) { nowMonth = "0" + nowMonth; } // 对日期进行处理,1-9号在前面添加一个“0” if (strDate >= 0 && strDate <= 9) { strDate = "0" + strDate; } // 最后拼接字符串,得到一个格式为(yyyy-MM-dd)的日期 var nowDate = date.getFullYear() + seperator + nowMonth + seperator + strDate; return nowDate } function currentYear() { // 获取当前日期 var date = new Date(); // $console.info(date.getFullYear()) return date.getFullYear() } function currentMonth() { // 获取当前日期 var date = new Date(); // 获取当前月份 var nowMonth = date.getMonth() + 1; // 对月份进行处理,1-9月在前面添加一个“0” if (nowMonth >= 1 && nowMonth <= 9) { nowMonth = "0" + nowMonth; } // $console.info(nowMonth) return nowMonth } function currentDay() { // 获取当前日期 var date = new Date(); // 获取当前是几号 var strDate = date.getDate(); // 对日期进行处理,1-9号在前面添加一个“0” if (strDate >= 0 && strDate <= 9) { strDate = "0" + strDate; } // $console.info(strDate) return strDate } function excessTicket(resultTuple) { var normalSeat = (resultTuple[32] == "") ? "" : "商务座:" var firstClassSeat = (resultTuple[31] == "") ? "" : " 一等座:" var secondClass = (resultTuple[30] == "") ? "" : " 二等座:" var advancedSoftSleeper = (resultTuple[21] == "") ? "" : " 高级软卧:" var softSleeper = (resultTuple[23] == "") ? "" : " 软卧:" var moving = (resultTuple[33] == "") ? "" : " 动卧:" var hardSleeper = (resultTuple[28] == "") ? "" : " 硬卧:" var softSeat = (resultTuple[24] == "") ? "" : " 软座:" var hardSeat = (resultTuple[29] == "") ? "" : " 硬座:" var noSeat = (resultTuple[26] == "") ? "" : " 无座:" var excessTicketString = normalSeat + resultTuple[32] + firstClassSeat + resultTuple[31] + secondClass + resultTuple[30] + advancedSoftSleeper + resultTuple[21] + softSleeper + resultTuple[23] + moving + resultTuple[33] + hardSleeper + resultTuple[28] + softSeat + resultTuple[24] + hardSeat + resultTuple[29] + noSeat + resultTuple[26] // $console.info(excessTicketString) return excessTicketString.replace(/^\s+|\s+$/g, ""); }
29.758621
340
0.568173
439175b6a9fa90d9f0df7d1e45634133ef0bcbf1
1,817
ts
TypeScript
client/src/app/components/personagem-form/personagem-form.component.ts
ricardohneto/a-wing-personagens
a1c5303d5b08aa112edb71109ef30a83a540c9a3
[ "Apache-2.0" ]
null
null
null
client/src/app/components/personagem-form/personagem-form.component.ts
ricardohneto/a-wing-personagens
a1c5303d5b08aa112edb71109ef30a83a540c9a3
[ "Apache-2.0" ]
4
2021-03-09T04:49:55.000Z
2022-02-26T11:14:49.000Z
client/src/app/components/personagem-form/personagem-form.component.ts
ricardohneto/a-wing-personagens
a1c5303d5b08aa112edb71109ef30a83a540c9a3
[ "Apache-2.0" ]
null
null
null
import { PersonagemService } from './../../services/personagem.service'; import { Personagem } from './../../models/Personagem'; import { Component, OnInit, HostBinding } from '@angular/core'; import { Router,ActivatedRoute } from '@angular/router'; @Component({ selector: 'app-personagem-form', templateUrl: './personagem-form.component.html', styleUrls: ['./personagem-form.component.css'] }) export class PersonagemFormComponent implements OnInit { @HostBinding('class') classes = 'row'; personagem: Personagem = { cod_personagem: 0, nom_personagem: '', descricao: '', imagem: '', created_at: new Date() } edit: boolean = false; constructor(private personagemService: PersonagemService, private router: Router, private activatedRoute: ActivatedRoute) { } ngOnInit() { const params = this.activatedRoute.snapshot.params; if (params.cod_Personagem) { this.personagemService.getUm(params.cod_Personagem) .subscribe ( res => { console.log(res); this.personagem = res; this.edit = true; }, err => console.error(err) ) } } saveNewPersonagem() { delete this.personagem.cod_personagem; delete this.personagem.created_at; this.personagemService.savePersonagem(this.personagem) .subscribe( res => { console.log(res); this.router.navigate(['/personagens']); }, err => console.error(err) ) } updatePersonagem() { delete this.personagem.created_at; this.personagemService.updatePersonagem(this.personagem.cod_personagem, this.personagem) .subscribe ( res => { console.log(res); this.router.navigate(['/personagens']); }, err => console.error(err) ) } }
25.591549
127
0.635113
a941e269a2e766ed5ff78fbe6fd7c40646f9202d
10,098
swift
Swift
Keylogger/Keylogger/Keylogger.swift
Crazy-MT/Swift-Keylogger
c225fda0acee9a7bac3041d20d50715d92fc1289
[ "MIT" ]
1
2020-09-27T04:40:29.000Z
2020-09-27T04:40:29.000Z
Keylogger/Keylogger/Keylogger.swift
Crazy-MT/Swift-Keylogger
c225fda0acee9a7bac3041d20d50715d92fc1289
[ "MIT" ]
null
null
null
Keylogger/Keylogger/Keylogger.swift
Crazy-MT/Swift-Keylogger
c225fda0acee9a7bac3041d20d50715d92fc1289
[ "MIT" ]
1
2021-06-04T16:46:22.000Z
2021-06-04T16:46:22.000Z
// // Keylogger.swift // Keylogger // // Created by Skrew Everything on 14/01/17. // Copyright © 2017 Skrew Everything. All rights reserved. // import Foundation import IOKit.hid import Cocoa class Keylogger { var manager: IOHIDManager var deviceList = NSArray() // Used in multiple matching dictionary var bundlePathURL = Bundle.main.bundleURL // Path to where the executable is present - Change this to use custom path var appName = "" // Active App name var appData:URL // Folder var keyData:URL // Folder var devicesData:URL // Folder init() { appData = bundlePathURL.appendingPathComponent("Data").appendingPathComponent("App") // Creates App Folder in Data Folder keyData = bundlePathURL.appendingPathComponent("Data").appendingPathComponent("Key") // Creates Key Folder in Data Folder devicesData = bundlePathURL.appendingPathComponent("Data").appendingPathComponent("Devices") // Creates Devices Folder in Data Folder manager = IOHIDManagerCreate(kCFAllocatorDefault, IOOptionBits(kIOHIDOptionsTypeNone)) if !(FileManager.default.fileExists(atPath: appData.path) && FileManager.default.fileExists(atPath: keyData.path)) { do { try FileManager.default.createDirectory(at: bundlePathURL.appendingPathComponent("Data"), withIntermediateDirectories: false, attributes: nil) try FileManager.default.createDirectory(at: appData, withIntermediateDirectories: false, attributes: nil) try FileManager.default.createDirectory(at: keyData, withIntermediateDirectories: false, attributes: nil) try FileManager.default.createDirectory(at: devicesData, withIntermediateDirectories: false, attributes: nil) } catch { print("Can't create directories!") } } if (CFGetTypeID(manager) != IOHIDManagerGetTypeID()) { print("Can't create manager") exit(1); } deviceList = deviceList.adding(CreateDeviceMatchingDictionary(inUsagePage: kHIDPage_GenericDesktop, inUsage: kHIDUsage_GD_Keyboard)) as NSArray deviceList = deviceList.adding(CreateDeviceMatchingDictionary(inUsagePage: kHIDPage_GenericDesktop, inUsage: kHIDUsage_GD_Keypad)) as NSArray IOHIDManagerSetDeviceMatchingMultiple(manager, deviceList as CFArray) let observer = UnsafeMutableRawPointer(Unmanaged.passUnretained(self).toOpaque()) /* App switching notification*/ NSWorkspace.shared.notificationCenter.addObserver(self, selector: #selector(activatedApp), name: NSWorkspace.didActivateApplicationNotification, object: nil) /* Connected and Disconnected Call Backs */ IOHIDManagerRegisterDeviceMatchingCallback(manager, CallBackFunctions.Handle_DeviceMatchingCallback, observer) IOHIDManagerRegisterDeviceRemovalCallback(manager, CallBackFunctions.Handle_DeviceRemovalCallback, observer) /* Input value Call Backs */ IOHIDManagerRegisterInputValueCallback(manager, CallBackFunctions.Handle_IOHIDInputValueCallback, observer); /* Open HID Manager */ let ioreturn: IOReturn = openHIDManager() if ioreturn != kIOReturnSuccess { print("Can't open HID!") } else { print("init success") } } @objc dynamic func activatedApp(notification: NSNotification) { if let info = notification.userInfo, let app = info[NSWorkspace.applicationUserInfoKey] as? NSRunningApplication, let name = app.localizedName { self.appName = name let dateFolder = "\(CallBackFunctions.calander.component(.day, from: Date()))-\(CallBackFunctions.calander.component(.month, from: Date()))-\(CallBackFunctions.calander.component(.year, from: Date()))" let path = self.appData.appendingPathComponent(dateFolder) if !FileManager.default.fileExists(atPath: path.path) { do { try FileManager.default.createDirectory(at: path , withIntermediateDirectories: false, attributes: nil) } catch { print("Can't Create Folder") } } let fileName = path.appendingPathComponent("Time Stamps of Apps").path if !FileManager.default.fileExists(atPath: fileName ) { if !FileManager.default.createFile(atPath: fileName, contents: nil, attributes: nil) { print("Can't Create File!") } } let fh = FileHandle.init(forWritingAtPath: fileName) fh?.seekToEndOfFile() let timeStamp = Date().description(with: Locale.current) + "\t\(self.appName)" + "\n" fh?.write(timeStamp.data(using: .utf8)!) } } /* For Keyboard */ func CreateDeviceMatchingDictionary(inUsagePage: Int ,inUsage: Int ) -> CFMutableDictionary { /* // note: the usage is only valid if the usage page is also defined */ let resultAsSwiftDic = [kIOHIDDeviceUsagePageKey: inUsagePage, kIOHIDDeviceUsageKey : inUsage] let resultAsCFDic: CFMutableDictionary = resultAsSwiftDic as! CFMutableDictionary return resultAsCFDic } func openHIDManager() -> IOReturn { return IOHIDManagerOpen(manager, IOOptionBits(kIOHIDOptionsTypeNone)); } /* Scheduling the HID Loop */ func start() { IOHIDManagerScheduleWithRunLoop(manager, CFRunLoopGetMain(), CFRunLoopMode.defaultMode.rawValue) } /* Un-scheduling the HID Loop */ func stop() { IOHIDManagerUnscheduleFromRunLoop(manager, CFRunLoopGetMain(), CFRunLoopMode.defaultMode.rawValue); } var keyMap: [UInt32:[String]] { var map = [UInt32:[String]]() map[4] = ["a","A"] map[5] = ["b","B"] map[6] = ["c","C"] map[7] = ["d","D"] map[8] = ["e","E"] map[9] = ["f","F"] map[10] = ["g","G"] map[11] = ["h","H"] map[12] = ["i","I"] map[13] = ["j","J"] map[14] = ["k","K"] map[15] = ["l","L"] map[16] = ["m","M"] map[17] = ["n","N"] map[18] = ["o","O"] map[19] = ["p","P"] map[20] = ["q","Q"] map[21] = ["r","R"] map[22] = ["s","S"] map[23] = ["t","T"] map[24] = ["u","U"] map[25] = ["v","V"] map[26] = ["w","W"] map[27] = ["x","X"] map[28] = ["y","Y"] map[29] = ["z","Z"] map[30] = ["1","!"] map[31] = ["2","@"] map[32] = ["3","#"] map[33] = ["4","$"] map[34] = ["5","%"] map[35] = ["6","^"] map[36] = ["7","&"] map[37] = ["8","*"] map[38] = ["9","("] map[39] = ["0",")"] map[40] = ["\n","\n"] map[41] = ["\\ESCAPE","\\ESCAPE"] map[42] = ["\\DELETE|BACKSPACE","\\DELETE|BACKSPACE"] // map[43] = ["\\TAB","\\TAB"] map[44] = [" "," "] map[45] = ["-","_"] map[46] = ["=","+"] map[47] = ["[","{"] map[48] = ["]","}"] map[49] = ["\\","|"] map[50] = ["",""] // Keyboard Non-US# and ~2 map[51] = [";",":"] map[52] = ["'","\""] map[53] = ["`","~"] map[54] = [",","<"] map[55] = [".",">"] map[56] = ["/","?"] map[57] = ["\\CAPSLOCK","\\CAPSLOCK"] map[58] = ["\\F1","\\F1"] map[59] = ["\\F2","\\F2"] map[60] = ["\\F3","\\F3"] map[61] = ["\\F4","\\F4"] map[62] = ["\\F5","\\F5"] map[63] = ["\\F6","\\F6"] map[64] = ["\\F7","\\F7"] map[65] = ["\\F8","\\F8"] map[66] = ["\\F9","\\F9"] map[67] = ["\\F10","\\F10"] map[68] = ["\\F11","\\F11"] map[69] = ["\\F12","\\F12"] map[70] = ["\\PRINTSCREEN","\\PRINTSCREEN"] map[71] = ["\\SCROLL-LOCK","\\SCROLL-LOCK"] map[72] = ["\\PAUSE","\\PAUSE"] map[73] = ["\\INSERT","\\INSERT"] map[74] = ["\\HOME","\\HOME"] map[75] = ["\\PAGEUP","\\PAGEUP"] map[76] = ["\\DELETE-FORWARD","\\DELETE-FORWARD"] // map[77] = ["\\END","\\END"] map[78] = ["\\PAGEDOWN","\\PAGEDOWN"] map[79] = ["\\RIGHTARROW","\\RIGHTARROW"] map[80] = ["\\LEFTARROW","\\LEFTARROW"] map[81] = ["\\DOWNARROW","\\DOWNARROW"] map[82] = ["\\UPARROW","\\UPARROW"] map[83] = ["\\NUMLOCK","\\CLEAR"] // Keypads map[84] = ["/","/"] map[85] = ["*","*"] map[86] = ["-","-"] map[87] = ["+","+"] map[88] = ["\\ENTER","\\ENTER"] map[89] = ["1","\\END"] map[90] = ["2","\\DOWNARROW"] map[91] = ["3","\\PAGEDOWN"] map[92] = ["4","\\LEFTARROW"] map[93] = ["5","5"] map[94] = ["6","\\RIGHTARROW"] map[95] = ["7","\\HOME"] map[96] = ["8","\\UPARROW"] map[97] = ["9","\\PAGEUP"] map[98] = ["0","\\INSERT"] map[99] = [".","\\DELETE"] map[100] = ["",""] // ///// map[224] = ["\\LC","\\LC"] // left control map[225] = ["\\LS","\\LS"] // left shift map[226] = ["\\LA","\\LA"] // left alt map[227] = ["\\LCMD","\\LCMD"] // left cmd map[228] = ["\\RC","\\RC"] // right control map[229] = ["\\RS","\\RS"] // right shift map[230] = ["\\RA","\\RA"] // right alt map[231] = ["\\RCMD","\\RCMD"] // right cmd return map } }
38.689655
213
0.505249
b433ca19da023e82ac251f87941ef797ef117f77
2,205
ps1
PowerShell
TOOL-ConvertTo-StringList/ConvertTo-StringList.ps1
dbensmith/PowerShell
170f0405cfca80d6d5ff80753480a9997a5faeb0
[ "MIT" ]
1,727
2015-01-29T09:09:34.000Z
2022-03-31T16:54:34.000Z
TOOL-ConvertTo-StringList/ConvertTo-StringList.ps1
dbensmith/PowerShell
170f0405cfca80d6d5ff80753480a9997a5faeb0
[ "MIT" ]
23
2015-07-09T03:45:16.000Z
2021-10-17T20:28:22.000Z
TOOL-ConvertTo-StringList/ConvertTo-StringList.ps1
dbensmith/PowerShell
170f0405cfca80d6d5ff80753480a9997a5faeb0
[ "MIT" ]
646
2015-01-12T11:42:34.000Z
2022-03-29T07:06:40.000Z
function ConvertTo-StringList { <# .SYNOPSIS Function to convert an array into a string list with a delimiter. .DESCRIPTION Function to convert an array into a string list with a delimiter. .PARAMETER Array Specifies the array to process. .PARAMETER Delimiter Separator between value, default is "," .EXAMPLE $Computers = "Computer1","Computer2" ConvertTo-StringList -Array $Computers Output: Computer1,Computer2 .EXAMPLE $Computers = "Computer1","Computer2" ConvertTo-StringList -Array $Computers -Delimiter "__" Output: Computer1__Computer2 .EXAMPLE $Computers = "Computer1" ConvertTo-StringList -Array $Computers -Delimiter "__" Output: Computer1 .NOTES Francois-Xavier Cat lazywinadmin.com @lazywinadmin I used this function in System Center Orchestrator (SCORCH). This is sometime easier to pass data between activities .LINK https://github.com/lazywinadmin/PowerShell #> [CmdletBinding()] [OutputType([string])] param ( [Parameter(Mandatory = $true, ValueFromPipeline = $true)] [System.Array]$Array, [system.string]$Delimiter = "," ) BEGIN { $StringList = "" } PROCESS { Write-Verbose -Message "Array: $Array" foreach ($item in $Array) { # Adding the current object to the list $StringList += "$item$Delimiter" } Write-Verbose -Message "StringList: $StringList" } END { TRY { IF ($StringList) { $lenght = $StringList.Length Write-Verbose -Message "StringList Lenght: $lenght" # Output Info without the last delimiter $StringList.Substring(0, ($lenght - $($Delimiter.length))) } }# TRY CATCH { Write-Warning -Message "[END] Something wrong happening when output the result" $Error[0].Exception.Message } FINALLY { # Reset Variable $StringList = "" } } }
25.639535
91
0.570975
33efbbcd4106fe76343d44096b33f0cec1a04bb3
1,108
h
C
src/acs_parameters.h
RSkinderowicz/AntColonySystemSA
d27f001b4ae9d3adeb34d9f2342cf10d6a00045a
[ "MIT" ]
2
2018-01-16T21:34:49.000Z
2021-07-22T18:16:08.000Z
src/acs_parameters.h
RSkinderowicz/AntColonySystemSA
d27f001b4ae9d3adeb34d9f2342cf10d6a00045a
[ "MIT" ]
null
null
null
src/acs_parameters.h
RSkinderowicz/AntColonySystemSA
d27f001b4ae9d3adeb34d9f2342cf10d6a00045a
[ "MIT" ]
3
2017-11-03T15:19:20.000Z
2020-04-04T02:47:09.000Z
#ifndef ACS_PARAMS #define ACS_PARAMS #include <cstdint> /* * A collection of the standard ACS parameters to simplify passing to functions * & methods. */ struct ACSParameters { uint32_t ants_count_ = 10; double beta_ = 3.0; uint32_t cand_list_size_ = 25; double rho_ = 0.1; // global evaporation rate double phi_ = 0.01; // local evaporation rate double q0_ = 0.9; // Non-optimization related parameters bool verbose_ = true; }; /* * A collection of the standard ACS parameters to simplify passing to functions * & methods. */ struct ACSSAParameters { uint32_t ants_count_; double beta_ = 3.0; uint32_t cand_list_size_ = 25; double rho_ = 0.1; // global evaporation rate double phi_ = 0.01; // local evaporation rate double q0_ = 0.9; // Non-optimization related parameters bool verbose_ = true; // SA-related parameters double sa_cooling_ratio_ = 0.999; double sa_initial_accept_prob_ = 0.3; double sa_min_temperature_multiplier_ = 1e-4; uint32_t sa_temp_init_moves_ = 1000u; }; #endif /* ifndef ACS_PARAMS */
24.086957
79
0.690433
58e7db7dd3b058c59bf70c309fca190c7ccaaade
4,937
css
CSS
public/css/style.css
padi-dev-khoanx/fastshare
6b56f29f47852f9c353cbf764a67a0488db8230d
[ "MIT" ]
null
null
null
public/css/style.css
padi-dev-khoanx/fastshare
6b56f29f47852f9c353cbf764a67a0488db8230d
[ "MIT" ]
null
null
null
public/css/style.css
padi-dev-khoanx/fastshare
6b56f29f47852f9c353cbf764a67a0488db8230d
[ "MIT" ]
null
null
null
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400); .frame { position: absolute; top: 50%; left: 50%; width: 400px; height: 400px; margin-top: -200px; margin-left: -200px; border-radius: 2px; box-shadow: 1px 2px 10px 0px rgba(0, 0, 0, 0.3); background: #3A92AF; background: -webkit-gradient(linear, left bottom, right top, from(#3A92AF), to(#5CA05A)); background: linear-gradient(to top right, #3A92AF 0%, #5CA05A 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3A92AF', endColorstr='#5CA05A',GradientType=1 ); color: #fff; font-family: 'Open Sans', Helvetica, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .center { position: absolute; width: 300px; height: 260px; top: 70px; left: 50px; background: #fff; box-shadow: 8px 10px 15px 0 rgba(0, 0, 0, 0.2); border-radius: 3px; } .title { font-size: 16px; color: #676767; margin-top: 10px; /* border-bottom: 1px solid #D8D8D8; */ text-align: center; } .sub-title { font-size: 10px; color: #676767; text-align: center; margin-bottom: 5px; } .dropzone { position: absolute; z-index: 1; box-sizing: border-box; display: table; table-layout: fixed; width: 100px; height: 80px; top: 86px; left: 100px; border: 1px dashed #A4A4A4; border-radius: 3px; text-align: center; overflow: hidden; } .link-copy { text-align: center; margin-top: 60px; } .link-input { width: 90%; border: solid #6ECE3B 2px; padding: 6px; border-radius: 3px; color: #8a8a8a; margin: auto; font-size: 15px; } .dropzone.is-dragover { border-color: #666; background: #eee; } .dropzone .content { display: table-cell; vertical-align: middle; } .dropzone .upload { margin: 6px 0 0 2px; } .dropzone .filename { display: block; color: #676767; font-size: 14px; line-height: 18px; } .dropzone .input { position: absolute; top: 0; left: 0; right: 0; bottom: 0; opacity: 0; } .upload-btn { position: absolute; width: 140px; height: 40px; left: 80px; bottom: 24px; background: #6ECE3B; border-radius: 3px; text-align: center; line-height: 40px; font-size: 14px; box-shadow: 0 2px 0 0 #498C25; cursor: pointer; -webkit-transition: all .2s ease-in-out; transition: all .2s ease-in-out; } .upload-btn:hover { box-shadow: 0 2px 0 0 #498C25, 0 2px 10px 0 #6ECE3B; } .progress { position:relative; width:90%; height: 20px; margin: auto; } .bar { background-color: #498C25; width:0%; height:20px; } .percent { position:absolute; display:inline-block; margin: auto; text-align: center; color: #fff; z-index: 99; width: 100%; height: 20px; } .syncing { position: absolute; top: 109px; left: 134px; opacity: 0; } .syncing.active { -webkit-animation: syncing 3s ease-in-out infinite; animation: syncing 3s ease-in-out infinite; animation-iteration-count: infinite; } .done { position: absolute; top: 112px; left: 132px; opacity: 0; } .done.active { -webkit-animation: done .3s ease-in; animation: done .3s ease-in; -webkit-animation-fill-mode: both; animation-fill-mode: both; } .show-link { display: none; } .copy-btn { position: absolute; width: 140px; height: 40px; left: 80px; bottom: 24px; background: #6ECE3B; border-radius: 3px; text-align: center; line-height: 40px; font-size: 14px; box-shadow: 0 2px 0 0 #498C25; cursor: pointer; -webkit-transition: all .2s ease-in-out; transition: all .2s ease-in-out; } .copy-btn:hover { box-shadow: 0 2px 0 0 #498C25, 0 2px 10px 0 #6ECE3B; } @-webkit-keyframes syncing { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 10% { opacity: 1; } 90% { opacity: 1; } 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); opacity: 0; } } @keyframes syncing { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 10% { opacity: 1; } 90% { opacity: 1; } 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); opacity: 0; } } @-webkit-keyframes done { from { opacity: 0; } to { opacity: 1; } } @keyframes done { from { opacity: 0; } to { opacity: 1; } } .not_exist { color: rgb(41, 41, 41); top: 45%; position: absolute; text-align: center; width: 100%; font-size: 24px; } .not_exist_js { color: rgb(41, 41, 41); top: 45%; position: absolute; text-align: center; width: 100%; font-size: 24px; display: none; } .error{ text-align: center; color: rgb(184, 40, 40); font-size: 12px; width: 100%; position: absolute; top: 65%; font-weight: bold; }
18.490637
118
0.6111
384f99bfd3727da07d87534b6a82922aea72b413
6,243
php
PHP
src/Persistence/Service/StackDriverLoggerService.php
webravolab/layers
df92d7f902206c94a71179daa01e53c54373de0a
[ "MIT" ]
null
null
null
src/Persistence/Service/StackDriverLoggerService.php
webravolab/layers
df92d7f902206c94a71179daa01e53c54373de0a
[ "MIT" ]
null
null
null
src/Persistence/Service/StackDriverLoggerService.php
webravolab/layers
df92d7f902206c94a71179daa01e53c54373de0a
[ "MIT" ]
null
null
null
<?php namespace Webravo\Persistence\Service; use Symfony\Component\Debug\Exception\FatalThrowableError; use Webravo\Infrastructure\Library\Configuration; use Psr\Log\LoggerInterface; use Psr\Log\LogLevel; use Google\Cloud\Logging\LoggingClient; use Monolog\Handler\AbstractProcessingHandler; use Monolog\Logger; class StackDriverLoggerService extends AbstractProcessingHandler implements LoggerInterface { /* * @var array */ protected $options; /** * @param string $googleProjectId Google Project Id * @param string $logName The name of the log to write entries to. * @param array $options Configuration options. * @param object $logging Logging Object(for test) */ public function __construct($googleProjectId = null, $logName = null, $options=[], $logging=null) { if (is_null($googleProjectId)) { $googleProjectId = Configuration::get('GOOGLE_PROJECT_ID'); } if (is_null($logName)) { $logName = Configuration::get('GOOGLE_LOG_NAME', null, 'global'); } if (is_null($logging)) { $logging = new LoggingClient([ 'projectId' => $googleProjectId, ]); } $this->logger = $logging->logger($logName); // set logger options. // see http://googlecloudplatform.github.io/google-cloud-php/#/ $this->options = [ 'resource' => [ 'type' => 'generic_task', ], 'labels' => [ 'project_id' => $googleProjectId, 'logName' => $logName, ], 'timestamp' => (new \DateTime())->format(\DateTime::RFC3339_EXTENDED), ]; $this->options = $this->array_merge_recursive_distinct($this->options, $options); } public function write(array $record) { if (!isset($record['formatted']) || 'string' !== gettype($record['formatted'])) { throw new \InvalidArgumentException('StackdriverLoggerService accepts only formatted records as a string'); } if (!isset($this->options['severity']) && isset($record['level'])) { // Add severity if not already set and passed through the record (Monolog compatibility) $this->options['severity'] = $record['level']; } // Update timestamp if (preg_match("/^\[.*\]: \[([0-9]{4}-(0[1-9]|1[0-2])-([0-9]{2}) ([0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}))\].*$/", $record['formatted'], $a_matches) || preg_match("/^.*\[([0-9]{4}-(0[1-9]|1[0-2])-([0-9]{2}) ([0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}))\].*$/", $record['formatted'], $a_matches)) { if (is_array($a_matches) && isset($a_matches[1])) { // Get timestamp from message if written in ISO format $log_date = \DateTime::createFromFormat("Y-m-d H:i:s", $a_matches[1]); $this->options['timestamp'] = $log_date->format(\DateTime::RFC3339_EXTENDED); $record['formatted'] = str_replace(' ' ,' ', str_replace('[' . $a_matches[1] . ']','', $record['formatted'])); } } else { $this->options['timestamp'] = (new \DateTime())->format(\DateTime::RFC3339_EXTENDED); } // Check for any exception to log if (isset($this->options['labels']['exception'])) { $e = $this->options['labels']['exception']; $a_stack = []; if ($e instanceof FatalThrowableError) { $this->options['labels']['exception'] = $e->getMessage(); $this->logger->write($record['formatted'], $this->options); $trace_message = $e->getFile() . ' - ' . $e->getLine() . ' - ' . $e->getTraceAsString(); $this->logger->write($trace_message, $this->options); } } else { $this->logger->write($record['formatted'], $this->options); } } public function log($severity, $message, array $context = array()) { $level = Logger::getLevelName($severity); if (count($context) > 0) { foreach($context as $key => $value) { if (is_array($value)) { // Flatten any sub-array value because labels must be plain strings - 2019-05-07 <PN> $context[$key] = serialize($value); } } $this->options = array_replace($this->options, [ 'labels' => $context ]); } $this->options = array_replace($this->options, [ 'severity' => $severity ]); $this->write(['formatted' => "[$level]: $message"]); } public function alert($message, array $context = array()) { $this->log(Logger::ALERT, $message, $context); } public function critical($message, array $context = array()) { $this->log(Logger::CRITICAL, $message, $context); } public function debug($message, array $context = array()) { $this->log(Logger::DEBUG, $message, $context); } public function emergency($message, array $context = array()) { $this->log(Logger::EMERGENCY, $message, $context); } public function error($message, array $context = array()) { $this->log(Logger::ERROR, $message, $context); } public function info($message, array $context = array()) { $this->log(Logger::INFO, $message, $context); } public function notice($message, array $context = array()) { $this->log(LOgger::NOTICE, $message, $context); } public function warning($message, array $context = array()) { $this->log(Logger::WARNING, $message, $context); } protected function array_merge_recursive_distinct(array &$array1, array &$array2) { $merged = $array1; foreach ($array2 as $key => &$value) { if (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) { $merged[$key] = $this->array_merge_recursive_distinct($merged[$key], $value); } else { $merged[$key] = $value; } } return $merged; } }
36.296512
150
0.543969
d67c6142e0353cdcf8b1251a4a33a1871c224dea
353
swift
Swift
validation-test/compiler_crashers_fixed/01097-no-stacktrace.swift
ghostbar/swift-lang.deb
b1a887edd9178a0049a0ef839c4419142781f7a0
[ "Apache-2.0" ]
10
2015-12-25T02:19:46.000Z
2021-11-14T15:37:57.000Z
validation-test/compiler_crashers_fixed/01097-no-stacktrace.swift
ghostbar/swift-lang.deb
b1a887edd9178a0049a0ef839c4419142781f7a0
[ "Apache-2.0" ]
2
2016-02-01T08:51:00.000Z
2017-04-07T09:04:30.000Z
validation-test/compiler_crashers_fixed/01097-no-stacktrace.swift
ghostbar/swift-lang.deb
b1a887edd9178a0049a0ef839c4419142781f7a0
[ "Apache-2.0" ]
3
2016-04-02T15:05:27.000Z
2019-08-19T15:25:02.000Z
// RUN: not %target-swift-frontend %s -parse // Distributed under the terms of the MIT license // Test case submitted to project by https://github.com/practicalswift (practicalswift) // Test case found by fuzzing extension NSSet { if c == .b { } var f = 1 var e: Int -> Int = { } } import Foundation extension NSSet { convenience init(array: Array) {
20.764706
87
0.708215
05fb0e4dc08da553fafef34b4e0923fc528a3380
8,557
swift
Swift
Safe Reach/SocialVC.swift
gdelarosa/Safe-Reach
dbdfea6f33d038b1ba7ffb49e02458299919b6ec
[ "MIT" ]
null
null
null
Safe Reach/SocialVC.swift
gdelarosa/Safe-Reach
dbdfea6f33d038b1ba7ffb49e02458299919b6ec
[ "MIT" ]
null
null
null
Safe Reach/SocialVC.swift
gdelarosa/Safe-Reach
dbdfea6f33d038b1ba7ffb49e02458299919b6ec
[ "MIT" ]
null
null
null
// // SocialVC.swift // Safe Reach // // Created by Gina De La Rosa on 12/11/16. // Copyright © 2016 Gina De La Rosa. All rights reserved. // import UIKit class SocialVC: UITableViewController { let imageList = ["bienestar", "bienestar", "bienestar", "bienestar", "bienestar", "bienestar", "bienestar", "bienestar", "colors", "covenant", "friendscc", "friendsproject", "genderwell", "youthcenter", "lambda", "gendercenter", "layouth", "micentro", "myfriend", "safeplace", "trianglesquare", "village"] let titleList = ["Bienestar Coachella", "Bienestar El Monte", "Bienestar Hollywood", "Bienestar Long Beach", "Bienestar East Los Angeles", "Bienestar Pomona", "Bienestar San Fernando Valley", "Bienestar South Los Angeles", "Colors LGBTQ Youth Counseling Center", "Covenant House", "Friends Community Center", "Friends of Project 10", "Gender Wellness of Los Angeles", "Highland Annex and Youth Center", "Lambda Legal", "Los Angeles Gender Center", "Los Angeles Youth", "Mi Centro", "My Friend's Place", "Safe Place For Youth", "Triangle Square", "The Village at Ed Gould Plaza"] let descriptionList = ["BIENESTAR is a unique non-profit social service organization dedicated to positively impacting the health and well-being of the Latino community and other underserved communities in Southern California.", "BIENESTAR is a unique non-profit social service organization dedicated to positively impacting the health and well-being of the Latino community and other underserved communities in Southern California.", "BIENESTAR is a unique non-profit social service organization dedicated to positively impacting the health and well-being of the Latino community and other underserved communities in Southern California.", "BIENESTAR is a unique non-profit social service organization dedicated to positively impacting the health and well-being of the Latino community and other underserved communities in Southern California.", "BIENESTAR is a unique non-profit social service organization dedicated to positively impacting the health and well-being of the Latino community and other underserved communities in Southern California.", "BIENESTAR is a unique non-profit social service organization dedicated to positively impacting the health and well-being of the Latino community and other underserved communities in Southern California.", "BIENESTAR is a unique non-profit social service organization dedicated to positively impacting the health and well-being of the Latino community and other underserved communities in Southern California.", "BIENESTAR is a unique non-profit social service organization dedicated to positively impacting the health and well-being of the Latino community and other underserved communities in Southern California.", "Colors LGBTQ Youth Counseling Center provides free LGBTQ-affirmative counseling and psychotherapy services to youth under 25 and their families in the greater Los Angeles area.", "Covenant House California (CHC) is a non-profit agency whose mission is to reach out to at-risk homeless youth living on the streets and offer them hope and opportunities to turn their lives around.", "Provides services for and conducts research with substance-using gay and bisexual men, other men who have sex with men, and high-risk transgender women.", "Friends of Project 10 Inc. is a nonprofit that provides support and outreach to lesbian, gay, bisexual, transgender and questioning (LGBTQ) youth.", "A counseling practice devoted to working with clients — and their families — who are coping with all issues related to gender identity.", "Provides addiction recovery services, clothing, counseling, computer center, emergency overnight beds, employment assistance, food, GED program, HIV and STD testing, and showers, hate crime victim assistance, legal services, LifeWorks, RISE, Transgender Economic empowerment, and family services.", "The mission of Lambda Legal is to achieve full recognition of the civil rights of lesbians, gay men, bisexuals, transgender people and those with HIV through impact litigation, education and public policy work.", "Counseling and support for the LGBTQ+ community.", "The Los Angeles Youth mission is to empower abused, neglected and homeless adolescents to become self-sufficient.", "Provides legal and immigration services, public policy and community building, senior services, and transgender support services.", "My Friend’s Place assists and inspires homeless youth to build self-sufficient lives.", "Safe Place for Youth's mission is to inspire, nurture and empower the resilient human spirit of homeless youth by providing immediate and lasting solutions, one young person at a time.", "Triangle Square Apartments is the nation's first affordable lesbian, gay, bisexual and transgender (LGBT) housing development of private, individual apartment homes.", "Provides AIDS/LifeCycle, Conversation Groups/Meetings, Cultural Arts and Education, Leadership LAB, Room/Facility Rentals, Senior Services, and Volunteer Resources."] override func viewDidLoad() { super.viewDidLoad() let imageView = UIImageView(image: UIImage(named: "Triangle")) imageView.contentMode = UIViewContentMode.scaleAspectFit let titleView = UIView(frame: CGRect(x: 0, y: 0, width: 50, height: 30)) imageView.frame = titleView.bounds titleView.addSubview(imageView) self.navigationItem.titleView = titleView } // MARK: - Tableview override func numberOfSections(in tableView: UITableView) -> Int { return 1 } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return titleList.count } override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell: TableViewCell = tableView.dequeueReusableCell(withIdentifier: "Social") as! TableViewCell cell.socialTitle.text = titleList[(indexPath as NSIndexPath).row] cell.socialDescription.text = descriptionList[(indexPath as NSIndexPath).row] let imageName = UIImage(named: imageList[(indexPath as NSIndexPath).row]) cell.socialImage.image = imageName return cell } override func prepare(for segue: UIStoryboardSegue, sender: Any?) { // store information into string before push to detail view if (segue.identifier == "SocialDetail") { // reference detailVC in this vc let dvc = segue.destination as! SocialDetailVC if let indexPath = self.tableView.indexPathForSelectedRow { // convert to string to place in our sent data let title = titleList[(indexPath as NSIndexPath).row] as String // now we reference objects in the dvc dvc.sentTitleData = title // convert to string to place in our sent data let description = descriptionList[(indexPath as NSIndexPath).row] as String // now we reference objects in the dvc dvc.sentDescriptionData = description // convert to string to place in our sent data let imageView = imageList[(indexPath as NSIndexPath).row] as String // now we reference objects in the dvc dvc.sentImageData = imageView } } } }
60.260563
308
0.645553
43b9a0633835340de6b12dd4640cc23c0a87671e
809
ts
TypeScript
src/commands/projects/index.ts
fega/turbojira
db202e112d3a7c11222c737a734d630b6d1f931e
[ "MIT" ]
null
null
null
src/commands/projects/index.ts
fega/turbojira
db202e112d3a7c11222c737a734d630b6d1f931e
[ "MIT" ]
12
2022-03-12T18:26:50.000Z
2022-03-12T18:28:39.000Z
src/commands/projects/index.ts
fega/turbojira
db202e112d3a7c11222c737a734d630b6d1f931e
[ "MIT" ]
null
null
null
import {Command, Flags} from '@oclif/core' import {JiraService} from '../../services/jira' import jiraView from '../../services/jira-view' export default class Projects extends Command { static description = 'Say hello' static examples = [ `$ oex hello friend --from oclif hello friend from oclif! (./src/commands/hello/index.ts) `, ] static flags = { from: Flags.string({char: 'f', description: 'Whom is saying hello', required: false}), } static args = [{name: 'person', description: 'Person to say hello to', required: false}] async run(): Promise<void> { const {args, flags} = await this.parse(Projects) const a = new JiraService() const projects = await a.getProjects() console.table(projects.map(element => jiraView.formatProject(element)).join('\n')) } }
27.896552
90
0.673671
7439565926a41d45e7d12605616c35836e8b7ca5
1,615
css
CSS
assets/css/style.css
morislm/modul-lab
39d69b9bbf4b1e8c73ec7da2d3297475aa74ef18
[ "MIT" ]
null
null
null
assets/css/style.css
morislm/modul-lab
39d69b9bbf4b1e8c73ec7da2d3297475aa74ef18
[ "MIT" ]
null
null
null
assets/css/style.css
morislm/modul-lab
39d69b9bbf4b1e8c73ec7da2d3297475aa74ef18
[ "MIT" ]
null
null
null
body { background: #FFFFFF; margin: 0px; font-family: 'Roboto', sans-serif; font-size: 14px; color: #4f5252; font-weight: 400; } .container{ margin-top:50px; padding: 10px; } ul, ol, li { margin: 0; padding: 0; list-style: none; } .reorder_link { color: #3675B4; border: solid 2px #3675B4; border-radius: 3px; text-transform: uppercase; background: #fff; font-size: 18px; padding: 10px 20px; margin: 15px 15px 15px 0px; font-weight: bold; text-decoration: none; transition: all 0.35s; -moz-transition: all 0.35s; -webkit-transition: all 0.35s; -o-transition: all 0.35s; white-space: nowrap; } .reorder_link:hover { color: #fff; border: solid 2px #3675B4; background: #3675B4; box-shadow: none; } #reorder-helper{ margin: 18px 10px; padding: 10px; } .light_box { background: #efefef; padding: 20px; margin: 15px 0; text-align: center; font-size: 1.2em; } /* image gallery */ .gallery{ width:100%; float:left; margin-top:15px; } .gallery ul{ display:table-row; } .gallery ul li{ display: table-cell; height: 100px; list-style-type: none; margin: 10px; vertical-align: middle; } /* .gallery ul{ margin:0; padding:0; list-style-type:none; } .gallery ul li{ padding:7px; border:2px solid #ccc; float:left; margin:10px 7px; background:none; width:auto; height:30px; line-height: 30px; } */ .gallery img{ width:250px; } /* notice box */ .notice, .notice a{ color: #fff !important; } .notice { z-index: 8888; padding: 10px; margin-top: 20px; } .notice a { font-weight: bold; } .notice_error { background: #E46360; } .notice_success { background: #657E3F; }
15.380952
35
0.67678
45644cce9dd5d973d1fe22e0e33216693d052346
2,449
rs
Rust
src/main.rs
Knights-of-the-Functional-Calculus/rusti
d6bdcdb46ede063eefb3b405ef02679388b6abdd
[ "MIT" ]
null
null
null
src/main.rs
Knights-of-the-Functional-Calculus/rusti
d6bdcdb46ede063eefb3b405ef02679388b6abdd
[ "MIT" ]
null
null
null
src/main.rs
Knights-of-the-Functional-Calculus/rusti
d6bdcdb46ede063eefb3b405ef02679388b6abdd
[ "MIT" ]
null
null
null
extern crate serenity; use serenity::client::Client; use serenity::framework::standard::{macros::group, StandardFramework}; use serenity::prelude::EventHandler; use serenity::prelude::Context; use serenity::{ framework::standard::{macros::command, CommandResult}, model::{channel::Message, gateway::Ready}, }; #[macro_use] extern crate log; extern crate env_logger; mod commands; use crate::commands::role::*; mod util; use crate::util::travis::*; mod web_server; use crate::web_server::*; use std::env; extern crate hyper; #[macro_use] extern crate serde_json; extern crate gotham; #[macro_use] extern crate gotham_derive; extern crate futures; group!({ name: "general", options: {}, commands: [ping], }); struct Handler; impl EventHandler for Handler { fn ready(&self, context: Context, ready: Ready) { debug!("{} is connected!", ready.user.name); for guild in ready.guilds { match guild .id() .create_role(&context.http, |r| r.hoist(true).name("python")) { Ok(res) => debug!("{:?}", res), Err(error) => error!("{:?}", error), }; } post_travis_repo( "repo", "Knights-of-the-Functional-Calculus", "code-skill-validator-python", "activate", None, ); let addr = format!( "{}:{}", &env::var("WEBHOOK_HOST").expect("host"), &env::var("WEBHOOK_PORT").expect("port") ); error!("Listening for requests at http://{}", &addr); gotham::start(addr, webhook::router(&context)); } } fn main() { env_logger::init(); // Login with a bot token from the environment let mut client = Client::new(&env::var("DISCORD_TOKEN").expect("token"), Handler) .expect("Error creating client"); client.with_framework( StandardFramework::new() .configure(|c| c.prefix("~")) // set the bot's prefix to "~" .group(&GENERAL_GROUP) .group(&ROLE_GROUP), ); // start listening for events by starting a single shard if let Err(why) = client.start() { error!("An error occurred while running the client: {:?}", why); } } #[command] fn ping(ctx: &mut Context, msg: &Message) -> CommandResult { msg.reply(ctx, "Pong!")?; debug!("ping:\t{:?}", msg.author.name); Ok(()) }
24.009804
85
0.575337
c5404c287e27140ec417f05540a1ec41f77e0cda
7,757
dart
Dart
lib/generated/google/cloud/dialogflow/v2beta1/session_entity_type.pbjson.dart
balajiks-dev/dialogflow_flutter
1c7825abd774541628ee31cb9c9910fb0e6e54ec
[ "Apache-2.0" ]
5
2021-04-28T08:25:19.000Z
2021-09-13T15:22:33.000Z
lib/generated/google/cloud/dialogflow/v2beta1/session_entity_type.pbjson.dart
balajiks-dev/dialogflow_flutter
1c7825abd774541628ee31cb9c9910fb0e6e54ec
[ "Apache-2.0" ]
4
2021-03-26T12:49:08.000Z
2022-03-20T06:43:03.000Z
lib/generated/google/cloud/dialogflow/v2beta1/session_entity_type.pbjson.dart
balajiks-dev/dialogflow_flutter
1c7825abd774541628ee31cb9c9910fb0e6e54ec
[ "Apache-2.0" ]
6
2021-07-16T11:46:22.000Z
2021-11-17T21:43:28.000Z
/// // Generated code. Do not modify. // source: google/cloud/dialogflow/v2beta1/session_entity_type.proto // // @dart = 2.12 // ignore_for_file: annotate_overrides,camel_case_types,unnecessary_const,non_constant_identifier_names,library_prefixes,unused_import,unused_shown_name,return_of_invalid_type,unnecessary_this,prefer_final_fields,deprecated_member_use_from_same_package import 'dart:core' as $core; import 'dart:convert' as $convert; import 'dart:typed_data' as $typed_data; @$core.Deprecated('Use sessionEntityTypeDescriptor instead') const SessionEntityType$json = const { '1': 'SessionEntityType', '2': const [ const {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'}, const { '1': 'entity_override_mode', '3': 2, '4': 1, '5': 14, '6': '.google.cloud.dialogflow.v2beta1.SessionEntityType.EntityOverrideMode', '10': 'entityOverrideMode' }, const { '1': 'entities', '3': 3, '4': 3, '5': 11, '6': '.google.cloud.dialogflow.v2beta1.EntityType.Entity', '10': 'entities' }, ], '4': const [SessionEntityType_EntityOverrideMode$json], '7': const {}, }; @$core.Deprecated('Use sessionEntityTypeDescriptor instead') const SessionEntityType_EntityOverrideMode$json = const { '1': 'EntityOverrideMode', '2': const [ const {'1': 'ENTITY_OVERRIDE_MODE_UNSPECIFIED', '2': 0}, const {'1': 'ENTITY_OVERRIDE_MODE_OVERRIDE', '2': 1}, const {'1': 'ENTITY_OVERRIDE_MODE_SUPPLEMENT', '2': 2}, ], }; /// Descriptor for `SessionEntityType`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List sessionEntityTypeDescriptor = $convert.base64Decode( 'ChFTZXNzaW9uRW50aXR5VHlwZRISCgRuYW1lGAEgASgJUgRuYW1lEncKFGVudGl0eV9vdmVycmlkZV9tb2RlGAIgASgOMkUuZ29vZ2xlLmNsb3VkLmRpYWxvZ2Zsb3cudjJiZXRhMS5TZXNzaW9uRW50aXR5VHlwZS5FbnRpdHlPdmVycmlkZU1vZGVSEmVudGl0eU92ZXJyaWRlTW9kZRJOCghlbnRpdGllcxgDIAMoCzIyLmdvb2dsZS5jbG91ZC5kaWFsb2dmbG93LnYyYmV0YTEuRW50aXR5VHlwZS5FbnRpdHlSCGVudGl0aWVzIoIBChJFbnRpdHlPdmVycmlkZU1vZGUSJAogRU5USVRZX09WRVJSSURFX01PREVfVU5TUEVDSUZJRUQQABIhCh1FTlRJVFlfT1ZFUlJJREVfTU9ERV9PVkVSUklERRABEiMKH0VOVElUWV9PVkVSUklERV9NT0RFX1NVUFBMRU1FTlQQAjrDAupBvwIKK2RpYWxvZ2Zsb3cuZ29vZ2xlYXBpcy5jb20vU2Vzc2lvbkVudGl0eVR5cGUSRXByb2plY3RzL3twcm9qZWN0fS9hZ2VudC9zZXNzaW9ucy97c2Vzc2lvbn0vZW50aXR5VHlwZXMve2VudGl0eV90eXBlfRJacHJvamVjdHMve3Byb2plY3R9L2xvY2F0aW9ucy97bG9jYXRpb259L2FnZW50L3Nlc3Npb25zL3tzZXNzaW9ufS9lbnRpdHlUeXBlcy97ZW50aXR5X3R5cGV9Em1wcm9qZWN0cy97cHJvamVjdH0vYWdlbnQvZW52aXJvbm1lbnRzL3tlbnZpcm9ubWVudH0vdXNlcnMve3VzZXJ9L3Nlc3Npb25zL3tzZXNzaW9ufS9lbnRpdHlUeXBlcy97ZW50aXR5X3R5cGV9'); @$core.Deprecated('Use listSessionEntityTypesRequestDescriptor instead') const ListSessionEntityTypesRequest$json = const { '1': 'ListSessionEntityTypesRequest', '2': const [ const { '1': 'parent', '3': 1, '4': 1, '5': 9, '8': const {}, '10': 'parent' }, const {'1': 'page_size', '3': 2, '4': 1, '5': 5, '10': 'pageSize'}, const {'1': 'page_token', '3': 3, '4': 1, '5': 9, '10': 'pageToken'}, ], }; /// Descriptor for `ListSessionEntityTypesRequest`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List listSessionEntityTypesRequestDescriptor = $convert.base64Decode( 'Ch1MaXN0U2Vzc2lvbkVudGl0eVR5cGVzUmVxdWVzdBJLCgZwYXJlbnQYASABKAlCM+BBAvpBLRIrZGlhbG9nZmxvdy5nb29nbGVhcGlzLmNvbS9TZXNzaW9uRW50aXR5VHlwZVIGcGFyZW50EhsKCXBhZ2Vfc2l6ZRgCIAEoBVIIcGFnZVNpemUSHQoKcGFnZV90b2tlbhgDIAEoCVIJcGFnZVRva2Vu'); @$core.Deprecated('Use listSessionEntityTypesResponseDescriptor instead') const ListSessionEntityTypesResponse$json = const { '1': 'ListSessionEntityTypesResponse', '2': const [ const { '1': 'session_entity_types', '3': 1, '4': 3, '5': 11, '6': '.google.cloud.dialogflow.v2beta1.SessionEntityType', '10': 'sessionEntityTypes' }, const { '1': 'next_page_token', '3': 2, '4': 1, '5': 9, '10': 'nextPageToken' }, ], }; /// Descriptor for `ListSessionEntityTypesResponse`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List listSessionEntityTypesResponseDescriptor = $convert.base64Decode( 'Ch5MaXN0U2Vzc2lvbkVudGl0eVR5cGVzUmVzcG9uc2USZAoUc2Vzc2lvbl9lbnRpdHlfdHlwZXMYASADKAsyMi5nb29nbGUuY2xvdWQuZGlhbG9nZmxvdy52MmJldGExLlNlc3Npb25FbnRpdHlUeXBlUhJzZXNzaW9uRW50aXR5VHlwZXMSJgoPbmV4dF9wYWdlX3Rva2VuGAIgASgJUg1uZXh0UGFnZVRva2Vu'); @$core.Deprecated('Use getSessionEntityTypeRequestDescriptor instead') const GetSessionEntityTypeRequest$json = const { '1': 'GetSessionEntityTypeRequest', '2': const [ const {'1': 'name', '3': 1, '4': 1, '5': 9, '8': const {}, '10': 'name'}, ], }; /// Descriptor for `GetSessionEntityTypeRequest`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List getSessionEntityTypeRequestDescriptor = $convert.base64Decode( 'ChtHZXRTZXNzaW9uRW50aXR5VHlwZVJlcXVlc3QSRwoEbmFtZRgBIAEoCUIz4EEC+kEtCitkaWFsb2dmbG93Lmdvb2dsZWFwaXMuY29tL1Nlc3Npb25FbnRpdHlUeXBlUgRuYW1l'); @$core.Deprecated('Use createSessionEntityTypeRequestDescriptor instead') const CreateSessionEntityTypeRequest$json = const { '1': 'CreateSessionEntityTypeRequest', '2': const [ const { '1': 'parent', '3': 1, '4': 1, '5': 9, '8': const {}, '10': 'parent' }, const { '1': 'session_entity_type', '3': 2, '4': 1, '5': 11, '6': '.google.cloud.dialogflow.v2beta1.SessionEntityType', '8': const {}, '10': 'sessionEntityType' }, ], }; /// Descriptor for `CreateSessionEntityTypeRequest`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List createSessionEntityTypeRequestDescriptor = $convert.base64Decode( 'Ch5DcmVhdGVTZXNzaW9uRW50aXR5VHlwZVJlcXVlc3QSSwoGcGFyZW50GAEgASgJQjPgQQL6QS0SK2RpYWxvZ2Zsb3cuZ29vZ2xlYXBpcy5jb20vU2Vzc2lvbkVudGl0eVR5cGVSBnBhcmVudBJnChNzZXNzaW9uX2VudGl0eV90eXBlGAIgASgLMjIuZ29vZ2xlLmNsb3VkLmRpYWxvZ2Zsb3cudjJiZXRhMS5TZXNzaW9uRW50aXR5VHlwZUID4EECUhFzZXNzaW9uRW50aXR5VHlwZQ=='); @$core.Deprecated('Use updateSessionEntityTypeRequestDescriptor instead') const UpdateSessionEntityTypeRequest$json = const { '1': 'UpdateSessionEntityTypeRequest', '2': const [ const { '1': 'session_entity_type', '3': 1, '4': 1, '5': 11, '6': '.google.cloud.dialogflow.v2beta1.SessionEntityType', '8': const {}, '10': 'sessionEntityType' }, const { '1': 'update_mask', '3': 2, '4': 1, '5': 11, '6': '.google.protobuf.FieldMask', '10': 'updateMask' }, ], }; /// Descriptor for `UpdateSessionEntityTypeRequest`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List updateSessionEntityTypeRequestDescriptor = $convert.base64Decode( 'Ch5VcGRhdGVTZXNzaW9uRW50aXR5VHlwZVJlcXVlc3QSZwoTc2Vzc2lvbl9lbnRpdHlfdHlwZRgBIAEoCzIyLmdvb2dsZS5jbG91ZC5kaWFsb2dmbG93LnYyYmV0YTEuU2Vzc2lvbkVudGl0eVR5cGVCA+BBAlIRc2Vzc2lvbkVudGl0eVR5cGUSOwoLdXBkYXRlX21hc2sYAiABKAsyGi5nb29nbGUucHJvdG9idWYuRmllbGRNYXNrUgp1cGRhdGVNYXNr'); @$core.Deprecated('Use deleteSessionEntityTypeRequestDescriptor instead') const DeleteSessionEntityTypeRequest$json = const { '1': 'DeleteSessionEntityTypeRequest', '2': const [ const {'1': 'name', '3': 1, '4': 1, '5': 9, '8': const {}, '10': 'name'}, ], }; /// Descriptor for `DeleteSessionEntityTypeRequest`. Decode as a `google.protobuf.DescriptorProto`. final $typed_data.Uint8List deleteSessionEntityTypeRequestDescriptor = $convert.base64Decode( 'Ch5EZWxldGVTZXNzaW9uRW50aXR5VHlwZVJlcXVlc3QSRwoEbmFtZRgBIAEoCUIz4EEC+kEtCitkaWFsb2dmbG93Lmdvb2dsZWFwaXMuY29tL1Nlc3Npb25FbnRpdHlUeXBlUgRuYW1l');
43.335196
940
0.74668
5cfe3834e2c47494716edd8fbcd6e9b39d202368
217
php
PHP
admin/home.php
Analystharsh/Discussion-Forum-based-Web-Application-
a9454bf7550f6cf4ef630fb0d23b9b4001efd91f
[ "MIT" ]
1
2020-01-20T19:24:06.000Z
2020-01-20T19:24:06.000Z
admin/home.php
Analystharsh/Discussion-Forum-based-Web-Application-
a9454bf7550f6cf4ef630fb0d23b9b4001efd91f
[ "MIT" ]
null
null
null
admin/home.php
Analystharsh/Discussion-Forum-based-Web-Application-
a9454bf7550f6cf4ef630fb0d23b9b4001efd91f
[ "MIT" ]
null
null
null
<?php session_start(); require("header.php"); require("checkUser.php"); ?> <script type="text/javascript"> document.getElementById("ahome").className="active"; </script> <?php require("footer.php");?>
19.727273
54
0.654378
e24619206b283e9471b7d8a704ef5381bd39a7c2
1,018
js
JavaScript
spring-boot-rsocket-client/src/Metadata.js
rajviv95/spring-boot-rsocket-poc
8af75bbe7a698df1d6f36e7a7fb14f19f12774bb
[ "MIT" ]
null
null
null
spring-boot-rsocket-client/src/Metadata.js
rajviv95/spring-boot-rsocket-poc
8af75bbe7a698df1d6f36e7a7fb14f19f12774bb
[ "MIT" ]
null
null
null
spring-boot-rsocket-client/src/Metadata.js
rajviv95/spring-boot-rsocket-poc
8af75bbe7a698df1d6f36e7a7fb14f19f12774bb
[ "MIT" ]
1
2022-01-18T18:09:33.000Z
2022-01-18T18:09:33.000Z
import { JsonSerializer, MESSAGE_RSOCKET_ROUTING, encodeAndAddCustomMetadata, encodeAndAddWellKnownMetadata, } from "rsocket-core"; export class Metadata extends Map { constructor(json) { super(); if (json != null) { for (let [key, value] of json) { this.set(key, value); } } } toJSON() { const result = {}; for (let [key, value] of this.entries()) { result[key] = value; } return result; } } Metadata.ROUTE = "route"; Metadata.AUTHENTICATION_BEARER = "message/x.rsocket.authentication.v0"; export const JsonMetadataSerializer = { deserialize(data) { if (data == null) { return null; } let json = JsonSerializer.deserialize(data); return new Metadata(json); }, serialize(metadata) { if (metadata == null) { return null; } let json = metadata.toJSON(); return JsonSerializer.serialize(json); }, }; JsonMetadataSerializer.MIME_TYPE = "application/vnd.spring.rsocket.metadata+json";
21.208333
71
0.633595
6af2c7579048acf32c4100d0265ab64f41e92f4d
520
h
C
include/anki/util/NonCopyable.h
galek/anki-3d-engine
2b12968d8f2ca44d2aeb7480a4b8e63f7703ae75
[ "BSD-3-Clause" ]
1
2016-09-29T06:39:41.000Z
2016-09-29T06:39:41.000Z
include/anki/util/NonCopyable.h
galek/anki-3d-engine
2b12968d8f2ca44d2aeb7480a4b8e63f7703ae75
[ "BSD-3-Clause" ]
null
null
null
include/anki/util/NonCopyable.h
galek/anki-3d-engine
2b12968d8f2ca44d2aeb7480a4b8e63f7703ae75
[ "BSD-3-Clause" ]
null
null
null
// Copyright (C) 2014, Panagiotis Christopoulos Charitos. // All rights reserved. // Code licensed under the BSD License. // http://www.anki3d.org/LICENSE #ifndef ANKI_UTIL_NON_COPYABLE_H #define ANKI_UTIL_NON_COPYABLE_H namespace anki { /// @addtogroup util_patterns /// @{ /// Makes a derived class non copyable struct NonCopyable { NonCopyable() {} NonCopyable(const NonCopyable&) = delete; NonCopyable& operator=(const NonCopyable&) = delete; ~NonCopyable() {} }; /// @} } // end namespace anki #endif
16.774194
57
0.719231
7def50da4020f67d0b2308bf7a36f1a4ef7c5065
413
css
CSS
css/style.css
motasemodeh/201d13
3eb21f3d2e7abab9962990f77829df536b856811
[ "MIT" ]
null
null
null
css/style.css
motasemodeh/201d13
3eb21f3d2e7abab9962990f77829df536b856811
[ "MIT" ]
null
null
null
css/style.css
motasemodeh/201d13
3eb21f3d2e7abab9962990f77829df536b856811
[ "MIT" ]
null
null
null
h1{ margin: 7px; padding: 7px; text-align: center; font-size: large; } .linkes{ text-align: center; border: 4px solid black; padding: 4px; margin: 8px; } p{ text-align: center; } ul{ text-align: center; border: 4px solid black; padding: 4px; margin: 8px; } .top10{ text-align: center; border: 4px solid black; padding: 4px; margin: 8px; }
13.766667
28
0.57385
c64c3d48dbd345673de9b0cad243684928d11158
776
rb
Ruby
test/unit/core/shape/basic/test_basic_interface.rb
eitoball/thinreports-generator
567d7e52bd00fe7852c37b961a43efe85ff5b063
[ "MIT" ]
null
null
null
test/unit/core/shape/basic/test_basic_interface.rb
eitoball/thinreports-generator
567d7e52bd00fe7852c37b961a43efe85ff5b063
[ "MIT" ]
null
null
null
test/unit/core/shape/basic/test_basic_interface.rb
eitoball/thinreports-generator
567d7e52bd00fe7852c37b961a43efe85ff5b063
[ "MIT" ]
null
null
null
# coding: utf-8 require 'test/unit/helper' class ThinReports::Core::Shape::Basic::TestBlockInterface < MiniTest::Unit::TestCase include ThinReports::TestHelpers Basic = ThinReports::Core::Shape::Basic def setup parent = flexmock('parent') format = Basic::BlockFormat.new({}) internal = Basic::BlockInternal.new(parent, Basic::BlockFormat.new({})) @interface = Basic::BlockInterface.new(parent, format, internal) end def test_value_should_work_as_reader_with_no_arguments @interface.internal.write_value('new value') assert_equal @interface.value, 'new value' end def test_value_should_work_as_writer_with_arguments @interface.value('new value') assert_equal @interface.internal.read_value, 'new value' end end
28.740741
84
0.734536
d009c3b5bb2a63f16e4ff4d54d0e80df4972d23c
11,837
swift
Swift
ios/Classes/SwiftCustomAuthPlugin.swift
torusresearch/customauth-flutter-sdk
cc26ecdc94c4de60e88ae2361a83312f068f8fab
[ "MIT" ]
3
2022-03-22T09:04:38.000Z
2022-03-22T10:03:07.000Z
ios/Classes/SwiftCustomAuthPlugin.swift
torusresearch/customauth-flutter-sdk
cc26ecdc94c4de60e88ae2361a83312f068f8fab
[ "MIT" ]
6
2021-11-22T06:33:46.000Z
2022-03-05T01:15:04.000Z
ios/Classes/SwiftCustomAuthPlugin.swift
torusresearch/customauth-flutter-sdk
cc26ecdc94c4de60e88ae2361a83312f068f8fab
[ "MIT" ]
4
2021-07-15T20:01:49.000Z
2021-11-17T02:26:01.000Z
import Flutter import UIKit import CustomAuth import FetchNodeDetails struct CustomAuthArgs { let network: String; let browserRedirectUri: String; let redirectUri: String; var ethereumNetwork: EthereumNetwork { get { switch network { case "mainnet": return EthereumNetwork.MAINNET case "testnet": return EthereumNetwork.ROPSTEN default: return EthereumNetwork.ROPSTEN } } } } public class SwiftCustomAuthPlugin: NSObject, FlutterPlugin { public static func register(with registrar: FlutterPluginRegistrar) { let channel = FlutterMethodChannel(name: "customauth", binaryMessenger: registrar.messenger()) let instance = SwiftCustomAuthPlugin() registrar.addMethodCallDelegate(instance, channel: channel) } var customAuthArgs: CustomAuthArgs? = nil public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { guard let args = call.arguments as? Dictionary<String, Any> else { result(FlutterError( code: "INVALID_ARGUMENTS", message: "Invalid Flutter iOS plugin method arguments", details: nil)) return } switch call.method { case "init": guard let network = args["network"] as? String, let browserRedirectUri = args["browserRedirectUri"] as? String, let redirectUri = args["redirectUri"] as? String else { result(FlutterError( code: "MISSING_ARGUMENTS", message: "Missing init arguments", details: nil)) return } self.customAuthArgs = CustomAuthArgs( network: network, browserRedirectUri: browserRedirectUri, redirectUri: redirectUri) print("CustomAuthPlugin#init: " + "network=\(network), " + "browserRedirectUri=\(redirectUri), redirectUri=\(redirectUri)") result(nil) case "triggerLogin": guard let initArgs = self.customAuthArgs else { result(FlutterError( code: "NotInitializedException", message: "CustomAuth.init has to be called first", details: nil)) return } guard let typeOfLogin = args["typeOfLogin"] as? String, let verifier = args["verifier"] as? String, let clientId = args["clientId"] as? String else { result(FlutterError( code: "MissingArgumentException", message: "Missing triggerLogin arguments", details: nil)) return } guard let loginProvider = LoginProviders(rawValue: typeOfLogin) else { result(FlutterError( code: "InvalidTypeOfLoginException", message: "Invalid type of login", details: nil)) return } let jwtParams = args["jwtParams"] as? Dictionary<String, String> let subVerifierDetails = SubVerifierDetails( loginType: .web, loginProvider: loginProvider, clientId: clientId, verifierName: verifier, redirectURL: initArgs.redirectUri, browserRedirectURL: initArgs.browserRedirectUri, extraQueryParams: [:], jwtParams: jwtParams ?? [:] ) let customAuthSdk = CustomAuth( aggregateVerifierType: .singleLogin, aggregateVerifierName: verifier, subVerifierDetails: [subVerifierDetails], network: initArgs.ethereumNetwork ) customAuthSdk.triggerLogin(browserType: .external).done { data in result(data) }.catch { err in result(FlutterError( code: "IosSdkError", message: "Error from iOS SDK: \(err.localizedDescription)", details: err.localizedDescription )) } case "triggerAggregateLogin": guard let initArgs = self.customAuthArgs else { result(FlutterError( code: "NotInitializedException", message: "TorusDirect.init has to be called first", details: nil)) return } guard let aggregateVerifierType = args["aggregateVerifierType"] as? String, let verifierIdentifier = args["verifierIdentifier"] as? String, let subVerifierDetailsArray = args["subVerifierDetailsArray"] as? [Dictionary<String, Any>] else { result(FlutterError( code: "MissingArgumentException", message: "Missing triggerAggregateLogin arguments", details: nil)) return } var castedSubVerifierDetailsArray: [SubVerifierDetails] = [] for details in subVerifierDetailsArray { guard let loginProvider = LoginProviders( rawValue: details["typeOfLogin"] as! String ) else { result(FlutterError( code: "InvalidTypeOfLoginException", message: "Invalid type of login", details: nil)) return } let jwtParams = details["jwtParams"] as? Dictionary<String, String> castedSubVerifierDetailsArray.append( SubVerifierDetails( loginType: .web, loginProvider: loginProvider, clientId: details["clientId"] as! String, verifierName: details["verifier"] as! String, redirectURL: initArgs.redirectUri, browserRedirectURL: initArgs.browserRedirectUri, extraQueryParams: [:], jwtParams: jwtParams ?? [:] ) ) let customAuthSdk = CustomAuth( aggregateVerifierType: verifierTypes(rawValue: aggregateVerifierType)!, aggregateVerifierName: verifierIdentifier, subVerifierDetails: castedSubVerifierDetailsArray, network: initArgs.ethereumNetwork ) customAuthSdk.triggerLogin(browserType: .external).done { data in result(data) }.catch { err in result(FlutterError( code: "IosSdkError", message: "Error from iOS SDK: \(err.localizedDescription)", details: err.localizedDescription )) } } case "getTorusKey": guard let initArgs = self.customAuthArgs else { result(FlutterError( code: "NotInitializedException", message: "CustomAuth.init has to be called first", details: nil)) return } guard let verifier = args["verifier"] as? String, let verifierId = args["verifierId"] as? String, let idToken = args["idToken"] as? String, let verifierParams = args["verifierParams"] as? Dictionary<String, String> else { result(FlutterError( code: "MissingArgumentException", message: "Missing getTorusKey arguments", details: nil)) return } let subVerifierDetails = SubVerifierDetails( loginType: .web, loginProvider: .jwt, clientId: "<empty>", verifierName: verifier, redirectURL: initArgs.redirectUri, browserRedirectURL: "https://scripts.toruswallet.io/redirect.html", extraQueryParams: [:], jwtParams: [:] ) let customAuthSdk = CustomAuth( aggregateVerifierType: .singleLogin, aggregateVerifierName: verifier, subVerifierDetails: [subVerifierDetails], network: initArgs.ethereumNetwork ) customAuthSdk.getTorusKey(verifier: verifier, verifierId: verifierId, idToken: idToken, userData: verifierParams).done { data in result(data) }.catch { err in result(FlutterError( code: "IosSdkError", message: "Error from iOS SDK: \(err.localizedDescription)", details: err.localizedDescription )) } case "getAggregateTorusKey": guard let initArgs = self.customAuthArgs else { result(FlutterError( code: "NotInitializedException", message: "CustomAuth.init has to be called first", details: nil)) return } guard let verifier = args["verifier"] as? String, let verifierId = args["verifierId"] as? String, let subVerifierInfoArray = args["subVerifierInfoArray"] as? [Dictionary<String, Any>] else { result(FlutterError( code: "MissingArgumentException", message: "Missing getAggregateTorusKey arguments", details: nil)) return } if subVerifierInfoArray.count != 1 { result(FlutterError( code: "InvalidArgumentException", message: "subVerifierInfoArray must have length of 1", details: nil )) return } let sviaVerifier = subVerifierInfoArray[0]["verifier"] as! String let sviaIdToken = subVerifierInfoArray[0]["idToken"] as! String let subVerifierDetails = SubVerifierDetails( loginType: .web, loginProvider: .jwt, clientId: "<empty>", verifierName: sviaVerifier == "" ? verifier : sviaVerifier, redirectURL: initArgs.redirectUri, browserRedirectURL: "https://scripts.toruswallet.io/redirect.html", extraQueryParams: [:], jwtParams: [:] ) let customAuthSdk = CustomAuth( aggregateVerifierType: .singleIdVerifier, aggregateVerifierName: verifier, subVerifierDetails: [subVerifierDetails], network: initArgs.ethereumNetwork ) customAuthSdk.getAggregateTorusKey(verifier: verifier, verifierId: verifierId, idToken: sviaIdToken, subVerifierDetails: subVerifierDetails).done { data in result(data) }.catch { err in result(FlutterError( code: "IosSdkError", message: "Error from iOS SDK: \(err.localizedDescription)", details: err.localizedDescription )) } default: result(FlutterMethodNotImplemented) } } }
43.358974
167
0.518459
4445a771a7e1b6c0a3f26dbec6a8c7aa595fba4b
9,940
py
Python
deepcomp/env/entities/user.py
CN-UPB/DeepCoMP
f9f64873184bb53b5687ae62f8ba2b84da423692
[ "MIT" ]
19
2021-03-17T12:59:48.000Z
2022-03-24T09:04:32.000Z
deepcomp/env/entities/user.py
CN-UPB/DeepCoMP
f9f64873184bb53b5687ae62f8ba2b84da423692
[ "MIT" ]
1
2021-03-08T16:27:49.000Z
2021-03-08T16:27:49.000Z
deepcomp/env/entities/user.py
CN-UPB/DeepCoMP
f9f64873184bb53b5687ae62f8ba2b84da423692
[ "MIT" ]
6
2021-01-25T19:34:18.000Z
2022-03-20T05:56:33.000Z
import random import structlog from shapely.geometry import Point import matplotlib.pyplot as plt from matplotlib import cm from deepcomp.env.util.utility import log_utility, step_utility, linear_clipped_utility from deepcomp.util.constants import MIN_UTILITY, MAX_UTILITY, SUPPORTED_UTILITIES class User: """ A user/UE moving around in the world and requesting mobile services Connection to BS are checked before connecting and after every move to check if connection is lost or still stable """ def __init__(self, id, map, pos_x, pos_y, movement, util_func='log', dr_req=1): """ Create new UE object :param id: Unique ID of UE (string) :param map: Map object representing the playground/world :param pos_x: x-coord of starting position or 'random' :param pos_y: y-coord of starting position or 'random' :param movement: Movement utility object implementing the movement of the UE :param dr_req: Data rate requirement by UE for successful service """ self.id = id self.map = map self.movement = movement assert util_func in SUPPORTED_UTILITIES, \ f"Utility function {util_func} not supported. Supported: {SUPPORTED_UTILITIES}" self.util_func = util_func self.dr_req = dr_req # dict of connected BS: BS (only connected BS are keys!) --> data rate of connection self.bs_dr = {} # own RNG for reproducibility; global random shares state that's manipulated by RL during training self.rng = random.Random() self.init_pos_x = pos_x self.init_pos_y = pos_y self.pos = None self.reset_pos() self.movement.reset() # exponentially weighted moving average data rate self.ewma_dr = 0 self.log = structlog.get_logger(id=self.id, pos=str(self.pos), ewma_dr=self.ewma_dr, conn_bs=list(self.bs_dr.keys()), dr_req=self.dr_req) self.log.info('UE init') def __repr__(self): return str(self.id) # compare and hash UEs based on their ID only def __eq__(self, other): if type(other) is type(self): return self.id == other.id return False def __hash__(self): return hash(self.id) @property def curr_dr(self): """Current data rate the UE gets through all its BS connections""" dr = sum(list(self.bs_dr.values())) self.log.debug("Current data rate", curr_dr=dr) return dr @property def dr_req_satisfied(self): """Whether or not the UE's data rate requirement is satisfied by its current total data rate""" return self.curr_dr >= self.dr_req @property def utility(self): """Utility property based on the current data rate and utility function""" return self.dr_to_utility(self.curr_dr) def dr_to_utility(self, dr): """Utility function to map given data rate to utility for the UE""" assert self.util_func in SUPPORTED_UTILITIES, \ f"Utility function {self.util_func} not supported. Supported: {SUPPORTED_UTILITIES}" if self.util_func == 'log': return log_utility(dr) if self.util_func == 'step': return step_utility(dr, self.dr_req) if self.util_func == 'linear': return linear_clipped_utility(dr) # unknown utility not implemented raise NotImplementedError(f"Utility function {self.util_func} not implemented!") def seed(self, seed=None): self.rng.seed(seed) self.movement.seed(seed) def reset_pos(self): """(Re)set position based on initial position x and y as Point. Resolve 'random'.""" # set pos_x pos_x = self.init_pos_x if pos_x == 'random': pos_x = self.rng.randint(0, int(self.map.width)) # set pos_y pos_y = self.init_pos_y if pos_y == 'random': pos_y = self.rng.randint(0, int(self.map.height)) # set pos as Point self.pos = Point(pos_x, pos_y) def reset(self): """Reset UE position, movement, and connections.""" self.reset_pos() self.movement.reset() self.bs_dr = {} self.ewma_dr = 0 def plot(self, ax, radius=2, details=False): """ Plot the UE as filled circle with a given radius and the ID. Color from red to green indicating the utility. :param ax: Matplotlib axis to plot on :param radius: Radius of the circle :param details: Whether to show the UE's data rate and utility :return: A list of created matplotlib artists """ # show utility as red to yellow to green. use color map for [0,1) --> normalize utility first colormap = cm.get_cmap('RdYlGn') norm = plt.Normalize(MIN_UTILITY, MAX_UTILITY) color = colormap(norm(self.utility)) artists = ax.plot(*self.pos.buffer(radius).exterior.xy, color=color) artists.extend(ax.fill(*self.pos.buffer(radius).exterior.xy, color=color)) artists.append(ax.annotate(self.id, xy=(self.pos.x, self.pos.y), ha='center', va='center')) if details: # show curr data rate and utility below the UE artists.append(ax.annotate(f'r: {self.curr_dr:.2f}', xy=(self.pos.x, self.pos.y - radius - 2), ha='center', va='center')) artists.append(ax.annotate(f'qoe: {self.utility:.2f}', xy=(self.pos.x, self.pos.y - radius - 6), ha='center', va='center')) return artists def update_curr_dr(self): """Update the current data rate of all BS connections according to the current situation (pos & assignment)""" for bs in self.bs_dr: self.bs_dr[bs] = bs.data_rate(self) def update_ewma_dr(self, weight=0.9): """ Update the exp. weighted moving avg. of this UE's current data rate: `EWMA(t) = weight * dr + (1-weight) * EWMA(t-1)` Used as historic avg. rate for proportional-fair sharing. Called after movement. :param weight: Weight for EWMA in [0, 1]. The higher, the more focus on new/current dr and less on previous. """ self.ewma_dr = weight * self.curr_dr + (1 - weight) * self.ewma_dr self.log = self.log.bind(ewma_dr=self.ewma_dr) def move(self): """ Do one step: Move according to own movement pattern. Check for lost connections. Update EWMA data rate. :return: Number of connections lost through movement """ self.pos = self.movement.step(self.pos) num_lost_connections = self.check_bs_connection() self.log = self.log.bind(pos=str(self.pos)) self.update_ewma_dr() self.log.debug("User move", lost_connections=num_lost_connections) return num_lost_connections def check_bs_connection(self): """ Check if assigned BS connections are still stable (after move), else remove. :return: Number of removed/lost connections """ remove_bs = [] for bs in self.bs_dr: if not bs.can_connect(self.pos): self.log.info("Losing connection to BS", bs=bs) remove_bs.append(bs) # remove/disconnect bs for bs in remove_bs: self.disconnect_from_bs(bs) return len(remove_bs) def connect_to_bs(self, bs, disconnect=False, return_connected=False): """ Try to connect to specified basestation. Return if successful. :param bs: Basestation to connect to :param disconnect: If True, disconnect from BS if it was previously connected. :param return_connected: If True, return whether the UE is now connected to the BS or not. Else, return if the (dis-)connect was successful. :return: True if (dis-)connected successfully. False if out of range. If return_connected, return if connected. """ log = self.log.bind(bs=bs, disconnect=disconnect, conn_bs=list(self.bs_dr.keys())) # already connected if bs in self.bs_dr.keys(): if disconnect: self.disconnect_from_bs(bs) log.info("Disconnected") if return_connected: return False else: log.info("Staying connected") return True # not yet connected if bs.can_connect(self.pos): # add BS to connections; important: initialize with data rate # also important: initialize before adding connection to bs.conn_ues; affects how data rate is calc self.bs_dr[bs] = bs.data_rate(self) bs.conn_ues.append(self) self.log = self.log.bind(conn_bs=list(self.bs_dr.keys())) log.info("Connected") return True # log.info("Cannot connect") return False def disconnect_from_bs(self, bs): """Disconnect from given BS. Assume BS is currently connected.""" assert bs in self.bs_dr.keys(), "Not connected to BS --> Cannot disconnect" del self.bs_dr[bs] bs.conn_ues.remove(self) self.log = self.log.bind(conn_bs=list(self.bs_dr.keys())) def disconnect_from_all(self): """Disconnect from all BS. Necessary before removing UE.""" # copy list of all curr BS to avoid iterating over dict with changing size bs_list = list(self.bs_dr.keys()) for bs in bs_list: self.disconnect_from_bs(bs) def ues_at_same_bs(self): """Return set of UEs that are currently connected to any of the BS that this UE is connected to""" ue_set = set() for bs in self.bs_dr: ue_set.update(set(bs.conn_ues)) self.log.debug('UEs at same BS', ue_set=ue_set) return ue_set
40.571429
119
0.623742
7aa3b7bdced1c11c1f2cdf2e14680830bbe89b0e
3,296
cs
C#
samples/TaxAuthorities/ValuedPartner.TU.BusinessRepository/Menu/TUMenuModuleHelper.cs
DavidFWang/Sage300-SDK
daa5cf0134fd379675a988adbc12a20aeef80934
[ "MIT" ]
null
null
null
samples/TaxAuthorities/ValuedPartner.TU.BusinessRepository/Menu/TUMenuModuleHelper.cs
DavidFWang/Sage300-SDK
daa5cf0134fd379675a988adbc12a20aeef80934
[ "MIT" ]
null
null
null
samples/TaxAuthorities/ValuedPartner.TU.BusinessRepository/Menu/TUMenuModuleHelper.cs
DavidFWang/Sage300-SDK
daa5cf0134fd379675a988adbc12a20aeef80934
[ "MIT" ]
null
null
null
 // The MIT License (MIT) // Copyright (c) 1994-2017 The Sage Group plc or its licensors. All rights reserved. // // 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. using Sage.CA.SBS.ERP.Sage300.Common.BusinessRepository.Menu; using Sage.CA.SBS.ERP.Sage300.Common.Interfaces.Bootstrap; using Sage.CA.SBS.ERP.Sage300.Common.Interfaces.Repository.Menu; using Sage.CA.SBS.ERP.Sage300.Common.Models; using Sage.CA.SBS.ERP.Sage300.Common.Models.Portal; using System; using System.Collections.Generic; using System.ComponentModel.Composition; namespace ValuedPartner.BusinessRepository.Menu { /// <summary> /// TU Menu Module helper /// </summary> [Export(typeof(IMenuModuleHelper))] [BootstrapMetadataExport("TU", new[] { BootstrapAppliesTo.Web }, 10)] class TUMenuModuleHelper : AbstractMenuModuleHelper { /// <summary> /// Return Module specified /// </summary> public override string Module { get { return "TU"; } } /// <summary> /// Return Name of the screen file /// </summary> public override string MenuDetailFileName { get { return "TUMenuDetails.xml"; } } /// <summary> /// Return MultiCurrency status /// </summary> public bool IsMultiCurrency { get; private set; } /// <summary> /// Initialize the module manager /// </summary> /// <param name="company">string</param> /// <param name="context">Context</param> public override void Initialize(string company, Context context) { PrepareDataFile(company); } /// <summary> /// Return Menu Items with activation filter applied /// </summary> /// <returns>List</returns> public override List<NavigableMenu> GetFilteredMenuItems() { var criteriaList = new List<Func<NavigableMenu, bool>>(); return GetApplyFilteredMenuItems(criteriaList); } /// <summary> /// Flag to indicate whether the menu is third party development menu /// </summary> public override bool IsPlugInMenu { get { return true; } } } }
36.21978
88
0.656553
d4fff080c2ab84ef5fb9545c688f13482716f85b
6,283
ts
TypeScript
primitive.ts
jameswilddev/ayeful
cf7af4845304cd2f8189909264ccc528772f6cd8
[ "MIT" ]
null
null
null
primitive.ts
jameswilddev/ayeful
cf7af4845304cd2f8189909264ccc528772f6cd8
[ "MIT" ]
1
2020-09-04T23:02:57.000Z
2020-09-04T23:02:57.000Z
primitive.ts
jameswilddev/swizzler
cf7af4845304cd2f8189909264ccc528772f6cd8
[ "MIT" ]
null
null
null
export type FloatPrimitive = `float`; export type Vec2Primitive = `vec2`; export type Vec3Primitive = `vec3`; export type Vec4Primitive = `vec4`; export type AnyNonMatFloatPrimitive = | FloatPrimitive | Vec2Primitive | Vec3Primitive | Vec4Primitive; export type Mat2Primitive = `mat2`; export type Mat3Primitive = `mat3`; export type Mat4Primitive = `mat4`; export type AnyMatPrimitive = Mat2Primitive | Mat3Primitive | Mat4Primitive; export type AnyFloatPrimitive = AnyNonMatFloatPrimitive | AnyMatPrimitive; export type IntPrimitive = `int`; export type Ivec2Primitive = `ivec2`; export type Ivec3Primitive = `ivec3`; export type Ivec4Primitive = `ivec4`; export type AnyIntPrimitive = | IntPrimitive | Ivec2Primitive | Ivec3Primitive | Ivec4Primitive; export type BoolPrimitive = `bool`; export type Bvec2Primitive = `bvec2`; export type Bvec3Primitive = `bvec3`; export type Bvec4Primitive = `bvec4`; export type AnyBoolPrimitive = | BoolPrimitive | Bvec2Primitive | Bvec3Primitive | Bvec4Primitive; export type AnyCastablePrimitive = | AnyNonMatFloatPrimitive | Mat2Primitive | AnyIntPrimitive | AnyBoolPrimitive; export type AnyNumericPrimitive = AnyFloatPrimitive | AnyIntPrimitive; export type AnyPrimitive = AnyNumericPrimitive | AnyBoolPrimitive; export type BasePrimitive = FloatPrimitive | IntPrimitive | BoolPrimitive; export const basePrimitives: ReadonlyArray<BasePrimitive> = [ `float`, `int`, `bool`, ]; export const primitiveBases: { readonly [primitive in AnyPrimitive]: BasePrimitive; } = { float: `float`, vec2: `float`, vec3: `float`, vec4: `float`, mat2: `float`, mat3: `float`, mat4: `float`, int: `int`, ivec2: `int`, ivec3: `int`, ivec4: `int`, bool: `bool`, bvec2: `bool`, bvec3: `bool`, bvec4: `bool`, }; export type PairPrimitive = Vec2Primitive | Ivec2Primitive | Bvec2Primitive; export const pairPrimitives: ReadonlyArray<PairPrimitive> = [ `vec2`, `ivec2`, `bvec2`, ]; export const primitivePairs: { readonly [primitive in AnyPrimitive]: PairPrimitive; } = { float: `vec2`, vec2: `vec2`, vec3: `vec2`, vec4: `vec2`, mat2: `vec2`, mat3: `vec2`, mat4: `vec2`, int: `ivec2`, ivec2: `ivec2`, ivec3: `ivec2`, ivec4: `ivec2`, bool: `bvec2`, bvec2: `bvec2`, bvec3: `bvec2`, bvec4: `bvec2`, }; export type TripletPrimitive = Vec3Primitive | Ivec3Primitive | Bvec3Primitive; export const tripletPrimitives: ReadonlyArray<TripletPrimitive> = [ `vec3`, `ivec3`, `bvec3`, ]; export const primitiveTriplets: { readonly [primitive in AnyPrimitive]: TripletPrimitive; } = { float: `vec3`, vec2: `vec3`, vec3: `vec3`, vec4: `vec3`, mat2: `vec3`, mat3: `vec3`, mat4: `vec3`, int: `ivec3`, ivec2: `ivec3`, ivec3: `ivec3`, ivec4: `ivec3`, bool: `bvec3`, bvec2: `bvec3`, bvec3: `bvec3`, bvec4: `bvec3`, }; export type QuartetPrimitive = Vec4Primitive | Ivec4Primitive | Bvec4Primitive; export const quartetPrimitives: ReadonlyArray<QuartetPrimitive> = [ `vec4`, `ivec4`, `bvec4`, ]; export const primitiveQuartets: { readonly [primitive in AnyPrimitive]: QuartetPrimitive; } = { float: `vec4`, vec2: `vec4`, vec3: `vec4`, vec4: `vec4`, mat2: `vec4`, mat3: `vec4`, mat4: `vec4`, int: `ivec4`, ivec2: `ivec4`, ivec3: `ivec4`, ivec4: `ivec4`, bool: `bvec4`, bvec2: `bvec4`, bvec3: `bvec4`, bvec4: `bvec4`, }; export type PrimitiveArities = { readonly float: 1; readonly vec2: 2; readonly vec3: 3; readonly vec4: 4; readonly mat2: 4; readonly mat3: 9; readonly mat4: 16; readonly int: 1; readonly ivec2: 2; readonly ivec3: 3; readonly ivec4: 4; readonly bool: 1; readonly bvec2: 2; readonly bvec3: 3; readonly bvec4: 4; }; export const primitiveArities: PrimitiveArities = { float: 1, vec2: 2, vec3: 3, vec4: 4, mat2: 4, mat3: 9, mat4: 16, int: 1, ivec2: 2, ivec3: 3, ivec4: 4, bool: 1, bvec2: 2, bvec3: 3, bvec4: 4, }; export type CastToFloat = { readonly float: `float`; readonly vec2: `vec2`; readonly vec3: `vec3`; readonly vec4: `vec4`; readonly mat2: `vec4`; readonly int: `float`; readonly ivec2: `vec2`; readonly ivec3: `vec3`; readonly ivec4: `vec4`; readonly bool: `float`; readonly bvec2: `vec2`; readonly bvec3: `vec3`; readonly bvec4: `vec4`; }; export const castToFloat: CastToFloat = { float: `float`, vec2: `vec2`, vec3: `vec3`, vec4: `vec4`, mat2: `vec4`, int: `float`, ivec2: `vec2`, ivec3: `vec3`, ivec4: `vec4`, bool: `float`, bvec2: `vec2`, bvec3: `vec3`, bvec4: `vec4`, }; export type CastToInt = { readonly float: `int`; readonly vec2: `ivec2`; readonly vec3: `ivec3`; readonly vec4: `ivec4`; readonly mat2: `ivec4`; readonly int: `int`; readonly ivec2: `ivec2`; readonly ivec3: `ivec3`; readonly ivec4: `ivec4`; readonly bool: `int`; readonly bvec2: `ivec2`; readonly bvec3: `ivec3`; readonly bvec4: `ivec4`; }; export const castToInt: CastToInt = { float: `int`, vec2: `ivec2`, vec3: `ivec3`, vec4: `ivec4`, mat2: `ivec4`, int: `int`, ivec2: `ivec2`, ivec3: `ivec3`, ivec4: `ivec4`, bool: `int`, bvec2: `ivec2`, bvec3: `ivec3`, bvec4: `ivec4`, }; export type CastToBoolean = { readonly float: `bool`; readonly vec2: `bvec2`; readonly vec3: `bvec3`; readonly vec4: `bvec4`; readonly mat2: `bvec4`; readonly int: `bool`; readonly ivec2: `bvec2`; readonly ivec3: `bvec3`; readonly ivec4: `bvec4`; readonly bool: `bool`; readonly bvec2: `bvec2`; readonly bvec3: `bvec3`; readonly bvec4: `bvec4`; }; export const castToBoolean: CastToBoolean = { float: `bool`, vec2: `bvec2`, vec3: `bvec3`, vec4: `bvec4`, mat2: `bvec4`, int: `bool`, ivec2: `bvec2`, ivec3: `bvec3`, ivec4: `bvec4`, bool: `bool`, bvec2: `bvec2`, bvec3: `bvec3`, bvec4: `bvec4`, }; export function combinationOfPrimitives<TPrimitive extends AnyPrimitive>( ...primitives: ReadonlyArray<TPrimitive> ): TPrimitive { const castBasePrimitives: ReadonlyArray<AnyPrimitive> = basePrimitives; let output = primitives[0]; for (const primitive of primitives) { if (!castBasePrimitives.includes(primitive)) { output = primitive; } } return output; }
20.873754
79
0.663218
6dfe531eeba924c9a55d4716b3f15408a3d5a1b9
8,467
ts
TypeScript
controls/pdfexport/src/implementation/pages/pdf-page-layer.ts
cxspxr/ej2-javascript-ui-controls
e94214f8e78c7d290241ae5b905e03cdbc96e1a9
[ "Net-SNMP", "Xnet" ]
219
2018-10-31T10:53:46.000Z
2022-03-28T09:31:17.000Z
controls/pdfexport/src/implementation/pages/pdf-page-layer.ts
cxspxr/ej2-javascript-ui-controls
e94214f8e78c7d290241ae5b905e03cdbc96e1a9
[ "Net-SNMP", "Xnet" ]
98
2018-10-31T10:53:09.000Z
2022-03-16T03:52:15.000Z
controls/pdfexport/src/implementation/pages/pdf-page-layer.ts
cxspxr/ej2-javascript-ui-controls
e94214f8e78c7d290241ae5b905e03cdbc96e1a9
[ "Net-SNMP", "Xnet" ]
129
2018-11-14T15:48:56.000Z
2022-03-30T17:59:22.000Z
/** * PdfPageLayer.ts class for EJ2-PDF */ import { IPdfWrapper } from './../../interfaces/i-pdf-wrapper'; import { IPdfPrimitive } from './../../interfaces/i-pdf-primitives'; import { PdfPageBase } from './pdf-page-base'; import { PdfStream } from './../primitives/pdf-stream'; import { PdfDictionary } from './../primitives/pdf-dictionary'; import { PdfGraphics, GetResourceEventHandler } from './../graphics/pdf-graphics'; import { PdfPageLayerCollection } from './pdf-page-layer-collection'; import { DictionaryProperties } from './../input-output/pdf-dictionary-properties'; import { PdfArray } from './../primitives/pdf-array'; import { PdfPage } from './pdf-page'; import { RectangleF } from './../drawing/pdf-drawing'; import { PdfSectionCollection } from './../pages/pdf-section-collection'; import { PdfColorSpace } from './../graphics/enum'; import { PdfMargins } from './../graphics/pdf-margins'; /** * The `PdfPageLayer` used to create layers in PDF document. * @private */ export class PdfPageLayer implements IPdfWrapper { // Fields /** * Parent `page` of the layer. * @private */ private pdfPage : PdfPageBase; /** * `Graphics context` of the layer. * @private */ private pdfGraphics : PdfGraphics; /** * `Content` of the object. * @private */ private content : PdfStream; /** * Indicates whether the layer should `clip page template` dimensions or not. * @private */ private clipPageTemplates : boolean; // private bSaved : boolean; /** * Local Variable to store the `color space` of the document. * @private */ private pdfColorSpace : PdfColorSpace = PdfColorSpace.Rgb; /** * Local Variable to store the `layer id`. * @private */ private layerid : string; /** * Local Variable to store the `name`. * @private */ private layerName : string; /** * Local Variable to set `visibility`. * @default true * @private */ private isVisible : boolean = true; /** * Collection of the `layers` of the page. * @private */ private layer : PdfPageLayerCollection; /** * Indicates if `Sublayer` is present. * @default false * @private */ public sublayer : boolean = false; /** * Local variable to store `length` of the graphics. * @default 0 * @private */ public contentLength : number = 0; /** * Stores the `print Option` dictionary. * @private */ public printOption : PdfDictionary; /** * Stores the `usage` dictionary. * @private */ public usage : PdfDictionary; /** * Instance for `PdfDictionaryProperties` Class. * @private */ private dictionaryProperties : DictionaryProperties = new DictionaryProperties(); // Properties /** * Get or set the `color space`. * @private */ public get colorSpace() : PdfColorSpace { return this.pdfColorSpace; } public set colorSpace(value : PdfColorSpace) { this.pdfColorSpace = value; } /** * Gets parent `page` of the layer. * @private */ public get page() : PdfPageBase { return this.pdfPage; } /** * Gets and Sets the `id of the layer`. * @private */ public get layerId() : string { return this.layerid; } public set layerId(value : string) { this.layerid = value; } /** * Gets or sets the `name` of the layer. * @private */ public get name() : string { return this.layerName; } public set name(value : string) { this.layerName = value; } /** * Gets or sets the `visibility` of the layer. * @private */ public get visible() : boolean { return this.isVisible; } public set visible(value : boolean) { this.isVisible = value; } /** * Gets `Graphics` context of the layer, used to draw various graphical content on layer. * @private */ public get graphics() : PdfGraphics { if ((this.pdfGraphics == null)) { this.initializeGraphics(this.page); } return this.pdfGraphics; } /** * Gets the collection of `PdfPageLayer`, this collection handle by the class 'PdfPageLayerCollection'. * @private */ public get layers() : PdfPageLayerCollection { if (this.layer == null) { this.layer = new PdfPageLayerCollection(this.page); this.layer.sublayer = true; return this.layer; } else { return this.layer; } } // Constructors /** * Initializes a new instance of the `PdfPageLayer` class with specified PDF page. * @private */ public constructor(page : PdfPageBase) /** * Initializes a new instance of the `PdfPageLayer` class with specified PDF page and PDF stream. * @private */ public constructor(page : PdfPageBase, stream : PdfStream) /** * Initializes a new instance of the `PdfPageLayer` class. * @private */ public constructor(page : PdfPageBase, clipPageTemplates : boolean) public constructor(page : PdfPageBase, streamClipPageTemplates ?: boolean|PdfStream) { if (page === null) { throw new Error('ArgumentNullException:page'); } this.pdfPage = page; this.clipPageTemplates = true; if (typeof streamClipPageTemplates === 'undefined') { this.content = new PdfStream(); } else if (streamClipPageTemplates instanceof PdfStream || streamClipPageTemplates === null) { if (streamClipPageTemplates === null) { throw new Error('ArgumentNullException:stream'); } this.content = streamClipPageTemplates as PdfStream; } else { this.content = new PdfStream(); this.clipPageTemplates = streamClipPageTemplates; } } // Implementation /** * `Adds` a new PDF Page layer. * @private */ public add() : PdfPageLayer { let layer : PdfPageLayer = new PdfPageLayer(this.pdfPage); layer.name = ''; return layer; } /** * Returns a value indicating the `sign` of a single-precision floating-point number. * @private */ private sign(number : number) : number { if (number === 0) { return 0; } else if (number > 0) { return 1; } else { return -1; } } /** * `Initializes Graphics context` of the layer. * @private */ private initializeGraphics(page : PdfPageBase) : void { let oPage : PdfPage = page as PdfPage; let gr : GetResourceEventHandler = new GetResourceEventHandler(this.page); let cropBox : PdfArray = null; this.pdfGraphics = new PdfGraphics(page.size, gr, this.content); this.pdfGraphics.mediaBoxUpperRightBound = 0; if (oPage != null) { let sc : PdfSectionCollection = oPage.section.parent; if (sc != null) { this.pdfGraphics.colorSpace = sc.document.colorSpace; this.colorSpace = sc.document.colorSpace; } } // Transform coordinates to the left/top and activate margins. let isSame : boolean = (this.sign(page.origin.y) === this.sign(page.origin.x)); // if (page != null) { if (page.origin.x >= 0 && page.origin.y >= 0 || !(isSame)) { this.pdfGraphics.initializeCoordinates(); } else { // this.m_graphics.InitializeCoordinates(page); } let clipRect : RectangleF = oPage.section.getActualBounds(oPage, true); let margins : PdfMargins = oPage.section.pageSettings.margins; if (this.clipPageTemplates) { if (page.origin.x >= 0 && page.origin.y >= 0) { this.pdfGraphics.clipTranslateMargins(clipRect); } } else { this.graphics.clipTranslateMargins(clipRect.x, clipRect.y, margins.left, margins.top, margins.right, margins.bottom); } this.pdfGraphics.setLayer(this); // this.bSaved = false; } // IPdfWrapper Members /** * Gets the wrapped `element`. * @private */ public get element() : IPdfPrimitive { return this.content; } }
31.243542
129
0.587103
23996e6da229767580da944647d97f82f40c7fa4
3,797
js
JavaScript
packages/cloudform-types/types/greengrassV2/componentVersion.js
sundersc/cloudform
4754be3e8dcb502136cdc7b605a199590a2e6b2b
[ "MIT" ]
133
2017-11-24T13:43:17.000Z
2021-12-17T20:26:42.000Z
packages/cloudform-types/types/greengrassV2/componentVersion.js
sundersc/cloudform
4754be3e8dcb502136cdc7b605a199590a2e6b2b
[ "MIT" ]
49
2017-12-03T20:33:26.000Z
2022-03-09T19:52:49.000Z
packages/cloudform-types/types/greengrassV2/componentVersion.js
sundersc/cloudform
4754be3e8dcb502136cdc7b605a199590a2e6b2b
[ "MIT" ]
27
2018-02-05T23:09:00.000Z
2021-09-17T18:41:05.000Z
"use strict"; /* Generated from: * ap-northeast-1 (https://d33vqc0rt9ld30.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 39.2.0, * ap-northeast-2 (https://d1ane3fvebulky.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 39.2.0, * ap-south-1 (https://d2senuesg1djtx.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 39.2.0, * ap-southeast-1 (https://doigdx0kgq9el.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 39.2.0, * ap-southeast-2 (https://d2stg8d246z9di.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 39.2.0, * eu-central-1 (https://d1mta8qj7i28i2.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 39.2.0, * eu-west-1 (https://d3teyb21fexa9r.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 39.2.0, * eu-west-2 (https://d1742qcu2c1ncx.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 39.2.0, * us-east-1 (https://d1uauaxba7bl26.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 39.2.0, * us-east-2 (https://dnwj8swjjbsbt.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 39.2.0, * us-west-2 (https://d201a2mn26r7lk.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json), version 39.2.0 */ Object.defineProperty(exports, "__esModule", { value: true }); const resource_1 = require("../resource"); class ComponentPlatform { constructor(properties) { Object.assign(this, properties); } } exports.ComponentPlatform = ComponentPlatform; class LambdaContainerParams { constructor(properties) { Object.assign(this, properties); } } exports.LambdaContainerParams = LambdaContainerParams; class LambdaVolumeMount { constructor(properties) { Object.assign(this, properties); } } exports.LambdaVolumeMount = LambdaVolumeMount; class LambdaFunctionRecipeSource { constructor(properties) { Object.assign(this, properties); } } exports.LambdaFunctionRecipeSource = LambdaFunctionRecipeSource; class ComponentDependencyRequirement { constructor(properties) { Object.assign(this, properties); } } exports.ComponentDependencyRequirement = ComponentDependencyRequirement; class LambdaDeviceMount { constructor(properties) { Object.assign(this, properties); } } exports.LambdaDeviceMount = LambdaDeviceMount; class LambdaLinuxProcessParams { constructor(properties) { Object.assign(this, properties); } } exports.LambdaLinuxProcessParams = LambdaLinuxProcessParams; class LambdaEventSource { constructor(properties) { Object.assign(this, properties); } } exports.LambdaEventSource = LambdaEventSource; class LambdaExecutionParameters { constructor(properties) { Object.assign(this, properties); } } exports.LambdaExecutionParameters = LambdaExecutionParameters; class ComponentVersion extends resource_1.ResourceBase { constructor(properties) { super('AWS::GreengrassV2::ComponentVersion', properties || {}); } } exports.default = ComponentVersion; ComponentVersion.ComponentPlatform = ComponentPlatform; ComponentVersion.LambdaContainerParams = LambdaContainerParams; ComponentVersion.LambdaVolumeMount = LambdaVolumeMount; ComponentVersion.LambdaFunctionRecipeSource = LambdaFunctionRecipeSource; ComponentVersion.ComponentDependencyRequirement = ComponentDependencyRequirement; ComponentVersion.LambdaDeviceMount = LambdaDeviceMount; ComponentVersion.LambdaLinuxProcessParams = LambdaLinuxProcessParams; ComponentVersion.LambdaEventSource = LambdaEventSource; ComponentVersion.LambdaExecutionParameters = LambdaExecutionParameters;
44.151163
127
0.790361
e74d018bee5fc94e9a140e0c82b045d8ee948166
1,531
go
Go
bcs-services/cluster-resources/pkg/i18n/i18n_test.go
jamesgetx/bk-bcs
e4cf72cb3aed409d5ce0d1e10dde61dc63af68b8
[ "Apache-2.0" ]
null
null
null
bcs-services/cluster-resources/pkg/i18n/i18n_test.go
jamesgetx/bk-bcs
e4cf72cb3aed409d5ce0d1e10dde61dc63af68b8
[ "Apache-2.0" ]
null
null
null
bcs-services/cluster-resources/pkg/i18n/i18n_test.go
jamesgetx/bk-bcs
e4cf72cb3aed409d5ce0d1e10dde61dc63af68b8
[ "Apache-2.0" ]
null
null
null
/* * Tencent is pleased to support the open source community by making Blueking Container Service available. * Copyright (C) 2022 THL A29 Limited, a Tencent company. All rights reserved. * Licensed under the MIT License (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the License at * * http://opensource.org/licenses/MIT * * 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 i18n import ( "context" "testing" "github.com/stretchr/testify/assert" "github.com/Tencent/bk-bcs/bcs-services/cluster-resources/pkg/common/ctxkey" ) func TestGetMsg(t *testing.T) { // 初始化 i18n 字典 assert.Nil(t, InitMsgMap()) // 默认中文 ctx := context.TODO() assert.Equal(t, "无指定操作权限", GetMsg(ctx, "无指定操作权限")) // 指定为英文 ctx = context.WithValue(ctx, ctxkey.LangKey, EN) assert.Equal(t, "no operate permission!", GetMsg(ctx, "无指定操作权限")) // 指定为中文 ctx = context.WithValue(ctx, ctxkey.LangKey, ZH) assert.Equal(t, "无指定操作权限", GetMsg(ctx, "无指定操作权限")) } func TestGetMsgWithLang(t *testing.T) { // 初始化 i18n 字典 assert.Nil(t, InitMsgMap()) // 指定为英文 assert.Equal(t, "no operate permission!", GetMsgWithLang("无指定操作权限", EN)) // 指定为中文 assert.Equal(t, "无指定操作权限", GetMsgWithLang("无指定操作权限", ZH)) }
28.886792
106
0.723057
c66299cc0aefb64fcf86382f3c251d75897669aa
758
py
Python
main.py
ZimnyCat/2bTracker
9833b1209ac09b134c13f647213a0f53c28d743c
[ "WTFPL" ]
null
null
null
main.py
ZimnyCat/2bTracker
9833b1209ac09b134c13f647213a0f53c28d743c
[ "WTFPL" ]
1
2022-01-28T21:40:46.000Z
2022-02-01T16:38:08.000Z
main.py
ZimnyCat/2bTracker
9833b1209ac09b134c13f647213a0f53c28d743c
[ "WTFPL" ]
null
null
null
# -*- coding: utf-8 -*- from time import sleep from requests import get import utils print("2bTracker\nuses https://2bqueue.info/\n") utils.init() print("Getting 2b2t player lists...") oldQueuePlayerList = get("https://2bqueue.info/players").json()["queue"]["players"] oldMainPlayerList = get("https://2bqueue.info/players").json()["server"]["players"] print("Done.") while True: sleep(5) newQueuePlayerList = get("https://2bqueue.info/players").json()["queue"]["players"] newMainPlayerList = get("https://2bqueue.info/players").json()["server"]["players"] utils.compare(oldQueuePlayerList, newQueuePlayerList, oldMainPlayerList, newMainPlayerList) oldQueuePlayerList = newQueuePlayerList oldMainPlayerList = newMainPlayerList
30.32
95
0.724274
a349ef0d00e4adb3aaad11aed00ada9e91def2f3
6,538
h
C
gem/include/GEMStruct.h
xbai0624/MPD_GEM_View_SSP
823740845773c6b938159c40b8c04fb83a3a259f
[ "MIT" ]
null
null
null
gem/include/GEMStruct.h
xbai0624/MPD_GEM_View_SSP
823740845773c6b938159c40b8c04fb83a3a259f
[ "MIT" ]
null
null
null
gem/include/GEMStruct.h
xbai0624/MPD_GEM_View_SSP
823740845773c6b938159c40b8c04fb83a3a259f
[ "MIT" ]
null
null
null
#ifndef GEM_STRUCT_H #define GEM_STRUCT_H #include <cstdint> #include <vector> #include "MPDDataStruct.h" //////////////////////////////////////////////////////////////// // In mpd apv raw data, the length of one time sample // in the unit of uint32_t #define MPD_APV_TS_LEN 129 #define APV_STRIP_SIZE 128 //////////////////////////////////////////////////////////////// // raw ADC value on a strip (N time samples) struct StripRawADC { int stripNo; std::vector<int> v_adc; StripRawADC() : stripNo(-1) {} StripRawADC(const StripRawADC &r) = default; StripRawADC(StripRawADC &&r) = default; int GetTimeSampleSize() const { return static_cast<int>(v_adc.size()); } }; //////////////////////////////////////////////////////////////// // channel (on each APV) address struct GEMChannelAddress { int crate; int mpd; int adc; int strip; GEMChannelAddress() {} GEMChannelAddress(const int &c, const int &m, const int &a, const int &s) : crate(c), mpd(m), adc(a), strip(s) {} }; //////////////////////////////////////////////////////////////// // gem adc data for each strip struct GEM_Strip_Data { GEMChannelAddress addr; std::vector<float> values; GEM_Strip_Data() {} GEM_Strip_Data(const int &c, const int &m, const int &a, const int &s) : addr(c, m, a, s) {} void set_address (const int &c, const int &m, const int &a, const int &s) { addr.crate = c; addr.mpd = m; addr.adc = a; addr.strip = s; } void add_value(const float &v) { values.push_back(v); } }; //////////////////////////////////////////////////////////////// // raw event data structure struct EventData { // event info uint32_t event_number; uint8_t type; uint8_t trigger; uint64_t timestamp; // data banks std::vector<GEM_Strip_Data> gem_data; // constructors EventData() :event_number(0), type(0), trigger(0), timestamp(0) {} EventData(const uint8_t &t) :event_number(0), type(t), trigger(0), timestamp(0) {} void Clear() { event_number = 0; type = 0; trigger = 0; timestamp = 0; gem_data.clear(); } void update_type(const uint8_t &t) {type = t;} void update_trigger(const uint8_t &t) {trigger = t;} void update_time(const uint64_t &t) {timestamp = t;} uint32_t get_type() const {return type;} uint32_t get_trigger() const {return trigger;} uint64_t get_time() const {return timestamp;} void add_gemhit(const GEM_Strip_Data &g) {gem_data.emplace_back(g);} void add_gemhit(GEM_Strip_Data &&g) {gem_data.emplace_back(g);} std::vector<GEM_Strip_Data> &get_gem_data() {return gem_data;} const std::vector<GEM_Strip_Data> &get_gem_data() const {return gem_data;} }; //////////////////////////////////////////////////////////////// // gem hit struct struct StripHit { int32_t strip; float charge; float position; bool cross_talk; APVAddress apv_addr; StripHit() : strip(0), charge(0.), position(0.), cross_talk(false), apv_addr(-1, -1, -1) {} StripHit(int s, float c, float p, bool f = false, int crate = -1, int mpd = -1, int adc = -1) : strip(s), charge(c), position(p), cross_talk(f), apv_addr(crate, mpd, adc) {} }; //////////////////////////////////////////////////////////////// // gem cluster struct struct StripCluster { float position; float peak_charge; float total_charge; bool cross_talk; std::vector<StripHit> hits; StripCluster() : position(0.), peak_charge(0.), total_charge(0.), cross_talk(false) {} StripCluster(const std::vector<StripHit> &p) : position(0.), peak_charge(0.), total_charge(0.), cross_talk(false), hits(p) {} StripCluster(std::vector<StripHit> &&p) : position(0.), peak_charge(0.), total_charge(0.), cross_talk(false), hits(std::move(p)) {} }; //////////////////////////////////////////////////////////////// // a struct for gem raw data struct GEMRawData { APVAddress addr; const uint32_t *buf; uint32_t size; }; //////////////////////////////////////////////////////////////// // a struct for gem zero suppression data struct GEMZeroSupData { APVAddress addr; int channel; int time_sample; int adc_value; }; //////////////////////////////////////////////////////////////// // a base hit information class BaseHit { public: float x; // Cluster's x-position (mm) float y; // Cluster's y-position (mm) float z; // Cluster's z-position (mm) float E; // Cluster's energy (MeV) BaseHit() : x(0.), y(0.), z(0.), E(0.) {} BaseHit(float xi, float yi, float zi, float Ei) : x(xi), y(yi), z(zi), E(Ei) {} }; //////////////////////////////////////////////////////////////// // gem reconstructed hit class GEMHit : public BaseHit { public: int32_t det_id; // which GEM detector it belongs to float x_charge; // x charge float y_charge; // y charge float x_peak; // x peak charge float y_peak; // y peak charge int32_t x_size; // x hits size int32_t y_size; // y hits size float sig_pos; // position resolution GEMHit() : det_id(-1), x_charge(0.), y_charge(0.), x_peak(0.), y_peak(0.), x_size(0), y_size(0), sig_pos(0.) {} GEMHit(float xx, float yy, float zz, int d, float xc, float yc, float xp, float yp, int xs, int ys, float sig) : BaseHit(xx, yy, zz, 0.), det_id(d), x_charge(xc), y_charge(yc), x_peak(xp), y_peak(yp), x_size(xs), y_size(ys), sig_pos(sig) {} }; // status enums require bitwise manipulation // the following defintions are copies from Rtypes.h in root (cern) #define SET_BIT(n,i) ( (n) |= (1ULL << i) ) #define CLEAR_BIT(n,i) ( (n) &= ~(1ULL << i) ) #define TEST_BIT(n,i) ( (bool)( n & (1ULL << i) ) ) // raw data flags enum APVRawDataFlags { OnlineCommonModeSubtractionEnabled = 0x5, // bit(10 0000); common-mode sub is enabled OnlineBuildAllSamples = 0x4, // bit(01 0000); all samples are recorded(zero-sup disabled) OnlineCM_OR = 0x3, // bit(00 1000); common-mode out of range, (cm and zero-sup will be disabled for the following apv frame) }; #endif
25.243243
128
0.533038
0db41fffc4d437b581d255936fb33e1e56520326
4,695
rb
Ruby
app/helpers/railspress/revision_helper.rb
TrueSoft/railspress
13a8be2bed2717cadf9ceb54a95ff5a1a0cd4d9b
[ "MIT" ]
1
2021-06-26T13:19:51.000Z
2021-06-26T13:19:51.000Z
app/helpers/railspress/revision_helper.rb
TrueSoft/railspress
13a8be2bed2717cadf9ceb54a95ff5a1a0cd4d9b
[ "MIT" ]
30
2019-11-21T12:14:54.000Z
2022-02-17T16:46:09.000Z
app/helpers/railspress/revision_helper.rb
TrueSoft/railspress
13a8be2bed2717cadf9ceb54a95ff5a1a0cd4d9b
[ "MIT" ]
null
null
null
=begin * Post revision functions. * * file wp-includes\revision.php =end module Railspress::RevisionHelper # Determines if the specified post is a revision. # # @param [int|WP_Post] post Post ID or post object. # @return [false|int] False if not a revision, ID of revision's parent otherwise. def wp_is_post_revision(post) post = wp_get_post_revision(post) return false if post.nil? post.post_parent.to_i end # Gets a post revision. # # @param [int|WP_Post] post The post ID or object. # @param [string] output Optional. The required return type. One of OBJECT, ARRAY_A, or ARRAY_N, which correspond to # a WP_Post object, an associative array, or a numeric array, respectively. Default OBJECT. # @param [string] filter Optional sanitation filter. See sanitize_post(). # @return [WP_Post|array|null] WP_Post (or array) on success, or null on failure. def wp_get_post_revision(post, output = :OBJECT, filter = 'raw') revision = get_post(post, :OBJECT, filter) return revision if revision.nil? return nil if revision.post_type != 'revision' if output == :OBJECT return revision elsif output == :ARRAY_A _revision = get_object_vars(revision) return _revision elsif output == :ARRAY_N _revision = array_values(get_object_vars(revision)) return _revision end revision end # Returns all revisions of specified post. # # @see get_children() # # @param [int|WP_Post] post_id Optional. Post ID or WP_Post object. Default is global `$post`. # @param [array|null] args Optional. Arguments for retrieving post revisions. Default null. # @return [array] An array of revisions, or an empty array if none. def wp_get_post_revisions(post_id = 0, args = nil) post = get_post(post_id) return {} if post.nil? defaults = { order: 'DESC', orderby: 'post_date', # TODO How is it correct? orderby: 'date ID', check_enabled: true, } args = Railspress::Functions.wp_parse_args(args || {}, defaults) if args[:check_enabled] && !wp_revisions_enabled(post) return {} end args = args.merge({ post_parent: post.id, post_type: 'revision', post_status: 'inherit', }) revisions = get_children(args) return {} if revisions.nil? revisions end # Determine if revisions are enabled for a given post. # # @param [WP_Post] post The post object. # @return bool True if number of revisions to keep isn't zero, false otherwise. def wp_revisions_enabled(post) wp_revisions_to_keep(post) != 0 end # Determine how many revisions to retain for a given post. # # By default, an infinite number of revisions are kept. # # The constant WP_POST_REVISIONS can be set in wp-config to specify the limit # of revisions to keep. # # @param [WP_Post] post The post object. # @return [int] The number of revisions to keep. def wp_revisions_to_keep(post) num = !defined?(Railspress.WP_POST_REVISIONS) || Railspress.WP_POST_REVISIONS if num == true || 'true'.eql?(num) num = -1 else num = num.to_i end unless post_type_supports(post.post_type, 'revisions') num = 0 end # Filters the number of revisions to save for the given post. # # Overrides the value of WP_POST_REVISIONS. apply_filters('wp_revisions_to_keep', num, post).to_i end # Retrieve formatted date timestamp of a revision (linked to that revisions's page). # # @param [int|object] revision Revision ID or revision object. # @param [bool] link Optional, default is true. Link to revisions's page? # @return [string|false] i18n formatted datetimestamp or localized 'Current Revision'. def wp_post_revision_title(revision, link = true ) revision = get_post( revision ) return revision if revision.nil? return false unless ['post', 'page', 'revision'].include? revision.post_type # translators: revision date format, see https://secure.php.net/date datef = _x( 'F j, Y @ H:i:s', 'revision date format' ) # translators: %s: revision date autosavef = __( '%s [Autosave]' ) # translators: %s: revision date currentf = __( '%s [Current Revision]' ) date = date_i18n( datef, strtotime( revision.post_modified ) ) if ( link && current_user_can( 'edit_post', revision.id ) && link = get_edit_post_link( revision.id ) ) date = "<a href='#{link}'>#{date}</a>" end if !wp_is_post_revision(revision) date = sprintf(currentf, date ) elsif wp_is_post_autosave(revision) date = sprintf(autosavef, date ) end date end end
31.510067
122
0.672204
c4eabc24d27ea35b73a8be559fea0a51971629d2
1,327
cc
C++
src/dictionaries/node_webrtc/rtc_offer_options.cc
elofun/node-webrtc
be63c8c007402c25962df9e30c9813ba70b8a17b
[ "Apache-2.0" ]
1,302
2018-11-26T03:29:51.000Z
2022-03-31T23:38:34.000Z
src/dictionaries/node_webrtc/rtc_offer_options.cc
elofun/node-webrtc
be63c8c007402c25962df9e30c9813ba70b8a17b
[ "Apache-2.0" ]
311
2018-11-26T14:22:19.000Z
2022-03-28T09:47:38.000Z
src/dictionaries/node_webrtc/rtc_offer_options.cc
elofun/node-webrtc
be63c8c007402c25962df9e30c9813ba70b8a17b
[ "Apache-2.0" ]
233
2018-11-26T18:08:11.000Z
2022-03-30T01:29:50.000Z
#include "src/dictionaries/node_webrtc/rtc_offer_options.h" #include "src/functional/maybe.h" #include "src/functional/validation.h" namespace node_webrtc { #define RTC_OFFER_OPTIONS_FN CreateRTCOfferOptions static Validation<RTC_OFFER_OPTIONS> RTC_OFFER_OPTIONS_FN( const bool voiceActivityDetection, const bool iceRestart, const Maybe<bool> offerToReceiveAudio, const Maybe<bool> offerToReceiveVideo) { webrtc::PeerConnectionInterface::RTCOfferAnswerOptions options; options.ice_restart = iceRestart; options.voice_activity_detection = voiceActivityDetection; options.offer_to_receive_audio = offerToReceiveAudio.Map([](auto boolean) { return boolean ? webrtc::PeerConnectionInterface::RTCOfferAnswerOptions::kOfferToReceiveMediaTrue : 0; }).FromMaybe(webrtc::PeerConnectionInterface::RTCOfferAnswerOptions::kUndefined); options.offer_to_receive_video = offerToReceiveVideo.Map([](auto boolean) { return boolean ? webrtc::PeerConnectionInterface::RTCOfferAnswerOptions::kOfferToReceiveMediaTrue : 0; }).FromMaybe(webrtc::PeerConnectionInterface::RTCOfferAnswerOptions::kUndefined); return Pure(RTC_OFFER_OPTIONS(options)); } } // namespace node_webrtc #define DICT(X) RTC_OFFER_OPTIONS ## X #include "src/dictionaries/macros/impls.h" #undef DICT
36.861111
90
0.788244
da40c21ce41d34aa0c547dc1321f46a8c3be726c
584
ts
TypeScript
src/moduleResolver/__tests__/module.resolution.test.ts
Kend0r/fuse-box
0c30c7b1131de2ba8b3289892c199d50539fcc5a
[ "MIT" ]
4,452
2016-10-29T11:50:44.000Z
2022-03-27T01:49:29.000Z
src/moduleResolver/__tests__/module.resolution.test.ts
Kend0r/fuse-box
0c30c7b1131de2ba8b3289892c199d50539fcc5a
[ "MIT" ]
1,614
2016-11-14T18:26:33.000Z
2022-03-23T18:42:48.000Z
src/moduleResolver/__tests__/module.resolution.test.ts
Kend0r/fuse-box
0c30c7b1131de2ba8b3289892c199d50539fcc5a
[ "MIT" ]
431
2016-11-12T17:43:55.000Z
2022-03-22T17:22:39.000Z
import { EnvironmentType } from '../../config/EnvironmentType'; import { createIntegrationTest } from '../../testUtils/integrationTest'; describe('Module resolution test', () => { it('should ', async () => { // const test = createIntegrationTest({ // config: { entry: 'index.ts', target: 'browser' }, // envType: EnvironmentType.DEVELOPMENT, // files: { // 'hello.ts': 'export function hello(){}', // 'index.ts': `require("./hello")`, // }, // }); // const tool = await test.runDev(); // tool.runBundleInBrowser(); }); });
32.444444
72
0.568493
2cb0c2d2b43f07d1796562d69afb9f6d2b958dbd
12,925
py
Python
psdaq/psdaq/pyxpm/surf/protocols/rssi/_RssiCore.py
JBlaschke/lcls2
30523ef069e823535475d68fa283c6387bcf817b
[ "BSD-3-Clause-LBNL" ]
null
null
null
psdaq/psdaq/pyxpm/surf/protocols/rssi/_RssiCore.py
JBlaschke/lcls2
30523ef069e823535475d68fa283c6387bcf817b
[ "BSD-3-Clause-LBNL" ]
null
null
null
psdaq/psdaq/pyxpm/surf/protocols/rssi/_RssiCore.py
JBlaschke/lcls2
30523ef069e823535475d68fa283c6387bcf817b
[ "BSD-3-Clause-LBNL" ]
null
null
null
#!/usr/bin/env python #----------------------------------------------------------------------------- # Title : PyRogue RSSI module #----------------------------------------------------------------------------- # File : RssiCore.py # Created : 2017-04-12 #----------------------------------------------------------------------------- # Description: # PyRogue RSSI module #----------------------------------------------------------------------------- # This file is part of the rogue software platform. It is subject to # the license terms in the LICENSE.txt file found in the top-level directory # of this distribution and at: # https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. # No part of the rogue software platform, including this file, may be # copied, modified, propagated, or distributed except according to the terms # contained in the LICENSE.txt file. #----------------------------------------------------------------------------- import pyrogue as pr class RssiCore(pr.Device): def __init__( self, name = "RssiCore", description = "RSSI module", **kwargs): super().__init__(name=name, description=description, **kwargs) ############################## # Variables ############################## self.add(pr.RemoteVariable( name = "OpenConn", description = "Open Connection Request (Server goes to listen state, Client actively requests the connection by sending SYN segment)", offset = 0x00, bitSize = 1, bitOffset = 0x00, base = pr.UInt, mode = "RW", )) self.add(pr.RemoteVariable( name = "CloseConn", description = "Close Connection Request (Send a RST Segment to peer and close the connection)", offset = 0x00, bitSize = 1, bitOffset = 0x01, base = pr.UInt, mode = "RW", )) self.add(pr.RemoteVariable( name = "Mode", description = "Mode:'0': Use internal parameters from generics,'1': Use parameters from registers", offset = 0x00, bitSize = 1, bitOffset = 0x02, base = pr.UInt, mode = "RW", )) self.add(pr.RemoteVariable( name = "HeaderChksumEn", description = "Header checksum: '1': Enable calculation and check, '0': Disable check and insert 0 in place of header checksum", offset = 0x00, bitSize = 1, bitOffset = 0x03, base = pr.UInt, mode = "RW", )) self.add(pr.RemoteVariable( name = "InjectFault", description = "Inject fault to the next packet header checksum (Default '0'). Acts on rising edge - injects exactly one fault in next segment", offset = 0x00, bitSize = 1, bitOffset = 0x04, base = pr.UInt, mode = "RW", )) self.add(pr.RemoteVariable( name = "InitSeqN", description = "Initial sequence number [7:0]", offset = 0x04, bitSize = 8, bitOffset = 0x00, base = pr.UInt, mode = "RW", )) self.add(pr.RemoteVariable( name = "Version", description = "Version register [3:0]", offset = 0x08, bitSize = 4, bitOffset = 0x00, base = pr.UInt, mode = "RW", )) self.add(pr.RemoteVariable( name = "MaxOutsSeg", description = "Maximum out standing segments [7:0]", offset = 0x0C, bitSize = 8, bitOffset = 0x00, base = pr.UInt, mode = "RW", )) self.add(pr.RemoteVariable( name = "MaxSegSize", description = "Maximum segment size [15:0]", offset = 0x10, bitSize = 16, bitOffset = 0x00, base = pr.UInt, mode = "RW", )) self.add(pr.RemoteVariable( name = "RetransTimeout", description = "Retransmission timeout [15:0]", offset = 0x14, bitSize = 16, bitOffset = 0x00, base = pr.UInt, mode = "RW", )) self.add(pr.RemoteVariable( name = "CumAckTimeout", description = "Cumulative acknowledgment timeout [15:0]", offset = 0x18, bitSize = 16, bitOffset = 0x00, base = pr.UInt, mode = "RW", )) self.add(pr.RemoteVariable( name = "NullSegTimeout", description = "Null segment timeout [15:0]", offset = 0x1C, bitSize = 16, bitOffset = 0x00, base = pr.UInt, mode = "RW", )) self.add(pr.RemoteVariable( name = "MaxNumRetrans", description = "Maximum number of retransmissions [7:0]", offset = 0x20, bitSize = 8, bitOffset = 0x00, base = pr.UInt, mode = "RW", )) self.add(pr.RemoteVariable( name = "MaxCumAck", description = "Maximum cumulative acknowledgments [7:0]", offset = 0x24, bitSize = 8, bitOffset = 0x00, base = pr.UInt, mode = "RW", )) self.add(pr.RemoteVariable( name = "MaxOutOfSeq", description = "Max out of sequence segments (EACK) [7:0]", offset = 0x28, bitSize = 8, bitOffset = 0x00, base = pr.UInt, mode = "RW", )) self.add(pr.RemoteVariable( name = "ConnectionActive", description = "Connection Active", offset = 0x40, bitSize = 1, bitOffset = 0x00, base = pr.UInt, mode = "RO", pollInterval = 1, )) self.add(pr.RemoteVariable( name = "ErrMaxRetrans", description = "Maximum retransmissions exceeded retransMax.", offset = 0x40, bitSize = 1, bitOffset = 0x01, base = pr.UInt, mode = "RO", pollInterval = 1, )) self.add(pr.RemoteVariable( name = "ErrNullTout", description = "Null timeout reached (server) nullTout.", offset = 0x40, bitSize = 1, bitOffset = 0x02, base = pr.UInt, mode = "RO", pollInterval = 1, )) self.add(pr.RemoteVariable( name = "ErrAck", description = "Error in acknowledgment mechanism.", offset = 0x40, bitSize = 1, bitOffset = 0x03, base = pr.UInt, mode = "RO", pollInterval = 1, )) self.add(pr.RemoteVariable( name = "ErrSsiFrameLen", description = "SSI Frame length too long", offset = 0x40, bitSize = 1, bitOffset = 0x04, base = pr.UInt, mode = "RO", pollInterval = 1, )) self.add(pr.RemoteVariable( name = "ErrConnTout", description = "Connection to peer timed out. Timeout defined in generic PEER_CONN_TIMEOUT_G (Default: 1000 ms)", offset = 0x40, bitSize = 1, bitOffset = 0x05, base = pr.UInt, mode = "RO", pollInterval = 1, )) self.add(pr.RemoteVariable( name = "ParamRejected", description = "Client rejected the connection (parameters out of range), Server proposed new parameters (parameters out of range)", offset = 0x40, bitSize = 1, bitOffset = 0x06, base = pr.UInt, mode = "RO", pollInterval = 1, )) self.add(pr.RemoteVariable( name = "ValidCnt", description = "Number of valid segments [31:0]", offset = 0x44, bitSize = 32, bitOffset = 0x00, base = pr.UInt, mode = "RO", pollInterval = 1, )) self.add(pr.RemoteVariable( name = "DropCnt", description = "Number of dropped segments [31:0]", offset = 0x48, bitSize = 32, bitOffset = 0x00, base = pr.UInt, mode = "RO", pollInterval = 1, )) self.add(pr.RemoteVariable( name = "RetransmitCnt", description = "Counts all retransmission requests within the active connection [31:0]", offset = 0x4C, bitSize = 32, bitOffset = 0x00, base = pr.UInt, mode = "RO", pollInterval = 1, )) self.add(pr.RemoteVariable( name = "ReconnectCnt", description = "Counts all reconnections from reset [31:0]", offset = 0x50, bitSize = 32, bitOffset = 0x00, base = pr.UInt, mode = "RO", pollInterval = 1, )) self.add(pr.RemoteVariable( name = 'TxFrameRate', description = 'Outbound Frame Rate', units = 'Hz', offset = 0x54, base = pr.UInt, mode = "RO", disp = '{:d}', pollInterval = 1, )) self.add(pr.RemoteVariable( name = 'TxBandwidth', description = 'Outbound Bandwidth', units = 'B/s', offset = 0x5C, bitSize = 64, base = pr.UInt, mode = "RO", disp = '{:d}', pollInterval = 1, )) self.add(pr.RemoteVariable( name = 'RxFrameRate', description = 'Inbound Frame Rate', units = 'Hz', offset = 0x58, base = pr.UInt, mode = "RO", disp = '{:d}', pollInterval = 1, )) self.add(pr.RemoteVariable( name = 'RxBandwidth', description = 'Inbound Bandwidth', units = 'B/s', offset = 0x64, bitSize = 64, base = pr.UInt, mode = "RO", disp = '{:d}', pollInterval = 1, )) ############################## # Commands ############################## @self.command(name="C_OpenConn", description="Open connection request",) def C_OpenConn(): self.OpenConn.set(0) @self.command(name="C_CloseConn", description="Close connection request",) def C_CloseConn(): self.CloseConn.set(1) self.CloseConn.set(0) @self.command(name="C_InjectFault", description="Inject a single fault(for debug and test purposes only). Corrupts checksum during transmission",) def C_InjectFault(): self.InjectFault.set(1) self.InjectFault.set(0)
35.314208
156
0.402863
29b4e8040ab0ac933c3a300d2dfcd0a017ae27fb
121
rb
Ruby
spec/config/database_cleaner.rb
Progeser/progeser-api
e72324fe2c069de1a7d78ea0c542ed18f315664b
[ "Apache-2.0" ]
2
2019-10-23T19:45:14.000Z
2019-11-21T00:14:28.000Z
spec/config/database_cleaner.rb
Progeser/progeser-api
e72324fe2c069de1a7d78ea0c542ed18f315664b
[ "Apache-2.0" ]
7
2020-03-13T16:37:34.000Z
2021-09-14T13:49:08.000Z
spec/config/database_cleaner.rb
ProGeSer/progeser-api
e72324fe2c069de1a7d78ea0c542ed18f315664b
[ "Apache-2.0" ]
null
null
null
# frozen_string_literal: true require 'database_cleaner' DatabaseCleaner.strategy = :truncation DatabaseCleaner.clean
15.125
38
0.834711
ff496f83b4a7788c2b58aa26433f8ac171f17b72
1,058
py
Python
IncTrend/tests/test_api.py
AMOOOMA/IncTrend
c16cc1f91530a208122a48539d5a7bb0d3c75305
[ "MIT" ]
null
null
null
IncTrend/tests/test_api.py
AMOOOMA/IncTrend
c16cc1f91530a208122a48539d5a7bb0d3c75305
[ "MIT" ]
null
null
null
IncTrend/tests/test_api.py
AMOOOMA/IncTrend
c16cc1f91530a208122a48539d5a7bb0d3c75305
[ "MIT" ]
null
null
null
import pytest import json from django.test import TestCase, Client from django.urls import reverse from rest_framework import status def test_api(): assert True @pytest.mark.django_db def test_post_then_get_messages(): client = Client() test_message = {'id': 1, 'type': 'Test', 'body': 'this is a test message'} client.post('/Messages', test_message, format='json') resp = client.get('/Messages', format='json') assert resp.status_code == status.HTTP_200_OK assert json.loads(resp.content)[0] == test_message @pytest.mark.django_db def test_get_predictions_create_company(): client = Client() test_names = ['AAPL', 'AMZN', 'AAPL', 'AMZN', 'GOOGL'] for name in test_names: resp = client.get(reverse('company-predictions', args=(name,))) assert resp.status_code == status.HTTP_200_OK resp = client.get('/Company', format='json') assert resp.status_code == status.HTTP_200_OK assert len(json.loads(resp.content)) == 3 # make sure no duplicates added
31.117647
80
0.674858
238126e9ac2477f2a27f3c4d590dae2c2695c6f1
311
js
JavaScript
lib/TaxSystem.js
63pokupki/komtet-kassa-nodejs-sdk
78910c16dbbf5d199db6ca61b7988777d4480464
[ "BSD-3-Clause" ]
1
2019-08-29T04:30:11.000Z
2019-08-29T04:30:11.000Z
lib/TaxSystem.js
63pokupki/komtet-kassa-nodejs-sdk
78910c16dbbf5d199db6ca61b7988777d4480464
[ "BSD-3-Clause" ]
null
null
null
lib/TaxSystem.js
63pokupki/komtet-kassa-nodejs-sdk
78910c16dbbf5d199db6ca61b7988777d4480464
[ "BSD-3-Clause" ]
null
null
null
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class TaxSystem { } TaxSystem.COMMON = 0; TaxSystem.SIMPLIFIED_IN = 1; TaxSystem.SIMPLIFIED_IN_OUT = 2; TaxSystem.UTOII = 3; TaxSystem.UST = 4; TaxSystem.PATENT = 5; exports.TaxSystem = TaxSystem; //# sourceMappingURL=TaxSystem.js.map
25.916667
62
0.752412
a35cea11d07db88095dc09238e84d2429b8e0dc3
9,758
c
C
examples/rpl-border-router/webserver/webserver.c
wodishenga/contiki
f6870ceb7051579f7607e9f1df5d93e3d03cb1ee
[ "BSD-3-Clause" ]
null
null
null
examples/rpl-border-router/webserver/webserver.c
wodishenga/contiki
f6870ceb7051579f7607e9f1df5d93e3d03cb1ee
[ "BSD-3-Clause" ]
null
null
null
examples/rpl-border-router/webserver/webserver.c
wodishenga/contiki
f6870ceb7051579f7607e9f1df5d93e3d03cb1ee
[ "BSD-3-Clause" ]
null
null
null
/* * Copyright (c) 2017, RISE SICS * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. 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. * 3. Neither the name of the Institute 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 THE INSTITUTE AND CONTRIBUTORS ``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 THE INSTITUTE OR CONTRIBUTORS 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. * * This file is part of the Contiki operating system. * */ #include "contiki.h" #include "net/routing/routing.h" #include "net/ipv6/uip-ds6-nbr.h" #include "net/ipv6/uip-ds6-route.h" #include "net/ipv6/uip-sr.h" #include <stdio.h> #include <string.h> /*---------------------------------------------------------------------------*/ //static const char *TOP = "<html>\n <head>\n <title>Contiki-NG</title>\n </head>\n<body>\n"; //static const char *BOTTOM = "\n</body>\n</html>\n"; static const char *TOP = " <!DOCTYPE html>\n <html>\n <head>\n\ <meta charset=\"UTF-8\">\n\ <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n\ <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n\ <title>Contiki-NG</title>\n <style>\n\ * {\n\ padding: 0;\n\ margin: 0;\n\ }\n\ html,\n\ body {\n\ width: 100%;\n\ height: 98%;\n\ }\n\ svg {\n\ width: 100%;\n\ height: 98%;\n\ }\n\ .links line { \ stroke: rgb(86, 87, 87); \ stroke-opacity: 1; \ } \ .nodes circle { \ stroke: #fff; \ stroke-width: 1.5px; \ } \ text {\ font-family: sans-serif;\ font-size:16px;\ }\ </style>\n </head>\n <body>\n\ <svg width=\"1400\" height=\"950\"></svg>\n\ <script src=\"https://d3js.org/d3.v4.min.js\"></script>\n\ <script>\n\ var svg = d3.select(\"svg\"),\ width = +svg.attr(\"width\"),\ height = +svg.attr(\"height\");\ console.log(svg)\n\ var color = d3.scaleOrdinal(d3.schemeCategory20);\ var simulation = d3.forceSimulation()\ .force(\"link\", d3.forceLink().id(function(d) { return d.id; }).distance(110))\ .force(\"charge\", d3.forceManyBody().strength(-100))\ .force(\"center\", d3.forceCenter((width / 2 + 20), height / 2));\n"; ///////////////////////////// static const char *BOTTOM = "var link = svg.append(\"g\")\n\ .attr(\"class\", \"links\")\n\ .selectAll(\"line\")\n\ .data(graph.links)\n\ .enter().append(\"line\")\n\ .attr(\"stroke-width\", function(d) { return 3; });\n\ var node = svg.append(\"g\")\n\ .attr(\"class\", \"nodes\")\n\ .selectAll(\"g\")\n\ .data(graph.nodes)\n\ .enter().append(\"g\");\n\ var circles = node.append(\"circle\")\n\ .attr(\"r\", 8)\n\ .attr(\"fill\", function(d) { return color(d.group); })\n\ .call(d3.drag()\n\ .on(\"start\", dragstarted)\n\ .on(\"drag\", dragged)\n\ .on(\"end\", dragended));\n\ var lables = node.append(\"text\")\n\ .text(function(d) {\n\ return d.id;\n\ })\n\ .attr('x', 10)\n\ .attr('y', 5);\n\ node.append(\"title\")\n\ .text(function(d) { return d.id; });\n\ simulation\n\ .nodes(graph.nodes)\n\ .on(\"tick\", ticked);\n\ simulation.force(\"link\")\n\ .links(graph.links);\n\ function ticked() {\n\ link\n\ .attr(\"x1\", function(d) { return d.source.x; })\n\ .attr(\"y1\", function(d) { return d.source.y; })\n\ .attr(\"x2\", function(d) { return d.target.x; })\n\ .attr(\"y2\", function(d) { return d.target.y; });\n\ node\n\ .attr(\"cx\", function(d) {\n\ return d.x = Math.max(10, Math.min(width-10, d.x));\n\ })\n\ .attr(\"cy\", function(d) {\n\ return d.y = Math.max(16, Math.min(height-16, d.y));\n\ })\n\ .attr(\"transform\", function(d) {\n\ return \"translate(\" + d.x + \",\" + d.y + \")\";\n\ })\n\ }\n\ function dragstarted(d) {\n\ if (!d3.event.active) simulation.alphaTarget(0.3).restart();\n\ d.fx = d.x;\n\ d.fy = d.y;\n\ }\n\ function dragged(d) {\n\ d.fx = d3.event.x;\n\ d.fy = d3.event.y;\n\ }\n\ function dragended(d) {\n\ if (!d3.event.active) simulation.alphaTarget(0);\n\ d.fx = null;\n\ d.fy = null;\n\ }\n\ </script>\n\n"; static char buf[1024]; static int blen; #define ADD(...) do { \ blen += snprintf(&buf[blen], sizeof(buf) - blen, __VA_ARGS__); \ } while(0) #define SEND(s) do { \ SEND_STRING(s, buf); \ blen = 0; \ } while(0); /* Use simple webserver with only one page for minimum footprint. * Multiple connections can result in interleaved tcp segments since * a single static buffer is used for all segments. */ #include "httpd-simple.h" /*---------------------------------------------------------------------------*/ static void ipaddr_add(const uip_ipaddr_t *addr) { uint16_t a; int i, f; for(i = 0, f = 0; i < sizeof(uip_ipaddr_t); i += 2) { a = (addr->u8[i] << 8) + addr->u8[i + 1]; if(a == 0 && f >= 0) { if(f++ == 0) { ADD("::"); } } else { if(f > 0) { f = -1; } else if(i > 0) { ADD(":"); } ADD("%x", a); } } } /*---------------------------------------------------------------------------*/ static PT_THREAD(generate_routes(struct httpd_state *s)) { // static uip_ds6_nbr_t *nbr; uip_ipaddr_t root_ipaddr; NETSTACK_ROUTING.get_root_ipaddr(&root_ipaddr); PSOCK_BEGIN(&s->sout); SEND_STRING(&s->sout, TOP); // ADD(" Neighbors\n <ul>\n"); ADD("var graph = {\"nodes\": ["); ADD("{\"id\": \""); ipaddr_add(&root_ipaddr); ADD("\", \"group\": 1},\n"); SEND(&s->sout); if(uip_sr_num_nodes() > 0) { static uip_sr_node_t *link; for(link = uip_sr_node_head(); link != NULL; link = uip_sr_node_next(link)) { if(link->parent != NULL) { uip_ipaddr_t child_ipaddr; NETSTACK_ROUTING.get_sr_node_ipaddr(&child_ipaddr, link); ADD("{\"id\": \""); ipaddr_add(&child_ipaddr); ADD("\", \"group\": 1},\n"); SEND(&s->sout); } } ADD("],\n"); SEND(&s->sout); } // for(nbr = uip_ds6_nbr_head(); // nbr != NULL; // nbr = uip_ds6_nbr_next(nbr)) { // // ADD("{\"id\": \""); // nbr->ipaddr.u8[0] = 0xfD; // nbr->ipaddr.u8[1] = 0x00; // ipaddr_add(&nbr->ipaddr); // ADD("\", \"group\": 1},\n"); // SEND(&s->sout); // } // ADD(" ],"); // SEND(&s->sout); #if (UIP_MAX_ROUTES != 0) // { // static uip_ds6_route_t *r; // ADD(" Routes\n <ul>\n"); // SEND(&s->sout); // for(r = uip_ds6_route_head(); r != NULL; r = uip_ds6_route_next(r)) { // ADD(" <li>"); // ipaddr_add(&r->ipaddr); // ADD("/%u (via ", r->length); // ipaddr_add(uip_ds6_route_nexthop(r)); // ADD(") %lus", (unsigned long)r->state.lifetime); // ADD("</li>\n"); // SEND(&s->sout); // } // ADD(" </ul>\n"); // SEND(&s->sout); // } #endif /* UIP_MAX_ROUTES != 0 */ #if (UIP_SR_LINK_NUM != 0) if(uip_sr_num_nodes() > 0) { static uip_sr_node_t *link; ADD(" \"links\":["); SEND(&s->sout); for(link = uip_sr_node_head(); link != NULL; link = uip_sr_node_next(link)) { if(link->parent != NULL) { uip_ipaddr_t child_ipaddr; uip_ipaddr_t parent_ipaddr; NETSTACK_ROUTING.get_sr_node_ipaddr(&child_ipaddr, link); NETSTACK_ROUTING.get_sr_node_ipaddr(&parent_ipaddr, link->parent); ADD(" {\"source\": \""); ipaddr_add(&child_ipaddr); ADD("\", \"target\":\""); ipaddr_add(&parent_ipaddr); // ADD(") %us", (unsigned int)link->lifetime); ADD("\",\"value\":1},\n"); SEND(&s->sout); } } ADD("]};\n"); SEND(&s->sout); SEND_STRING(&s->sout, BOTTOM); ADD("<h1>当前已组网节点数: %u</h1></body>\n </html>", uip_sr_num_nodes()); SEND(&s->sout); } #endif /* UIP_SR_LINK_NUM != 0 */ PSOCK_END(&s->sout); } /*---------------------------------------------------------------------------*/ PROCESS(webserver_nogui_process, "Web server"); PROCESS_THREAD(webserver_nogui_process, ev, data) { PROCESS_BEGIN(); httpd_init(); while(1) { PROCESS_WAIT_EVENT_UNTIL(ev == tcpip_event); httpd_appcall(data); } PROCESS_END(); } /*---------------------------------------------------------------------------*/ httpd_simple_script_t httpd_simple_get_script(const char *name) { return generate_routes; } /*---------------------------------------------------------------------------*/
29.840979
99
0.541299