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
33cbf4e2c0db72a903a189f13a61663c02506fc1
625
h
C
src/innTest/innTest.h
turesnake/tprPixelGames
6b5471a072a1a8b423834ab04ff03e64df215d5e
[ "BSD-3-Clause" ]
591
2020-03-12T05:10:33.000Z
2022-03-30T13:41:59.000Z
src/innTest/innTest.h
turesnake/tprPixelGames
6b5471a072a1a8b423834ab04ff03e64df215d5e
[ "BSD-3-Clause" ]
4
2020-04-06T01:55:06.000Z
2020-05-02T04:28:04.000Z
src/innTest/innTest.h
turesnake/tprPixelGames
6b5471a072a1a8b423834ab04ff03e64df215d5e
[ "BSD-3-Clause" ]
112
2020-04-05T23:55:36.000Z
2022-03-17T11:58:02.000Z
/* * ======================== innTest.h ========================== * -- tpr -- * CREATE -- 2020.01.01 * MODIFY -- * ---------------------------------------------------------- */ #ifndef TPR_INN_TEST_H #define TPR_INN_TEST_H //=== *** glad FIRST, glfw SECEND *** === // Don't include glfw3.h ALONE!!! #include<glad/glad.h> #include<GLFW/glfw3.h> namespace innTest {//---------- namespace: innTest --------------// void innTest_main(); }//-------------------- namespace: innTest end --------------// #endif
25
67
0.3472
0de9c04579fa5e00a01a76f31e4b53383794f19d
4,422
cs
C#
Gu.Analyzers/Analyzers/DocsAnalyzer.cs
JohanLarsson/Gu.Analyzers
5a91b66a5aab619a3d0780c86a2e2572944d75ff
[ "MIT" ]
6
2016-12-23T19:01:14.000Z
2017-10-23T03:06:56.000Z
Gu.Analyzers/Analyzers/DocsAnalyzer.cs
JohanLarsson/Gu.Analyzers
5a91b66a5aab619a3d0780c86a2e2572944d75ff
[ "MIT" ]
112
2016-11-10T15:27:56.000Z
2018-02-28T14:52:06.000Z
Gu.Analyzers/Analyzers/DocsAnalyzer.cs
JohanLarsson/Gu.Analyzers
5a91b66a5aab619a3d0780c86a2e2572944d75ff
[ "MIT" ]
8
2016-12-10T19:50:28.000Z
2018-02-28T10:27:17.000Z
namespace Gu.Analyzers; using System.Collections.Immutable; using Gu.Roslyn.AnalyzerExtensions; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.CodeAnalysis.Diagnostics; [DiagnosticAnalyzer(LanguageNames.CSharp)] internal class DocsAnalyzer : DiagnosticAnalyzer { public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } = ImmutableArray.Create( Descriptors.GU0100WrongCrefType); public override void Initialize(AnalysisContext context) { context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None); context.EnableConcurrentExecution(); context.RegisterSyntaxNodeAction(c => Handle(c), SyntaxKind.XmlCrefAttribute); } private static void Handle(SyntaxNodeAnalysisContext context) { if (!context.IsExcludedFromAnalysis() && context.Node is XmlCrefAttributeSyntax attribute && attribute.Parent is XmlEmptyElementSyntax emptyElement && emptyElement.Parent is XmlElementSyntax candidate && IsAutoDoc() && candidate.HasLocalName("param") && TryGetTypes(out var parameterType, out var crefType) && !IsMatch(parameterType, crefType!)) { context.ReportDiagnostic( Diagnostic.Create( Descriptors.GU0100WrongCrefType, attribute.Cref.GetLocation(), parameterType.ToDisplayString())); } bool IsAutoDoc() { return candidate.Content.TryElementAt(1, out var match) && Equals(match, emptyElement) && candidate.Content.TryFirst(out var first) && first is XmlTextSyntax text && IsAutoPrefix() && IsAutoSuffix(); bool IsAutoPrefix() { return text.ToString() switch { "The " or "The left " or "The right " or "The first " or "The other " => true, _ => false, }; } bool IsAutoSuffix() { if (candidate.Content.Count == 2) { return true; } if (candidate.Content.Count > 3) { return false; } return candidate.Content[2].ToString() switch { "." => true, _ => false, }; } } bool TryGetTypes(out ITypeSymbol parameterType, out ITypeSymbol? crefType) { if (candidate.TryGetNameAttribute(out var nameAttribute) && context.ContainingSymbol is IMethodSymbol method && method.TryFindParameter(nameAttribute.Identifier.Identifier.ValueText, out var parameter) && context.SemanticModel.TryGetType(attribute.Cref, context.CancellationToken, out crefType)) { parameterType = parameter.Type; return true; } parameterType = null!; crefType = null!; return false; } static bool IsMatch(ITypeSymbol parameterType, ITypeSymbol crefType) { return Equals(parameterType.MetadataName, crefType.MetadataName) && TypeArgumentsMatch(TypeArguments(parameterType as INamedTypeSymbol), TypeArguments(crefType as INamedTypeSymbol)); static ImmutableArray<ITypeSymbol> TypeArguments(INamedTypeSymbol? nt) { return nt?.TypeArguments ?? ImmutableArray<ITypeSymbol>.Empty; } static bool TypeArgumentsMatch(ImmutableArray<ITypeSymbol> x, ImmutableArray<ITypeSymbol> y) { if (x.Length != y.Length) { return false; } for (var i = 0; i < x.Length; i++) { if (!IsMatch(x[i], y[i])) { return false; } } return true; } } } }
34.015385
133
0.53166
79aa5db21c08c0efd9ec7b0246f999ecabe92ba1
1,607
cpp
C++
topics/string/attribute_parser.cpp
sandeepjindal/algos
e649c82bfb6b986c8462b09d28e07c2069e48792
[ "MIT" ]
1
2019-09-10T17:45:58.000Z
2019-09-10T17:45:58.000Z
topics/string/attribute_parser.cpp
sandeepjindal/algos
e649c82bfb6b986c8462b09d28e07c2069e48792
[ "MIT" ]
null
null
null
topics/string/attribute_parser.cpp
sandeepjindal/algos
e649c82bfb6b986c8462b09d28e07c2069e48792
[ "MIT" ]
null
null
null
#include <cmath> #include <cstdio> #include <utility> #include <vector> #include <iostream> #include <algorithm> #include <sstream> #include <map> using namespace std; vector<string> splitter(string str,char delim){ vector<string> out; std::stringstream ss(str); std::string s; while (std::getline(ss, s, delim)) { out.push_back(s); } return out; } int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ int t,q; string taggers; cin >> t; cin >> q; string prefix = ""; string query; map<string,string> interm; vector<string> split; while(t--){ cout <<"t is " << t << endl; getline(std::cin >> std::ws, taggers); cout << "string at "<< t << "is "<<taggers << endl; split = splitter(taggers,' '); for(string p: split){ cout << "splitter spitted out " << p << endl; } string d = prefix + split[0].substr(1)+ "~" + split[1]; prefix = prefix + split[0].substr(1) + "."; string val = split[3]; val.pop_back(); val.pop_back(); cout << "d is "<< d <<"val is "<< val << endl; interm.insert(make_pair(d, val.substr(1))); } for (auto const& pair: interm) { std::cout << "{" << pair.first << ": " << pair.second << "}\n"; } while(q--){ cin >> query; if(interm.find(query) == interm.end()){ cout << "Not Found!"; }else{ cout <<interm.find(query) -> second; } } return 0; }
24.723077
78
0.506534
05bb35c1f2b39a8e71ee6a48acc0e40a68458f7d
4,514
py
Python
python/ConcaveHull.py
Pratool/homography
c9daeaa3364b7c658b39c225952288dd828c332e
[ "MIT" ]
1
2019-08-12T17:38:22.000Z
2019-08-12T17:38:22.000Z
python/ConcaveHull.py
Pratool/homography
c9daeaa3364b7c658b39c225952288dd828c332e
[ "MIT" ]
1
2020-03-03T15:43:38.000Z
2020-03-04T03:22:47.000Z
python/ConcaveHull.py
Pratool/homography
c9daeaa3364b7c658b39c225952288dd828c332e
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Implementation(s) of Concave Hull algorithm(s). """ import json import math import sys import unittest from matplotlib import pyplot as plt from Polygon import * def main(set_file): with open(set_file, 'r') as f: concave_set = json.load(f) concave_set = [tuple(point) for point in concave_set] concave_poly = create_concave_poly(concave_set, 5, viz=default_visualizer) axes = plt.gca() _plot_set(axes, concave_set) concave_poly.plot(axes) plt.show() # pt is the point to test, v0, v1 are endpoints of the line segment. signed_area = lambda pt, v0, v1: ((v0[0] - pt[0]) * (v1[1] - pt[1]) - (v0[1] - pt[1]) * (v1[0] - pt[0])) def _plot_set(mplib_axes, point_set): xs = [p[0] for p in point_set] ys = [p[1] for p in point_set] mplib_axes.plot(xs, ys, 'o') return mplib_axes def _plot_knn_graph_node(mplib_axes, point, subpoint): """Plot point, subpoints, edges to subpoints, and values associated with each subpoint (plotted along edge). """ average = lambda x: (x[0]+x[1])/2.0 xs = (subpoint.point[0], point[0]) ys = (subpoint.point[1], point[1]) mplib_axes.plot(xs, ys, '-o') mplib_axes.text(average(xs), average(ys), '{:.1f}'.format(subpoint.metric)) class Subpoint: def __init__(self, point, metric): self.point = point self.metric = metric def __repr__(self): return (self.metric, self.point).__repr__() def default_visualizer(function, *args, **kwargs): """Wrapper to run expensive visualization. """ return function(*args, **kwargs) def no_visualizer(function, *args, **kwargs): """Wrapper to not run expensive visualization. """ return None def create_concave_poly(point_set, k, viz=no_visualizer): # Sort 2D points by y-value point_set.sort(key=lambda x: x[1]) knn_graph = create_knn_graph(point_set, k) vertices = [] current_point = point_set[0] prev_point = (current_point[0]+1, current_point[1]) while len(vertices) <= 1 or vertices[0] != current_point: axes = viz(plt.gca) viz(_plot_set, axes, vertices) linked_points = knn_graph[current_point] rightmost_neighbor = None for neighbor in linked_points: if neighbor.point in vertices and neighbor.point != vertices[0]: continue if rightmost_neighbor is None: rightmost_neighbor = neighbor.point neighbor.metric = signed_area(neighbor.point, current_point, rightmost_neighbor) if neighbor.metric < 0: rightmost_neighbor = neighbor.point viz(_plot_knn_graph_node, axes, current_point, neighbor) viz(plt.show) vertices.append(current_point) if rightmost_neighbor is None: break prev_point = current_point current_point = rightmost_neighbor return Polygon(vertices) def create_knn_graph(point_set, k): if k <= 0 or type(k) != int: raise ValueError('k-NN graph requires positive integer k.') if k >= len(point_set) - 1: raise ValueError('Max k in k-NN graph is one fewer than the total ' 'number of nodes.') graph = {} for point in point_set: # Order all k linked points by ascending euclidean distance from point. graph[point] = [] for linked_point in point_set: distance = euclidean_distance(point, linked_point) for i in range(k): if (len(graph[point]) < i + 1 or distance < graph[point][i].metric): graph[point].insert(i, Subpoint(linked_point, distance)) break graph[point] = graph[point][1:k+1] return graph def euclidean_distance(point0, point1): if len(point0) != len(point1): raise ValueError('Points must be the same dimensionality.') accumulator = 0 for i in range(len(point0)): accumulator += (point0[i]-point1[i])**2 return math.pow(accumulator, float(1.0/len(point0))) class TestEuclideanDistance(unittest.TestCase): def test_2d(self): self.assertAlmostEqual( euclidean_distance((3, 0), (0, 4)), float(5), delta=1e-9) def test_3d(self): self.assertAlmostEqual( euclidean_distance((1, 2, 3), (4, 5, 6)), float(3), delta=1e-9) if __name__ == '__main__': main(*sys.argv[1:])
28.935897
92
0.622286
bfc8f2ce06b533ba99e04d0b3624654914bc91d2
355
kt
Kotlin
dsl/src/main/kotlin/com/code42/jenkins/pipelinekt/dsl/step/declarative/SetBuildDescription.kt
bayesiano/pipelinekt
422b91e28be45dcc232ca8363ae1a1db08987a9c
[ "MIT" ]
36
2020-01-05T17:12:53.000Z
2022-03-30T05:29:04.000Z
dsl/src/main/kotlin/com/code42/jenkins/pipelinekt/dsl/step/declarative/SetBuildDescription.kt
bayesiano/pipelinekt
422b91e28be45dcc232ca8363ae1a1db08987a9c
[ "MIT" ]
7
2020-01-02T15:55:43.000Z
2021-06-13T15:27:57.000Z
dsl/src/main/kotlin/com/code42/jenkins/pipelinekt/dsl/step/declarative/SetBuildDescription.kt
bayesiano/pipelinekt
422b91e28be45dcc232ca8363ae1a1db08987a9c
[ "MIT" ]
22
2020-01-02T19:55:55.000Z
2022-03-30T05:33:27.000Z
package com.code42.jenkins.pipelinekt.dsl.step.declarative import com.code42.jenkins.pipelinekt.core.step.Step import com.code42.jenkins.pipelinekt.dsl.DslContext import com.code42.jenkins.pipelinekt.internal.step.scripted.SetBuildDescription fun DslContext<Step>.setBuildDescription(description: String) = add(SetBuildDescription(description))
39.444444
79
0.83662
18ad548daeec3cc605fe324770c9b0115f016a43
2,458
asm
Assembly
amicable_num.asm
guynan/asmpe
86742a309a7837b884a6396893fcb4896fa1003a
[ "MIT" ]
null
null
null
amicable_num.asm
guynan/asmpe
86742a309a7837b884a6396893fcb4896fa1003a
[ "MIT" ]
null
null
null
amicable_num.asm
guynan/asmpe
86742a309a7837b884a6396893fcb4896fa1003a
[ "MIT" ]
null
null
null
; Find the sum of all of the amicable numbers below 10,000 global _start extern printf section .text _start: ; To evaluate this, we use rcx as our counter, rbx as the summation xor rcx, rcx mov ecx, 1 xor rbx, rbx iter_range: cmp ecx, 10000 jg _complete_result mov edi, ecx push rcx push rbx call amicable pop rbx pop rcx cmp eax, 1 jne _inc_counter add ebx, ecx _inc_counter: inc ecx jmp iter_range _complete_result: mov edi, ebx call print_result call _end_execution ; A number is amicable if the sum of the factors of the number is equal to the ; sum of the factors of that sum. We accept a number in rdi as our input value, ; ecx is the result of our input number n sum of factors, amicable: call sum_factors mov ecx, eax xor rax, rax cmp edi, ecx je _not_amicable push rdi mov edi, ecx push rcx call sum_factors pop rcx pop rdi mov ebx, eax xor rax, rax cmp ebx, edi jne _not_amicable inc eax _not_amicable: ret ; take a number in rdi, return value in rax, which is our summation. rcx is our ; counter sum_factors: xor rax, rax mov ecx, 1 _factor_iter: push rcx imul ecx, 2 cmp ecx, edi pop rcx jg _end_sum ; idiv uses rdx as the remainder, eax as the divisor xor rdx, rdx mov ebx, ecx ; Preserve our current sum push rax push rcx mov eax, edi idiv ebx pop rcx pop rax test edx, edx jnz _next_factor add eax, ecx _next_factor: inc ecx jmp _factor_iter _end_sum: ret print_result: mov ebx, edi push rdi mov rdi, format mov esi, ebx xor rax, rax call printf pop rdi ret _end_execution: mov rax, 60 mov rdi, 0 syscall ret section .data format: db "%ld", 10, 0 ; vim: ft=nasm
15.961039
79
0.489829
7f40e0fad197e44e3c71723ddfcf65b6a9cdaec0
691
php
PHP
src/Tagcade/Service/Report/PerformanceReport/Display/Selector/Selectors/SelectorInterface.php
duytc/tagcade-api
3debd22b4760c9011cc32c60e32f587ae58207dc
[ "MIT" ]
null
null
null
src/Tagcade/Service/Report/PerformanceReport/Display/Selector/Selectors/SelectorInterface.php
duytc/tagcade-api
3debd22b4760c9011cc32c60e32f587ae58207dc
[ "MIT" ]
null
null
null
src/Tagcade/Service/Report/PerformanceReport/Display/Selector/Selectors/SelectorInterface.php
duytc/tagcade-api
3debd22b4760c9011cc32c60e32f587ae58207dc
[ "MIT" ]
null
null
null
<?php namespace Tagcade\Service\Report\PerformanceReport\Display\Selector\Selectors; use DateTime; use Tagcade\Model\Report\PerformanceReport\Display\ReportType\ReportTypeInterface; interface SelectorInterface { /** * @param ReportTypeInterface $reportType * @param DateTime $startDate * @param DateTime $endDate * @param null|array|mixed $queryParams * @return array */ public function getReports(ReportTypeInterface $reportType, DateTime $startDate, DateTime $endDate, $queryParams = null); /** * @param ReportTypeInterface $reportType * @return bool */ public function supportsReportType(ReportTypeInterface $reportType); }
28.791667
125
0.732272
52ee13758ed0de093662ee4ba464d6b1e5fc8492
9,320
rb
Ruby
db/schema.rb
mobility-lab/tumitfahrer
8a8d904951753f049192dbc1445a419a9040c941
[ "AAL" ]
null
null
null
db/schema.rb
mobility-lab/tumitfahrer
8a8d904951753f049192dbc1445a419a9040c941
[ "AAL" ]
null
null
null
db/schema.rb
mobility-lab/tumitfahrer
8a8d904951753f049192dbc1445a419a9040c941
[ "AAL" ]
null
null
null
# encoding: UTF-8 # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # # Note that this schema.rb definition is the authoritative source for your # database schema. If you need to create the application database on another # system, you should be using db:schema:load, not running all the migrations # from scratch. The latter is a flawed and unsustainable approach (the more migrations # you'll amass, the slower it'll run and the greater likelihood for issues). # # It's strongly recommended that you check this file into your version control system. ActiveRecord::Schema.define(version: 20140725082712) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" enable_extension "adminpack" create_table "api_keys", force: true do |t| t.string "access_token" t.datetime "created_at" t.datetime "updated_at" end create_table "contributions", force: true do |t| t.integer "user_id" t.integer "project_id" t.float "amount" t.datetime "created_at" t.datetime "updated_at" end create_table "conversations", force: true do |t| t.integer "ride_id" t.datetime "created_at" t.datetime "updated_at" t.integer "user_id" t.integer "other_user_id" end add_index "conversations", ["user_id", "other_user_id", "ride_id"], name: "index_conversations_on_user_id_and_other_user_id_and_ride_id", using: :btree create_table "devices", force: true do |t| t.integer "user_id" t.string "token" t.datetime "created_at" t.datetime "updated_at" t.boolean "enabled" t.string "platform" t.string "language" end create_table "feedbacks", force: true do |t| t.integer "user_id" t.string "title" t.string "content" t.datetime "created_at" t.datetime "updated_at" end create_table "friendship_requests", force: true do |t| t.integer "from_user_id" t.integer "to_user_id" t.datetime "created_at" t.datetime "updated_at" end create_table "friendships", force: true do |t| t.integer "user_id" t.integer "friend_id" t.datetime "created_at" t.datetime "updated_at" end add_index "friendships", ["friend_id"], name: "index_friendships_on_friend_id", using: :btree add_index "friendships", ["user_id", "friend_id"], name: "index_friendships_on_user_id_and_friend_id", unique: true, using: :btree add_index "friendships", ["user_id"], name: "index_friendships_on_user_id", using: :btree create_table "gcms", force: true do |t| t.datetime "created_at" t.datetime "updated_at" t.string "host" t.string "format" t.string "key" end create_table "messages", force: true do |t| t.datetime "created_at" t.datetime "updated_at" t.boolean "is_seen" t.string "content" t.integer "conversation_id" t.integer "sender_id" t.integer "receiver_id" end create_table "organized_rides", force: true do |t| t.integer "user_id" t.integer "ride_id" t.datetime "created_at" t.datetime "updated_at" end create_table "payments", force: true do |t| t.integer "from_user_id" t.integer "to_user_id" t.integer "ride_id" t.float "amount" t.datetime "created_at" t.datetime "updated_at" end create_table "projects", force: true do |t| t.integer "phase" t.float "fundings_target" t.integer "owner_id" t.string "description" t.string "title" t.datetime "date" t.datetime "created_at" t.datetime "updated_at" t.integer "ride_id" end create_table "push_configurations", force: true do |t| t.string "type", null: false t.string "app", null: false t.text "properties" t.boolean "enabled", default: false, null: false t.integer "connections", default: 1, null: false t.datetime "created_at" t.datetime "updated_at" end create_table "push_feedback", force: true do |t| t.string "app", null: false t.string "device", null: false t.string "type", null: false t.string "follow_up", null: false t.datetime "failed_at", null: false t.boolean "processed", default: false, null: false t.datetime "processed_at" t.text "properties" t.datetime "created_at" t.datetime "updated_at" end add_index "push_feedback", ["processed"], name: "index_push_feedback_on_processed", using: :btree create_table "push_messages", force: true do |t| t.string "app", null: false t.string "device", null: false t.string "type", null: false t.text "properties" t.boolean "delivered", default: false, null: false t.datetime "delivered_at" t.boolean "failed", default: false, null: false t.datetime "failed_at" t.integer "error_code" t.string "error_description" t.datetime "deliver_after" t.datetime "created_at" t.datetime "updated_at" end add_index "push_messages", ["delivered", "failed", "deliver_after"], name: "index_push_messages_on_delivered_and_failed_and_deliver_after", using: :btree create_table "ratings", force: true do |t| t.integer "to_user_id" t.integer "from_user_id" t.integer "rating_type" t.integer "ride_id" t.datetime "created_at" t.datetime "updated_at" end create_table "relationships", force: true do |t| t.integer "user_id" t.integer "ride_id" t.boolean "is_driving" t.datetime "created_at" t.datetime "updated_at" end add_index "relationships", ["ride_id"], name: "index_relationships_on_ride_id", using: :btree add_index "relationships", ["user_id", "ride_id", "is_driving"], name: "index_relationships_on_user_id_and_ride_id_and_is_driving", unique: true, using: :btree add_index "relationships", ["user_id"], name: "index_relationships_on_user_id", using: :btree create_table "requests", force: true do |t| t.integer "ride_id" t.integer "passenger_id" t.datetime "created_at" t.datetime "updated_at" end create_table "ride_searches", force: true do |t| t.integer "user_id" t.string "departure_place" t.string "destination" t.datetime "departure_time" t.datetime "created_at" t.datetime "updated_at" t.integer "ride_type" end create_table "rides", force: true do |t| t.string "departure_place" t.string "destination" t.datetime "departure_time" t.integer "free_seats" t.integer "user_id" t.string "meeting_point" t.datetime "created_at" t.datetime "updated_at" t.float "price" t.boolean "is_paid" t.integer "rideType" t.float "distance" t.integer "ride_type" t.float "departure_latitude" t.float "departure_longitude" t.float "destination_latitude" t.float "destination_longitude" t.string "car" t.integer "rating_id" t.datetime "last_cancel_time" t.integer "regular_ride_id" end add_index "rides", ["user_id"], name: "index_rides_on_user_id", using: :btree create_table "rides_as_drivers", force: true do |t| t.integer "user_id" t.integer "ride_id" t.datetime "created_at" t.datetime "updated_at" end add_index "rides_as_drivers", ["ride_id"], name: "index_rides_as_drivers_on_ride_id", using: :btree add_index "rides_as_drivers", ["user_id", "ride_id"], name: "index_rides_as_drivers_on_user_id_and_ride_id", unique: true, using: :btree add_index "rides_as_drivers", ["user_id"], name: "index_rides_as_drivers_on_user_id", using: :btree create_table "rides_as_passengers", force: true do |t| t.integer "user_id" t.integer "ride_id" t.datetime "created_at" t.datetime "updated_at" end add_index "rides_as_passengers", ["ride_id"], name: "index_rides_as_passengers_on_ride_id", using: :btree add_index "rides_as_passengers", ["user_id", "ride_id"], name: "index_rides_as_passengers_on_user_id_and_ride_id", unique: true, using: :btree add_index "rides_as_passengers", ["user_id"], name: "index_rides_as_passengers_on_user_id", using: :btree create_table "users", force: true do |t| t.string "first_name" t.string "last_name" t.string "email" t.string "phone_number" t.string "department" t.string "car" t.datetime "created_at" t.datetime "updated_at" t.string "password_digest" t.string "remember_token" t.boolean "admin" t.string "api_key" t.boolean "is_student" t.string "avatar_file_name" t.string "avatar_content_type" t.integer "avatar_file_size" t.datetime "avatar_updated_at" t.float "rating_avg" end add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree add_index "users", ["remember_token"], name: "index_users_on_remember_token", using: :btree end
33.285714
161
0.669099
2fa9b452061bd72650de90b5714719b70e6e7495
2,930
py
Python
raymon/tests/profiling/test_features.py
pbonte/raymon
83912d7a5ff22d61289688828169a7178fa34a2d
[ "MIT" ]
null
null
null
raymon/tests/profiling/test_features.py
pbonte/raymon
83912d7a5ff22d61289688828169a7178fa34a2d
[ "MIT" ]
null
null
null
raymon/tests/profiling/test_features.py
pbonte/raymon
83912d7a5ff22d61289688828169a7178fa34a2d
[ "MIT" ]
null
null
null
#%% from raymon.profiling.components import DataType import pytest import pandas as pd import numpy as np from raymon.profiling.extractors.structured import generate_components from raymon import InputComponent from raymon import IntStats, FloatStats, CategoricStats from raymon import ModelProfile from raymon.globals import ProfileStateException, DataException from raymon.profiling.extractors.structured import ElementExtractor #%% def test_constuct_comps(): cols = { "num1": list(range(10)), "cat1": ["a"] * 5 + ["b"] * 5, "cat2": ["c"] * 5 + ["d"] * 5, "num2": [0.2] * 10, } df = pd.DataFrame(data=cols) components = generate_components(dtypes=df.dtypes, complass=InputComponent) assert len(components) == 4 assert all(isinstance(c, InputComponent) for c in components) assert isinstance(components[0].stats, IntStats) assert isinstance(components[1].stats, CategoricStats) assert isinstance(components[2].stats, CategoricStats) assert isinstance(components[3].stats, FloatStats) def test_compile(): cols = { "num1": list(range(10)), "cat1": ["a"] * 5 + ["b"] * 5, } df = pd.DataFrame(data=cols) components = generate_components(dtypes=df.dtypes, complass=InputComponent) schema = ModelProfile(components=components) assert not schema.is_built() schema.build(input=df) components = schema.components assert isinstance(components["num1"].stats, IntStats) assert components["num1"].stats.min == 0 assert components["num1"].stats.max == 9 assert components["num1"].stats.mean == 4.5 assert components["num1"].is_built() assert isinstance(components["cat1"].stats, CategoricStats) assert sorted(components["cat1"].stats.frequencies.keys()) == sorted(["a", "b"]) assert components["cat1"].stats.invalids == 0 assert components["cat1"].is_built() assert schema.is_built() def test_compile_one(): arr = np.array([1, 2, 3, 4, 5])[None, :] schema = ModelProfile( components=[InputComponent(name="predicted_price", extractor=ElementExtractor(element=0), dtype=DataType.INT)], ) assert not schema.is_built() schema.build(input=arr) components = schema.components assert isinstance(components["predicted_price"].stats, IntStats) assert components["predicted_price"].stats.min == 1 assert components["predicted_price"].stats.max == 5 assert components["predicted_price"].is_built() assert schema.is_built() def test_all_nan(): cols = { "num1": [np.nan] * 10, "cat1": [np.nan] * 10, } df = pd.DataFrame(data=cols) components = generate_components(dtypes=df.dtypes) schema = ModelProfile(components=components) try: schema.build(input=df) except ValueError: pass else: pytest.fail("Component with all nans should throw a DataException") # %%
32.197802
119
0.682253
7dd499e7608f560689228be989421f98eddda4c2
2,072
css
CSS
public/css/admin.css
Romis192Nesmelov/beefko
2edb6583b14ce878a3a34db11761664e23f4f14f
[ "MIT" ]
null
null
null
public/css/admin.css
Romis192Nesmelov/beefko
2edb6583b14ce878a3a34db11761664e23f4f14f
[ "MIT" ]
null
null
null
public/css/admin.css
Romis192Nesmelov/beefko
2edb6583b14ce878a3a34db11761664e23f4f14f
[ "MIT" ]
null
null
null
textarea { border: 1px solid #ddd; } select { padding-left: 10px !important; } .navigation > li.active > a, .navigation > li.active > a:hover, .navigation > li.active > a:focus, .bootstrap-switch-handle-on.bootstrap-switch-primary, .bootstrap-switch-handle-off.bootstrap-switch-primary { background-color: #087fae; } .form-horizontal .form-group { margin-left: 0; margin-right: 0; } .textarea .form-control-feedback { margin-top: 20px; } .form-control.daterange-single { padding-left: 10px; } .error, .form-control-feedback .icon-cancel-circle2 { color: red; } .input-label .star { color: red; } .input-group { width: 100%; } .input-group-addon { width: 40px; } input[type=number] { font-size: 35px; font-weight: bolder; height: 50px; color: #087fae; } .bg-blue { background-color: #087fae; border-color: #087fae; } .id { width: 20px; } td.image { width: 10%; text-align: center; vertical-align: middle; } td.image img, .image img, .edit-image-preview img { width: 100%; } .edit-image-preview .image { margin-bottom: 10px; } .delete, .edit { text-align: center; } td.delete > span { cursor: pointer; } textarea { width: 100%; height: 150px; resize: vertical; } .dropdown-toggle .avatar { display: table; float: left; margin-top: 5px; } .modal-body { width: 100%; background-color: #f1f1f1; border: 1px solid #eaeaea; display: table; margin-bottom: 20px; } .name { font-size: 18px; } .name-part { font-size: 15px; color: grey; text-align: center; } .panel-heading .name-part { font-size: 100%; display: inline-block; text-align: left; margin-left: 5px; } .icon-delete { position: absolute; width: 20px; height: 20px; padding-top: 5px; border-radius: 50%; cursor: pointer; left: 100%; top: -10px; text-align: center; background-color: white; transform: translateX(-50%); z-index: 999; } .icon-delete:hover { color: red; }
14.695035
55
0.615347
ec255cd2e256bef2457630daf91b6a9fd20a8956
9,457
swift
Swift
ZhiHuDaily/ZhiHuDaily/Views/CommonViews/ScrollNumberLabel.swift
xiabob/ZhihuDaily
eafad860c01cf30e55d9a481fce42d96017a1fa7
[ "MIT" ]
3
2017-03-17T15:20:31.000Z
2017-10-01T04:56:09.000Z
ZhiHuDaily/ZhiHuDaily/Views/CommonViews/ScrollNumberLabel.swift
xiabob/ZhihuDaily
eafad860c01cf30e55d9a481fce42d96017a1fa7
[ "MIT" ]
null
null
null
ZhiHuDaily/ZhiHuDaily/Views/CommonViews/ScrollNumberLabel.swift
xiabob/ZhihuDaily
eafad860c01cf30e55d9a481fce42d96017a1fa7
[ "MIT" ]
null
null
null
// // ScrollNumberLabel.swift // ZhiHuDaily // // Created by xiabob on 17/3/23. // Copyright © 2017年 xiabob. All rights reserved. // import UIKit class ScrollNumberLabel: UIView { private(set) var number: UInt = 0 var font = UIFont.systemFont(ofSize: 14) { didSet { for label in numberLabels { label.font = font } } } var textColor = UIColor.black { didSet { for label in numberLabels { label.textColor = textColor } } } fileprivate var numbers: [UInt] = [] fileprivate var numberLabels: [CyclicNumberLabel] = [] fileprivate lazy var containerView: UIView = { let view = UIView(frame: CGRect.zero) view.backgroundColor = .clear return view }() init(frame: CGRect, originNumber: UInt) { super.init(frame: frame) clipsToBounds = true number = originNumber addSubview(containerView) initNumberLabels() } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } fileprivate func initNumberLabels() { numbers = getNumbersArray(from: number) let width = "9".widthWithConstrainedHeight(font.lineHeight, font: font) numberLabels = numbers.map { (value) -> CyclicNumberLabel in let label = CyclicNumberLabel(frame: CGRect(x: 0, y: 0, width: width, height: self.xb_height)) label.font = self.font label.textColor = self.textColor label.change(toNewNumber: "\(value)", by: .add, isAnimation: false) return label } containerView.xb_width = ceil(CGFloat(numberLabels.count) * width) containerView.xb_height = xb_height containerView.center = CGPoint(x: xb_width/2, y: xb_height/2) var index = 0 while index < numberLabels.count { let label = numberLabels[index] label.xb_left = CGFloat(index) * label.xb_width containerView.addSubview(label) index += 1 } } fileprivate func resetNumberLabels(newValue: UInt) { for label in numberLabels { label.removeFromSuperview() } numberLabels.removeAll() let newNumbers = getNumbersArray(from: newValue) let numberCount = newNumbers.count var index: Int = 0 let width = "9".widthWithConstrainedHeight(font.lineHeight, font: font) while index < numberCount { let label = CyclicNumberLabel(frame: CGRect(x: CGFloat(index) * width, y: 0, width: width, height: xb_height)) label.font = self.font label.textColor = self.textColor label.change(toNewNumber: "\(newNumbers[index])", by: .add, isAnimation: false) index += 1 numberLabels.append(label) containerView.addSubview(label) } containerView.xb_width = ceil(CGFloat(numberLabels.count) * width) containerView.xb_height = xb_height containerView.center = CGPoint(x: xb_width/2, y: xb_height/2) } fileprivate func getNewContainerView(from newValue: UInt) -> UIView { let containerView = UIView() let newNumbers = getNumbersArray(from: newValue) let numberCount = newNumbers.count var index: Int = 0 let width = "9".widthWithConstrainedHeight(font.lineHeight, font: font) while index < numberCount { let label = CyclicNumberLabel(frame: CGRect(x: CGFloat(index) * width, y: 0, width: width, height: xb_height)) label.font = self.font label.textColor = self.textColor label.change(toNewNumber: "\(newNumbers[index])", by: .add, isAnimation: false) index += 1 containerView.addSubview(label) } containerView.xb_width = ceil(CGFloat(newNumbers.count) * width) containerView.xb_height = xb_height containerView.center = CGPoint(x: xb_width/2, y: xb_height/2) return containerView } fileprivate func setNumberLabels(to newNumbers: [UInt], type: CyclicNumberLabelType) { var index = 0 while index < newNumbers.count { let label = numberLabels[index] label.change(toNewNumber: "\(newNumbers[index])", by: type) index += 1 } } fileprivate func getNumbersArray(from number: UInt) -> [UInt] { let numberString = NSString(format: "%d", number) var numberArray: [UInt] = Array(repeating: 0, count: numberString.length) var index = 0 while index < numberArray.count { numberArray[index] = UInt(numberString.substring(with: NSRange(location: index, length: 1))) ?? 0 index += 1 } return numberArray } func change(toNewNumber value: UInt) { if number == value {return} let oldValue = number let oldNumbersCount = numbers.count number = value numbers = getNumbersArray(from: value) let newNumbersCount = numbers.count if newNumbersCount == oldNumbersCount { let type = oldValue < value ? CyclicNumberLabelType.add : CyclicNumberLabelType.reduce setNumberLabels(to: numbers, type: type) } else { let type = newNumbersCount > oldNumbersCount ? CyclicNumberLabelType.add : CyclicNumberLabelType.reduce containerView.isHidden = true resetNumberLabels(newValue: number) var multiplier: CGFloat = 0 if type == .add { multiplier = 1 } else { multiplier = -1 } let oldContainer = getNewContainerView(from: oldValue) oldContainer.xb_top = 0 addSubview(oldContainer) let newContainer = getNewContainerView(from: value) newContainer.xb_top = multiplier * xb_height addSubview(newContainer) UIView.animate(withDuration: 0.25, animations: { oldContainer.xb_top = -multiplier * self.xb_height newContainer.xb_top = 0 }, completion: { (finished) in oldContainer.removeFromSuperview() newContainer.removeFromSuperview() self.containerView.isHidden = false }) } } } fileprivate enum CyclicNumberLabelType { case add, reduce } fileprivate class CyclicNumberLabel: UIView { var font = UIFont.systemFont(ofSize: 14) { didSet { topLabel.font = font centerLabel.font = font bottomLabel.font = font } } var textColor = UIColor.black { didSet { topLabel.textColor = textColor centerLabel.textColor = textColor bottomLabel.textColor = textColor } } fileprivate lazy var topLabel: UILabel = self.createLabel() fileprivate lazy var centerLabel: UILabel = self.createLabel() fileprivate lazy var bottomLabel: UILabel = self.createLabel() fileprivate lazy var containerView: UIView = { [unowned self] in let view = UIView(frame: CGRect(x: 0, y: -self.xb_height, width: self.xb_width, height: self.xb_height*3)) view.backgroundColor = .clear return view }() override init(frame: CGRect) { super.init(frame: frame) clipsToBounds = true configViews() } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } fileprivate func configViews() { addSubview(containerView) topLabel.xb_top = 0 containerView.addSubview(topLabel) centerLabel.xb_top = xb_height containerView.addSubview(centerLabel) bottomLabel.xb_top = xb_height * 2 containerView.addSubview(bottomLabel) } fileprivate func createLabel() -> UILabel { let label = UILabel(frame: bounds) label.font = font label.textColor = textColor label.textAlignment = .center return label } func change(toNewNumber value: String, by type: CyclicNumberLabelType, isAnimation: Bool = true) { if centerLabel.text == "\(value)" {return} if !isAnimation {return self.centerLabel.text = value} if type == .add { bottomLabel.text = value UIView.animate(withDuration: 0.25, animations: { self.containerView.xb_top = -2*self.xb_height }, completion: { (finished) in self.centerLabel.text = value self.containerView.xb_top = -self.xb_height }) } else { topLabel.text = value UIView.animate(withDuration: 0.25, animations: { self.containerView.xb_top = 0 }, completion: { (finished) in self.centerLabel.text = value self.containerView.xb_top = -self.xb_height }) } } }
34.264493
122
0.576821
25f719c3c1d1994376de7e9ea4b3cd8f63706d25
516
cs
C#
PublishR.Starter.SharedApiApp/Startup.cs
clusta/publishr
9a92c024d92156673db0bdb944eec1377bc326d8
[ "MIT" ]
null
null
null
PublishR.Starter.SharedApiApp/Startup.cs
clusta/publishr
9a92c024d92156673db0bdb944eec1377bc326d8
[ "MIT" ]
null
null
null
PublishR.Starter.SharedApiApp/Startup.cs
clusta/publishr
9a92c024d92156673db0bdb944eec1377bc326d8
[ "MIT" ]
null
null
null
using Microsoft.Owin; using Microsoft.Owin.Cors; using Owin; using PublishR.Server; using System; using System.Collections.Generic; using System.Linq; using System.Web; [assembly: OwinStartup(typeof(PublishR.Starter.SharedApiApp.Startup))] namespace PublishR.Starter.SharedApiApp { public class Startup { public void Configuration(IAppBuilder app) { app.UseCors(CorsOptions.AllowAll); app.UseOAuthBearerAuthentication(AuthController.OAuthOptions); } } }
23.454545
74
0.722868
e2eef77ba611acd1b69db21ab2d29d4fc63e2015
4,280
py
Python
07_Java_Experiment/PyTest/excelutil/utils.py
Robert-Stackflow/HUST-Courses
300752552e7af035b0e5c7663953850c81871242
[ "MIT" ]
4
2021-11-01T09:27:32.000Z
2022-03-07T14:24:10.000Z
07_Java_Experiment/PyTest/excelutil/utils.py
Robert-Stackflow/HUST-Courses
300752552e7af035b0e5c7663953850c81871242
[ "MIT" ]
null
null
null
07_Java_Experiment/PyTest/excelutil/utils.py
Robert-Stackflow/HUST-Courses
300752552e7af035b0e5c7663953850c81871242
[ "MIT" ]
null
null
null
import numpy as np import pandas as pd import openpyxl from pandas import DataFrame # 以下的索引都是从0开始计算 sheet0_sid_excel_col_index = 1 # 学号的列索引, 相对于DataFrame,不是Excel sheet0_sname_excel_col_index = sheet0_sid_excel_col_index + 1 # 姓名的列索引, 相对于DataFrame,不是Excel sheet0_auto_test_excel_col_index = 17 # 自动测试分数的列索引, 相对于DataFrame,不是Excel sheet0_auto_test_detail_excel_col_index = 21 # 自动测试详情的列索引, 相对于DataFrame,不是Excel sheet0_exam_excel_col_index = 26 # 考试卷面分数的列索引, 相对于DataFrame,不是Excel sheet0_excel_skip_rows = 7 # Sheet0的前7行忽略 sheet0_excel_cols_range = 'B:AC' # Sheet0的A列忽略 class Excel: def __init__(self, excel_file_full_path, new_excel_file_full_path, header=None, keep_default_na=False): """ 构造函数\n :param \n excel_file_full_path: Excel文件完全路径\n new_excel_file_full_path: 新Excel文件完全路径\n header: 指定数据表的表头, 为None表示没有表头\n keep_default_na: 默认为False,这时读取空单元格时为空字符串''而不是nan """ self.excel_file_full_path = excel_file_full_path self.new_excel_file_path = new_excel_file_full_path self.reader = pd.ExcelFile(excel_file_full_path) self.sheet_names = self.reader.sheet_names # 得到所有的sheet name # 得到所有的sheet的DataFrame self.data_frames = [] # 保存所有sheet的DataFrame,Sheet0的下标为0,Sheet1的下标为1... # 读取所有的sheet for i in range(len(self.sheet_names)): if i == 0: # 得到sheet0的DataFrame self.data_frames.append(pd.read_excel(excel_file_full_path, header=header, sheet_name=i, skiprows=sheet0_excel_skip_rows, usecols=sheet0_excel_cols_range, keep_default_na=keep_default_na)) else: self.data_frames.append(pd.read_excel(excel_file_full_path, header=header, sheet_name=i, keep_default_na=keep_default_na)) def read_row(self, sheet_index, row_index): """ 读取指定sheet里的指定行\n :param sheet_index: 指定的sheet索引 :param row_index: 行号索引, 序号从0开始,相对DataFrame,而不是Excel :return: 指定行的内容,类型为 ndarray """ return self.data_frames[sheet_index].values[row_index] def read_cell_in_row(self, row_array, col_index): """ 读取一行的指定列 :param row_array: 行内容 :param col_index: 列下标,从0开始,相对DataFrame,而不是Excel :return: """ return row_array[col_index] def read_cell_in_dataframe(self, sheet_index, row_index, col_index): """ 读取指定sheet里的dataframe的一个单元格内容 :param sheet_index: 指定的sheet索引 :param row_index: 行索引 :param col_index: 列索引 :return: """ return self.data_frames[sheet_index].values[row_index][col_index] def write_cell_in_dataframe(self, sheet_index, row_index, col_index, value): """ 写指定sheet里的dataframe的一个单元格 :param sheet_index: 指定的sheet索引 :param row_index: 行索引 :param col_index: 列索引 :param value: 单元格内容 :return: """ self.data_frames[sheet_index].iloc[row_index, col_index] = value def row_count(self, sheet_index): """ 获取指定sheet里的dataframe的总行数 :param sheet_index: 指定的sheet索引 :return: """ return len(self.data_frames[sheet_index]) def save_to_new_excel(self, dataframe_index): """ 将指定的dataframe写入到Excel的新的excel :param dataframe_index: dataframe的索引 :return: """ self.data_frames[dataframe_index].to_excel(self.new_excel_file_path, header=None) None def find_student(self, sheet_index, student_info): """ 在指定sheet里找到指定学生所在行索引 :param sheet_index: 指定sheet的索引 :param student_info: 指定的学生信息, StudentInfo类型 :return: 学生的行索引,相对于DataFrame;如果没找到返回-1 """ for i in range(self.row_count(sheet_index)): sid = self.read_cell_in_dataframe(sheet_index, i, sheet0_sid_excel_col_index) sname = self.read_cell_in_dataframe(sheet_index, i, sheet0_sname_excel_col_index) if sid == student_info.sid and sname == student_info.sname: return i return -1
36.581197
204
0.645794
ccb6019154ab73d04c1be19600c236ddf3fd16b0
2,895
lua
Lua
scripts/vscripts/lua_abilities/axe_battle_hunger_lua/modifier_axe_battle_hunger_lua.lua
GIANTCRAB/dota-2-lua-abilities
fb1c2a78444e50f879b1cbedf4e0060408478278
[ "MIT" ]
125
2018-03-26T21:35:49.000Z
2022-03-31T21:01:38.000Z
scripts/vscripts/lua_abilities/axe_battle_hunger_lua/modifier_axe_battle_hunger_lua.lua
hanzhengit/dota-2-lua-abilities
c6d7b7cff8be6bc32f3580411f31c24b8c0b0eca
[ "MIT" ]
2
2020-07-05T16:02:19.000Z
2020-11-18T02:24:48.000Z
scripts/vscripts/lua_abilities/axe_battle_hunger_lua/modifier_axe_battle_hunger_lua.lua
hanzhengit/dota-2-lua-abilities
c6d7b7cff8be6bc32f3580411f31c24b8c0b0eca
[ "MIT" ]
40
2019-03-02T11:17:10.000Z
2022-03-31T05:45:26.000Z
modifier_axe_battle_hunger_lua = class({}) -------------------------------------------------------------------------------- -- Classifications function modifier_axe_battle_hunger_lua:IsHidden() return false end function modifier_axe_battle_hunger_lua:IsDebuff() return false end function modifier_axe_battle_hunger_lua:IsPurgable() return false end -------------------------------------------------------------------------------- -- Initializations function modifier_axe_battle_hunger_lua:OnCreated( kv ) -- references self.bonus = self:GetAbility():GetSpecialValueFor( "speed_bonus" ) if IsServer() then self:SetStackCount( 1 ) end end function modifier_axe_battle_hunger_lua:OnRefresh( kv ) -- references self.bonus = self:GetAbility():GetSpecialValueFor( "speed_bonus" ) if IsServer() then -- increase stack self:IncrementStackCount() end end function modifier_axe_battle_hunger_lua:OnDestroy( kv ) end function modifier_axe_battle_hunger_lua:OnStackCountChanged( old ) if IsServer() then if self:GetStackCount()<1 then self:Destroy() end end end -------------------------------------------------------------------------------- -- Modifier Effects function modifier_axe_battle_hunger_lua:DeclareFunctions() local funcs = { MODIFIER_PROPERTY_MOVESPEED_BONUS_PERCENTAGE, } return funcs end function modifier_axe_battle_hunger_lua:GetModifierMoveSpeedBonus_Percentage() return self.bonus * self:GetStackCount() end -------------------------------------------------------------------------------- -- Graphics & Animations -- function modifier_axe_battle_hunger_lua:GetEffectName() -- return "particles/string/here.vpcf" -- end -- function modifier_axe_battle_hunger_lua:GetEffectAttachType() -- return PATTACH_ABSORIGIN_FOLLOW -- end -- function modifier_axe_battle_hunger_lua:PlayEffects() -- -- Get Resources -- local particle_cast = "string" -- local sound_cast = "string" -- -- Get Data -- -- Create Particle -- local effect_cast = ParticleManager:CreateParticle( particle_cast, PATTACH_NAME, hOwner ) -- ParticleManager:SetParticleControl( effect_cast, iControlPoint, vControlVector ) -- ParticleManager:SetParticleControlEnt( -- effect_cast, -- iControlPoint, -- hTarget, -- PATTACH_NAME, -- "attach_name", -- vOrigin, -- unknown -- bool -- unknown, true -- ) -- ParticleManager:SetParticleControlForward( effect_cast, iControlPoint, vForward ) -- SetParticleControlOrientation( effect_cast, iControlPoint, vForward, vRight, vUp ) -- ParticleManager:ReleaseParticleIndex( effect_cast ) -- -- buff particle -- self:AddParticle( -- nFXIndex, -- bDestroyImmediately, -- bStatusEffect, -- iPriority, -- bHeroEffect, -- bOverheadEffect -- ) -- -- Create Sound -- EmitSoundOnLocationWithCaster( vTargetPosition, sound_location, self:GetCaster() ) -- EmitSoundOn( sound_target, target ) -- end***
26.318182
93
0.679447
b0bdd8302542f715c9fdd53b53ab2d4c294af373
300
py
Python
2019-08-10/08/zad8_Maria.py
SzczecinTech/zadania-rekrutacyjne
fad5d7a6ab7ae77e567610c56fbbcd4a38f8b2c2
[ "MIT" ]
1
2019-09-05T20:35:07.000Z
2019-09-05T20:35:07.000Z
2019-08-10/08/zad8_Maria.py
SzczecinTech/zadania-rekrutacyjne
fad5d7a6ab7ae77e567610c56fbbcd4a38f8b2c2
[ "MIT" ]
1
2020-03-20T15:27:10.000Z
2020-03-20T15:27:10.000Z
2019-08-10/08/zad8_Maria.py
SzczecinTech/zadania-rekrutacyjne
fad5d7a6ab7ae77e567610c56fbbcd4a38f8b2c2
[ "MIT" ]
10
2019-08-10T08:26:09.000Z
2019-08-15T13:50:48.000Z
import re def is_palindrome(arg): string = str(arg) re.compile('([^\w])') string = re.sub('([^\w])', '', string).lower() return reverse(string) == string def reverse(string): string = string[::-1] return string print(is_palindrome('kajak')) print(is_palindrome('Kajak, kajak'))
20
48
0.63
3f865925541152f780832e7ddf65a3e885096fac
469
php
PHP
app/Models/Offer/OfferTranslation.php
The-Alternative/Back_End_E_Daliely_New
f70b1f76e73db323966b41df36080e4979a40f6d
[ "MIT" ]
null
null
null
app/Models/Offer/OfferTranslation.php
The-Alternative/Back_End_E_Daliely_New
f70b1f76e73db323966b41df36080e4979a40f6d
[ "MIT" ]
2
2021-07-01T10:14:52.000Z
2021-11-17T21:19:04.000Z
app/Models/Offer/OfferTranslation.php
The-Alternative/Back_End_E_Daliely_New
f70b1f76e73db323966b41df36080e4979a40f6d
[ "MIT" ]
2
2021-06-22T09:12:32.000Z
2021-12-26T10:33:10.000Z
<?php namespace App\Models\Offer; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class OfferTranslation extends Model { use HasFactory; protected $table='offer_translations'; protected $fillable=['id','name','short_description','long_description','locale' ,'offer_id']; protected $hidden=['offer_id']; public function Offer() { return $this->belongsTo(Offer::class); } }
21.318182
85
0.697228
af516e0e224be9352bbd9f70f78beffb29e4ae92
3,177
py
Python
twitch-eventsub/src/server.py
sp1d3rx/stream-environment
b32b8aaa926a8eed041801455cac4d969ca5f2fc
[ "MIT" ]
7
2021-05-03T22:49:43.000Z
2022-02-14T22:55:22.000Z
twitch-eventsub/src/server.py
sp1d3rx/stream-environment
b32b8aaa926a8eed041801455cac4d969ca5f2fc
[ "MIT" ]
48
2021-05-02T09:24:22.000Z
2021-12-29T21:44:43.000Z
twitch-eventsub/src/server.py
sp1d3rx/stream-environment
b32b8aaa926a8eed041801455cac4d969ca5f2fc
[ "MIT" ]
7
2021-05-03T20:09:03.000Z
2022-01-29T22:37:53.000Z
import os import urllib import webbrowser import requests from dotenv import load_dotenv from sanic import Sanic, Request from sanic.response import text load_dotenv("../credentials.env") # credential imports CLIENT_ID = os.getenv("CLIENT_ID") CLIENT_SECRET = os.getenv("CLIENT_SECRET") OAUTH_TOKEN = os.getenv("OAUTH_TOKEN") CALLBACK = os.getenv("CALLBACK") # eventsub callback creds HOST = "127.0.0.1" PORT = 5000 LOCAL_ADDRESS = f"https://{HOST}:{PORT}" SCOPES = [ "bits:read", "channel:read:subscriptions", "channel:moderate", "channel:read:redemptions", ] # database API creds DB_URL = "http://127.0.0.1:1337" # ssl things CERT_PATH = os.getenv("CERT_PATH") KEY_PATH = os.getenv("KEY_PATH") ssl = {"cert": CERT_PATH, "key": KEY_PATH} app = Sanic("twitch_eventsub") def get_user_auth(client_id:str = CLIENT_ID, scopes:list = SCOPES): url = "https://id.twitch.tv/oauth2/authorize" # create appropriate url for authorizing permissions params = { "client_id": client_id, "redirect_uri": "https://127.0.0.1:5000/authorize", "response_type": "code", "scope": " ".join(scopes), "force_verify": "true" } get_url = url + "?" + urllib.parse.urlencode(params) # open browser window for user to accept required permissions webbrowser.open(get_url) async def aio_get(url:str) -> dict: async with aiohttp.ClientSession() as session: async with session.get(url) as r: response = await r.json() print(response) return response async def aio_post(url:str, payload:dict, **kwargs) -> None: data = json.dumps(payload).encode("ascii") async with aiohttp.ClientSession() as session: await session.post(url, data=data) @app.get("/") async def root(request): get_user_auth() return text("Hey, it worked!") @app.route("/authorize") async def authorize(request): code = request.args["code"][0] # get user access token using the above code url = "https://id.twitch.tv/oauth2/token" params = { "client_id": CLIENT_ID, "client_secret": CLIENT_SECRET, "code": code, "grant_type": "authorization_code", "redirect_uri": f"{LOCAL_ADDRESS}/authorize" } async with aiohttp.ClientSession() as session: response = await session.post( url=url, client_id = CLIENT_ID, client_secret = CLIENT_SECRET, code = code, grant_type = "authorization_code", redirect_uri = f"{LOCAL_ADDRESS}/authorize" ) data = response.json() #response = requests.post(url=url, params=params) #data = response.json() app_access = data["access_token"] app_access_payload = {"name":"app_access", "token":app_access} aio_post(f"{DB_URL}/tokens/set/", app_access_payload) refresh = data["refresh_token"] refresh_payload = {"name":"refresh", "token":refresh} aio_post(f"{DB_URL}/tokens/set/", refresh_payload) #write_token("refresh", refresh_token) return text("boom, it worked") if __name__ == "__main__": app.run(host=HOST, port=PORT, ssl=ssl)
27.626087
67
0.649984
1a486dfd9092760f22f143361e2fb52e067a3b17
1,992
py
Python
jobs/views.py
Yuhjiang/hellofamilyclub
4d01a41cde57023b0fd10685b67ab31d51fe1fb7
[ "BSD-2-Clause" ]
1
2020-11-06T01:55:37.000Z
2020-11-06T01:55:37.000Z
jobs/views.py
Yuhjiang/hellofamilyclub
4d01a41cde57023b0fd10685b67ab31d51fe1fb7
[ "BSD-2-Clause" ]
34
2020-03-13T04:49:53.000Z
2022-03-07T06:08:35.000Z
jobs/views.py
Yuhjiang/hellofamilyclub
4d01a41cde57023b0fd10685b67ab31d51fe1fb7
[ "BSD-2-Clause" ]
null
null
null
import os import sys import django import logging sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) profile = os.environ.get('HELLOFAMILYCLUB', 'develop') os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'hellofamilyclub.settings.{}'.format(profile)) django.setup() from apscheduler.schedulers.blocking import BlockingScheduler from apscheduler.jobstores.mongodb import MongoDBJobStore from apscheduler.jobstores.memory import MemoryJobStore from apscheduler.executors.pool import ThreadPoolExecutor, ProcessPoolExecutor from pictures.service.weibo import fetch_weibo_pictures from pictures.service.recognize import recognize_all_pictures from pictures.service.config import db_client from news.service.helloproject_news import run_collect_hello_project_news logging.basicConfig(filename='/Users/yuhao/log/job.log', filemode='a') logging.getLogger('apscheduler').setLevel(logging.DEBUG) jobstores = { 'mongo': MongoDBJobStore(collection='job', database='hellofamily', client=db_client), 'default': MemoryJobStore() } executors = { 'default': ThreadPoolExecutor(20), 'processpool': ProcessPoolExecutor(5), } job_defaults = { 'coalesce': False, 'max_instances': 10, } scheduler = BlockingScheduler(jobstores=jobstores, executors=executors, job_defaults=job_defaults) scheduler.add_job(fetch_weibo_pictures, 'interval', hours=1, replace_existing=True, id='fetch_weibo_pictures', jobstore='mongo', max_instances=1) scheduler.add_job(recognize_all_pictures, 'interval', hours=1, replace_existing=True, id='recognize_all_pictures', jobstore='mongo', max_instances=1) scheduler.add_job(run_collect_hello_project_news, 'interval', hours=2, replace_existing=True, id='collect_hello_project_news', jobstore='mongo', max_instances=1) scheduler.start()
34.947368
78
0.730924
4956a141fc7b165a434567e5779637f45366b8e9
2,554
py
Python
components/google-cloud/tests/v1/bigquery/integration/test_bigquery_query_job_compile.py
votti/pipelines
1c3e2768e6177d5d6e3f4b8eff8fafb9a3b76c1f
[ "Apache-2.0" ]
1
2022-03-30T05:22:19.000Z
2022-03-30T05:22:19.000Z
components/google-cloud/tests/v1/bigquery/integration/test_bigquery_query_job_compile.py
votti/pipelines
1c3e2768e6177d5d6e3f4b8eff8fafb9a3b76c1f
[ "Apache-2.0" ]
1
2020-02-06T12:53:44.000Z
2020-02-06T12:53:44.000Z
components/google-cloud/tests/v1/bigquery/integration/test_bigquery_query_job_compile.py
votti/pipelines
1c3e2768e6177d5d6e3f4b8eff8fafb9a3b76c1f
[ "Apache-2.0" ]
null
null
null
# Copyright 2021 The Kubeflow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Test google-cloud-pipeline-Components to ensure they compile correctly.""" import json import os from google_cloud_pipeline_components.v1.bigquery import BigqueryQueryJobOp import kfp from kfp.v2 import compiler import unittest class ComponentsCompileTest(unittest.TestCase): def setUp(self): super(ComponentsCompileTest, self).setUp() self._project = 'test_project' self._location = 'us-central1' self._query = 'SELECT * FROM foo_bar;' self._query_parameters = [{'name':'foo'},{'name':'bar'}] self._job_configuration_query = {'priority':'high'} self._labels = {'key1':'val1'} self._encryption_spec_key_name = 'fake_encryption_key' self._package_path = os.path.join( os.getenv('TEST_UNDECLARED_OUTPUTS_DIR'), 'pipeline.json') def tearDown(self): super(ComponentsCompileTest, self).tearDown() if os.path.exists(self._package_path): os.remove(self._package_path) def test_bigquery_query_job_op_compile(self): @kfp.dsl.pipeline(name='bigquery-test') def pipeline(): BigqueryQueryJobOp( project=self._project, location=self._location, query=self._query, query_parameters=self._query_parameters, job_configuration_query=self._job_configuration_query, labels=self._labels, encryption_spec_key_name=self._encryption_spec_key_name) compiler.Compiler().compile( pipeline_func=pipeline, package_path=self._package_path) with open(self._package_path) as f: executor_output_json = json.load(f, strict=False) with open('testdata/bigquery_query_job_component_pipeline.json') as ef: expected_executor_output_json = json.load(ef, strict=False) # Ignore the kfp SDK & schema version during comparison del executor_output_json['sdkVersion'] del executor_output_json['schemaVersion'] self.assertDictEqual(executor_output_json, expected_executor_output_json)
37.558824
77
0.74119
a42b2fa06d5df018699c2dd9c2b4af31c419de1f
695
ps1
PowerShell
Installer/Audit-Test-Automation/ATAPAuditor/AuditGroups/Microsoft Windows Server 2022-CIS-1.0.0#SecurityOptions.ps1
fbprogmbh/Audit-Test-Automation-
0371cd12b12e6088f33bb48b91c45f7e415cbca1
[ "BSD-3-Clause" ]
null
null
null
Installer/Audit-Test-Automation/ATAPAuditor/AuditGroups/Microsoft Windows Server 2022-CIS-1.0.0#SecurityOptions.ps1
fbprogmbh/Audit-Test-Automation-
0371cd12b12e6088f33bb48b91c45f7e415cbca1
[ "BSD-3-Clause" ]
null
null
null
Installer/Audit-Test-Automation/ATAPAuditor/AuditGroups/Microsoft Windows Server 2022-CIS-1.0.0#SecurityOptions.ps1
fbprogmbh/Audit-Test-Automation-
0371cd12b12e6088f33bb48b91c45f7e415cbca1
[ "BSD-3-Clause" ]
null
null
null
[AuditTest] @{ Id = "2.3.1.1" Task = "(L1) Ensure 'Accounts: Administrator account status' is set to 'Disabled' (MS only)" Test = { } } [AuditTest] @{ Id = "2.3.1.3" Task = "(L1) Ensure 'Accounts: Guest account status' is set to 'Disabled' (MS only)" Test = { } } [AuditTest] @{ Id = "2.3.1.5" Task = "(L1) Configure 'Accounts: Rename administrator account'" Test = { } } [AuditTest] @{ Id = "2.3.1.6" Task = "(L1) Configure 'Accounts: Rename guest account'" Test = { } } [AuditTest] @{ Id = "2.3.11.6" Task = "(L1) Ensure 'Network security: Force logoff when logon hours expire' is set to 'Enabled'" Test = { } }
22.419355
101
0.552518
5bf426ba17e2e9121dcc0575dc06da4e66f7ea76
2,047
css
CSS
style.css
Fidela-keziah/Delani-week3Ip
52d6fdcbc136e1016cfb6634e72c4360eb8b40a3
[ "MIT" ]
null
null
null
style.css
Fidela-keziah/Delani-week3Ip
52d6fdcbc136e1016cfb6634e72c4360eb8b40a3
[ "MIT" ]
null
null
null
style.css
Fidela-keziah/Delani-week3Ip
52d6fdcbc136e1016cfb6634e72c4360eb8b40a3
[ "MIT" ]
null
null
null
#welcome{ background-image: url(img/assets/backgrounds/h_img.jpg); background-repeat: no-repeat; background-size: cover; } .wel{ color: white; text-align: center; font-family: 'Black Ops One', cursive; padding: 25px; } #about{ text-align: center; font-family: 'Abel', sans-serif; } .jumbotron{ background-color: transparent; } #service{ text-align: center; background-image: url(img/assets/backgrounds/s_image.jpg); background-repeat: no-repeat; background-size: cover; color: white; font-family: 'Abel', sans-serif; } #whatwedo{ text-align: center; font-family: 'Abel', sans-serif; } #portfolio{ text-align: center; font-family: 'Abel', sans-serif; } #contact{ background-image: url(img/assets/backgrounds/c_image.jpg); background-repeat: no-repeat; background-size: cover; color: white; margin-top: 15px; font-family: 'Abel', sans-serif; } footer{ text-align: center; margin-top: 20px; font-family: 'Cookie', cursive; padding: 10px; } .col-md-3 img{ max-width: 90%; max-height: 90%; margin-bottom: 15px; } .text{ text-align: center; display: none; } input[type="text"],input[type="email"],#textarea,input[type="submit"]{ background-color: transparent; color: white; text-align: center; } .form-control::-webkit-input-placeholder{ color: white; } #name,#anyemail,#textarea{ margin-left: 15px; margin-bottom: 15px; } #textarea{ width: 750px; } #wedodesign,#wedodevelopment,#wedoproduct{ display: none; } .mouse-click { animation: bounce 3s infinite; } @keyframes bounce { 0%, 20%, 50%, 80%, 100% { transform: translateY(0); } 50% { transform: translateY(-50px); } 50% { transform: translateY(-50px); } } #four{ display: none; } #portfolio img{ margin: 5px 5px 20px 5px; opacity: 1.0; } #portfolio img:hover{ opacity: 0.3; }
19.311321
72
0.604787
b481b01cab4645d4cd89e09648881773e0ba083b
1,141
rb
Ruby
spec/lib/page_tree_spec.rb
brandleadership/kuhsaft
5ea1daebcc1facf61a067e8177ae2fcae02d488b
[ "MIT" ]
null
null
null
spec/lib/page_tree_spec.rb
brandleadership/kuhsaft
5ea1daebcc1facf61a067e8177ae2fcae02d488b
[ "MIT" ]
null
null
null
spec/lib/page_tree_spec.rb
brandleadership/kuhsaft
5ea1daebcc1facf61a067e8177ae2fcae02d488b
[ "MIT" ]
null
null
null
require 'spec_helper' require_relative '../../lib/kuhsaft/page_tree' require_relative '../../app/models/kuhsaft/page' # TODO: THESE SPECS ONLY WORK WHEN THE FULL SUITE IS RUN. FIX THAT! module Kuhsaft describe PageTree do let(:page_tree) do { '0' => { 'id' => '1', 'children' => { '0' => { 'id' => '2' } } }, '1' => { 'id' => '3' } } end before :each do @page1 = FactoryGirl.create(:page, id: 1, position: 10) @page2 = FactoryGirl.create(:page, id: 2, position: 10) @page3 = FactoryGirl.create(:page, id: 3, position: 10) end describe 'update' do it 'sets the correct position of the root nodes' do PageTree.update(page_tree) expect(@page1.reload.position).to eq(0) expect(@page2.reload.position).to eq(0) expect(@page3.reload.position).to eq(1) end it 'sets the correct parent attribute for the nodes' do PageTree.update(page_tree) expect(@page1.reload.parent_id).to be_nil expect(@page2.reload.parent_id).to eq(1) expect(@page3.reload.parent_id).to be nil end end end end
29.25641
73
0.60298
cf0b26efd691c32614d044f669deaebdc2fb80f7
11,586
php
PHP
src/phpDocumentor/Command/Project/ParseCommand.php
zhangmx/phpDocumentor2
2a699057bc2ae5fa9b5468c6a230abd431a3d8de
[ "MIT" ]
1
2016-05-24T00:53:08.000Z
2016-05-24T00:53:08.000Z
src/phpDocumentor/Command/Project/ParseCommand.php
zhangmx/phpDocumentor2
2a699057bc2ae5fa9b5468c6a230abd431a3d8de
[ "MIT" ]
null
null
null
src/phpDocumentor/Command/Project/ParseCommand.php
zhangmx/phpDocumentor2
2a699057bc2ae5fa9b5468c6a230abd431a3d8de
[ "MIT" ]
null
null
null
<?php /** * phpDocumentor * * PHP Version 5 * * @author Mike van Riel <mike.vanriel@naenius.com> * @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com) * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ namespace phpDocumentor\Command\Project; use \Symfony\Component\Console\Input\InputInterface; use \Symfony\Component\Console\Input\InputOption; use \Symfony\Component\Console\Output\OutputInterface; /** * Parses the given source code and creates a structure file. * * The parse task uses the source files defined either by -f or -d options and * generates a structure file (structure.xml) at the target location (which is * the folder 'output' unless the option -t is provided). * * @author Mike van Riel <mike.vanriel@naenius.com> * @license http://www.opensource.org/licenses/mit-license.php MIT * @link http://phpdoc.org */ class ParseCommand extends \phpDocumentor\Command\ConfigurableCommand { /** * Initializes this command and sets the name, description, options and * arguments. * * @return void */ protected function configure() { $this->setName('project:parse') ->setAliases(array('parse')) ->setDescription('Creates a structure file from your source code') ->setHelp( <<<HELP The parse task uses the source files defined either by -f or -d options and generates a structure file (structure.xml) at the target location. HELP ) ->addOption( 'target', 't', InputOption::VALUE_OPTIONAL, 'Path where to store the generated output' ) ->addOption( 'filename', 'f', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Comma-separated list of files to parse. The wildcards ? and * ' .'are supported' ) ->addOption( 'directory', 'd', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Comma-separated list of directories to (recursively) parse' ) ->addOption( 'extensions', 'e', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Comma-separated list of extensions to parse, defaults to ' . 'php, php3 and phtml' ) ->addOption( 'ignore', 'i', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Comma-separated list of file(s) and directories that will be ' . 'ignored. Wildcards * and ? are supported' ) ->addOption( 'ignore-tags', null, InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Comma-separated list of tags that will be ignored, defaults to ' .'none. package, subpackage and ignore may not be ignored.' ) ->addOption( 'hidden', null, InputOption::VALUE_NONE, 'set to on to descend into hidden directories ' . '(directories starting with \'.\'), default is on' ) ->addOption( 'ignore-symlinks', null, InputOption::VALUE_NONE, 'Ignore symlinks to other files or directories, default is on' ) ->addOption( 'markers', 'm', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Comma-separated list of markers/tags to filter', array('TODO', 'FIXME') ) ->addOption( 'title', null, InputOption::VALUE_OPTIONAL, 'Sets the title for this project; default is the phpDocumentor ' .'logo' ) ->addOption( 'force', null, InputOption::VALUE_NONE, 'Forces a full build of the documentation, does not increment ' .'existing documentation' ) ->addOption( 'validate', null, InputOption::VALUE_NONE, 'Validates every processed file using PHP Lint, costs a lot of ' .'performance' ) ->addOption( 'visibility', null, InputOption::VALUE_OPTIONAL, 'Specifies the parse visibility that should be displayed in the ' .'documentation (comma seperated e.g. "public,protected")' ) ->addOption( 'defaultpackagename', null, InputOption::VALUE_OPTIONAL, 'Name to use for the default package.', 'Default' ) ->addOption( 'sourcecode', null, InputOption::VALUE_NONE, 'Whether to include syntax highlighted source code' ) ->addOption( 'progressbar', 'p', InputOption::VALUE_NONE, 'Whether to show a progress bar; will automatically quiet logging ' .'to stdout' ); parent::configure(); } /** * Returns the target location where to store the structure.xml. * * @throws \InvalidArgumentException * * @return string */ public function getTarget($target) { $target = trim($target); if (($target == '') || ($target == DIRECTORY_SEPARATOR)) { throw new \InvalidArgumentException( 'Either an empty path or root was given: ' . $target ); } // if the target does not end with .xml, assume it is a folder if (substr($target, -4) != '.xml') { // if the folder does not exist at all, create it if (!file_exists($target)) { if (!@mkdir($target, 0755, true)) { throw new \InvalidArgumentException( 'The path "' . $target . '" could not be created' ); } } if (!is_dir($target)) { throw new \InvalidArgumentException( 'The given location "' . $target . '" is not a folder' ); } $path = realpath($target); $target = $path . DIRECTORY_SEPARATOR . 'structure.xml'; } else { $path = realpath(dirname($target)); $target = $path . DIRECTORY_SEPARATOR . basename($target); } if (!is_writable($path)) { throw new \InvalidArgumentException( 'The given path "' . $target . '" either does not exist or is ' . 'not writable.' ); } return $target; } /** * Executes the business logic involved with this command. * * @param \Symfony\Component\Console\Input\InputInterface $input * @param \Symfony\Component\Console\Output\OutputInterface $output * * @return int */ protected function execute(InputInterface $input, OutputInterface $output) { // invoke parent to load custom config parent::execute($input, $output); /** @var \phpDocumentor\Console\Helper\ProgressHelper $progress */ $progress = $this->getProgressBar($input); if (!$progress) { $this->connectOutputToLogging($output); } $output->write('Initializing parser and collecting files .. '); $target = $this->getTarget( $this->getOption($input, 'target', 'parser/target') ); $parser = new \phpDocumentor\Parser\Parser(); $parser->setTitle( htmlentities((string)$this->getOption($input, 'title', 'title')) ); $parser->setExistingXml($target); $parser->setForced($input->getOption('force')); $parser->setMarkers( $this->getOption($input, 'markers', 'parser/markers/item', null, true) ); $parser->setIgnoredTags($input->getOption('ignore-tags')); $parser->setValidate($input->getOption('validate')); $parser->setVisibility( (string)$this->getOption($input, 'visibility', 'parser/visibility') ); $parser->setDefaultPackageName( $this->getOption( $input, 'defaultpackagename', 'parser/default-package-name' ) ); $files = $this->getFileCollection($input); $parser->setPath($files->getProjectRoot()); if ($progress) { $progress->start($output, $files->count()); } try { // save the generate file to the path given as the 'target' option $output->writeln('OK'); $output->writeln('Parsing files'); $result = $parser->parseFiles($files, $input->getOption('sourcecode')); } catch (\Exception $e) { if ($e->getCode() === \phpDocumentor\Parser\Exception::NO_FILES_FOUND) { throw new \Exception( 'No parsable files were found, did you specify any using ' . 'the -f or -d parameter?' ); } throw new \Exception($e->getMessage()); } if ($progress) { $progress->finish(); } $output->write('Storing structure.xml in "'.$target.'" .. '); file_put_contents($target, $result); $output->writeln('OK'); return 0; } /** * Returns the collection of files based on the input and configuration. * * @param InputInterface $input * * @return \phpDocumentor\File\Collection */ protected function getFileCollection($input) { $files = new \phpDocumentor\Fileset\Collection(); $files->setAllowedExtensions( $this->getOption( $input, 'extensions', 'parser/extensions/extension', array('php', 'php3', 'phtml'), true ) ); $files->setIgnorePatterns( $this->getOption($input, 'ignore', 'files/ignore', array(), true) ); $files->setIgnoreHidden( $this->getOption( $input, 'hidden', 'files/ignore-hidden', 'off' ) == 'on' ); $files->setFollowSymlinks( $this->getOption( $input, 'ignore-symlinks', 'files/ignore-symlinks', 'off' ) == 'on' ); $files->addFiles( $this->getOption($input, 'filename', 'files/file', array(), true) ); $files->addDirectories( $this->getOption($input, 'directory', 'files/directory', array(), true) ); return $files; } /** * Adds the parser.file.pre event to the advance the progressbar. * * @param \Symfony\Component\Console\Input\InputInterface $input * * @return \Symfony\Component\Console\Helper\HelperInterface|null */ protected function getProgressBar(InputInterface $input) { $progress = parent::getProgressBar($input); if (!$progress) { return null; } $this->getService('event_dispatcher')->connect( 'parser.file.pre', function() use ($progress) { $progress->advance(); } ); return $progress; } }
34.482143
84
0.53228
dd5f91e2b25eaabd1eb9a0ea491033e022328d81
1,017
java
Java
src/main/java/org/myrobotlab/service/meta/IpCameraMeta.java
srayner/myrobotlab
7f43b182a0f58b27b580dd94c106679feef15c31
[ "Apache-2.0" ]
null
null
null
src/main/java/org/myrobotlab/service/meta/IpCameraMeta.java
srayner/myrobotlab
7f43b182a0f58b27b580dd94c106679feef15c31
[ "Apache-2.0" ]
null
null
null
src/main/java/org/myrobotlab/service/meta/IpCameraMeta.java
srayner/myrobotlab
7f43b182a0f58b27b580dd94c106679feef15c31
[ "Apache-2.0" ]
null
null
null
package org.myrobotlab.service.meta; import org.myrobotlab.framework.Platform; import org.myrobotlab.logging.LoggerFactory; import org.myrobotlab.service.meta.abstracts.MetaData; import org.slf4j.Logger; public class IpCameraMeta extends MetaData { private static final long serialVersionUID = 1L; public final static Logger log = LoggerFactory.getLogger(IpCameraMeta.class); /** * This class is contains all the meta data details of a service. It's peers, * dependencies, and all other meta data related to the service. * */ public IpCameraMeta(String name) { super(name); Platform platform = Platform.getLocalInstance(); addDescription("control and video stream capture for generic ip camera"); addCategory("video"); // FIXME - should be webcam dependency not opencv ! // addDependency("org.bytedeco.javacpp","1.1"); // FIXME - should just add IpFrameGrabber and drop the dependency !!! // addDependency("org.bytedeco", "javacv-platform", "1.3.3"); } }
31.78125
79
0.728614
3a7f5de58951af97d2e2133426b8773b2e1bf826
2,311
swift
Swift
GuiseTests/GuiseFilterTests.swift
Prosumma/Guise
9959b3ec6412509fc5f6e0071425484e7c747d0a
[ "MIT" ]
53
2016-03-13T14:14:32.000Z
2022-03-14T21:04:55.000Z
GuiseTests/GuiseFilterTests.swift
Prosumma/Guise
9959b3ec6412509fc5f6e0071425484e7c747d0a
[ "MIT" ]
2
2017-12-09T22:01:15.000Z
2018-02-13T17:54:23.000Z
GuiseTests/GuiseFilterTests.swift
Prosumma/Guise
9959b3ec6412509fc5f6e0071425484e7c747d0a
[ "MIT" ]
4
2017-08-16T17:42:18.000Z
2020-02-27T22:48:21.000Z
// // GuiseFilterTests.swift // Guise // // Created by Gregory Higley on 10/23/17. // Copyright © 2017 Gregory Higley. All rights reserved. // import XCTest @testable import Guise class GuiseFilterTests: XCTestCase { override func setUp() { super.setUp() Guise.clear() } func testFilterByKeys() { let key1 = AnyKey(Guise.register(instance: 3, name: Name.🌈))! let key2 = AnyKey(type: String.self, container: Container.🐝) let found = Guise.filter(keys: [key1, key2]).keys XCTAssertEqual(found.count, 1) XCTAssertTrue(found.contains(key1)) XCTAssertFalse(found.contains(key2)) } func testFilterByContainer() { let container = Container.🐝 let key1 = AnyKey(Guise.register(instance: "Fred", name: "fred", container: container))! let key2 = AnyKey(Guise.register(instance: Plink(thibb: Guise.resolve(type: String.self, name: "fred", container: container)!) as Plonk, container: container))! let key3 = AnyKey(Guise.register(instance: "Fred", name: "fred"))! // Note that this is in the default container, not 🐝 let found = Set(Guise.filter(container: container).keys) XCTAssertEqual(found.count, 2) XCTAssertEqual(found.intersection([key1, key2, key3]).count, found.count) XCTAssertFalse(found.contains(key3)) } func testFilterByType() { let container = Container.🐝, name = Name.🌈 let key1 = Guise.register(instance: 7, name: name, container: container) let key2 = Guise.register(instance: 3, container: container) let key3 = Guise.register(instance: 1, name: name) Guise.register(instance: "y0", name: name) let found = Set(Guise.filter(type: Int.self).keys) XCTAssertEqual(found.count, 3) XCTAssertEqual(found.intersection([key1, key2, key3]).count, found.count) } func testFilterByMetadata() { let limit = 2 for p in 0..<5 { let identifier = UUID() let metadata: Any = p < limit ? Metadata.bloop : () Guise.register(factory: Plink(thibb: "\(identifier)") as Plonk, name: identifier, metadata: metadata) } XCTAssertEqual(limit, Guise.filter(type: Plonk.self, metadata: Metadata.bloop).count) } }
38.516667
168
0.638685
16c6df1d339e9c519a5536eea0872f313ac57f39
216
sql
SQL
task6.sql
SimeonHristov99/SQLEveryDay
837b070c71fd5cf76e5aab07edee77bc8bf6115e
[ "MIT" ]
null
null
null
task6.sql
SimeonHristov99/SQLEveryDay
837b070c71fd5cf76e5aab07edee77bc8bf6115e
[ "MIT" ]
null
null
null
task6.sql
SimeonHristov99/SQLEveryDay
837b070c71fd5cf76e5aab07edee77bc8bf6115e
[ "MIT" ]
null
null
null
select T.department, e2.first_name, e2.salary, T.avg from employee e2 join ( select e.department, avg(salary) as avg from employee e group by e.department ) as T on T.department = e2.department order by T.department;
24
52
0.773148
92305d94a651a27def7644c6812129436559f8af
529
swift
Swift
Eisenhower Todo/AddTask/Configurator/AddTaskInitializer.swift
gsabatie/EisenhowerTodoApp
723e7ab18cb0e2978c66b3217cdb025d58de5022
[ "MIT" ]
2
2018-03-16T23:46:15.000Z
2019-03-22T15:40:22.000Z
Eisenhower Todo/AddTask/Configurator/AddTaskInitializer.swift
gsabatie/EisenhowerTodoApp
723e7ab18cb0e2978c66b3217cdb025d58de5022
[ "MIT" ]
null
null
null
Eisenhower Todo/AddTask/Configurator/AddTaskInitializer.swift
gsabatie/EisenhowerTodoApp
723e7ab18cb0e2978c66b3217cdb025d58de5022
[ "MIT" ]
null
null
null
// // AddTaskAddTaskInitializer.swift // EisenhowerTodoApp // // Created by Guillaume Sabatie on 27/03/2018. // Copyright © 2018 EiseinhowerAppTeam. All rights reserved. // import UIKit class AddTaskModuleInitializer: NSObject { //Connect with object on storyboard @IBOutlet weak var addtaskViewController: AddTaskViewController! override func awakeFromNib() { let configurator = AddTaskModuleConfigurator() configurator.configureModuleForViewInput(viewInput: addtaskViewController) } }
23
82
0.750473
4debc93285b2a7a84a5753e882cbc847e8477e07
127
lua
Lua
states/win.lua
jdeeny/awfulwinterjam2018
2b3990b56e55b1530e37edbada24607f55282ce8
[ "MIT" ]
null
null
null
states/win.lua
jdeeny/awfulwinterjam2018
2b3990b56e55b1530e37edbada24607f55282ce8
[ "MIT" ]
null
null
null
states/win.lua
jdeeny/awfulwinterjam2018
2b3990b56e55b1530e37edbada24607f55282ce8
[ "MIT" ]
null
null
null
local win = {} function win.enter() state = STATE_WIN end function win.update(dt) end function win.draw() end return win
8.466667
23
0.708661
da387ea86320e7b8f0004c8cc77eab8b8dc89da0
3,726
php
PHP
inc/support/plugins/cf7/modules/class-basic.php
BicanMarianValeriu/wecodeart-framework
8dcfabfd5f6e8f74ea506661add1a8b905464168
[ "MIT" ]
13
2019-01-02T21:13:51.000Z
2022-03-20T23:06:33.000Z
inc/support/plugins/cf7/modules/class-basic.php
BicanMarianValeriu/wecodeart-framework
8dcfabfd5f6e8f74ea506661add1a8b905464168
[ "MIT" ]
3
2020-03-16T11:53:00.000Z
2022-03-20T04:39:20.000Z
inc/support/plugins/cf7/modules/class-basic.php
BicanMarianValeriu/wecodeart-framework
8dcfabfd5f6e8f74ea506661add1a8b905464168
[ "MIT" ]
1
2019-02-19T01:38:10.000Z
2019-02-19T01:38:10.000Z
<?php /** * WeCodeArt Framework. * * WARNING: This file is part of the core WeCodeArt Framework. DO NOT edit this file under any circumstances. * Please do all modifications in the form of a child theme. * * @package WeCodeArt Framework * @subpackage Support\CF7\Modules\Module * @copyright Copyright (c) 2021, WeCodeArt Framework * @since 5.0.0 * @version 5.3.1 */ namespace WeCodeArt\Support\Plugins\CF7\Modules; defined( 'ABSPATH' ) || exit; use WeCodeArt\Singleton; /** * Basic Fields. */ class Basic extends Module { use Singleton; /** * Module vars. * * @var mixed */ protected $name = 'text'; protected $fields = [ 'text', 'text*', 'email', 'email*', 'url', 'url*', 'tel', 'tel*' ]; /** * Return field HTML. * * @param object $tag * * @return string Rendered field output. */ public function get_html( $tag ) { if ( empty( $tag->name ) ) { return ''; } $attrs = []; if ( wpcf7_support_html5() ) { $attrs['type'] = $tag->basetype; } else { $attrs['type'] = 'text'; } $validation_error = wpcf7_get_validation_error( $tag->name ); $class = explode( ' ', wpcf7_form_controls_class( $tag->type, 'wpcf7-text form-control' ) ); if ( in_array( $tag->basetype, [ 'email', 'url', 'tel' ] ) ) { $class[] = 'wpcf7-validates-as-' . $tag->basetype; } if ( $validation_error ) { $class[] = 'wpcf7-not-valid'; $attrs['aria-invalid'] = 'true'; $attrs['aria-describedby'] = wpcf7_get_validation_error_reference( $tag->name ); } else { $attrs['aria-invalid'] = 'false'; } $attrs['name'] = $tag->name; $attrs['size'] = $tag->get_size_option( '40' ); $attrs['maxlength'] = $tag->get_maxlength_option(); $attrs['minlength'] = $tag->get_minlength_option(); if ( $attrs['maxlength'] and $attrs['minlength'] and $attrs['maxlength'] < $attrs['minlength'] ) { unset( $attrs['maxlength'], $attrs['minlength'] ); } $attrs['class'] = $tag->get_class_option( join( ' ', $class ) ); $attrs['tabindex'] = $tag->get_option( 'tabindex', 'signed_int', true ); $attrs['autocomplete'] = $tag->get_option( 'autocomplete', '[-0-9a-zA-Z]+', true ); if( $tag->get_id_option() ) { $attrs['id'] = $tag->get_id_option(); } if ( $tag->has_option( 'readonly' ) ) { $attrs['readonly'] = 'readonly'; } if ( $tag->is_required() ) { $attrs['required'] = true; $attrs['aria-required'] = 'true'; } $label = $tag->has_option( 'first_as_label' ) ? (string) reset( $tag->values ) : false; $value = count( $tag->values ) > 1 ? (string) end( $tag->values ) : (string) reset( $tag->values ); if ( $tag->has_option( 'placeholder' ) or $tag->has_option( 'watermark' ) ) { $attrs['placeholder'] = $value; $value = ''; } $attrs['value'] = wpcf7_get_hangover( $tag->name, $tag->get_default_option( $value ) ); $html = wecodeart( 'markup' )::wrap( 'cf7-basic-field', [ [ 'tag' => 'span', 'attrs' => [ 'class' => self::get_wrap_class( $tag ) ] ] ], 'wecodeart_input', [ $attrs['type'], [ 'label' => $label, 'attrs' => $attrs, 'messages' => [ 'invalid' => $validation_error ] ] ], false ); return $html; } }
30.292683
113
0.503221
0732cae4a134d20c731f9db17d4f589972ff38a1
58
rb
Ruby
app/models/comment.rb
rprata/emeeting
7f1fdda62f4b8fef7b08c4c8ccf0968b773dd7c5
[ "CC0-1.0" ]
null
null
null
app/models/comment.rb
rprata/emeeting
7f1fdda62f4b8fef7b08c4c8ccf0968b773dd7c5
[ "CC0-1.0" ]
null
null
null
app/models/comment.rb
rprata/emeeting
7f1fdda62f4b8fef7b08c4c8ccf0968b773dd7c5
[ "CC0-1.0" ]
null
null
null
class Comment < ActiveRecord::Base belongs_to :event end
14.5
34
0.793103
2d74712cecb133b1cfb8890ee485d796212d2821
93
css
CSS
test/whitespace-basic.expect.css
jake-low/postcss-minify
c9e8c5eddcd7e77210d7abd15066f655056a330e
[ "MIT" ]
2
2021-09-12T11:41:05.000Z
2021-12-24T06:32:11.000Z
test/whitespace-basic.expect.css
jake-low/postcss-minify
c9e8c5eddcd7e77210d7abd15066f655056a330e
[ "MIT" ]
null
null
null
test/whitespace-basic.expect.css
jake-low/postcss-minify
c9e8c5eddcd7e77210d7abd15066f655056a330e
[ "MIT" ]
null
null
null
body{font-family:sans-serif;font-weight:400}h1{line-height:2em}p{color:#222;font-size:small}
46.5
92
0.784946
ef174e9c40dc71ddd459c914ff26372844a6c86a
2,383
c
C
testpcap3.c
moooofly/libpcap_tutorial
36484c182b8a329f1bd2a3e14777e24c1f3997f2
[ "Apache-2.0" ]
3
2018-05-10T05:55:49.000Z
2021-11-12T13:39:09.000Z
testpcap3.c
moooofly/libpcap_tutorial
36484c182b8a329f1bd2a3e14777e24c1f3997f2
[ "Apache-2.0" ]
2
2016-11-29T03:20:29.000Z
2016-11-29T03:51:47.000Z
testpcap3.c
moooofly/libpcap_tutorial
36484c182b8a329f1bd2a3e14777e24c1f3997f2
[ "Apache-2.0" ]
1
2021-11-07T22:48:57.000Z
2021-11-07T22:48:57.000Z
/********************************************************************** * file: testpcap3.c * date: Sat Apr 07 23:23:02 PDT 2001 * Author: Martin Casado * Last Modified:2001-Apr-07 11:23:05 PM * * Investigate using filter programs with pcap_compile() and * pcap_setfilter() * **********************************************************************/ #include <pcap.h> #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netinet/if_ether.h> /* just print a count every time we have a packet... */ void my_callback(u_char *useless,const struct pcap_pkthdr* pkthdr,const u_char* packet) { static int count = 1; fprintf(stdout,"%d, ",count); fflush(stdout); count++; } int main(int argc,char **argv) { int i; char *dev; char errbuf[PCAP_ERRBUF_SIZE]; pcap_t* descr; const u_char *packet; struct pcap_pkthdr hdr; /* pcap.h */ struct ether_header *eptr; /* net/ethernet.h */ struct bpf_program fp; /* hold compiled program */ bpf_u_int32 maskp; /* subnet mask */ bpf_u_int32 netp; /* ip */ if(argc != 2) { fprintf(stdout,"Usage: %s \"filter program\"\n",argv[0]); return 0; } /* grab a device to peak into... */ dev = pcap_lookupdev(errbuf); if(dev == NULL) { fprintf(stderr,"%s\n",errbuf); exit(1); } /* ask pcap for the network address and mask of the device */ pcap_lookupnet(dev,&netp,&maskp,errbuf); /* open device for reading this time lets set it in promiscuous * mode so we can monitor traffic to another machine */ descr = pcap_open_live(dev,BUFSIZ,1,-1,errbuf); if(descr == NULL) { printf("pcap_open_live(): %s\n",errbuf); exit(1); } /* Lets try and compile the program.. non-optimized */ if(pcap_compile(descr,&fp,argv[1],0,netp) == -1) { fprintf(stderr,"Error calling pcap_compile\n"); exit(1); } /* set the compiled program as the filter */ if(pcap_setfilter(descr,&fp) == -1) { fprintf(stderr,"Error setting filter\n"); exit(1); } /* ... and loop */ pcap_loop(descr,-1,my_callback,NULL); return 0; }
28.035294
79
0.542174
d63efb90773d1fc7aa8ad56b391c84c683416284
2,921
cs
C#
Tests/Biohazrd.Tests.Common/ToolProcessFailureException.cs
PathogenPlayground/Biohazrd
49256a4bc4ba13ab8cb65f34df031838618d877c
[ "MIT" ]
6
2021-12-14T04:54:44.000Z
2022-03-08T19:58:34.000Z
Tests/Biohazrd.Tests.Common/ToolProcessFailureException.cs
PathogenPlayground/Biohazrd
49256a4bc4ba13ab8cb65f34df031838618d877c
[ "MIT" ]
27
2021-11-29T00:34:12.000Z
2022-03-14T21:39:08.000Z
Tests/Biohazrd.Tests.Common/ToolProcessFailureException.cs
PathogenPlayground/Biohazrd
49256a4bc4ba13ab8cb65f34df031838618d877c
[ "MIT" ]
null
null
null
using System; using System.Collections.ObjectModel; using System.Diagnostics; using System.Text; namespace Biohazrd.Tests.Common { public sealed class ToolProcessFailureException : Exception { public ProcessStartInfo ProcessStartInfo { get; } private static string CreateMessage(Process process, string? actionBeingDone, string? standardInput) { string SmartEscape(string commandOrArgument) { foreach (char c in commandOrArgument) { switch (c) { case >= 'a' and <= 'z': case >= 'A' and <= 'Z': case >= '0' and <= '9': case '.': case '-': case '_': case '=': case ':': case '~': case '/': case '\\': continue; default: if (OperatingSystem.IsWindows()) { return $"\"{commandOrArgument}\""; } else { return $"'{commandOrArgument}'"; } } } return commandOrArgument; } ProcessStartInfo startInfo = process.StartInfo; StringBuilder message = new(); message.Append($"`{SmartEscape(startInfo.FileName)}"); if (!String.IsNullOrEmpty(startInfo.Arguments)) { message.Append($" {startInfo.Arguments}"); } else if (startInfo.ArgumentList is Collection<string> { Count: > 0 }) { foreach (string argument in startInfo.ArgumentList) { message.Append($" {SmartEscape(argument)}"); } } message.Append($"` failed with exit code {process.ExitCode}"); if (actionBeingDone is not null) { message.Append($" while {actionBeingDone}"); } message.AppendLine("."); message.AppendLine($"Working directory: `{(startInfo.WorkingDirectory is "" ? Environment.CurrentDirectory : startInfo.WorkingDirectory)}`"); if (standardInput is not null) { message.AppendLine("Standard input:"); message.AppendLine("```"); message.AppendLine(standardInput); message.AppendLine("```"); } return message.ToString(); } public ToolProcessFailureException(Process process, string? actionBeingDone = null, string? standardInput = null, Exception? innerException = null) : base(CreateMessage(process, actionBeingDone, standardInput), innerException) => ProcessStartInfo = process.StartInfo; } }
36.5125
155
0.491612
4d8a27df8bf47f7a16ce868a3efb18bc346ba381
1,132
cs
C#
Assets/Scripts/MagnetScript.cs
reiss-josh/ExtraCredits_GameJam_6
85860171550990bf338737e95b3bda8d69364b35
[ "MIT" ]
null
null
null
Assets/Scripts/MagnetScript.cs
reiss-josh/ExtraCredits_GameJam_6
85860171550990bf338737e95b3bda8d69364b35
[ "MIT" ]
null
null
null
Assets/Scripts/MagnetScript.cs
reiss-josh/ExtraCredits_GameJam_6
85860171550990bf338737e95b3bda8d69364b35
[ "MIT" ]
null
null
null
using System.Collections; using System.Collections.Generic; using UnityEngine; public class MagnetScript : MonoBehaviour { public GameObject carriedChild; public Vector3 startPos = new Vector3(-20f, 8.5f, 0); public float moveSpeed = 5f; public float threshold = 0.1f; private Rigidbody2D rb2d; private Rigidbody2D childRb; // Start is called before the first frame update void Start() { transform.position = startPos; rb2d = GetComponent<Rigidbody2D>(); childRb = carriedChild.GetComponent<Rigidbody2D>(); childRb.isKinematic = true; } // Update is called once per frame void FixedUpdate() { if (isApproxEqual(transform.position.x, 0, threshold)) AwakenChild(); rb2d.velocity = Vector3.right * moveSpeed; Debug.Log(childRb.IsSleeping()); } public bool isApproxEqual(float value1, float value2, float threshold) { return Mathf.Abs(value1 - value2) <= threshold; } void AwakenChild() { carriedChild.transform.parent = null; childRb.isKinematic = false; } }
25.727273
77
0.65371
c67eefa4bdf966a6000d15a165952626e868932a
345
css
CSS
angular-frontend/src/app/components/slot-and-order/slot-and-order.component.css
isi-vista/MASC
311533238aa085792df10d38682b442966029581
[ "MIT" ]
1
2021-06-04T22:43:38.000Z
2021-06-04T22:43:38.000Z
angular-frontend/src/app/components/slot-and-order/slot-and-order.component.css
isi-vista/MASC
311533238aa085792df10d38682b442966029581
[ "MIT" ]
null
null
null
angular-frontend/src/app/components/slot-and-order/slot-and-order.component.css
isi-vista/MASC
311533238aa085792df10d38682b442966029581
[ "MIT" ]
null
null
null
#graph { height: 60vh; border: 1px solid #888; } .full-screen { height: 100vh; } .recenter { position: relative; top: -50px; } .slotting-table-body-sm { display: block; height: 45vh; max-height: 45vh; overflow-y: auto; } .slotting-table-body-lg { display: block; height: 78vh; max-height: 78vh; overflow-y: auto; }
12.321429
25
0.631884
701a854cf1962179a5125bc40813a9e7980cab6c
16,959
cpp
C++
hackathon/shengdian/MorphoHub_Release/GUI/morphohub_gui.cpp
zzhmark/vaa3d_tools
3ca418add85a59ac7e805d55a600b78330d7e53d
[ "MIT" ]
1
2021-12-27T19:14:03.000Z
2021-12-27T19:14:03.000Z
hackathon/shengdian/MorphoHub_Release/GUI/morphohub_gui.cpp
zzhmark/vaa3d_tools
3ca418add85a59ac7e805d55a600b78330d7e53d
[ "MIT" ]
null
null
null
hackathon/shengdian/MorphoHub_Release/GUI/morphohub_gui.cpp
zzhmark/vaa3d_tools
3ca418add85a59ac7e805d55a600b78330d7e53d
[ "MIT" ]
null
null
null
#include "morphohub_gui.h" morphoHub_GUI::morphoHub_GUI(V3DPluginCallback2 &callback,QWidget *parent) : QMainWindow(parent) { this->mainparent=parent; morphoHubcallback=&callback; setWindowTitle(tr("MorphoHub-GUI")); morphoHub_Init(); createActions(); createStatusBar(); createToolBar(); createMenus(); setMainLayout(); } /*Initialization of MorphoHub, load settings*/ void morphoHub_GUI::morphoHub_Init() { qDebug()<<"load settings"<<endl; QSettings settings("MorphoHub","Vaa3d"); if(settings.contains("dbpath")) mDB.loadDB(settings.value("dbpath").toString()); else toLogWindow("Please set or load the database path!"); } void morphoHub_GUI::createMenus() { //database menu dbMenu = menuBar()->addMenu(tr("&Database")); dbMenu->addAction(newDBAction); dbMenu->addAction(loadDBAction); dbMenu->addAction(setImgPathAction); dbMenu->addAction(settingsAction); //Management menu managementMenu=menuBar()->addMenu(tr("Management")); /*Image part*/ managementMenu->addAction(newImageAction); managementMenu->addAction(deleteImageAction); managementMenu->addAction(updateImageAction); managementMenu->addAction(download_Img_metadataAction); /*Soma part*/ managementMenu->addAction(newSomataAction); managementMenu->addAction(deleteSomataAction); managementMenu->addAction(updateSomataAction); managementMenu->addAction(download_Soma_metadataAction); /*Morphometry part*/ managementMenu->addAction(newMorphoAction); managementMenu->addAction(deleteMorphoAction); managementMenu->addAction(updateMorphoAction); managementMenu->addAction(download_Morpho_metadataAction); managementMenu->addAction(download_MorphoAction); //services menu servicesMenu = menuBar()->addMenu(tr("&Services")); servicesMenu->addAction(monitorAction); // servicesMenu->addAction(errorCheckAction); //window menu menuWindow = menuBar()->addMenu(tr("&Window")); //help menu helpMenu = menuBar()->addMenu(tr("&Help")); helpMenu->addAction(helpAction); } void morphoHub_GUI::createActions() { //action for database newDBAction = new QAction(tr("&Create Database"), this); newDBAction->setShortcuts(QKeySequence::New); newDBAction->setStatusTip(tr("Create a new database")); connect(newDBAction, SIGNAL(triggered()), this, SLOT(newDBAction_slot())); loadDBAction = new QAction(tr("&Load Database"), this); loadDBAction->setStatusTip(tr("load an exist database")); connect(loadDBAction, SIGNAL(triggered()), this, SLOT(loadDBAction_slot())); setImgPathAction=new QAction(tr("&Set Image Path"), this); setImgPathAction->setStatusTip(tr("load image path")); connect(setImgPathAction, SIGNAL(triggered()), this, SLOT(setImgPathAction_slot())); settingsAction = new QAction(tr("&Settings"), this); settingsAction->setStatusTip(tr("Default settings")); connect(settingsAction, SIGNAL(triggered()), this, SLOT(settingsAction_slot())); //action for Management /*Image part*/ newImageAction = new QAction(tr("&New Image"), this); newImageAction->setStatusTip(tr("Create a new image dataset")); connect(newImageAction, SIGNAL(triggered()), this, SLOT(newImageAction_slot())); deleteImageAction = new QAction(tr("&Delete Image"), this); deleteImageAction->setStatusTip(tr("Delete an existed image dataset")); connect(deleteImageAction, SIGNAL(triggered()), this, SLOT(deleteImageAction_slot())); updateImageAction = new QAction(tr("&Update Image Metadata"), this); connect(updateImageAction, SIGNAL(triggered()), this, SLOT(updateImageAction_slot())); download_Img_metadataAction = new QAction(tr("&Download Image Metadata"), this); connect(download_Img_metadataAction, SIGNAL(triggered()), this, SLOT(download_Img_metadataAction_slot())); /*Soma part*/ newSomataAction = new QAction(tr("&New Soma"), this); newSomataAction->setStatusTip(tr("Create a new soma metadata for specified Image")); connect(newSomataAction, SIGNAL(triggered()), this, SLOT(newSomataAction_slot())); deleteSomataAction = new QAction(tr("&Delete Soma"), this); deleteSomataAction->setStatusTip(tr("Delete an existed soma metadata of an image dataset")); connect(deleteSomataAction, SIGNAL(triggered()), this, SLOT(deleteSomataAction_slot())); updateSomataAction = new QAction(tr("&Update Soma"), this); updateSomataAction->setStatusTip(tr("Update soma metadata of an image dataset (from apo file)")); connect(updateSomataAction, SIGNAL(triggered()), this, SLOT(updateSomataAction_slot())); download_Soma_metadataAction = new QAction(tr("&Download Soma Metadata"), this); connect(download_Soma_metadataAction, SIGNAL(triggered()), this, SLOT(download_Soma_metadataAction_slot())); /*Morpho part*/ newMorphoAction = new QAction(tr("&New Morphometry"), this); newMorphoAction->setStatusTip(tr("Create a new morphometry")); connect(newMorphoAction, SIGNAL(triggered()), this, SLOT(newMorphoAction_slot())); deleteMorphoAction = new QAction(tr("&Delete Morphometry"), this); deleteMorphoAction->setStatusTip(tr("Delete an existed morphometry")); connect(deleteMorphoAction, SIGNAL(triggered()), this, SLOT(deleteMorphoAction_slot())); updateMorphoAction = new QAction(tr("&Update Morphometry"), this); connect(updateMorphoAction, SIGNAL(triggered()), this, SLOT(updateMorphoAction_slot())); download_Morpho_metadataAction = new QAction(tr("&Download Morphometry Metadata"), this); connect(download_Morpho_metadataAction, SIGNAL(triggered()), this, SLOT(download_Morpho_metadataAction_slot())); download_MorphoAction = new QAction(tr("&Download Morphometry data"), this); connect(download_MorphoAction, SIGNAL(triggered()), this, SLOT(download_MorphoAction_slot())); //action for services monitorAction=new QAction(tr("Monitoring"),this); monitorAction->setToolTip(tr("Monitoring of the database")); connect(monitorAction,SIGNAL(triggered()),this,SLOT(monitorAction_slot())); //Actions for window //action for Help helpAction=new QAction(tr("&Help"),this); helpAction->setToolTip(tr("MorphoHub documents")); connect(helpAction,SIGNAL(triggered()),this,SLOT(helpAction_slot())); } void morphoHub_GUI::createStatusBar() { statusLabel=new QLabel("MorphoHub"); statusLabel->setAlignment(Qt::AlignHCenter); statusLabel->setMinimumSize(statusLabel->sizeHint()); userStatusLabel=new QLabel("MorphoHub"); userStatusLabel->setAlignment(Qt::AlignRight); userStatusLabel->setMinimumSize(userStatusLabel->sizeHint()); statusBar()->addWidget(statusLabel); statusBar()->addWidget(userStatusLabel,1); } void morphoHub_GUI::updateStatusBar(const QString& showtext) { QString log="Input log error"; if(!showtext.isEmpty()) log=showtext; statusLabel->setText(log); toLogWindow(log); } void morphoHub_GUI::toLogWindow(const QString &logtext) { QString getlogtext=logtextedit->toPlainText(); QString showText=getlogtext+"\n"+logtext; logtextedit->setText(showText); logtextedit->moveCursor(QTextCursor::End); } void morphoHub_GUI::createToolBar() { dbToolBar=this->addToolBar(tr("DB")); dbToolBar->addAction(newDBAction); dbToolBar->addAction(loadDBAction); } void morphoHub_GUI::setMainLayout() { mainWidget=new QWidget(this); mainlayout=new QHBoxLayout(); logtextedit=new QTextEdit(this); logtextedit->setText(tr("Welcome to MorphoHub.")); MainLogwidget=new QDockWidget("Main Log"); MainLogwidget->setAllowedAreas(Qt::AllDockWidgetAreas); MainLogwidget->setFeatures(QDockWidget::DockWidgetMovable|QDockWidget::DockWidgetFloatable); MainLogwidget->setWidget(logtextedit); this->addDockWidget(Qt::BottomDockWidgetArea,MainLogwidget); mainWidget->setLayout(mainlayout); setCentralWidget(mainWidget); if(mDB.getDBpath().isEmpty()) toLogWindow("Warning: Please set the database path!"); else { toLogWindow(tr("Load Database: %1").arg(mDB.getDBpath())); updateStatusBar(tr("Database: %1").arg(mDB.getDBpath())); } } /*Services slot*/ void morphoHub_GUI::monitorAction_slot() { ScreenWall bigscreencontroldialog(mainparent); if(bigscreencontroldialog.exec()!=QDialog::Accepted) return; bigscreencontroldialog.update(); DisplayPARA controlPara=bigscreencontroldialog.controlPara; MethodForBigScreenDisplay(*morphoHubcallback,mainparent,controlPara); } /*login and logout*/ void morphoHub_GUI::newDBAction_slot() { //QMessageBox::information(this, tr("Information"), tr("Open")); QString title="choose path"; QString inputpath = QFileDialog::getExistingDirectory(this, title, "~/", QFileDialog::ShowDirsOnly |QFileDialog::DontResolveSymlinks); if(!inputpath.isEmpty()) { int reply; reply=QMessageBox::warning(this,"Database Initialization",QObject::tr("You are making a new database now!\n")+ QObject::tr("MorphoHub will create some folders for initialization.\n")+ QObject::tr("Are you sure you want to do this?\n"), QMessageBox::Ok,QMessageBox::Cancel); if(reply==QMessageBox::Cancel) return; QDir::setCurrent(inputpath); QDir dir(QDir::currentPath()); bool setflag=mDB.createDB(dir.absolutePath()); if(!setflag) return; updateStatusBar(tr("Database path : %1").arg(mDB.getDBpath())); QSettings settings("MorphoHub","Vaa3d"); settings.setValue("dbpath",mDB.getDBpath()); } } void morphoHub_GUI::loadDBAction_slot() { QString title="please select an existed database"; QString inputpath = QFileDialog::getExistingDirectory(this, title, "~/", QFileDialog::ShowDirsOnly |QFileDialog::DontResolveSymlinks); if(!inputpath.isEmpty()) { //converter dir path int reply; reply=QMessageBox::warning(this,"Database Initialization",QObject::tr("You are switching database now!\n")+ QObject::tr("MorphoHub will create some folders for initialization.\n")+ QObject::tr("Are you sure you want to do this?\n"), QMessageBox::Ok,QMessageBox::Cancel); if(reply==QMessageBox::Cancel) return; QDir::setCurrent(inputpath); QDir dir(QDir::currentPath()); bool setflag=mDB.createDB(dir.absolutePath()); if(!setflag) return; updateStatusBar(tr("Database path : %1").arg(mDB.getDBpath())); QSettings settings("MorphoHub","Vaa3d"); settings.setValue("dbpath",mDB.getDBpath()); } else { QMessageBox::warning(this,"Path Error","Can't find database path, Please reset it again!"); return; } } void morphoHub_GUI::setImgPathAction_slot() { QString title="please select image datasets path"; QString inputpath = QFileDialog::getExistingDirectory(this, title, "~/", QFileDialog::ShowDirsOnly |QFileDialog::DontResolveSymlinks); if(!inputpath.isEmpty()) { //converter dir path int reply; reply=QMessageBox::warning(this,"Database Initialization",QObject::tr("Set up image datasets path!\n"), QMessageBox::Ok,QMessageBox::Cancel); if(reply==QMessageBox::Cancel) return; QDir::setCurrent(inputpath); QDir dir(QDir::currentPath()); bool setflag=mDB.setImgDBpath(dir.absolutePath()); if(!setflag) return; toLogWindow(tr("Database image datasets path : %1").arg(mDB.getImgDBpath())); QSettings settings("MorphoHub","Vaa3d"); settings.setValue("imgpath",mDB.getImgDBpath()); } else { QMessageBox::warning(this,"Path Error","Can't find database path, Please reset it again!"); return; } } void morphoHub_GUI::settingsAction_slot() { /*Parameters that need to be initialized. * database: *dbpath,imgdbpath *db_init_1stlayer,db_init_2stlayer_metadata,db_init_3stlayer_metadata */ toLogWindow("hello, developing"); } /*Image part*/ void morphoHub_GUI::newImageAction_slot() { /*All i need is to, get the input-para-list of Image, and call the database function * 1. generate imageID (addImage) * 2. set metadata (updateImage), use a dialog for inputing para-list */ mImage newimage; NewImage_gui *newImage_gui=new NewImage_gui(newimage,this->mainparent); newImage_gui->setMinimumSize(200,300); newImage_gui->setMaximumSize(400,400); newImage_gui->setGeometry(50,50,800,500); newImage_gui->exec(); toLogWindow(newimage.getName()); } void morphoHub_GUI::deleteImageAction_slot() { toLogWindow("hello, developing"); } void morphoHub_GUI::updateImageAction_slot() { toLogWindow("hello, developing"); } void morphoHub_GUI::download_Img_metadataAction_slot() { toLogWindow("hello, developing"); } /*Soma part*/ void morphoHub_GUI::newSomataAction_slot() { toLogWindow("hello, developing"); } void morphoHub_GUI::deleteSomataAction_slot() { toLogWindow("hello, developing"); } void morphoHub_GUI::updateSomataAction_slot() { toLogWindow("hello, developing"); } void morphoHub_GUI::download_Soma_metadataAction_slot() { toLogWindow("hello, developing"); } /*Morphometry part*/ void morphoHub_GUI::newMorphoAction_slot() { } void morphoHub_GUI::deleteMorphoAction_slot() { } void morphoHub_GUI::updateMorphoAction_slot() { } void morphoHub_GUI::download_Morpho_metadataAction_slot() { } void morphoHub_GUI::download_MorphoAction_slot() { } void morphoHub_GUI::helpAction_slot() { QString helptext= "MorphoHub--PB scale multi-morphometry of single neurons for whole brains<br>" "This plugin is developed by Shengdian Jiang. 2019-10 <br>" "Email : shengdianjiang@seu.edu.cn or shengdianjiang@gmail.com <br>" "Version:1.2<br>" "<H2>Introduction: GUI </H2>" "MorphoHub handles four types of data, including image volumes, neuron morphology, software components and meta data of user interactions<br>" "1.Image volumes.<br>" "----2D and 3D image datasets,scan the list of image datasets from configuration.<br>" "----configuration name: <image_datasets_of_morphoHub.csv>.<br>" "-----------------.<br>" "2.function toolbar:<br>" " 2.1 NewDB and LoadDB button are placed at toolbar so that you can quickly setup the software environment.<br>" " 2.2 Serval fuctions of level control are also placed at toolbar.<br>" " 2.3 In order to manage the data, you have to log in to MorphoHub with a registered UserID.<br>" "3.Main view of MorphoHub is combined with three parts:<br>" " 3.1 Content Window.<br>" " Click one of the item at content, a new data tab about this level will be created at Data window.<br>" " Note: If this level is already created at Data Window, the data tab will be updated.<br>" " 3.2 Data Window.<br>" " This part will show the basic information of neurons of the chosen level.<br>" " 3.3 Main Log Window.<br>" " This window will show the operations you make.<br>" "<H2>Usage: Initialization</H2>" "1.Database<br>" " 1.1 New Database<br>" " 1.2 Load Database<br>" " 1.3 Settings<br>" "2.Level Control<br>" "3.Management<br>" " 3.1 Data Management<br>" " 3.2 User Management<br>" "4.Login<br>" "<H2>MorphoHub file system</H2>" "At morphoHub, there will be a configuration file for each brain datasets. and a collection table for all the datasets.<br>" "" ; QTextEdit *textEdit=new QTextEdit(helptext); textEdit->setWindowTitle("MorphoHub Document and Help"); textEdit->resize(850, 700); //use the QWidget function textEdit->setReadOnly(true); textEdit->setFontPointSize(16); textEdit->show(); } morphoHub_GUI::morphoHub_GUI() { } morphoHub_GUI::~morphoHub_GUI() { }
40.57177
154
0.663777
df8c1c61a707bdfd1ed88018196407e764186398
70
sh
Shell
intTests/test0036_global/test.sh
khotitekofe/saw-script
4f40375c493a650451f9c5db53068bd4d7fe8f34
[ "BSD-3-Clause" ]
1
2021-06-14T11:09:13.000Z
2021-06-14T11:09:13.000Z
intTests/test0036_global/test.sh
khotitekofe/saw-script
4f40375c493a650451f9c5db53068bd4d7fe8f34
[ "BSD-3-Clause" ]
null
null
null
intTests/test0036_global/test.sh
khotitekofe/saw-script
4f40375c493a650451f9c5db53068bd4d7fe8f34
[ "BSD-3-Clause" ]
null
null
null
set -e $SAW test.saw # These tests should fail ! $SAW test-fail.saw
10
25
0.685714
e8fd482e02b503e8a9ea4b53f002d5067bd451c3
1,545
go
Go
search.go
dogancelik/wallhaven-go
452e2bb716a4537fe7120bbe3ba26dcaf3eb5bf8
[ "MIT" ]
null
null
null
search.go
dogancelik/wallhaven-go
452e2bb716a4537fe7120bbe3ba26dcaf3eb5bf8
[ "MIT" ]
null
null
null
search.go
dogancelik/wallhaven-go
452e2bb716a4537fe7120bbe3ba26dcaf3eb5bf8
[ "MIT" ]
null
null
null
package wallhaven import ( "net/url" "strconv" "strings" "github.com/PuerkitoBio/goquery" ) const searchUrl string = "https://alpha.wallhaven.cc/search" const imageUrl string = "https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-" type Result struct { Id int Resolution string Favorites int PageUrl string ThumbnailUrl string ImageUrl string } func createQuery(opt *Options) string { query := "?" query += "q=" + url.QueryEscape(opt.Term) query += "&categories=" + opt.Categories.ToBits() query += "&purity=" + opt.Purity.ToBits() query += "&resolutions=" + url.QueryEscape(strings.Join(opt.Resolutions, ",")) query += "&sorting=" + opt.Sorting query += "&page=" + strconv.Itoa(opt.Page) return query } func Search(opt *Options) ([]Result, error) { results := []Result{} url := searchUrl + createQuery(opt) doc, err := goquery.NewDocument(url) if err != nil { return results, err } doc.Find("#thumbs figure").Each(func(i int, s *goquery.Selection) { id, _ := s.Attr("data-wallpaper-id") idAsInt, _ := strconv.Atoi(id) favs := s.Find(".wall-favs").Text() favsAsInt, _ := strconv.Atoi(favs) pageUrl, _ := s.Find(".preview").Attr("href") thumbUrl, _ := s.Find(".lazyload").Attr("data-src") result := Result{ Id: idAsInt, Resolution: s.Find(".wall-res").Text(), Favorites: favsAsInt, PageUrl: pageUrl, ThumbnailUrl: thumbUrl, ImageUrl: imageUrl + id + ".jpg", } results = append(results, result) }) return results, nil }
24.52381
84
0.645955
296d3a1ff65337ca9bd2fa7783423e339ef1afa2
615
rs
Rust
althea_kernel_interface/src/ping_check.rs
darkdrgn2k/althea_rs
a331a1b73339f770c1d2baa1c1e75e825493ed8f
[ "Apache-2.0" ]
null
null
null
althea_kernel_interface/src/ping_check.rs
darkdrgn2k/althea_rs
a331a1b73339f770c1d2baa1c1e75e825493ed8f
[ "Apache-2.0" ]
null
null
null
althea_kernel_interface/src/ping_check.rs
darkdrgn2k/althea_rs
a331a1b73339f770c1d2baa1c1e75e825493ed8f
[ "Apache-2.0" ]
null
null
null
use super::KernelInterface; use failure::Error; use std::net::IpAddr; impl dyn KernelInterface { //Pings a ipv6 address to determine if it's online pub fn ping_check_v6(&self, ip: &IpAddr) -> Result<bool, Error> { let result = self.run_command("ping6", &["-w1", "-W1", "-c1", &ip.to_string()]); Ok(result?.status.success()) } /// Pings a ipv4 address to determine if it's online pub fn ping_check_v4(&self, ip: &IpAddr) -> Result<bool, Error> { let result = self.run_command("ping", &["-w1", "-W1", "-c1", &ip.to_string()]); Ok(result?.status.success()) } }
36.176471
88
0.611382
df63606be25aa9efa10a70b263fb3af3bbf9e385
1,617
cshtml
C#
test/Landing.Hosting/Views/Shared/Error.cshtml
tahaipek/Hisar
f1683895aae94c95905e1132da55826bedfebb4a
[ "MIT" ]
19
2017-04-16T17:30:49.000Z
2022-02-19T06:38:59.000Z
test/Landing.Hosting/Views/Shared/Error.cshtml
tahaipek/Hisar
f1683895aae94c95905e1132da55826bedfebb4a
[ "MIT" ]
3
2017-04-17T08:32:27.000Z
2018-04-01T14:40:51.000Z
test/Landing.Hosting/Views/Shared/Error.cshtml
tahaipek/Hisar
f1683895aae94c95905e1132da55826bedfebb4a
[ "MIT" ]
9
2017-05-11T19:28:48.000Z
2018-10-04T22:28:29.000Z
@model BasicExceptionContext @if (Context == null) { <h1>Context Null</h1> } @{ var message = ""; var details = ""; var logGuid = ""; object obj = null; if (Context.Items.TryGetValue(nameof(BasicExceptionContext), out obj)) { var modelContext = obj as BasicExceptionContext; if (modelContext != null) { logGuid = modelContext.LogGuid; message = !string.IsNullOrEmpty(modelContext.Message) ? modelContext.Message : "An error occurred!"; details = !string.IsNullOrEmpty(modelContext.ExceptionDetail) ? modelContext.ExceptionDetail : ""; } } } <div id="content"> <div class="row"> <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12"> <div class="row"> <div class="col-sm-12"> <div class="text-center error-box"> <h1 class="error-text tada animated"><i class="fa fa-times-circle text-danger error-icon-shadow"></i> Error 500</h1> <h2 class="font-xl"><strong>@message</strong></h2> <br /> <p class="lead semi-bold"> <strong>An error occurred!</strong> <br /> @details <br /> Working on it! <br /> Error Code: <strong>@logGuid</strong> </p> </div> </div> </div> </div> </div> </div>
33.6875
140
0.461967
c6ff88dab92a030c94aa2e8cf33241db296cfb94
1,427
rb
Ruby
app/controllers/comments_controller.rb
bignaczewski/anonynet
99cdf57e0c5025e14f97ee41d19c54b9d27b4a00
[ "Ruby" ]
null
null
null
app/controllers/comments_controller.rb
bignaczewski/anonynet
99cdf57e0c5025e14f97ee41d19c54b9d27b4a00
[ "Ruby" ]
null
null
null
app/controllers/comments_controller.rb
bignaczewski/anonynet
99cdf57e0c5025e14f97ee41d19c54b9d27b4a00
[ "Ruby" ]
null
null
null
class CommentsController < ApplicationController respond_to :js def create @post = Post.find(params[:comment][:post_id]) @comment = Comment.new(params[:comment].permit(:content, :content_html, :post_id), content_html: Obscenity.sanitize(params[:comment][:content])) @comment.user_id = current_user.id if current_user @comment.save respond_with(@comment) end def report_comment @comment = Comment.find(params[:id]) hc = HiddenComment.new(user_id: current_user.id, comment_id: @comment.id) hc.save # below: if three combined comments and posts from user are equal 3 or more, this user will be hidden for current_user if @comment.user_id and ((HiddenPost.where(user_id: current_user.id).where(post_id: Post.where(user_id: @comment.user_id).ids) .size+HiddenComment.where(user_id: current_user.id) .where(comment_id: Comment.where(user_id: @comment.user_id).ids).size) >= 3) hu = HiddenUser.new(user_id: current_user.id, hidden_user_id: @comment.user_id) hu.save if HiddenUser.where(hidden_user_id: @comment.user_id).size >= 3 bu = User.find(@comment.user_id) bu.banned = true bu.save end end if HiddenComment.where(comment_id: @comment.id).size >= 3 @comment.hidden=true @comment.save end end end
36.589744
130
0.653118
fa513e96bae96387b9d086d039ead11fd11f5987
1,379
swift
Swift
Sources/SwiftSemantics/Supporting Types/Modifier.swift
chriseidhof/SwiftSemantics
70ab04ac51b570ce9f71c09aca4b661829bca5ae
[ "MIT" ]
null
null
null
Sources/SwiftSemantics/Supporting Types/Modifier.swift
chriseidhof/SwiftSemantics
70ab04ac51b570ce9f71c09aca4b661829bca5ae
[ "MIT" ]
null
null
null
Sources/SwiftSemantics/Supporting Types/Modifier.swift
chriseidhof/SwiftSemantics
70ab04ac51b570ce9f71c09aca4b661829bca5ae
[ "MIT" ]
null
null
null
import SwiftSyntax /** A declaration modifier. A declaration may have one or more modifiers to specify access control (`private` / `public` / etc.), declare a type member (`class` / `static`), or designate its mutability (`nonmutating`). A declaration modifier may specify an additional detail within enclosing parentheses (`()`) following its name. For example, the following property declaration has two modifiers: ```swift public private(set) var title: String ``` - The first modifier has a `name` equal to `"public"`, and a nil `detail` - The second modifier has a `name` equal to `"private"` and a `detail` equal to `"set"` */ public struct Modifier: Hashable, Codable { /// The declaration modifier name. public let name: String /// The modifier detail, if any. public let detail: String? } // MARK: - ExpressibleBySyntax extension Modifier: ExpressibleBySyntax { /// Creates an instance initialized with the given syntax node. public init(_ node: DeclModifierSyntax) { name = node.name.withoutTrivia().text detail = node.detail?.description } } // MARK: - CustomStringConvertible extension Modifier: CustomStringConvertible { public var description: String { if let detail = detail { return "\(name)(\(detail))" } else { return name } } }
25.072727
67
0.672226
8a28d60227d1b697fcdf8424378692dcfbedf399
3,769
swift
Swift
sinaWeibo/sinaWeibo/Classes/Home/JKRepostCell.swift
zhangjk4859/MyWeiBoProject
afded56e550c8187198253484ebc1ab7c2a0279a
[ "MIT" ]
null
null
null
sinaWeibo/sinaWeibo/Classes/Home/JKRepostCell.swift
zhangjk4859/MyWeiBoProject
afded56e550c8187198253484ebc1ab7c2a0279a
[ "MIT" ]
null
null
null
sinaWeibo/sinaWeibo/Classes/Home/JKRepostCell.swift
zhangjk4859/MyWeiBoProject
afded56e550c8187198253484ebc1ab7c2a0279a
[ "MIT" ]
null
null
null
// // JKRepostCell.swift // sinaWeibo // // Created by 张俊凯 on 16/7/17. // Copyright © 2016年 张俊凯. All rights reserved. // import UIKit import KILabel class JKRepostCell: JKHomeCell { override var status: JKStatus? { didSet{ let name = status?.retweeted_status?.user?.name ?? "" let text = status?.retweeted_status?.text ?? "" forwardLabel.attributedText = EmoticonPackage.emoticonString("@" + name + ": " + text) } } //父类的设置子视图方法,重写 override func setupUI() { super.setupUI() //1.添加子控件 //1.1按钮在配图下面 contentView.insertSubview(forwardButton, belowSubview: pictureView) //1.2正文在按钮上面 contentView.insertSubview(forwardLabel, aboveSubview: forwardButton) // 2.布局子控件 // 2.1布局转发背景 forwardButton.jk_AlignVertical(type: JK_AlignType.BottomLeft, referView: contentLabel, size: nil, offset: CGPoint(x: -10, y: 10)) forwardButton.jk_AlignVertical(type: JK_AlignType.TopRight, referView: footerView, size: nil) // 2.2布局转发正文 forwardLabel.text = "fjdskljflkdsjflksdjlkfdsjlfjdslfjlkds" forwardLabel.jk_AlignInner(type: JK_AlignType.TopLeft, referView: forwardButton, size: nil, offset: CGPoint(x: 10, y: 10)) // 2.3重新调整转发配图的位置,配图放到转发的正文下面 let cons = pictureView.jk_AlignVertical(type: JK_AlignType.BottomLeft, referView: forwardLabel, size: CGSize(width: 290, height: 290), offset: CGPoint(x: 0, y: 10)) pictureWidthCons = pictureView.jk_Constraint(cons, attribute: NSLayoutAttribute.Width) pictureHeightCons = pictureView.jk_Constraint(cons, attribute: NSLayoutAttribute.Height) pictureTopCons = pictureView.jk_Constraint(cons, attribute: NSLayoutAttribute.Top) } // MARK: - 懒加载 //转发内容label显示正文 // private lazy var forwardLabel: UILabel = { // let label = UILabel.createLabel(UIColor.darkGrayColor(), fontSize: 15) // label.numberOfLines = 0 // label.preferredMaxLayoutWidth = UIScreen.mainScreen().bounds.width - 20 // return label // }() //可以实现label内容点击网页链接和高亮 private lazy var forwardLabel: UILabel = { let label = KILabel() label.textColor = UIColor.darkGrayColor() label.font = UIFont.systemFontOfSize(15) label.numberOfLines = 0 label.preferredMaxLayoutWidth = UIScreen.mainScreen().bounds.width - 20 // 监听URL label.urlLinkTapHandler = { (label, string, range) in // //只能调用类方法,静态方法 // JKRepostCell.openWebView(string) } return label }() //找view的所在控制器 func parentViewController() -> UIViewController? { for (let next = self.superview; next != nil; next?.superview) { let ctr = next?.nextResponder() if (ctr is UIViewController) { return ctr as? UIViewController } } return nil } //接受KILabel的字符串,弹出控制器 func openWebView(string : String) { let vc = parentViewController() let webVC = JKWelcomVC() vc?.navigationController?.pushViewController(webVC, animated: true) } //整个cell是一个button,可以点击 private lazy var forwardButton: UIButton = { let btn = UIButton() btn.backgroundColor = UIColor(white: 0.9, alpha: 1.0) return btn }() }
31.408333
172
0.570708
46c799ea72fbcc7d7f3a5faadc31f84b063b2f48
887
py
Python
src/users/models/componentsschemasmicrosoft_graph_inferenceclassificationallof1.py
peombwa/Sample-Graph-Python-Client
3396f531fbe6bb40a740767c4e31aee95a3b932e
[ "MIT" ]
null
null
null
src/users/models/componentsschemasmicrosoft_graph_inferenceclassificationallof1.py
peombwa/Sample-Graph-Python-Client
3396f531fbe6bb40a740767c4e31aee95a3b932e
[ "MIT" ]
null
null
null
src/users/models/componentsschemasmicrosoft_graph_inferenceclassificationallof1.py
peombwa/Sample-Graph-Python-Client
3396f531fbe6bb40a740767c4e31aee95a3b932e
[ "MIT" ]
null
null
null
# coding=utf-8 # -------------------------------------------------------------------------- # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- from msrest.serialization import Model class ComponentsschemasmicrosoftGraphInferenceclassificationallof1(Model): """inferenceClassification. :param overrides: :type overrides: list[~users.models.MicrosoftgraphinferenceClassificationOverride] """ _attribute_map = { 'overrides': {'key': 'overrides', 'type': '[MicrosoftgraphinferenceClassificationOverride]'}, } def __init__(self, overrides=None): super(ComponentsschemasmicrosoftGraphInferenceclassificationallof1, self).__init__() self.overrides = overrides
34.115385
101
0.617813
05d42a2a49213688cfdecdb536afe80161c44f8b
371
py
Python
code/examples/benchmark.py
megbedell/spectro-pessimism
e3d549287b1023f9790a156afab50551be93222a
[ "MIT" ]
null
null
null
code/examples/benchmark.py
megbedell/spectro-pessimism
e3d549287b1023f9790a156afab50551be93222a
[ "MIT" ]
4
2017-12-09T17:01:34.000Z
2017-12-16T16:59:05.000Z
code/examples/benchmark.py
megbedell/spectro-pessimism
e3d549287b1023f9790a156afab50551be93222a
[ "MIT" ]
1
2017-12-10T23:34:32.000Z
2017-12-10T23:34:32.000Z
# simple benchmark from generator import * import time # number of simulated photons N = int(5E7) t1 = time.time() spectrum = Etalon() spectrograph = MaroonX() generate_rv_series(spectrograph, spectrum, [0.], photons_per_spectrum=N) t2 = time.time() print("Total time for tracing: {:.2f} s".format(t2-t1)) print("Simulating {:.2E} photons per second".format(N/(t2-t1)))
26.5
72
0.725067
2595524c383d3bb539b7825d66c99d6f6f9e90ae
5,162
js
JavaScript
src/components/pages/Index/Index.js
fabricio7p/Ikebana-App-Frontend
1c7608afb29d6386ad1df86087ab529928cdb742
[ "MIT" ]
1
2020-08-14T19:42:54.000Z
2020-08-14T19:42:54.000Z
src/components/pages/Index/Index.js
fabricio7p/Ikebana-App-Frontend
1c7608afb29d6386ad1df86087ab529928cdb742
[ "MIT" ]
null
null
null
src/components/pages/Index/Index.js
fabricio7p/Ikebana-App-Frontend
1c7608afb29d6386ad1df86087ab529928cdb742
[ "MIT" ]
null
null
null
import React, { useEffect } from 'react'; import { Link } from 'react-router-dom'; import './styles.scss'; export default function Index() { return( <div class="index"> <div className="index-main"> <img className="underlay-index" src="https://ikebana-app-content.s3-sa-east-1.amazonaws.com/static/mainlogo_transparent_notext.png" alt="Logo" /> <div className="index-main__header"> <div className="index-main__header--logo"> <img className="index-main__header--logo--img" src="https://ikebana-app-content.s3-sa-east-1.amazonaws.com/static/mainlogo_transparent_notext.png" alt="Logo" /> <p className="index-main__header--logo--text">sanguetsu</p> </div> <ul className="index-main__header--links"> <div className="index-main__header--links--hamburguer"> <div></div> </div> <li className="index-main__header--links--el"><a target="_blank" href="https://www.fmo.org.br/">Fundação</a></li> <li className="index-main__header--links--el"><a target="_blank" href="https://www.fmo.org.br/noticias/">Noticias</a></li> <li className="index-main__header--links--el"><a target="_blank" href="http://loja.fmo.org.br/">Loja</a></li> <li className="index-main__header--links--el"><a target="_blank" href="https://www.fmo.org.br/a-fmo/">Sobre</a></li> </ul> </div> <div className="index-main__content"> <h1 className="index-main__content--title1">ikebana</h1> <h1 className="index-main__content--title2">sanguetsu</h1> <p className="index-main__content--desc">Conecte-se com praticantes do método Sanguetsu e compartilhe conhecimento.</p> </div> <div className="index-main__buttons"> <Link to="/login"> <button className="index-main__buttons--login"> <div className="btn-wrapper"> <i className="material-icons">how_to_reg</i> <p className="index-main__buttons--login--text">Entrar</p> </div> </button> </Link> <Link to="/explore"> <button className="index-main__buttons--explore"> <div className="btn-wrapper"> <i className="material-icons">apps</i> <p className="index-main__buttons--explore--text">Explorar</p> </div> </button> </Link> </div> </div> <div className="index-footer-landing"> <ul className="index-footer-landing__social"> <li className="index-footer-landing__social--link"> <a target="_blank" href="https://www.fmo.org.br/"> <img className="footer-logo" src={"https://ikebana-app-content.s3-sa-east-1."+ "amazonaws.com/static/logotipo_notext.png"} alt="FMO" /> </a> </li> <li className="index-footer-landing__social--link"> <a target="_blank" href="https://www.facebook.com/FundacaoMokitiOkadaMOA/"> <img className="footer-logo" src={"https://ikebana-app-content.s3-sa-east-1.amazon"+ "aws.com/static/facebook.svg"} alt="facebook" /> </a> </li> <li className="index-footer-landing__social--link"> <a href={"https://www.youtube.com/channel/UCJg-nQqbJ"+ "5v-CVGVqevrIKQ"} target="_blank"><img className="footer-logo" src={"https://ikebana-app-content.s3-sa-east-1.amazon"+ "aws.com/static/youtube.svg"} alt="youtube" /> </a> </li> <li className="index-footer-landing__social--link"> <a href={"https://www.instagram.com/fundacaomokitiokada/"} target="_blank"><img className="footer-logo" src={"https://ikebana-app-content.s3-sa-east-1.amazon"+ "aws.com/static/instagram.svg"} alt="youtube" /> </a> </li> </ul> </div> </div> ); }
56.725275
184
0.450988
2478d4c1da0ab833ca9fd33f0daebf1bf334773a
6,965
php
PHP
resources/views/admin/languages/list.blade.php
NguyenQuocTruong14110425/dongtien
ff7eff435a3142c9c629e3b354e20f86403673ac
[ "MIT" ]
null
null
null
resources/views/admin/languages/list.blade.php
NguyenQuocTruong14110425/dongtien
ff7eff435a3142c9c629e3b354e20f86403673ac
[ "MIT" ]
null
null
null
resources/views/admin/languages/list.blade.php
NguyenQuocTruong14110425/dongtien
ff7eff435a3142c9c629e3b354e20f86403673ac
[ "MIT" ]
null
null
null
@extends('layout_admin.layout') @section('header-admin') <title>dashboad</title> @endsection @section('content-admin') <div class="pannel"> <div class="pannel-title"> <div class="current-page">@lang('component.languages_list_title')</div> <li><a href="{{URL::to('admin/dashboard')}}" title="admin/dashboad">@lang('component.dashboard')</a></li> <li><a href="{{URL::to('admin/languages/')}}" title="admin/news">@lang('component.languages')</a></li> </div> <div class="right-action"> <a type="buttons" href="javascript:void(0)" class="btn btn-dropdown" data-toggle="modal" data-target="#createLanguages"> <i class="fas fa-plus"></i> </a> <a type="buttons" href="{{URL::to('admin/languages/all-trash')}}" class="btn btn-dropdown"> <i class="fas fa-trash"></i> </a> <button type="button" class="btn btn-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <i class="fas fa-th-list"></i> </button> <div class="dropdown-menu" aria-labelledby="dropdownMenuButton"> <a class="dropdown-item" href="#"><i class="fas fa-question-circle"></i>Help</a> <a class="dropdown-item" href="#"><i class="fab fa-stack-overflow"></i> Activity</a> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="card"> <div class="card-title"> <ul class="nav nav-tabs"> <li> <a class="active show" data-toggle="tab" href="#list"> <i class="fas fa-clipboard-list"></i>@lang('component.languages_list_title')</a> </li> <li> <a data-toggle="tab" href="#trash"> <i class="fab fa-firstdraft"></i>@lang('component.draft')</a></li> </ul> </div> <div class="card-body"> <div class="table-basic"> <div class="tab-content"> <div id="list" class="tab-pane fade in active show"> <table id="listtable" class="table table-bordered table-striped"> <thead> <th>@lang('component.languages_description')</th> <th>@lang('component.languages_code')</th> <th></th> </thead> <tbody> @foreach($languages as $value) <tr> <td>{{$value->lang_description}}</td> <td>{{$value->lang_code}}</td> <td> <a type="buttons" tages="edit" href="{{URL::to('admin/languages/update/' . $value->id)}}">update</a> <a type="buttons" tages="delete" href="{{URL::to('admin/languages/trash/' . $value->id)}}">trash</a> <a type="buttons" tages="info" href="{{URL::to('admin/languages/detail/' . $value->id)}}">detail</a> </td> </tr> @endforeach </tbody> </table> </div> <div id="trash" class="tab-pane fade"> <table id="trashtable" class="table table-bordered table-striped"> <thead> <th>@lang('component.languages_description')</th> <th>@lang('component.languages_code')</th> <th></th> </thead> <tbody> </tbody> </table> </div> </div> </div> </div> </div> </div> <!-- create language --> <div id="createLanguages" class="modal fade" role="dialog"> <div class="modal-dialog"> <!-- Modal content--> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title">@lang('component.languages_create_title')</h4> </div> <form class="form-basic" action="{{URL::to('admin/languages/create')}}" method="POST"> @csrf <div class="modal-body"> <div class="form-group"> <label for="description">@lang('component.languages_description'):</label> <input type="text" class="form-control" id="description" name="description"/> </div> <div class="form-group"> <label for="lang_code">@lang('component.languages_code'):</label> <input type="text" class="form-control" id="lang_code" name="lang_code"/> </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="submit" class="btn btn-info">@lang('button.languages_create')</button> </div> </form> </div> </div> </div> <!-- end card form table striped --> </div> <script type="text/javascript"> $( document ).ready(function() { var method = { search: true, sort: true, pagin: true, countRow: true, show: [10,25,50,100], lang: '{{ App::getLocale()}}', selectedId: false, sortField :[ "@lang('component.languages_description')", "@lang('component.languages_code')" ] } $('#listtable').DataTableCustom(method); }); </script> @endsection
51.592593
149
0.398134
a3738f313d63dd2447a2785b59de43cbf1ae1bd1
2,640
java
Java
x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/expression/function/Function.java
ZenMX/elasticsearch
fb08c46e9afb6948098eae10c02e652dc3c135d0
[ "Apache-2.0" ]
3
2020-07-09T19:00:34.000Z
2020-07-09T19:01:20.000Z
x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/expression/function/Function.java
ZenMX/elasticsearch
fb08c46e9afb6948098eae10c02e652dc3c135d0
[ "Apache-2.0" ]
3
2020-07-29T08:58:34.000Z
2020-07-31T19:03:50.000Z
x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/expression/function/Function.java
ZenMX/elasticsearch
fb08c46e9afb6948098eae10c02e652dc3c135d0
[ "Apache-2.0" ]
2
2021-08-20T05:42:04.000Z
2021-08-20T05:44:41.000Z
/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ package org.elasticsearch.xpack.ql.expression.function; import org.elasticsearch.xpack.ql.expression.Expression; import org.elasticsearch.xpack.ql.expression.Expressions; import org.elasticsearch.xpack.ql.expression.Nullability; import org.elasticsearch.xpack.ql.expression.gen.pipeline.ConstantInput; import org.elasticsearch.xpack.ql.expression.gen.pipeline.Pipe; import org.elasticsearch.xpack.ql.expression.gen.script.ScriptTemplate; import org.elasticsearch.xpack.ql.tree.Source; import java.util.List; import java.util.Locale; import java.util.Objects; import java.util.StringJoiner; /** * Any SQL expression with parentheses, like {@code MAX()}, or {@code ABS()}. A * function is always a {@code NamedExpression}. */ public abstract class Function extends Expression { private final String functionName = getClass().getSimpleName().toUpperCase(Locale.ROOT); private Pipe lazyPipe = null; // TODO: Functions supporting distinct should add a dedicated constructor Location, List<Expression>, boolean protected Function(Source source, List<Expression> children) { super(source, children); } public final List<Expression> arguments() { return children(); } public String functionName() { return functionName; } @Override public Nullability nullable() { return Expressions.nullable(children()); } @Override public int hashCode() { return Objects.hash(getClass(), children()); } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } Function other = (Function) obj; return Objects.equals(children(), other.children()); } public Pipe asPipe() { if (lazyPipe == null) { lazyPipe = foldable() ? new ConstantInput(source(), this, fold()) : makePipe(); } return lazyPipe; } protected Pipe makePipe() { throw new UnsupportedOperationException(); } @Override public String nodeString() { StringJoiner sj = new StringJoiner(",", functionName() + "(", ")"); for (Expression ex : arguments()) { sj.add(ex.nodeString()); } return sj.toString(); } public abstract ScriptTemplate asScript(); }
29.662921
113
0.668182
a9ebe70cca56c1bb2594708fd4981f424ea0e80a
72,879
php
PHP
module/Shipment/config/module.config.php
Profilan/dutchfurniturefulfilment
7cfe5651c999f6fb34140f59286907b1bff93824
[ "BSD-3-Clause" ]
null
null
null
module/Shipment/config/module.config.php
Profilan/dutchfurniturefulfilment
7cfe5651c999f6fb34140f59286907b1bff93824
[ "BSD-3-Clause" ]
null
null
null
module/Shipment/config/module.config.php
Profilan/dutchfurniturefulfilment
7cfe5651c999f6fb34140f59286907b1bff93824
[ "BSD-3-Clause" ]
null
null
null
<?php return [ 'router' => [ 'routes' => [ 'shipment.rest.doctrine.purchase-order' => [ 'type' => 'Segment', 'options' => [ 'route' => '/api/purchase-order[/:ordernr]', 'defaults' => [ 'controller' => 'Shipment\\V1\\Rest\\PurchaseOrder\\Controller', ], ], ], 'shipment.rest.doctrine.purchase-orderline' => [ 'type' => 'Segment', 'options' => [ 'route' => '/api/purchase-orderline[/:orderlineid]', 'defaults' => [ 'controller' => 'Shipment\\V1\\Rest\\PurchaseOrderline\\Controller', ], ], ], 'shipment.rest.doctrine.supplier' => [ 'type' => 'Segment', 'options' => [ 'route' => '/api/supplier[/:suppliercode]', 'defaults' => [ 'controller' => 'Shipment\\V1\\Rest\\Supplier\\Controller', ], ], ], 'shipment.rest.doctrine.stock-transaction' => [ 'type' => 'Segment', 'options' => [ 'route' => '/api/stock-transaction[/:id]', 'defaults' => [ 'controller' => 'Shipment\\V1\\Rest\\StockTransaction\\Controller', ], ], ], 'shipment.rest.doctrine.sales-orderline-status' => [ 'type' => 'Segment', 'options' => [ 'route' => '/api/sales-orderline-status[/:id]', 'defaults' => [ 'controller' => 'Shipment\\V1\\Rest\\SalesOrderlineStatus\\Controller', ], ], ], 'shipment.rest.doctrine.sales-orderline-pick-quantity' => [ 'type' => 'Segment', 'options' => [ 'route' => '/api/sales-orderline-pick-quantity[/:sales_orderline_pick_quantity_id]', 'defaults' => [ 'controller' => 'Shipment\\V1\\Rest\\SalesOrderlinePickQuantity\\Controller', ], ], ], 'shipment.rest.doctrine.sales-order-shipment' => [ 'type' => 'Segment', 'options' => [ 'route' => '/api/sales-order-shipment[/:sales_order_shipment_id]', 'defaults' => [ 'controller' => 'Shipment\\V1\\Rest\\SalesOrderShipment\\Controller', ], ], ], 'shipment.rest.doctrine.status-code' => [ 'type' => 'Segment', 'options' => [ 'route' => '/api/status-code[/:status_code_id]', 'defaults' => [ 'controller' => 'Shipment\\V1\\Rest\\StatusCode\\Controller', ], ], ], 'shipment.rest.doctrine.delivery-appointment' => [ 'type' => 'Segment', 'options' => [ 'route' => '/api/delivery-appointment[/:delivery_appointment_id]', 'defaults' => [ 'controller' => 'Shipment\\V1\\Rest\\DeliveryAppointment\\Controller', ], ], ], ], ], 'zf-versioning' => [ 'uri' => [ 0 => 'shipment.rest.doctrine.purchase-order', 1 => 'shipment.rest.doctrine.purchase-orderline', 2 => 'shipment.rest.doctrine.supplier', 3 => 'shipment.rest.doctrine.stock-transaction', 4 => 'shipment.rest.doctrine.sales-orderline-status', 5 => 'shipment.rest.doctrine.sales-orderline-pick-quantity', 6 => 'shipment.rest.doctrine.sales-order-shipment', 7 => 'shipment.rest.doctrine.status-code', 8 => 'shipment.rest.doctrine.delivery-appointment', ], ], 'zf-rest' => [ 'Shipment\\V1\\Rest\\PurchaseOrder\\Controller' => [ 'listener' => \Shipment\V1\Rest\PurchaseOrder\PurchaseOrderResource::class, 'route_name' => 'shipment.rest.doctrine.purchase-order', 'route_identifier_name' => 'ordernr', 'entity_identifier_name' => 'ordernr', 'collection_name' => 'purchase_order', 'entity_http_methods' => [ 0 => 'GET', ], 'collection_http_methods' => [ 0 => 'GET', ], 'collection_query_whitelist' => [ 0 => 'suppliercode', 1 => 'carrier', 2 => 'searchstring', ], 'page_size' => 25, 'page_size_param' => 'limit', 'entity_class' => \Application\Entity\Shipment\PurchaseOrder::class, 'collection_class' => \Shipment\V1\Rest\PurchaseOrder\PurchaseOrderCollection::class, 'service_name' => 'PurchaseOrder', ], 'Shipment\\V1\\Rest\\PurchaseOrderline\\Controller' => [ 'listener' => \Shipment\V1\Rest\PurchaseOrderline\PurchaseOrderlineResource::class, 'route_name' => 'shipment.rest.doctrine.purchase-orderline', 'route_identifier_name' => 'orderlineid', 'entity_identifier_name' => 'orderlineid', 'collection_name' => 'purchase_orderline', 'entity_http_methods' => [ 0 => 'GET', ], 'collection_http_methods' => [ 0 => 'GET', ], 'collection_query_whitelist' => [ 0 => 'carrier', 1 => 'ordernr', 2 => 'suppliercode', ], 'page_size' => 25, 'page_size_param' => 'limit', 'entity_class' => \Application\Entity\Shipment\PurchaseOrderline::class, 'collection_class' => \Shipment\V1\Rest\PurchaseOrderline\PurchaseOrderlineCollection::class, 'service_name' => 'PurchaseOrderline', ], 'Shipment\\V1\\Rest\\Supplier\\Controller' => [ 'listener' => \Shipment\V1\Rest\Supplier\SupplierResource::class, 'route_name' => 'shipment.rest.doctrine.supplier', 'route_identifier_name' => 'suppliercode', 'entity_identifier_name' => 'suppliercode', 'collection_name' => 'supplier', 'entity_http_methods' => [ 0 => 'GET', ], 'collection_http_methods' => [ 0 => 'GET', ], 'collection_query_whitelist' => [ 0 => 'carrier', 1 => 'searchstring', ], 'page_size' => 25, 'page_size_param' => 'limit', 'entity_class' => \Application\Entity\Shipment\Supplier::class, 'collection_class' => \Shipment\V1\Rest\Supplier\SupplierCollection::class, 'service_name' => 'Supplier', ], 'Shipment\\V1\\Rest\\StockTransaction\\Controller' => [ 'listener' => \Shipment\V1\Rest\StockTransaction\StockTransactionResource::class, 'route_name' => 'shipment.rest.doctrine.stock-transaction', 'route_identifier_name' => 'id', 'entity_identifier_name' => 'id', 'collection_name' => 'stock_transaction', 'entity_http_methods' => [], 'collection_http_methods' => [ 0 => 'POST', ], 'collection_query_whitelist' => [], 'page_size' => 25, 'page_size_param' => null, 'entity_class' => \Application\Entity\Shipment\StockTransaction::class, 'collection_class' => \Shipment\V1\Rest\StockTransaction\StockTransactionCollection::class, 'service_name' => 'StockTransaction', ], 'Shipment\\V1\\Rest\\SalesOrderlineStatus\\Controller' => [ 'listener' => \Shipment\V1\Rest\SalesOrderlineStatus\SalesOrderlineStatusResource::class, 'route_name' => 'shipment.rest.doctrine.sales-orderline-status', 'route_identifier_name' => 'id', 'entity_identifier_name' => 'id', 'collection_name' => 'sales_orderline_status', 'entity_http_methods' => [], 'collection_http_methods' => [ 0 => 'POST', ], 'collection_query_whitelist' => [], 'page_size' => 25, 'page_size_param' => null, 'entity_class' => \Application\Entity\Shipment\SalesOrderlineStatus::class, 'collection_class' => \Shipment\V1\Rest\SalesOrderlineStatus\SalesOrderlineStatusCollection::class, 'service_name' => 'SalesOrderlineStatus', ], 'Shipment\\V1\\Rest\\SalesOrderlinePickQuantity\\Controller' => [ 'listener' => \Shipment\V1\Rest\SalesOrderlinePickQuantity\SalesOrderlinePickQuantityResource::class, 'route_name' => 'shipment.rest.doctrine.sales-orderline-pick-quantity', 'route_identifier_name' => 'sales_orderline_pick_quantity_id', 'entity_identifier_name' => 'id', 'collection_name' => 'sales_orderline_pick_quantity', 'entity_http_methods' => [], 'collection_http_methods' => [ 0 => 'POST', ], 'collection_query_whitelist' => [], 'page_size' => 25, 'page_size_param' => null, 'entity_class' => \Application\Entity\Shipment\SalesOrderlinePickQuantity::class, 'collection_class' => \Shipment\V1\Rest\SalesOrderlinePickQuantity\SalesOrderlinePickQuantityCollection::class, 'service_name' => 'SalesOrderlinePickQuantity', ], 'Shipment\\V1\\Rest\\SalesOrderShipment\\Controller' => [ 'listener' => \Shipment\V1\Rest\SalesOrderShipment\SalesOrderShipmentResource::class, 'route_name' => 'shipment.rest.doctrine.sales-order-shipment', 'route_identifier_name' => 'sales_order_shipment_id', 'entity_identifier_name' => 'id', 'collection_name' => 'sales_order_shipment', 'entity_http_methods' => [ 0 => 'GET', 1 => 'PUT', ], 'collection_http_methods' => [ 0 => 'GET', 1 => 'POST', ], 'collection_query_whitelist' => [], 'page_size' => 25, 'page_size_param' => null, 'entity_class' => \Application\Entity\Shipment\SalesOrderShipment::class, 'collection_class' => \Shipment\V1\Rest\SalesOrderShipment\SalesOrderShipmentCollection::class, 'service_name' => 'SalesOrderShipment', ], 'Shipment\\V1\\Rest\\StatusCode\\Controller' => [ 'listener' => \Shipment\V1\Rest\StatusCode\StatusCodeResource::class, 'route_name' => 'shipment.rest.doctrine.status-code', 'route_identifier_name' => 'status_code_id', 'entity_identifier_name' => 'id', 'collection_name' => 'status_code', 'entity_http_methods' => [ 0 => 'GET', ], 'collection_http_methods' => [ 0 => 'GET', ], 'collection_query_whitelist' => [ 0 => 'tableName', ], 'page_size' => 25, 'page_size_param' => null, 'entity_class' => \Application\Entity\Shipment\StatusCode::class, 'collection_class' => \Shipment\V1\Rest\StatusCode\StatusCodeCollection::class, 'service_name' => 'StatusCode', ], 'Shipment\\V1\\Rest\\DeliveryAppointment\\Controller' => [ 'listener' => \Shipment\V1\Rest\DeliveryAppointment\DeliveryAppointmentResource::class, 'route_name' => 'shipment.rest.doctrine.delivery-appointment', 'route_identifier_name' => 'delivery_appointment_id', 'entity_identifier_name' => 'id', 'collection_name' => 'delivery_appointment', 'entity_http_methods' => [], 'collection_http_methods' => [ 0 => 'POST', ], 'collection_query_whitelist' => [], 'page_size' => 25, 'page_size_param' => null, 'entity_class' => \Application\Entity\Shipment\DeliveryAppointment::class, 'collection_class' => \Shipment\V1\Rest\DeliveryAppointment\DeliveryAppointmentCollection::class, 'service_name' => 'DeliveryAppointment', ], ], 'zf-content-negotiation' => [ 'controllers' => [ 'Shipment\\V1\\Rest\\PurchaseOrder\\Controller' => 'HalJson', 'Shipment\\V1\\Rest\\PurchaseOrderline\\Controller' => 'HalJson', 'Shipment\\V1\\Rest\\Supplier\\Controller' => 'HalJson', 'Shipment\\V1\\Rest\\StockTransaction\\Controller' => 'HalJson', 'Shipment\\V1\\Rest\\SalesOrderlineStatus\\Controller' => 'HalJson', 'Shipment\\V1\\Rest\\SalesOrderlinePickQuantity\\Controller' => 'HalJson', 'Shipment\\V1\\Rest\\SalesOrderShipment\\Controller' => 'HalJson', 'Shipment\\V1\\Rest\\StatusCode\\Controller' => 'HalJson', 'Shipment\\V1\\Rest\\DeliveryAppointment\\Controller' => 'HalJson', ], 'accept-whitelist' => [ 'Shipment\\V1\\Rest\\PurchaseOrder\\Controller' => [ 0 => 'application/vnd.shipment.v1+json', 1 => 'application/hal+json', 2 => 'application/json', ], 'Shipment\\V1\\Rest\\PurchaseOrderline\\Controller' => [ 0 => 'application/vnd.shipment.v1+json', 1 => 'application/hal+json', 2 => 'application/json', ], 'Shipment\\V1\\Rest\\Supplier\\Controller' => [ 0 => 'application/vnd.shipment.v1+json', 1 => 'application/hal+json', 2 => 'application/json', ], 'Shipment\\V1\\Rest\\StockTransaction\\Controller' => [ 0 => 'application/vnd.shipment.v1+json', 1 => 'application/hal+json', 2 => 'application/json', ], 'Shipment\\V1\\Rest\\SalesOrderlineStatus\\Controller' => [ 0 => 'application/vnd.shipment.v1+json', 1 => 'application/hal+json', 2 => 'application/json', ], 'Shipment\\V1\\Rest\\SalesOrderlinePickQuantity\\Controller' => [ 0 => 'application/vnd.shipment.v1+json', 1 => 'application/hal+json', 2 => 'application/json', ], 'Shipment\\V1\\Rest\\SalesOrderShipment\\Controller' => [ 0 => 'application/vnd.shipment.v1+json', 1 => 'application/hal+json', 2 => 'application/json', ], 'Shipment\\V1\\Rest\\StatusCode\\Controller' => [ 0 => 'application/vnd.shipment.v1+json', 1 => 'application/hal+json', 2 => 'application/json', ], 'Shipment\\V1\\Rest\\DeliveryAppointment\\Controller' => [ 0 => 'application/vnd.shipment.v1+json', 1 => 'application/hal+json', 2 => 'application/json', ], ], 'content-type-whitelist' => [ 'Shipment\\V1\\Rest\\PurchaseOrder\\Controller' => [ 0 => 'application/json', ], 'Shipment\\V1\\Rest\\PurchaseOrderline\\Controller' => [ 0 => 'application/json', ], 'Shipment\\V1\\Rest\\Supplier\\Controller' => [ 0 => 'application/json', ], 'Shipment\\V1\\Rest\\StockTransaction\\Controller' => [ 0 => 'application/json', ], 'Shipment\\V1\\Rest\\SalesOrderlineStatus\\Controller' => [ 0 => 'application/json', ], 'Shipment\\V1\\Rest\\SalesOrderlinePickQuantity\\Controller' => [ 0 => 'application/json', ], 'Shipment\\V1\\Rest\\SalesOrderShipment\\Controller' => [ 0 => 'application/json', ], 'Shipment\\V1\\Rest\\StatusCode\\Controller' => [ 0 => 'application/json', ], 'Shipment\\V1\\Rest\\DeliveryAppointment\\Controller' => [ 0 => 'application/json', ], ], 'accept_whitelist' => [ 'Shipment\\V1\\Rest\\SalesOrderlineStatus\\Controller' => [ 0 => 'application/json', 1 => 'application/*+json', ], 'Shipment\\V1\\Rest\\PurchaseOrder\\Controller' => [ 0 => 'application/json', 1 => 'application/*+json', ], 'Shipment\\V1\\Rest\\PurchaseOrderline\\Controller' => [ 0 => 'application/json', 1 => 'application/*+json', ], 'Shipment\\V1\\Rest\\Supplier\\Controller' => [ 0 => 'application/json', 1 => 'application/*+json', ], 'Shipment\\V1\\Rest\\StockTransaction\\Controller' => [ 0 => 'application/json', 1 => 'application/*+json', ], 'Shipment\\V1\\Rest\\SalesOrderlinePickQuantity\\Controller' => [ 0 => 'application/json', 1 => 'application/*+json', ], 'Shipment\\V1\\Rest\\SalesOrderShipment\\Controller' => [ 0 => 'application/json', 1 => 'application/*+json', ], 'Shipment\\V1\\Rest\\StatusCode\\Controller' => [ 0 => 'application/json', 1 => 'application/*+json', ], 'Shipment\\V1\\Rest\\DeliveryAppointment\\Controller' => [ 0 => 'application/json', 1 => 'application/*+json', ], ], 'content_type_whitelist' => [ 'Shipment\\V1\\Rest\\SalesOrderlineStatus\\Controller' => [ 0 => 'application/json', ], 'Shipment\\V1\\Rest\\PurchaseOrder\\Controller' => [ 0 => 'application/json', ], 'Shipment\\V1\\Rest\\PurchaseOrderline\\Controller' => [ 0 => 'application/json', ], 'Shipment\\V1\\Rest\\Supplier\\Controller' => [ 0 => 'application/json', ], 'Shipment\\V1\\Rest\\StockTransaction\\Controller' => [ 0 => 'application/json', ], 'Shipment\\V1\\Rest\\SalesOrderlinePickQuantity\\Controller' => [ 0 => 'application/json', ], 'Shipment\\V1\\Rest\\SalesOrderShipment\\Controller' => [ 0 => 'application/json', ], 'Shipment\\V1\\Rest\\StatusCode\\Controller' => [ 0 => 'application/json', ], 'Shipment\\V1\\Rest\\DeliveryAppointment\\Controller' => [ 0 => 'application/json', ], ], ], 'zf-hal' => [ 'metadata_map' => [ \Application\Entity\Shipment\PurchaseOrder::class => [ 'route_identifier_name' => 'ordernr', 'entity_identifier_name' => 'ordernr', 'route_name' => 'shipment.rest.doctrine.purchase-order', 'hydrator' => 'Shipment\\V1\\Rest\\PurchaseOrder\\PurchaseOrderHydrator', ], \Shipment\V1\Rest\PurchaseOrder\PurchaseOrderCollection::class => [ 'entity_identifier_name' => 'ordernr', 'route_name' => 'shipment.rest.doctrine.purchase-order', 'is_collection' => true, ], \Application\Entity\Shipment\PurchaseOrderline::class => [ 'route_identifier_name' => 'orderlineid', 'entity_identifier_name' => 'orderlineid', 'route_name' => 'shipment.rest.doctrine.purchase-orderline', 'hydrator' => 'Shipment\\V1\\Rest\\PurchaseOrderline\\PurchaseOrderlineHydrator', ], \Shipment\V1\Rest\PurchaseOrderline\PurchaseOrderlineCollection::class => [ 'entity_identifier_name' => 'suppliercode', 'route_name' => 'shipment.rest.doctrine.purchase-orderline', 'is_collection' => true, ], \Application\Entity\Shipment\Supplier::class => [ 'route_identifier_name' => 'suppliercode', 'entity_identifier_name' => 'suppliercode', 'route_name' => 'shipment.rest.doctrine.supplier', 'hydrator' => 'Shipment\\V1\\Rest\\Supplier\\SupplierHydrator', ], \Shipment\V1\Rest\Supplier\SupplierCollection::class => [ 'entity_identifier_name' => 'suppliercode', 'route_name' => 'shipment.rest.doctrine.supplier', 'is_collection' => true, ], \Application\Entity\Shipment\StockTransaction::class => [ 'route_identifier_name' => 'id', 'entity_identifier_name' => 'id', 'route_name' => 'shipment.rest.doctrine.stock-transaction', 'hydrator' => 'Shipment\\V1\\Rest\\StockTransaction\\StockTransactionHydrator', ], \Shipment\V1\Rest\StockTransaction\StockTransactionCollection::class => [ 'entity_identifier_name' => 'id', 'route_name' => 'shipment.rest.doctrine.stock-transaction', 'is_collection' => true, ], \Application\Entity\Shipment\SalesOrderlineStatus::class => [ 'route_identifier_name' => 'id', 'entity_identifier_name' => 'id', 'route_name' => 'shipment.rest.doctrine.sales-orderline-status', 'hydrator' => 'Shipment\\V1\\Rest\\SalesOrderlineStatus\\SalesOrderlineStatusHydrator', ], \Shipment\V1\Rest\SalesOrderlineStatus\SalesOrderlineStatusCollection::class => [ 'entity_identifier_name' => 'salesOrderlineId', 'route_name' => 'shipment.rest.doctrine.sales-orderline-status', 'is_collection' => true, ], \Application\Entity\Shipment\SalesOrderlinePickQuantity::class => [ 'route_identifier_name' => 'sales_orderline_pick_quantity_id', 'entity_identifier_name' => 'id', 'route_name' => 'shipment.rest.doctrine.sales-orderline-pick-quantity', 'hydrator' => 'Shipment\\V1\\Rest\\SalesOrderlinePickQuantity\\SalesOrderlinePickQuantityHydrator', ], \Shipment\V1\Rest\SalesOrderlinePickQuantity\SalesOrderlinePickQuantityCollection::class => [ 'entity_identifier_name' => 'id', 'route_name' => 'shipment.rest.doctrine.sales-orderline-pick-quantity', 'is_collection' => true, ], \Application\Entity\Shipment\SalesOrderShipment::class => [ 'route_identifier_name' => 'sales_order_shipment_id', 'entity_identifier_name' => 'id', 'route_name' => 'shipment.rest.doctrine.sales-order-shipment', 'hydrator' => 'Shipment\\V1\\Rest\\SalesOrderShipment\\SalesOrderShipmentHydrator', ], \Shipment\V1\Rest\SalesOrderShipment\SalesOrderShipmentCollection::class => [ 'entity_identifier_name' => 'id', 'route_name' => 'shipment.rest.doctrine.sales-order-shipment', 'is_collection' => true, ], \Application\Entity\Shipment\StatusCode::class => [ 'route_identifier_name' => 'status_code_id', 'entity_identifier_name' => 'id', 'route_name' => 'shipment.rest.doctrine.status-code', 'hydrator' => 'Shipment\\V1\\Rest\\StatusCode\\StatusCodeHydrator', ], \Shipment\V1\Rest\StatusCode\StatusCodeCollection::class => [ 'entity_identifier_name' => 'id', 'route_name' => 'shipment.rest.doctrine.status-code', 'is_collection' => true, ], \Application\Entity\Shipment\DeliveryAppointment::class => [ 'route_identifier_name' => 'delivery_appointment_id', 'entity_identifier_name' => 'id', 'route_name' => 'shipment.rest.doctrine.delivery-appointment', 'hydrator' => 'Shipment\\V1\\Rest\\DeliveryAppointment\\DeliveryAppointmentHydrator', ], \Shipment\V1\Rest\DeliveryAppointment\DeliveryAppointmentCollection::class => [ 'entity_identifier_name' => 'id', 'route_name' => 'shipment.rest.doctrine.delivery-appointment', 'is_collection' => true, ], ], ], 'zf-apigility' => [ 'doctrine-connected' => [ \Shipment\V1\Rest\PurchaseOrder\PurchaseOrderResource::class => [ 'object_manager' => 'doctrine.entitymanager.orm_default', 'hydrator' => 'Shipment\\V1\\Rest\\PurchaseOrder\\PurchaseOrderHydrator', 'query_providers' => [ 'default' => 'default_orm', 'fetch_all' => 'purchase_order_fetch_all', 'fetch' => 'purchase_order_fetch', ], ], \Shipment\V1\Rest\PurchaseOrderline\PurchaseOrderlineResource::class => [ 'object_manager' => 'doctrine.entitymanager.orm_default', 'hydrator' => 'Shipment\\V1\\Rest\\PurchaseOrderline\\PurchaseOrderlineHydrator', 'query_providers' => [ 'default' => 'default_orm', 'fetch_all' => 'purchase_orderline_fetch_all', 'fetch' => 'purchase_orderline_fetch', ], ], \Shipment\V1\Rest\Supplier\SupplierResource::class => [ 'object_manager' => 'doctrine.entitymanager.orm_default', 'hydrator' => 'Shipment\\V1\\Rest\\Supplier\\SupplierHydrator', 'query_providers' => [ 'default' => 'default_orm', 'fetch_all' => 'supplier_fetch_all', 'fetch' => 'supplier_fetch', ], ], \Shipment\V1\Rest\StockTransaction\StockTransactionResource::class => [ 'object_manager' => 'doctrine.entitymanager.orm_default', 'hydrator' => 'Shipment\\V1\\Rest\\StockTransaction\\StockTransactionHydrator', ], \Shipment\V1\Rest\SalesOrderlineStatus\SalesOrderlineStatusResource::class => [ 'object_manager' => 'doctrine.entitymanager.orm_default', 'hydrator' => 'Shipment\\V1\\Rest\\SalesOrderlineStatus\\SalesOrderlineStatusHydrator', ], \Shipment\V1\Rest\SalesOrderlinePickQuantity\SalesOrderlinePickQuantityResource::class => [ 'object_manager' => 'doctrine.entitymanager.orm_default', 'hydrator' => 'Shipment\\V1\\Rest\\SalesOrderlinePickQuantity\\SalesOrderlinePickQuantityHydrator', ], \Shipment\V1\Rest\SalesOrderShipment\SalesOrderShipmentResource::class => [ 'object_manager' => 'doctrine.entitymanager.orm_default', 'hydrator' => 'Shipment\\V1\\Rest\\SalesOrderShipment\\SalesOrderShipmentHydrator', ], \Shipment\V1\Rest\StatusCode\StatusCodeResource::class => [ 'object_manager' => 'doctrine.entitymanager.orm_default', 'hydrator' => 'Shipment\\V1\\Rest\\StatusCode\\StatusCodeHydrator', 'query_providers' => [ 'default' => 'default_orm', 'fetch_all' => 'status_code_fetch_all', ], ], \Shipment\V1\Rest\DeliveryAppointment\DeliveryAppointmentResource::class => [ 'object_manager' => 'doctrine.entitymanager.orm_default', 'hydrator' => 'Shipment\\V1\\Rest\\DeliveryAppointment\\DeliveryAppointmentHydrator', ], ], ], 'doctrine-hydrator' => [ 'Shipment\\V1\\Rest\\PurchaseOrder\\PurchaseOrderHydrator' => [ 'entity_class' => \Application\Entity\Shipment\PurchaseOrder::class, 'object_manager' => 'doctrine.entitymanager.orm_default', 'by_value' => true, 'strategies' => [], 'use_generated_hydrator' => true, ], 'Shipment\\V1\\Rest\\PurchaseOrderline\\PurchaseOrderlineHydrator' => [ 'entity_class' => \Application\Entity\Shipment\PurchaseOrderline::class, 'object_manager' => 'doctrine.entitymanager.orm_default', 'by_value' => true, 'strategies' => [], 'use_generated_hydrator' => true, ], 'Shipment\\V1\\Rest\\Supplier\\SupplierHydrator' => [ 'entity_class' => \Application\Entity\Shipment\Supplier::class, 'object_manager' => 'doctrine.entitymanager.orm_default', 'by_value' => true, 'strategies' => [], 'use_generated_hydrator' => true, ], 'Shipment\\V1\\Rest\\StockTransaction\\StockTransactionHydrator' => [ 'entity_class' => \Application\Entity\Shipment\StockTransaction::class, 'object_manager' => 'doctrine.entitymanager.orm_default', 'by_value' => true, 'strategies' => [], 'use_generated_hydrator' => true, ], 'Shipment\\V1\\Rest\\SalesOrderlineStatus\\SalesOrderlineStatusHydrator' => [ 'entity_class' => \Application\Entity\Shipment\SalesOrderlineStatus::class, 'object_manager' => 'doctrine.entitymanager.orm_default', 'by_value' => true, 'strategies' => [], 'use_generated_hydrator' => true, ], 'Shipment\\V1\\Rest\\SalesOrderlinePickQuantity\\SalesOrderlinePickQuantityHydrator' => [ 'entity_class' => \Application\Entity\Shipment\SalesOrderlinePickQuantity::class, 'object_manager' => 'doctrine.entitymanager.orm_default', 'by_value' => true, 'strategies' => [], 'use_generated_hydrator' => true, ], 'Shipment\\V1\\Rest\\SalesOrderShipment\\SalesOrderShipmentHydrator' => [ 'entity_class' => \Application\Entity\Shipment\SalesOrderShipment::class, 'object_manager' => 'doctrine.entitymanager.orm_default', 'by_value' => true, 'strategies' => [], 'use_generated_hydrator' => true, ], 'Shipment\\V1\\Rest\\StatusCode\\StatusCodeHydrator' => [ 'entity_class' => \Application\Entity\Shipment\StatusCode::class, 'object_manager' => 'doctrine.entitymanager.orm_default', 'by_value' => true, 'strategies' => [], 'use_generated_hydrator' => true, ], 'Shipment\\V1\\Rest\\DeliveryAppointment\\DeliveryAppointmentHydrator' => [ 'entity_class' => \Application\Entity\Shipment\DeliveryAppointment::class, 'object_manager' => 'doctrine.entitymanager.orm_default', 'by_value' => true, 'strategies' => [], 'use_generated_hydrator' => true, ], ], 'zf-content-validation' => [ 'Shipment\\V1\\Rest\\PurchaseOrder\\Controller' => [ 'input_filter' => 'Shipment\\V1\\Rest\\PurchaseOrder\\Validator', ], 'Shipment\\V1\\Rest\\PurchaseOrderline\\Controller' => [ 'input_filter' => 'Shipment\\V1\\Rest\\PurchaseOrderline\\Validator', ], 'Shipment\\V1\\Rest\\Supplier\\Controller' => [ 'input_filter' => 'Shipment\\V1\\Rest\\Supplier\\Validator', ], 'Shipment\\V1\\Rest\\StockTransaction\\Controller' => [ 'input_filter' => 'Shipment\\V1\\Rest\\StockTransaction\\Validator', ], 'Shipment\\V1\\Rest\\SalesOrderlineStatus\\Controller' => [ 'input_filter' => 'Shipment\\V1\\Rest\\SalesOrderlineStatus\\Validator', ], 'Shipment\\V1\\Rest\\SalesOrderlinePickQuantity\\Controller' => [ 'input_filter' => 'Shipment\\V1\\Rest\\SalesOrderlinePickQuantity\\Validator', ], 'Shipment\\V1\\Rest\\SalesOrderShipment\\Controller' => [ 'input_filter' => 'Shipment\\V1\\Rest\\SalesOrderShipment\\Validator', ], 'Shipment\\V1\\Rest\\StatusCode\\Controller' => [ 'input_filter' => 'Shipment\\V1\\Rest\\StatusCode\\Validator', ], 'Shipment\\V1\\Rest\\DeliveryAppointment\\Controller' => [ 'input_filter' => 'Shipment\\V1\\Rest\\DeliveryAppointment\\Validator', ], ], 'input_filter_specs' => [ 'Shipment\\V1\\Rest\\PurchaseOrder\\Validator' => [ 0 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'ORDERNR', 'field_type' => 'varchar(9)', 'description' => 'Ordernr De Eekhoorn', ], 1 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'SUPPLIERCODE', 'description' => 'Leveranciercode Cicmpy.crdcode  nodig om te kunnen filteren op leverancier (naam/nummer).', 'field_type' => 'varchar(8)', ], 2 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'SUPPLIERNAME', 'description' => 'Leverancier naam Cicmpy.cmp_name  nodig om te kunnen filteren op leverancier (naam/nummer)', 'field_type' => 'varchar(50)', ], 3 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'DELIVERYDATE', 'description' => 'Leverdatum', 'field_type' => \DateTime::class, ], 4 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'ORDERDESCRIPTION', 'description' => 'Inkooporder beschrijving', 'field_type' => 'varchar(60)', ], 5 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'ORDERREF', 'description' => 'Inkooporder referentie', 'field_type' => 'varchar(60)', ], ], 'Shipment\\V1\\Rest\\PurchaseOrderline\\Validator' => [ 0 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'ORDERLINEID', 'description' => 'Unieke code', 'field_type' => 'int', ], 1 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'ORDERNR', 'description' => 'Ordernummer De Eekhoorn', 'field_type' => 'varchar(9)', ], 2 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'SUPPLIERCODE', 'description' => 'Leveranciercode', 'field_type' => 'varchar(10)', ], 3 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'SUPPLIERNAME', 'description' => 'Naam van de leverancier', 'field_type' => 'varchar', ], 4 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'QUANTITY', 'description' => 'Aantal in Order', 'field_type' => 'Float', ], 5 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'DELIVERYDATE', 'description' => 'Leverdatum', 'field_type' => \DateTime::class, ], 6 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'ITEMCODE', 'description' => 'Artikelcode', 'field_type' => 'varchar(30)', ], 7 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'ITEMDESCRIPTION', 'description' => 'Omschrijving Artike', 'field_type' => 'varchar(60)', ], 8 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'SALESUNIT', 'description' => 'Eenheid', 'field_type' => 'varchar(8)', ], 9 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'EANCODE', 'description' => 'EAN code', 'field_type' => 'varchar(30)', ], 10 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'BRAND', 'description' => 'Merk', 'field_type' => 'varchar(30)', ], 11 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'PRODUCTGROUP', 'description' => 'Artikelgroep', 'field_type' => 'int', ], 12 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'COLLIUNIT', 'description' => 'Colli eenheid', 'field_type' => 'varchar', ], 13 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'SALESUNITPERCOLLI', 'description' => 'Eenheden per verpakking', 'field_type' => 'float', ], 14 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'VOLUME', 'description' => 'Volume in M3', 'field_type' => 'float', ], 15 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'WEIGHT', 'description' => 'Gewicht/verpakking', 'field_type' => 'float', ], 16 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'HEIGHT', 'description' => 'Hoogte', 'field_type' => 'float', ], 17 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'LENGTH', 'description' => 'Lengte', 'field_type' => 'float', ], 18 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'WIDTH', 'description' => 'Breedte', 'field_type' => 'float', ], 19 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'ORDERDESCRIPTION', 'description' => 'Inkooporder omschrijving', 'field_type' => 'varchar(60)', ], 20 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'ORDERREF', 'description' => 'Inkooporder referentie', 'field_type' => 'varchar(60)', ], ], 'Shipment\\V1\\Rest\\Supplier\\Validator' => [ 0 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'SUPPLIERCODE', 'description' => 'Leveranciercode', 'field_type' => 'varchar(8)', ], 1 => [ 'required' => true, 'validators' => [], 'filters' => [], 'name' => 'SUPPLIERNAME', 'description' => 'Leveranciernaam', 'field_type' => 'varchar(50)', ], ], 'Shipment\\V1\\Rest\\StockTransaction\\Validator' => [ 0 => [ 'name' => 'orderlineId', 'required' => false, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StripTags::class, ], 1 => [ 'name' => \Zend\Filter\Digits::class, ], ], 'validators' => [], 'description' => 'Unieke id', 'field_type' => 'int', ], 1 => [ 'name' => 'warehouse', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '30', ], ], ], 'description' => 'Magazijn', 'field_type' => 'varchar(30)', ], 2 => [ 'name' => 'warehouseLocation', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '30', ], ], ], 'description' => 'Magazijn locatie', 'field_type' => 'varchar(30)', ], 3 => [ 'name' => 'itemCode', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '30', ], ], ], 'description' => 'Artikelcode', 'field_type' => 'varchar(30)', ], 4 => [ 'name' => 'quantity', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [], 'description' => 'Aantal in verkoopeenheid', 'field_type' => 'float', ], 5 => [ 'name' => 'transactionType', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StripTags::class, ], 1 => [ 'name' => \Zend\Filter\Digits::class, ], ], 'validators' => [], 'description' => 'Type transactie', 'field_type' => 'int', ], 6 => [ 'name' => 'description', 'required' => false, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '100', ], ], ], 'description' => 'Omschrijving transactie', 'field_type' => 'varchar(100)', ], 7 => [ 'name' => 'status', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StripTags::class, ], 1 => [ 'name' => \Zend\Filter\Digits::class, ], ], 'validators' => [], 'description' => 'Status', 'field_type' => 'int', ], 8 => [ 'name' => 'processDate', 'required' => false, 'filters' => [], 'validators' => [ 0 => [ 'name' => \Zend\Validator\Date::class, 'options' => [ 'format' => 'Y-m-d H:i:s', ], ], ], 'description' => 'Verwerkingsdatum', 'field_type' => 'datetime(YYYY-MM-DD HH:MM:SS)', ], ], 'Shipment\\V1\\Rest\\SalesOrderlineStatus\\Validator' => [ 0 => [ 'name' => 'salesOrderlineId', 'required' => true, 'filters' => [], 'validators' => [ 0 => [ 'name' => \Zend\I18n\Validator\IsInt::class, 'options' => [], ], ], 'description' => 'Id dat overeenkomt met het Id in tabel EEK_DISTRIBUTION_SALESORDERLINES. Dit Id dient bekend te zijn bij de vervoerder, bijvoorbeeld doordat we dit inschieten in hun API (CustomerLineId)', 'field_type' => 'int', ], 1 => [ 'name' => 'status', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StripTags::class, ], 1 => [ 'name' => \Zend\Filter\Digits::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\I18n\Validator\IsInt::class, 'options' => [], ], ], 'description' => 'Status', 'field_type' => 'int', ], 2 => [ 'name' => 'statusDescription', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '255', ], ], ], 'description' => 'Status omschrijving', 'field_type' => 'varchar(100)', ], 3 => [ 'required' => false, 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '20', ], ], ], 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, 'options' => [], ], 1 => [ 'name' => \Zend\Filter\StripTags::class, 'options' => [], ], ], 'name' => 'carrier', 'description' => 'Vervoerder. Dient te corresponderen met crediteurnummer in Exact. Opties: 998000 - Dusseldorp 999068 - DutchNed 900339 - De Zwaluw', 'field_type' => 'varchar(20)', ], 4 => [ 'name' => 'transactionDate', 'required' => true, 'filters' => [], 'validators' => [ 0 => [ 'name' => \Zend\Validator\Date::class, 'options' => [ 'format' => 'Y-m-d H:i:s', ], ], ], 'description' => 'Transaction Date', 'field_type' => \datetime::class, ], 5 => [ 'required' => false, 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '255', ], ], ], 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, 'options' => [], ], 1 => [ 'name' => \Zend\Filter\StripTags::class, 'options' => [], ], ], 'name' => 'trackTrace', 'description' => 'Carrier reference', 'field_type' => 'nvarchar(MAX)', ], ], 'Shipment\\V1\\Rest\\SalesOrderlinePickQuantity\\Validator' => [ 0 => [ 'name' => 'orderlineId', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StripTags::class, ], 1 => [ 'name' => \Zend\Filter\Digits::class, ], ], 'validators' => [], 'description' => 'Unieke order regel ID', 'field_type' => 'int', ], 1 => [ 'name' => 'itemcode', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '30', ], ], ], 'description' => 'Artikelcode', 'field_type' => 'varchar(30)', ], 2 => [ 'name' => 'quantityPicked', 'required' => true, 'filters' => [], 'validators' => [], 'description' => 'Aantal gepickt', 'field_type' => 'float', ], 3 => [ 'name' => 'quantityShortage', 'required' => false, 'filters' => [], 'validators' => [], 'description' => 'Aantal manco', 'field_type' => 'float', ], 4 => [ 'name' => 'reasonShortage', 'required' => false, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '100', ], ], ], 'description' => 'Reden manco', 'field_type' => 'varchar(100)', ], ], 'Shipment\\V1\\Rest\\SalesOrderShipment\\Validator' => [ 0 => [ 'name' => 'shipmentId', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StripTags::class, ], 1 => [ 'name' => \Zend\Filter\Digits::class, ], ], 'validators' => [], 'description' => 'Unieke ID van de zending', 'field_type' => 'int', ], 1 => [ 'name' => 'debtorNumber', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '10', ], ], ], 'description' => 'Debiteurnummer', 'field_type' => 'varchar(10)', ], 2 => [ 'name' => 'skuType', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '10', ], ], ], 'description' => 'Pallettype of Colli: PALA, PALB, PALC, COLLI etc.', 'field_type' => 'varchar(10)', ], 3 => [ 'name' => 'skuId', 'required' => false, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '20', ], ], ], 'description' => 'Unieke ID van de SKU', 'field_type' => 'varchar(20)', ], 4 => [ 'name' => 'carrier', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '50', ], ], ], 'description' => 'Vervoerder', 'field_type' => 'varchar(50)', ], 5 => [ 'name' => 'deliveryDate', 'required' => true, 'filters' => [], 'validators' => [ 0 => [ 'name' => \Zend\Validator\Date::class, 'options' => [ 'format' => 'Y-m-d H:i:s', ], ], ], 'description' => 'Afleverdatum', 'field_type' => 'datetime(YYYY-MM-DD HH:MM:SS)', ], 6 => [ 'name' => 'debtorName', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '50', ], ], ], 'description' => 'Afleveradres naam', 'field_type' => 'varchar(50)', ], 7 => [ 'name' => 'delAddress', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '100', ], ], ], 'description' => 'Afleveradres', 'field_type' => 'varchar(100)', ], 8 => [ 'name' => 'delPostcode', 'required' => false, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '20', ], ], ], 'description' => 'Aflever postcode', 'field_type' => 'varchar(20)', ], 9 => [ 'name' => 'delCity', 'required' => false, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '100', ], ], ], 'description' => 'Aflever plaats', 'field_type' => 'varchar(100)', ], 10 => [ 'name' => 'delCountryCode', 'required' => false, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], 2 => [ 'name' => \Zend\Filter\StringToUpper::class, 'options' => [], ], ], 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '2', ], ], ], 'description' => 'Aflever landcode', 'field_type' => 'varchar(2)', ], 11 => [ 'name' => 'trackTraceCode', 'required' => false, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '50', ], ], ], 'description' => 'Track and Trace code', 'field_type' => 'varchar(50)', ], 12 => [ 'name' => 'trackTraceUrl', 'required' => false, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '100', ], ], ], 'description' => 'Track and Trace Url', 'field_type' => 'varchar(250)', ], 13 => [ 'name' => 'status', 'required' => false, 'filters' => [], 'validators' => [], 'description' => 'Status', 'field_type' => 'integer', ], ], 'Shipment\\V1\\Rest\\StatusCode\\Validator' => [ 0 => [ 'name' => 'status', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StripTags::class, ], 1 => [ 'name' => \Zend\Filter\Digits::class, ], ], 'validators' => [], 'field_type' => 'integer', 'description' => 'Status code', ], 1 => [ 'name' => 'tableName', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [], 'description' => 'Name of the table for a list of related statuscodes', 'field_type' => 'string', ], 2 => [ 'name' => 'description', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [], 'description' => 'Status description', 'field_type' => 'string', ], ], 'Shipment\\V1\\Rest\\DeliveryAppointment\\Validator' => [ 0 => [ 'name' => 'carrier', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '20', ], ], ], 'description' => 'Name of the carrier', 'field_type' => 'varchar(20)', ], 1 => [ 'name' => 'salesOrderlineId', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StripTags::class, ], 1 => [ 'name' => \Zend\Filter\Digits::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\I18n\Validator\IsInt::class, 'options' => [], ], ], 'description' => 'Reference to sales orderline ID', 'field_type' => 'int', ], 2 => [ 'name' => 'type', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\Validator\StringLength::class, 'options' => [ 'max' => '100', ], ], ], 'description' => 'Delivery type', 'field_type' => 'nvarchar(100)', ], 3 => [ 'name' => 'status', 'required' => true, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StripTags::class, ], 1 => [ 'name' => \Zend\Filter\Digits::class, ], ], 'validators' => [ 0 => [ 'name' => \Zend\I18n\Validator\IsInt::class, 'options' => [], ], ], 'description' => 'Status code', 'field_type' => 'int', ], 4 => [ 'name' => 'deliveryTimeFrom', 'required' => true, 'filters' => [], 'validators' => [ 0 => [ 'name' => \Zend\Validator\Date::class, 'options' => [ 'format' => 'Y-m-d H:i:s', ], ], ], 'description' => 'Expected Delivery Time From', 'field_type' => \datetime::class, ], 5 => [ 'name' => 'deliveryTimeTo', 'required' => true, 'filters' => [], 'validators' => [ 0 => [ 'name' => \Zend\Validator\Date::class, 'options' => [ 'format' => 'Y-m-d H:i:s', ], ], ], 'description' => 'Expected Delivery Time To', 'field_type' => \datetime::class, ], 6 => [ 'name' => 'deliveryRemark', 'required' => false, 'filters' => [ 0 => [ 'name' => \Zend\Filter\StringTrim::class, ], 1 => [ 'name' => \Zend\Filter\StripTags::class, ], ], 'validators' => [], 'description' => 'Remarks on delivery', 'field_type' => 'nvarchar(max)', ], ], ], 'zf-apigility-doctrine-query-provider' => [ 'aliases' => [ 'purchase_order_fetch_all' => \Application\Query\Provider\PurchaseOrder\FetchAll::class, 'purchase_order_fetch' => \Application\Query\Provider\PurchaseOrder\Fetch::class, 'purchase_orderline_fetch_all' => \Application\Query\Provider\PurchaseOrderline\FetchAll::class, 'purchase_orderline_fetch' => \Application\Query\Provider\PurchaseOrderline\Fetch::class, 'supplier_fetch_all' => \Application\Query\Provider\Supplier\FetchAll::class, 'supplier_fetch' => \Application\Query\Provider\Supplier\Fetch::class, 'status_code_fetch_all' => \Application\Query\Provider\StatusCode\FetchAll::class, ], 'factories' => [ \Application\Query\Provider\PurchaseOrder\FetchAll::class => \Zend\ServiceManager\Factory\InvokableFactory::class, \Application\Query\Provider\PurchaseOrder\Fetch::class => \Zend\ServiceManager\Factory\InvokableFactory::class, \Application\Query\Provider\PurchaseOrderline\FetchAll::class => \Zend\ServiceManager\Factory\InvokableFactory::class, \Application\Query\Provider\PurchaseOrderline\Fetch::class => \Zend\ServiceManager\Factory\InvokableFactory::class, \Application\Query\Provider\Supplier\FetchAll::class => \Zend\ServiceManager\Factory\InvokableFactory::class, \Application\Query\Provider\Supplier\Fetch::class => \Zend\ServiceManager\Factory\InvokableFactory::class, \Application\Query\Provider\StatusCode\FetchAll::class => \Zend\ServiceManager\Factory\InvokableFactory::class, ], ], ];
40.874369
222
0.40441
4269c0d257ffd3a4a714dbe1d1aec3c3209807a5
1,801
dart
Dart
lib/src/widgets/scrollable_ex.dart
flutter-dd/ui_ex
932526f13a6fc1f17c24b64581a03a176a13c9c0
[ "MIT" ]
1
2021-11-18T06:49:07.000Z
2021-11-18T06:49:07.000Z
lib/src/widgets/scrollable_ex.dart
flutter-dd/ui_ex
932526f13a6fc1f17c24b64581a03a176a13c9c0
[ "MIT" ]
null
null
null
lib/src/widgets/scrollable_ex.dart
flutter-dd/ui_ex
932526f13a6fc1f17c24b64581a03a176a13c9c0
[ "MIT" ]
null
null
null
part of ui_ex; /// 可滚动的小部件 /// Scrollable extension WidgetsScrollableEx<T extends ScrollController?> on T { /// Scrollable Scrollable scrollable({ Key? key, AxisDirection axisDirection = AxisDirection.down, ScrollPhysics? physics, required Widget Function(BuildContext, ViewportOffset) viewportBuilder, double Function(ScrollIncrementDetails)? incrementCalculator, bool excludeFromSemantics = false, int? semanticChildCount, DragStartBehavior dragStartBehavior = DragStartBehavior.start, String? restorationId, ScrollBehavior? scrollBehavior, }) => Scrollable( key: key, axisDirection: axisDirection, controller: this, physics: physics, viewportBuilder: viewportBuilder, incrementCalculator: incrementCalculator, excludeFromSemantics: excludeFromSemantics, semanticChildCount: semanticChildCount, dragStartBehavior: dragStartBehavior, restorationId: restorationId, scrollBehavior: scrollBehavior, ); } extension WidgetsScrollableDetailsEx<T extends ScrollController> on T { /// ScrollableDetails ScrollableDetails scrollableDetails({required AxisDirection direction}) => ScrollableDetails(direction: direction, controller: this); } extension WidgetsScrollIncrementDetailsEx<T extends ScrollIncrementType> on T { /// ScrollIncrementDetails ScrollIncrementDetails scrollIncrementDetails( {required ScrollMetrics metrics}) => ScrollIncrementDetails(metrics: metrics, type: this); } extension WidgetsScrollIntentEx<T extends ScrollIncrementType?> on T { /// ScrollIntent ScrollIntent scrollIntent({required AxisDirection direction}) => ScrollIntent( direction: direction, type: this ?? ScrollIncrementType.line); }
34.634615
80
0.745142
43f9e337deeba84c5954e4f6fb01785d62ff4e05
1,070
ts
TypeScript
src/tools/recalculateAscentDescent.ts
fabulator/endomondo-api-handler
a3352888a9994acc083b56e1d8239ee857386941
[ "Apache-2.0" ]
21
2018-03-23T14:32:51.000Z
2021-04-12T15:02:17.000Z
src/tools/recalculateAscentDescent.ts
fabulator/endomondo-api-handler
a3352888a9994acc083b56e1d8239ee857386941
[ "Apache-2.0" ]
267
2018-04-11T10:30:06.000Z
2020-12-30T21:57:51.000Z
src/tools/recalculateAscentDescent.ts
fabulator/endomondo-api-handler
a3352888a9994acc083b56e1d8239ee857386941
[ "Apache-2.0" ]
5
2020-01-14T14:22:32.000Z
2021-04-12T15:02:28.000Z
import { unit } from '../helpers/math'; import { Point, Workout } from '../models'; /** * Recalculate total ascent and descent. * * @param workout * @returns {Workout} */ export default function recalculateAscentDescent(workout: Workout): Workout { let ascent = 0; let descent = 0; let previusPoint: Point | undefined; workout.getPoints().forEach((point) => { if (!previusPoint) { previusPoint = point; return; } const altitude = point.getAltitude(); const previusAltitude = previusPoint.getAltitude(); if (altitude === undefined) { return; } if (previusAltitude === undefined) { previusPoint = point; return; } const diff = altitude.toNumber('m') - previusAltitude.toNumber('m'); if (diff > 0) { ascent += diff; } else { descent -= diff; } previusPoint = point; }); return workout.setAscent(unit(ascent, 'm')).setDescent(unit(descent, 'm')); }
23.777778
79
0.553271
eef495ddfead279a591909ea2a2ee0b90b9bdf50
204
rb
Ruby
display/db/migrate/20150128000000_add_org_scope_to_teams.rb
mtunganati/oneops
6a07b9ede594233bfe36a3a11816ec5b69881264
[ "Apache-2.0" ]
160
2017-06-05T22:08:31.000Z
2022-03-27T02:10:54.000Z
display/db/migrate/20150128000000_add_org_scope_to_teams.rb
mtunganati/oneops
6a07b9ede594233bfe36a3a11816ec5b69881264
[ "Apache-2.0" ]
142
2017-06-06T17:59:38.000Z
2021-09-08T14:09:22.000Z
display/db/migrate/20150128000000_add_org_scope_to_teams.rb
mtunganati/oneops
6a07b9ede594233bfe36a3a11816ec5b69881264
[ "Apache-2.0" ]
190
2017-06-05T21:49:14.000Z
2022-03-23T09:52:11.000Z
class AddOrgScopeToTeams < ActiveRecord::Migration def up add_column :teams, :org_scope, :boolean, :null => false, :default => false end def down remove_column :teams, :org_scope end end
20.4
78
0.705882
b77f8a98b9d4e8eff3e6110f4bfe69457782718d
2,746
cc
C++
kernel/futex.cc
mit-pdos/ward
91b598932d161f907590b9ad21d7df395e5d6712
[ "MIT-0" ]
29
2019-12-12T02:30:35.000Z
2022-01-06T17:13:09.000Z
kernel/futex.cc
mit-pdos/ward
91b598932d161f907590b9ad21d7df395e5d6712
[ "MIT-0" ]
47
2019-12-11T02:34:13.000Z
2020-06-08T19:26:59.000Z
kernel/futex.cc
mit-pdos/ward
91b598932d161f907590b9ad21d7df395e5d6712
[ "MIT-0" ]
4
2020-12-08T13:46:55.000Z
2022-01-04T20:25:10.000Z
#include "types.h" #include "kernel.hh" #include "spinlock.hh" #include "cpputil.hh" #include "ns.hh" #include "errno.h" #include "condvar.hh" #include "proc.hh" #include "cpu.hh" #include "spercpu.hh" #include "vm.hh" #include "hash.hh" #define FUTEX_HASH_BUCKETS 257 struct futex_list_bucket { ilist<proc, &proc::futex_link> items; spinlock lock; }; struct futex_list { futex_list_bucket buckets[FUTEX_HASH_BUCKETS]; }; futex_list futex_waiters __attribute__((section (".qdata"))); futexkey::futexkey(uintptr_t useraddr, const sref<class vmap>& vmap_, bool priv) : ptr(nullptr) { if ((useraddr & 0x3) != 0) panic("misaligned futex address"); u64 pageidx; if (!priv && (pageable = vmap_->lookup_pageable(useraddr, &pageidx))) { shared = true; address = pageidx * PGSIZE + useraddr % PGSIZE; } else { shared = false; vmap = vmap_.get(); address = useraddr; } } futexkey::futexkey(futexkey&& other) : futexkey() { *this = std::move(other); } futexkey& futexkey::operator=(futexkey&& other) noexcept { shared = other.shared; address = other.address; ptr = other.ptr; other.ptr = nullptr; return *this; } futexkey::~futexkey() { if (shared) pageable.reset(); } bool futexkey::operator==(const futexkey& other) { return address == other.address && ptr == other.ptr && shared == other.shared; } u64 futex_bucket(futexkey* key) { return (hash(key->address) ^ hash(key->ptr)) % FUTEX_HASH_BUCKETS; } u32 futexval(futexkey* key) { if (key->shared) { auto p = key->pageable->get_page_info(PGROUNDDOWN(key->address)); return *(u32*)((char*)p->va() + (key->address % PGSIZE)); } u32 val; if (key->vmap == myproc()->vmap.get() && !fetchmem_ncli(&val, (const void*)(key->address), 4)) return val; u32* kva = (u32*)key->vmap->pagelookup(key->address); return kva ? *kva : 0; } long futexwait(futexkey&& key, u32 val, u64 timer) { futex_list_bucket* bucket = &futex_waiters.buckets[futex_bucket(&key)]; scoped_acquire l(&bucket->lock); if (futexval(&key) != val) return -EWOULDBLOCK; myproc()->futex_key = std::move(key); bucket->items.push_back(myproc()); u64 nsecto = timer == 0 ? 0 : timer+nsectime(); myproc()->cv->sleep_to(&bucket->lock, nsecto); bucket->items.erase(iiterator<proc, &proc::futex_link>(myproc())); return 0; } long futexwake(futexkey&& key, u64 nwake) { if (nwake == 0) { return -EINVAL; } futex_list_bucket* bucket = &futex_waiters.buckets[futex_bucket(&key)]; scoped_acquire l(&bucket->lock); u64 nwoke = 0; for(auto i = bucket->items.begin(); i != bucket->items.end() && nwoke < nwake; i++) { if (i->futex_key == key) { i->cv->wake_all(); nwoke++; } } return nwoke; }
23.470085
97
0.651493
32407e8e371198be7f0b8aaa08d1d26a7ab989c4
19,517
asm
Assembly
Library/Spreadsheet/Spreadsheet/spreadsheetEditBar.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
504
2018-11-18T03:35:53.000Z
2022-03-29T01:02:51.000Z
Library/Spreadsheet/Spreadsheet/spreadsheetEditBar.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
96
2018-11-19T21:06:50.000Z
2022-03-06T10:26:48.000Z
Library/Spreadsheet/Spreadsheet/spreadsheetEditBar.asm
steakknife/pcgeos
95edd7fad36df400aba9bab1d56e154fc126044a
[ "Apache-2.0" ]
73
2018-11-19T20:46:53.000Z
2022-03-29T00:59:26.000Z
COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Copyright (c) GeoWorks 1991 -- All Rights Reserved PROJECT: PC GEOS MODULE: GeoCalc FILE: spreadsheetEditBar.asm AUTHOR: Gene Anderson, Feb 27, 1991 ROUTINES: Name Description ---- ----------- MSG_SPREADSHEET_GOTO_CELL Goto a cell entered in "cell goto" box MSG_SPREADSHEET_ENTER_DATA Enter data from edit bar MSG_SPREADSHEET_MAKE_FOCUS Make ourselves the focus SetEditContents Set edit bar contents from active cell FormatCellContents Call appropriate formatting routine EditFormatTextCell Format a text cell for edit bar display EditFormatFormulaCell Format a formula cell for edit bar display EditFormatConstantCell Format a constant cell for edit bar display ClearEditBar Clear contents of edit bar SetEditBarText Set text for edit bar SpreadsheetGrabFocus Make ourselves the focus REVISION HISTORY: Name Date Description ---- ---- ----------- Gene 2/27/91 Initial revision DESCRIPTION: SpreadsheetClass routines related to the edit bar $Id: spreadsheetEditBar.asm,v 1.1 97/04/07 11:13:58 newdeal Exp $ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ EditCode segment resource COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% GotoCell %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Goto a cell CALLED BY: via MSG_SPREADSHEET_GOTO_CELL PASS: *ds:si - instance data ds:di - *ds:si es - seg addr of SpreadsheetClass ax - the method dx - handle of text block cx - length of text (w/o NULL) (unused) RETURN: nothing (block free'd) DESTROYED: bx, si, di, ds, es PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 2/11/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ GotoCell method dynamic SpreadsheetClass, MSG_SPREADSHEET_GOTO_CELL mov si, di ; ds:si <- ptr to instance ; ; Get the text ; mov bx, dx ;bx <- handle of text push bx call MemLock jc quit ;branch if error ; ; Try to parse the text ; mov dx, ax clr di ;dx:di <- ptr to text call ConvertToCellOrRange jc badRefError ;branch if error test ds:[si].SSI_flags, mask SF_NONZERO_DOC_ORIGIN jz ok ; ; Check for a cell or range before the temporary origin ; (origin used when spreadsheet is in locked rows/columns mode) ; push ax, si mov si, ds:[si].SSI_chunk mov ax, TEMP_SPREADSHEET_DOC_ORIGIN call ObjVarFindData pop ax, si jnc ok cmp ax, ds:[bx].SDO_rowCol.CR_row jb originError cmp dx, ds:[bx].SDO_rowCol.CR_row jb originError cmp cx, ds:[bx].SDO_rowCol.CR_column jb originError cmp bp, ds:[bx].SDO_rowCol.CR_column jb originError ok: ; ; ax, cx = Row/column of first cell ; dx, bp = Row/column of last cell ; ; The range entered is legal. Set the new active ; cell and set the range in the cell edit. ; push cx ;active column push ax ;active row push bp ;end column push dx ;end row push cx ;start column push ax ;start row CheckHack <(size SpreadsheetRangeParams) eq 6*(size word)> mov bp, sp ;ss:bp <- ptr to params mov di, si ;ds:di <- ptr to ssheet call SpreadsheetSetSelection add sp, (size SpreadsheetRangeParams) ; ; Make sure the active cell is visible ; call KeepActiveCellOnScreen quit: ; ; Free text block ; pop bx call MemFree ret originError: mov al, PSEE_CELL_OR_RANGE_IS_LOCKED jmp error badRefError: mov al, PSEE_RESULT_SHOULD_BE_CELL_OR_RANGE error: call SpreadsheetNotifyUserOfError ;tell user about the problem jmp quit GotoCell endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SpreadsheetEnterData %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Enter data from the edit bar into the active cell CALLED BY: MSG_SPREADSHEET_ENTER_DATA PASS: ds:*si - instance data ds:di - ds:*si es - seg addr of SpreadsheetClass ax - the method dx - handle of text block cx - length of text (w/o NULL) RETURN: carry - set if data not entered (ie. error) DESTROYED: bx, si, di, ds, es (method handler) PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: NOTE: frees the text block REVISION HISTORY: Name Date Description ---- ---- ----------- eca 2/25/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SpreadsheetEnterData method SpreadsheetClass, MSG_SPREADSHEET_ENTER_DATA mov si, di ;ds:si <- ptr to instance data call EnterDataFromEditBar ; ; Refresh the edit bar ; pushf ; error (carry) flag mov ax, mask SNF_EDIT_BAR call SS_SendNotification popf ret SpreadsheetEnterData endm EnterDataFromEditBar proc near class SpreadsheetClass .enter push dx ;save handle of text block mov bx, dx ;bx <- handle of text block mov dx, cx ;dx <- length of text call MemLock mov es, ax clr di ;es:di <- ptr to text ; ; Figure out what kind of data this is, and ; allocate a new cell appropriately. ; mov ax, ds:[si].SSI_active.CR_row mov cx, ds:[si].SSI_active.CR_column ;(ax,cx) <- active (r,c) LocalIsNull es:[di] ;any text? jz deleteCell ;branch if deleting LocalCmpChar es:[di], '=' ;check for formula je allocFormula ;branch if formula clr bx ;bx <- use default attrs ; ; Attempt to parse this as a number-constant cell. ; call AllocConstantCellFromText ;check for constant jnc redrawCell ;branch if it was a constant ; ; Not a constant... Default to a text cell. ; call AllocTextCell redrawCell: ; ; ds:si = Pointer to spreadsheet instance ; Need to reload the row/column of the cell we're working on ; mov ax, ds:[si].SSI_active.CR_row mov cx, ds:[si].SSI_active.CR_column ;(ax,cx) <- active (r,c) call RecalcDependents ;recalc cell dependents ;also redraws the cell clc ;carry <- no error quit: pop bx pushf call MemFree popf .leave ret deleteCell: call DeleteCell ;delete the cell jmp redrawCell allocFormula: ; ; Skip the "=" at the start of the formula ; LocalNextChar esdi ;es:di <- ptr to formula call FormulaCellAlloc ;allocate a formula cell jnc redrawCell ;branch if no error ; ; There was an error. We want to notify the user about the problem ; and then keep the focus in the edit bar. ; ; The range of text where the error was found is in cx/dx. ; We select that text before we notify the user of the problem. ; push ax, bp ;save error code, frame ; ; The problem is that cx/dx really contain the offset from the ; start of the expression we passed them, which is after the ; "=" at the start of the text. We need to advance each edge of the ; range by one character, unless they are at the end of the text. ; (cx/dx are char indexes) ; cmp cx, TEXT_ADDRESS_PAST_END_LOW ;check for whole range at end je setSelection ;branch if so inc cx ;advance range start cmp dx, TEXT_ADDRESS_PAST_END_LOW ;check for range end at end je setSelection ;branch if so inc dx ;advance range end setSelection: PrintMessage <fix edit bar selection if possible> if 0 mov ax, MSG_VIS_TEXT_SELECT_RANGE_SMALL mov di, mask MF_CALL ;di <- flags call SpreadsheetCallEditOD ;call edit object endif pop ax, bp ;restore error code, frame push ax, cx, dx, bp mov ax, MSG_GEN_APPLICATION_IGNORE_INPUT call GenCallApplication pop ax, cx, dx, bp call SpreadsheetNotifyUserOfError ;tell the user about it ; ; Added, 7/ 7/95 -jw ; ; Send MSG_SPREADSHEET_REPLACE_TEXT_SELECTION to the edit-bar, ; but pass nothing as the text to replace with. The side-effects ; of this message are: ; ; - The edit bar grabs the focus (good) ; - The edit bar marks itself as modified (good) ; ; The result is that the user is left editing the formula that ; had the error, and they must correct it in order to do anything. ; ; (OK... it's weak, but it does work) ; ; Note that I use ObjCallInstanceNoLock() under the assumption ; that this must somehow get passed to the edit-bar just ; as a general rule (that's certainly how GeoCalc handles it). ; push ax, bx, cx, dx, bp, si clr dx ; dx <- handle of block clr bp ; don't select anything clr cx ; null terminated text mov si, ds:[si].SSI_chunk ; *ds:si <- object mov ax, MSG_SPREADSHEET_REPLACE_TEXT_SELECTION call ObjCallInstanceNoLock mov ax, MSG_GEN_APPLICATION_ACCEPT_INPUT call UserSendToApplicationViaProcess pop ax, bx, cx, dx, bp, si stc ;carry <- error jmp quit ;don't take the focus back EnterDataFromEditBar endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SpreadsheetEnterDataWithEvent %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: Same as MSG_SPREADSHEET_ENTER_DATA, but also handle the passed event if data entered correctly. PASS: *ds:si - SpreadsheetClass object ds:di - SpreadsheetClass instance data es - segment of SpreadsheetClass RETURN: nothing DESTROYED: ax,cx,dx,bp REGISTER/STACK USAGE: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/CAVEATS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- chrisb 11/ 8/93 Initial version. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SpreadsheetEnterDataWithEvent method dynamic SpreadsheetClass, MSG_SPREADSHEET_ENTER_DATA_WITH_EVENT push bp mov ax, MSG_SPREADSHEET_ENTER_DATA call ObjCallInstanceNoLock pop cx jcxz done mov dx, TO_NULL jc send CheckHack <TO_SELF eq (TO_NULL+1)> inc dx send: mov ax, MSG_META_SEND_CLASSED_EVENT GOTO ObjCallInstanceNoLock done: ret SpreadsheetEnterDataWithEvent endm COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FormatEditContents %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Format the contents of a cell for the edit bar CALLED BY: UTILITY PASS: ds:si - ptr to Spreadsheet instance data dx:bp - ptr to buffer *es:di = cell data RETURN: cx - length of text (w/o NULL) DESTROYED: PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- eca 2/25/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ ; ; Routine for things like CT_EMPTY... ; EditFormatNothing proc near uses ds .enter clr cx ;cx <- length w/o NULL mov ds, dx ;ds:bp <- ptr to buffer mov ds:[bp][0], cx ;a nothing string. .leave ret EditFormatNothing endp cellEditFormatRoutines nptr \ EditFormatTextCell, ;CT_TEXT EditFormatConstantCell, ;CT_CONSTANT EditFormatFormulaCell, ;CT_FORMULA BadCellType, ;CT_NAME BadCellType, ;CT_CHART EditFormatNothing, ;CT_EMPTY EditFormatFormulaCell ;CT_DISPLAY_FORMULA CheckHack <(size cellEditFormatRoutines) eq CellType> FormatEditContents proc far class SpreadsheetClass uses ax, bp, es, di .enter EC < call ECCheckInstancePtr ;> mov ax, ds:[si].SSI_active.CR_row mov cx, ds:[si].SSI_active.CR_column ;(ax,cx) <- active (r,c) SpreadsheetCellLock ;lock cell jnc noData ;branch if no data if _PROTECT_CELL ; ; dx = segment of NotifySSheetEditBarChange block, if not, we are ; skewed. ; push ds, bx mov ds, dx ;ds = notification block seg mov bx, es:[di] mov bl, es:[bx].CC_recalcFlags andnf bl, mask CRF_PROTECTION jz allSet ;set protection flag if not jmp ornf ds:[NSSEBC_miscData], mask SSEBCMD_PROTECTION allSet: pop ds, bx endif ; ; Pass dx:bp = buffer to use ; call FormatCellContents ;format contents into buffer SpreadsheetCellUnlock ;unlock cell done: .leave ret ; ; The cell has no data. Set the edit bar text to NULL. ; noData: clr cx ;cx <- length of text mov es, dx mov es:[bp], cx ;NULL-terminate text CheckHack <C_NULL eq 0> jmp done FormatEditContents endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FormatCellContents %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Format the contents of a cell. CALLED BY: FormatEditContents() PASS: *es:di = Pointer to the cell data ds:si = Spreadsheet instance SBCS< dx:bp = Buffer of at least MAX_CELL_TEXT_SIZE+1 size > DBCS< dx:bp = Buffer of at least MAX_CELL_TEXT_SIZE+2 size > ax = Row cx = Column RETURN: buffer filled with the formatted expression cx = length of string (w/o NULL) DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 7/30/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ FormatCellContents proc far uses bx, di .enter EC < call ECCheckInstancePtr ;> mov di, es:[di] ;es:di <- ptr to data mov bl, es:[di].CC_type ;bl <- CellType clr bh call cs:cellEditFormatRoutines[bx] .leave ret FormatCellContents endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% EditFormatTextCell %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Format for text cell data for edit bar display CALLED BY: FormatCellContents() PASS: es:di - cell data dx:bp - ptr to buffer to use RETURN: cx - length of formatted string (w/o NULL) DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- eca 3/ 3/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ EditFormatTextCell proc near uses ax, di, si, ds, es .enter segmov ds, es mov si, di ;ds:si <- ptr to cell ChunkSizePtr ds, si, cx sub cx, (size CellText) ;cx <- size of string add si, (size CellText) ;ds:si <- ptr to text mov es, dx mov di, bp ;es:di <- ptr to destination push cx ;save size rep movsb ;copy me jesus pop cx DBCS< shr cx, 1 ;cx <- length of string > dec cx ;cx <- length (w/o) NULL .leave ret EditFormatTextCell endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% EditFormatFormulaCell %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Format for text cell data for edit bar display CALLED BY: FormatCellContents() PASS: es:di - cell data ds:si - Spreadsheet instance dx:bp - ptr to buffer to use ax - row cx - column RETURN: cx - length of formatted string (w/o NULL) DESTROYED: none PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 3/ 8/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ EditFormatFormulaCellFar proc far call EditFormatFormulaCell ret EditFormatFormulaCellFar endp EditFormatFormulaCell proc near uses ax, bx, dx, di, es, bp .enter EC < call ECCheckInstancePtr ;> push cx, ax ; push CellReference mov ax, es ; ax:cx <- ptr to the formula mov cx, di add cx, CF_formula mov es, dx ; es:di <- ptr to destination mov di, bp SBCS< mov dx, MAX_CELL_TEXT_SIZE + (size char) ; dx <- size of the buffer > DBCS< mov dx, MAX_CELL_TEXT_SIZE + (size wchar); dx <- size of the buffer > mov bx, sp ; ss:bx <- ptr to "current cell" call FormulaCellFormat ; Do the formatting ; cx <- text length (w/out NULL) add sp, (size CellReference) .leave ret EditFormatFormulaCell endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% EditFormatConstantCell %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Format a constant cell for display in the edit-bar. CALLED BY: FormatCellContents() PASS: es:di = Pointer to cell data ds:si = Pointer to spreadsheet instance dx:bp = Pointer to buffer to use ax,cx = Row,Column RETURN: cx - length of formatted string DESTROYED: nothing PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- jcw 4/15/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ EditFormatConstantCell proc near uses ds, si, es, di, ax, bx .enter EC < call ECCheckInstancePtr ;> segmov ds, es, si ; ds:si <- ptr to cell constant lea si, es:[di].CC_current mov es, dx ; es:di <- ptr to buffer mov di, bp mov ax, mask FFAF_FROM_ADDR or mask FFAF_NO_TRAIL_ZEROS mov bh, DECIMAL_PRECISION mov bl, DECIMAL_PRECISION - 1 call FloatFloatToAscii_StdFormat ; cx <- # chars (w/out NULL) .leave ret EditFormatConstantCell endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SpreadsheetGrabFocus %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Grab the focus so the spreadsheet gets keyboard input CALLED BY: UTILITY PASS: ds:si - ptr to Spreadsheet instance RETURN: none DESTROYED: ax, di PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- eca 2/25/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SpreadsheetGrabFocus proc far class SpreadsheetClass uses cx, dx, si, bp .enter EC < call ECCheckInstancePtr ;> ; ; Grab the focus by calling ourselves to grab the focus. ; This allows applications with weird UI (eg. multiple ; Spreadsheet objects) to handle getting the focus ; by subclassing the Spreadsheet object. ; mov si, ds:[si].SSI_chunk ;*ds:si - Spreadsheet object mov ax, MSG_SPREADSHEET_MAKE_FOCUS call ObjCallInstanceNoLock .leave ret SpreadsheetGrabFocus endp COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SpreadsheetMakeFocus %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SYNOPSIS: Make this Spreadsheet the current focus & target CALLED BY: MSG_SPREADSHEET_MAKE_FOCUS PASS: *ds:si - instance data ds:di - *ds:si es - seg addr of SpreadsheetClass ax - the method RETURN: none DESTROYED: bx, si, ds, es (method handler) PSEUDO CODE/STRATEGY: KNOWN BUGS/SIDE EFFECTS/IDEAS: REVISION HISTORY: Name Date Description ---- ---- ----------- eca 3/21/91 Initial version %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@ SpreadsheetMakeFocus method dynamic SpreadsheetClass, MSG_SPREADSHEET_MAKE_FOCUS uses cx, dx, bp .enter mov ax, MSG_META_GRAB_TARGET_EXCL call ObjCallInstanceNoLock mov ax, MSG_META_GRAB_FOCUS_EXCL call ObjCallInstanceNoLock .leave ret SpreadsheetMakeFocus endm EditCode ends
25.884615
79
0.603576
92e749231e42cabdaa232e96a783eaa6d52a4b26
1,251
c
C
src/alloc.c
nielshoez/PSU_2019_malloc
73089f1164542626cb7b081cacb35b773b33a530
[ "MIT" ]
2
2020-02-21T15:03:01.000Z
2020-02-21T15:03:03.000Z
src/alloc.c
nielshoez/PSU_2019_malloc
73089f1164542626cb7b081cacb35b773b33a530
[ "MIT" ]
null
null
null
src/alloc.c
nielshoez/PSU_2019_malloc
73089f1164542626cb7b081cacb35b773b33a530
[ "MIT" ]
null
null
null
/* ** EPITECH PROJECT, 2020 ** alloc ** File description: ** alloc */ #include "my_malloc.h" mem_t *create_head(size_t size) { size += sizeof(mem_t); size_t space = (size - 1) / (2 * getpagesize()) * (2 * getpagesize()) + (2 * getpagesize()); head = sbrk(space); if (head == (void *) -1) return (NULL); head->free = true; head->size = space - sizeof(mem_t); head->next = NULL; head->address = (void *)head + sizeof(mem_t); return (head); } mem_t *create_node(size_t size) { mem_t *current = head; size += sizeof(mem_t); long int space = (size - 1) / (2 * getpagesize()) * (2 * getpagesize()) + (2 * getpagesize()); while (current != NULL && current->next != NULL) current = current->next; if (sbrk(space) == (void *) -1) return (NULL); current->size += space; return (current); } void *split(mem_t *current, size_t size) { mem_t *new; new = (void *)current->address + size; new->size = current->size - size - sizeof(mem_t); new->next = current->next; new->address = (void *)new + sizeof(mem_t); new->free = true; current->free = false; current->size = size; current->next = new; return (current); }
22.339286
75
0.560352
b0d735aa8ad231893e317bbee17f3854072723f8
68
py
Python
tuiuiu/tuiuiuadmin/__init__.py
caputomarcos/tuiuiu.io
d8fb57cf95487e7fe1454b2130ef18acc916da46
[ "BSD-3-Clause" ]
3
2019-08-08T09:09:35.000Z
2020-12-15T18:04:17.000Z
tuiuiu/tuiuiuadmin/__init__.py
caputomarcos/tuiuiu.io
d8fb57cf95487e7fe1454b2130ef18acc916da46
[ "BSD-3-Clause" ]
null
null
null
tuiuiu/tuiuiuadmin/__init__.py
caputomarcos/tuiuiu.io
d8fb57cf95487e7fe1454b2130ef18acc916da46
[ "BSD-3-Clause" ]
1
2017-09-09T20:10:40.000Z
2017-09-09T20:10:40.000Z
default_app_config = 'tuiuiu.tuiuiuadmin.apps.TuiuiuAdminAppConfig'
34
67
0.867647
142efbf9daec27ccca78384f16f4f132bf10b568
856
tsx
TypeScript
src/components/complexes/ResponseList/index.tsx
fegoworks/survey-questionnaire
f843f8e6c6623061818b4c5a671f241ad9c90797
[ "MIT" ]
null
null
null
src/components/complexes/ResponseList/index.tsx
fegoworks/survey-questionnaire
f843f8e6c6623061818b4c5a671f241ad9c90797
[ "MIT" ]
null
null
null
src/components/complexes/ResponseList/index.tsx
fegoworks/survey-questionnaire
f843f8e6c6623061818b4c5a671f241ad9c90797
[ "MIT" ]
null
null
null
import { Choice } from "../../../types/types"; import Response from "../../molecules/Response"; import styles from "./responseList.module.css"; interface IResponseList { responseList: Array<Choice> | undefined; handleClick: (event: React.MouseEvent<HTMLDivElement>) => void; } const ResponseList: React.FC<IResponseList> = ({ responseList, handleClick, }) => { const alphabet = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"]; return ( <ul className={styles.responseList}> {responseList?.map((response: Choice, index: number) => ( <Response key={`${index} + qc`} value={response.value} label={response.label} selected={response.selected} alphabet={alphabet[index]} handleClick={handleClick} /> ))} </ul> ); }; export default ResponseList;
25.939394
70
0.59229
a31dd31e8b06458e94e0537cab97634ae4d69c76
4,439
java
Java
src/main/java/com/badminton/mall/controller/business/BusinessOrderController.java
pwu-github/badminton-mall-demo1
3d0913752ab5d521d1b2a5c12245a4a31c69d75d
[ "MIT" ]
null
null
null
src/main/java/com/badminton/mall/controller/business/BusinessOrderController.java
pwu-github/badminton-mall-demo1
3d0913752ab5d521d1b2a5c12245a4a31c69d75d
[ "MIT" ]
null
null
null
src/main/java/com/badminton/mall/controller/business/BusinessOrderController.java
pwu-github/badminton-mall-demo1
3d0913752ab5d521d1b2a5c12245a4a31c69d75d
[ "MIT" ]
null
null
null
package com.badminton.mall.controller.business; import com.badminton.mall.common.ServiceResultEnum; import com.badminton.mall.controller.vo.OrderItemVO; import com.badminton.mall.entity.MallOrder; import com.badminton.mall.service.OrderService; import com.badminton.mall.util.PageQueryUtil; import com.badminton.mall.util.Result; import com.badminton.mall.util.ResultGenerator; import org.springframework.stereotype.Controller; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import java.util.List; import java.util.Map; import java.util.Objects; @Controller @RequestMapping("/business") public class BusinessOrderController { @Resource private OrderService orderService; @GetMapping("/orders") public String ordersPage(HttpServletRequest request) { request.setAttribute("businessPath", "orders"); return "business/newbee_mall_order"; } /** * 列表 */ @RequestMapping(value = "/orders/list", method = RequestMethod.GET) @ResponseBody public Result list(@RequestParam Map<String, Object> params) { if (StringUtils.isEmpty(params.get("page")) || StringUtils.isEmpty(params.get("limit"))) { return ResultGenerator.genFailResult("参数异常!"); } PageQueryUtil pageUtil = new PageQueryUtil(params); return ResultGenerator.genSuccessResult(orderService.getNewBeeMallOrdersPage(pageUtil)); } /** * 修改 */ @RequestMapping(value = "/orders/update", method = RequestMethod.POST) @ResponseBody public Result update(@RequestBody MallOrder mallOrder) { if (Objects.isNull(mallOrder.getTotalPrice()) || Objects.isNull(mallOrder.getOrderId()) || mallOrder.getOrderId() < 1 || mallOrder.getTotalPrice() < 1 || StringUtils.isEmpty(mallOrder.getUserAddress())) { return ResultGenerator.genFailResult("参数异常!"); } String result = orderService.updateOrderInfo(mallOrder); if (ServiceResultEnum.SUCCESS.getResult().equals(result)) { return ResultGenerator.genSuccessResult(); } else { return ResultGenerator.genFailResult(result); } } /** * 详情 */ @GetMapping("/order-items/{id}") @ResponseBody public Result info(@PathVariable("id") Long id) { List<OrderItemVO> orderItems = orderService.getOrderItems(id); if (!CollectionUtils.isEmpty(orderItems)) { return ResultGenerator.genSuccessResult(orderItems); } return ResultGenerator.genFailResult(ServiceResultEnum.DATA_NOT_EXIST.getResult()); } /** * 配货 */ @RequestMapping(value = "/orders/checkDone", method = RequestMethod.POST) @ResponseBody public Result checkDone(@RequestBody Long[] ids) { if (ids.length < 1) { return ResultGenerator.genFailResult("参数异常!"); } String result = orderService.checkDone(ids); if (ServiceResultEnum.SUCCESS.getResult().equals(result)) { return ResultGenerator.genSuccessResult(); } else { return ResultGenerator.genFailResult(result); } } /** * 出库 */ @RequestMapping(value = "/orders/checkOut", method = RequestMethod.POST) @ResponseBody public Result checkOut(@RequestBody Long[] ids) { if (ids.length < 1) { return ResultGenerator.genFailResult("参数异常!"); } String result = orderService.checkOut(ids); if (ServiceResultEnum.SUCCESS.getResult().equals(result)) { return ResultGenerator.genSuccessResult(); } else { return ResultGenerator.genFailResult(result); } } /** * 关闭订单 */ @RequestMapping(value = "/orders/close", method = RequestMethod.POST) @ResponseBody public Result closeOrder(@RequestBody Long[] ids) { if (ids.length < 1) { return ResultGenerator.genFailResult("参数异常!"); } String result = orderService.closeOrder(ids); if (ServiceResultEnum.SUCCESS.getResult().equals(result)) { return ResultGenerator.genSuccessResult(); } else { return ResultGenerator.genFailResult(result); } } }
33.37594
98
0.657581
a38fa284b5f533a89547d34cc4e6e14545f8496d
1,622
java
Java
src/app/voltdb/voltdb_src/src/frontend/org/voltdb/task/IntervalGenerator.java
OpenMPDK/SMDK
8f19d32d999731242cb1ab116a4cb445d9993b15
[ "BSD-3-Clause" ]
44
2022-03-16T08:32:31.000Z
2022-03-31T16:02:35.000Z
src/app/voltdb/voltdb_src/src/frontend/org/voltdb/task/IntervalGenerator.java
H2O0Lee/SMDK
eff49bc17a55a83ea968112feb2e2f2ea18c4ff5
[ "BSD-3-Clause" ]
1
2022-03-29T02:30:28.000Z
2022-03-30T03:40:46.000Z
src/app/voltdb/voltdb_src/src/frontend/org/voltdb/task/IntervalGenerator.java
H2O0Lee/SMDK
eff49bc17a55a83ea968112feb2e2f2ea18c4ff5
[ "BSD-3-Clause" ]
18
2022-03-19T04:41:04.000Z
2022-03-31T03:32:12.000Z
/* This file is part of VoltDB. * Copyright (C) 2019 VoltDB Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with VoltDB. If not, see <http://www.gnu.org/licenses/>. */ package org.voltdb.task; /** * Interface which calculates the time interval which should elapse until the next action should be performed */ public interface IntervalGenerator extends Initializable { /** * This method is invoked only once to obtain the first interval. The first action will be performed after this time * interval has elapsed. After the action has been performed {@link Interval#getCallback() callback} will be invoked * with the {@link ActionResult result} of the action. The return of the callback will be used as the next interval. * <p> * If this method throws an exception or returns {@code null} the task instance will halted and put into an error * state. * * @return {@link Interval} with the time interval until the next action should be performed and callback to invoke */ Interval getFirstInterval(); }
45.055556
120
0.733662
20de7d95ed085f83ef54b6538c82d53494572caa
1,050
cs
C#
src/Xamarin.Forms.PancakeView.Multi/Platforms/Shared/MarkupExtensions/ShadowExtension.cs
modplug/Xamarin.Forms.PancakeView
ba2c955137f241f65fffe671318798fdd695cbda
[ "MIT" ]
1
2020-07-21T15:31:55.000Z
2020-07-21T15:31:55.000Z
src/Xamarin.Forms.PancakeView.Multi/Platforms/Shared/MarkupExtensions/ShadowExtension.cs
modplug/Xamarin.Forms.PancakeView
ba2c955137f241f65fffe671318798fdd695cbda
[ "MIT" ]
null
null
null
src/Xamarin.Forms.PancakeView.Multi/Platforms/Shared/MarkupExtensions/ShadowExtension.cs
modplug/Xamarin.Forms.PancakeView
ba2c955137f241f65fffe671318798fdd695cbda
[ "MIT" ]
null
null
null
using System; using Xamarin.Forms.Xaml; namespace Xamarin.Forms.PancakeView { [AcceptEmptyServiceProvider] public class ShadowExtension : IMarkupExtension<DropShadow> { public float BlurRadius { set; get; } = (float)DropShadow.BlurRadiusProperty.DefaultValue; public Color Color { set; get; } = (Color)DropShadow.ColorProperty.DefaultValue; public Point Offset { set; get; } = (Point)DropShadow.OffsetProperty.DefaultValue; public float Opacity { set; get; } = (float)DropShadow.OpacityProperty.DefaultValue; public DropShadow ProvideValue(IServiceProvider serviceProvider) { return new DropShadow { BlurRadius = BlurRadius, Color = Color, Offset = Offset, Opacity = Opacity }; } object IMarkupExtension.ProvideValue(IServiceProvider serviceProvider) { return (this as IMarkupExtension<DropShadow>).ProvideValue(serviceProvider); } } }
31.818182
98
0.638095
8e5ddcdf7307fc001d5647e655cc596837d56900
1,486
h
C
CW/cw/light/materialconfig.h
GandhiKK/CG_2021
4a5b217de323d482c00c44f0596ad455d219818c
[ "MIT" ]
null
null
null
CW/cw/light/materialconfig.h
GandhiKK/CG_2021
4a5b217de323d482c00c44f0596ad455d219818c
[ "MIT" ]
7
2021-03-14T16:55:49.000Z
2021-05-26T13:26:30.000Z
CW/cw/light/materialconfig.h
GandhiKK/CG_2021
4a5b217de323d482c00c44f0596ad455d219818c
[ "MIT" ]
1
2021-03-14T16:47:54.000Z
2021-03-14T16:47:54.000Z
#pragma once #include <QColor> #include <QObject> #include <QGLFunctions> #include <QOpenGLFunctions_3_3_Compatibility> struct MaterialConfig { static MaterialConfig notExactlyWood; static MaterialConfig glassSide; static MaterialConfig glassSideBack; static MaterialConfig glassSideSide; static MaterialConfig ironLeg; // GL_FRONT_AND_BACK, GL_FRONT or GL_BACK GLenum face; QColor materialAmbient; QColor materialDiffuse; QColor materialSpecular; QColor materialEmission; GLint materialShininess; void use(QOpenGLContext *context) { auto funcs = context->versionFunctions<QOpenGLFunctions_3_3_Compatibility>(); GLfloat tempColor[4]; writeColor(tempColor, materialAmbient); funcs->glMaterialfv(face, GL_AMBIENT, tempColor); writeColor(tempColor, materialDiffuse); funcs->glMaterialfv(face, GL_DIFFUSE, tempColor); writeColor(tempColor, materialSpecular); funcs->glMaterialfv(face, GL_SPECULAR, tempColor); writeColor(tempColor, materialEmission); funcs->glMaterialfv(face, GL_EMISSION, tempColor); funcs->glMateriali(face, GL_SHININESS, materialShininess); } void writeColor(float* to, const QColor& color) { to[0] = static_cast<GLfloat>(color.redF()); to[1] = static_cast<GLfloat>(color.greenF()); to[2] = static_cast<GLfloat>(color.blueF()); to[3] = static_cast<GLfloat>(color.alphaF()); } };
33.022222
85
0.704576
ae587eec282429d74d7851a399edf74de10b0336
9,513
css
CSS
digexp-dxsync/test/resources/server-sync-watch/themes/Theme One/css/deeper/blue/blue.css
SharikaN/WebDevToolkitForDx
c462a4090ae33deb8d3df4362aa14e7f626377e8
[ "Apache-2.0" ]
15
2015-05-26T14:54:37.000Z
2018-05-13T15:34:15.000Z
digexp-dxsync/test/resources/server-sync-watch/themes/Theme One/css/deeper/blue/blue.css
SharikaN/WebDevToolkitForDx
c462a4090ae33deb8d3df4362aa14e7f626377e8
[ "Apache-2.0" ]
13
2021-03-31T10:41:35.000Z
2022-03-17T22:19:49.000Z
test/resources/server-sync-watch/themes/Theme One/css/deeper/blue/blue.css
hcl-dx/dxsync
b626d4c74c869fac13751ea10db6bc9a087fc471
[ "Apache-2.0" ]
7
2015-06-25T06:21:38.000Z
2019-12-03T00:00:00.000Z
.wpthemeHeader{background-color: #003366; border-bottom: 1px solid #001F3F;}.wpthemeBannerInner {background: #06467A; background: -moz-linear-gradient(center top , #06467A 0%, #0A305F 100%) repeat scroll 0 0 #0A305F; background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#06467A), color-stop(100%,#0A305F)); background: -webkit-linear-gradient(top, #06467A 0%,#0A305F 100%); background: -o-linear-gradient(top, #06467A 0%,#0A305F 100%); background: -ms-linear-gradient(top, #06467A 0%,#0A305F 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#06467A', endColorstr='#0A305F',GradientType=0 ); background: linear-gradient(top, #06467A 0%,#0A305F 100%); border-top: 1px solid #06508C; border-bottom: 1px solid #072346;}.wpthemeBannerPrimaryNavigation .wpthemeBannerInner {background: #0d2552; background: -moz-linear-gradient(top, #0B2E5D 0%, #0d2552 100%) repeat scroll 0 0 #0d2552; background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#0B2E5D), color-stop(100%,#0d2552)); background: -webkit-linear-gradient(top, #0B2E5D 0%,#0d2552 100%); background: -o-linear-gradient(top, #0B2E5D 0%,#0d2552 100%); background: -ms-linear-gradient(top, #0B2E5D 0%,#0d2552 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#0B2E5D', endColorstr='#0d2552',GradientType=0 ); background: linear-gradient(top, #0B2E5D 0%,#0d2552 100%); border-top: 1px solid #0D3974;}.wpthemeBannerPrimaryNavigation {background: none repeat scroll 0 0 #c1c1c1; border-bottom: 1px solid #888; padding: 0 0 2px;} .wpthemeBanner .wpthemePrimaryNav li a:hover, .wpthemeBanner .wpthemePrimaryNav li a:active,.wpthemeBanner .wpthemePrimaryNav li a:focus {filter: none; background: rgba(76, 141, 191, 0.1); border-left-color: rgba(255, 255, 255, 0.2); border-right-color: rgba(255, 255, 255, 0.2);}.wpthemeBanner .wpthemePrimaryNav li.wpthemeSelected a, .wpthemeBanner .wpthemePrimaryNav li.wpthemeSelected a:link,.wpthemeBanner .wpthemePrimaryNav li.wpthemeSelected a:hover,.wpthemeBanner .wpthemePrimaryNav li.wpthemeSelected a:active, .wpthemeBanner .wpthemePrimaryNav li.wpthemeSelected a:focus {filter: none; background: none repeat scroll 0 0 #14396A; border-left-color: rgba(255, 255, 255, 0.2); border-right-color: rgba(255, 255, 255, 0.2);}.wpthemeBanner .wpthemeBranding img {background-position:0 -926px;}.wpthemeControlHeader{border-top: 3px solid #003366;}.wpthemeMobileNav.wpthemeMobileSide {background-color: #025FBD;}.wpthemeMobileNav ul.wpthemeExpandNav .wpthemeHasChildren > a,.wpthemeMobileNav > ul.wpthemeExpandNav ul.wpthemeExpandNav ul.wpthemeExpandNav ul.wpthemeExpandNav .wpthemeHasChildren a {border-right: 1px solid #002D59;}.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(n),.wpthemeMobileNav > ul.wpthemeExpandNav ul.wpthemeExpandNav ul.wpthemeExpandNav ul.wpthemeExpandNav .wpthemeNavListItem,.wpthemeMobileNav.wpthemeMobileSide {background-color: #026ED9;}.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(n) .wpthemeNavListItem a,.wpthemeMobileNav > ul.wpthemeExpandNav ul.wpthemeExpandNav ul.wpthemeExpandNav ul.wpthemeExpandNav .wpthemeNavListItem a {border-top: 1px solid #358FE8; border-bottom: 1px solid #004A94;}.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(n) ul.wpthemeExpandNav {border-bottom: 1px solid #358FE8;}.wpthemeMobileNav > ul.wpthemeExpandNav > .wpthemeNavListItem,.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(3) {background-color: #002D59;}.wpthemeMobileNav > ul.wpthemeExpandNav > .wpthemeNavListItem a,.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(3) .wpthemeNavListItem a {border-top: 1px solid #014385; border-bottom: 1px solid #000046;}.wpthemeMobileNav > ul.wpthemeExpandNav .wpthemeHasChildren a,.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(3) .wpthemeHasChildren a {border-right: 1px solid #000046;}.wpthemeMobileNav > ul.wpthemeExpandNav .wpthemeHasChildren a.wpthemeExpandBtn,.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(3) .wpthemeHasChildren a.wpthemeExpandBtn {border-left: 1px solid #014385;}.wpthemeMobileNav li.wpthemeNavSearch {border-bottom: 1px solid #000046;}.wpthemeMobileNav.wpthemeMobileSide ul.wpthemeExpandNav,#wpthemeNavRoot > ul.wpthemeExpandNav {border-bottom: 1px solid #014385;}.wpthemeMobileNav > ul.wpthemeExpandNav ul.wpthemeExpandNav .wpthemeNavListItem,.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(5) {background-color: #004A94;}.wpthemeMobileNav > ul.wpthemeExpandNav ul.wpthemeExpandNav .wpthemeNavListItem a,.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(5) .wpthemeNavListItem a {border-top: 1px solid #0066CC; border-bottom: 1px solid #002D59;}.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(5) ul.wpthemeExpandNav {border-bottom: 1px solid #0066CC;}.wpthemeMobileNav > ul.wpthemeExpandNav ul.wpthemeExpandNav .wpthemeHasChildren a,.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(5) .wpthemeHasChildren a {border-right: 1px solid #002D59;}.wpthemeMobileNav > ul.wpthemeExpandNav ul.wpthemeExpandNav .wpthemeHasChildren a.wpthemeExpandBtn,.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(5) .wpthemeHasChildren a.wpthemeExpandBtn {border-left: 1px solid #0066CC;}.wpthemeMobileNav > ul.wpthemeExpandNav ul.wpthemeExpandNav ul.wpthemeExpandNav .wpthemeNavListItem,.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(6) {background-color: #025FBD;}.wpthemeMobileNav > ul.wpthemeExpandNav ul.wpthemeExpandNav ul.wpthemeExpandNav .wpthemeNavListItem a,.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(6) .wpthemeNavListItem a {border-top: 1px solid #217DD9; border-bottom: 1px solid #002D59;}.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(6) ul.wpthemeExpandNav {border-bottom: 1px solid #217DD9;}.wpthemeMobileNav > ul.wpthemeExpandNav ul.wpthemeExpandNav ul.wpthemeExpandNav .wpthemeHasChildren a,.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(6) .wpthemeHasChildren a {border-right: 1px solid #002D59;}.wpthemeMobileNav > ul.wpthemeExpandNav ul.wpthemeExpandNav ul.wpthemeExpandNav ul.wpthemeExpandNav .wpthemeHasChildren a.wpthemeExpandBtn,.wpthemeMobileNav > ul.wpthemeExpandNav ul.wpthemeExpandNav ul.wpthemeExpandNav .wpthemeHasChildren a.wpthemeExpandBtn,.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(6) .wpthemeHasChildren a.wpthemeExpandBtn {border-left: 1px solid #217DD9;}.wpthemeMobileNav ul.wpthemeExpandNav .wpthemeNavListItem.wpthemeAncestor > a.wpthemeExpandBtn {border-left: 1px solid #010166;}.wpthemeMobileNav ul.wpthemeExpandNav a,.wpthemeMobileNav ul.wpthemeExpandNav a:hover,.wpthemeMobileNav ul.wpthemeExpandNav a:active,.wpthemeMobileNav ul.wpthemeExpandNav a:focus {color: #CCCCCC;}.wpthemeMobileNav ul.wpthemeExpandNav .wpthemeAncestor > a,.wpthemeMobileNav ul.wpthemeExpandNav .wpthemeAncestor > a:hover,.wpthemeMobileNav ul.wpthemeExpandNav .wpthemeAncestor > a:active,.wpthemeMobileNav ul.wpthemeExpandNav .wpthemeAncestor > a:focus {color: #00CCBE; background-color: #00001A;}.wpthemeMobileNav ul.wpthemeExpandNav .wpthemeSelected > a,.wpthemeMobileNav ul.wpthemeExpandNav .wpthemeSelected > a:hover,.wpthemeMobileNav ul.wpthemeExpandNav .wpthemeSelected > a:active,.wpthemeMobileNav ul.wpthemeExpandNav .wpthemeSelected > a:focus {color: #02EDDD; background-color: #00001A; border-left: 1px solid #000032 !important;}.wpthemeMobileNav ul.wpthemeExpandNav .wpthemeAncestor > a span {border-left: 6px solid #00CCBE; -webkit-border-image: -webkit-gradient(linear, 0 0, 0 100%, from(#37CCC2), to(#009187)) 0 0 0 100%; -webkit-border-image: -webkit-linear-gradient(#37CCC2, #009187) 0 0 0 100%;}.wpthemeMobileNav ul.wpthemeExpandNav .wpthemeSelected > a span {border-left: 6px solid #02EDDD; -webkit-border-image: -webkit-gradient(linear, 0 0, 0 100%, from(#98EDE7), to(#009E94)) 0 0 0 100%; -webkit-border-image: -webkit-linear-gradient(#98EDE7, #009E94) 0 0 0 100%;}.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(n) .wpthemeNavListItem.wpthemeAncestor a {background-color: #000036;}.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(n) .wpthemeNavListItem a:active,.wpthemeMobileNav > ul.wpthemeExpandNav ul.wpthemeExpandNav ul.wpthemeExpandNav ul.wpthemeExpandNav .wpthemeNavListItem a:active,.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(n) .wpthemeNavListItem a {background-color: #000036;}.wpthemeMobileNav > ul.wpthemeExpandNav .wpthemeNavListItem a:active,.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(3) .wpthemeNavListItem a:active {background-color: #000013;}.wpthemeMobileNav > ul.wpthemeExpandNav ul.wpthemeExpandNav .wpthemeNavListItem a:active,.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(5) .wpthemeNavListItem a:active {background-color: #000024;}.wpthemeMobileNav > ul.wpthemeExpandNav ul.wpthemeExpandNav ul.wpthemeExpandNav .wpthemeNavListItem a:active,.wpthemeMobileNav.wpthemeMobileSide:nth-of-type(6) .wpthemeNavListItem a:active {background-color: #00002D;}.wpthemeMobile #logoutlink, .wpthemeMobile #wpthemeLogin a {background: -moz-linear-gradient(center top , #06467A 0%, #0A305F 100%) repeat scroll 0 0 transparent; background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#06467A), color-stop(100%,#0A305F)); background: -webkit-linear-gradient(top, #06467A 0%,#0A305F 100%); background: -o-linear-gradient(top, #06467A 0%,#0A305F 100%); background: -ms-linear-gradient(top, #06467A 0%,#0A305F 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#06467A', endColorstr='#0A305F',GradientType=0 ); background: linear-gradient(top, #06467A 0%,#0A305F 100%); border: 2px solid #000022; color: #FFFFFF;}.wpthemeBanner .wpthemeMobileBorder {border-bottom: 3px solid #CCCCCC;}
9,513
9,513
0.808262
dbdde3280009c83f3cf416779670afc6377619ff
889
php
PHP
resources/views/welcome.blade.php
CE3Group3/UMaT-ORC
b5aaac3dbeccc96724ddd00c4da95ef9ae679583
[ "MIT" ]
null
null
null
resources/views/welcome.blade.php
CE3Group3/UMaT-ORC
b5aaac3dbeccc96724ddd00c4da95ef9ae679583
[ "MIT" ]
null
null
null
resources/views/welcome.blade.php
CE3Group3/UMaT-ORC
b5aaac3dbeccc96724ddd00c4da95ef9ae679583
[ "MIT" ]
null
null
null
@extends('layouts.master') @section('title' , 'Home') @section('head') <link href="{{URL::To('css/welcome.css')}}" rel='stylesheet' type='text/css'> @endsection @section('logout') @if(false) <a href="{{URL::to('student/logout')}}">Logout</a> @endif @endsection @section('content') <section class="wrapper"> <section class="leftCol"> <div class="cover-photo"><img src="{{URL::to('img/student.png')}}" alt=""/></div> <div class="text">Student</div> <a href="{{URL::to('student/login')}}" class="button">Proceed</a> </section>{{-- --}}<section class="rightCol"> <div class="cover-photo"><img src="{{URL::to('img/lecturer1.png')}}" alt=""/></div> <div class="text">Lecturer</div> <a href="{{URL::to('lecturer/login')}}" class="button">Proceed</a> </section> </section> @endsection
30.655172
95
0.563555
835d3cee2900e8674fb6599f97e62838dc3083cf
13,723
tsx
TypeScript
src/components/UserLinkProviderForm.tsx
katsu-o/firebase-auth-spa
c390a04e8fc1734ff280d61d7946eee224e6abed
[ "MIT" ]
6
2019-07-30T10:36:40.000Z
2020-05-06T14:52:36.000Z
src/components/UserLinkProviderForm.tsx
katsu-o/firebase-auth-spa
c390a04e8fc1734ff280d61d7946eee224e6abed
[ "MIT" ]
null
null
null
src/components/UserLinkProviderForm.tsx
katsu-o/firebase-auth-spa
c390a04e8fc1734ff280d61d7946eee224e6abed
[ "MIT" ]
null
null
null
import * as React from 'react'; import { Button, IconButton, CssBaseline, Divider, Paper, Radio, Grid, TextField, List, ListItem, ListItemIcon, ListItemText, InputAdornment, Typography, Theme, createStyles, WithStyles, withStyles, } from '@material-ui/core'; import classNames from 'classnames'; import { Visibility as VisibilityIcon, VisibilityOff as VisibilityOffIcon, Link as LinkIcon, LinkOff as LinkOffIcon, } from '@material-ui/icons'; import { Formik, FormikProps, FormikActions, Field, FieldProps } from 'formik'; // import Yup from 'yup'; import { ISigningInfo } from '../models/SigningInfo'; import { UserInfo } from '../models/UserInfo'; import { AuthProvider } from '../models/AuthProvider'; import AuthUtil from '../utilities/AuthUtil'; import IconUtil from '../utilities/IconUtil'; import { isGmail } from '../utilities/misc'; const styles = (theme: Theme) => createStyles({ paper: { marginTop: theme.spacing.unit * 0, display: 'flex', flexDirection: 'column', alignItems: 'start', textAlign: 'left', padding: `${theme.spacing.unit * 1}px ${theme.spacing.unit * 3}px ${theme.spacing.unit * 1}px`, }, form: { width: '100%', // Fix IE11 issue. marginTop: theme.spacing.unit * 0, }, chapterHeading: { textDecoration: 'underline', marginBottom: theme.spacing.unit * 1, }, list: { width: '100%', borderRadius: '2px', display: 'inline-block', margin: 0, paddingTop: 0, paddingBottom: 0, boxShadow: '0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)', }, listItem: { paddingLeft: theme.spacing.unit * 2, paddingRight: theme.spacing.unit * 2, paddingTop: theme.spacing.unit, paddingBottom: theme.spacing.unit, }, listItemText: { margin: 0, }, listItemTextLinked: { margin: 0, color: theme.palette.primary.main, wordWrap: 'break-word', }, radio: { padding: 0, marginRight: theme.spacing.unit, }, divider: { marginTop: theme.spacing.unit, marginBottom: theme.spacing.unit, }, submit: { marginTop: theme.spacing.unit, marginLeft: theme.spacing.unit * 0, marginRight: theme.spacing.unit, textTransform: 'none', }, submitUnlink: { backgroundColor: theme.palette.error.main, '&:hover': { backgroundColor: theme.palette.error.dark, }, }, buttonIcon: { verticalAlign: 'middle', marginRight: theme.spacing.unit, }, bannedReason: { marginTop: theme.spacing.unit * 1, marginRight: theme.spacing.unit * 1, }, }); // props from parent interface IOwnProps extends WithStyles<typeof styles> { authenticatedUser: UserInfo; authenticatedUserTimestamp?: number; onAddLink: (signing: ISigningInfo) => void; onRemoveLink: (signing: ISigningInfo) => void; authProviders: AuthProvider[]; submitting?: boolean; disabled?: boolean; } // local state of this component interface State {} // entire props of this component type Props = IOwnProps & State; // Formik form values interface FormValues { password: string; selectedAuthProvider: AuthProvider | undefined; isLinked: boolean; passwordVisibility: boolean; pseudo: number; // for form reset } const validate = (values: FormValues) => { const errors: any = {}; // selectedProvider === 'Password' && isLinked === false の時だけ、パスワードチェック if (values.selectedAuthProvider === 'Password' && !values.isLinked) { if (!values.password) { errors.password = 'Required'; } else if (values.password.length < 6) { errors.password = 'At least 6 characters'; } } return errors; }; const CustomTextFieldComponent = ({ field, form, ...props }: FieldProps<FormValues>) => ( <TextField onChange={form.handleChange(field.name)} // tslint:disable-next-line jsx-no-lambda onBlur={e => form.handleBlur(field.name)} value={field.value} disabled={form.isSubmitting} error={form.touched[field.name] && form.errors[field.name] !== undefined} helperText={form.errors[field.name]} {...props} /> ); const UserLinkProviderForm = (props: Props) => { const { classes, authenticatedUser, submitting, authenticatedUserTimestamp, authProviders, onAddLink, onRemoveLink, disabled, } = props; const authenticated = Boolean(authenticatedUser); const iv: FormValues = { password: '', selectedAuthProvider: undefined, isLinked: false, passwordVisibility: false, pseudo: authenticatedUserTimestamp || 0, }; const preventFormSubmit = (e: React.FormEvent) => { e.preventDefault(); }; const handleFormikSubmit = (values: FormValues, formikActions: FormikActions<FormValues>) => { // フォーム側では状態管理しない formikActions.setSubmitting(false); const signing: ISigningInfo = { userName: null, email: authenticatedUser ? authenticatedUser.email : null, password: values.password, authProvider: values.selectedAuthProvider || null, }; // 条件分岐 values.isLinked ? onRemoveLink(signing) : onAddLink(signing); }; const render = (formikBag: FormikProps<FormValues>) => { const { selectedAuthProvider } = formikBag.values; // リンク済みの認証プロバイダが 1 つかどうか const isOnlyOneProviderLink = authenticatedUser && authenticatedUser.providerData ? authenticatedUser.providerData.length === 1 : false; // 辻褄の合わないアカウントとして更新しようとしているか否か // ※仮にこれで更新すると、@gmail.com でありながら Google 認証が存在しないアカウントとなる。 // この状態で再度 Google 認証で Sign In すると Google 認証が勝手に紐づいてしまうため、これを避ける。 // 運用ポリシー: Sign In でプロバイダ認証の追加はさせない。 // 1. リンク済みの Gmail 認証を選択している // 2. アカウントの Email アドレスが @gmail.com const isInconsistentAccountToBeUpdated = selectedAuthProvider === 'Google' && AuthUtil.isLinkedAuthProvider(authenticatedUser, 'Google') && (authenticatedUser && authenticatedUser.email && isGmail(authenticatedUser.email)) ? true : false; // リンク解除禁止是非 const isRemoveLinkBanned = isOnlyOneProviderLink || isInconsistentAccountToBeUpdated; // リンク解除を禁止する場合のメッセージ const bannedReason = isOnlyOneProviderLink ? 'Since it is the last one, can not be deleted.' : isInconsistentAccountToBeUpdated ? "If the account's email address is @gmail.com, you can not cancel Google authentication." : ''; const handleTogglePasswordVisibility = (e: React.MouseEvent) => { formikBag.setFieldValue('passwordVisibility', !formikBag.values.passwordVisibility); }; const handleListItemClick = (authProvider: AuthProvider) => (event: React.MouseEvent) => { formikBag.setFieldValue('selectedAuthProvider', selectedAuthProvider !== authProvider ? authProvider : undefined); formikBag.setFieldTouched('selectedAuthProvider'); formikBag.setFieldValue('isLinked', AuthUtil.isLinkedAuthProvider(authenticatedUser, authProvider)); formikBag.setFieldTouched('isLinked'); }; const submitClassname = classNames(classes.submit, { [classes.submitUnlink]: selectedAuthProvider && AuthUtil.isLinkedAuthProvider(authenticatedUser, selectedAuthProvider), }); return ( <Paper className={classes.paper}> <Typography variant="h6" className={classes.chapterHeading}> Providers </Typography> <form className={classes.form} onSubmit={preventFormSubmit}> <Grid container={true} direction="row" justify="flex-start" alignItems="center"> <Grid item={true} xs={12}> <List className={classes.list}> {authProviders.map((provider, idx) => { const isLinked = AuthUtil.isLinkedAuthProvider(authenticatedUser, provider); const userInfo = AuthUtil.getAuthProviderUserInfo(authenticatedUser, provider); return ( <React.Fragment key={provider}> <ListItem className={classes.listItem} button={true} onClick={handleListItemClick(provider)} disabled={disabled} > <Grid container={true} direction="row" justify="space-between" alignItems="center"> <Grid item={true}> <Radio className={classes.radio} checked={provider === selectedAuthProvider} disabled={disabled} /> </Grid> <Grid item={true}> <ListItemIcon className={classes.buttonIcon}> {IconUtil.renderAuthProviderIcon(provider)} </ListItemIcon> </Grid> <Grid item={true} xs={3}> <ListItemText className={classes.listItemText} primary={provider} /> </Grid> <Grid item={true} xs={3}> <ListItemText classes={{ primary: classes.listItemTextLinked }} primary={isLinked ? userInfo && userInfo.email : ''} secondary={isLinked ? userInfo && userInfo.displayName : ''} /> </Grid> <Grid item={true} xs={2}> <ListItemText classes={{ primary: classes.listItemTextLinked }} primary={isLinked ? 'Linked' : ''} /> </Grid> </Grid> </ListItem> {idx < authProviders.length - 1 && <Divider />} </React.Fragment> ); })} </List> </Grid> </Grid> <Grid container={true} direction="row" justify="flex-start" alignItems="center"> <Grid item={true} xs={12}> <Field label="Password" margin="dense" required={true} fullWidth={true} name="password" type={formikBag.values.passwordVisibility ? 'text' : 'password'} autoComplete="current-password" variant="outlined" disabled={ !authenticated || submitting || disabled || (selectedAuthProvider !== 'Password' || AuthUtil.isLinkedAuthProvider(authenticatedUser, 'Password')) } InputProps={{ endAdornment: ( <InputAdornment position="end"> <IconButton aria-label="Toggle password visibility" onClick={handleTogglePasswordVisibility} disabled={ !authenticated || submitting || disabled || (selectedAuthProvider !== 'Password' || AuthUtil.isLinkedAuthProvider(authenticatedUser, 'Password')) } > {formikBag.values.passwordVisibility ? <VisibilityOffIcon /> : <VisibilityIcon />} </IconButton> </InputAdornment> ), }} component={CustomTextFieldComponent} /> </Grid> </Grid> <Grid container={true} direction="row" justify="flex-end" alignItems="center"> {selectedAuthProvider && isRemoveLinkBanned && ( <Grid item={true}> <Typography variant="caption" className={classes.bannedReason}> {bannedReason} </Typography> </Grid> )} <Grid item={true}> <Button type="button" fullWidth={true} variant="contained" color="primary" className={submitClassname} disabled={ !authenticated || submitting || !formikBag.isValid || disabled || !selectedAuthProvider || (selectedAuthProvider && isRemoveLinkBanned) } onClick={formikBag.submitForm} > {selectedAuthProvider && AuthUtil.isLinkedAuthProvider(authenticatedUser, selectedAuthProvider) ? ( <React.Fragment> <LinkOffIcon className={classes.buttonIcon} /> Unlink </React.Fragment> ) : ( <React.Fragment> <LinkIcon className={classes.buttonIcon} /> Link </React.Fragment> )} </Button> </Grid> </Grid> </form> </Paper> ); }; return ( <React.Fragment> <CssBaseline /> <Formik enableReinitialize={true} initialValues={iv} validate={validate} onSubmit={handleFormikSubmit} render={render} /> </React.Fragment> ); }; export default withStyles(styles)(UserLinkProviderForm);
33.800493
120
0.555928
796fd40c190307cfe5d162508b42374496153d5c
5,248
php
PHP
2021/CVE-2021-24945/vultarget/likebtn-like-button/includes/meta_columns.php
hjyuan/reapoc
ef515e56c44c2590ff8601582bf6c08e076e7083
[ "Apache-2.0" ]
421
2021-12-07T08:46:40.000Z
2022-03-31T12:42:16.000Z
2021/CVE-2021-24945/vultarget/likebtn-like-button/includes/meta_columns.php
LinShiG0ng/reapoc
99ebfcca818928eca79c0a2dcc2e466bc8f3e734
[ "Apache-2.0" ]
1
2022-03-14T06:07:39.000Z
2022-03-14T15:52:22.000Z
2021/CVE-2021-24945/vultarget/likebtn-like-button/includes/meta_columns.php
LinShiG0ng/reapoc
99ebfcca818928eca79c0a2dcc2e466bc8f3e734
[ "Apache-2.0" ]
144
2021-12-07T11:06:14.000Z
2022-03-31T07:41:35.000Z
<?php /** * Posts columns */ // Column names define('LIKEBTN_COLUMN_LIKES', 'likebtn-likes'); define('LIKEBTN_COLUMN_DISLIKES', 'likebtn-dislikes'); define('LIKEBTN_COLUMN_LMD', 'likebtn-lmd'); // Set meta column hooks function likebtn_meta_columns_setup_hooks() { _likebtn_set_post_type_hooks(); //add_action('restrict_manage_posts', 'likebtn_posts_filter_dropdown'); add_filter('request', 'likebtn_column_sort_orderby'); } add_action('admin_init', 'likebtn_meta_columns_setup_hooks'); // Set the hooks for the post_types function _likebtn_set_post_type_hooks() { $post_types = _likebtn_get_entities(true, false, false, 'keys'); if (is_array($post_types) && !empty($post_types)) { foreach ($post_types as $pt) { if (_likebtn_is_metabox_hidden($pt) === false) { add_filter('manage_' . $pt . '_posts_columns', 'likebtn_column_heading', 10, 1); add_action('manage_' . $pt . '_posts_custom_column', 'likebtn_column_content', 10, 2); add_action('manage_edit-' . $pt . '_sortable_columns', 'likebtn_column_sort', 10, 2); /* * Use the `get_user_option_{$option}` filter to change the output of the get_user_option * function for the `manage{$screen}columnshidden` option, which is based on the current * admin screen. The admin screen we want to target is the `edit-{$post_type}` screen. */ $filter = sprintf('get_user_option_%s', sprintf('manage%scolumnshidden', 'edit-' . $pt)); add_filter($filter, 'likebtn_column_hidden', 10, 3); } } } } // Test whether the metabox should be hidden either by choice of the admin or because // the post type is not a public post type function _likebtn_is_metabox_hidden($post_type = null) { return false; } function likebtn_column_heading($columns) { if (_likebtn_is_metabox_hidden()) { return $columns; } return array_merge($columns, array( LIKEBTN_COLUMN_LIKES => __('Likes', 'likebtn-like-button'), LIKEBTN_COLUMN_DISLIKES => __('Dislikes', 'likebtn-like-button'), LIKEBTN_COLUMN_LMD => __('Likes minus dislikes', 'likebtn-like-button'), )); } function likebtn_column_content($column_name, $post_id) { if (_likebtn_is_metabox_hidden()) { return; } switch ($column_name) { case LIKEBTN_COLUMN_LIKES: echo (int)get_post_meta($post_id, LIKEBTN_META_KEY_LIKES, true); break; case LIKEBTN_COLUMN_DISLIKES: echo (int)get_post_meta($post_id, LIKEBTN_META_KEY_DISLIKES, true); break; case LIKEBTN_COLUMN_LMD: echo (int)get_post_meta($post_id, LIKEBTN_META_KEY_LIKES_MINUS_DISLIKES, true); break; } } // Indicate which of the columns are sortable. function likebtn_column_sort($columns) { if (_likebtn_is_metabox_hidden()) { return $columns; } $columns[LIKEBTN_COLUMN_LIKES] = LIKEBTN_COLUMN_LIKES; $columns[LIKEBTN_COLUMN_DISLIKES] = LIKEBTN_COLUMN_DISLIKES; $columns[LIKEBTN_COLUMN_LMD] = LIKEBTN_COLUMN_LMD; return $columns; } // Hide Likes minus dislikes by default function likebtn_column_hidden($result, $option, $user) { global $wpdb; $prefix = $wpdb->get_blog_prefix(); if (!$user->has_prop($prefix . $option) && !$user->has_prop($option)) { if (!is_array($result)) { $result = array(); } array_push($result, LIKEBTN_COLUMN_LMD); } return $result; } // Modify the query based on the orderby variable in $_GET function likebtn_column_sort_orderby($vars) { if (isset($vars['orderby'])) { $vars = array_merge($vars, likebtn_filter_order_by($vars['orderby'])); } return $vars; } // Returning filters when $order_by is matched in the if-statement function likebtn_filter_order_by($order_by) { switch ($order_by) { case LIKEBTN_COLUMN_LIKES: return array( //'meta_key' => LIKEBTN_META_KEY_LIKES, 'orderby' => 'meta_value_num', 'meta_query' => array( 'relation' => 'OR', array( 'key' => LIKEBTN_META_KEY_LIKES, 'compare' => 'NOT EXISTS', 'type' => 'numeric' ), array( 'key' => LIKEBTN_META_KEY_LIKES, 'compare' => 'EXISTS', 'type' => 'numeric' ) ) ); break; case LIKEBTN_COLUMN_DISLIKES: return array( //'meta_key' => LIKEBTN_META_KEY_DISLIKES, 'orderby' => 'meta_value', 'meta_query' => array( 'relation' => 'OR', array( 'key' => LIKEBTN_META_KEY_DISLIKES, 'compare' => 'NOT EXISTS', 'type' => 'numeric' ), array( 'key' => LIKEBTN_META_KEY_DISLIKES, 'compare' => 'EXISTS', 'type' => 'numeric' ) ) ); break; case LIKEBTN_COLUMN_LMD: return array( //'meta_key' => LIKEBTN_META_KEY_LIKES_MINUS_DISLIKES, 'orderby' => 'meta_value', 'meta_query' => array( 'relation' => 'OR', array( 'key' => LIKEBTN_META_KEY_LIKES_MINUS_DISLIKES, 'compare' => 'NOT EXISTS', 'type' => 'numeric' ), array( 'key' => LIKEBTN_META_KEY_LIKES_MINUS_DISLIKES, 'compare' => 'EXISTS', 'type' => 'numeric' ) ) ); break; } return array(); }
27.914894
93
0.640053
98188d3ad025301c9c90c992a2cd2817b5b3bfb1
4,682
py
Python
bench_cli/configuration.py
systay/arewefastyet
f21f3c0c63b5e3729d946bd2283004641b427aad
[ "Apache-2.0" ]
null
null
null
bench_cli/configuration.py
systay/arewefastyet
f21f3c0c63b5e3729d946bd2283004641b427aad
[ "Apache-2.0" ]
null
null
null
bench_cli/configuration.py
systay/arewefastyet
f21f3c0c63b5e3729d946bd2283004641b427aad
[ "Apache-2.0" ]
1
2021-09-03T16:06:08.000Z
2021-09-03T16:06:08.000Z
# ------------------------------------------------------------------------------------------------------------------------------------ # Copyright 2021 The Vitess Authors. # 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. # # demonstrates to: # - returns data from config.yaml file # ------------------------------------------------------------------------------------------------------------------------------------- import yaml import os from typing import Dict import bench_cli.connection as connection class Config: def __init__(self, cfg: Dict[str, any]): self.config_file: str = None # Web related self.web: bool = None self.web_api_key: str = None # Task related self.tasks: [str] = None self.tasks_run_oltp: bool = None self.tasks_run_tpcc: bool = None self.tasks_run_all: bool = None self.tasks_commit: str = None self.tasks_source: str = None self.tasks_inventory_file: str = None self.tasks_ansible_dir: str = None self.tasks_scripts_dir: str = None self.tasks_reports_dir: str = None self.tasks_pprof: str = None self.tasks_pprof_options = None self.tasks_upload_to_aws = None # MySQL related self.mysql_host: str = None self.mysql_username: str = None self.mysql_password: str = None self.mysql_database: str = None # Packet related self.packet_token: str = None self.packet_project_id: str = None # Slack related self.slack_api_token: str = None self.slack_channel: str = None # Other commands self.delete_benchmark: str = None if cfg.get("config_file") is not None: self.__load_config(self.__read_from_file(cfg.get("config_file"))) self.__load_config(cfg) self.__parse() def __read_from_file(self, file: str): with open(file) as f: return yaml.load(f, Loader=yaml.SafeLoader) def __load_config(self, cfg) -> None: for key in cfg: if cfg[key] is not None: setattr(self, key, cfg[key]) def __parse(self): self.__parse_profiling() self.__parse_run_task() def __parse_profiling(self): self.tasks_pprof_options = None if self.tasks_pprof is None: return splits = self.tasks_pprof.split("/") pprof_targets = splits[:len(splits) - 1] pprof_args = splits[-1] if len(pprof_targets) == 0 or ("vttablet" not in pprof_targets and "vtgate" not in pprof_targets): raise AttributeError("profiling needs a target (vttablet, vtgate)") # TODO: check pprof_args based on vitess check self.tasks_pprof_options = { "targets": pprof_targets, "args": pprof_args, } def __parse_run_task(self): self.tasks = [] if self.tasks_run_oltp or self.tasks_run_all: self.tasks.append("oltp") if self.tasks_run_tpcc or self.tasks_run_all: self.tasks.append("tpcc") def get_inventory_file_path(self) -> str: """ Build the inventory file path from the given ansible directory and inventory file. @return: str """ return os.path.join(self.tasks_ansible_dir, self.tasks_inventory_file) def unsafe_dump(self, echo=True) -> str: """ Dumps the configuration data. @param echo: If True, prints the dump @return: str """ attrs = vars(self) dumpstr = '\n'.join("%s: %s" % item for item in attrs.items()) if echo: print(dumpstr) return dumpstr def valid_to_run(self) -> bool: """ Check if the configuration allows us to run tests. @return: bool """ if not self.tasks_commit or not self.tasks_source or not self.tasks_inventory_file: return False return True def mysql_connect(self): """ Connect to the mysql. """ return connection.connectdb(self.mysql_host, self.mysql_username, self.mysql_password, self.mysql_database)
33.927536
135
0.591841
387d47191d49828ad5d3f0d05b34d9b331b188ec
315
php
PHP
resources/views/termekek/show.blade.php
takristof/KreativOtletcentrum
a0d05c31fbad7eb3a7617511f4ac95a986cdb3dc
[ "MIT" ]
null
null
null
resources/views/termekek/show.blade.php
takristof/KreativOtletcentrum
a0d05c31fbad7eb3a7617511f4ac95a986cdb3dc
[ "MIT" ]
null
null
null
resources/views/termekek/show.blade.php
takristof/KreativOtletcentrum
a0d05c31fbad7eb3a7617511f4ac95a986cdb3dc
[ "MIT" ]
null
null
null
@extends('layout') @section('title', $termekek->termek_nev) @section('content') <h1> {{ $termekek->termek_nev }}</h1> <p>A termék ára: {{ $termekek->ar }} Ft</p> <p>Elérhető mennyiség: {{ $termekek->mennyiseg }} db</p> <p>Elérhető-e jelenleg a termék: {{ $termekek->elerheto_e }} </p> @endsection
28.636364
69
0.619048
35f701f1ab7d83d91cbd9e7f9eb415b23acb9406
1,238
cc
C++
media/gpu/android/mock_android_video_surface_chooser.cc
zipated/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
2,151
2020-04-18T07:31:17.000Z
2022-03-31T08:39:18.000Z
media/gpu/android/mock_android_video_surface_chooser.cc
cangulcan/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
395
2020-04-18T08:22:18.000Z
2021-12-08T13:04:49.000Z
media/gpu/android/mock_android_video_surface_chooser.cc
cangulcan/src
2b8388091c71e442910a21ada3d97ae8bc1845d3
[ "BSD-3-Clause" ]
338
2020-04-18T08:03:10.000Z
2022-03-29T12:33:22.000Z
// Copyright 2017 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "media/gpu/android/mock_android_video_surface_chooser.h" namespace media { MockAndroidVideoSurfaceChooser::MockAndroidVideoSurfaceChooser() = default; MockAndroidVideoSurfaceChooser::~MockAndroidVideoSurfaceChooser() = default; void MockAndroidVideoSurfaceChooser::SetClientCallbacks( UseOverlayCB use_overlay_cb, UseTextureOwnerCB use_texture_owner_cb) { MockSetClientCallbacks(); use_overlay_cb_ = std::move(use_overlay_cb); use_texture_owner_cb_ = std::move(use_texture_owner_cb); } void MockAndroidVideoSurfaceChooser::UpdateState( base::Optional<AndroidOverlayFactoryCB> factory, const State& new_state) { MockUpdateState(); if (factory) { factory_ = std::move(*factory); MockReplaceOverlayFactory(!factory_.is_null()); } current_state_ = new_state; } void MockAndroidVideoSurfaceChooser::ProvideTextureOwner() { use_texture_owner_cb_.Run(); } void MockAndroidVideoSurfaceChooser::ProvideOverlay( std::unique_ptr<AndroidOverlay> overlay) { use_overlay_cb_.Run(std::move(overlay)); } } // namespace media
30.195122
76
0.78433
df2a5de708503d8b070108138fe704c4e00038ef
1,118
rb
Ruby
lib/teracy-dev-v05-compat/processors/provisioner_id_deprecated_removal.rb
hoatle/teracy-dev-v05-compat
e6ed9ec67ec5ba8ed2fa3b535b34ad965e33b126
[ "MIT" ]
1
2018-08-20T10:50:08.000Z
2018-08-20T10:50:08.000Z
lib/teracy-dev-v05-compat/processors/provisioner_id_deprecated_removal.rb
hoatle/teracy-dev-v05-compat
e6ed9ec67ec5ba8ed2fa3b535b34ad965e33b126
[ "MIT" ]
35
2018-10-10T04:30:52.000Z
2020-03-05T07:57:06.000Z
lib/teracy-dev-v05-compat/processors/provisioner_id_deprecated_removal.rb
hoatle/teracy-dev-v05-compat
e6ed9ec67ec5ba8ed2fa3b535b34ad965e33b126
[ "MIT" ]
2
2018-08-28T09:42:12.000Z
2018-10-09T23:33:13.000Z
require 'teracy-dev/processors/processor' module TeracyDevV05Compat module Processors # a workaround to fix the following problem: # $ vagrant up # Bringing machine 'teracy-dev.local' up with 'virtualbox' provider... # There are errors in the configuration of this machine. Please fix # the following errors and try again: # chef solo provisioner: # * The following settings shouldn't exist: _id_deprecated # # @see: https://github.com/teracyhq-incubator/teracy-dev-core/issues/58 class ProvisionerIdDeprecatedRemoval < TeracyDev::Processors::Processor def process(settings) settings['nodes'].each_with_index do |node, node_idx| node['provisioners'].each_with_index do |provisioner, idx| if !provisioner['_id_deprecated'].nil? provisioner.delete('_id_deprecated') node['provisioners'][idx] = provisioner settings['nodes'][node_idx] = node end end unless node['provisioners'].nil? end unless settings['nodes'].nil? return settings end end end end
36.064516
75
0.665474
56a2f24efa7465dfca0e6951e474b3eab2521d9f
3,275
rs
Rust
src/objects/bytearray.rs
thanatos/pyo3
25514f69da6faa1e785e7f3ed1aa18486a3b8624
[ "Apache-2.0" ]
null
null
null
src/objects/bytearray.rs
thanatos/pyo3
25514f69da6faa1e785e7f3ed1aa18486a3b8624
[ "Apache-2.0" ]
4
2019-01-24T18:41:24.000Z
2021-12-07T17:10:17.000Z
src/objects/bytearray.rs
thanatos/pyo3
25514f69da6faa1e785e7f3ed1aa18486a3b8624
[ "Apache-2.0" ]
null
null
null
// Copyright (c) 2017-present PyO3 Project and Contributors use std; use std::os::raw::c_char; use ffi; use object::PyObject; use instance::PyObjectWithToken; use python::{Python, ToPyPointer}; use err::{PyResult, PyErr}; /// Represents a Python `bytearray`. pub struct PyByteArray(PyObject); pyobject_convert!(PyByteArray); pyobject_nativetype!(PyByteArray, PyByteArray_Type, PyByteArray_Check); impl PyByteArray { /// Creates a new Python bytearray object. /// The byte string is initialized by copying the data from the `&[u8]`. /// /// Panics if out of memory. pub fn new<'p>(py: Python<'p>, src: &[u8]) -> &'p PyByteArray { let ptr = src.as_ptr() as *const c_char; let len = src.len() as ffi::Py_ssize_t; unsafe { py.from_owned_ptr::<PyByteArray>( ffi::PyByteArray_FromStringAndSize(ptr, len)) } } /// Creates a new Python bytearray object /// from other PyObject, that implements the buffer protocol. pub fn from<'p, I>(py: Python<'p>, src: &'p I) -> PyResult<&'p PyByteArray> where I: ToPyPointer { unsafe { py.from_owned_ptr_or_err( ffi::PyByteArray_FromObject(src.as_ptr())) } } /// Gets the length of the bytearray. #[inline] pub fn len(&self) -> usize { // non-negative Py_ssize_t should always fit into Rust usize unsafe { ffi::PyByteArray_Size(self.0.as_ptr()) as usize } } /// Check if bytearray is empty. pub fn is_empty(&self) -> bool { self.len() == 0 } /// Gets the Python bytearray data as byte slice. #[cfg_attr(feature = "cargo-clippy", allow(mut_from_ref))] pub fn data(&self) -> &mut [u8] { unsafe { let buffer = ffi::PyByteArray_AsString(self.0.as_ptr()) as *mut u8; let length = ffi::PyByteArray_Size(self.0.as_ptr()) as usize; std::slice::from_raw_parts_mut(buffer, length) } } /// Resize bytearray object. pub fn resize(&self, len: usize) -> PyResult<()> { unsafe { let result = ffi::PyByteArray_Resize(self.0.as_ptr(), len as ffi::Py_ssize_t); if result == 0 { Ok(()) } else { Err(PyErr::fetch(self.py())) } } } } #[cfg(test)] mod test { use exc; use python::Python; use object::PyObject; use objects::PyByteArray; #[test] fn test_bytearray() { let gil = Python::acquire_gil(); let py = gil.python(); let src = b"Hello Python"; let bytearray = PyByteArray::new(py, src); assert_eq!(src.len(), bytearray.len()); assert_eq!(src, bytearray.data()); let ba: PyObject = bytearray.into(); let bytearray = PyByteArray::from(py, &ba).unwrap(); assert_eq!(src.len(), bytearray.len()); assert_eq!(src, bytearray.data()); bytearray.resize(20).unwrap(); assert_eq!(20, bytearray.len()); let none = py.None(); if let Err(err) = PyByteArray::from(py, &none) { assert!(err.is_instance::<exc::TypeError>(py)); } else { panic!("error"); } drop(none); } }
28.478261
90
0.570687
27cf2817638ad01feea81c7b3bee4644f0e19e16
303
rb
Ruby
spec/scraper_spec.rb
Adjoa/hack_design-cli-app
0fbcb97c39f57c52052986b6774b356112cccb9f
[ "MIT" ]
null
null
null
spec/scraper_spec.rb
Adjoa/hack_design-cli-app
0fbcb97c39f57c52052986b6774b356112cccb9f
[ "MIT" ]
null
null
null
spec/scraper_spec.rb
Adjoa/hack_design-cli-app
0fbcb97c39f57c52052986b6774b356112cccb9f
[ "MIT" ]
1
2019-12-10T14:59:06.000Z
2019-12-10T14:59:06.000Z
RSpec.describe Scraper do describe '.scrape_lessons_page' do it 'returns an array of objects containing lesson title and url pairs' do lessons_array = Scraper.scrape_lessons_page expect(lessons_array).to be_an(Array) end end # describe '.scrape_lesson' do # end end
25.25
77
0.709571
011ed1f0d2a9daea4d4798fb570570180229bf89
35,009
rb
Ruby
test/unit/person_test.rb
stuzart/seek
9aa1ceeae33d20b4fe409b437eddcc3698721319
[ "BSD-3-Clause" ]
null
null
null
test/unit/person_test.rb
stuzart/seek
9aa1ceeae33d20b4fe409b437eddcc3698721319
[ "BSD-3-Clause" ]
null
null
null
test/unit/person_test.rb
stuzart/seek
9aa1ceeae33d20b4fe409b437eddcc3698721319
[ "BSD-3-Clause" ]
null
null
null
require 'test_helper' class PersonTest < ActiveSupport::TestCase fixtures :users, :people # Replace this with your real tests. def test_work_groups p=Factory(:person_in_multiple_projects) assert_equal 3,p.work_groups.size end test "registered user's profile can be edited by" do admin = Factory(:admin) project_administrator = Factory(:project_administrator) project_administrator2 = Factory(:project_administrator) person = Factory :person,:group_memberships=>[Factory(:group_membership,:work_group=>project_administrator.group_memberships.first.work_group)] another_person = Factory :person assert_equal person.projects,project_administrator.projects assert_not_equal person.projects,project_administrator2.projects assert person.can_be_edited_by?(person.user) assert !person.can_be_edited_by?(project_administrator.user),"should not be editable by the project administrator of the same project, as user is registered" assert person.can_be_edited_by?(admin.user) assert !person.can_be_edited_by?(another_person.user) assert !person.can_be_edited_by?(project_administrator2.user),"should be not editable by the project administrator of another project" assert person.can_be_edited_by?(person), "You can also ask by passing in a person" assert !person.can_be_edited_by?(project_administrator),"You can also ask by passing in a person" end test "userless profile can be edited by" do admin = Factory(:admin) project_administrator = Factory(:project_administrator) project_administrator2 = Factory(:project_administrator) profile = Factory :brand_new_person,:group_memberships=>[Factory(:group_membership,:work_group=>project_administrator.group_memberships.first.work_group)] another_person = Factory :person assert_equal profile.projects,project_administrator.projects assert_not_equal profile.projects,project_administrator2.projects assert profile.can_be_edited_by?(project_administrator.user),"should be editable by the project administrator of the same project, as user is not registered" assert profile.can_be_edited_by?(admin.user) assert !profile.can_be_edited_by?(another_person.user) assert !profile.can_be_edited_by?(project_administrator2.user),"should be not editable by the project administrator of another project" assert profile.can_be_edited_by?(project_administrator),"You can also ask by passing in a person" end test "me?" do person = Factory(:person) refute person.me? User.current_user = person.user assert person.me? person = Factory(:brand_new_person) assert_nil person.user refute person.me? User.current_user = nil refute person.me? end test "programmes" do person1=Factory(:person) prog = Factory(:programme,:projects=>person1.projects) prog2 = Factory(:programme) assert_includes person1.programmes,prog refute_includes person1.programmes,prog2 end test "can be administered by" do admin = Factory(:admin) admin2 = Factory(:admin) project_administrator = Factory(:project_administrator) person_in_same_project = Factory :person,:group_memberships=>[Factory(:group_membership,:work_group=>project_administrator.group_memberships.first.work_group)] person_in_different_project = Factory :person assert admin.can_be_administered_by?(admin.user),"admin can administer themself" assert admin2.can_be_administered_by?(admin.user),"admin can administer another admin" assert project_administrator.can_be_administered_by?(admin.user),"admin should be able to administer another project administrator" assert person_in_same_project.can_be_administered_by?(project_administrator.user),"project administrator should be able to administer someone from same project" assert person_in_different_project.can_be_administered_by?(project_administrator.user),"project administrator should be able to administer someone from another project" assert !project_administrator.can_be_administered_by?(person_in_same_project.user),"a normal person cannot administer someone else" assert !project_administrator.can_be_administered_by?(project_administrator.user),"project administrator should not administer himself" assert !person_in_same_project.can_be_administered_by?(person_in_same_project.user), "person should not administer themself" assert !person_in_same_project.can_be_administered_by?(nil) assert project_administrator.can_be_administered_by?(admin),"you can also ask by passing a person" assert person_in_same_project.can_be_administered_by?(project_administrator),"you can also ask by passing a person" #can be administered by a programme administrator pa = Factory :programme_administrator assert Factory(:person).can_be_administered_by?(pa.user) end test "project administrator cannot edit an admin within their project" do admin = Factory(:admin) project_administrator = Factory(:project_administrator,:group_memberships=>[Factory(:group_membership,:work_group=>admin.group_memberships.first.work_group)]) assert !(admin.projects & project_administrator.projects).empty? assert !admin.can_be_edited_by?(project_administrator) end #checks the updated_at doesn't get artificially changed between created and reloading def test_updated_at person = Factory(:person, :updated_at=>1.week.ago) updated_at = person.updated_at person = Person.find(person.id) assert_equal updated_at.to_s,person.updated_at.to_s end test "to_rdf" do object = Factory :person, :skype_name=>"skypee",:email=>"sdkfhsd22fkhfsd@sdkfsdkhfkhsdf.com" Factory(:study,:contributor=>object) Factory(:investigation,:contributor=>object) Factory(:assay,:contributor=>object) Factory(:assay,:contributor=>object) Factory(:assets_creator,:creator=>object) Factory(:assets_creator,:asset=>Factory(:sop),:creator=>object) object.web_page="http://google.com" disable_authorization_checks do object.save! end object.reload rdf = object.to_rdf RDF::Reader.for(:rdfxml).new(rdf) do |reader| assert reader.statements.count > 1 assert_equal RDF::URI.new("http://localhost:3000/people/#{object.id}"), reader.statements.first.subject assert reader.has_triple? ["http://localhost:3000/people/#{object.id}",RDF::FOAF.mbox_sha1sum,"b507549e01d249ee5ed98bd40e4d86d1470a13b8"] end end test "orcid id validation" do p = Factory :person p.orcid = nil assert p.valid? p.orcid = "sdff-1111-1111-1111" assert !p.valid? p.orcid = "1111111111111111" assert !p.valid? p.orcid = "0000-0002-1694-2339" assert !p.valid?,"checksum doesn't match" p.orcid = "0000-0002-1694-233X" assert p.valid? p.orcid = "http://orcid.org/0000-0002-1694-233X" assert p.valid? p.orcid = "http://orcid.org/0000-0003-2130-0865" assert p.valid? end test "orcid_uri" do disable_authorization_checks do p = Factory :person p.orcid = "http://orcid.org/0000-0003-2130-0865" assert p.valid? p.save! p.reload assert_equal "http://orcid.org/0000-0003-2130-0865",p.orcid_uri p.orcid = "0000-0002-1694-233X" p.save! p.reload assert_equal "http://orcid.org/0000-0002-1694-233X",p.orcid_uri p.orcid=nil p.save! p.reload assert_nil p.orcid_uri p.orcid="" p.save! p.reload assert_nil p.orcid_uri end end test "email uri" do p = Factory :person, :email=>"sfkh^sd@weoruweoru.com" assert_equal "mailto:sfkh%5Esd@weoruweoru.com",p.email_uri end test "only first admin person" do Person.delete_all person = Factory :admin assert person.only_first_admin_person? person.is_admin=false disable_authorization_checks{person.save!} assert !person.only_first_admin_person? person.is_admin=true disable_authorization_checks{person.save!} assert person.only_first_admin_person? Factory :person assert !person.only_first_admin_person? end def test_active_ordered_by_updated_at_and_avatar_not_null Person.delete_all avatar = Factory :avatar people = [] people << Factory(:person,:avatar=>avatar, :updated_at=>1.week.ago) people << Factory(:person,:avatar=>avatar, :updated_at=>1.minute.ago) people << Factory(:person,:updated_at=>1.day.ago) people << Factory(:person,:updated_at=>1.hour.ago) people << Factory(:person,:updated_at=>2.minutes.ago) sorted = Person.all.sort do |x,y| if x.avatar.nil? == y.avatar.nil? y.updated_at <=> x.updated_at else if x.avatar.nil? 1 else -1 end end end assert_equal sorted, Person.active end def test_ordered_by_last_name sorted = Person.all.sort_by do |p| lname = "" || p.last_name.try(:downcase) fname = "" || p.first_name.try(:downcase) lname+fname end assert_equal sorted, Person.all end def test_is_asset assert !Person.is_asset? assert !people(:quentin_person).is_asset? assert !people(:quentin_person).is_downloadable_asset? end def test_member_of p=Factory :person proj = Factory :project assert !p.projects.empty? assert p.member_of?(p.projects.first) assert !p.member_of?(proj) end def test_avatar_key p=people(:quentin_person) assert_nil p.avatar_key assert p.defines_own_avatar? end def test_first_person_is_admin assert Person.count>0 #should already be people from fixtures p=Person.new(:first_name=>"XXX",:email=>"xxx@email.com") p.save! assert !p.is_admin?, "Should not automatically be admin, since people already exist" Person.delete_all assert_equal 0,Person.count #no people should exist p=Person.new(:first_name=>"XXX",:email=>"xxx@email.com") p.save p.reload assert p.is_admin?, "Should automatically be admin, since it is the first created person" end test "first person in default project" do Factory(:person) #make sure there is a person, project and institution registered assert Person.count>0 assert Project.count>0 p=Person.new(:first_name=>"XXX",:email=>"xxx@email.com") p.save! assert !p.is_admin?, "Should not automatically be admin, since people already exist" assert_empty p.projects assert_empty p.institutions Person.delete_all project = Project.first institution = project.institutions.first refute_nil project refute_nil institution assert_equal 0,Person.count #no people should exist p=Person.new(:first_name=>"XXX",:email=>"xxx@email.com") p.save! p.reload assert_equal [project],p.projects assert_equal [institution],p.institutions end def test_registered registered=Person.registered registered.each do |p| assert_not_nil p.user end assert registered.include?(people(:quentin_person)) assert !registered.include?(people(:person_without_user)) end def test_duplicates dups=Person.duplicates assert !dups.empty? assert dups.include?(people(:duplicate_1)) assert dups.include?(people(:duplicate_2)) end test "without group" do no_group = Factory(:brand_new_person) in_group = Factory(:person) assert no_group.projects.empty? assert !in_group.projects.empty? all = Person.without_group assert !all.include?(in_group) assert all.include?(no_group) end test "with group" do no_group = Factory(:brand_new_person) in_group = Factory(:person) assert no_group.projects.empty? assert !in_group.projects.empty? all = Person.with_group assert all.include?(in_group) assert !all.include?(no_group) end def test_expertise p=Factory :person Factory :expertise,:value=>"golf",:annotatable=>p Factory :expertise,:value=>"fishing",:annotatable=>p Factory :tool,:value=>"sbml",:annotatable=>p assert_equal 2, p.expertise.size p=Factory :person Factory :expertise,:value=>"golf",:annotatable=>p Factory :tool,:value=>"sbml",:annotatable=>p assert_equal 1, p.expertise.size assert_equal "golf",p.expertise[0].text end def test_tools p=Factory :person Factory :tool,:value=>"sbml",:annotatable=>p Factory :tool,:value=>"java",:annotatable=>p Factory :expertise,:value=>"sbml",:annotatable=>p assert_equal 2, p.tools.size p=Factory :person Factory :tool,:value=>"sbml",:annotatable=>p Factory :expertise,:value=>"fishing",:annotatable=>p assert_equal 1, p.tools.size assert_equal "sbml",p.tools[0].text end def test_assign_expertise p=Factory :person User.with_current_user p.user do assert_equal 0,p.expertise.size assert_difference("Annotation.count",2) do assert_difference("TextValue.count",2) do p.expertise = ["golf","fishing"] end end assert_equal 2,p.expertise.size assert p.expertise.collect{|e| e.text}.include?("golf") assert p.expertise.collect{|e| e.text}.include?("fishing") assert_difference("Annotation.count",-1) do assert_no_difference("TextValue.count") do p.expertise = ["golf"] end end assert_equal 1,p.expertise.size assert_equal "golf",p.expertise[0].text p2=Factory :person assert_difference("Annotation.count") do assert_no_difference("TextValue.count") do p2.expertise = ["golf"] end end end end def test_assigns_tools p=Factory :person User.with_current_user p.user do assert_equal 0,p.tools.size assert_difference("Annotation.count",2) do assert_difference("TextValue.count",2) do p.tools = ["golf","fishing"] end end assert_equal 2,p.tools.size assert p.tools.collect{|e| e.text}.include?("golf") assert p.tools.collect{|e| e.text}.include?("fishing") assert_difference("Annotation.count",-1) do assert_no_difference("TextValue.count") do p.tools = ["golf"] end end assert_equal 1,p.tools.size assert_equal "golf",p.tools[0].text p2=Factory :person assert_difference("Annotation.count") do assert_no_difference("TextValue.count") do p2.tools = ["golf"] end end end end def test_removes_previously_assigned p=Factory :person User.with_current_user p.user do p.tools = ["one","two"] assert_equal 2,p.tools.size p.tools = ["three"] assert_equal 1,p.tools.size assert_equal "three",p.tools[0].text p=Factory :person p.expertise = ["aaa","bbb"] assert_equal 2,p.expertise.size p.expertise = ["ccc"] assert_equal 1,p.expertise.size assert_equal "ccc",p.expertise[0].text end end def test_expertise_and_tools_with_same_name p=Factory :person User.with_current_user p.user do assert_difference("Annotation.count",2) do assert_difference("TextValue.count",2) do p.tools = ["golf","fishing"] end end assert_difference("Annotation.count",2) do assert_no_difference("TextValue.count") do p.expertise = ["golf","fishing"] end end end end def test_institutions person = Factory(:person_in_multiple_projects) institution = person.group_memberships.first.work_group.institution institution2 = Factory(:institution) assert_equal 3,person.institutions.count assert person.institutions.include?(institution) assert !person.institutions.include?(institution2) end def test_projects p=Factory(:person_in_multiple_projects) assert_equal 3,p.projects.size end test "not registered" do peeps=Person.not_registered assert_not_nil peeps assert peeps.size>0,"There should be some userless people" assert_nil(peeps.find{|p| !p.user.nil?},"There should be no people with a non nil user") p=people(:three) assert_not_nil(peeps.find{|person| p.id==person.id},"Person :three should be userless and therefore in the list") p=people(:quentin_person) assert_nil(peeps.find{|person| p.id==person.id},"Person :one should have a user and not be in the list") end def test_name p=people(:quentin_person) assert_equal "Quentin Jones", p.name p.first_name="Tom" assert_equal "Tom Jones", p.name end def test_email_with_name p=people(:quentin_person) assert_equal("Quentin Jones <quentin@email.com>",p.email_with_name) end def test_email_with_name_no_last_name p=Person.new(:first_name=>"Fred",:email=>"fff@fff.com") assert_equal("Fred <fff@fff.com>",p.email_with_name) end def test_capitalization_with_nil_last_name p=people(:no_first_name) assert_equal "Lastname",p.name end def test_capitalization_with_nil_first_name p=people(:no_last_name) assert_equal "Firstname",p.name end def test_double_firstname_capitalised p=people(:double_firstname) assert_equal "Fred David Bloggs", p.name end def test_double_lastname_capitalised p=people(:double_lastname) assert_equal "Fred Smith Jones",p.name end def test_double_barrelled_lastname_capitalised p=people(:double_barrelled_lastname) assert_equal "Fred Smith-Jones",p.name end def test_valid p=people(:quentin_person) assert p.valid? p.email=nil assert !p.valid? p.email="sdf" assert !p.valid? p.email="sdf@" assert !p.valid? p.email="sdaf@sdf.com" assert p.valid? p.web_page=nil assert p.valid? p.web_page="" assert p.valid? p.web_page="sdfsdf" assert !p.valid? p.web_page="http://google.com" assert p.valid? p.web_page="https://google.com" assert p.valid? p.web_page="http://google.com/fred" assert p.valid? p.web_page="http://google.com/fred?param=bob" assert p.valid? p.web_page="http://www.mygrid.org.uk/dev/issues/secure/IssueNavigator.jspa?reset=true&mode=hide&sorter/order=DESC&sorter/field=priority&resolution=-1&pid=10051&fixfor=10110" assert p.valid? end def test_email_with_capitalise_valid p=people(:quentin_person) assert p.valid? p.email="gordon.brown@gov.uk" assert p.valid? p.email="Gordon.Brown@gov.uk" assert p.valid?,"Capitals in email should be valid" end def test_email_unique p=people(:quentin_person) newP=Person.new(:first_name=>"Fred",:email=>p.email) assert !newP.valid?,"Should not be valid as email is not unique" newP.email = p.email.capitalize assert !newP.valid?,"Should not be valid as email is not case sensitive" newP.email="zxczxc@zxczxczxc.com" assert newP.valid? end def test_disciplines p = Factory :person,:disciplines=>[Factory(:discipline,:title=>"A"),Factory(:discipline, :title=>"B")] p.reload assert_equal 2,p.disciplines.size assert_equal "A",p.disciplines[0].title assert_equal "B",p.disciplines[1].title end def test_positions_association position = Factory(:project_position) p=Factory :person p.group_memberships.first.project_positions << position assert_equal 1, p.project_positions.size assert p.project_positions.include?(position) end def test_update_first_letter p=Person.new(:first_name=>"Fred",:last_name=>"Monkhouse",:email=>"blahblah@email.com") assert p.valid?,"The new person should be valid" p.save assert_equal "M",p.first_letter p=Person.new(:first_name=>"Freddy",:email=>"blahbddlah@email.com") assert p.valid?,"The new person should be valid" p.save assert_equal "F",p.first_letter p=Person.new(:first_name=>"Zebedee",:email=>"zz@email.com") assert p.valid?,"The new person should be valid" p.save assert_equal "Z",p.first_letter end def test_update_first_letter_blank_last_name p=Person.new(:first_name=>"Zebedee",:last_name=>"",:email=>"zz@email.com") assert p.valid?,"The new person should be valid" p.save assert_equal "Z",p.first_letter end def test_notifiee_info_inserted p=Person.new(:first_name=>"Zebedee",:last_name=>"",:email=>"zz@email.com") assert_nil p.notifiee_info assert_difference("NotifieeInfo.count") do p.save! end p=Person.find(p.id) assert_not_nil p.notifiee_info assert p.receive_notifications? end def test_dependent_notifiee_info_is_destroyed_with_person p=Person.new(:first_name=>"Zebedee",:last_name=>"",:email=>"zz@email.com") p.save! assert_not_nil p.notifiee_info assert_difference("NotifieeInfo.count",-1) do p.destroy end end def test_user_is_destroyed_with_person p=people(:quentin_person) u=users(:quentin) assert_difference("Person.count",-1) do assert_difference("User.count",-1) do p.destroy end end assert_nil User.find_by_id(u.id) p=people(:random_userless_person) assert_difference("Person.count",-1) do assert_no_difference("User.count") do p.destroy end end end def test_updated_not_changed_when_adding_notifiee_info p=people(:modeller_person) up_at=p.updated_at sleep(2) p.check_for_notifiee_info assert_equal up_at,p.updated_at end test "test uuid generated" do p = people(:modeller_person) assert_nil p.attributes["uuid"] p.save assert_not_nil p.attributes["uuid"] end test "uuid doesn't change" do x = people(:modeller_person) x.save uuid = x.attributes["uuid"] x.save assert_equal x.uuid, uuid end test 'projects method notices changes via both group_memberships and work_groups' do person = Factory.build(:person, :group_memberships => [Factory(:group_membership)]) group_membership_projects = person.group_memberships.map(&:work_group).map(&:project).uniq.sort_by(&:title) work_group_projects = person.work_groups.map(&:project).uniq.sort_by(&:title) assert_equal (group_membership_projects | work_group_projects), person.projects.sort_by(&:title) end test 'should retrieve the list of people who have the manage right on the item' do user = Factory(:user) person = user.person data_file = Factory(:data_file, :contributor => user) people_can_manage = data_file.people_can_manage assert_equal 1, people_can_manage.count assert_equal person.id, people_can_manage.first[0] new_person = Factory(:person_in_project) policy = data_file.policy policy.permissions.build(:contributor => new_person, :access_type => Policy::MANAGING) policy.save people_can_manage = data_file.people_can_manage assert_equal 2, people_can_manage.count people_ids = people_can_manage.collect{|p| p[0]} assert people_ids.include? person.id assert people_ids.include? new_person.id end test "related resource" do user = Factory :user person = user.person User.with_current_user(user) do AssetsCreator.create :asset=>Factory(:data_file),:creator=> person AssetsCreator.create :asset=>Factory(:model),:creator=> person AssetsCreator.create :asset=>Factory(:sop),:creator=> person Factory :event,:contributor=>user AssetsCreator.create :asset=>Factory(:presentation),:creator=> person AssetsCreator.create :asset=>Factory(:publication),:creator=>person assert_equal person.created_data_files, person.related_data_files assert_equal person.created_models, person.related_models assert_equal person.created_sops, person.related_sops assert_equal user.events, person.related_events assert_equal person.created_presentations, person.related_presentations assert_equal person.created_publications, person.related_publications end end test 'related isa' do person = Factory(:person) AssetsCreator.create :asset=>(inv1=Factory(:investigation)),:creator=> person inv2=Factory(:investigation,:contributor=>person) assert_equal [inv1,inv2].sort, person.related_investigations.sort AssetsCreator.create :asset=>(study1=Factory(:study)),:creator=> person study2=Factory(:study,:contributor=>person) assert_equal [study1,study2].sort, person.related_studies.sort AssetsCreator.create :asset=>(assay1=Factory(:assay)),:creator=> person assay2=Factory(:assay,:contributor=>person) assert_equal [assay1,assay2].sort, person.related_assays.sort end test "get the correct investigations and studides" do p = Factory(:person) u = p.user inv1 = Factory(:investigation, :contributor=>p) inv2 = Factory(:investigation, :contributor=>u) study1 = Factory(:study, :contributor=>p) study2 = Factory(:study, :contributor=>u) p = Person.find(p.id) assert_equal [study1,study2],p.studies.sort_by(&:id) assert_equal [inv1,inv2],p.investigations.sort_by(&:id) end test "should be able to remove the workgroup whose project is not subcribed" do p=Factory :person wg = Factory :work_group p.work_groups = [wg] p.project_subscriptions.delete_all assert p.project_subscriptions.empty? p.work_groups = [] p.save assert_empty p.work_groups assert_empty p.projects end test "add to project and institution subscribes to project" do person = Factory (:brand_new_person) inst = Factory(:institution) proj = Factory(:project) assert_empty person.project_subscriptions person.add_to_project_and_institution(proj,inst) person.save! person.reload assert_includes person.project_subscriptions.map(&:project),proj end test "shares programme?" do person1 = Factory(:person) person2 = Factory(:person) person3 = Factory(:person) prog1 = Factory :programme,:projects=>(person1.projects | person2.projects) prog2 = Factory :programme,:projects=>person3.projects assert person1.shares_programme?(person2) assert person2.shares_programme?(person1) refute person3.shares_programme?(person1) refute person3.shares_programme?(person2) refute person1.shares_programme?(person3) refute person2.shares_programme?(person3) #also with project rather than person assert person1.shares_programme?(person2.projects.first) refute person2.shares_programme?(person3.projects.first) end test "shares project?" do person1 = Factory(:person) project = person1.projects.first person2 = Factory(:person,:work_groups=>[project.work_groups.first]) person3 = Factory(:person) assert person1.shares_project?(person2) refute person1.shares_project?(person3) assert person1.shares_project?(project) refute person1.shares_project?(person3.projects.first) assert person1.shares_project?([project]) assert person1.shares_project?([project,Factory(:project)]) refute person1.shares_project?([person3.projects.first]) refute person1.shares_project?([person3.projects.first,Factory(:project)]) end test "add to project and institution" do proj1=Factory :project proj2=Factory :project inst1=Factory :institution inst2=Factory :institution p1=Factory :brand_new_person p2=Factory :brand_new_person assert_difference("WorkGroup.count",1) do assert_difference("GroupMembership.count",1) do p1.add_to_project_and_institution(proj1,inst1) p1.save! end end p1.reload assert_equal 1,p1.projects.count assert_include p1.projects,proj1 assert_equal 1,p1.institutions.count assert_include p1.institutions,inst1 assert_no_difference("WorkGroup.count") do assert_difference("GroupMembership.count",1) do p2.add_to_project_and_institution(proj1,inst1) end end p2.reload assert_equal 1,p2.projects.count assert_include p2.projects,proj1 assert_equal 1,p2.institutions.count assert_include p2.institutions,inst1 assert_difference("WorkGroup.count",1) do assert_difference("GroupMembership.count",1) do p1.add_to_project_and_institution(proj2,inst1) end end assert_difference("WorkGroup.count",1) do assert_difference("GroupMembership.count",1) do p1.add_to_project_and_institution(proj1,inst2) end end p1.reload assert_equal 2,p1.projects.count assert_include p1.projects,proj2 assert_equal 2,p1.institutions.count assert_include p1.institutions,inst2 assert_no_difference("WorkGroup.count") do assert_no_difference("GroupMembership.count") do p1.add_to_project_and_institution(proj1,inst1) end end end test "cache-key changes with workgroup" do person = Factory :person refute_empty person.projects cachekey = person.cache_key person.add_to_project_and_institution(Factory(:project),Factory(:institution)) refute_equal cachekey,person.cache_key end test "can create" do User.current_user=Factory(:project_administrator).user assert Person.can_create? User.current_user=Factory(:admin).user assert Person.can_create? User.current_user=Factory(:brand_new_user) refute User.current_user.registration_complete? assert Person.can_create? User.current_user = nil refute Person.can_create? User.current_user=Factory(:person).user refute Person.can_create? User.current_user=Factory(:pal).user refute Person.can_create? User.current_user=Factory(:asset_gatekeeper).user refute Person.can_create? User.current_user=Factory(:asset_housekeeper).user refute Person.can_create? User.current_user=Factory(:programme_administrator).user assert Person.can_create? end test "administered programmes" do pa = Factory(:programme_administrator) admin = Factory(:admin) other_prog = Factory(:programme) progs = pa.programmes assert_equal progs.sort,pa.administered_programmes.sort refute_includes pa.administered_programmes,other_prog assert_empty Factory(:person).administered_programmes assert_equal Programme.all.sort,admin.administered_programmes end test "not_registered_with_matching_email" do 3.times do Factory :person end p1 = Factory :brand_new_person, :email=>"FISH-sOup@email.com" p2 = Factory :person, :email=>"FISH-registered@email.com" refute p1.registered? assert p2.registered? assert_includes Person.not_registered_with_matching_email("FISH-sOup@email.com"),p1 assert_includes Person.not_registered_with_matching_email("fish-soup@email.com"),p1 refute_includes Person.not_registered_with_matching_email("FISH-registered@email.com"),p2 assert_empty Person.not_registered_with_matching_email("fffffxxxx11z@email.com") end test "orcid required for new person" do with_config_value(:orcid_required, true) do assert_nothing_raised do has_orcid = Factory :brand_new_person, :email => "FISH-sOup1@email.com", :orcid => 'http://orcid.org/0000-0002-0048-3300' assert has_orcid.valid? assert_empty has_orcid.errors[:orcid] end assert_raises ActiveRecord::RecordInvalid do no_orcid = Factory :brand_new_person, :email => "FISH-sOup2@email.com" assert !no_orcid.valid? assert_not_empty no_orcid.errors[:orcid] end assert_raises ActiveRecord::RecordInvalid do bad_orcid = Factory :brand_new_person, :email => "FISH-sOup3@email.com", :orcid => 'banana' assert !bad_orcid.valid? assert_not_empty bad_orcid.errors[:orcid] end end end test "orcid not required for existing person" do no_orcid = Factory :brand_new_person, :email => "FISH-sOup1@email.com" with_config_value(:orcid_required, true) do assert_nothing_raised do no_orcid.update_attributes(:email => "FISH-sOup99@email.com") assert no_orcid.valid? end end end test "orcid must be valid even if not required" do bad_orcid = Factory :brand_new_person, :email => "FISH-sOup1@email.com" with_config_value(:orcid_required, true) do bad_orcid.update_attributes(:email => "FISH-sOup99@email.com", :orcid => 'big mac') assert !bad_orcid.valid? assert_not_empty bad_orcid.errors[:orcid] end with_config_value(:orcid_required, false) do assert_raises ActiveRecord::RecordInvalid do another_bad_orcid = Factory :brand_new_person, :email => "FISH-sOup1@email.com", :orcid => 'こんにちは' assert !another_bad_orcid.valid? assert_not_empty bad_orcid.errors[:orcid] end end end test "ensures full orcid uri is stored" do semi_orcid = Factory :brand_new_person, :email => "FISH-sOup1@email.com", :orcid => '0000-0002-0048-3300' full_orcid = Factory :brand_new_person, :email => "FISH-sOup2@email.com", :orcid => 'http://orcid.org/0000-0002-0048-3300' assert_equal 'http://orcid.org/0000-0002-0048-3300', semi_orcid.orcid assert_equal 'http://orcid.org/0000-0002-0048-3300', full_orcid.orcid end test "can flag has having left a project" do person = Factory(:person) project = person.projects.first assert_not_includes person.former_projects, project assert_includes person.current_projects, project assert_includes person.projects, project gm = person.group_memberships.first gm.time_left_at = 1.day.ago gm.save assert gm.has_left person.reload assert_includes person.former_projects, project assert_not_includes person.current_projects, project assert_includes person.projects, project end test "can flag has leaving a project" do person = Factory(:person) project = person.projects.first assert_not_includes person.former_projects, project assert_includes person.current_projects, project assert_includes person.projects, project gm = person.group_memberships.first gm.time_left_at = 1.day.from_now gm.save assert !gm.has_left person.reload assert_not_includes person.former_projects, project assert_includes person.current_projects, project assert_includes person.projects, project end test 'trim spaces from email, first_name, last_name' do person = Factory(:brand_new_person) person.email = ' fish@email.com ' person.first_name = ' bob ' person.last_name = ' monkhouse ' person.web_page = ' http://fish.com ' assert person.valid? disable_authorization_checks do person.save! end person.reload assert_equal 'fish@email.com',person.email assert_equal 'bob',person.first_name assert_equal 'monkhouse',person.last_name assert_equal 'http://fish.com',person.web_page end end
31.9134
177
0.712731
3f15e971c281cc3ad6e18800a4044987da2026a7
1,276
rb
Ruby
spec/defines/network_spec.rb
pyther/pyther-networkd
7d0ce771ae52b1346bab6836d64188b959bd1746
[ "MIT" ]
null
null
null
spec/defines/network_spec.rb
pyther/pyther-networkd
7d0ce771ae52b1346bab6836d64188b959bd1746
[ "MIT" ]
null
null
null
spec/defines/network_spec.rb
pyther/pyther-networkd
7d0ce771ae52b1346bab6836d64188b959bd1746
[ "MIT" ]
null
null
null
require 'spec_helper' describe 'networkd::network' do let :pre_condition do 'class { "networkd": conf_dir => "/etc/systemd/networkd" }' end let :default_facts do { :concat_basedir => '/dne', } end context 'example-1' do let(:title) { 'enp2s0' } let :params do { :match => { 'name' => 'enp2s0' }, :network => { 'address' => '192.168.0.15/24', 'gateway' => '192.168.0.1' }, } end let :facts do default_facts end it { is_expected.to contain_class("networkd") } it { is_expected.to contain_concat__fragment('network_enp2s0-match') } it { is_expected.to contain_concat__fragment('network_enp2s0-match').with( :content => /^Name=enp2s0$/ ) } it { is_expected.to contain_concat__fragment('network_enp2s0-network') } it { is_expected.to contain_concat__fragment('network_enp2s0-network').with( :content => /Address=192.168.0.15\/24\nGateway=192.168.0.1/ ) } it do should contain_file('enp2s0.network').with({ 'ensure' => 'present', 'path' => '/etc/systemd/networkd/enp2s0.network', }) end #it do # $stdout.puts self.catalogue.to_yaml # should contain_file('enp2s0.network').with_content(/\s*Gateway=192.168.0.1/) #end end end
29
83
0.624608
3f9e71b96b99460b263edf95ca2447bdd841699b
586
php
PHP
app/Services/Token/TokenInterface.php
raphaelts3/bluecoding-back
0f02069cf23d7d47079ed361cfdf3d3fd58a4603
[ "MIT" ]
null
null
null
app/Services/Token/TokenInterface.php
raphaelts3/bluecoding-back
0f02069cf23d7d47079ed361cfdf3d3fd58a4603
[ "MIT" ]
null
null
null
app/Services/Token/TokenInterface.php
raphaelts3/bluecoding-back
0f02069cf23d7d47079ed361cfdf3d3fd58a4603
[ "MIT" ]
null
null
null
<?php namespace App\Services\Token; interface TokenInterface { public const LIFE_TIME = 24 * 60 * 60; public const CACHE_PREFIX = 'token:'; /** * @param int $userId * @return string */ public function generate(int $userId): string; /** * @param string|null $token * @return int * @throws TokenException */ public function validate(string $token = null): int; /** * @param string|null $token * @return void * @throws TokenException */ public function invalidate(string $token = null): void; }
18.3125
59
0.59727
dfadd4ae44d6877561efd7d64ad43ef35774d550
2,152
cs
C#
MiniNotes.aspx.cs
DevinDow/ToDo
b841db2a6d0f1c5890872e02f73d6e643556805f
[ "MIT" ]
1
2018-08-27T04:12:41.000Z
2018-08-27T04:12:41.000Z
MiniNotes.aspx.cs
DevinDow/ToDo
b841db2a6d0f1c5890872e02f73d6e643556805f
[ "MIT" ]
null
null
null
MiniNotes.aspx.cs
DevinDow/ToDo
b841db2a6d0f1c5890872e02f73d6e643556805f
[ "MIT" ]
null
null
null
using System; using System.Collections; using System.Configuration; using System.Data; using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.HtmlControls; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Xml.Linq; using System.Drawing; using System.Data.SqlClient; namespace DevinDow.ToDo { public partial class MiniNotes : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string text; using (SqlConnection sqlConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["DevinDowConnectionString"].ConnectionString)) { SqlCommand sqlCommand = new SqlCommand("SELECT Text " + "FROM Notes " + "WHERE UserName = @UserName", sqlConnection); sqlCommand.Parameters.Add("@UserName", SqlDbType.NVarChar).Value = User.Identity.Name; sqlConnection.Open(); text = (string)sqlCommand.ExecuteScalar(); } if (text == null) using (SqlConnection sqlConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["DevinDowConnectionString"].ConnectionString)) { SqlCommand sqlCommand = new SqlCommand("INSERT INTO Notes (Text, UserName) " + "VALUES ('', @UserName)", sqlConnection); sqlCommand.Parameters.Add("@UserName", SqlDbType.NVarChar).Value = User.Identity.Name; sqlConnection.Open(); sqlCommand.ExecuteNonQuery(); } else txtNotes.Text = text; } } public void btnUpdateNotes_OnClick(Object sender, EventArgs e) { using (SqlConnection sqlConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["DevinDowConnectionString"].ConnectionString)) { SqlCommand sqlCommand = new SqlCommand("UPDATE Notes SET Text=@Text WHERE UserName=@UserName", sqlConnection); sqlCommand.Parameters.Add("@Text", SqlDbType.NVarChar).Value = txtNotes.Text; sqlCommand.Parameters.Add("@UserName", SqlDbType.NVarChar).Value = User.Identity.Name; sqlConnection.Open(); sqlCommand.ExecuteNonQuery(); } Response.Redirect(Request.Url.ToString()); } } }
30.742857
145
0.730483
81ab05d2b2872866d5de0691ca8cad9c1019ed5d
812
css
CSS
app/styles/main.css
allyrv/blocitoff-angular
b849b3f6717620d49e19a3541b64d70f58a01f3d
[ "Apache-2.0" ]
null
null
null
app/styles/main.css
allyrv/blocitoff-angular
b849b3f6717620d49e19a3541b64d70f58a01f3d
[ "Apache-2.0" ]
null
null
null
app/styles/main.css
allyrv/blocitoff-angular
b849b3f6717620d49e19a3541b64d70f58a01f3d
[ "Apache-2.0" ]
null
null
null
*, *::before, *::after{ -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } html { height: 100%; font-size: 100%; } body { text-align: center!important; background-color: #FFFFFF; } .hero-content { width: 500px; background-color: #f3f3f3; margin: auto; margin-top: 5rem; } .hero-title { padding: 1rem; } .new-task { position: relative; background-color: #f3f3f3; padding: 2rem; margin: auto; width: 500px; } .task-content { position: relative; background-color: #f3f3f3; margin: auto; height: 100%; width: 500px; margin-top: -20px; } .task-list { padding-top: 5px; } .archive-title { text-decoration: line-through; } .priority { margin: 0 1rem 0 0; height: 1.75rem; } h3.task-title.ng-binding { display:inline; }
13.533333
33
0.641626
dbf500e0d53461de73bfc2f13fdca4c2f13be3de
6,100
php
PHP
src/EventLoop/StreamSelectLoop.php
WyriHaximus/react
fb15cab25c244e33c7e2d2027f895efe94523d2c
[ "MIT" ]
1
2021-10-05T10:04:07.000Z
2021-10-05T10:04:07.000Z
src/EventLoop/StreamSelectLoop.php
WyriHaximus/react
fb15cab25c244e33c7e2d2027f895efe94523d2c
[ "MIT" ]
null
null
null
src/EventLoop/StreamSelectLoop.php
WyriHaximus/react
fb15cab25c244e33c7e2d2027f895efe94523d2c
[ "MIT" ]
2
2021-11-11T06:18:15.000Z
2022-01-09T04:29:09.000Z
<?php namespace React\EventLoop; use React\EventLoop\Tick\FutureTickQueue; use React\EventLoop\Tick\NextTickQueue; use React\EventLoop\Timer\Timer; use React\EventLoop\Timer\TimerInterface; use React\EventLoop\Timer\Timers; /** * A stream_select() based event-loop. */ class StreamSelectLoop implements LoopInterface { const MICROSECONDS_PER_SECOND = 1000000; private $nextTickQueue; private $futureTickQueue; private $timers; private $readStreams = []; private $readListeners = []; private $writeStreams = []; private $writeListeners = []; private $running; public function __construct() { $this->nextTickQueue = new NextTickQueue($this); $this->futureTickQueue = new FutureTickQueue($this); $this->timers = new Timers(); } /** * {@inheritdoc} */ public function addReadStream($stream, callable $listener) { $key = (int) $stream; if (!isset($this->readStreams[$key])) { $this->readStreams[$key] = $stream; $this->readListeners[$key] = $listener; } } /** * {@inheritdoc} */ public function addWriteStream($stream, callable $listener) { $key = (int) $stream; if (!isset($this->writeStreams[$key])) { $this->writeStreams[$key] = $stream; $this->writeListeners[$key] = $listener; } } /** * {@inheritdoc} */ public function removeReadStream($stream) { $key = (int) $stream; unset( $this->readStreams[$key], $this->readListeners[$key] ); } /** * {@inheritdoc} */ public function removeWriteStream($stream) { $key = (int) $stream; unset( $this->writeStreams[$key], $this->writeListeners[$key] ); } /** * {@inheritdoc} */ public function removeStream($stream) { $this->removeReadStream($stream); $this->removeWriteStream($stream); } /** * {@inheritdoc} */ public function addTimer($interval, callable $callback) { $timer = new Timer($this, $interval, $callback, false); $this->timers->add($timer); return $timer; } /** * {@inheritdoc} */ public function addPeriodicTimer($interval, callable $callback) { $timer = new Timer($this, $interval, $callback, true); $this->timers->add($timer); return $timer; } /** * {@inheritdoc} */ public function cancelTimer(TimerInterface $timer) { $this->timers->cancel($timer); } /** * {@inheritdoc} */ public function isTimerActive(TimerInterface $timer) { return $this->timers->contains($timer); } /** * {@inheritdoc} */ public function nextTick(callable $listener) { $this->nextTickQueue->add($listener); } /** * {@inheritdoc} */ public function futureTick(callable $listener) { $this->futureTickQueue->add($listener); } /** * {@inheritdoc} */ public function tick() { $this->nextTickQueue->tick(); $this->futureTickQueue->tick(); $this->timers->tick(); $this->waitForStreamActivity(0); } /** * {@inheritdoc} */ public function run() { $this->running = true; while ($this->running) { $this->nextTickQueue->tick(); $this->futureTickQueue->tick(); $this->timers->tick(); // Next-tick or future-tick queues have pending callbacks ... if (!$this->running || !$this->nextTickQueue->isEmpty() || !$this->futureTickQueue->isEmpty()) { $timeout = 0; // There is a pending timer, only block until it is due ... } elseif ($scheduledAt = $this->timers->getFirst()) { if (0 > $timeout = $scheduledAt - $this->timers->getTime()) { $timeout = 0; } // The only possible event is stream activity, so wait forever ... } elseif ($this->readStreams || $this->writeStreams) { $timeout = null; // There's nothing left to do ... } else { break; } $this->waitForStreamActivity($timeout * self::MICROSECONDS_PER_SECOND); } } /** * {@inheritdoc} */ public function stop() { $this->running = false; } /** * Wait/check for stream activity, or until the next timer is due. */ private function waitForStreamActivity($timeout) { $read = $this->readStreams; $write = $this->writeStreams; $this->streamSelect($read, $write, $timeout); foreach ($read as $stream) { $key = (int) $stream; if (isset($this->readListeners[$key])) { call_user_func($this->readListeners[$key], $stream, $this); } } foreach ($write as $stream) { $key = (int) $stream; if (isset($this->writeListeners[$key])) { call_user_func($this->writeListeners[$key], $stream, $this); } } } /** * Emulate a stream_select() implementation that does not break when passed * empty stream arrays. * * @param array &$read An array of read streams to select upon. * @param array &$write An array of write streams to select upon. * @param integer|null $timeout Activity timeout in microseconds, or null to wait forever. * * @return integer The total number of streams that are ready for read/write. */ protected function streamSelect(array &$read, array &$write, $timeout) { if ($read || $write) { $except = null; return stream_select($read, $write, $except, $timeout === null ? null : 0, $timeout); } usleep($timeout); return 0; } }
23.461538
108
0.533934
390605d829ad192c408d6299430bb2e2951457f4
5,018
py
Python
Human_intention/nodes/markers_from_tf.py
Vibek/Back-up
888ede4187e8a9879154a5a1f48545507ca3121e
[ "Apache-2.0" ]
1
2018-02-07T15:09:25.000Z
2018-02-07T15:09:25.000Z
Human_intention/nodes/markers_from_tf.py
Vibek/Back-up
888ede4187e8a9879154a5a1f48545507ca3121e
[ "Apache-2.0" ]
null
null
null
Human_intention/nodes/markers_from_tf.py
Vibek/Back-up
888ede4187e8a9879154a5a1f48545507ca3121e
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python """ Convert a skeleton transform tree to a list of visualization markers for RViz. """ import rospy from visualization_msgs.msg import Marker from geometry_msgs.msg import Point import tf class SkeletonMarkers(): def __init__(self): rospy.init_node('markers_from_tf') rospy.loginfo("Initializing Skeleton Markers Node...") rate = rospy.get_param('~rate', 20) r = rospy.Rate(rate) # There is usually no need to change the fixed frame from the default self.fixed_frame = rospy.get_param('~fixed_frame', 'openni_depth_frame') # Get the list of skeleton frames we want to track self.skeleton_frames = rospy.get_param('~skeleton_frames', '') # Initialize the tf listener tf_listener = tf.TransformListener() # Define a marker publisher marker_pub = rospy.Publisher('skeleton_markers', Marker, queue_size=5) # Intialize the markers self.initialize_markers() # Make sure we see the openni_depth_frame tf_listener.waitForTransform(self.fixed_frame, self.fixed_frame, rospy.Time(), rospy.Duration(60.0)) # A flag to track when we have detected a skeleton skeleton_detected = False # Begin the main loop while not rospy.is_shutdown(): # Set the markers header self.markers.header.stamp = rospy.Time.now() # Clear the markers point list self.markers.points = list() # Check to see if a skeleton is detected while not skeleton_detected: # Assume we can at least see the head frame frames = [f for f in tf_listener.getFrameStrings() if f.startswith('head_')] try: # If the head frame is visible, pluck off the # user index from the name head_frame = frames[0] user_index = head_frame.replace('head_', '') # Make sure we have a transform between the head # and the fixed frame try: (trans, rot) = tf_listener.lookupTransform(self.fixed_frame, head_frame, rospy.Time(0)) skeleton_detected = True except (tf.Exception, tf.ConnectivityException, tf.LookupException): skeleton_detected = False rospy.loginfo("User index: " + str(user_index)) r.sleep() except: skeleton_detected = False # Loop through the skeleton frames for frame in self.skeleton_frames: # Append the user_index to the frame name skel_frame = frame + "_" + str(user_index) # We only need the origin of each skeleton frame # relative to the fixed frame position = Point() # Get the transformation from the fixed frame # to the skeleton frame try: (trans, rot) = tf_listener.lookupTransform(self.fixed_frame, skel_frame, rospy.Time(0)) position.x = trans[0] position.y = trans[1] position.z = trans[2] # Set a marker at the origin of this frame self.markers.points.append(position) except: pass # Publish the set of markers marker_pub.publish(self.markers) r.sleep() def initialize_markers(self): # Set various parameters scale = rospy.get_param('~scale', 0.07) lifetime = rospy.get_param('~lifetime', 0) # 0 is forever ns = rospy.get_param('~ns', 'skeleton_markers') id = rospy.get_param('~id', 0) color = rospy.get_param('~color', {'r': 0.0, 'g': 1.0, 'b': 0.0, 'a': 1.0}) # Initialize the marker points list self.markers = Marker() self.markers.header.frame_id = self.fixed_frame self.markers.ns = ns self.markers.id = id self.markers.type = Marker.POINTS self.markers.action = Marker.ADD self.markers.lifetime = rospy.Duration(lifetime) self.markers.scale.x = scale self.markers.scale.y = scale self.markers.color.r = color['r'] self.markers.color.g = color['g'] self.markers.color.b = color['b'] self.markers.color.a = color['a'] if __name__ == '__main__': try: SkeletonMarkers() except rospy.ROSInterruptException: pass
38.6
112
0.529892
ff4229df98b5ee7702a83095e8df3a16f97d6205
55
py
Python
crypto_native/__init__.py
dkushche/Crypto
75919d6df2084aee1de76c9999ac4e361c4efd48
[ "MIT" ]
3
2020-05-07T22:03:48.000Z
2021-03-11T16:36:56.000Z
crypto_native/__init__.py
dkushche/Crypto
75919d6df2084aee1de76c9999ac4e361c4efd48
[ "MIT" ]
null
null
null
crypto_native/__init__.py
dkushche/Crypto
75919d6df2084aee1de76c9999ac4e361c4efd48
[ "MIT" ]
null
null
null
from .openssl_api import * from .ms_cryptoapi import *
18.333333
27
0.781818
05d7437553ead35c067a0ad5368ed8eef56cab3d
1,127
dart
Dart
lib/src/utils/read_write_file.dart
yeqk97/raco
50aec24e171bb29bf22c8296d80b63ddabe337d0
[ "MIT" ]
null
null
null
lib/src/utils/read_write_file.dart
yeqk97/raco
50aec24e171bb29bf22c8296d80b63ddabe337d0
[ "MIT" ]
null
null
null
lib/src/utils/read_write_file.dart
yeqk97/raco
50aec24e171bb29bf22c8296d80b63ddabe337d0
[ "MIT" ]
null
null
null
import 'dart:io'; import 'dart:typed_data'; import 'package:path_provider/path_provider.dart'; class ReadWriteFile { Future<String> get _localPath async { final directory = await getApplicationDocumentsDirectory(); return directory.path; } Future<File> writeStringToFile(String fileName, String content) async { final path = await _localPath; final file = File(path + '/' + fileName); return file.writeAsString(content); } Future<File> wirteBytesToFile(String fileName, ByteData content) async { final path = await _localPath; final file = File(path + '/' + fileName); return file.writeAsBytes(content.buffer.asUint8List(), flush: true); } Future<String> readStringFromFile(String fileName) async { final path = await _localPath; final file = File(path + '/' + fileName); return file.readAsString(); } Future<bool> exists(String fileName) async{ final path = await _localPath; return File(path + '/' + fileName).exists(); } Future<String> getPaht(String fileName) async { final path = await _localPath; return path + '/' + fileName; } }
28.897436
74
0.693878
2d47b95b502607e8beff9410ffb748fa6c196ac3
10,605
css
CSS
assets/css/app.css
Cailtom/Electrum-E-Commerce
83fe9ac086b804260683a0b98025d99f0b9ec7f7
[ "MIT" ]
1
2021-12-18T23:25:10.000Z
2021-12-18T23:25:10.000Z
assets/css/app.css
Cailtom/Electrum-E-Commerce
83fe9ac086b804260683a0b98025d99f0b9ec7f7
[ "MIT" ]
3
2022-01-10T17:21:08.000Z
2022-01-10T17:29:36.000Z
assets/css/app.css
Cailtom/Electrum-E-Commerce
83fe9ac086b804260683a0b98025d99f0b9ec7f7
[ "MIT" ]
null
null
null
html { font-size: 14px; } * { padding: 0; margin: 0; box-sizing: border-box; font-family: "Open sans"; font-size: 1rem; } i { color: #d10024; } a { text-decoration: none; transition: 0.4s; } a:hover { color: #d10024; } input { border: none; outline: none; } ul { list-style: none; } .navbar { background-color: #15161d; } .navbar-topo { background-color: #1e1f29; color: #fff; } @media (max-width: 767.98px) { .navbar-topo { display: none; } } .navbar-topo-container { max-width: 1170px; margin: 0 auto; display: flex; justify-content: space-between; padding: 0.8rem 0; } .navbar-topo-container span { margin-right: 1rem; } .navbar-topo-container i { margin-right: 0.3rem; } .navbar-topo-container a { color: #fff; } .navbar-main-container { max-width: 1170px; margin: 0 auto; display: flex; justify-content: space-between; padding: 1.3rem 0; } @media (max-width: 767.98px) { .navbar-main-container { flex-direction: column; align-items: center; } } .navbar-main-container a, .navbar-main-container span, .navbar-main-container i { color: #fff; } .navbar-main-container #brand { font-weight: 900; font-size: 3rem; } .navbar-main-container #brand i { color: #d10024; font-size: 2rem; } .navbar-main-container #search-form { display: flex; align-items: center; justify-content: center; width: 45%; } @media (max-width: 767.98px) { .navbar-main-container #search-form { width: 100%; margin: 2rem 0; } } .navbar-main-container #search-form input { height: 40px; } .navbar-main-container #search-form #search { height: 40px; border-top-left-radius: 20px; border-bottom-left-radius: 20px; padding-left: 25px; width: 60%; } .navbar-main-container .navbar-actions-menu { display: flex; align-items: center; } .navbar-main-container .navbar-actions-menu .wishilst-container, .navbar-main-container .navbar-actions-menu .navbar-cart-container { position: relative; display: flex; flex-direction: column; text-align: center; margin-left: 2.5rem; } .navbar-main-container .navbar-actions-menu .wishilst-container .quantidade, .navbar-main-container .navbar-actions-menu .navbar-cart-container .quantidade { position: absolute; top: -10px; right: 2px; background-color: #d10024; height: 18px; width: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; } .navbar-main-container .navbar-actions-menu .wishilst-container i, .navbar-main-container .navbar-actions-menu .navbar-cart-container i { margin-bottom: 0.2rem; } .navbar-main-container .navbar-actions-menu .wishilst-container i a:hover, .navbar-main-container .navbar-actions-menu .navbar-cart-container i a:hover { color: #d10024; } @media (max-width: 767.98px) { .navbar-main-container .navbar-actions-menu .wishilst-container, .navbar-main-container .navbar-actions-menu .navbar-cart-container { margin: 2rem; } } .navbar-bottom { background-color: #fff; border-bottom: 2px solid #e4e7ed; border-top: 3px solid #d10024; } .navbar-bottom ul { max-width: 1170px; margin: 0 auto; display: flex; justify-content: space-between; justify-content: left; padding: 1rem 0; } @media (max-width: 767.98px) { .navbar-bottom ul { display: none; } } .navbar-bottom ul li { margin-right: 1.3rem; } .navbar-bottom ul li a { color: #2b2d42; border-bottom: 2px solid transparent; } .navbar-bottom ul li a:hover { color: #d10024; border-color: #d10024; } .banners { max-width: 1170px; margin: 0 auto; display: flex; justify-content: space-between; padding: 3rem 0; } @media (max-width: 767.98px) { .banners { flex-direction: column; align-items: center; } } .products-grid { max-width: 1170px; margin: 0 auto; display: flex; justify-content: space-between; flex-direction: column; padding: 2rem 0; } .products-grid h2 { font-size: 2rem; text-transform: uppercase; } @media (max-width: 767.98px) { .products-grid h2 { text-align: center; } } .products-grid-container { display: flex; justify-content: space-between; padding: 2rem 0; } @media (max-width: 767.98px) { .products-grid-container { flex-direction: column; align-items: center; } } .deal-container { background-image: url("../img/deal_headset.png"); background-repeat: no-repeat; background-position-x: 95%; background-position-y: 2rem; background-size: 25%; background-color: #e4e7ed; height: 400px; padding: 2rem; } @media (max-width: 767.98px) { .deal-container { background-size: 70%; background-position-x: 130%; background-position-y: 120%; height: 700px; } } @media (max-width: 767.98px) and (max-width: 767.98px) { .deal-container { text-align: center; } } .deal-container-content { height: 100%; flex-direction: column; align-items: center; max-width: 1170px; margin: 0 auto; display: flex; justify-content: space-between; justify-content: center; } .deal-container-content-timer { display: flex; margin-bottom: 2rem; } @media (max-width: 767.98px) { .deal-container-content-timer { flex-wrap: wrap; align-self: center; justify-content: center; } } .deal-container-content .deal-container-timer { width: 100px; height: 100px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; background-color: #d10024; color: #fff; margin: 0 1rem; } @media (max-width: 767.98px) { .deal-container-content .deal-container-timer { text-align: center; margin-bottom: 1.5rem; } } .deal-container-content .deal-container-timer-time { font-weight: bold; font-size: 1.5rem; } .deal-container-content-title, .deal-container-content-subtitle { margin-bottom: 1rem; text-transform: uppercase; font-size: 2rem; } .deal-container-content-subtitle { margin-bottom: 2rem; font-size: 1.5rem; } .newaletter-container { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 3rem; border-top: 2px solid #e4e7ed; } @media (max-width: 767.98px) { .newaletter-container { text-align: center; } } .newaletter-container h2 { font-size: 2rem; color: #333; margin-bottom: 2rem; } .newaletter-container h2 span { font-size: 2rem; font-weight: bold; text-transform: uppercase; } .newaletter-container form { display: flex; margin-bottom: 3rem; } @media (max-width: 767.98px) { .newaletter-container form { width: 100%; } } .newaletter-container form input[type=email] { border: 1px solid #e4e7ed; height: 40px; border-top-left-radius: 20px; border-bottom-left-radius: 20px; padding-left: 25px; } .footer { background-color: #15161d; padding: 3rem 0; } @media (max-width: 767.98px) { .footer { padding-bottom: 3rem 0; } } .footer a, .footer p { color: #b9babc; } .footer li, .footer p { margin-bottom: 1rem; } .footer li a:hover, .footer p a:hover { color: #d10024; } .footer i { margin-right: 0.3rem; } .footer h3 { color: #fff; text-transform: uppercase; font-size: 1.75rem; margin-bottom: 1.5rem; } .footer-topo { max-width: 1170px; margin: 0 auto; display: flex; justify-content: space-between; padding: 1.5rem; } @media (max-width: 767.98px) { .footer-topo { flex-direction: column; } } .footer-topo-about, .footer-topo-categories, .footer-topo-information, .footer-topo-menu { max-width: 25%; } @media (max-width: 767.98px) { .footer-topo-about, .footer-topo-categories, .footer-topo-information, .footer-topo-menu { max-width: 100%; margin-bottom: 1rem; } } .footer-bottom { max-width: 1170px; margin: 0 auto; display: flex; justify-content: space-between; flex-direction: column; justify-content: center; align-items: center; } .footer-bottom-payments { margin-bottom: 2rem; } .footer-bottom-payments i { color: #333; cursor: pointer; font-size: 3rem; margin: 5px; transition: 0.4s; } .footer-bottom-payments i:hover { color: #d10024; } .banner { width: 30%; height: 200px; position: relative; color: #fff; transition: 0.4s; background-position: center; background-size: cover; background: size 100%; } @media (max-width: 767.98px) { .banner { width: 90%; margin: 1rem; } } .banner:hover { background-size: 120%; } .banner-cover { background-color: #d10024; width: 70%; height: 100%; opacity: 0.8; border-bottom-right-radius: 6rem; } .banner-content { position: absolute; top: 0; left: 0; padding: 2rem; } .banner-content h2 { font-size: 2.1rem; margin-bottom: 1rem; max-width: 70%; } .banner-content a { font-size: 1.5rem; color: #fff; font-weight: bold; display: flex; align-items: center; } .banner-content i { color: #fff; margin-left: 0.8rem; } #banner-1 { background-image: url("../img/banner-1.jpg"); } #banner-2 { background-image: url("../img/banner-2.jpg"); } #banner-3 { background-image: url("../img/banner-3.jpg"); } .btn { padding: 8px 15px; height: 40px; color: #ffffff; border-radius: 20px; font-weight: bold; text-transform: uppercase; background-color: #d10024; cursor: pointer; outline: none; border: 2px solid #d10024; transition: 0.4s; } .btn:hover { background-color: #fff; color: #d10024; } .btn-half { border-top-left-radius: 0; border-bottom-left-radius: 0; text-transform: none; } .products-grid-card { border: 1px solid #b9babc; position: relative; width: 20%; padding: 1rem; trasition: 0.4s; display: flex; flex-direction: column; justify-content: center; align-items: center; } @media (max-width: 767.98px) { .products-grid-card { width: 90%; margin: 1rem; } } .products-grid-card:hover { border-color: #d10024; } .products-grid-card .label { text-transform: uppercase; border: 1px solid #d10024; color: #d10024; top: 1rem; right: 1rem; padding: 2px 6px; } .products-grid-card .new { background-color: #d10024; color: #fff; } .products-grid-card img { width: 100%; } .products-grid-card .category, .products-grid-card .product-name, .products-grid-card .product-price, .products-grid-card .rating-box, .products-grid-card .btn { margin-bottom: 1rem; } .products-grid-card .category { margin-top: 1rem; text-transform: uppercase; color: #b9babc; } .products-grid-card .product-name { text-transform: uppercase; font-size: 1.2rem; } .products-grid-card .product-price { color: #d10024; font-size: 1.5rem; font-weight: bold; } /*# sourceMappingURL=app.css.map */
19.566421
161
0.66959
17b9b913ca8f44890544c7e91e345f341e1cdc55
886
sh
Shell
scripts/docdeploy.sh
JahidAhmed/fgpv-vpgf
b6686db2bb4bd78239bd2093df055c3c41b2e1f8
[ "MIT" ]
1
2016-11-01T13:05:08.000Z
2016-11-01T13:05:08.000Z
scripts/docdeploy.sh
AleksueiR/fgpv-vpgf
55c3ac5e4e66bc9c077866f6f59373b9956ae915
[ "MIT" ]
null
null
null
scripts/docdeploy.sh
AleksueiR/fgpv-vpgf
55c3ac5e4e66bc9c077866f6f59373b9956ae915
[ "MIT" ]
1
2018-02-05T15:14:24.000Z
2018-02-05T15:14:24.000Z
#!/bin/bash set -e if [ "$TRAVIS_REPO_SLUG" == "fgpv-vpgf/fgpv-vpgf" ] && [ -n "$TRAVIS_TAG" ]; then npm run doc # this section assumes the id_rsa key has already been decrypted # devdeploy.sh should run before this script echo -e "Host *\n\tStrictHostKeyChecking no\n" > ~/.ssh/config eval `ssh-agent -s` ssh-add ~/.ssh/id_rsa git clone --depth=1 git@github.com:fgpv-vpgf/fgpv-vpgf.github.io.git ghdocs mkdir -p ghdocs/fgpv-vpgf/$TRAVIS_TAG rsync -av --delete docbuild/ ghdocs/fgpv-vpgf/$TRAVIS_TAG/ bash ./scripts/make_doc_index.sh ghdocs/fgpv-vpgf/ > ghdocs/fgpv-vpgf/index.html cd ghdocs git add fgpv-vpgf/$TRAVIS_TAG git add fgpv-vpgf/index.html git config user.email "glitch.chatbot@gmail.com" git config user.name "Glitch Bot" git commit -m "Docs for fgpv@$TRAVIS_TAG" git push cd .. rm -rf ghdocs fi
34.076923
84
0.677201
4dd7410faec21b63eeece02623e75bcda6998176
212
cs
C#
src/XQ.ProjectX.Service/TalentInfo.cs
moto2002/kaituo_src
a75fe94ede2ef27ce87047f5b760ab855ab36eec
[ "MIT" ]
1
2018-08-28T12:20:57.000Z
2018-08-28T12:20:57.000Z
src/XQ.ProjectX.Service/TalentInfo.cs
moto2002/kaituo_src
a75fe94ede2ef27ce87047f5b760ab855ab36eec
[ "MIT" ]
null
null
null
src/XQ.ProjectX.Service/TalentInfo.cs
moto2002/kaituo_src
a75fe94ede2ef27ce87047f5b760ab855ab36eec
[ "MIT" ]
null
null
null
using System; namespace XQ.ProjectX.Service { public class TalentInfo { public string TalentGroupID; public string TalentID; public int TalentLevel; public int Talent; public int Timestamp; } }
11.777778
30
0.735849
0d5b1c7eb40060338a594c9bce6e5846ebc230be
30,414
c
C
opp/ir/ir.c
MadMax129/C-Interpreter
64fffaec1553fe552315d745d85ced9e45b5e70a
[ "Apache-2.0" ]
9
2020-12-24T22:49:49.000Z
2022-01-21T08:10:29.000Z
opp/ir/ir.c
MadMax129/C-Interpreter
64fffaec1553fe552315d745d85ced9e45b5e70a
[ "Apache-2.0" ]
null
null
null
opp/ir/ir.c
MadMax129/C-Interpreter
64fffaec1553fe552315d745d85ced9e45b5e70a
[ "Apache-2.0" ]
1
2020-06-07T20:13:37.000Z
2020-06-07T20:13:37.000Z
/** @file ir.c * * @brief Opp IR * * Copyright (c) 2020 Maks S * * 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. */ #include "ir.h" static enum Regs oppir_push_reg(struct OppIr* ir, enum OppIr_Const_Type type); static void oppir_push(struct OppIr* ir, struct Register reg); static struct Register oppir_pop_reg(struct OppIr* ir); static enum Regs oppir_reg_alloc(struct OppIr* ir); static void oppir_write_const(struct OppIr* ir, struct OppIr_Value* imm); static int32_t oppir_get_spill(struct OppIr* ir); static void oppir_set_offsets(struct OppIr* ir); static void oppir_save_reg(struct OppIr* ir, enum Regs reg_type, struct OppIr_Set* set); static void oppir_write_reg(struct OppIr* ir, enum Regs reg_type, struct OppIr_Const* imm); static void oppir_write_data(struct OppIr* ir, const unsigned int len, unsigned char* d); // Opcodes static void oppir_eval_const(struct OppIr* ir, struct OppIr_Const* imm); static void oppir_local_param(struct OppIr* ir, unsigned int args); static void oppir_eval_func(struct OppIr* ir, struct OppIr_Func* fn); static void oppir_eval_arg(struct OppIr* ir, struct OppIr_Arg* arg); static void oppir_eval_mov_arg(struct OppIr* ir, struct OppIr_Arg* arg); static void oppir_eval_label(struct OppIr* ir, struct OppIr_Const* loc); static void oppir_eval_jmp(struct OppIr* ir, struct OppIr_Jmp* jmp); static void oppir_eval_var(struct OppIr* ir, struct OppIr_Var* var); static void oppir_eval_cmp(struct OppIr* ir, struct OppIr_Cmp* cmp); static void oppir_eval_arith(struct OppIr* ir, struct OppIr_Arith* arith); static void oppir_eval_set(struct OppIr* ir, struct OppIr_Set* set); static void oppir_eval_cast(struct OppIr* ir, struct OppIr_Cast* cast); static void oppir_eval_ptr_assign(struct OppIr* ir, struct OppIr_Cast* cast); static void oppir_eval_bitwise(struct OppIr* ir, struct OppIr_Bit* bit); static void oppir_eval_addr(struct OppIr* ir, struct OppIr_Const* addr); static void oppir_eval_end(struct OppIr* ir); static void oppir_eval_ret(struct OppIr* ir); static void oppir_eval_call(struct OppIr* ir, struct OppIr_Call* call); static void oppir_eval_deref(struct OppIr* ir, struct OppIr_Cast* cast); static struct Register regs[] = { {.reg = REG_RAX, .used = 0}, {.reg = REG_RCX, .used = 0}, {.reg = REG_RDX, .used = 0}, {.reg = REG_XMM0, .used = 0}, {.reg = REG_XMM1, .used = 0}, {.reg = REG_XMM2, .used = 0}, }; static unsigned char a_label[7]; struct OppIr* init_oppir() { struct OppIr* ir = (struct OppIr*)malloc(sizeof(struct OppIr)); if (ir == NULL) goto err; // Bytecode ir->code.bytes = (unsigned char*)malloc(INIT_BYTECODE_SIZE); if (ir->code.bytes == NULL) goto err; ir->code.idx = 0; ir->code.allocated = INIT_BYTECODE_SIZE; // Local Stack ir->local_stack.size = 0; ir->local_stack.pos = 0; ir->local_stack.frame_ptr = 0; // Offset Tables ir->offsets.offset_table = (int32_t*)malloc(sizeof(int32_t)*DEFAULT_OFFSET_TABLE); ir->offsets.jmp_table = (struct Jmp_Item*)malloc(sizeof(struct Jmp_Item)*DEFAULT_OFFSET_TABLE); if (ir->offsets.offset_table == NULL || ir->offsets.jmp_table == NULL) goto err; ir->offsets.allocated = DEFAULT_OFFSET_TABLE; ir->offsets.jmp_idx = 0; memset(ir->offsets.offset_table, 0, sizeof(int32_t)*DEFAULT_OFFSET_TABLE); memset(ir->offsets.jmp_table, 0, sizeof(struct Jmp_Item)*DEFAULT_OFFSET_TABLE); // Register Allocation ir->regalloc.amount = 0; ir->regalloc.allocated = DEFAULT_SPILL; ir->regalloc.spills = (struct Spill*) malloc(sizeof(struct Spill)*DEFAULT_SPILL); memset(ir->regalloc.spills, 0, sizeof(struct Spill)*DEFAULT_SPILL); if (ir->regalloc.spills == NULL) goto err; // Reg Stack ir->reg_stack.stack = (struct Register*) malloc(sizeof(struct Register)*DEFAULT_REG_STACK); memset(ir->reg_stack.stack, 0, sizeof(struct Register)*DEFAULT_REG_STACK); if (ir->reg_stack.stack == NULL) goto err; ir->reg_stack.top = ir->reg_stack.stack; ir->reg_stack.allocated = DEFAULT_REG_STACK; ir->instr = NULL; // Data ir->data_seg.data = (unsigned char*) malloc(INIT_BYTECODE_SIZE); if (ir->data_seg.data == NULL) goto err; ir->data_seg.allocated = INIT_BYTECODE_SIZE; ir->data_seg.idx = 0; memset(ir->data_seg.data, 0, INIT_BYTECODE_SIZE); // End return ir; err: INTERNAL_ERROR("Malloc Fail"); return NULL; } void oppir_free(struct OppIr* ir) { free(ir->code.bytes); free(ir->data_seg.data); free(ir->offsets.offset_table); free(ir->offsets.jmp_table); free(ir->regalloc.spills); free(ir->reg_stack.stack); free(ir); } void dump_bytes(struct OppIr* ir, OppIO* io) { if (io == NULL) { for (size_t i = 0; i < ir->code.idx; i++) { if ((i+1) % 16 == 0) printf("\n"); else printf("%X ", ir->code.bytes[i]); } printf("\n"); } else { fwrite(ir->code.bytes, sizeof(unsigned char), ir->code.idx, io->file); fclose(io->file); } } void oppir_get_opcodes(struct OppIr *ir, struct OppIr_Instr* instr) { if (instr == NULL) return; ir->instr = instr; } void oppir_eval(struct OppIr* ir) { #ifdef LINUX64 init_strtab(); init_elf_syms(); init_reloc(); #endif for (size_t index = 0; index < ir->instr->instr_idx; index++) oppir_eval_opcode(ir, &ir->instr->opcodes[index]); #ifdef LINUX64 init_elf_header(DEFAULT_SECT); init_text_sect(ir); init_data_sect(ir); init_symtab_sect(); init_shstrtab_sect(); init_strtab_sect(); init_rela_text_sect(); elf_offsets(ir); #endif // dump_data(ir); } void oppir_emit_obj(struct OppIr* ir, OppIO* out) { #ifdef LINUX64 write_elf64(ir, out); #endif free_elf_data(); } void oppir_check_realloc(struct OppIr* ir, unsigned int bytes) { if ((ir->code.idx + bytes) >= ir->code.allocated) { ir->code.bytes = (unsigned char*) realloc(ir->code.bytes, (64+ir->code.allocated)); if (ir->code.bytes == NULL) INTERNAL_ERROR("Malloc Fail"); ir->code.allocated += 64; } } void oppir_check_data(struct OppIr* ir, unsigned int bytes) { if ((ir->data_seg.idx + bytes) >= ir->data_seg.allocated) { ir->data_seg.data = (unsigned char*) realloc(ir->data_seg.data, (64+ir->data_seg.allocated)); if (ir->data_seg.data == NULL) INTERNAL_ERROR("Malloc Fail"); ir->data_seg.allocated += 64; } } static void oppir_gen_label() { static unsigned int idx = 0; sprintf(a_label, "L.%u", idx); idx++; } static void oppir_write_data(struct OppIr* ir, const unsigned int len, unsigned char* d) { oppir_check_data(ir, len+1); for (unsigned int i = 0; i <= len; i++) ir->data_seg.data[ir->data_seg.idx++] = d[i]; } static void oppir_check_regstack(struct OppIr* ir) { if (ir->reg_stack.top >= (ir->reg_stack.stack + ir->reg_stack.allocated)) { ir->reg_stack.stack = (struct Register*) realloc(ir->reg_stack.stack, (16+ir->reg_stack.allocated)); if (ir->reg_stack.stack == NULL) INTERNAL_ERROR("Malloc fail"); ir->reg_stack.allocated += 16; } } static int32_t oppir_get_spill(struct OppIr* ir) { for (unsigned int i = 0; i < ir->regalloc.allocated; i++) { if (!ir->regalloc.spills[i].use && ir->regalloc.spills[i].made) { ir->regalloc.spills[i].use = 1; return ir->regalloc.spills[i].loc; } } if (ir->regalloc.amount == ir->regalloc.allocated) INTERNAL_ERROR("OppIR spill limit met"); ir->local_stack.size += 8; ir->local_stack.pos -= 8; ir->regalloc.spills[ir->regalloc.amount].loc = ir->local_stack.pos; ir->regalloc.spills[ir->regalloc.amount].use = 1; ir->regalloc.spills[ir->regalloc.amount].made = 1; ir->regalloc.amount++; return ir->local_stack.pos; } static enum Regs oppir_push_reg(struct OppIr* ir, enum OppIr_Const_Type type) { int i = (type == IMM_F32 || type == IMM_F64) ? 3 : 0; const int max = (i == 3) ? 6 : 3; for (i; i < max; i++) { if (!regs[i].used) { regs[i].used = 1; oppir_check_regstack(ir); ir->reg_stack.top->reg = regs[i].reg; ir->reg_stack.top->type = type; ir->reg_stack.top->used = 1; ir->reg_stack.top->loc = 0; ir->reg_stack.top->spilled = 0; ir->reg_stack.top++; return regs[i].reg; } } return oppir_reg_alloc(ir); } static void oppir_push(struct OppIr* ir, struct Register reg) { if (regs[reg.reg].used == 0) { regs[reg.reg].used = 1; oppir_check_regstack(ir); *ir->reg_stack.top = reg; ir->reg_stack.top->used = 1; ir->reg_stack.top->loc = 0; ir->reg_stack.top->spilled = 0; ir->reg_stack.top++; } else printf("Internal error oppir_push\n"), exit(1); } static enum Regs oppir_reg_alloc(struct OppIr* ir) { struct Register spill_reg = {0}; struct OppIr_Set set; for (struct Register* i = ir->reg_stack.stack; i < ir->reg_stack.top; i++) { if (i->used && !i->spilled) { i->spilled = 1; i->loc = oppir_get_spill(ir); spill_reg.loc = i->loc; spill_reg.reg = i->reg; spill_reg.type = i->type; oppir_check_regstack(ir); ir->reg_stack.top->reg = i->reg; ir->reg_stack.top->used = 1; ir->reg_stack.top->loc = 0; ir->reg_stack.top->spilled = 0; ir->reg_stack.top->type = i->type; ir->reg_stack.top++; break; } } if (spill_reg.type != IMM_F64 && spill_reg.type != IMM_F32) spill_reg.type = IMM_U64; set.val.type = IMM_I32; set.val.imm_i32 = spill_reg.loc; set.loc_type = spill_reg.type; oppir_save_reg(ir, spill_reg.reg, &set); return spill_reg.reg; } static struct Register oppir_pop_reg(struct OppIr* ir) { struct Register pop_reg = {0}; ir->reg_stack.top--; if (ir->reg_stack.top < ir->reg_stack.stack || !ir->reg_stack.top->used) printf("Error reg_stack pop overflow\n"); if (ir->reg_stack.top->spilled) { ir->reg_stack.top->used = 0; ir->reg_stack.top->spilled = 0; struct OppIr_Const val = { .loc_type = ir->reg_stack.top->type, .val.type = IMM_LOC, .val.imm_i32 = ir->reg_stack.top->loc }; oppir_eval_const(ir, &val); pop_reg = oppir_pop_reg(ir); for (unsigned int i = 0; i < ir->regalloc.allocated; i++) { if (ir->regalloc.spills[i].loc == ir->reg_stack.top->loc) { ir->regalloc.spills[i].use = 0; break; } } } else { ir->reg_stack.top->used = 0; pop_reg = *ir->reg_stack.top; regs[pop_reg.reg].used = 0; } return pop_reg; } static void oppir_write_const(struct OppIr* ir, struct OppIr_Value* imm) { switch (imm->type) { case IMM_U64: case IMM_I64: { oppir_check_realloc(ir, 8); ir->code.bytes[ir->code.idx++] = imm->imm_i64 & 0xFF; for (int i = 8; i <= 56; i += 8) ir->code.bytes[ir->code.idx++] = (imm->imm_i64 >> i) & 0xFF; break; } case IMM_I32: { oppir_check_realloc(ir, 4); ir->code.bytes[ir->code.idx++] = imm->imm_i32 & 0xFF; for (int i = 8; i <= 24; i += 8) ir->code.bytes[ir->code.idx++] = (imm->imm_i32 >> i) & 0xFF; break; } case IMM_I8: { oppir_check_realloc(ir, 1); ir->code.bytes[ir->code.idx++] = imm->imm_i8; break; } default: break; } } void oppir_eval_opcode(struct OppIr* ir, struct OppIr_Opcode* op) { switch (op->type) { case OPCODE_CONST: oppir_eval_const(ir, &op->constant); break; case OPCODE_ASSIGN: oppir_eval_set(ir, &op->set); break; case OPCODE_FUNC: oppir_eval_func(ir, &op->func); break; case OPCODE_ARG: oppir_eval_arg(ir, &op->arg); break; case OPCODE_END: oppir_eval_end(ir); break; case OPCODE_CAST: oppir_eval_cast(ir, &op->cast); break; case OPCODE_ADDR: oppir_eval_addr(ir, &op->constant); break; case OPCODE_DEREF: oppir_eval_deref(ir, &op->cast); break; case OPCODE_PTR_ASSIGN: oppir_eval_ptr_assign(ir, &op->cast); break; case OPCODE_CALL: oppir_eval_call(ir, &op->call); break; case OPCODE_MOV_ARG: oppir_eval_mov_arg(ir, &op->arg); break; case OPCODE_LABEL: oppir_eval_label(ir, &op->constant); break; case OPCODE_JMP: oppir_eval_jmp(ir, &op->jmp); break; case OPCODE_CMP: oppir_eval_cmp(ir, &op->cmp); break; case OPCODE_VAR: oppir_eval_var(ir, &op->var); break; case OPCODE_RET: oppir_eval_ret(ir); break; case OPCODE_ARITH: oppir_eval_arith(ir, &op->arith); break; default: break; } } static void oppir_eval_sym(struct OppIr* ir, enum Regs reg, struct OppIr_Const* imm) { oppir_check_realloc(ir, 3); IR_EMIT(0x48); IR_EMIT(0x8b); IR_EMIT(0x05 + (reg*8)); make_reloc(ir->code.idx, imm->val.imm_sym, 9); imm->val.type = IMM_I32; imm->val.imm_i32 = 0; } static void oppir_eval_float(struct OppIr* ir, enum Regs reg, struct OppIr_Const* imm) { oppir_check_realloc(ir, 8); unsigned int len = 0; union { unsigned char l[8]; float f32; double f64; } data; if (imm->val.type == IMM_F64) { IR_EMIT(0xf2); data.f64 = imm->val.imm_f64; len = 7; } else { IR_EMIT(0xf3); data.f32 = (float)imm->val.imm_f64; len = 3; } IR_EMIT(0x0f); IR_EMIT(0x10); IR_EMIT(0x05 + (reg-3)); oppir_gen_label(); make_global_sym((char*)a_label, ir->data_seg.idx, 0); make_reloc(ir->code.idx, (char*)a_label, 2); oppir_write_data(ir, len, (unsigned char*)data.l); imm->val.type = IMM_I32; imm->val.imm_i32 = 0; } static void oppir_eval_const(struct OppIr* ir, struct OppIr_Const* imm) { enum Regs reg_type; if (!imm->nopush) { enum OppIr_Const_Type t; if (imm->loc_type == 0) t = imm->val.type; else t = imm->loc_type; reg_type = oppir_push_reg(ir, t); } else reg_type = REG_RAX; if (imm->val.type == IMM_SYM) { oppir_eval_sym(ir, reg_type, imm); } else if (imm->val.type > IMM_LOC && imm->val.type < IMM_F32) { oppir_check_realloc(ir, 2); imm->val.type = IMM_I64; ir->code.bytes[ir->code.idx++] = 0x48; ir->code.bytes[ir->code.idx++] = 0xb8 + reg_type; } else if (imm->val.type > IMM_I64) { oppir_eval_float(ir, reg_type, imm); } else if (imm->val.type == IMM_LOC) { oppir_write_reg(ir, reg_type, imm); } else if (imm->val.type == IMM_STR) { oppir_gen_label(); make_global_sym((char*)a_label, ir->data_seg.idx, 0); oppir_write_data(ir, strlen(imm->val.imm_sym), imm->val.imm_sym); oppir_check_realloc(ir, 7); IR_EMIT(0x48); IR_EMIT(0x8d); IR_EMIT(0x05 + (reg_type*8)); make_reloc(ir->code.idx, (char*)a_label, 2); imm->val.type = IMM_I32; imm->val.imm_i32 = 0; } oppir_write_const(ir, &imm->val); } static void oppir_write_reg(struct OppIr* ir, enum Regs reg_type, struct OppIr_Const* imm) { bool small = imm->val.imm_i32 > -128; if (small) imm->val.type = IMM_I8; else imm->val.type = IMM_I32; oppir_check_realloc(ir, 8); switch (imm->loc_type) { case IMM_F32: case IMM_F64: if (imm->loc_type == IMM_F32) IR_EMIT(0xf3); else IR_EMIT(0xf2); IR_EMIT(0x0f); IR_EMIT(0x10); reg_type -= 3; break; case IMM_U8: case IMM_U16: case IMM_I8: case IMM_I16: case IMM_I32: IR_EMIT(0x48); if (imm->loc_type != IMM_I32) IR_EMIT(0x0f); else IR_EMIT(0x63); switch (imm->loc_type) { break; case IMM_I8: IR_EMIT(0xbe); break; case IMM_U8: IR_EMIT(0xb7); break; case IMM_I16: IR_EMIT(0xbf); break; case IMM_U16: IR_EMIT(0xb7); break; } break; case IMM_U64: case IMM_I64: IR_EMIT(0x48); IR_EMIT(0x8b); break; case IMM_U32: IR_EMIT(0x8b); break; default: break; } if (small) IR_EMIT(0x45 + (reg_type*8)); else IR_EMIT(0x85 + (reg_type*8)); } static void oppir_save_reg(struct OppIr* ir, enum Regs reg_type, struct OppIr_Set* set) { bool small = set->val.imm_i32 > -128; if (small) set->val.type = IMM_I8; oppir_check_realloc(ir, 3); switch (set->loc_type) { case IMM_I8: case IMM_U8: IR_EMIT(0x88); break; case IMM_I16: case IMM_U16: IR_EMIT(0x66); IR_EMIT(0x89); break; case IMM_I32: case IMM_U32: IR_EMIT(0x89); break; case IMM_I64: case IMM_U64: IR_EMIT(0x48); IR_EMIT(0x89); break; case IMM_F32: IR_EMIT(0xf3); IR_EMIT(0x0f); IR_EMIT(0x11); reg_type -= 3; break; case IMM_F64: IR_EMIT(0xf2); IR_EMIT(0x0f); IR_EMIT(0x11); reg_type -= 3; break; default: break; } if (small) IR_EMIT(0x45 + (reg_type*8)); else IR_EMIT(0x85 + (reg_type*8)); oppir_write_const(ir, &set->val); } static void oppir_eval_set(struct OppIr* ir, struct OppIr_Set* set) { if (set->global) { struct OppIr_Cast c = {.type = set->loc_type}; oppir_eval_ptr_assign(ir, &c); return; } struct Register reg_type = oppir_pop_reg(ir); bool small = set->val.imm_i32 > -128; oppir_save_reg(ir, reg_type.reg, set); } static void oppir_emit_frame(struct OppIr* ir) { struct OppIr_Value frame = { .type = IMM_I32, .imm_i32 = 0x00000000 }; IR_EMIT(0x55); IR_EMIT(0x48); IR_EMIT(0x89); IR_EMIT(0xe5); IR_EMIT(0x48); IR_EMIT(0x81); IR_EMIT(0xec); ir->local_stack.frame_ptr = ir->code.idx; oppir_write_const(ir, &frame); } static void oppir_eval_func(struct OppIr* ir, struct OppIr_Func* fn) { if (fn->ext) { make_extern(fn->fn_name); return; } oppir_check_realloc(ir, 11); // Reset local func info ir->local_stack.size = 0; ir->local_stack.pos = 0; ir->offsets.jmp_idx = 0; ir->regalloc.amount = 0; ir->reg_stack.top = ir->reg_stack.stack; for (unsigned int i = 0; i < ir->regalloc.allocated; i++) { ir->regalloc.spills[i].made = 0; ir->regalloc.spills[i].use = 0; } #ifdef LINUX64 make_fn_sym(fn->fn_name, ir->code.idx); #endif oppir_emit_frame(ir); } static void oppir_eval_arg(struct OppIr* ir, struct OppIr_Arg* arg) { // Ignore size type for now all are treated as 64 bit regs switch (arg->type) { case IMM_U8...IMM_I64: oppir_check_realloc(ir, 4); if (arg->idx < 4) IR_EMIT(0x48); else IR_EMIT(0x4c); IR_EMIT(0x89); if (arg->idx <= 1) IR_EMIT(0x7d - (arg->idx*8)); else if (arg->idx <= 3) IR_EMIT(0x55 - ((arg->idx-2)*8)); else IR_EMIT(0x45 + ((arg->idx-4)*8)); break; case IMM_F32...IMM_F64: oppir_check_realloc(ir, 5); if (arg->type == IMM_F64) IR_EMIT(0xf2); else IR_EMIT(0xf3); IR_EMIT(0x0f); IR_EMIT(0x11); IR_EMIT(0x45 + (arg->idx*8)); break; default: break; } ir->local_stack.size += 8; ir->local_stack.pos -= 8; IR_EMIT((char)ir->local_stack.pos); } static void oppir_eval_end(struct OppIr* ir) { struct OppIr_Value stack_size = { .type = IMM_I32, .imm_i32 = ir->local_stack.size }; size_t temp = ir->code.idx; ir->code.idx = ir->local_stack.frame_ptr; while ((stack_size.imm_i32 % 16) != 0) stack_size.imm_i32 += 1; oppir_write_const(ir, &stack_size); ir->code.idx = temp; struct OppIr_Const ret = { .val.imm_i32 = 0 }; oppir_eval_label(ir, &ret); IR_EMIT(0xc9); IR_EMIT(0xc3); oppir_set_offsets(ir); } static void oppir_set_offsets(struct OppIr* ir) { struct OppIr_Value val = { .type = IMM_I32, .imm_i32 = 0 }; for (unsigned int i = 0; i < ir->offsets.jmp_idx; i++) { size_t temp = ir->code.idx; int32_t jmp_loc = ir->offsets.offset_table[ir->offsets.jmp_table[i].table_pos] - (ir->offsets.jmp_table[i].loc + 4); ir->code.idx = ir->offsets.jmp_table[i].loc; val.imm_i32 = jmp_loc; oppir_write_const(ir, &val); ir->code.idx = temp; } } static void oppir_cast_to_f32(struct OppIr* ir, enum Regs reg) { enum Regs new_reg = oppir_push_reg(ir, IMM_F32); switch (reg) { case REG_RAX...REG_RDX: oppir_check_realloc(ir, 5); IR_EMIT(0xf3); IR_EMIT(0x48); IR_EMIT(0x0f); IR_EMIT(0x2a); IR_EMIT((0xc0 + ((new_reg-3)*8)) + reg); break; case REG_XMM0...REG_XMM2: oppir_check_realloc(ir, 4); IR_EMIT(0xf2); IR_EMIT(0x0f); IR_EMIT(0x5a); IR_EMIT(0xc0 + ((new_reg-3)*8) + (reg-3)); break; } } static void oppir_cast_to_f64(struct OppIr* ir, enum Regs reg) { enum Regs new_reg = oppir_push_reg(ir, IMM_F64); switch (reg) { case REG_RAX...REG_RDX: oppir_check_realloc(ir, 5); IR_EMIT(0xf2); IR_EMIT(0x48); IR_EMIT(0x0f); IR_EMIT(0x2a); IR_EMIT((0xc0 + ((new_reg-3)*8)) + (reg)); break; case REG_XMM0...REG_XMM2: oppir_check_realloc(ir, 4); IR_EMIT(0xf3); IR_EMIT(0x0f); IR_EMIT(0x5a); IR_EMIT(0xc0 + ((new_reg-3)*8) + (reg-3)); break; } } static void oppir_eval_cast(struct OppIr* ir, struct OppIr_Cast* cast) { struct Register reg = oppir_pop_reg(ir); switch (cast->type) { case IMM_F32: oppir_cast_to_f32(ir, reg.reg); break; case IMM_F64: oppir_cast_to_f64(ir, reg.reg); break; default: assert(false); break; } } static void oppir_eval_var(struct OppIr* ir, struct OppIr_Var* var) { if (var->global) { make_global_sym(var->name, ir->data_seg.idx, 0); oppir_check_data(ir, var->size); ir->data_seg.idx += var->size; } else { ir->local_stack.size += var->size; ir->local_stack.pos -= var->size; } } static void oppir_eval_addr(struct OppIr* ir, struct OppIr_Const* addr) { enum Regs reg = oppir_push_reg(ir, IMM_U64); oppir_check_realloc(ir, 7); bool small = addr->val.imm_i32 > -128; if (small) addr->val.type = IMM_I8; else addr->val.type = IMM_I32; IR_EMIT(0x48); IR_EMIT(0x8d); if (small) IR_EMIT(0x45 + (reg*8)); else IR_EMIT(0x85 + (reg*8)); oppir_write_const(ir, &addr->val); } static void oppir_emit_reg_comb(struct OppIr* ir, enum Regs lhs, enum Regs rhs) { switch (lhs) { case REG_RAX: IR_EMIT(0xc0 + (rhs*8)); break; case REG_RCX: IR_EMIT(0xc1 + (rhs*8)); break; case REG_RDX: IR_EMIT(0xc2 + (rhs*8)); break; default: break; } } static void oppir_eval_float_arith(struct OppIr* ir, struct OppIr_Arith* arith) { } static void oppir_eval_arith(struct OppIr* ir, struct OppIr_Arith* arith) { if (arith->floating) { oppir_eval_float_arith(ir, arith); return; } struct Register rhs = oppir_pop_reg(ir); BLOCK_REG(rhs.reg); struct Register lhs; if (!arith->imm) lhs = oppir_pop_reg(ir); else lhs = rhs; UNBLOCK_REG(rhs.reg); oppir_check_realloc(ir, 7); switch (arith->type) { case TADD: { IR_EMIT(0x48); if (arith->imm) { if (arith->val.type == IMM_I8) { IR_EMIT(0x83); IR_EMIT(0xc0 + rhs.reg); } else { if (rhs.reg == REG_RAX) IR_EMIT(0x05); else { IR_EMIT(0x81); IR_EMIT(0xc0 + rhs.reg); } } } else IR_EMIT(0x1); break; } case TMIN: { IR_EMIT(0x48); if (arith->imm) { if (arith->val.type == IMM_I8) { IR_EMIT(0x83); IR_EMIT(0xe8 + rhs.reg); } else { if (rhs.reg == REG_RAX) IR_EMIT(0x2d); else { IR_EMIT(0x81); IR_EMIT(0xe8 + rhs.reg); } } } else IR_EMIT(0x29); break; } case TMUL: { IR_EMIT(0x48); if (arith->imm) { if (arith->val.imm_i8 == -1) { IR_EMIT(0xf7); IR_EMIT(0xd8 + rhs.reg); goto skip; } else { IR_EMIT(0xc1); IR_EMIT(0xe0 + rhs.reg); char b = 0; while (arith->val.imm_i8 != 1) arith->val.imm_i8 >>= 1, b++; arith->val.imm_i8 = b; } } else { IR_EMIT(0x0f); IR_EMIT(0xaf); oppir_emit_reg_comb(ir, rhs.reg, lhs.reg); goto skip; } break; } case TDIV: { printf("FIX DIV\n"); assert(false); // if (lhs.reg != REG_RAX) { // if (regs[REG_RAX].used) // oppir_spill_reg(ir, REG_RAX); // oppir_check_realloc(ir, 3); // IR_EMIT(0x48); // IR_EMIT(0x89); // IR_EMIT(0xc8 + ((lhs.reg-1)*8)); // } // if (rhs.reg != REG_RCX) { // if (regs[REG_RCX].used) // oppir_spill_reg(ir, REG_RCX); // oppir_check_realloc(ir, 3); // IR_EMIT(0x48); // IR_EMIT(0x89); // IR_EMIT(0xd1); // } // if (!arith->unsign) { // IR_EMIT(0x48); // IR_EMIT(0x99); // IR_EMIT(0x48); // IR_EMIT(0xf7); // IR_EMIT(0xf9); // } // else { // IR_EMIT(0x48); // IR_EMIT(0xf7); // IR_EMIT(0xf1); // } goto skip; break; } } if (arith->imm) oppir_write_const(ir, &arith->val); else oppir_emit_reg_comb(ir, lhs.reg, rhs.reg); skip: oppir_push(ir, lhs); } static void oppir_eval_deref(struct OppIr* ir, struct OppIr_Cast* cast) { struct Register reg = oppir_pop_reg(ir); oppir_check_realloc(ir, 4); switch (cast->type) { case IMM_I8: IR_EMIT(0x48); IR_EMIT(0x0f); IR_EMIT(0xbe); break; case IMM_U8: IR_EMIT(0x48); IR_EMIT(0x0f); IR_EMIT(0xb6); break; case IMM_I16: IR_EMIT(0x48); IR_EMIT(0x0f); IR_EMIT(0xbf); break; case IMM_U16: IR_EMIT(0x48); IR_EMIT(0x0f); IR_EMIT(0xb7); break; case IMM_I32: IR_EMIT(0x48); IR_EMIT(0x63); break; case IMM_U32: IR_EMIT(0x8b); break; case IMM_I64: case IMM_U64: IR_EMIT(0x48); IR_EMIT(0x8b); break; case IMM_F64: IR_EMIT(0xf2); IR_EMIT(0x0f); IR_EMIT(0x10); break; case IMM_F32: IR_EMIT(0xf3); IR_EMIT(0x0f); IR_EMIT(0x10); break; default: break; } if (cast->type != IMM_F32 && cast->type != IMM_F64) { oppir_push(ir, reg); IR_EMIT(0x9 * (reg.reg)); } else { enum Regs new_reg = oppir_push_reg(ir, cast->type); IR_EMIT(((new_reg-3)*8) + reg.reg); } } static void oppir_eval_ptr_assign(struct OppIr* ir, struct OppIr_Cast* cast) { struct Register rhs = oppir_pop_reg(ir); struct Register lhs = oppir_pop_reg(ir); assert(cast->type != IMM_F32 && cast->type != IMM_F64); oppir_check_realloc(ir, 3); switch (cast->type) { case IMM_I8: case IMM_U8: IR_EMIT(0x88); break; case IMM_I16: case IMM_U16: IR_EMIT(0x66); IR_EMIT(0x89); break; case IMM_I32: case IMM_U32: IR_EMIT(0x89); break; case IMM_I64: case IMM_U64: IR_EMIT(0x48); IR_EMIT(0x89); break; default: break; } switch (lhs.reg) { case REG_RAX: IR_EMIT(0x08 * (rhs.reg)); break; case REG_RCX: IR_EMIT(rhs.reg == REG_RAX ? 0x1 : 0x11); break; case REG_RDX: IR_EMIT(rhs.reg == REG_RAX ? 0x2 : 0xa); break; } } static void oppir_eval_ret(struct OppIr* ir) { struct Register reg = oppir_pop_reg(ir); if (reg.reg != REG_RAX && reg.reg != REG_XMM0) { switch (reg.reg) { case REG_RCX: case REG_RDX: oppir_check_realloc(ir, 3); IR_EMIT(0x48); IR_EMIT(0x89); IR_EMIT(0xc0 + (reg.reg*8)); break; default: oppir_check_realloc(ir, 4); if (reg.type == IMM_F32) IR_EMIT(0xf3); else IR_EMIT(0xf2); IR_EMIT(0x0f); IR_EMIT(0x10); IR_EMIT(0xc1 + (reg.reg-4)); break; } } struct OppIr_Jmp jmp = { .type = PURE_JMP, .loc = 0 }; oppir_eval_jmp(ir, &jmp); } static void oppir_spill_all(struct OppIr* ir) { for (struct Register* i = ir->reg_stack.stack; i < ir->reg_stack.top; i++) { if (i->used && !i->spilled) { struct Register spill_reg = {0}; struct OppIr_Set set; i->spilled = 1; i->loc = oppir_get_spill(ir); spill_reg.loc = i->loc; spill_reg.reg = i->reg; spill_reg.type = i->type; if (spill_reg.type != IMM_F64 && spill_reg.type != IMM_F32) spill_reg.type = IMM_U64; regs[spill_reg.reg].used = false; set.val.type = IMM_I32; set.val.imm_i32 = spill_reg.loc; set.loc_type = spill_reg.type; oppir_save_reg(ir, spill_reg.reg, &set); } } } static void oppir_eval_call(struct OppIr* ir, struct OppIr_Call* call) { struct Register reg = {0}; if (call->extra_args > 2) { oppir_check_realloc(ir, 3); IR_EMIT(0x4c); IR_EMIT(0x89); IR_EMIT(0xd2); if (call->extra_args > 3) { IR_EMIT(0x4c); IR_EMIT(0x89); IR_EMIT(0xd9); } } oppir_spill_all(ir); if (call->imm) { oppir_check_realloc(ir, 4); IR_EMIT(0xe8); make_reloc(ir->code.idx, call->name, 4); IR_EMIT(0x00); IR_EMIT(0x00); IR_EMIT(0x00); IR_EMIT(0x00); } else { assert(false); } if (call->ret) { reg.reg = call->ret_type == IMM_F32 || call->ret_type == IMM_F64 ? REG_XMM0 : REG_RAX; reg.type = call->ret_type; oppir_push(ir, reg); } } static void oppir_eval_mov_arg(struct OppIr* ir, struct OppIr_Arg* arg) { if (arg->stop) { oppir_spill_all(ir); return; } struct Register reg = oppir_pop_reg(ir); if (arg->type != IMM_F64 && arg->type != IMM_F32) { oppir_check_realloc(ir, 3); if (arg->idx < 2) IR_EMIT(0x48); else IR_EMIT(0x49); IR_EMIT(0x89); switch (arg->idx) { case 0: case 1: IR_EMIT((0xc7 - arg->idx) + (reg.reg*8)); break; case 2: case 3: IR_EMIT((0xc2 + (arg->idx-2)) + (reg.reg*8)); break; case 4: case 5: IR_EMIT((0xc0 + (arg->idx-4)) + (reg.reg*8)); break; } } else { if ((reg.reg-3) == arg->idx) return; oppir_check_realloc(ir, 4); if (arg->type == IMM_F64) IR_EMIT(0xf2); else IR_EMIT(0xf3); IR_EMIT(0x0f); IR_EMIT(0x10); IR_EMIT((0xc0 + (arg->idx*8)) + reg.reg-3); } } static void oppir_eval_label(struct OppIr* ir, struct OppIr_Const* loc) { if ((unsigned int)loc->val.imm_i32 >= ir->offsets.allocated) { printf("LABEL REALLOC NEEDED\n"); } ir->offsets.offset_table[loc->val.imm_i32] = ir->code.idx; } static void oppir_eval_jmp(struct OppIr* ir, struct OppIr_Jmp* jmp) { if (jmp->loc >= ir->offsets.allocated) { printf("LABEL REALLOC NEEDED\n"); } if (jmp->type == PURE_JMP) IR_EMIT(0xe9); else IR_EMIT(0x0f); switch (jmp->type) { case TEQEQ: IR_EMIT(0x84); break; case TNOTEQ: IR_EMIT(0x85); break; case TGT: IR_EMIT(0x8f); break; case TLE: IR_EMIT(0x8e); break; case TLT: IR_EMIT(0x8c); break; case TGE: IR_EMIT(0x8d); break; } ir->offsets.jmp_table[ir->offsets.jmp_idx].loc = ir->code.idx; ir->offsets.jmp_table[ir->offsets.jmp_idx].table_pos = jmp->loc; IR_EMIT(0x00); IR_EMIT(0x00); IR_EMIT(0x00); IR_EMIT(0x00); ir->offsets.jmp_idx++; } static void oppir_eval_cmp(struct OppIr* ir, struct OppIr_Cmp* cmp) { struct Register rhs = oppir_pop_reg(ir); BLOCK_REG(rhs.reg); struct Register lhs = oppir_pop_reg(ir); UNBLOCK_REG(rhs.reg); oppir_check_realloc(ir, 3); // add floating and unsigned compares IR_EMIT(0x48); IR_EMIT(0x39); switch (lhs.reg) { case REG_RAX: IR_EMIT(0xc0 + (rhs.reg*8)); break; case REG_RCX: IR_EMIT(0xc1 + (rhs.reg*8)); break; case REG_RDX: IR_EMIT(0xc2 + (rhs.reg*8)); break; } }
20.80301
96
0.650753
112f3b6e1da78e353d5f826ee2418001a0cd3e19
19,569
css
CSS
src/index.css
basementuniverse/vscode-kanbn
f85619450fc2593eecc43b2f84dfc7556076c5f3
[ "MIT" ]
24
2021-05-01T10:47:42.000Z
2022-02-11T10:11:38.000Z
src/index.css
basementuniverse/vscode-kanbn
f85619450fc2593eecc43b2f84dfc7556076c5f3
[ "MIT" ]
14
2021-04-19T10:15:30.000Z
2022-02-25T12:05:52.000Z
src/index.css
basementuniverse/vscode-kanbn
f85619450fc2593eecc43b2f84dfc7556076c5f3
[ "MIT" ]
1
2021-09-30T11:45:01.000Z
2021-09-30T11:45:01.000Z
body.vscode-light, body.vscode-dark, body.vscode-high-contrast { margin: 0; padding: 1em; font-family: var(--vscode-font-family); font-size: var(--vscode-font-size); background-color: var(--vscode-editor-background); color: var(--vscode-foreground); } /*----------------------------------------------------------------------------- Board styles -----------------------------------------------------------------------------*/ .kanbn-header-name { font-size: 1.5em; margin-top: 0; padding-bottom: 0.5em; border-bottom: 1px var(--vscode-activityBar-inactiveForeground) solid; display: flex; text-align: left; } .kanbn-header-name p { display: inline-block; flex: 2; margin: 0; padding: 4px 0; } .kanbn-filter { position: relative; flex: 1; } .kanbn-filter form { width: 100%; display: flex; white-space: nowrap; } .kanbn-filter-input { box-sizing: border-box; flex: 1; padding: 8px; background-color: var(--vscode-input-background); color: var(--vscode-input-foreground); font-family: var(--vscode-font-family); font-size: var(--vscode-font-size); border: 1px transparent solid; } .kanbn-filter-input:hover, .kanbn-filter-input:focus { border-color: var(--vscode-input-border); } .kanbn-header-button { outline: none; border: 1px transparent solid; background-color: var(--vscode-button-background); color: var(--vscode-button-foreground); padding: 9px; margin-left: 8px; max-width: 120px; overflow-x: hidden; text-overflow: ellipsis; } .kanbn-header-button .codicon { font-size: 12px !important; position: relative; top: 1px; } .kanbn-header-button-burndown .codicon { top: 2px; } .kanbn-header-button-sprint .codicon { margin-right: 0.5em; } .kanbn-header-button:focus { border-color: var(--vscode-button-hoverBackground); } .kanbn-header-button:hover, .kanbn-header-button:active { background-color: var(--vscode-button-hoverBackground); } .kanbn-header-button-inactive { opacity: 0.6; } .kanbn-board { display: flex; align-items: stretch; } .kanbn-column { flex: 1; } .kanbn-column-name { color: var(--vscode-editor-foreground); font-size: 0.8em; letter-spacing: 0.1em; font-weight: bold; text-transform: uppercase; padding: 4px; padding-left: 8px; } .kanbn-column-name .codicon { font-size: 0.8em !important; margin-right: 0.5em; } .kanbn-column-button { position: relative; top: -2px; left: -4px; float: right; outline: none; border: 1px transparent solid; background-color: transparent; color: var(--vscode-button-foreground); padding: 2px; height: 16px; width: 16px; margin-right: 8px; border-radius: 1px; } .kanbn-column-button .codicon { font-size: 11px !important; font-weight: 900; } .kanbn-column-button:focus { border-color: var(--vscode-button-hoverBackground); } .kanbn-column-button:hover, .kanbn-column-button:active { background-color: var(--vscode-button-hoverBackground); } .kanbn-column-button.kanbn-sort-column-button .codicon { opacity: 0.5; font-weight: normal; } .kanbn-column-button.kanbn-sort-column-button.kanbn-column-sorted .codicon { opacity: 1; } .kanbn-column-count { opacity: 0.6; font-weight: normal; font-style: italic; margin-left: 8px; } .kanbn-column-task-list-container { height: calc(100% - 44px); } .kanbn-column-task-list { margin: 0 8px; border-left: 4px var(--vscode-activityBar-inactiveForeground) solid; min-height: 46px; height: 100%; transition: border-color .5s ease-in-out; } .kanbn-column-task-list.drag-over { border-color: var(--vscode-activityBar-foreground) !important; } .kanbn-column-backlog .kanbn-column-task-list { border-color: #36d; } .kanbn-column-in-progress .kanbn-column-task-list { border-color: #194; } .kanbn-column-todo .kanbn-column-task-list { border-color: #eb1; } .kanbn-column-done .kanbn-column-task-list { border-color: #e83; } /*----------------------------------------------------------------------------- Task styles -----------------------------------------------------------------------------*/ .kanbn-task { position: relative; overflow: hidden; padding: 4px 4px 8px 4px; margin: 8px; min-height: 30px; border-left: 4px var(--vscode-activityBar-inactiveForeground) solid; color: var(--vscode-editor-foreground); } body.vscode-light .kanbn-task { background-color: rgba(0, 0, 0, 0.05); } body.vscode-dark .kanbn-task { background-color: rgba(255, 255, 255, 0.03); } .kanbn-task.drag { border-color: var(--vscode-activityBar-foreground); } .kanbn-task-data { display: inline-block; margin: 4px 8px 4px 0; min-width: 30%; opacity: 0.7; font-size: 0.9em; font-weight: normal; font-style: italic; } .kanbn-task-data-label { opacity: 0.4; } .kanbn-task-data-name { display: block; } .kanbn-task-data-tags { display: block; } .kanbn-task-data-relation { display: block; } .kanbn-task-data-name button { margin: 0; padding: 0; border: none; outline: none; background-color: transparent; font-weight: bold; color: var(--vscode-editor-foreground); cursor: pointer; text-align: left; } .kanbn-task-data-name button:focus, .kanbn-task-data-name button:hover { border: none; outline: none; text-decoration: underline; } .kanbn-task div .codicon { position: relative; top: 1px; font-size: 0.9em !important; margin-right: 0.5em; } .kanbn-task-tag { display: inline-block; background-color: var(--vscode-activityBar-inactiveForeground); background-color: #999; color: #333; font-size: 0.8em; font-weight: bold; padding: 2px 4px; margin: 4px 4px 4px 0; border-radius: 4px; } .kanbn-task-tag-nothing { background-color: #6bf; } .kanbn-task-tag-tiny { background-color: #36d; } .kanbn-task-tag-small { background-color: #194; } .kanbn-task-tag-medium { background-color: #eb1; } .kanbn-task-tag-large { background-color: #e83; } .kanbn-task-tag-huge { background-color: #f42; } .kanbn-task-overdue .kanbn-task-data-due { color: #f22 !important; } .kanbn-task-progress { position: absolute; bottom: -2px; left: 0; height: 6px; background-color: #3c7; opacity: 0.7; transition: width .5s ease-in-out; } .kanbn-task-data-updated { display: none; } .kanbn-task-data-started { display: none; } .kanbn-task-data-due { display: none; } .kanbn-task-data-completed { display: none; } .kanbn-task-data-comments { display: none; } .kanbn-task-data-relation { display: none; } /*----------------------------------------------------------------------------- Task editor styles -----------------------------------------------------------------------------*/ .kanbn-task-editor-title { display: inline-block; font-size: 1.5em; margin-top: 0; } .kanbn-task-editor-dirty { margin-left: 8px; color: #f22; } .kanbn-task-editor-dates { font-size: var(--vscode-font-size); font-style: italic; font-weight: normal; opacity: 0.8; float: right; margin: 2px; } .kanbn-task-editor-form { display: flex; border-top: 1px solid var(--vscode-activityBar-inactiveForeground); } .kanbn-task-editor-field .kanbn-task-editor-title, .kanbn-task-editor-field-label p:first-of-type { color: var(--vscode-editor-foreground); font-size: 0.8em; letter-spacing: 0.1em; font-weight: bold; text-transform: uppercase; padding: 4px 0; border-bottom: none; } .kanbn-task-editor-column-left { width: 70%; padding-right: 1em; } .kanbn-task-editor-column-right { width: 30%; } .kanbn-task-editor-field { margin-bottom: 1em; } body.vscode-dark .kanbn-task-editor-field-input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); } .kanbn-task-editor-field-input, .kanbn-task-editor-field-select, .kanbn-task-editor-field-checkbox, .kanbn-task-editor-field-textarea { box-sizing: border-box; display: block; width: 100%; padding: 8px; margin: 8px 0; background-color: var(--vscode-input-background); color: var(--vscode-input-foreground); font-family: var(--vscode-font-family); font-size: var(--vscode-font-size); border: 1px transparent solid; } .kanbn-task-editor-field-input[type=date] { padding: 6px 8px; } .kanbn-task-editor-field-select { padding-bottom: 7px; } .kanbn-task-editor-field-textarea { min-height: 90px; resize: vertical; } .kanbn-task-editor-field-input:hover, .kanbn-task-editor-field-input:focus { border-color: var(--vscode-input-border); } .kanbn-task-editor-buttons { text-align: right; } .kanbn-task-editor-main-buttons { float: right; position: relative; top: -0.5em; } .kanbn-task-editor-button { outline: none; border: 1px transparent solid; background-color: var(--vscode-button-background); color: var(--vscode-button-foreground); padding: 9px 1em; margin-left: 8px; } .kanbn-task-editor-button .codicon { font-size: 11px !important; margin-right: 0.5em; position: relative; top: 1px; } .kanbn-task-editor-button:focus { border-color: var(--vscode-button-hoverBackground); } .kanbn-task-editor-button:hover, .kanbn-task-editor-button:active { background-color: var(--vscode-button-hoverBackground); } .kanbn-task-editor-button-delete:focus { border-color: #f22; } .kanbn-task-editor-button-delete:hover, .kanbn-task-editor-button-delete:active { background-color: #f22; } .kanbn-task-editor-field-errors { font-weight: bold; color: #f22; } .kanbn-task-editor-id { margin-bottom: 8px; font-style: italic; opacity: 0.8; } .kanbn-task-editor-row { display: flex; } .kanbn-task-editor-column { flex: 1; margin-right: 8px; } .kanbn-task-editor-column:last-child { margin-right: 0; } .kanbn-task-editor-field-relation-task { flex: 2; } .kanbn-task-editor-field-subtask-completed { flex: 0 0 2em; padding: 10px 0; } .kanbn-task-editor-column-buttons { white-space: nowrap; flex: 0; } .kanbn-task-editor-field .kanbn-task-editor-buttons { margin-top: 8px; } .kanbn-task-editor-column-buttons .kanbn-task-editor-button { margin: 8px 0 8px 8px; } .kanbn-task-editor-column-buttons .kanbn-task-editor-button .codicon { margin-right: 0; } .kanbn-task-editor-field-progress { position: relative; } .kanbn-task-editor-field-progress .kanbn-task-progress { bottom: 0; height: 4px; opacity: 1; } .kanbn-task-editor-field-tag { position: relative; } .kanbn-task-editor-tag-highlight { position: absolute; bottom: 8px; left: 0; height: 4px; width: 100%; } .kanbn-task-editor-row-comment { padding-bottom: 1em; margin-bottom: 1em; } .kanbn-task-editor-field-comment-author-value { padding: 16px 0; font-style: italic; opacity: 0.8; } .kanbn-task-editor-field-comment-author-value .codicon { font-size: 0.8em !important; margin-right: 0.5em; } .kanbn-task-editor-field-comment-date { padding: 16px 0; text-align: right; font-style: italic; opacity: 0.8; } .kanbn-task-editor-field-comment-text .kanbn-task-editor-field-textarea { min-height: 90px; } .kanbn-task-editor-comment-text { position: relative; padding: .5em; background-color: var(--vscode-input-background); min-height: 90px; white-space: pre-wrap; } .kanbn-task-editor-comment-text::after { content: ""; position: absolute; height: 16px; width: 24px; bottom: -15px; left: 95%; background-color: var(--vscode-input-background); clip-path: polygon(0 0, 100% 0, 100% 100%); } .kanbn-task-editor-field-label-description { display: inline-block; } .kanbn-task-editor-description-preview { padding: .5em; border: 1px var(--vscode-input-background) solid; } .kanbn-task-editor-button-edit-description { float: right; } .kanbn-task-editor-custom-checkbox { float: left; width: auto; position: relative; top: -.2em; margin: .5em 1em .5em 0; } /*----------------------------------------------------------------------------- Burndown chart styles -----------------------------------------------------------------------------*/ .kanbn-burndown-settings { position: relative; flex: 1; } .kanbn-burndown-settings form { width: 100%; display: flex; white-space: nowrap; } .kanbn-burndown-settings-sprint-select { box-sizing: border-box; flex: 1; padding: 8px; background-color: var(--vscode-input-background); color: var(--vscode-input-foreground); border: 1px transparent solid; } .kanbn-burndown-settings-input { box-sizing: border-box; display: block; flex: 0.5; padding: 8px; background-color: var(--vscode-input-background); color: var(--vscode-input-foreground); font-family: var(--vscode-font-family); font-size: var(--vscode-font-size); border: 1px transparent solid; } .kanbn-burndown-settings-input[type=date] { padding: 6px 8px; margin-left: 8px; } .kanbn-burndown-settings-sprint-select:hover, .kanbn-burndown-settings-sprint-select:focus, .kanbn-burndown-settings-input:hover, .kanbn-burndown-settings-input:focus { border-color: var(--vscode-input-border); } body.vscode-dark .kanbn-burndown-settings-input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); } .kanbn-burndown { height: 85vh; width: 95vw; } .kanbn-burndown-grid { stroke: var(--vscode-activityBar-inactiveForeground); } .kanbn-burndown-line path { stroke: #3c7; } .kanbn-burndown-point { stroke: var(--vscode-foreground); fill: var(--vscode-editor-background); } .kanbn-burndown-tooltip { background-color: var(--vscode-menu-background); color: var(--vscode-menu-foreground); padding: 8px; } .kanbn-burndown-tooltip p { margin: 0; } .kanbn-burndown-tooltip-date { font-weight: bold; } .kanbn-burndown-tooltip-task { font-style: italic; } /*----------------------------------------------------------------------------- Code block syntax highlighting styles -----------------------------------------------------------------------------*/ body.vscode-dark code[class*="language-"] span.token.comment, body.vscode-dark code[class*="language-"] span.token.prolog, body.vscode-dark code[class*="language-"] span.token.cdata { color: #808080; } body.vscode-dark code[class*="language-"] span.token.delimiter, body.vscode-dark code[class*="language-"] span.token.boolean, body.vscode-dark code[class*="language-"] span.token.keyword, body.vscode-dark code[class*="language-"] span.token.selector, body.vscode-dark code[class*="language-"] span.token.important, body.vscode-dark code[class*="language-"] span.token.atrule { color: #cc7832; } body.vscode-dark code[class*="language-"] span.token.operator, body.vscode-dark code[class*="language-"] span.token.punctuation, body.vscode-dark code[class*="language-"] span.token.attr-name { color: #a9b7c6; } body.vscode-dark code[class*="language-"] span.token.tag, body.vscode-dark code[class*="language-"] span.token.tag.punctuation, body.vscode-dark code[class*="language-"] span.token.doctype, body.vscode-dark code[class*="language-"] span.token.builtin { color: #e8bf6a; } body.vscode-dark code[class*="language-"] span.token.entity, body.vscode-dark code[class*="language-"] span.token.number, body.vscode-dark code[class*="language-"] span.token.symbol { color: #6897bb; } body.vscode-dark code[class*="language-"] span.token.property, body.vscode-dark code[class*="language-"] span.token.constant, body.vscode-dark code[class*="language-"] span.token.variable { color: #9876aa; } body.vscode-dark code[class*="language-"] span.token.string, body.vscode-dark code[class*="language-"] span.token.char { color: #6a8759; } body.vscode-dark code[class*="language-"] span.token.attr-value, body.vscode-dark code[class*="language-"] span.token.attr-value.punctuation { color: #a5c261; } body.vscode-dark code[class*="language-"] span.token.attr-value.punctuation:first-child { color: #a9b7c6; } body.vscode-dark code[class*="language-"] span.token.url { color: #287bde; } body.vscode-dark code[class*="language-"] span.token.function { color: #ffc66d; } body.vscode-dark code[class*="language-"] span.token.regex { color: #364135; } body.vscode-dark code[class*="language-"] span.token.inserted { color: #294436; } body.vscode-dark code[class*="language-"] span.token.deleted { color: #484a4a; } body.vscode-dark code.language-css span.token.property, body.vscode-dark code.language-css span.token.property + .token.punctuation { color: #a9b7c6; } body.vscode-dark code.language-css span.token.id, body.vscode-dark code.language-css .token.selector > .token.class, body.vscode-dark code.language-css .token.selector > .token.attribute, body.vscode-dark code.language-css .token.selector > .token.pseudo-class, body.vscode-dark code.language-css .token.selector > .token.pseudo-element { color: #ffc66d; } body.vscode-light code[class*="language-"] span.token.comment, body.vscode-light code[class*="language-"] span.token.prolog, body.vscode-light code[class*="language-"] span.token.doctype, body.vscode-light code[class*="language-"] span.token.cdata { color: #708090; } body.vscode-light code[class*="language-"] span.token.punctuation { color: #999999; } body.vscode-light code[class*="language-"] span.token.namespace { opacity: 0.7; } body.vscode-light code[class*="language-"] span.token.property, body.vscode-light code[class*="language-"] span.token.tag, body.vscode-light code[class*="language-"] span.token.boolean, body.vscode-light code[class*="language-"] span.token.number, body.vscode-light code[class*="language-"] span.token.constant, body.vscode-light code[class*="language-"] span.token.symbol, body.vscode-light code[class*="language-"] span.token.deleted { color: #990055; } body.vscode-light code[class*="language-"] span.token.selector, body.vscode-light code[class*="language-"] span.token.attr-name, body.vscode-light code[class*="language-"] span.token.string, body.vscode-light code[class*="language-"] span.token.char, body.vscode-light code[class*="language-"] span.token.builtin, body.vscode-light code[class*="language-"] span.token.inserted { color: #669900; } body.vscode-light code[class*="language-"] span.token.operator, body.vscode-light code[class*="language-"] span.token.entity, body.vscode-light code[class*="language-"] span.token.url, body.vscode-light code.language-css span.token.string { color: #9a6e3a; background: hsla(0, 0%, 100%, .5); } body.vscode-light code[class*="language-"] span.token.atrule, body.vscode-light code[class*="language-"] span.token.attr-value, body.vscode-light code[class*="language-"] span.token.keyword { color: #0077aa; } body.vscode-light code[class*="language-"] span.token.function, body.vscode-light code[class*="language-"] span.token.class-name { color: #dd4a68; } body.vscode-light code[class*="language-"] span.token.regex, body.vscode-light code[class*="language-"] span.token.important, body.vscode-light code[class*="language-"] span.token.variable { color: #ee9900; }
22.834306
97
0.650723
bb74c01e835a22057d66ca9a77d0922254aa1130
7,894
cs
C#
tests/Apworks.Tests/IronyQueryConditionParserTests.cs
cnark/apworks-core
30ed8531b019fa0c6253f62dfb2e61217eb7adc9
[ "Apache-2.0" ]
1
2021-05-12T01:56:22.000Z
2021-05-12T01:56:22.000Z
tests/Apworks.Tests/IronyQueryConditionParserTests.cs
cnark/apworks-core
30ed8531b019fa0c6253f62dfb2e61217eb7adc9
[ "Apache-2.0" ]
null
null
null
tests/Apworks.Tests/IronyQueryConditionParserTests.cs
cnark/apworks-core
30ed8531b019fa0c6253f62dfb2e61217eb7adc9
[ "Apache-2.0" ]
null
null
null
using Apworks.Querying.Parsers.Irony; using System.Linq; using System.Collections.Generic; using Xunit; using Apworks.Tests.Models; using System; namespace Apworks.Tests { public class IronyQueryConditionParserTests { private readonly List<Customer> Customers = new List<Customer>(); private static readonly DateTime CurrentDate = new DateTime(2017, 5, 17); public IronyQueryConditionParserTests() { Customers.Add(new Customer { Id = 1, Email = "jim@example.com", Name = "jim", DateRegistered = DateTime.Now.AddDays(-1) }); Customers.Add(new Customer { Id = 2, Email = "tom@example.com", Name = "tom", DateRegistered = DateTime.Now.AddDays(-2) }); Customers.Add(new Customer { Id = 3, Email = "alex@example.com", Name = "alex", DateRegistered = DateTime.Now.AddDays(-3) }); Customers.Add(new Customer { Id = 4, Email = "carol@example.com", Name = "carol", DateRegistered = DateTime.Now.AddDays(-4) }); Customers.Add(new Customer { Id = 5, Email = "david@example.com", Name = "david", DateRegistered = DateTime.Now.AddDays(-5) }); Customers.Add(new Customer { Id = 6, Email = "frank@example.com", Name = "frank", DateRegistered = DateTime.Now.AddDays(-6) }); Customers.Add(new Customer { Id = 7, Email = "peter@example.com", Name = "peter", DateRegistered = DateTime.Now.AddDays(-7) }); Customers.Add(new Customer { Id = 8, Email = "paul@example.com", Name = "paul", DateRegistered = DateTime.Now.AddDays(1) }); Customers.Add(new Customer { Id = 9, Email = "winter@example.com", Name = "winter", DateRegistered = DateTime.Now.AddDays(2) }); Customers.Add(new Customer { Id = 10, Email = "julie@example.com", Name = "julie", DateRegistered = DateTime.Now.AddDays(3) }); Customers.Add(new Customer { Id = 11, Email = "jim@example.com", Name = "jim", DateRegistered = DateTime.Now.AddDays(4) }); Customers.Add(new Customer { Id = 12, Email = "brian@example.com", Name = "brian", DateRegistered = DateTime.Now.AddDays(5) }); Customers.Add(new Customer { Id = 13, Email = "david@example.com", Name = "david", DateRegistered = DateTime.Now.AddDays(6) }); Customers.Add(new Customer { Id = 14, Email = "daniel@example.com", Name = "daniel", DateRegistered = DateTime.Now.AddDays(7) }); Customers.Add(new Customer { Id = 15, Email = "jill@example.com", Name = "jill", DateRegistered = DateTime.Now.AddDays(8) }); } [Fact] public void EqualTest() { var parser = new IronyQueryConditionParser(); var expression = parser.Parse<Customer>("Name eq \"paul\""); var result = Customers.Where(expression.Compile()); Assert.Equal(1, result.Count()); } [Fact] public void NotEqualTest() { var parser = new IronyQueryConditionParser(); var expression = parser.Parse<Customer>("Id ne 4"); var result = Customers.Where(expression.Compile()); Assert.Equal(14, result.Count()); } [Fact] public void NotTest() { var parser = new IronyQueryConditionParser(); var expression = parser.Parse<Customer>("not Id eq 4"); var result = Customers.Where(expression.Compile()); Assert.Equal(14, result.Count()); } [Fact] public void AndTest() { var parser = new IronyQueryConditionParser(); var expression = parser.Parse<Customer>("Id ge 5 and Name eq \"jim\""); var result = Customers.Where(expression.Compile()); Assert.Equal(1, result.Count()); } [Fact] public void OrTest() { var parser = new IronyQueryConditionParser(); var expression = parser.Parse<Customer>("Id ge 5 or Name eq \"jim\""); var result = Customers.Where(expression.Compile()); Assert.Equal(12, result.Count()); } [Fact] public void GreatThanOrEqualsToTest() { var parser = new IronyQueryConditionParser(); var expression = parser.Parse<Customer>("Id ge 5"); var result = Customers.Where(expression.Compile()); Assert.Equal(11, result.Count()); } [Fact] public void GreatThanTest() { var parser = new IronyQueryConditionParser(); var expression = parser.Parse<Customer>("Id gt 5"); var result = Customers.Where(expression.Compile()); Assert.Equal(10, result.Count()); } [Fact] public void LessThanOrEqualsToTest() { var parser = new IronyQueryConditionParser(); var expression = parser.Parse<Customer>("Id le 5"); var result = Customers.Where(expression.Compile()); Assert.Equal(5, result.Count()); } [Fact] public void LessThanTest() { var parser = new IronyQueryConditionParser(); var expression = parser.Parse<Customer>("Id lt 5"); var result = Customers.Where(expression.Compile()); Assert.Equal(4, result.Count()); } [Fact] public void StringStartsWithTest() { var parser = new IronyQueryConditionParser(); var expression = parser.Parse<Customer>("email sw \"fr\""); var result = Customers.Where(expression.Compile()); Assert.Equal(1, result.Count()); } [Fact] public void StringEndsWithTest() { var parser = new IronyQueryConditionParser(); var expression = parser.Parse<Customer>("name ew \"er\""); var result = Customers.Where(expression.Compile()); Assert.Equal(2, result.Count()); } [Fact] public void StringStartsEndsWithCombinedTest() { var parser = new IronyQueryConditionParser(); var expression = parser.Parse<Customer>("name ew \"er\" and email sw \"w\""); var result = Customers.Where(expression.Compile()); Assert.Equal(1, result.Count()); } [Fact] public void StringContainsTest() { var parser = new IronyQueryConditionParser(); var expression = parser.Parse<Customer>("name ct \"ul\""); var result = Customers.Where(expression.Compile()); Assert.Equal(2, result.Count()); } [Fact] public void DatePropertyLessThanTest() { var today = DateTime.Now.ToString("MM/dd/yyyy"); var parser = new IronyQueryConditionParser(); var expression = parser.Parse<Customer>($"dateRegistered lt \"{today}\""); var result = Customers.Where(expression.Compile()); Assert.Equal(7, result.Count()); } [Fact] public void DatePropertyGreatThanTest() { var today = DateTime.Now.ToString("MM/dd/yyyy"); var parser = new IronyQueryConditionParser(); var expression = parser.Parse<Customer>($"dateRegistered gt \"{today}\""); var result = Customers.Where(expression.Compile()); Assert.Equal(8, result.Count()); } [Fact] public void CombinedQueryTest() { var today = DateTime.Now.ToString("MM/dd/yyyy"); var parser = new IronyQueryConditionParser(); var queryString = $"(Name EQ \"jim\" or Name SW \"da\") AND NOT DateRegistered LT \"{today}\""; var expression = parser.Parse<Customer>(queryString); var result = Customers.Where(expression.Compile()); Assert.Equal(3, result.Count()); } } }
43.136612
141
0.580568
480b048f806387ef433e18cd1e830729e62ea126
107,887
sql
SQL
DB/dmd3.10.18.sql
bachhumanna/dmd
713856845a31b19c0edcf474848c87425f0248ab
[ "MIT" ]
null
null
null
DB/dmd3.10.18.sql
bachhumanna/dmd
713856845a31b19c0edcf474848c87425f0248ab
[ "MIT" ]
null
null
null
DB/dmd3.10.18.sql
bachhumanna/dmd
713856845a31b19c0edcf474848c87425f0248ab
[ "MIT" ]
null
null
null
-- phpMyAdmin SQL Dump -- version 4.5.4.1deb2ubuntu2.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Oct 03, 2018 at 10:47 AM -- Server version: 5.7.23-0ubuntu0.16.04.1 -- PHP Version: 7.0.32-0ubuntu0.16.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: `dmd` -- -- -------------------------------------------------------- -- -- Table structure for table `booking` -- CREATE TABLE `booking` ( `id` int(11) NOT NULL, `order_id` varchar(10) DEFAULT NULL, `users_id` int(11) NOT NULL, `franchisees_id` int(11) NOT NULL, `trip_status` int(11) DEFAULT NULL COMMENT '1=>Start, 2=>Complete,3=>Breakdown', `name` varchar(255) DEFAULT NULL, `email` varchar(255) DEFAULT NULL, `phone_number` varchar(255) DEFAULT NULL, `address` varchar(255) DEFAULT NULL, `note` text, `booking_time` datetime DEFAULT NULL, `base_location` varchar(255) NOT NULL, `drop_location` varchar(255) NOT NULL, `outward_companion` varchar(255) DEFAULT NULL, `outward_waiting` int(11) DEFAULT NULL, `journey_type` int(11) NOT NULL COMMENT '1=>On way,2=>Return', `return_companion` int(11) DEFAULT NULL, `return_waiting` int(11) DEFAULT NULL, `long_return` int(11) DEFAULT '0', `drop_off_to_base` int(11) DEFAULT NULL, `comfort_break` int(11) DEFAULT NULL, `total_distance` double(10,2) DEFAULT NULL, `total_duration` int(11) DEFAULT NULL, `total_price` double(10,2) DEFAULT NULL, `custom_price` double(10,2) DEFAULT NULL, `payment_mode` int(11) NOT NULL COMMENT '1=>Cash,2=>Credit', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `booking` -- INSERT INTO `booking` (`id`, `order_id`, `users_id`, `franchisees_id`, `trip_status`, `name`, `email`, `phone_number`, `address`, `note`, `booking_time`, `base_location`, `drop_location`, `outward_companion`, `outward_waiting`, `journey_type`, `return_companion`, `return_waiting`, `long_return`, `drop_off_to_base`, `comfort_break`, `total_distance`, `total_duration`, `total_price`, `custom_price`, `payment_mode`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, '', 1, 1, 0, 'Hasibur Rahaman', 'hassib2008@gmail.com', '789654123', 'Address', 'Note', '2018-09-29 16:55:00', 'Garia Station road Garia Kolkata 700084', 'Kolkata Railway Station (Chitpur Station), Belgachia, Calcutta, West Bengal, India', NULL, NULL, 2, NULL, NULL, 0, NULL, NULL, 24.96, 124, 51.00, 0.00, 1, '2018-09-22 05:14:49', '2018-09-24 01:06:33', NULL), (2, '', 1, 1, NULL, 'Hasibur Rahaman', 'hassib2008@gmail.com', '789654123', 'Address', 'as', '2018-09-29 19:55:00', 'Garia Station road Garia Kolkata 700084', 'Andhra Pradesh, India', NULL, NULL, 1, NULL, NULL, 0, NULL, NULL, 857.84, 1554, 1717.00, 10.23, 1, '2018-09-24 07:44:32', '2018-09-24 08:37:15', NULL), (3, '', 1, 1, NULL, 'Hasibur Rahaman', 'hassib2008@gmail.com', '789654123', 'Address', NULL, '2018-09-29 19:55:00', 'Garia Station road Garia Kolkata 700084', 'Garia Station Road, Baidyapara, Garia, Calcutta, West Bengal, India', NULL, NULL, 1, NULL, NULL, 0, NULL, NULL, 24.29, 101, 50.00, 70.00, 1, '2018-09-24 08:50:28', '2018-09-25 04:57:52', NULL), (35, '', 1, 1, NULL, 'Hasibur Rahaman', 'hassib2008@gmail.com', '789654123', 'Address', 'dasdasd', '2018-09-29 23:55:00', 'Garia Station road Garia Kolkata 700084', 'Netaji Subhash Chandra Bose International Airport (CCU), Jessore Road, Dum Dum, Calcutta, West Bengal, India', NULL, NULL, 1, NULL, NULL, 0, NULL, NULL, 20.53, 83, 104.85, NULL, 1, '2018-09-27 02:03:59', '2018-09-27 02:03:59', NULL), (41, '', 3, 1, NULL, 'Hasibur Rahaman', 'hassib2008@gmail.com', '789654123', 'Address', NULL, '2018-09-29 19:55:00', 'Garia Station road Garia Kolkata 700084', 'Dum Dum, Calcutta, West Bengal, India', NULL, NULL, 1, NULL, NULL, 0, NULL, NULL, 15.82, 80, 76.70, 100.00, 1, '2018-09-27 02:36:34', '2018-09-27 07:21:33', NULL), (42, '', 1, 1, NULL, 'Hasibur Rahaman', 'hassib2008@gmail.com', '789654123', 'Address', 'dasdasd', '2018-10-27 15:55:00', 'Garia Station road Garia Kolkata 700084', 'Netaji Subhash Chandra Bose International Airport (CCU), Jessore Road, Dum Dum, Calcutta, West Bengal, India', NULL, NULL, 1, NULL, NULL, 0, NULL, NULL, 20.53, 83, 104.85, NULL, 1, '2018-09-28 02:31:07', '2018-09-28 02:31:07', NULL), (45, '', 1, 1, NULL, 'Hasibur Rahaman', 'hassib2008@gmail.com', '789654123', 'Address', 'dasdasd', '2018-09-29 19:55:00', 'Garia Station road Garia Kolkata 700084', 'Netaji Subhash Chandra Bose International Airport (CCU), Jessore Road, Dum Dum, Calcutta, West Bengal, India', NULL, NULL, 1, NULL, NULL, 0, NULL, NULL, 20.53, 83, 104.85, NULL, 1, '2018-09-28 02:46:39', '2018-09-28 02:46:39', NULL), (46, '', 1, 1, NULL, 'Hasibur Rahaman', 'hassib2008@gmail.com', '789654123', 'Address', 'dasdasd', '2018-09-29 19:55:00', 'Garia Station road Garia Kolkata 700084', 'Netaji Subhash Chandra Bose International Airport (CCU), Jessore Road, Dum Dum, Calcutta, West Bengal, India', NULL, NULL, 1, NULL, NULL, 0, NULL, NULL, 20.53, 83, 104.85, NULL, 1, '2018-09-28 02:50:09', '2018-09-28 02:50:09', NULL), (47, 'O-10047', 1, 1, NULL, 'Hasibur Rahaman', 'hassib2008@gmail.com', '789654123', 'Address', 'dasdasd', '2018-09-29 19:55:00', 'Garia Station road Garia Kolkata 700084', 'Netaji Subhash Chandra Bose International Airport (CCU), Jessore Road, Dum Dum, Calcutta, West Bengal, India', NULL, NULL, 1, NULL, NULL, 0, NULL, NULL, 20.53, 83, 104.85, NULL, 1, '2018-09-28 02:50:30', '2018-09-28 02:50:30', NULL), (48, 'O-10048', 1, 1, NULL, 'Hasibur Rahaman', 'hassib2008@gmail.com', '789654123', 'Address', 'dasdasd', '2018-09-29 19:55:00', 'Garia Station road Garia Kolkata 700084', 'Netaji Subhash Chandra Bose International Airport (CCU), Jessore Road, Dum Dum, Calcutta, West Bengal, India', NULL, NULL, 1, NULL, NULL, 0, NULL, NULL, 20.53, 83, 104.85, NULL, 1, '2018-09-28 02:53:06', '2018-09-28 02:53:06', NULL), (49, 'O-10049', 1, 1, NULL, 'Hasibur Rahaman', 'hassib2008@gmail.com', '789654123', 'Address', 'dasdasd', '2018-10-31 10:50:00', 'Garia Station road Garia Kolkata 700084', 'Netaji Subhash Chandra Bose International Airport (CCU), Jessore Road, Dum Dum, Calcutta, West Bengal, India', NULL, NULL, 1, NULL, NULL, 0, NULL, NULL, 20.53, 83, 104.85, NULL, 1, '2018-09-28 02:55:57', '2018-09-28 02:55:57', NULL), (50, 'O-10050', 1, 1, NULL, 'Hasibur Rahaman', 'hassib2008@gmail.com', '789654123', 'Address', 'dasdasd', '2018-10-06 07:35:00', 'Garia Station road Garia Kolkata 700084', 'Netaji Subhash Chandra Bose International Airport (CCU), Jessore Road, Dum Dum, Calcutta, West Bengal, India', NULL, NULL, 1, NULL, NULL, 0, NULL, NULL, 20.53, 83, 104.85, NULL, 1, '2018-09-28 03:02:08', '2018-09-28 03:02:08', NULL), (51, 'O-10051', 1, 1, NULL, 'Hasibur Rahaman', 'hassib2008@gmail.com', '789654123', 'Address', 'dasdasd', '2018-09-29 19:55:00', 'Garia Station road Garia Kolkata 700084', 'Netaji Subhash Chandra Bose International Airport (CCU), Jessore Road, Dum Dum, Calcutta, West Bengal, India', NULL, NULL, 1, NULL, NULL, 0, NULL, NULL, 20.53, 83, 104.85, NULL, 1, '2018-09-28 04:13:23', '2018-09-28 04:13:23', NULL), (53, 'O-10053', 1, 1, NULL, 'Hasibur Rahaman', 'hassib2008@gmail.com', '789654123', 'Address', 'asdasd', '2018-11-02 15:55:00', 'Garia Station road Garia Kolkata 700084', 'Assam, India', NULL, NULL, 1, NULL, NULL, 0, NULL, NULL, 3032.36, 5629, 23456.05, NULL, 1, '2018-09-28 04:23:31', '2018-09-28 04:23:31', NULL), (54, 'O-10054', 1, 1, NULL, 'Hasibur Rahaman', 'hassib2008@gmail.com', '789654123', 'Address', 'asdasd', '2018-09-29 15:55:00', 'Garia Station road Garia Kolkata 700084', 'Assam, India', NULL, NULL, 1, NULL, NULL, 0, NULL, NULL, 3032.36, 5629, 23456.05, NULL, 1, '2018-09-28 04:28:10', '2018-09-28 04:28:10', NULL), (55, 'O-10055', 1, 1, NULL, 'Hasibur Rahaman', 'hassib2008@gmail.com', '789654123', 'Address', 'asdasd', '2018-10-27 19:55:00', 'Garia Station road Garia Kolkata 700084', 'Assam, India', NULL, NULL, 1, NULL, NULL, 0, NULL, NULL, 3032.36, 5629, 23456.05, NULL, 1, '2018-09-28 04:28:39', '2018-09-28 04:28:39', NULL), (56, 'O-10056', 1, 1, NULL, 'Hasibur Rahaman', 'hassib2008@gmail.com', '789654123', 'Address', NULL, '2018-09-29 16:55:00', 'Garia Station road Garia Kolkata 700084', 'Sealdah Railway Station, Sealdah, Raja Bazar, Calcutta, West Bengal, India', NULL, NULL, 1, NULL, NULL, 0, NULL, 0, 9.78, 44, 207.55, NULL, 1, '2018-09-28 05:38:39', '2018-09-28 05:39:56', NULL), (57, 'O-10057', 3, 1, NULL, 'Hasibur Rahaman', 'hassib2008@gmail.com', '789654123', 'Address', 'asdasdas', '2018-09-29 15:55:00', 'Garia Station road Garia Kolkata 700084', 'Chitpur, Calcutta, West Bengal, India', NULL, NULL, 1, NULL, NULL, 0, NULL, 0, 12.35, 66, 317.55, NULL, 1, '2018-09-28 06:03:04', '2018-09-28 06:03:04', NULL); -- -------------------------------------------------------- -- -- Table structure for table `booking_vehicle` -- CREATE TABLE `booking_vehicle` ( `id` int(11) NOT NULL, `status` int(11) DEFAULT NULL COMMENT '1=>accept,2=>Reject', `booking_id` int(11) NOT NULL, `vehicle_id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `created_at` timestamp(4) NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `booking_vehicle` -- INSERT INTO `booking_vehicle` (`id`, `status`, `booking_id`, `vehicle_id`, `user_id`, `created_at`, `updated_at`, `deleted_at`) VALUES (9, 2, 41, 1, 13, '2018-09-27 06:43:44.0000', '2018-09-27 07:13:29', '2018-09-27 07:13:29'), (11, NULL, 3, 1, 13, '2018-09-27 06:44:40.0000', '2018-09-27 06:44:40', NULL), (12, 1, 41, 2, 3, '2018-09-27 07:13:29.0000', '2018-09-27 08:24:43', NULL), (13, NULL, 2, 1, 13, '2018-09-28 01:32:53.0000', '2018-09-28 01:32:53', NULL), (14, NULL, 55, 1, 13, '2018-09-28 04:29:22.0000', '2018-09-28 04:29:22', NULL), (15, 1, 57, 2, 3, '2018-09-28 06:03:16.0000', '2018-10-01 07:20:35', NULL); -- -------------------------------------------------------- -- -- Table structure for table `default_permissions` -- CREATE TABLE `default_permissions` ( `id` int(10) UNSIGNED NOT NULL, `is_super` int(11) DEFAULT NULL, `type` int(11) NOT NULL COMMENT '1=>Franchisor, 2=>Franchisee', `name` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `default_permissions` -- INSERT INTO `default_permissions` (`id`, `is_super`, `type`, `name`, `created_at`, `updated_at`) VALUES (43, 1, 2, 'vehicles-tracking', NULL, NULL), (44, 1, 2, 'role.index', NULL, NULL), (45, 1, 2, 'role.create', NULL, NULL), (46, 1, 2, 'role.store', NULL, NULL), (47, 1, 2, 'role.show', NULL, NULL), (48, 1, 2, 'role.edit', NULL, NULL), (49, 1, 2, 'role.update', NULL, NULL), (50, 1, 2, 'role.destroy', NULL, NULL), (51, 1, 2, 'driver.index', NULL, NULL), (52, 1, 2, 'driver.create', NULL, NULL), (53, 1, 2, 'driver.store', NULL, NULL), (54, 1, 2, 'driver.show', NULL, NULL), (55, 1, 2, 'driver.edit', NULL, NULL), (56, 1, 2, 'driver.update', NULL, NULL), (57, 1, 2, 'driver.destroy', NULL, NULL), (58, 1, 2, 'franchisee-user.index', NULL, NULL), (59, 1, 2, 'franchisee-user.create', NULL, NULL), (60, 1, 2, 'franchisee-user.store', NULL, NULL), (61, 1, 2, 'franchisee-user.show', NULL, NULL), (62, 1, 2, 'franchisee-user.edit', NULL, NULL), (63, 1, 2, 'franchisee-user.update', NULL, NULL), (64, 1, 2, 'franchisee-user.destroy', NULL, NULL), (65, 1, 2, 'driving-request.index', NULL, NULL), (66, 1, 2, 'driving-request.create', NULL, NULL), (67, 1, 2, 'driving-request.store', NULL, NULL), (68, 1, 2, 'driving-request.show', NULL, NULL), (69, 1, 2, 'driving-request.edit', NULL, NULL), (70, 1, 2, 'driving-request.update', NULL, NULL), (71, 1, 2, 'driving-request.destroy', NULL, NULL), (72, 1, 2, 'booking.index', NULL, NULL), (73, 1, 2, 'booking.create', NULL, NULL), (74, 1, 2, 'booking.store', NULL, NULL), (75, 1, 2, 'booking.show', NULL, NULL), (76, 1, 2, 'booking.edit', NULL, NULL), (77, 1, 2, 'booking.update', NULL, NULL), (78, 1, 2, 'booking.destroy', NULL, NULL), (79, 1, 2, 'vehicles.index', NULL, NULL), (80, 1, 2, 'vehicles.create', NULL, NULL), (81, 1, 2, 'vehicles.store', NULL, NULL), (82, 1, 2, 'vehicles.show', NULL, NULL), (83, 1, 2, 'vehicles.edit', NULL, NULL), (84, 1, 2, 'vehicles.update', NULL, NULL), (85, 1, 2, 'vehicles.destroy', NULL, NULL); -- -------------------------------------------------------- -- -- Table structure for table `drivers_vehicles` -- CREATE TABLE `drivers_vehicles` ( `id` int(11) NOT NULL, `franchisees_id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `vehicle_id` int(11) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `drivers_vehicles` -- INSERT INTO `drivers_vehicles` (`id`, `franchisees_id`, `user_id`, `vehicle_id`, `created_at`, `updated_at`, `deleted_at`) VALUES (3, 1, 3, 1, '2018-09-25 03:55:46', '2018-09-25 03:57:54', '2018-09-25 03:57:54'), (4, 1, 13, 2, '2018-09-25 03:57:32', '2018-09-25 03:58:23', '2018-09-25 03:58:23'), (5, 1, 13, 1, '2018-09-25 03:58:27', '2018-09-26 00:08:25', '2018-09-26 00:08:25'), (6, 1, 3, 2, '2018-09-25 03:58:30', '2018-09-26 00:08:28', '2018-09-26 00:08:28'), (7, 1, 3, 2, '2018-09-26 00:08:33', '2018-09-26 05:33:52', '2018-09-26 05:33:52'), (8, 1, 13, 1, '2018-09-26 00:08:41', '2018-09-26 05:33:37', '2018-09-26 05:33:37'), (9, 1, 13, 1, '2018-09-26 05:33:48', '2018-09-26 05:33:55', '2018-09-26 05:33:55'), (10, 1, 13, 1, '2018-09-27 02:37:23', '2018-09-27 02:37:23', NULL), (11, 1, 3, 2, '2018-09-27 02:37:29', '2018-09-27 02:37:29', NULL); -- -------------------------------------------------------- -- -- Table structure for table `driver_attendance` -- CREATE TABLE `driver_attendance` ( `id` int(11) NOT NULL, `user_id` int(11) NOT NULL, `franchisees_id` int(11) NOT NULL, `attendance_date` date DEFAULT NULL, `in_time` time DEFAULT NULL, `out_time` time DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `driver_attendance` -- INSERT INTO `driver_attendance` (`id`, `user_id`, `franchisees_id`, `attendance_date`, `in_time`, `out_time`) VALUES (1, 3, 1, '2018-09-26', '09:34:14', '09:34:43'), (2, 3, 1, '2018-09-26', '09:34:46', '09:34:50'), (3, 3, 1, '2018-09-27', '09:57:06', '10:14:02'), (4, 3, 1, '2018-09-27', '10:14:58', '10:16:13'), (5, 3, 1, '2018-09-27', '10:16:51', '10:42:11'), (6, 3, 1, '2018-09-27', '11:30:04', '11:32:53'), (7, 3, 1, '2018-09-27', '12:40:52', '12:41:59'), (8, 3, 1, '2018-09-27', '12:42:49', '12:44:53'), (9, 3, 1, '2018-09-27', '12:56:45', '13:00:00'), (10, 3, 1, '2018-09-27', '13:02:21', '13:03:52'), (11, 3, 1, '2018-09-27', '13:05:46', '13:14:33'), (12, 3, 1, '2018-09-27', '13:15:23', '13:16:02'), (13, 3, 1, '2018-09-27', '13:16:28', '13:18:14'), (14, 3, 1, '2018-09-27', '13:18:56', '13:22:22'), (15, 3, 1, '2018-09-27', '13:24:52', '13:29:00'), (16, 3, 1, '2018-09-27', '13:29:37', '13:30:45'), (17, 3, 1, '2018-09-27', '13:31:27', '13:33:02'), (18, 3, 1, '2018-09-27', '13:33:40', '13:47:09'), (19, 3, 1, '2018-09-27', '13:53:34', NULL), (20, 3, 1, '2018-09-28', '06:24:16', '06:24:48'), (21, 3, 1, '2018-09-28', '06:24:49', '06:24:53'), (22, 3, 1, '2018-09-28', '06:24:54', '11:44:35'), (23, 3, 1, '2018-10-01', '08:12:31', '08:15:25'), (24, 3, 1, '2018-10-01', '08:16:59', '08:38:13'), (25, 3, 1, '2018-10-01', '08:40:42', '08:43:02'), (26, 3, 1, '2018-10-01', '09:43:09', '12:50:14'), (27, 3, 1, '2018-10-02', '06:50:23', '07:05:42'); -- -------------------------------------------------------- -- -- Table structure for table `driver_details` -- CREATE TABLE `driver_details` ( `id` int(10) NOT NULL, `user_id` int(10) NOT NULL, `drivinglicence` varchar(255) DEFAULT NULL COMMENT 'PDF or Image', `licence_no` varchar(255) NOT NULL, `licence_expiry_date` varchar(255) NOT NULL, `driver_experience` varchar(255) NOT NULL, `phl_number` varchar(255) NOT NULL, `phl_image` varchar(255) DEFAULT NULL, `phl_expiry_date` varchar(255) NOT NULL, `national_insurance_no` varchar(255) NOT NULL, `passport_number` varchar(255) NOT NULL, `passport_image` varchar(255) NOT NULL, `short_name` varchar(20) DEFAULT NULL, `renewal_date` varchar(255) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `driver_details` -- INSERT INTO `driver_details` (`id`, `user_id`, `drivinglicence`, `licence_no`, `licence_expiry_date`, `driver_experience`, `phl_number`, `phl_image`, `phl_expiry_date`, `national_insurance_no`, `passport_number`, `passport_image`, `short_name`, `renewal_date`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, 3, '1537606027-5ba6018b8197f.png', 'L-NUMBER', '2018-09-27', '234', 'PHL NUMBER', '1537606398-5ba602fee6db7.jpg', '2018-09-22', 'Insurance-NUMBER', 'PASSPORT', '1537606943-5ba6051fa3059.jpg', '66', '2018-09-25', '2018-09-22 03:17:07', '2018-10-01 02:42:24', NULL), (2, 13, '1537861925-5ba9e925ac89a.png', '234', '2018-09-27', '12', '123', '1537861925-5ba9e925b3f09.jpg', '234', '234', '234', '1537861925-5ba9e925b45b7.png', 'BD', '2018-10-24', '2018-09-25 02:22:05', '2018-09-25 02:22:05', NULL); -- -------------------------------------------------------- -- -- Table structure for table `driving_request` -- CREATE TABLE `driving_request` ( `id` int(10) NOT NULL, `franchisees_id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `surname` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `dob` varchar(255) NOT NULL, `phone` varchar(255) NOT NULL, `street` varchar(255) NOT NULL, `locality` varchar(255) NOT NULL, `postcode` varchar(255) NOT NULL, `town` varchar(255) NOT NULL, `profile_pic` varchar(255) DEFAULT NULL, `phl_number` varchar(255) NOT NULL, `phl_image` varchar(255) DEFAULT NULL, `phl_expiry_date` varchar(255) NOT NULL, `national_insurance_no` varchar(255) NOT NULL, `status` int(10) DEFAULT '0', `drivinglicence` varchar(255) DEFAULT NULL, `licence_no` varchar(255) NOT NULL, `licence_expiry_date` varchar(255) NOT NULL, `driver_experience` varchar(255) NOT NULL, `passport_number` varchar(255) NOT NULL, `passport_image` varchar(255) DEFAULT NULL, `short_name` varchar(20) DEFAULT NULL, `renewal_date` varchar(255) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `driving_request` -- INSERT INTO `driving_request` (`id`, `franchisees_id`, `name`, `surname`, `email`, `dob`, `phone`, `street`, `locality`, `postcode`, `town`, `profile_pic`, `phl_number`, `phl_image`, `phl_expiry_date`, `national_insurance_no`, `status`, `drivinglicence`, `licence_no`, `licence_expiry_date`, `driver_experience`, `passport_number`, `passport_image`, `short_name`, `renewal_date`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, 1, 'Ubuer', 'dasdas', 'hasib2008@gmail.com', '2018-09-14', '789654123656', '234234', '24234', '234234', '234234', NULL, '32423', NULL, '234', '234', 0, NULL, '234234', '2018-09-20', '234', '234', NULL, 'Ud', '2018-10-03', '2018-09-22 07:50:12', '2018-09-22 07:50:12', NULL); -- -------------------------------------------------------- -- -- Table structure for table `email_template` -- CREATE TABLE `email_template` ( `id` int(11) NOT NULL, `franchisees_id` int(11) DEFAULT NULL, `title` varchar(255) NOT NULL, `subject` varchar(255) NOT NULL, `from_name` varchar(255) NOT NULL, `from_email` varchar(255) NOT NULL, `description` varchar(255) NOT NULL, `content` text NOT NULL, `status` tinyint(4) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `email_template` -- INSERT INTO `email_template` (`id`, `franchisees_id`, `title`, `subject`, `from_name`, `from_email`, `description`, `content`, `status`) VALUES (1, NULL, 'Contact Reply to user', 'Thank you for contacting us', 'Red Flag Data', 'info@redflagdata.com.au', 'Contact Us User mail', '<table cellpadding="0" cellspacing="0" style="width: 732px; margin: 0 auto; font-family: \'Montserrat\', sans-serif; max-width: 100%; background: #fff7f9;" width="732px"><!--*-->\r\n <thead>\r\n <tr>\r\n <td style="background: #fff; padding: 16px 0px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: middle; padding-left: 20px;"><a href="#" style="border: none; float: left; outline: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; border: none; outline: none;" /> </a></td>\r\n <td style="text-align: right; vertical-align:middle; padding-right: 20px;">Contact<a href="mailto:support@redflagdata.com.au" style="text-decoration: none; font-weight: 400; font-size: 12px; line-height: 1; color: #5b5a5a;">@redflagdata.com.au</a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </thead>\r\n <!--*--><!--*-->\r\n <tbody>\r\n <tr>\r\n <td style="background: #fff2f4; padding: 66px 0 65px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: top; width: 470px; padding-left: 70px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="font-size: 18px; line-height: 1; color: #000000; line-height: 1; text-transform: uppercase; padding-bottom: 17px;">Hello {{ $name}}</td>\r\n </tr>\r\n <tr>\r\n <td style="font-size: 14px; line-height: 22px; color: #000; font-weight: 400; padding: 20px 0 0;">\r\n <p>Thank you for contacting us&nbsp;</p>\r\n\r\n <p>We will reply to you question ASAP&nbsp;</p>\r\n\r\n <p>Kind Regards</p>\r\n\r\n <p>Red Flag Data</p>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n <td style="vertical-align: middle; padding-right: 70px;"><img alt="" src="https://redflagdata.com.au/photos/1/verify_icon.png" style="display: block; border: none; outline: none; float: right; width: 79px; height: 79px;" /></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n <!--*--><!--*-->\r\n <tfoot>\r\n <tr>\r\n <td style="padding: 35px 0 42px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="padding:0 70px;"><a href="#" style="float: left; outline: none;border: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; outline: none; border: none;" /> </a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tfoot>\r\n <!--*-->\r\n</table>', 1), (2, NULL, 'Contact us to admin', 'Some one contacting us in contact form', 'Red Flag Data', 'contact@redflagdata.com.au', 'Contact Us User mail', '<table cellpadding="0" cellspacing="0" style="width: 732px; margin: 0 auto; font-family: \'Montserrat\', sans-serif; max-width: 100%; background: #fff7f9;" width="732px"><!--*-->\r\n <thead>\r\n <tr>\r\n <td style="background: #fff; padding: 16px 0px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: middle; padding-left: 20px;"><a href="#" style="border: none; float: left; outline: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; border: none; outline: none;" /> </a></td>\r\n <td style="text-align: right; vertical-align:middle; padding-right: 20px;">Contact<a href="mailto:support@redflagdata.com.au" style="text-decoration: none; font-weight: 400; font-size: 12px; line-height: 1; color: #5b5a5a;">@redflagdata.com.au</a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </thead>\r\n <!--*--><!--*-->\r\n <tbody>\r\n <tr>\r\n <td style="background: #fff2f4; padding: 56px 0 52px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: top; width: 470px; padding-left: 70px; padding-right: 70px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="font-size: 18px; line-height: 1; color: #000000; line-height: 1; text-transform: uppercase; padding-bottom: 17px;">Red Flag Data Contact Form</td>\r\n </tr>\r\n <tr>\r\n <td style="padding: 20px 0px 0px;">\r\n <table cellpadding="0" cellspacing="0" style="text-align: left; width: auto;" width="">\r\n <tbody>\r\n <tr>\r\n <td>\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="font-size: 14px; line-height: 1; color: #000; text-transform: capitalize; padding-bottom: 20px;">Contact Form</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style="padding-bottom: 22px;">\r\n <table cellpadding="0" cellspacing="0" style="height: 3px;" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="width: 46px; vertical-align: middle; height: 3px; font-size: 0;line-height: 0;"><img src="https://redflagdata.com.au/photos/1/colorline.png" style="border: none; outline: none; width: 100%; height: 3px;" /></td>\r\n <td style="vertical-align: middle; height: 3px; font-size: 0;line-height: 0;"><img src="https://redflagdata.com.au/photos/1/line.png" style="border: none; outline: none; width: 100%; height: 1px;" /></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style="font-size: 12px; line-height: 1; color: #000;">\r\n <table cellpadding="0" cellspacing="0" style="height: 3px;" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="width:194px; padding-bottom:17px; vertical-align:middle;">NAME:</td>\r\n <td style="padding-bottom:17px; vertical-align:middle;">{{ @$name }}</td>\r\n </tr>\r\n <tr>\r\n <td style="width:194px; padding-bottom:17px; vertical-align:middle;">&nbsp;EMAIL:</td>\r\n <td style="padding-bottom:17px; vertical-align:middle;">{{ @$email }}</td>\r\n </tr>\r\n <tr>\r\n <td style="width:194px; padding-bottom:17px; vertical-align:middle;">SUBJECT:</td>\r\n <td style="padding-bottom:17px; vertical-align:middle;">{{ @$subject }}</td>\r\n </tr>\r\n <tr>\r\n <td style="width:194px; padding-bottom:17px; vertical-align:middle;">YOUR MESSAGE:</td>\r\n <td style="padding-bottom:17px; vertical-align:middle; line-height: 1.4">{{ @$message }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n <!--*--><!--*-->\r\n <tfoot>\r\n <tr>\r\n <td style="padding: 35px 0 42px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="padding:0 70px;"><a href="#" style="float: left; outline: none;border: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; outline: none; border: none;" /> </a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tfoot>\r\n <!--*-->\r\n</table>', 1), (3, NULL, 'Add To Red Flaged', 'Alert a new guardian Red Flagged in your area', 'Red Flag Data', 'contact@redflagdata.com.au', 'Contact Us User mail', '<table cellpadding="0" cellspacing="0" style="width: 732px; margin: 0 auto; font-family: \'Montserrat\', sans-serif; max-width: 100%; background: #fff7f9;" width="732px"><!--*-->\r\n <thead>\r\n <tr>\r\n <td style="background: #fff; padding: 16px 0px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: middle; padding-left: 20px;"><a href="#" style="border: none; float: left; outline: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; border: none; outline: none; width: 108px; height: 109px;" /> </a></td>\r\n <td style="text-align: right; vertical-align:middle; padding-right: 20px;">Contact<a href="mailto:support@redflagdata.com.au" style="text-decoration: none; font-weight: 400; font-size: 12px; line-height: 1; color: #5b5a5a;">@redflagdata.com.au</a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </thead>\r\n <!--*--><!--*-->\r\n <tbody>\r\n <tr>\r\n <td style="background: #fff2f4; padding: 66px 0 65px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: top; width: 470px; padding-left: 70px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="font-size: 18px; line-height: 1; color: #000000; line-height: 1; text-transform: uppercase; padding-bottom: 17px;">Hello {{ $name}}</td>\r\n </tr>\r\n <tr>\r\n <td style="font-size: 14px; line-height: 22px; color: #000; font-weight: 400; padding: 20px 0 0;">A new guardian has been Red Flagged in your area&nbsp;</td>\r\n </tr>\r\n <tr>\r\n <td style="font-size: 12px; color: #5d595d; line-height: 1; text-align: center; padding-bottom: 39px;">\r\n <p>&nbsp;</p>\r\n\r\n <p>Please Click&nbsp;<a href="{{ @$profileLink }}" style="text-decoration: underline; outline: none; color: #e21a35;">here</a>&nbsp;to view.</p>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n <td style="vertical-align: middle; padding-right: 70px;"><img alt="" src="images/verify_icon.png" style="display: block; border: none; outline: none; float: right;" /></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n <!--*--><!--*-->\r\n <tfoot>\r\n <tr>\r\n <td style="padding: 35px 0 42px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="padding:0 70px;"><a href="#" style="float: left; outline: none;border: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; outline: none; border: none; width: 108px; height: 109px;" /> </a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tfoot>\r\n <!--*-->\r\n</table>', 1), (4, NULL, 'Trial End', 'Your trial period has ended', 'Red Flag Data', 'contact@redflagdata.com.au', 'Contact Us User mail', '<table cellpadding="0" cellspacing="0" style="width:732px"><!--*-->\r\n <thead>\r\n <tr>\r\n <td style="background-color:#ffffff">\r\n <table cellpadding="0" cellspacing="0" style="width:100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align:middle"><a href="#"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" /> </a></td>\r\n <td style="text-align:right; vertical-align:middle"><a href="mailto:contact@redflagdata.com.au">contact@redflagdata.com.au</a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </thead>\r\n <!--*--><!--*-->\r\n <tbody>\r\n <tr>\r\n <td style="background-color:#fff2f4">\r\n <table cellpadding="0" cellspacing="0" style="width:100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align:top; width:470px">\r\n <table cellpadding="0" cellspacing="0" style="width:100%">\r\n <tbody>\r\n <tr>\r\n <td>Hi, {{ $name}}</td>\r\n </tr>\r\n <tr>\r\n <td>\r\n <table>\r\n <tbody>\r\n <tr>\r\n <td>Trial End date</td>\r\n <td>{{ $endDate }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n\r\n <p>&nbsp;The credit/debit card that you entered upon sign up will now be charged for the amount of $88.00 Including GST .&nbsp;</p>\r\n\r\n <p>Thankyou for you business .</p>\r\n\r\n <p>Kind Regards</p>\r\n\r\n <p>Red Flag Data&nbsp;</p>\r\n </td>\r\n <td style="vertical-align:middle"><img alt="" src="http://localhost/redflag/photos/1/verify_icon.png" style="float:right; height:79px; width:79px" /></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n <!--*--><!--*-->\r\n <tfoot>\r\n <tr>\r\n <td>\r\n <table cellpadding="0" cellspacing="0" style="width:100%">\r\n <tbody>\r\n <tr>\r\n <td><a href="#"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" /> </a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tfoot>\r\n <!--*-->\r\n</table>', 1), (5, NULL, 'Next Billing', 'Next Billing', 'Red Flag Data', 'contact@redflagdata.com.au', 'Available Variable\r\nname, amount, next_payment_attempt, period_range', '<table cellpadding="0" cellspacing="0" style="width: 732px; margin: 0 auto; font-family: \'Montserrat\', sans-serif; max-width: 100%; background: #fff7f9;" width="732px"><!--*-->\r\n <thead>\r\n <tr>\r\n <td style="background: #fff; padding: 16px 0px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: middle; padding-left: 20px;"><a href="#" style="border: none; float: left; outline: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; border: none; outline: none;" /> </a></td>\r\n <td style="text-align: right; vertical-align:middle; padding-right: 20px;"><a href="mailto:support@redflagdata.com.au" style="text-decoration: none; font-weight: 400; font-size: 12px; line-height: 1; color: #5b5a5a;">support@redflagdata.com.au</a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </thead>\r\n <!--*--><!--*-->\r\n <tbody>\r\n <tr>\r\n <td style="background: #fff2f4; padding: 56px 0 52px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: top; width: 470px; padding-left: 70px; padding-right: 70px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="font-size: 18px; line-height: 1; color: #000000; line-height: 1; padding-bottom: 17px;">Hello {{ @$name }}</td>\r\n </tr>\r\n <tr>\r\n <td style="padding: 20px 0px 0px;">\r\n <table cellpadding="0" cellspacing="0" style="text-align: left; width: auto;" width="">\r\n <tbody>\r\n <tr>\r\n <td>&nbsp;</td>\r\n </tr>\r\n <tr>\r\n <td style="padding-bottom: 22px;">\r\n <table cellpadding="0" cellspacing="0" style="height: 3px;" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="width: 46px; vertical-align: middle; height: 3px; font-size: 0;line-height: 0;"><img src="https://redflagdata.com.au/photos/1/colorline.png" style="border: none; outline: none; width: 100%; height: 3px;" /></td>\r\n <td style="vertical-align: middle; height: 3px; font-size: 0;line-height: 0;"><img src="https://redflagdata.com.au/photos/1/line.png" style="border: none; outline: none; width: 100%; height: 1px;" /></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style="font-size: 12px; line-height: 1; color: #000;">\r\n <table cellpadding="0" cellspacing="0" style="height: 3px;" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="width:194px; padding-bottom:17px; vertical-align:middle;">Amount</td>\r\n <td style="padding-bottom:17px; vertical-align:middle;">{{ @$amount }}</td>\r\n </tr>\r\n <tr>\r\n <td style="width:194px; padding-bottom:17px; vertical-align:middle;">&nbsp;Next Payment Attempt On:</td>\r\n <td style="padding-bottom:17px; vertical-align:middle;">{{ @$next_payment_attempt }}</td>\r\n </tr>\r\n <tr>\r\n <td style="width:194px; padding-bottom:17px; vertical-align:middle;">For Period</td>\r\n <td style="padding-bottom:17px; vertical-align:middle;">{{ @$period_range }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n\r\n <p>Kind regards</p>\r\n\r\n <p>Red Flag data&nbsp;</p>\r\n\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n <!--*--><!--*-->\r\n <tfoot>\r\n <tr>\r\n <td style="padding: 35px 0 42px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="padding:0 70px;"><a href="#" style="float: left; outline: none;border: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; outline: none; border: none;" /> </a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tfoot>\r\n <!--*-->\r\n</table>', 1), (6, NULL, 'Payment Sucess', 'Payment', 'Red Flag Data', 'contact@redflagdata.com.au', 'Available Variable\r\nname, \r\namount,\r\nperiod_range,', '<table cellpadding="0" cellspacing="0" style="width: 732px; margin: 0 auto; font-family: \'Montserrat\', sans-serif; max-width: 100%; background: #fff7f9;" width="732px"><!--*-->\r\n <thead>\r\n <tr>\r\n <td style="background: #fff; padding: 16px 0px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: middle; padding-left: 20px;"><a href="#" style="border: none; float: left; outline: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; border: none; outline: none;" /> </a></td>\r\n <td style="text-align: right; vertical-align:middle; padding-right: 20px;"><a href="mailto:support@redflagdata.com.au" style="text-decoration: none; font-weight: 400; font-size: 12px; line-height: 1; color: #5b5a5a;">support@redflagdata.com.au</a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </thead>\r\n <!--*--><!--*-->\r\n <tbody>\r\n <tr>\r\n <td style="background: #fff2f4; padding: 56px 0 52px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: top; width: 470px; padding-left: 70px; padding-right: 70px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="font-size: 18px; line-height: 1; color: #000000; line-height: 1; padding-bottom: 17px;">Hi {{ @$name }}</td>\r\n </tr>\r\n <tr>\r\n <td style="padding: 20px 0px 0px;">\r\n <table cellpadding="0" cellspacing="0" style="text-align: left; width: auto;" width="">\r\n <tbody>\r\n <tr>\r\n <td>&nbsp;</td>\r\n </tr>\r\n <tr>\r\n <td style="padding-bottom: 22px;">\r\n <table cellpadding="0" cellspacing="0" style="height: 3px;" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="width: 46px; vertical-align: middle; height: 3px; font-size: 0;line-height: 0;"><img src="https://redflagdata.com.au/photos/1/colorline.png" style="border: none; outline: none; width: 100%; height: 3px;" /></td>\r\n <td style="vertical-align: middle; height: 3px; font-size: 0;line-height: 0;"><img src="https://redflagdata.com.au/photos/1/line.png" style="border: none; outline: none; width: 100%; height: 1px;" /></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style="font-size: 12px; line-height: 1; color: #000;">\r\n <table cellpadding="0" cellspacing="0" style="height: 3px;" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="width:194px; padding-bottom:17px; vertical-align:middle;">Amount</td>\r\n <td style="padding-bottom:17px; vertical-align:middle;">{{ @$amount }}</td>\r\n </tr>\r\n <tr>\r\n <td style="width:194px; padding-bottom:17px; vertical-align:middle;">&nbsp;Date:</td>\r\n <td style="padding-bottom:17px; vertical-align:middle;">{{ @$period_range }}</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n <!--*--><!--*-->\r\n <tfoot>\r\n <tr>\r\n <td style="padding: 35px 0 42px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="padding:0 70px;"><a href="#" style="float: left; outline: none;border: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; outline: none; border: none;" /> </a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tfoot>\r\n <!--*-->\r\n</table>', 1), (7, NULL, 'Signup Sucess', 'Signup', 'Red Flag Data', 'contact@redflagdata.com.au', 'Signup', '<meta charset="UTF-8"><meta name="viewport" content="width=device-width"><meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=1">\r\n<title></title>\r\n<style type="text/css">*{\r\n margin: 0;\r\n padding: 0;\r\n }\r\n</style>\r\n<table cellpadding="0" cellspacing="0" style="width: 732px; margin: 0 auto; font-family: \'Montserrat\', sans-serif; max-width: 100%; background: #fff7f9;" width="732px"><!--*-->\r\n <thead>\r\n <tr>\r\n <td style="background: #fff; padding: 16px 0px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: middle; padding-left: 20px;"><a href="#" style="border: none; float: left; outline: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; border: none; outline: none;" /> </a></td>\r\n <td style="text-align: right; vertical-align:middle; padding-right: 20px;"><a href="mailto:support@redflagdata.com.au" style="text-decoration: none; font-weight: 400; font-size: 12px; line-height: 1; color: #5b5a5a;">support@redflagdata.com.au</a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </thead>\r\n <!--*--><!--*-->\r\n <tbody>\r\n <tr>\r\n <td style="background: #fff2f4; padding: 66px 0 65px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: top; width: 470px; padding-left: 70px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="font-size: 18px; line-height: 1; color: #000000; line-height: 1; text-transform: uppercase; padding-bottom: 17px;">Hi {{ @$name }}</td>\r\n </tr>\r\n <tr>\r\n <td style="font-size: 14px; line-height: 22px; color: #000; font-weight: 400; padding: 20px 0 0;">\r\n <p>Welcome to<a href="https://redflagdata.com.au/"> Red Flad Data&nbsp;</a></p>\r\n\r\n <p>Please<a href="https://redflagdata.com.au/login"> Log in</a> to start enjoying the feature of our service now.&nbsp;</p>\r\n\r\n <p>&nbsp;</p>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n <td style="vertical-align: middle; padding-right: 70px;"><img alt="" src="https://redflagdata.com.au/photos/1/verify_icon.png" style="display: block; border: none; outline: none; float: right; width: 79px; height: 79px;" /></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n <!--*--><!--*-->\r\n <tfoot>\r\n <tr>\r\n <td style="padding: 35px 0 42px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="padding:0 70px;"><a href="#" style="float: left; outline: none;border: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; outline: none; border: none;" /> </a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tfoot>\r\n <!--*-->\r\n</table>', 1), (8, NULL, 'A Childcare service has Red Flagged you', 'You have been red flagged', 'Red Flag Data', 'Contact@redflagdata.com.au', 'Signup', '<meta charset="UTF-8"><meta name="viewport" content="width=device-width"><meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=1">\r\n<title></title>\r\n<style type="text/css">*{\r\n margin: 0;\r\n padding: 0;\r\n }\r\n</style>\r\n<table cellpadding="0" cellspacing="0" style="width: 732px; margin: 0 auto; font-family: \'Montserrat\', sans-serif; max-width: 100%; background: #fff7f9;" width="732px"><!--*-->\r\n <thead>\r\n <tr>\r\n <td style="background: #fff; padding: 16px 0px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: middle; padding-left: 20px;"><a href="https://redflagdata.com.au/pre-register" style="border: none; float: left; outline: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; border: none; outline: none; width: 108px; height: 109px;" /> </a></td>\r\n <td style="text-align: right; vertical-align:middle; padding-right: 20px;">contact<a href="mailto:support@redflagdata.com.au" style="text-decoration: none; font-weight: 400; font-size: 12px; line-height: 1; color: #5b5a5a;">@redflagdata.com.au</a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </thead>\r\n <!--*--><!--*-->\r\n <tbody>\r\n <tr>\r\n <td style="background: #fff2f4; padding: 66px 0 65px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: top; padding-left: 20px; padding-right:20px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="font-size: 18px; line-height: 1; color: #000000; line-height: 1; text-transform: uppercase; padding-bottom: 17px;">To {{ @$name }}</td>\r\n </tr>\r\n <tr>\r\n <td style="font-size: 14px; line-height: 22px; color: #000; font-weight: 400; padding: 20px 0 0;">\r\n <p style="margin-bottom:.0001pt; text-align:justify; margin:0cm 0cm 8pt"><span style="font-size:11pt"><span style="line-height:normal"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="color:#222222">You have been placed on the childcare debt register (childcare blacklist) your Name, DOB and the amount you owe has been entered on to the national database <a href="https://redflagdata.com.au/pre-register">Red Flag Data&nbsp;</a></span></span></span></span></span></p>\r\n\r\n <p style="margin-bottom:.0001pt; text-align:justify; margin:0cm 0cm 8pt">&nbsp;</p>\r\n\r\n <p style="margin-bottom:.0001pt; text-align:justify; margin:0cm 0cm 8pt"><span style="font-size:11pt"><span style="line-height:normal"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="color:#222222">All childcare Service Providers&nbsp;have access to this register, this may result in you being blacklisted from receiving further childcare services until all outstanding fees have been paid. At any time you may be removed from the register by paying the outstanding amount. </span></span></span></span></span></p>\r\n\r\n <p style="margin-bottom:.0001pt; text-align:justify; margin:0cm 0cm 8pt">&nbsp;</p>\r\n\r\n <p style="margin-bottom:.0001pt; text-align:justify; margin:0cm 0cm 8pt"><span style="font-size:11pt"><span style="line-height:normal"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="color:#222222">If know which child care service has place you on this database please contact the service to pay any outstanding amounts owing to have your name removed from the database .</span></span></span></span></span></p>\r\n\r\n <p style="margin-bottom:.0001pt; text-align:justify; margin:0cm 0cm 8pt">&nbsp;</p>\r\n\r\n <p style="margin-bottom:.0001pt; text-align:justify; margin:0cm 0cm 8pt"><span style="font-size:11pt"><span style="line-height:normal"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="color:#222222">If you do not know which service placed you on this database you create and account at<a href="https://redflagdata.com.au/pre-register"> Red Flag Data</a></span></span><span style="font-size:12.0pt"><span style="color:#222222">&nbsp;to find the name and contact details of the service you have an outstanding debt with. </span></span></span></span></span></p>\r\n\r\n <p style="margin-bottom:.0001pt; text-align:justify; margin:0cm 0cm 8pt">&nbsp;</p>\r\n\r\n <p style="margin-bottom:.0001pt; text-align:justify; margin:0cm 0cm 8pt"><span style="font-size:11pt"><span style="line-height:normal"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="color:#222222">No information from the register will be shared or sold or to any other agencies or third parties.</span></span></span></span></span></p>\r\n\r\n <p style="margin-bottom:.0001pt; text-align:justify; margin:0cm 0cm 8pt">&nbsp;</p>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n <!--*--><!--*-->\r\n <tfoot>\r\n <tr>\r\n <td style="padding: 35px 0 42px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="padding:0 70px;"><a href="https://redflagdata.com.au/pre-register" style="float: left; outline: none;border: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; outline: none; border: none; width: 108px; height: 109px;" /> </a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tfoot>\r\n <!--*-->\r\n</table>', 1), (9, NULL, 'Business User Signup Sucess', 'Signup', 'Red Flag Data', 'contact@redflagdata.com.au', 'Signup', '<meta charset="UTF-8"><meta name="viewport" content="width=device-width"><meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=1">\r\n<title></title>\r\n<style type="text/css">*{\r\n margin: 0;\r\n padding: 0;\r\n }\r\n</style>\r\n<table cellpadding="0" cellspacing="0" style="width: 732px; margin: 0 auto; font-family: \'Montserrat\', sans-serif; max-width: 100%; background: #fff7f9;" width="732px"><!--*-->\r\n <thead>\r\n <tr>\r\n <td style="background: #fff; padding: 16px 0px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: middle; padding-left: 20px;"><a href="https://redflagdata.com.au/" style="border: none; float: left; outline: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; border: none; outline: none;" /> </a></td>\r\n <td style="text-align: right; vertical-align:middle; padding-right: 20px;">Contact<a href="mailto:support@redflagdata.com.au" style="text-decoration: none; font-weight: 400; font-size: 12px; line-height: 1; color: #5b5a5a;">@redflagdata.com.au</a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </thead>\r\n <!--*--><!--*-->\r\n <tbody>\r\n <tr>\r\n <td style="background: #fff2f4; padding: 66px 0 65px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: top; width: 470px; padding-left: 70px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="font-size: 18px; line-height: 1; color: #000000; line-height: 1; text-transform: uppercase; padding-bottom: 17px;">Hi {{ @$name }}</td>\r\n </tr>\r\n <tr>\r\n <td style="font-size: 14px; line-height: 22px; color: #000; font-weight: 400; padding: 20px 0 0;">\r\n <p>Welcome to <a href="https://redflagdata.com.au/">Red Flag Data&nbsp;</a></p>\r\n\r\n <p>Please <a href="https://redflagdata.com.au/login">Log in</a> to start enjoying the features of our service now .&nbsp;</p>\r\n\r\n <p>&nbsp;</p>\r\n\r\n <p>Please download our <a href="http://redflagdata.com.au/files/1/generic-outstanding-fee-policy.docx">Outstanding Fee&nbsp;Policy,</a> edit and have signed by guardians before entering them on&nbsp;to the database .</p>\r\n\r\n <p>&nbsp;</p>\r\n\r\n <p>&nbsp;</p>\r\n\r\n <p>&nbsp;</p>\r\n\r\n <p>&nbsp;</p>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n <td style="vertical-align: middle; padding-right: 70px;"><img alt="" src="https://redflagdata.com.au/photos/1/verify_icon.png" style="display: block; border: none; outline: none; float: right; width: 79px; height: 79px;" /></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n <!--*--><!--*-->\r\n <tfoot>\r\n <tr>\r\n <td style="padding: 35px 0 42px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="padding:0 70px;"><a href="https://redflagdata.com.au/" style="float: left; outline: none;border: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; outline: none; border: none;" /> </a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tfoot>\r\n <!--*-->\r\n</table>', 1), (10, NULL, 'Remove Guardians From Red Flag', 'Your red flag has been removed', 'Red Flag Data', 'contact@redflagdata.com.au', 'Available Variable\r\n\r\nname\' , \'company_name\'', '<meta charset="UTF-8"><meta name="viewport" content="width=device-width"><meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=1">\r\n<title></title>\r\n<style type="text/css">*{\r\n margin: 0;\r\n padding: 0;\r\n }\r\n</style>\r\n<table cellpadding="0" cellspacing="0" style="width: 732px; margin: 0 auto; font-family: \'Montserrat\', sans-serif; max-width: 100%; background: #fff7f9;" width="732px"><!--*-->\r\n <thead>\r\n <tr>\r\n <td style="background: #fff; padding: 16px 0px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: middle; padding-left: 20px;"><a href="https://redflagdata.com.au/" style="border: none; float: left; outline: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; border: none; outline: none;" /> </a></td>\r\n <td style="text-align: right; vertical-align:middle; padding-right: 20px;"><a href="mailto:support@redflagdata.com.au" style="text-decoration: none; font-weight: 400; font-size: 12px; line-height: 1; color: #5b5a5a;">support@redflagdata.com.au</a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </thead>\r\n <!--*--><!--*-->\r\n <tbody>\r\n <tr>\r\n <td style="background: #fff2f4; padding: 66px 0 65px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: top; width: 470px; padding-left: 70px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="font-size: 18px; line-height: 1; color: #000000; line-height: 1; text-transform: uppercase; padding-bottom: 17px;">Hi {{ @$name }}</td>\r\n </tr>\r\n <tr>\r\n <td style="font-size: 14px; line-height: 22px; color: #000; font-weight: 400; padding: 20px 0 0;">\r\n <p>Your details have been removed from red flag data.</p>\r\n\r\n <p>&nbsp;</p>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n <td style="vertical-align: middle; padding-right: 70px;"><img alt="" src="https://redflagdata.com.au/photos/1/verify_icon.png" style="display: block; border: none; outline: none; float: right; width: 79px; height: 79px;" /></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n <!--*--><!--*-->\r\n <tfoot>\r\n <tr>\r\n <td style="padding: 35px 0 42px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="padding:0 70px;"><a href="https://redflagdata.com.au/" style="float: left; outline: none;border: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; outline: none; border: none;" /> </a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tfoot>\r\n <!--*-->\r\n</table>', 1), (11, NULL, 'Your have successfully cancelled you membership', 'Your have successfully cancelled you membership', 'Red Flag Data', 'contact@redflagdata.com.au', 'name', '<meta charset="UTF-8"><meta name="viewport" content="width=device-width"><meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=1">\r\n<title></title>\r\n<style type="text/css">*{\r\n margin: 0;\r\n padding: 0;\r\n }\r\n</style>\r\n<table cellpadding="0" cellspacing="0" style="width: 732px; margin: 0 auto; font-family: \'Montserrat\', sans-serif; max-width: 100%; background: #fff7f9;" width="732px"><!--*-->\r\n <thead>\r\n <tr>\r\n <td style="background: #fff; padding: 16px 0px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: middle; padding-left: 20px;"><a href="https://redflagdata.com.au/" style="border: none; float: left; outline: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; border: none; outline: none;" /> </a></td>\r\n <td style="text-align: right; vertical-align:middle; padding-right: 20px;">Contact<a href="mailto:support@redflagdata.com.au" style="text-decoration: none; font-weight: 400; font-size: 12px; line-height: 1; color: #5b5a5a;">@redflagdata.com.au</a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </thead>\r\n <!--*--><!--*-->\r\n <tbody>\r\n <tr>\r\n <td style="background: #fff2f4; padding: 66px 0 65px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: top; width: 470px; padding-left: 70px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="font-size: 18px; line-height: 1; color: #000000; line-height: 1; text-transform: uppercase; padding-bottom: 17px;">Hi {{ @$name }}</td>\r\n </tr>\r\n <tr>\r\n <td style="font-size: 14px; line-height: 22px; color: #000; font-weight: 400; padding: 20px 0 0;">\r\n <p>Your have successfully cancelled you membership</p>\r\n\r\n <p>&nbsp;</p>\r\n\r\n <p>&nbsp;</p>\r\n\r\n <p>&nbsp;</p>\r\n\r\n <p>&nbsp;</p>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n <td style="vertical-align: middle; padding-right: 70px;"><img alt="" src="https://redflagdata.com.au/photos/1/verify_icon.png" style="display: block; border: none; outline: none; float: right; width: 79px; height: 79px;" /></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n <!--*--><!--*-->\r\n <tfoot>\r\n <tr>\r\n <td style="padding: 35px 0 42px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="padding:0 70px;"><a href="https://redflagdata.com.au/" style="float: left; outline: none;border: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; outline: none; border: none;" /> </a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tfoot>\r\n <!--*-->\r\n</table>', 1), (12, NULL, 'verify email', 'verify email', 'Red Flag Data', 'contact@redflagdata.com.au', 'name\r\nurl', '<meta charset="UTF-8"><meta name="viewport" content="width=device-width"><meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=1">\r\n<title></title>\r\n<style type="text/css">*{\r\n margin: 0;\r\n padding: 0;\r\n }\r\n</style>\r\n<table cellpadding="0" cellspacing="0" style="width: 732px; margin: 0 auto; font-family: \'Montserrat\', sans-serif; max-width: 100%; background: #fff7f9;" width="732px"><!--*-->\r\n <thead>\r\n <tr>\r\n <td style="background: #fff; padding: 16px 0px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: middle; padding-left: 20px;"><a href="https://redflagdata.com.au/" style="border: none; float: left; outline: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; border: none; outline: none;" /> </a></td>\r\n <td style="text-align: right; vertical-align:middle; padding-right: 20px;">Contact<a href="mailto:support@redflagdata.com.au" style="text-decoration: none; font-weight: 400; font-size: 12px; line-height: 1; color: #5b5a5a;">@redflagdata.com.au</a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </thead>\r\n <!--*--><!--*-->\r\n <tbody>\r\n <tr>\r\n <td style="background: #fff2f4; padding: 66px 0 65px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="vertical-align: top; width: 470px; padding-left: 70px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="font-size: 18px; line-height: 1; color: #000000; line-height: 1; text-transform: uppercase; padding-bottom: 17px;">Hi {{ @$name }}</td>\r\n </tr>\r\n <tr>\r\n <td style="font-size: 14px; line-height: 22px; color: #000; font-weight: 400; padding: 20px 0 0;">\r\n <p>Please <a href="{{ $url }}">Click Here</a> to active your account.</p>\r\n\r\n <p>&nbsp;</p>\r\n\r\n <p>&nbsp;</p>\r\n\r\n <p>&nbsp;</p>\r\n\r\n <p>&nbsp;</p>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n <td style="vertical-align: middle; padding-right: 70px;"><img alt="" src="https://redflagdata.com.au/photos/1/verify_icon.png" style="display: block; border: none; outline: none; float: right; width: 79px; height: 79px;" /></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n <!--*--><!--*-->\r\n <tfoot>\r\n <tr>\r\n <td style="padding: 35px 0 42px;">\r\n <table cellpadding="0" cellspacing="0" width="100%">\r\n <tbody>\r\n <tr>\r\n <td style="padding:0 70px;"><a href="https://redflagdata.com.au/" style="float: left; outline: none;border: none;"><img alt="" src="https://redflagdata.com.au/photos/1/logo.png" style="display: block; outline: none; border: none;" /> </a></td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tfoot>\r\n <!--*-->\r\n</table>', 1); -- -------------------------------------------------------- -- -- Table structure for table `faqs` -- CREATE TABLE `faqs` ( `id` int(11) NOT NULL, `question` text NOT NULL, `answer` text NOT NULL, `status` int(11) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `franchisees` -- CREATE TABLE `franchisees` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `contact_person_name` varchar(255) NOT NULL, `contact_person_phone` varchar(100) NOT NULL, `contact_person_email` varchar(255) NOT NULL, `status` tinyint(4) NOT NULL, `street` varchar(255) NOT NULL, `locality` varchar(100) NOT NULL, `town` varchar(100) NOT NULL, `postcode` varchar(10) NOT NULL, `public_liability_insurance` date DEFAULT NULL, `employers_liability_insurance` date DEFAULT NULL, `franchise_license_renewal_date` date DEFAULT NULL, `company_year_end` date DEFAULT NULL, `confirmation_statement_date` date DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `franchisees` -- INSERT INTO `franchisees` (`id`, `name`, `contact_person_name`, `contact_person_phone`, `contact_person_email`, `status`, `street`, `locality`, `town`, `postcode`, `public_liability_insurance`, `employers_liability_insurance`, `franchise_license_renewal_date`, `company_year_end`, `confirmation_statement_date`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, 'UBER', 'Hasibur Rahaman', '7059114888', 'hasib2008@gmail.com', 1, 'Garia Station road', 'Garia', 'Kolkata', '700084', '2018-08-30', '2018-09-27', '2018-09-29', '2018-09-28', '2018-09-29', '2018-09-22 01:55:05', '2018-09-24 07:38:55', NULL), (5, 'Hasi', 'Hasi', '7896541236', 'asdasd@gmail.com', 1, 'asasda', 'asda', 'asdas', 'dasdasd', '2018-09-28', '2018-09-22', '2018-09-21', '2018-09-29', '2018-09-28', '2018-09-28 01:22:52', '2018-09-28 02:07:46', '2018-09-28 02:07:46'), (6, 'asdasd', 'asdasd', '7896541236', 'dfgdf@gmail.coom', 1, 'asdasd', 'sdfsdf', 'sd', 'gdfg', '2018-10-04', '2018-10-05', '2018-09-28', '2018-09-28', '2018-09-29', '2018-09-28 01:23:34', '2018-09-28 02:07:41', '2018-09-28 02:07:41'); -- -------------------------------------------------------- -- -- Table structure for table `franchisees_price` -- CREATE TABLE `franchisees_price` ( `id` int(10) NOT NULL, `franchisees_id` int(20) NOT NULL, `driver_cost` float NOT NULL, `vehicle_cost` float NOT NULL, `comfort_cost` float NOT NULL, `paid_mileage` float NOT NULL, `base_driving_cost` float NOT NULL, `waiting_time_cost` float NOT NULL, `companionship_cost` float NOT NULL, `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `franchisees_price` -- INSERT INTO `franchisees_price` (`id`, `franchisees_id`, `driver_cost`, `vehicle_cost`, `comfort_cost`, `paid_mileage`, `base_driving_cost`, `waiting_time_cost`, `companionship_cost`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, 1, 5, 5, 10, 5, 5, 5, 5, '2018-09-22 07:25:05', '2018-09-28 01:13:49', NULL), (2, 5, 123, 12312, 123, 123, 123, 123, 123, '2018-09-28 01:22:52', '2018-09-28 01:22:52', NULL), (3, 6, 1, 2, 7, 3, 4, 5, 6, '2018-09-28 01:23:34', '2018-09-28 01:23:34', NULL); -- -------------------------------------------------------- -- -- Table structure for table `general_setting` -- CREATE TABLE `general_setting` ( `id` int(11) NOT NULL, `veriable_slug` varchar(100) NOT NULL, `setting_name` varchar(255) NOT NULL, `setting_value` text NOT NULL, `alt_text` varchar(255) DEFAULT NULL, `field_type` int(11) DEFAULT '1' COMMENT '1=>Textarea,2=>image' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `general_setting` -- INSERT INTO `general_setting` (`id`, `veriable_slug`, `setting_name`, `setting_value`, `alt_text`, `field_type`) VALUES (1, 'site_name', 'Site Name', 'Driving Miss Daisy', NULL, 1), (2, 'tagline', 'Site Tagline', '#', NULL, 1), (3, 'home_logo', 'Home Page Logo', 'http://192.168.1.39/redflag/photos/1/logo.png', 'Home Page Logo', 2), (4, 'footer_logo', 'Footer Logo', 'http://192.168.1.39/redflag/photos/1/logo.png', NULL, 2), (5, 'footer_text', 'Footer Text', 'Red Flag Data provides access to a safe, secure national database for childcare providers, OOSH Co-ordinators', NULL, 1), (6, 'contact_email', 'Contact Email', 'contact@redflagdata.com.au', NULL, 1), (7, 'contact_phone', 'Contact Phone', '7059114888', NULL, 1), (8, 'contact_address', 'Adress', 'Address', NULL, 1), (9, 'fb_link', 'Facebook', 'http://facebook.com', NULL, 1), (10, 'twitter_link', 'Twitter Link', 'https://twitter.com/', NULL, 1), (11, 'gplus_link', 'Google Link', 'https://plus.google.com/discover', NULL, 1), (12, 'youtube_link', 'Youtube Link', 'http://localhost/redflag/admin/general-setting/12/edit', NULL, 1), (13, 'footer_text_signup', 'Youtube Link', 'Thank you for signing up', NULL, 1), (14, 'remove_flag_warning_message', 'Remove Flag Warning message ', ' only tick this box in extreme cases the guardian has paid but you still want to show in search result , for reason such as,Abusive to staff or you were forced to take legal action against them.', NULL, 1), (15, 'outstanding_fee_policy', 'outstanding fee policy"', 'http://192.168.1.39/redflag/files/1/Outstanding-fee-policy.docx', NULL, 3), (16, 'working_hours', 'workin_hours', 'Monday to Friday 9am to 5pm', NULL, 3), (17, 'instagram_link', 'instagram', 'https://www.instagram.com/redflagdata.com.au/', NULL, 1), (18, 'linkedin_link', 'linkedin', 'https://www.linkedin.com/company/redflagdata-com-au/', NULL, 1); -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `migrations` -- INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1, '2014_10_12_000000_create_users_table', 1), (2, '2014_10_12_100000_create_password_resets_table', 1), (3, '2018_02_19_085638_entrust_setup_tables', 2), (4, '2018_02_20_082558_user_subscription', 3), (5, '2018_02_20_083016_subscription', 4), (6, '2018_02_26_095611_create_jobs_table', 5), (7, '2018_02_27_053619_add_renews_at_column_to_subscriptions', 5); -- -------------------------------------------------------- -- -- Table structure for table `password_resets` -- CREATE TABLE `password_resets` ( `email` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `permissions` -- CREATE TABLE `permissions` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL, `display_name` varchar(190) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `description` varchar(190) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `permissions` -- INSERT INTO `permissions` (`id`, `name`, `display_name`, `description`, `created_at`, `updated_at`) VALUES (1, 'debugbar.openhandler', 'debugbar.openhandler', 'debugbar.openhandler', '2018-02-19 05:40:04', '2018-02-19 05:40:04'), (2, 'debugbar.clockwork', 'debugbar.clockwork', 'debugbar.clockwork', '2018-02-19 05:40:04', '2018-02-19 05:40:04'), (3, 'debugbar.assets.css', 'debugbar.assets.css', 'debugbar.assets.css', '2018-02-19 05:40:04', '2018-02-19 05:40:04'), (4, 'debugbar.assets.js', 'debugbar.assets.js', 'debugbar.assets.js', '2018-02-19 05:40:04', '2018-02-19 05:40:04'), (5, 'debugbar.cache.delete', 'debugbar.cache.delete', 'debugbar.cache.delete', '2018-02-19 05:40:04', '2018-02-19 05:40:04'), (6, 'login', 'login', 'login', '2018-02-19 05:40:04', '2018-02-19 05:40:04'), (7, 'logout', 'logout', 'logout', '2018-02-19 05:40:04', '2018-02-19 05:40:04'), (8, 'register', 'register', 'register', '2018-02-19 05:40:04', '2018-02-19 05:40:04'), (9, 'password.request', 'password.request', 'password.request', '2018-02-19 05:40:04', '2018-02-19 05:40:04'), (10, 'password.email', 'password.email', 'password.email', '2018-02-19 05:40:04', '2018-02-19 05:40:04'), (11, 'password.reset', 'password.reset', 'password.reset', '2018-02-19 05:40:04', '2018-02-19 05:40:04'), (12, 'home', 'home', 'home', '2018-02-19 05:40:04', '2018-02-19 05:40:04'), (13, 'admin', 'admin', 'admin', '2018-02-19 05:40:04', '2018-02-19 05:40:04'), (14, 'adminLogin', 'adminLogin', 'adminLogin', '2018-02-19 05:40:04', '2018-02-19 05:40:04'), (15, 'profile', 'profile', 'profile', '2018-02-19 05:40:04', '2018-02-19 05:40:04'), (16, 'role.index', 'role.index', 'role.index', '2018-02-19 05:40:04', '2018-02-19 05:40:04'), (17, 'role.create', 'role.create', 'role.create', '2018-02-19 05:40:04', '2018-02-19 05:40:04'), (18, 'role.store', 'role.store', 'role.store', '2018-02-19 05:40:04', '2018-02-19 05:40:04'), (19, 'role.show', 'role.show', 'role.show', '2018-02-19 05:40:05', '2018-02-19 05:40:05'), (20, 'role.edit', 'role.edit', 'role.edit', '2018-02-19 05:40:05', '2018-02-19 05:40:05'), (21, 'role.update', 'role.update', 'role.update', '2018-02-19 05:40:05', '2018-02-19 05:40:05'), (22, 'role.destroy', 'role.destroy', 'role.destroy', '2018-02-19 05:40:05', '2018-02-19 05:40:05'), (23, 'permissions.index', 'permissions.index', 'permissions.index', '2018-02-19 05:40:05', '2018-02-19 05:40:05'), (24, 'permissions.create', 'permissions.create', 'permissions.create', '2018-02-19 05:40:05', '2018-02-19 05:40:05'), (25, 'permissions.store', 'permissions.store', 'permissions.store', '2018-02-19 05:40:05', '2018-02-19 05:40:05'), (26, 'permissions.show', 'permissions.show', 'permissions.show', '2018-02-19 05:40:05', '2018-02-19 05:40:05'), (27, 'permissions.edit', 'permissions.edit', 'permissions.edit', '2018-02-19 05:40:05', '2018-02-19 05:40:05'), (28, 'permissions.update', 'permissions.update', 'permissions.update', '2018-02-19 05:40:05', '2018-02-19 05:40:05'), (29, 'permissions.destroy', 'permissions.destroy', 'permissions.destroy', '2018-02-19 05:40:05', '2018-02-19 05:40:05'), (30, 'testhome', 'testhome', 'testhome', '2018-08-13 05:32:19', '2018-08-13 05:32:19'), (31, 'change-franchisees', 'change-franchisees', 'change-franchisees', '2018-08-13 05:32:20', '2018-08-13 05:32:20'), (32, 'adminchangepassword', 'adminchangepassword', 'adminchangepassword', '2018-08-13 05:32:20', '2018-08-13 05:32:20'), (33, 'adminChangePasswordPost', 'adminChangePasswordPost', 'adminChangePasswordPost', '2018-08-13 05:32:20', '2018-08-13 05:32:20'), (34, 'franchisee.index', 'franchisee.index', 'franchisee.index', '2018-08-13 05:32:20', '2018-08-13 05:32:20'), (35, 'franchisee.create', 'franchisee.create', 'franchisee.create', '2018-08-13 05:32:20', '2018-08-13 05:32:20'), (36, 'franchisee.store', 'franchisee.store', 'franchisee.store', '2018-08-13 05:32:20', '2018-08-13 05:32:20'), (37, 'franchisee.show', 'franchisee.show', 'franchisee.show', '2018-08-13 05:32:20', '2018-08-13 05:32:20'), (38, 'franchisee.edit', 'franchisee.edit', 'franchisee.edit', '2018-08-13 05:32:20', '2018-08-13 05:32:20'), (39, 'franchisee.update', 'franchisee.update', 'franchisee.update', '2018-08-13 05:32:20', '2018-08-13 05:32:20'), (40, 'franchisee.destroy', 'franchisee.destroy', 'franchisee.destroy', '2018-08-13 05:32:20', '2018-08-13 05:32:20'), (41, 'email-template.index', 'email-template.index', 'email-template.index', '2018-08-13 05:32:20', '2018-08-13 05:32:20'), (42, 'email-template.create', 'email-template.create', 'email-template.create', '2018-08-13 05:32:20', '2018-08-13 05:32:20'), (43, 'email-template.store', 'email-template.store', 'email-template.store', '2018-08-13 05:32:20', '2018-08-13 05:32:20'), (44, 'email-template.show', 'email-template.show', 'email-template.show', '2018-08-13 05:32:20', '2018-08-13 05:32:20'), (45, 'email-template.edit', 'email-template.edit', 'email-template.edit', '2018-08-13 05:32:20', '2018-08-13 05:32:20'), (46, 'email-template.update', 'email-template.update', 'email-template.update', '2018-08-13 05:32:20', '2018-08-13 05:32:20'), (47, 'email-template.destroy', 'email-template.destroy', 'email-template.destroy', '2018-08-13 05:32:20', '2018-08-13 05:32:20'), (48, 'general-setting.index', 'general-setting.index', 'general-setting.index', '2018-08-13 05:32:21', '2018-08-13 05:32:21'), (49, 'general-setting.create', 'general-setting.create', 'general-setting.create', '2018-08-13 05:32:21', '2018-08-13 05:32:21'), (50, 'general-setting.store', 'general-setting.store', 'general-setting.store', '2018-08-13 05:32:21', '2018-08-13 05:32:21'), (51, 'general-setting.show', 'general-setting.show', 'general-setting.show', '2018-08-13 05:32:21', '2018-08-13 05:32:21'), (52, 'general-setting.edit', 'general-setting.edit', 'general-setting.edit', '2018-08-13 05:32:21', '2018-08-13 05:32:21'), (53, 'general-setting.update', 'general-setting.update', 'general-setting.update', '2018-08-13 05:32:21', '2018-08-13 05:32:21'), (54, 'general-setting.destroy', 'general-setting.destroy', 'general-setting.destroy', '2018-08-13 05:32:21', '2018-08-13 05:32:21'), (55, 'faq.index', 'faq.index', 'faq.index', '2018-08-13 05:32:21', '2018-08-13 05:32:21'), (56, 'faq.create', 'faq.create', 'faq.create', '2018-08-13 05:32:21', '2018-08-13 05:32:21'), (57, 'faq.store', 'faq.store', 'faq.store', '2018-08-13 05:32:21', '2018-08-13 05:32:21'), (58, 'faq.show', 'faq.show', 'faq.show', '2018-08-13 05:32:21', '2018-08-13 05:32:21'), (59, 'faq.edit', 'faq.edit', 'faq.edit', '2018-08-13 05:32:21', '2018-08-13 05:32:21'), (60, 'faq.update', 'faq.update', 'faq.update', '2018-08-13 05:32:21', '2018-08-13 05:32:21'), (61, 'faq.destroy', 'faq.destroy', 'faq.destroy', '2018-08-13 05:32:21', '2018-08-13 05:32:21'), (62, 'franchisor.index', 'franchisor.index', 'franchisor.index', '2018-08-13 05:32:21', '2018-08-13 05:32:21'), (63, 'franchisor.create', 'franchisor.create', 'franchisor.create', '2018-08-13 05:32:21', '2018-08-13 05:32:21'), (64, 'franchisor.store', 'franchisor.store', 'franchisor.store', '2018-08-13 05:32:21', '2018-08-13 05:32:21'), (65, 'franchisor.show', 'franchisor.show', 'franchisor.show', '2018-08-13 05:32:22', '2018-08-13 05:32:22'), (66, 'franchisor.edit', 'franchisor.edit', 'franchisor.edit', '2018-08-13 05:32:22', '2018-08-13 05:32:22'), (67, 'franchisor.update', 'franchisor.update', 'franchisor.update', '2018-08-13 05:32:22', '2018-08-13 05:32:22'), (68, 'franchisor.destroy', 'franchisor.destroy', 'franchisor.destroy', '2018-08-13 05:32:22', '2018-08-13 05:32:22'), (69, 'users.index', 'users.index', 'users.index', '2018-08-13 05:32:22', '2018-08-13 05:32:22'), (70, 'users.create', 'users.create', 'users.create', '2018-08-13 05:32:22', '2018-08-13 05:32:22'), (71, 'users.store', 'users.store', 'users.store', '2018-08-13 05:32:22', '2018-08-13 05:32:22'), (72, 'users.show', 'users.show', 'users.show', '2018-08-13 05:32:22', '2018-08-13 05:32:22'), (73, 'users.edit', 'users.edit', 'users.edit', '2018-08-13 05:32:22', '2018-08-13 05:32:22'), (74, 'users.update', 'users.update', 'users.update', '2018-08-13 05:32:22', '2018-08-13 05:32:22'), (75, 'users.destroy', 'users.destroy', 'users.destroy', '2018-08-13 05:32:22', '2018-08-13 05:32:22'), (76, 'driver.index', 'driver.index', 'driver.index', '2018-08-13 05:32:22', '2018-08-13 05:32:22'), (77, 'driver.create', 'driver.create', 'driver.create', '2018-08-13 05:32:22', '2018-08-13 05:32:22'), (78, 'driver.store', 'driver.store', 'driver.store', '2018-08-13 05:32:22', '2018-08-13 05:32:22'), (79, 'driver.show', 'driver.show', 'driver.show', '2018-08-13 05:32:22', '2018-08-13 05:32:22'), (80, 'driver.edit', 'driver.edit', 'driver.edit', '2018-08-13 05:32:23', '2018-08-13 05:32:23'), (81, 'driver.update', 'driver.update', 'driver.update', '2018-08-13 05:32:23', '2018-08-13 05:32:23'), (82, 'driver.destroy', 'driver.destroy', 'driver.destroy', '2018-08-13 05:32:23', '2018-08-13 05:32:23'), (83, 'franchisee-user.index', 'franchisee-user.index', 'franchisee-user.index', '2018-08-13 05:32:23', '2018-08-13 05:32:23'), (84, 'franchisee-user.create', 'franchisee-user.create', 'franchisee-user.create', '2018-08-13 05:32:23', '2018-08-13 05:32:23'), (85, 'franchisee-user.store', 'franchisee-user.store', 'franchisee-user.store', '2018-08-13 05:32:23', '2018-08-13 05:32:23'), (86, 'franchisee-user.show', 'franchisee-user.show', 'franchisee-user.show', '2018-08-13 05:32:23', '2018-08-13 05:32:23'), (87, 'franchisee-user.edit', 'franchisee-user.edit', 'franchisee-user.edit', '2018-08-13 05:32:23', '2018-08-13 05:32:23'), (88, 'franchisee-user.update', 'franchisee-user.update', 'franchisee-user.update', '2018-08-13 05:32:23', '2018-08-13 05:32:23'), (89, 'franchisee-user.destroy', 'franchisee-user.destroy', 'franchisee-user.destroy', '2018-08-13 05:32:23', '2018-08-13 05:32:23'), (90, 'driving-request.index', 'driving-request.index', 'driving-request.index', '2018-08-13 05:32:23', '2018-08-13 05:32:23'), (91, 'driving-request.create', 'driving-request.create', 'driving-request.create', '2018-08-13 05:32:23', '2018-08-13 05:32:23'), (92, 'driving-request.store', 'driving-request.store', 'driving-request.store', '2018-08-13 05:32:23', '2018-08-13 05:32:23'), (93, 'driving-request.show', 'driving-request.show', 'driving-request.show', '2018-08-13 05:32:23', '2018-08-13 05:32:23'), (94, 'driving-request.edit', 'driving-request.edit', 'driving-request.edit', '2018-08-13 05:32:23', '2018-08-13 05:32:23'), (95, 'driving-request.update', 'driving-request.update', 'driving-request.update', '2018-08-13 05:32:23', '2018-08-13 05:32:23'), (96, 'driving-request.destroy', 'driving-request.destroy', 'driving-request.destroy', '2018-08-13 05:32:23', '2018-08-13 05:32:23'), (97, 'drivingstore', 'drivingstore', 'drivingstore', '2018-08-13 05:32:23', '2018-08-13 05:32:23'), (98, 'editprofile', 'editprofile', 'editprofile', '2018-09-12 07:56:42', '2018-09-12 07:56:42'), (99, 'profile-update', 'profile-update', 'profile-update', '2018-09-12 07:56:43', '2018-09-12 07:56:43'), (100, 'default-permissions.index', 'default-permissions.index', 'default-permissions.index', '2018-09-12 07:56:43', '2018-09-12 07:56:43'), (101, 'default-permissions.create', 'default-permissions.create', 'default-permissions.create', '2018-09-12 07:56:43', '2018-09-12 07:56:43'), (102, 'default-permissions.store', 'default-permissions.store', 'default-permissions.store', '2018-09-12 07:56:43', '2018-09-12 07:56:43'), (103, 'default-permissions.show', 'default-permissions.show', 'default-permissions.show', '2018-09-12 07:56:43', '2018-09-12 07:56:43'), (104, 'default-permissions.edit', 'default-permissions.edit', 'default-permissions.edit', '2018-09-12 07:56:43', '2018-09-12 07:56:43'), (105, 'default-permissions.update', 'default-permissions.update', 'default-permissions.update', '2018-09-12 07:56:43', '2018-09-12 07:56:43'), (106, 'default-permissions.destroy', 'default-permissions.destroy', 'default-permissions.destroy', '2018-09-12 07:56:43', '2018-09-12 07:56:43'), (107, 'booking.index', 'booking.index', 'booking.index', '2018-09-12 07:56:43', '2018-09-12 07:56:43'), (108, 'booking.create', 'booking.create', 'booking.create', '2018-09-12 07:56:43', '2018-09-12 07:56:43'), (109, 'booking.store', 'booking.store', 'booking.store', '2018-09-12 07:56:43', '2018-09-12 07:56:43'), (110, 'booking.show', 'booking.show', 'booking.show', '2018-09-12 07:56:43', '2018-09-12 07:56:43'), (111, 'booking.edit', 'booking.edit', 'booking.edit', '2018-09-12 07:56:44', '2018-09-12 07:56:44'), (112, 'booking.update', 'booking.update', 'booking.update', '2018-09-12 07:56:44', '2018-09-12 07:56:44'), (113, 'booking.destroy', 'booking.destroy', 'booking.destroy', '2018-09-12 07:56:44', '2018-09-12 07:56:44'), (114, 'vehicles.index', 'vehicles.index', 'vehicles.index', '2018-09-12 07:56:44', '2018-09-12 07:56:44'), (115, 'vehicles.create', 'vehicles.create', 'vehicles.create', '2018-09-12 07:56:44', '2018-09-12 07:56:44'), (116, 'vehicles.store', 'vehicles.store', 'vehicles.store', '2018-09-12 07:56:44', '2018-09-12 07:56:44'), (117, 'vehicles.show', 'vehicles.show', 'vehicles.show', '2018-09-12 07:56:44', '2018-09-12 07:56:44'), (118, 'vehicles.edit', 'vehicles.edit', 'vehicles.edit', '2018-09-12 07:56:44', '2018-09-12 07:56:44'), (119, 'vehicles.update', 'vehicles.update', 'vehicles.update', '2018-09-12 07:56:44', '2018-09-12 07:56:44'), (120, 'vehicles.destroy', 'vehicles.destroy', 'vehicles.destroy', '2018-09-12 07:56:44', '2018-09-12 07:56:44'), (121, 'calender', 'calender', 'calender', '2018-09-12 07:56:44', '2018-09-12 07:56:44'), (122, 'boking-details', 'boking-details', 'boking-details', '2018-09-12 07:56:45', '2018-09-12 07:56:45'), (123, 'forgotpassword-link', 'forgotpassword-link', 'forgotpassword-link', '2018-09-12 07:56:45', '2018-09-12 07:56:45'), (124, 'forgotpasswordpost', 'forgotpasswordpost', 'forgotpasswordpost', '2018-09-12 07:56:45', '2018-09-12 07:56:45'), (125, 'searchajax', 'searchajax', 'searchajax', '2018-09-22 07:57:21', '2018-09-22 07:57:21'), (126, 'booking-price', 'booking-price', 'booking-price', '2018-09-22 07:57:21', '2018-09-22 07:57:21'), (127, 'vehicles-tracking', 'vehicles-tracking', 'vehicles-tracking', '2018-09-22 07:57:22', '2018-09-22 07:57:22'), (128, 'vehicles-tracking-ajax', 'vehicles-tracking-ajax', 'vehicles-tracking-ajax', '2018-09-22 07:57:22', '2018-09-22 07:57:22'); -- -------------------------------------------------------- -- -- Table structure for table `permission_role` -- CREATE TABLE `permission_role` ( `permission_id` int(10) UNSIGNED NOT NULL, `role_id` int(10) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `permission_role` -- INSERT INTO `permission_role` (`permission_id`, `role_id`) VALUES (5, 1), (1, 2), (2, 2), (3, 2), (4, 2), (5, 2), (6, 2), (7, 2), (8, 2), (9, 2), (10, 2), (11, 2), (12, 2), (13, 2), (14, 2), (15, 2), (16, 2), (17, 2), (18, 2), (19, 2), (20, 2), (21, 2), (22, 2), (23, 2), (24, 2), (25, 2), (26, 2), (27, 2), (28, 2), (29, 2), (30, 2), (31, 2), (32, 2), (33, 2), (34, 2), (35, 2), (36, 2), (37, 2), (38, 2), (39, 2), (40, 2), (41, 2), (42, 2), (43, 2), (44, 2), (45, 2), (46, 2), (47, 2), (48, 2), (49, 2), (50, 2), (51, 2), (52, 2), (53, 2), (54, 2), (55, 2), (56, 2), (57, 2), (58, 2), (59, 2), (60, 2), (61, 2), (62, 2), (63, 2), (64, 2), (65, 2), (66, 2), (67, 2), (68, 2), (69, 2), (70, 2), (71, 2), (72, 2), (73, 2), (74, 2), (75, 2), (76, 2), (77, 2), (78, 2), (79, 2), (80, 2), (81, 2), (82, 2), (83, 2), (84, 2), (85, 2), (86, 2), (87, 2), (88, 2), (89, 2), (90, 2), (91, 2), (92, 2), (93, 2), (94, 2), (95, 2), (96, 2), (97, 2), (98, 2), (99, 2), (100, 2), (101, 2), (102, 2), (103, 2), (104, 2), (105, 2), (106, 2), (107, 2), (108, 2), (109, 2), (110, 2), (111, 2), (112, 2), (113, 2), (114, 2), (115, 2), (116, 2), (117, 2), (118, 2), (119, 2), (120, 2), (121, 2), (122, 2), (123, 2), (124, 2), (125, 2), (126, 2), (127, 2), (128, 2); -- -------------------------------------------------------- -- -- Table structure for table `pickup_locations` -- CREATE TABLE `pickup_locations` ( `id` int(11) NOT NULL, `booking_id` int(11) NOT NULL, `pickup_position` int(11) NOT NULL DEFAULT '1', `location_name` varchar(255) NOT NULL, `distance` double(11,2) NOT NULL, `travel_time` int(11) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `pickup_locations` -- INSERT INTO `pickup_locations` (`id`, `booking_id`, `pickup_position`, `location_name`, `distance`, `travel_time`, `created_at`, `updated_at`, `deleted_at`) VALUES (12, 1, 1, 'Sealdah Railway Station, Sealdah, Raja Bazar, Calcutta, West Bengal, India', 8.94, 39, '2018-09-24 01:06:33', '2018-09-24 01:06:33', NULL), (13, 1, 99, 'Kolkata Railway Station (Chitpur Station), Belgachia, Calcutta, West Bengal, India', 3.54, 23, '2018-09-24 01:06:33', '2018-09-24 01:06:33', NULL), (30, 2, 1, 'Andhra Pradesh, India', 857.84, 1554, '2018-09-24 08:37:15', '2018-09-24 08:37:15', NULL), (31, 2, 99, 'Andhra Pradesh, India', 0.00, 0, '2018-09-24 08:37:15', '2018-09-24 08:37:15', NULL), (34, 3, 1, 'Shyam Bazar, Calcutta, West Bengal, India', 11.89, 50, '2018-09-25 04:57:52', '2018-09-25 04:57:52', NULL), (35, 3, 99, 'Garia Station Road, Baidyapara, Garia, Calcutta, West Bengal, India', 12.40, 51, '2018-09-25 04:57:52', '2018-09-25 04:57:52', NULL), (67, 35, 1, 'Dum Dum, Calcutta, West Bengal, India', 15.37, 55, '2018-09-27 02:03:59', '2018-09-27 02:03:59', NULL), (68, 35, 99, 'Netaji Subhash Chandra Bose International Airport (CCU), Jessore Road, Dum Dum, Calcutta, West Bengal, India', 5.16, 28, '2018-09-27 02:03:59', '2018-09-27 02:03:59', NULL), (84, 41, 1, 'Kolkata, West Bengal, India', 6.74, 37, '2018-09-27 07:21:33', '2018-09-27 07:21:33', NULL), (85, 41, 99, 'Dum Dum, Calcutta, West Bengal, India', 9.08, 43, '2018-09-27 07:21:33', '2018-09-27 07:21:33', NULL), (86, 45, 1, 'Dum Dum, Calcutta, West Bengal, India', 15.37, 55, '2018-09-28 02:46:39', '2018-09-28 02:46:39', NULL), (87, 45, 99, 'Netaji Subhash Chandra Bose International Airport (CCU), Jessore Road, Dum Dum, Calcutta, West Bengal, India', 5.16, 28, '2018-09-28 02:46:39', '2018-09-28 02:46:39', NULL), (88, 46, 1, 'Dum Dum, Calcutta, West Bengal, India', 15.37, 55, '2018-09-28 02:50:09', '2018-09-28 02:50:09', NULL), (89, 46, 99, 'Netaji Subhash Chandra Bose International Airport (CCU), Jessore Road, Dum Dum, Calcutta, West Bengal, India', 5.16, 28, '2018-09-28 02:50:09', '2018-09-28 02:50:09', NULL), (90, 47, 1, 'Dum Dum, Calcutta, West Bengal, India', 15.37, 55, '2018-09-28 02:50:30', '2018-09-28 02:50:30', NULL), (91, 47, 99, 'Netaji Subhash Chandra Bose International Airport (CCU), Jessore Road, Dum Dum, Calcutta, West Bengal, India', 5.16, 28, '2018-09-28 02:50:30', '2018-09-28 02:50:30', NULL), (92, 48, 1, 'Dum Dum, Calcutta, West Bengal, India', 15.37, 55, '2018-09-28 02:53:06', '2018-09-28 02:53:06', NULL), (93, 48, 99, 'Netaji Subhash Chandra Bose International Airport (CCU), Jessore Road, Dum Dum, Calcutta, West Bengal, India', 5.16, 28, '2018-09-28 02:53:06', '2018-09-28 02:53:06', NULL), (94, 49, 1, 'Dum Dum, Calcutta, West Bengal, India', 15.37, 55, '2018-09-28 02:55:57', '2018-09-28 02:55:57', NULL), (95, 49, 99, 'Netaji Subhash Chandra Bose International Airport (CCU), Jessore Road, Dum Dum, Calcutta, West Bengal, India', 5.16, 28, '2018-09-28 02:55:57', '2018-09-28 02:55:57', NULL), (96, 50, 1, 'Dum Dum, Calcutta, West Bengal, India', 15.37, 55, '2018-09-28 03:02:08', '2018-09-28 03:02:08', NULL), (97, 50, 99, 'Netaji Subhash Chandra Bose International Airport (CCU), Jessore Road, Dum Dum, Calcutta, West Bengal, India', 5.16, 28, '2018-09-28 03:02:08', '2018-09-28 03:02:08', NULL), (98, 51, 1, 'Dum Dum, Calcutta, West Bengal, India', 15.37, 55, '2018-09-28 04:13:23', '2018-09-28 04:13:23', NULL), (99, 51, 99, 'Netaji Subhash Chandra Bose International Airport (CCU), Jessore Road, Dum Dum, Calcutta, West Bengal, India', 5.16, 28, '2018-09-28 04:13:23', '2018-09-28 04:13:23', NULL), (102, 53, 1, 'Ashok Nagar, Bengaluru, Karnataka, India', 1162.21, 2100, '2018-09-28 04:23:31', '2018-09-28 04:23:31', NULL), (103, 53, 99, 'Assam, India', 1870.15, 3529, '2018-09-28 04:23:31', '2018-09-28 04:23:31', NULL), (104, 54, 1, 'Ashok Nagar, Bengaluru, Karnataka, India', 1162.21, 2100, '2018-09-28 04:28:10', '2018-09-28 04:28:10', NULL), (105, 54, 99, 'Assam, India', 1870.15, 3529, '2018-09-28 04:28:10', '2018-09-28 04:28:10', NULL), (106, 55, 1, 'Ashok Nagar, Bengaluru, Karnataka, India', 1162.21, 2100, '2018-09-28 04:28:39', '2018-09-28 04:28:39', NULL), (107, 55, 99, 'Assam, India', 1870.15, 3529, '2018-09-28 04:28:39', '2018-09-28 04:28:39', NULL), (110, 56, 1, 'Garia, Calcutta, West Bengal, India', 0.51, 3, '2018-09-28 05:39:55', '2018-09-28 05:39:55', NULL), (111, 56, 99, 'Sealdah Railway Station, Sealdah, Raja Bazar, Calcutta, West Bengal, India', 9.27, 41, '2018-09-28 05:39:56', '2018-09-28 05:39:56', NULL), (112, 57, 1, 'Garia, Calcutta, West Bengal, India', 0.51, 3, '2018-09-28 06:03:04', '2018-09-28 06:03:04', NULL), (113, 57, 2, 'Ruby General Hospital, Anandapur Main Road, Sector I, East Kolkata Township, Calcutta, West Bengal, India', 4.07, 17, '2018-09-28 06:03:04', '2018-09-28 06:03:04', NULL), (114, 57, 3, 'Sealdah Railway Station, Sealdah, Raja Bazar, Calcutta, West Bengal, India', 5.41, 26, '2018-09-28 06:03:04', '2018-09-28 06:03:04', NULL), (115, 57, 99, 'Chitpur, Calcutta, West Bengal, India', 2.36, 20, '2018-09-28 06:03:04', '2018-09-28 06:03:04', NULL); -- -------------------------------------------------------- -- -- Table structure for table `roles` -- CREATE TABLE `roles` ( `id` int(10) UNSIGNED NOT NULL, `franchisees_id` int(11) DEFAULT NULL, `name` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL, `display_name` varchar(190) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `description` varchar(190) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `roles` -- INSERT INTO `roles` (`id`, `franchisees_id`, `name`, `display_name`, `description`, `created_at`, `updated_at`) VALUES (1, NULL, 'Admin', 'Admin', 'Admin', '2018-09-22 04:49:13', '2018-09-22 04:49:13'), (2, 1, 'Test Role', 'd', 'fg', '2018-09-24 01:12:10', '2018-09-24 01:12:10'); -- -------------------------------------------------------- -- -- Table structure for table `role_user` -- CREATE TABLE `role_user` ( `user_id` int(10) UNSIGNED NOT NULL, `role_id` int(10) UNSIGNED NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `role_user` -- INSERT INTO `role_user` (`user_id`, `role_id`) VALUES (12, 2); -- -------------------------------------------------------- -- -- Table structure for table `trip_route` -- CREATE TABLE `trip_route` ( `id` int(10) NOT NULL, `booking_id` int(10) NOT NULL, `lat` varchar(255) NOT NULL, `lng` varchar(255) NOT NULL, `travel_time` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(10) UNSIGNED NOT NULL, `is_super` int(11) DEFAULT NULL, `user_type` int(11) NOT NULL DEFAULT '4' COMMENT '1=>Franchisor, 2=>Franchisee, 3=>Driver,4=>Users', `franchisees_id` int(11) DEFAULT NULL, `name` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL, `surname` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `profile_pic` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'profile.jpg', `email` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL, `password` varchar(190) COLLATE utf8mb4_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `device_token` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `dob` date DEFAULT NULL, `phone` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, `street` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `locality` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `town` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `postcode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, `country` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL, `status` int(11) DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `is_super`, `user_type`, `franchisees_id`, `name`, `surname`, `profile_pic`, `email`, `password`, `remember_token`, `device_token`, `dob`, `phone`, `street`, `locality`, `town`, `postcode`, `country`, `created_at`, `updated_at`, `deleted_at`, `status`) VALUES (1, 1, 1, NULL, 'Hasibur', 'Rahaman', 'profile.jpg', 'hasib2008@gmail.com', '$2y$10$azBENyVBiAfJOovL8fD3iuRZszIuT3WG0/MtJBFJrMGvlfmXf0sQK', '7qj9I4NyY1bcTaoElm1Nr4mBfOxvWMig0TmpH3J8YPfJqMUUxH83IasLwFwl', NULL, '1989-12-28', '7059114888', 'Street', 'Locality', 'Town', 'Postcode', NULL, NULL, '2018-09-24 01:36:52', NULL, 1), (3, NULL, 3, 1, 'Jhonn', 'Deo', '1537607040-5ba60580c8e95.png', 'driver@gmail.com', '$2y$10$e7qvNVc3JDbxVjZoqGGfqO8tnWkhfwj8zL2wEwF6etpKL32zV.u0m', NULL, '0', '2018-09-14', '78451232656', 'Street', 'Locality', 'Town', '741023', NULL, '2018-09-22 03:17:07', '2018-10-01 02:42:24', NULL, 1), (4, 1, 2, 1, 'Franchisee User', NULL, 'profile.jpg', 'franchiseeuser@gmail.com', '$2y$10$azBENyVBiAfJOovL8fD3iuRZszIuT3WG0/MtJBFJrMGvlfmXf0sQK', NULL, NULL, '2018-09-28', '7458965896', 'street', 'locality', 'Town', 'POSTCODE', NULL, '2018-09-22 03:41:13', '2018-09-22 03:43:42', NULL, 1), (12, 1, 1, NULL, 'Franchisor', NULL, 'profile.jpg', 'franchisor@gmail.com', '$2y$10$DD7mJrKN/TpYJ0XUI3j08ubrS/ON7QlHAY4Qv6maPaYWWvaPrTeK6', NULL, NULL, '2018-09-27', '7896541236', 'Street', 'Loality', 'Town', 'POSTCODE', NULL, '2018-09-24 01:23:46', '2018-09-24 01:23:52', NULL, 1), (13, NULL, 3, 1, 'Bittu', 'Devnath', '1537861925-5ba9e9258551b.png', 'bittu@gmail.com', '$2y$10$vXTDeM.BOmOaCRwSdBTmmOr1K45xPqrl1Cz6JMPu1xsWNOHO.of9i', NULL, NULL, '2018-09-28', '7896541236', 'Street', 'Locality', 'Town', 'POST', NULL, '2018-09-25 02:22:05', '2018-09-25 02:22:05', NULL, 1); -- -------------------------------------------------------- -- -- Table structure for table `vehicles` -- CREATE TABLE `vehicles` ( `id` int(11) NOT NULL, `franchisees_id` int(11) NOT NULL, `body_type` int(255) NOT NULL, `vehicles_model` varchar(255) NOT NULL, `vehicles_company` varchar(255) NOT NULL, `vehicles_number` varchar(20) NOT NULL, `max_capacity` int(11) DEFAULT NULL, `councile_license_no` varchar(255) NOT NULL, `council_date` date DEFAULT NULL, `tax_renewal_date` date DEFAULT NULL, `insurance_date` date DEFAULT NULL, `mot_date` date DEFAULT NULL, `lat` varchar(255) DEFAULT NULL, `lng` varchar(255) DEFAULT NULL, `status` int(11) NOT NULL COMMENT '1=>Active', `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `vehicles` -- INSERT INTO `vehicles` (`id`, `franchisees_id`, `body_type`, `vehicles_model`, `vehicles_company`, `vehicles_number`, `max_capacity`, `councile_license_no`, `council_date`, `tax_renewal_date`, `insurance_date`, `mot_date`, `lat`, `lng`, `status`, `created_at`, `updated_at`, `deleted_at`) VALUES (1, 1, 1, 'SUV', 'BMW', '748554', 10, '5656546', '2018-09-26', '2018-09-27', '2018-09-28', '2018-09-27', NULL, NULL, 1, '2018-09-25 01:05:11', '2018-09-25 01:05:11', NULL), (2, 1, 2, 'asdasd', 'asdas', 'asdas', 213123, '123', '2018-10-05', '2018-09-28', '2018-09-29', '2018-09-28', NULL, NULL, 1, '2018-09-25 03:57:26', '2018-09-25 03:57:26', NULL); -- -------------------------------------------------------- -- -- Table structure for table `vehicles_body_types` -- CREATE TABLE `vehicles_body_types` ( `id` int(11) NOT NULL, `type` varchar(255) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `vehicles_body_types` -- INSERT INTO `vehicles_body_types` (`id`, `type`, `created_at`, `updated_at`) VALUES (1, 'Coupe', NULL, NULL), (2, 'SUV/MUV', NULL, NULL), (3, 'Sedan', NULL, NULL), (4, 'Convertible', NULL, NULL), (5, 'Hatchback', NULL, NULL), (6, 'Station Wagon', NULL, NULL); -- -- Indexes for dumped tables -- -- -- Indexes for table `booking` -- ALTER TABLE `booking` ADD PRIMARY KEY (`id`); -- -- Indexes for table `booking_vehicle` -- ALTER TABLE `booking_vehicle` ADD PRIMARY KEY (`id`); -- -- Indexes for table `default_permissions` -- ALTER TABLE `default_permissions` ADD PRIMARY KEY (`id`); -- -- Indexes for table `drivers_vehicles` -- ALTER TABLE `drivers_vehicles` ADD PRIMARY KEY (`id`); -- -- Indexes for table `driver_attendance` -- ALTER TABLE `driver_attendance` ADD PRIMARY KEY (`id`); -- -- Indexes for table `driver_details` -- ALTER TABLE `driver_details` ADD PRIMARY KEY (`id`); -- -- Indexes for table `driving_request` -- ALTER TABLE `driving_request` ADD PRIMARY KEY (`id`); -- -- Indexes for table `email_template` -- ALTER TABLE `email_template` ADD PRIMARY KEY (`id`); -- -- Indexes for table `faqs` -- ALTER TABLE `faqs` ADD PRIMARY KEY (`id`); -- -- Indexes for table `franchisees` -- ALTER TABLE `franchisees` ADD PRIMARY KEY (`id`); -- -- Indexes for table `franchisees_price` -- ALTER TABLE `franchisees_price` ADD PRIMARY KEY (`id`); -- -- Indexes for table `general_setting` -- ALTER TABLE `general_setting` ADD PRIMARY KEY (`id`); -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Indexes for table `permissions` -- ALTER TABLE `permissions` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `permissions_name_unique` (`name`); -- -- Indexes for table `permission_role` -- ALTER TABLE `permission_role` ADD PRIMARY KEY (`permission_id`,`role_id`), ADD KEY `permission_role_role_id_foreign` (`role_id`); -- -- Indexes for table `pickup_locations` -- ALTER TABLE `pickup_locations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `roles` -- ALTER TABLE `roles` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `roles_name_unique` (`name`); -- -- Indexes for table `role_user` -- ALTER TABLE `role_user` ADD PRIMARY KEY (`user_id`,`role_id`), ADD KEY `role_user_role_id_foreign` (`role_id`); -- -- Indexes for table `trip_route` -- ALTER TABLE `trip_route` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`); -- -- Indexes for table `vehicles` -- ALTER TABLE `vehicles` ADD PRIMARY KEY (`id`); -- -- Indexes for table `vehicles_body_types` -- ALTER TABLE `vehicles_body_types` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `booking` -- ALTER TABLE `booking` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=58; -- -- AUTO_INCREMENT for table `booking_vehicle` -- ALTER TABLE `booking_vehicle` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16; -- -- AUTO_INCREMENT for table `default_permissions` -- ALTER TABLE `default_permissions` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=86; -- -- AUTO_INCREMENT for table `drivers_vehicles` -- ALTER TABLE `drivers_vehicles` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; -- -- AUTO_INCREMENT for table `driver_attendance` -- ALTER TABLE `driver_attendance` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28; -- -- AUTO_INCREMENT for table `driver_details` -- ALTER TABLE `driver_details` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `driving_request` -- ALTER TABLE `driving_request` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `email_template` -- ALTER TABLE `email_template` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13; -- -- AUTO_INCREMENT for table `faqs` -- ALTER TABLE `faqs` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `franchisees` -- ALTER TABLE `franchisees` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `franchisees_price` -- ALTER TABLE `franchisees_price` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `general_setting` -- ALTER TABLE `general_setting` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19; -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8; -- -- AUTO_INCREMENT for table `permissions` -- ALTER TABLE `permissions` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=129; -- -- AUTO_INCREMENT for table `pickup_locations` -- ALTER TABLE `pickup_locations` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=116; -- -- AUTO_INCREMENT for table `roles` -- ALTER TABLE `roles` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `trip_route` -- ALTER TABLE `trip_route` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- AUTO_INCREMENT for table `vehicles` -- ALTER TABLE `vehicles` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `vehicles_body_types` -- ALTER TABLE `vehicles_body_types` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- Constraints for dumped tables -- -- -- Constraints for table `permission_role` -- ALTER TABLE `permission_role` ADD CONSTRAINT `permission_role_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `permission_role_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `role_user` -- ALTER TABLE `role_user` ADD CONSTRAINT `role_user_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `role_user_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
82.168317
5,900
0.630187
0d9d300cded5d77c297f302ac20c8d49f48e6a32
3,965
cs
C#
CarLove/CarLove/Controllers/HomeController.cs
SDD-Maples/CarPort
a402f6b6e709101d98038c0a4df09f946108e6f0
[ "MIT" ]
null
null
null
CarLove/CarLove/Controllers/HomeController.cs
SDD-Maples/CarPort
a402f6b6e709101d98038c0a4df09f946108e6f0
[ "MIT" ]
5
2017-09-25T23:20:52.000Z
2017-11-30T00:02:00.000Z
CarLove/CarLove/Controllers/HomeController.cs
SDD-Maples/CarPort
a402f6b6e709101d98038c0a4df09f946108e6f0
[ "MIT" ]
null
null
null
using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using CarLove.Models; namespace CarLove.Controllers { public class HomeController : Controller { //Home Page public IActionResult Index() { return View(); } public IActionResult About() { ViewData["Message"] = "Your application description page."; return View(); } //Test Page for city station public IActionResult CityStat() { var rand = new Random(); int Current; int Capacity = rand.Next(100); using( var db = new MapleContext()) { Capacity = db.Lots.FirstOrDefault().Maxsize; Current = db.Lots.FirstOrDefault().CurrentCount; } ViewData["Capacity"] = Capacity; ViewData["Current"] = Current; //Console.WriteLine(ViewData["Lot"]); return View(); } public IActionResult Contact() { ViewData["Message"] = "Your contact page."; return View(); } public IActionResult Error() { return View(); } //Displays generates list of Lots for the View to Display public IActionResult LocSearch(string Loc, int? UserID ) { ViewData["Search"] = Loc; ViewData["UserId"] = UserID ?? -1; using( var db = new MapleContext()) { if( Loc == "!!" || Loc == "") return View(db.Lots.ToList()); return View(db.Lots.Where(l=>l.Location.Contains(Loc)).ToList()); } } //Lot Specific pages public IActionResult ViewLot(int ID) { Lot ret; using( var db = new MapleContext()) { ret = db.Lots.FirstOrDefault(l=>l.ID==ID); } return View(ret); } //Allows when in the Lot listing, this allows the user // to add a favorite, using LOTID and UserID public IActionResult AddFavorite(int LotID, int UserID) { if( UserID == -1) return RedirectToAction("ViewLot",new{ID=LotID}); using( var db = new MapleContext()) { var flot = db.Lots.FirstOrDefault(l=>l.ID==LotID); flot.Users.Add(new FavourLots{ UserID=UserID, LotID=LotID, Lot=flot }); db.SaveChanges(); } return RedirectToAction("ViewLot",new{ID=LotID}); } //Returns view for loggin in. //View Data is setup to return error messages to user public IActionResult LoginPage() { ViewData["Message"] = ""; return View(); } //Check Username/Password input //Return User to Login if no match exists //Otherwise, show list of favorites public IActionResult LoginResult(string Username, string Password) { using( var db = new MapleContext()) { var use = db.Users. FirstOrDefault(u=> u.Username== Username && u.Password==Password); if( use == null) { ViewData["Message"] = "Login Failed, please try again"; return View("LoginPage"); } use = db.Users .Include(e => e.Favorites) .ThenInclude(e => e.Lot) .Where( z=>z.ID == use.ID).FirstOrDefault(); var retList = use.Favorites.Select(e => e.Lot).ToList(); ViewData["UserId"] = use.ID; return View("LocSearch", retList); } } } }
29.589552
87
0.499874
522ccc292a35aa2e48366bb9b76b1f4db0d0ff96
687
ps1
PowerShell
scripts/windows/windows-base.ps1
ifunky/bakery
417ce4a2bde7c3f75e110c9889f4478f9765610c
[ "Apache-2.0" ]
4
2015-09-19T07:54:18.000Z
2021-07-30T12:38:55.000Z
scripts/windows/windows-base.ps1
ifunky/bakery
417ce4a2bde7c3f75e110c9889f4478f9765610c
[ "Apache-2.0" ]
null
null
null
scripts/windows/windows-base.ps1
ifunky/bakery
417ce4a2bde7c3f75e110c9889f4478f9765610c
[ "Apache-2.0" ]
null
null
null
Write-Host "Enabling RDP, reset SysprepStatus and show file extensions" netsh advfirewall firewall add rule name="Remote Desktop" dir=in localport=3389 protocol=TCP action=allow reg add 'HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server' /v fDenyTSConnections /t REG_DWORD /d 0 /f Set-ItemProperty -Path 'HKLM:\SYSTEM\Setup\Status\SysprepStatus' -Name 'GeneralizationState' -Value 7 Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Name 'HideFileExt' -Value 0 Set-ItemProperty -path "HKLM:\SOFTWARE\Microsoft\Internet Explorer\UnattendBackup\ActiveSetup\DisableFirstRunWizard" -Name DisableFirstRunWizard -Value 1
76.333333
154
0.815138
c6a3174a169ca1dda899bb95b1449a3699881c79
600
py
Python
DSA Coding/Array/MergeSort.py
prathimacode-hub/WIE-WoC
f412f297a57249af98213bf4a747c897f2d4c035
[ "MIT" ]
8
2022-03-01T09:09:20.000Z
2022-03-03T05:36:01.000Z
DSA Coding/Array/MergeSort.py
prathimacode-hub/WIE-WoC
f412f297a57249af98213bf4a747c897f2d4c035
[ "MIT" ]
52
2022-03-02T13:52:46.000Z
2022-03-04T03:03:17.000Z
DSA Coding/Array/MergeSort.py
prathimacode-hub/WIE-WoC
f412f297a57249af98213bf4a747c897f2d4c035
[ "MIT" ]
23
2022-03-01T06:39:34.000Z
2022-03-03T09:24:40.000Z
# Merge Sort def merge(left, right): result = [] i = j = 0 while i < len(left) and j < len(right): if left[i] < right[j]: result.append(left[i]) i += 1 else: result.append(right[j]) j += 1 result += left[i:] def mergeSort(arr): if len(arr) <= 1: return arr mid = len(arr) // 2 left = arr[:mid] right = arr[mid:] left = mergeSort(left) right = mergeSort(right) return merge(left, right) n = int(input("Enter number: ")) arr = list(map(int, input().split())) print(*mergeSort(arr))
20.689655
43
0.511667
4d10c21cc671622209906b917e160ace22fcb9b2
29
cshtml
C#
Griddly/Views/Example/Filters.cshtml
programcsharp/griddly
e69efe1fa7b8353b917c6d88d0909f46522ccb47
[ "MIT" ]
11
2015-02-24T09:43:11.000Z
2019-11-13T10:02:01.000Z
Griddly/Views/Example/Filters.cshtml
programcsharp/griddly
e69efe1fa7b8353b917c6d88d0909f46522ccb47
[ "MIT" ]
36
2015-01-08T18:53:36.000Z
2020-03-21T17:13:56.000Z
Griddly/Views/Example/Filters.cshtml
programcsharp/griddly
e69efe1fa7b8353b917c6d88d0909f46522ccb47
[ "MIT" ]
7
2015-03-13T15:25:58.000Z
2020-07-15T04:27:37.000Z
@Html.Griddly("FiltersGrid")
29
29
0.758621
1bf3187d234b17d737f855477e0816b3ae7b60bb
75
rb
Ruby
app/serializers/shipit/command_line_user_serializer.rb
mfwarren/shipit-engine
cbbb8b172bc41102843d27c1031ff495ffe86e33
[ "MIT" ]
null
null
null
app/serializers/shipit/command_line_user_serializer.rb
mfwarren/shipit-engine
cbbb8b172bc41102843d27c1031ff495ffe86e33
[ "MIT" ]
6
2020-06-25T07:31:54.000Z
2022-02-11T22:32:53.000Z
app/serializers/shipit/command_line_user_serializer.rb
mfwarren/shipit-engine
cbbb8b172bc41102843d27c1031ff495ffe86e33
[ "MIT" ]
null
null
null
module Shipit class CommandLineUserSerializer < UserSerializer end end
15
50
0.826667
dbcea8600525f0b34f736516c00b361e547b4ed0
2,762
php
PHP
application/controllers/Zerobacklognid.php
budianonym/propops-dashboard
9af1c24e66cb978f7b5e3b0d295b491daa436671
[ "MIT" ]
null
null
null
application/controllers/Zerobacklognid.php
budianonym/propops-dashboard
9af1c24e66cb978f7b5e3b0d295b491daa436671
[ "MIT" ]
null
null
null
application/controllers/Zerobacklognid.php
budianonym/propops-dashboard
9af1c24e66cb978f7b5e3b0d295b491daa436671
[ "MIT" ]
null
null
null
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Zerobacklognid extends CI_Controller { public function __construct() { parent::__construct(); $this->load->database(); $this->load->model('zerobacklognid_model'); function checkzero($a){ if ($a!=null) { return $a; }else{return 0;} } } public function index() { // $data['zerobacklognid'] = $this->zerobacklognid_model->local(); $data['zerobacklognidcount'] = $this->zerobacklognid_model->localcount(); // var_dump($data['backlog']); $data['title'] = "Backlog for Daily Operation"; $data['i'] = 1; $data['timestamp'] = []; $data['redawning'] = []; $data['expedia'] = []; $data['homeaway'] = []; $data['airbnb'] = []; $this->slice->view('template/header', $data); $this->slice->view('zerobacklog/nid_view', $data); $this->slice->view('template/footer', $data); // $this->load->view('welcome_message'); } public function nid() { $data['zerobacklognidajax'] = $this->zerobacklognid_model->local($_GET['channel'], $_GET['date']); $data['zerobacklognidvalidation'] = $this->zerobacklognid_model->validation($_GET['channel'], $_GET['date']); $data['codenya'] = $this->zerobacklognid_model->codenya(); //var_dump($data['codenya']); // var_dump($data['backlog']); $data['i'] = 1; $this->slice->view('zerobacklog/nidajax_view', $data); // $this->load->view('welcome_message'); } public function validation() { $data['zerobacklognidvalidationall'] = $this->zerobacklognid_model->validationall(); // var_dump($data['backlog']); $data['title'] = "Validation Backlog"; $data['i'] = 1; $this->slice->view('template/header', $data); $this->slice->view('zerobacklog/zerobacklogvalidation_view', $data); $this->slice->view('template/footer', $data); // $this->load->view('welcome_message'); } public function dailyAssignment() { $data['dailyAssignment'] = $this->zerobacklognid_model->dailyAssignment(); // var_dump($data['backlog']); $data['title'] = "Daily Assignment Numbers"; $data['i'] = 1; $this->slice->view('template/header', $data); $this->slice->view('zerobacklog/dailyassignment_view', $data); $this->slice->view('template/footer', $data); // $this->load->view('welcome_message'); } public function livenotreview() { $data['dailyAssignment'] = $this->zerobacklognid_model->get_livenotreview(); // var_dump($data['backlog']); $data['title'] = "Daily backlog (LiveNotReviewed"; $data['i'] = 1; $this->slice->view('template/header', $data); $this->slice->view('zerobacklog/livenotreviewed_view', $data); $this->slice->view('template/footer', $data); // $this->load->view('welcome_message'); } }
30.351648
111
0.637581
a606c63c8064c1c408f2390626f8f19830c26bc6
78
rb
Ruby
lib/url_canonicalize/version.rb
dominicsayers/url_canonicalize
12158c9819db96b49e2ffe8fad8929c3ad815f06
[ "MIT" ]
1
2016-12-23T11:16:06.000Z
2016-12-23T11:16:06.000Z
lib/url_canonicalize/version.rb
dominicsayers/url_canonicalize
12158c9819db96b49e2ffe8fad8929c3ad815f06
[ "MIT" ]
5
2017-03-06T16:50:04.000Z
2018-06-30T12:30:10.000Z
lib/url_canonicalize/version.rb
dominicsayers/url_canonicalize
12158c9819db96b49e2ffe8fad8929c3ad815f06
[ "MIT" ]
null
null
null
# frozen_string_literal: true module URLCanonicalize VERSION = '0.2.1' end
13
29
0.75641
143cf54f66b822b5e1ba2fc5ec0da60cda2a2e4a
1,584
ts
TypeScript
veggy-app/node_modules/@alfresco/adf-insights/insights/analytics-process/components/analytics-generator.component.d.ts
jcarrasko/adf-intro
3694bed27df3aa0c55b9dcca4a05865d83814d53
[ "Apache-2.0" ]
1
2018-03-01T11:12:54.000Z
2018-03-01T11:12:54.000Z
veggy-app/node_modules/@alfresco/adf-insights/insights/analytics-process/components/analytics-generator.component.d.ts
jcarrasko/adf-intro
3694bed27df3aa0c55b9dcca4a05865d83814d53
[ "Apache-2.0" ]
null
null
null
veggy-app/node_modules/@alfresco/adf-insights/insights/analytics-process/components/analytics-generator.component.d.ts
jcarrasko/adf-intro
3694bed27df3aa0c55b9dcca4a05865d83814d53
[ "Apache-2.0" ]
null
null
null
/*! * @license * Copyright 2016 Alfresco Software, Ltd. * * 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 { EventEmitter, OnChanges } from '@angular/core'; import { ReportQuery } from '../../diagram/models/report/reportQuery.model'; import { Chart } from '../../diagram/models/chart/chart.model'; import { AnalyticsService } from '../services/analytics.service'; export declare class AnalyticsGeneratorComponent implements OnChanges { private analyticsService; reportId: number; reportParamQuery: ReportQuery; success: EventEmitter<{}>; error: EventEmitter<{}>; reports: Chart[]; showDetails: boolean; currentChartPosition: number; barChartOptions: any; constructor(analyticsService: AnalyticsService); ngOnChanges(): void; generateReport(reportId: any, reportParamQuery: any): void; reset(): void; refresh(report: any): void; toggleDetailsTable(): void; isShowDetails(): boolean; isCurrent(position: number): boolean; selectCurrent(position: number): void; selectFirstReport(): void; }
37.714286
76
0.721591
5061cf71724c85586ca327c55142329c91c8eaf7
559
dart
Dart
lib/ui/pages/newTask/controller/new_task_controller.dart
1agracinha/taskee
d2548f15ea035461df89476a1ad0dcb7b35a968c
[ "MIT" ]
null
null
null
lib/ui/pages/newTask/controller/new_task_controller.dart
1agracinha/taskee
d2548f15ea035461df89476a1ad0dcb7b35a968c
[ "MIT" ]
null
null
null
lib/ui/pages/newTask/controller/new_task_controller.dart
1agracinha/taskee
d2548f15ea035461df89476a1ad0dcb7b35a968c
[ "MIT" ]
null
null
null
import 'package:bloc/bloc.dart'; import 'package:equatable/equatable.dart'; import 'package:get/get.dart'; import 'package:taskee/domain/usecases/usecases.dart'; part 'new_task_state.dart'; class NewTaskController extends Cubit<NewTaskState> { final IAddTaskUsecase _addTaskUsecase; NewTaskController(this._addTaskUsecase) : super(NewTaskInitial()); void addTask(String title, String subtitle, String state) async { emit(NewTaskLoading()); await _addTaskUsecase.addTask(title, subtitle, state); emit(NewTaskDone()); Get.back(); } }
29.421053
68
0.756708
660ec95e61516295e5f14c72425e71b3d9e84455
409
py
Python
froide_crowdfunding/migrations/0005_crowdfunding_public_interest.py
okfde/froide-crowdfunding
b67ea484529e69f65203f7b5e77e8e7db6a0c2e7
[ "MIT" ]
1
2019-03-13T20:11:59.000Z
2019-03-13T20:11:59.000Z
froide_crowdfunding/migrations/0005_crowdfunding_public_interest.py
okfde/froide-crowdfunding
b67ea484529e69f65203f7b5e77e8e7db6a0c2e7
[ "MIT" ]
null
null
null
froide_crowdfunding/migrations/0005_crowdfunding_public_interest.py
okfde/froide-crowdfunding
b67ea484529e69f65203f7b5e77e8e7db6a0c2e7
[ "MIT" ]
1
2019-05-01T12:34:46.000Z
2019-05-01T12:34:46.000Z
# Generated by Django 2.1.8 on 2019-04-15 09:32 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('froide_crowdfunding', '0004_contribution_public'), ] operations = [ migrations.AddField( model_name='crowdfunding', name='public_interest', field=models.TextField(blank=True), ), ]
21.526316
60
0.621027
4445a76ba1ea5e10f49e44687c680c88c2e67c3b
384
sql
SQL
sql-queries/query_45.sql
sdbs-uni-p/usage-of-not-replication
84e0870d47a9e73b246c96c436cebea09080df5d
[ "CC-BY-4.0" ]
null
null
null
sql-queries/query_45.sql
sdbs-uni-p/usage-of-not-replication
84e0870d47a9e73b246c96c436cebea09080df5d
[ "CC-BY-4.0" ]
null
null
null
sql-queries/query_45.sql
sdbs-uni-p/usage-of-not-replication
84e0870d47a9e73b246c96c436cebea09080df5d
[ "CC-BY-4.0" ]
null
null
null
--counting select count(*) countNegations, count(distinct p2dewey) countDefGroups, count(distinct line) from flattree where key = 'not' and p2key = 'definitions'; --visualizing -- this code miss one definition that has `.' inside the definition name select line, sibnum, sibkeys, valuelen, value from treewithsiblings where key = 'not' and path similar to '%.definitions.[^.]*.not';
38.4
92
0.752604
197e1694e14d349c800f732601a0862d0ee12c7f
17,690
asm
Assembly
lib/avx2/sha256_oct_avx2.asm
ipuustin/intel-ipsec-mb
2bddb438b1a7791abd84d14a6aebbff36ffeca58
[ "BSD-3-Clause" ]
null
null
null
lib/avx2/sha256_oct_avx2.asm
ipuustin/intel-ipsec-mb
2bddb438b1a7791abd84d14a6aebbff36ffeca58
[ "BSD-3-Clause" ]
null
null
null
lib/avx2/sha256_oct_avx2.asm
ipuustin/intel-ipsec-mb
2bddb438b1a7791abd84d14a6aebbff36ffeca58
[ "BSD-3-Clause" ]
null
null
null
;; ;; Copyright (c) 2012-2020, Intel Corporation ;; ;; Redistribution and use in source and binary forms, with or without ;; modification, are permitted provided that the following conditions are met: ;; ;; * Redistributions of source code must retain the above copyright notice, ;; this list of conditions and the following disclaimer. ;; * Redistributions in binary form must reproduce the above copyright ;; notice, this list of conditions and the following disclaimer in the ;; documentation and/or other materials provided with the distribution. ;; * Neither the name of Intel Corporation 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 COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. ;; ;; code to compute oct SHA256 using SSE-256 ;; outer calling routine takes care of save and restore of XMM registers ;; Logic designed/laid out by JDG ;; Function clobbers: rax, rcx, rdx, rbx, rsi, rdi, r9-r15; ymm0-15 ;; Stack must be aligned to 32 bytes before call ;; Windows clobbers: rax rbx rdx rsi rdi r8 r9 r10 r11 r12 r13 r14 ;; Windows preserves: rcx rbp r15 ;; ;; Linux clobbers: rax rbx rcx rdx rsi r8 r9 r10 r11 r12 r13 r14 ;; Linux preserves: rdi rbp r15 ;; ;; clobbers ymm0-15 %include "include/os.asm" ;%define DO_DBGPRINT %include "include/dbgprint.asm" %include "mb_mgr_datastruct.asm" %include "include/transpose_avx2.asm" %include "include/clear_regs.asm" section .data default rel align 64 ;global K256_8 K256_8: dq 0x428a2f98428a2f98, 0x428a2f98428a2f98 dq 0x428a2f98428a2f98, 0x428a2f98428a2f98 dq 0x7137449171374491, 0x7137449171374491 dq 0x7137449171374491, 0x7137449171374491 dq 0xb5c0fbcfb5c0fbcf, 0xb5c0fbcfb5c0fbcf dq 0xb5c0fbcfb5c0fbcf, 0xb5c0fbcfb5c0fbcf dq 0xe9b5dba5e9b5dba5, 0xe9b5dba5e9b5dba5 dq 0xe9b5dba5e9b5dba5, 0xe9b5dba5e9b5dba5 dq 0x3956c25b3956c25b, 0x3956c25b3956c25b dq 0x3956c25b3956c25b, 0x3956c25b3956c25b dq 0x59f111f159f111f1, 0x59f111f159f111f1 dq 0x59f111f159f111f1, 0x59f111f159f111f1 dq 0x923f82a4923f82a4, 0x923f82a4923f82a4 dq 0x923f82a4923f82a4, 0x923f82a4923f82a4 dq 0xab1c5ed5ab1c5ed5, 0xab1c5ed5ab1c5ed5 dq 0xab1c5ed5ab1c5ed5, 0xab1c5ed5ab1c5ed5 dq 0xd807aa98d807aa98, 0xd807aa98d807aa98 dq 0xd807aa98d807aa98, 0xd807aa98d807aa98 dq 0x12835b0112835b01, 0x12835b0112835b01 dq 0x12835b0112835b01, 0x12835b0112835b01 dq 0x243185be243185be, 0x243185be243185be dq 0x243185be243185be, 0x243185be243185be dq 0x550c7dc3550c7dc3, 0x550c7dc3550c7dc3 dq 0x550c7dc3550c7dc3, 0x550c7dc3550c7dc3 dq 0x72be5d7472be5d74, 0x72be5d7472be5d74 dq 0x72be5d7472be5d74, 0x72be5d7472be5d74 dq 0x80deb1fe80deb1fe, 0x80deb1fe80deb1fe dq 0x80deb1fe80deb1fe, 0x80deb1fe80deb1fe dq 0x9bdc06a79bdc06a7, 0x9bdc06a79bdc06a7 dq 0x9bdc06a79bdc06a7, 0x9bdc06a79bdc06a7 dq 0xc19bf174c19bf174, 0xc19bf174c19bf174 dq 0xc19bf174c19bf174, 0xc19bf174c19bf174 dq 0xe49b69c1e49b69c1, 0xe49b69c1e49b69c1 dq 0xe49b69c1e49b69c1, 0xe49b69c1e49b69c1 dq 0xefbe4786efbe4786, 0xefbe4786efbe4786 dq 0xefbe4786efbe4786, 0xefbe4786efbe4786 dq 0x0fc19dc60fc19dc6, 0x0fc19dc60fc19dc6 dq 0x0fc19dc60fc19dc6, 0x0fc19dc60fc19dc6 dq 0x240ca1cc240ca1cc, 0x240ca1cc240ca1cc dq 0x240ca1cc240ca1cc, 0x240ca1cc240ca1cc dq 0x2de92c6f2de92c6f, 0x2de92c6f2de92c6f dq 0x2de92c6f2de92c6f, 0x2de92c6f2de92c6f dq 0x4a7484aa4a7484aa, 0x4a7484aa4a7484aa dq 0x4a7484aa4a7484aa, 0x4a7484aa4a7484aa dq 0x5cb0a9dc5cb0a9dc, 0x5cb0a9dc5cb0a9dc dq 0x5cb0a9dc5cb0a9dc, 0x5cb0a9dc5cb0a9dc dq 0x76f988da76f988da, 0x76f988da76f988da dq 0x76f988da76f988da, 0x76f988da76f988da dq 0x983e5152983e5152, 0x983e5152983e5152 dq 0x983e5152983e5152, 0x983e5152983e5152 dq 0xa831c66da831c66d, 0xa831c66da831c66d dq 0xa831c66da831c66d, 0xa831c66da831c66d dq 0xb00327c8b00327c8, 0xb00327c8b00327c8 dq 0xb00327c8b00327c8, 0xb00327c8b00327c8 dq 0xbf597fc7bf597fc7, 0xbf597fc7bf597fc7 dq 0xbf597fc7bf597fc7, 0xbf597fc7bf597fc7 dq 0xc6e00bf3c6e00bf3, 0xc6e00bf3c6e00bf3 dq 0xc6e00bf3c6e00bf3, 0xc6e00bf3c6e00bf3 dq 0xd5a79147d5a79147, 0xd5a79147d5a79147 dq 0xd5a79147d5a79147, 0xd5a79147d5a79147 dq 0x06ca635106ca6351, 0x06ca635106ca6351 dq 0x06ca635106ca6351, 0x06ca635106ca6351 dq 0x1429296714292967, 0x1429296714292967 dq 0x1429296714292967, 0x1429296714292967 dq 0x27b70a8527b70a85, 0x27b70a8527b70a85 dq 0x27b70a8527b70a85, 0x27b70a8527b70a85 dq 0x2e1b21382e1b2138, 0x2e1b21382e1b2138 dq 0x2e1b21382e1b2138, 0x2e1b21382e1b2138 dq 0x4d2c6dfc4d2c6dfc, 0x4d2c6dfc4d2c6dfc dq 0x4d2c6dfc4d2c6dfc, 0x4d2c6dfc4d2c6dfc dq 0x53380d1353380d13, 0x53380d1353380d13 dq 0x53380d1353380d13, 0x53380d1353380d13 dq 0x650a7354650a7354, 0x650a7354650a7354 dq 0x650a7354650a7354, 0x650a7354650a7354 dq 0x766a0abb766a0abb, 0x766a0abb766a0abb dq 0x766a0abb766a0abb, 0x766a0abb766a0abb dq 0x81c2c92e81c2c92e, 0x81c2c92e81c2c92e dq 0x81c2c92e81c2c92e, 0x81c2c92e81c2c92e dq 0x92722c8592722c85, 0x92722c8592722c85 dq 0x92722c8592722c85, 0x92722c8592722c85 dq 0xa2bfe8a1a2bfe8a1, 0xa2bfe8a1a2bfe8a1 dq 0xa2bfe8a1a2bfe8a1, 0xa2bfe8a1a2bfe8a1 dq 0xa81a664ba81a664b, 0xa81a664ba81a664b dq 0xa81a664ba81a664b, 0xa81a664ba81a664b dq 0xc24b8b70c24b8b70, 0xc24b8b70c24b8b70 dq 0xc24b8b70c24b8b70, 0xc24b8b70c24b8b70 dq 0xc76c51a3c76c51a3, 0xc76c51a3c76c51a3 dq 0xc76c51a3c76c51a3, 0xc76c51a3c76c51a3 dq 0xd192e819d192e819, 0xd192e819d192e819 dq 0xd192e819d192e819, 0xd192e819d192e819 dq 0xd6990624d6990624, 0xd6990624d6990624 dq 0xd6990624d6990624, 0xd6990624d6990624 dq 0xf40e3585f40e3585, 0xf40e3585f40e3585 dq 0xf40e3585f40e3585, 0xf40e3585f40e3585 dq 0x106aa070106aa070, 0x106aa070106aa070 dq 0x106aa070106aa070, 0x106aa070106aa070 dq 0x19a4c11619a4c116, 0x19a4c11619a4c116 dq 0x19a4c11619a4c116, 0x19a4c11619a4c116 dq 0x1e376c081e376c08, 0x1e376c081e376c08 dq 0x1e376c081e376c08, 0x1e376c081e376c08 dq 0x2748774c2748774c, 0x2748774c2748774c dq 0x2748774c2748774c, 0x2748774c2748774c dq 0x34b0bcb534b0bcb5, 0x34b0bcb534b0bcb5 dq 0x34b0bcb534b0bcb5, 0x34b0bcb534b0bcb5 dq 0x391c0cb3391c0cb3, 0x391c0cb3391c0cb3 dq 0x391c0cb3391c0cb3, 0x391c0cb3391c0cb3 dq 0x4ed8aa4a4ed8aa4a, 0x4ed8aa4a4ed8aa4a dq 0x4ed8aa4a4ed8aa4a, 0x4ed8aa4a4ed8aa4a dq 0x5b9cca4f5b9cca4f, 0x5b9cca4f5b9cca4f dq 0x5b9cca4f5b9cca4f, 0x5b9cca4f5b9cca4f dq 0x682e6ff3682e6ff3, 0x682e6ff3682e6ff3 dq 0x682e6ff3682e6ff3, 0x682e6ff3682e6ff3 dq 0x748f82ee748f82ee, 0x748f82ee748f82ee dq 0x748f82ee748f82ee, 0x748f82ee748f82ee dq 0x78a5636f78a5636f, 0x78a5636f78a5636f dq 0x78a5636f78a5636f, 0x78a5636f78a5636f dq 0x84c8781484c87814, 0x84c8781484c87814 dq 0x84c8781484c87814, 0x84c8781484c87814 dq 0x8cc702088cc70208, 0x8cc702088cc70208 dq 0x8cc702088cc70208, 0x8cc702088cc70208 dq 0x90befffa90befffa, 0x90befffa90befffa dq 0x90befffa90befffa, 0x90befffa90befffa dq 0xa4506ceba4506ceb, 0xa4506ceba4506ceb dq 0xa4506ceba4506ceb, 0xa4506ceba4506ceb dq 0xbef9a3f7bef9a3f7, 0xbef9a3f7bef9a3f7 dq 0xbef9a3f7bef9a3f7, 0xbef9a3f7bef9a3f7 dq 0xc67178f2c67178f2, 0xc67178f2c67178f2 dq 0xc67178f2c67178f2, 0xc67178f2c67178f2 PSHUFFLE_BYTE_FLIP_MASK: ;ddq 0x0c0d0e0f08090a0b0405060700010203 ;ddq 0x0c0d0e0f08090a0b0405060700010203 dq 0x0405060700010203, 0x0c0d0e0f08090a0b dq 0x0405060700010203, 0x0c0d0e0f08090a0b align 64 MKGLOBAL(K256,data,internal) K256: dd 0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5 dd 0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5 dd 0xd807aa98,0x12835b01,0x243185be,0x550c7dc3 dd 0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174 dd 0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc dd 0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da dd 0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7 dd 0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967 dd 0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13 dd 0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85 dd 0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3 dd 0xd192e819,0xd6990624,0xf40e3585,0x106aa070 dd 0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5 dd 0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3 dd 0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208 dd 0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2 section .text %ifdef LINUX %define arg1 rdi %define arg2 rsi %define reg3 rcx %define reg4 rdx %else ; Windows definitions %define arg1 rcx %define arg2 rdx %define reg3 rsi %define reg4 rdi %endif ; Common definitions %define STATE arg1 %define INP_SIZE arg2 %define IDX rax %define ROUND rbx %define TBL reg3 %define inp0 r9 %define inp1 r10 %define inp2 r11 %define inp3 r12 %define inp4 r13 %define inp5 r14 %define inp6 r8 %define inp7 reg4 ; ymm0 a ; ymm1 b ; ymm2 c ; ymm3 d ; ymm4 e ; ymm5 f ; ymm6 g TMP0 ; ymm7 h TMP1 ; ymm8 T1 TT0 ; ymm9 TT1 ; ymm10 TT2 ; ymm11 TT3 ; ymm12 a0 TT4 ; ymm13 a1 TT5 ; ymm14 a2 TT6 ; ymm15 TMP TT7 %define a ymm0 %define b ymm1 %define c ymm2 %define d ymm3 %define e ymm4 %define f ymm5 %define g ymm6 %define h ymm7 %define T1 ymm8 %define a0 ymm12 %define a1 ymm13 %define a2 ymm14 %define TMP ymm15 %define TMP0 ymm6 %define TMP1 ymm7 %define TT0 ymm8 %define TT1 ymm9 %define TT2 ymm10 %define TT3 ymm11 %define TT4 ymm12 %define TT5 ymm13 %define TT6 ymm14 %define TT7 ymm15 %define SZ8 8*SHA256_DIGEST_WORD_SIZE ; Size of one vector register %define ROUNDS 64*SZ8 ; Define stack usage ;; Assume stack aligned to 32 bytes before call ;; Therefore FRAMESZ mod 32 must be 32-8 = 24 struc stack_frame .data resb 16*SZ8 .digest resb 8*SZ8 .ytmp resb 4*SZ8 .align resb 24 endstruc %define FRAMESZ stack_frame_size %define _DIGEST stack_frame.digest %define _YTMP stack_frame.ytmp %define YTMP0 rsp + _YTMP + 0*SZ8 %define YTMP1 rsp + _YTMP + 1*SZ8 %define YTMP2 rsp + _YTMP + 2*SZ8 %define YTMP3 rsp + _YTMP + 3*SZ8 %define VMOVPS vmovups %macro ROTATE_ARGS 0 %xdefine TMP_ h %xdefine h g %xdefine g f %xdefine f e %xdefine e d %xdefine d c %xdefine c b %xdefine b a %xdefine a TMP_ %endm ; PRORD reg, imm, tmp %macro PRORD 3 %define %%reg %1 %define %%imm %2 %define %%tmp %3 vpslld %%tmp, %%reg, (32-(%%imm)) vpsrld %%reg, %%reg, %%imm vpor %%reg, %%reg, %%tmp %endmacro ; non-destructive ; PRORD_nd reg, imm, tmp, src %macro PRORD_nd 4 %define %%reg %1 %define %%imm %2 %define %%tmp %3 %define %%src %4 ;vmovdqa %%tmp, %%reg vpslld %%tmp, %%src, (32-(%%imm)) vpsrld %%reg, %%src, %%imm vpor %%reg, %%reg, %%tmp %endmacro ; PRORD dst/src, amt %macro PRORD 2 PRORD %1, %2, TMP %endmacro ; PRORD_nd dst, src, amt %macro PRORD_nd 3 PRORD_nd %1, %3, TMP, %2 %endmacro ;; arguments passed implicitly in preprocessor symbols i, a...h %macro ROUND_00_15 2 %define %%T1 %1 %define %%i %2 PRORD_nd a0, e, (11-6) ; sig1: a0 = (e >> 5) vpxor a2, f, g ; ch: a2 = f^g vpand a2, a2, e ; ch: a2 = (f^g)&e vpxor a2, a2, g ; a2 = ch PRORD_nd a1, e, 25 ; sig1: a1 = (e >> 25) vmovdqa [SZ8*(%%i&0xf) + rsp], %%T1 vpaddd %%T1, %%T1, [TBL + ROUND] ; T1 = W + K vpxor a0, a0, e ; sig1: a0 = e ^ (e >> 5) PRORD a0, 6 ; sig1: a0 = (e >> 6) ^ (e >> 11) vpaddd h, h, a2 ; h = h + ch PRORD_nd a2, a, (13-2) ; sig0: a2 = (a >> 11) vpaddd h, h, %%T1 ; h = h + ch + W + K vpxor a0, a0, a1 ; a0 = sigma1 PRORD_nd a1, a, 22 ; sig0: a1 = (a >> 22) vpxor %%T1, a, c ; maj: T1 = a^c add ROUND, SZ8 ; ROUND++ vpand %%T1, %%T1, b ; maj: T1 = (a^c)&b vpaddd h, h, a0 vpaddd d, d, h vpxor a2, a2, a ; sig0: a2 = a ^ (a >> 11) PRORD a2, 2 ; sig0: a2 = (a >> 2) ^ (a >> 13) vpxor a2, a2, a1 ; a2 = sig0 vpand a1, a, c ; maj: a1 = a&c vpor a1, a1, %%T1 ; a1 = maj vpaddd h, h, a1 ; h = h + ch + W + K + maj vpaddd h, h, a2 ; h = h + ch + W + K + maj + sigma0 ROTATE_ARGS %endm ;; arguments passed implicitly in preprocessor symbols i, a...h %macro ROUND_16_XX 2 %define %%T1 %1 %define %%i %2 vmovdqa %%T1, [SZ8*((%%i-15)&0xf) + rsp] vmovdqa a1, [SZ8*((%%i-2)&0xf) + rsp] vmovdqa a0, %%T1 PRORD %%T1, 18-7 vmovdqa a2, a1 PRORD a1, 19-17 vpxor %%T1, %%T1, a0 PRORD %%T1, 7 vpxor a1, a1, a2 PRORD a1, 17 vpsrld a0, a0, 3 vpxor %%T1, %%T1, a0 vpsrld a2, a2, 10 vpxor a1, a1, a2 vpaddd %%T1, %%T1, [SZ8*((%%i-16)&0xf) + rsp] vpaddd a1, a1, [SZ8*((%%i-7)&0xf) + rsp] vpaddd %%T1, %%T1, a1 ROUND_00_15 %%T1, %%i %endm ;; SHA256_ARGS: ;; UINT128 digest[8]; // transposed digests ;; UINT8 *data_ptr[4]; ;; ;; void sha256_oct_avx2(SHA256_ARGS *args, UINT64 bytes); ;; arg 1 : STATE : pointer to array of pointers to input data ;; arg 2 : INP_SIZE : size of input in blocks MKGLOBAL(sha256_oct_avx2,function,internal) align 16 sha256_oct_avx2: ; general registers preserved in outer calling routine ; outer calling routine saves all the XMM registers sub rsp, FRAMESZ ;; Load the pre-transposed incoming digest. vmovdqu a,[STATE + 0*SHA256_DIGEST_ROW_SIZE] vmovdqu b,[STATE + 1*SHA256_DIGEST_ROW_SIZE] vmovdqu c,[STATE + 2*SHA256_DIGEST_ROW_SIZE] vmovdqu d,[STATE + 3*SHA256_DIGEST_ROW_SIZE] vmovdqu e,[STATE + 4*SHA256_DIGEST_ROW_SIZE] vmovdqu f,[STATE + 5*SHA256_DIGEST_ROW_SIZE] vmovdqu g,[STATE + 6*SHA256_DIGEST_ROW_SIZE] vmovdqu h,[STATE + 7*SHA256_DIGEST_ROW_SIZE] lea TBL,[rel K256_8] ;; load the address of each of the 4 message lanes ;; getting ready to transpose input onto stack mov inp0,[STATE + _data_ptr_sha256 + 0*PTR_SZ] mov inp1,[STATE + _data_ptr_sha256 + 1*PTR_SZ] mov inp2,[STATE + _data_ptr_sha256 + 2*PTR_SZ] mov inp3,[STATE + _data_ptr_sha256 + 3*PTR_SZ] mov inp4,[STATE + _data_ptr_sha256 + 4*PTR_SZ] mov inp5,[STATE + _data_ptr_sha256 + 5*PTR_SZ] mov inp6,[STATE + _data_ptr_sha256 + 6*PTR_SZ] mov inp7,[STATE + _data_ptr_sha256 + 7*PTR_SZ] xor IDX, IDX lloop: xor ROUND, ROUND ;; save old digest vmovdqa [rsp + _DIGEST + 0*SZ8], a vmovdqa [rsp + _DIGEST + 1*SZ8], b vmovdqa [rsp + _DIGEST + 2*SZ8], c vmovdqa [rsp + _DIGEST + 3*SZ8], d vmovdqa [rsp + _DIGEST + 4*SZ8], e vmovdqa [rsp + _DIGEST + 5*SZ8], f vmovdqa [rsp + _DIGEST + 6*SZ8], g vmovdqa [rsp + _DIGEST + 7*SZ8], h DBGPRINTL_YMM "transposed digest ", a,b,c,d,e,f,g,h %assign i 0 %rep 2 TRANSPOSE8_U32_LOAD8 TT0, TT1, TT2, TT3, TT4, TT5, TT6, TT7, \ inp0, inp1, inp2, inp3, inp4, inp5, \ inp6, inp7, IDX+i*32 vmovdqa [YTMP0], g vmovdqa [YTMP1], h TRANSPOSE8_U32_PRELOADED TT0, TT1, TT2, TT3, TT4, TT5, TT6, TT7, TMP0, TMP1 DBGPRINTL_YMM "transposed input ", TT0, TT1, TT2, TT3, TT4, TT5, TT6, TT7 vmovdqa TMP1, [rel PSHUFFLE_BYTE_FLIP_MASK] vmovdqa g, [YTMP0] vpshufb TT0, TT0, TMP1 vpshufb TT1, TT1, TMP1 vpshufb TT2, TT2, TMP1 vpshufb TT3, TT3, TMP1 vpshufb TT4, TT4, TMP1 vpshufb TT5, TT5, TMP1 vpshufb TT6, TT6, TMP1 vpshufb TT7, TT7, TMP1 vmovdqa h, [YTMP1] vmovdqa [YTMP0], TT4 vmovdqa [YTMP1], TT5 vmovdqa [YTMP2], TT6 vmovdqa [YTMP3], TT7 ROUND_00_15 TT0,(i*8+0) vmovdqa TT0, [YTMP0] ROUND_00_15 TT1,(i*8+1) vmovdqa TT1, [YTMP1] ROUND_00_15 TT2,(i*8+2) vmovdqa TT2, [YTMP2] ROUND_00_15 TT3,(i*8+3) vmovdqa TT3, [YTMP3] ROUND_00_15 TT0,(i*8+4) ROUND_00_15 TT1,(i*8+5) ROUND_00_15 TT2,(i*8+6) ROUND_00_15 TT3,(i*8+7) %assign i (i+1) %endrep add IDX, 4*4*4 %assign i (i*8) jmp Lrounds_16_xx align 16 Lrounds_16_xx: %rep 16 ROUND_16_XX T1, i %assign i (i+1) %endrep cmp ROUND,ROUNDS jb Lrounds_16_xx ;; add old digest vpaddd a, a, [rsp + _DIGEST + 0*SZ8] vpaddd b, b, [rsp + _DIGEST + 1*SZ8] vpaddd c, c, [rsp + _DIGEST + 2*SZ8] vpaddd d, d, [rsp + _DIGEST + 3*SZ8] vpaddd e, e, [rsp + _DIGEST + 4*SZ8] vpaddd f, f, [rsp + _DIGEST + 5*SZ8] vpaddd g, g, [rsp + _DIGEST + 6*SZ8] vpaddd h, h, [rsp + _DIGEST + 7*SZ8] sub INP_SIZE, 1 ;; unit is blocks jne lloop ; write back to memory (state object) the transposed digest vmovdqu [STATE + 0*SHA256_DIGEST_ROW_SIZE],a vmovdqu [STATE + 1*SHA256_DIGEST_ROW_SIZE],b vmovdqu [STATE + 2*SHA256_DIGEST_ROW_SIZE],c vmovdqu [STATE + 3*SHA256_DIGEST_ROW_SIZE],d vmovdqu [STATE + 4*SHA256_DIGEST_ROW_SIZE],e vmovdqu [STATE + 5*SHA256_DIGEST_ROW_SIZE],f vmovdqu [STATE + 6*SHA256_DIGEST_ROW_SIZE],g vmovdqu [STATE + 7*SHA256_DIGEST_ROW_SIZE],h DBGPRINTL_YMM "sha256 digest on exit ", a,b,c,d,e,f,g,h ; update input pointers add inp0, IDX mov [STATE + _data_ptr_sha256 + 0*8], inp0 add inp1, IDX mov [STATE + _data_ptr_sha256 + 1*8], inp1 add inp2, IDX mov [STATE + _data_ptr_sha256 + 2*8], inp2 add inp3, IDX mov [STATE + _data_ptr_sha256 + 3*8], inp3 add inp4, IDX mov [STATE + _data_ptr_sha256 + 4*8], inp4 add inp5, IDX mov [STATE + _data_ptr_sha256 + 5*8], inp5 add inp6, IDX mov [STATE + _data_ptr_sha256 + 6*8], inp6 add inp7, IDX mov [STATE + _data_ptr_sha256 + 7*8], inp7 ;;;;;;;;;;;;;;;; ;; Postamble %ifdef SAFE_DATA ;; Clear stack frame ((16+8+4)*32 bytes) clear_all_ymms_asm %assign i 0 %rep (16+8+4) vmovdqa [rsp + i*SZ8], ymm0 %assign i (i+1) %endrep %endif add rsp, FRAMESZ ret %ifdef LINUX section .note.GNU-stack noalloc noexec nowrite progbits %endif
30.033956
81
0.749237
b7591989c58e94141c3d37919cc61a1bf52502f4
562
cs
C#
source/cltrigger/Configuration/TriggerConfig.cs
corlib/trigger
c8b993b3b2c7f4d7a22f6023b8b66f5b65dc4f52
[ "MIT" ]
null
null
null
source/cltrigger/Configuration/TriggerConfig.cs
corlib/trigger
c8b993b3b2c7f4d7a22f6023b8b66f5b65dc4f52
[ "MIT" ]
null
null
null
source/cltrigger/Configuration/TriggerConfig.cs
corlib/trigger
c8b993b3b2c7f4d7a22f6023b8b66f5b65dc4f52
[ "MIT" ]
null
null
null
 namespace Corlib.Configuration { public class TriggerConfig { public string TriggerFile { get; set; } public ProcessAction ProcessAction { get; set; } public TriggerType GetTriggerType () { if (!string.IsNullOrWhiteSpace (TriggerFile)) return TriggerType.File; return TriggerType.Undefined; } public ActionType GetActionType () { if (null != ProcessAction) return ActionType.Process; return ActionType.Undefined; } } }
24.434783
57
0.587189