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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4430316763265d3d00b12bb867411ea6f2cfb360 | 879 | sql | SQL | okapia/assets/config/init.sql | soleverlee/ben | d5ffbf9b4e7387a6b05a624a100c183306fcd872 | [
"BSD-3-Clause"
] | 1 | 2020-09-03T18:15:56.000Z | 2020-09-03T18:15:56.000Z | okapia/assets/config/init.sql | soleverlee/ben | d5ffbf9b4e7387a6b05a624a100c183306fcd872 | [
"BSD-3-Clause"
] | null | null | null | okapia/assets/config/init.sql | soleverlee/ben | d5ffbf9b4e7387a6b05a624a100c183306fcd872 | [
"BSD-3-Clause"
] | null | null | null | create table meta_data(
id int not null primary key,
content BLOB not null
);
create table structured_item(
id TEXT not null primary key,
type int not null,
meta BLOB not null,
content BLOB not null
);
create table album(
id TEXT not null primary key,
content BLOB not null
);
-- https://github.com/tekartik/sqflite/issues/270
-- Although you can store the image in the database you cannot retrieve it
-- from the database because it is too large to fit into a CursorWindow
-- which has a limitation of 2MB (2097152).
create table image(
id TEXT not null primary key,
album_id TEXT not null,
meta BLOB not null,
content BLOB not null
);
create table tile(
id TEXT not null primary key,
content BLOB not null
);
create table contact(
id TEXT not null primary key,
name TEXT not null,
public_key TEXT not null,
fingerprint TEXT not null
); | 21.975 | 74 | 0.731513 |
a6d11c7e3e4fa41617a8046e576a744344c374d9 | 98 | sql | SQL | src/test/resources/sql/drop_table/89d828f7.sql | Shuttl-Tech/antlr_psql | fcf83192300abe723f3fd3709aff5b0c8118ad12 | [
"MIT"
] | 66 | 2018-06-15T11:34:03.000Z | 2022-03-16T09:24:49.000Z | src/test/resources/sql/drop_table/89d828f7.sql | Shuttl-Tech/antlr_psql | fcf83192300abe723f3fd3709aff5b0c8118ad12 | [
"MIT"
] | 13 | 2019-03-19T11:56:28.000Z | 2020-08-05T04:20:50.000Z | src/test/resources/sql/drop_table/89d828f7.sql | Shuttl-Tech/antlr_psql | fcf83192300abe723f3fd3709aff5b0c8118ad12 | [
"MIT"
] | 28 | 2019-01-05T19:59:02.000Z | 2022-03-24T11:55:50.000Z | -- file:updatable_views.sql ln:637 expect:true
DROP TABLE base_tbl_parent, base_tbl_child CASCADE
| 32.666667 | 50 | 0.836735 |
a54d146d8484063eb7e502c3602ac136b9b39724 | 224 | kt | Kotlin | MaterialExample/app/src/main/java/com/example/materialexample/Sports.kt | sad786/AndroidProjects | b87caf8ac3668f96629677ed5342b89ac151629a | [
"MIT"
] | null | null | null | MaterialExample/app/src/main/java/com/example/materialexample/Sports.kt | sad786/AndroidProjects | b87caf8ac3668f96629677ed5342b89ac151629a | [
"MIT"
] | null | null | null | MaterialExample/app/src/main/java/com/example/materialexample/Sports.kt | sad786/AndroidProjects | b87caf8ac3668f96629677ed5342b89ac151629a | [
"MIT"
] | null | null | null | package com.example.materialexample
class Sports(private val title:String,private val info:String, private val imageResource:Int)
{
fun getResource() = imageResource
fun getTitle() = title
fun getInfo() = info
} | 28 | 93 | 0.745536 |
f74b733b0aaf1091bfa526972af364dcd834a648 | 771 | h | C | System/Library/PrivateFrameworks/CalendarDaemon.framework/CalendarDaemon-Structs.h | lechium/iOS1351Headers | 6bed3dada5ffc20366b27f7f2300a24a48a6284e | [
"MIT"
] | 2 | 2021-11-02T09:23:27.000Z | 2022-03-28T08:21:57.000Z | System/Library/PrivateFrameworks/CalendarDaemon.framework/CalendarDaemon-Structs.h | lechium/iOS1351Headers | 6bed3dada5ffc20366b27f7f2300a24a48a6284e | [
"MIT"
] | null | null | null | System/Library/PrivateFrameworks/CalendarDaemon.framework/CalendarDaemon-Structs.h | lechium/iOS1351Headers | 6bed3dada5ffc20366b27f7f2300a24a48a6284e | [
"MIT"
] | 1 | 2022-03-28T08:21:59.000Z | 2022-03-28T08:21:59.000Z | /*
* This header is generated by classdump-dyld 1.5
* on Friday, April 30, 2021 at 11:37:00 AM Mountain Standard Time
* Operating System: Version 13.5.1 (Build 17F80)
* Image Source: /System/Library/PrivateFrameworks/CalendarDaemon.framework/CalendarDaemon
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. Updated by Kevin Bradley.
*/
typedef struct _NSZone* NSZoneRef;
typedef struct CalEventOccurrence* CalEventOccurrenceRef;
typedef struct __CFSet* CFSetRef;
typedef struct __CFArray* CFArrayRef;
typedef struct {
unsigned val[8];
} SCD_Struct_Cl4;
typedef struct CalFilter* CalFilterRef;
| 33.521739 | 130 | 0.648508 |
dfb2db6974f5ba710a0d2e12fe8e532944159d73 | 1,563 | ts | TypeScript | src/store/modules/review.ts | Company-Report-Explorer/frontend | af2c4496873d9ab8fe8b34b0c94a73a4131eefe6 | [
"MIT"
] | null | null | null | src/store/modules/review.ts | Company-Report-Explorer/frontend | af2c4496873d9ab8fe8b34b0c94a73a4131eefe6 | [
"MIT"
] | 10 | 2022-01-20T13:10:11.000Z | 2022-02-15T00:52:00.000Z | src/store/modules/review.ts | Company-Report-Explorer/frontend | af2c4496873d9ab8fe8b34b0c94a73a4131eefe6 | [
"MIT"
] | null | null | null | import { Commit } from "vuex";
import { callReviewApi } from "@/api/review";
import { ReviewState, ReviewResult } from "@/models/review";
const state: ReviewState = {
reviews: [],
isEnd: false,
};
const getters = {
allReviews: (state: ReviewState) => state.reviews,
isAllReviews: (state: ReviewState) => state.isEnd,
};
const actions = {
async fetchReviews(
{ commit }: { commit: Commit },
{
bookId,
query,
}: {
bookId: string;
query: string;
}
) {
const response = await callReviewApi(bookId, 0, query);
commit("setReviews", response.reviews);
commit("setIsAllReviews", response.isEnd);
},
async lazyLoadReviews(
{ commit }: { commit: Commit },
{
bookId,
offset,
query,
}: {
bookId: string;
offset: number;
query: string;
}
) {
const response = await callReviewApi(bookId, offset, query);
commit("lazyReviews", response.reviews);
commit("setIsAllReviews", response.isEnd);
},
async clearReviews({ commit }: { commit: Commit }) {
commit("clear");
},
};
const mutations = {
setReviews: (state: ReviewState, reviews: ReviewResult[]) =>
(state.reviews = reviews),
lazyReviews: (state: ReviewState, reviews: ReviewResult[]) =>
state.reviews.push(...reviews),
setIsAllReviews: (state: ReviewState, isEnd: boolean) =>
(state.isEnd = isEnd),
clear: (state: ReviewState) => {
state.reviews = [];
state.isEnd = false;
},
};
export default {
state,
getters,
actions,
mutations,
};
| 20.84 | 64 | 0.611644 |
50786b59df61cc69d715b38e1f28446640965e57 | 2,056 | go | Go | cmd/info.go | pavelhadzhiev/story-builder | 264c13edc7509f659d5ae4dde2f031ecfc3190a4 | [
"Apache-2.0"
] | null | null | null | cmd/info.go | pavelhadzhiev/story-builder | 264c13edc7509f659d5ae4dde2f031ecfc3190a4 | [
"Apache-2.0"
] | null | null | null | cmd/info.go | pavelhadzhiev/story-builder | 264c13edc7509f659d5ae4dde2f031ecfc3190a4 | [
"Apache-2.0"
] | null | null | null | // Copyright © 2019 Pavel Hadzhiev <p.hadzhiev96@gmail.com>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package cmd
import (
"fmt"
"github.com/pavelhadzhiev/story-builder/pkg/util"
"github.com/spf13/cobra"
)
// InfoCmd is a wrapper for the story-builder info command
type InfoCmd struct {
*Context
}
// Command builds and returns a cobra command that will be added to the root command
func (ic *InfoCmd) Command() *cobra.Command {
result := ic.buildCommand()
return result
}
// Run is used to build the RunE function for the cobra command
func (ic *InfoCmd) Run() error {
cfg, err := ic.Configurator.Load()
if err != nil {
fmt.Println("You don't have a valid configuration.")
return nil
}
if cfg.URL == "" {
fmt.Println("You are not connected to a server.")
return nil
}
fmt.Println("Server:", cfg.URL)
if cfg.Authorization == "" {
fmt.Println("You are not logged in.")
return nil
}
user, err := util.ExtractUsernameFromAuthorizationHeader(cfg.Authorization)
if err != nil {
fmt.Println("You are not logged in.")
return nil
}
fmt.Println("User:", user)
if cfg.Room == "" {
fmt.Println("You have not joined a room.")
return nil
}
fmt.Println("Room:", cfg.Room)
return nil
}
func (ic *InfoCmd) buildCommand() *cobra.Command {
var infoCmd = &cobra.Command{
Use: "info",
Short: "Outputs information about the server, user and joined room.",
Long: "Outputs information about the server, user and joined room.",
PreRunE: PreRunE(ic),
RunE: RunE(ic),
}
return infoCmd
}
| 25.7 | 84 | 0.700389 |
0bcf4640f16c8a4f10846c3ab69ea83a45d243b9 | 55 | js | JavaScript | node_modules/styled-icons/boxicons-solid/AlarmOff/AlarmOff.esm.js | chs6558/chs6558.github.io | 32dd0275105d1db5b085d3162126b0e847ec9c16 | [
"MIT"
] | null | null | null | node_modules/styled-icons/boxicons-solid/AlarmOff/AlarmOff.esm.js | chs6558/chs6558.github.io | 32dd0275105d1db5b085d3162126b0e847ec9c16 | [
"MIT"
] | null | null | null | node_modules/styled-icons/boxicons-solid/AlarmOff/AlarmOff.esm.js | chs6558/chs6558.github.io | 32dd0275105d1db5b085d3162126b0e847ec9c16 | [
"MIT"
] | null | null | null | export * from '@styled-icons/boxicons-solid/AlarmOff';
| 27.5 | 54 | 0.763636 |
7f78e2557dca18ece493bcf0aae16cdfb201ab4e | 125 | go | Go | go/web/handler/openapi/water.go | ikemoti/F_2002_1 | 8d020af6f092155ec9975f9482ea4c277370520c | [
"MIT"
] | null | null | null | go/web/handler/openapi/water.go | ikemoti/F_2002_1 | 8d020af6f092155ec9975f9482ea4c277370520c | [
"MIT"
] | 34 | 2020-11-01T15:25:59.000Z | 2020-11-19T15:42:08.000Z | go/web/handler/openapi/water.go | ikemoti/F_2002_1 | 8d020af6f092155ec9975f9482ea4c277370520c | [
"MIT"
] | 1 | 2020-11-07T04:07:27.000Z | 2020-11-07T04:07:27.000Z | package openapi
type Water struct {
Id int `json:"id"`
Name string `json:"name"`
Value float32 `json:"value"`
}
| 15.625 | 29 | 0.632 |
7a6f39d1444ad908cac335efed670e3d7b7ecf8b | 2,593 | rb | Ruby | app/models/pb_core_instantiation.rb | WGBH/AAPB2 | 18b0de023d3c09f8f750f53f28a7695ac9dfa8d5 | [
"Apache-2.0"
] | 11 | 2015-03-24T09:37:59.000Z | 2018-09-11T21:19:26.000Z | app/models/pb_core_instantiation.rb | WGBH/AAPB2 | 18b0de023d3c09f8f750f53f28a7695ac9dfa8d5 | [
"Apache-2.0"
] | 1,209 | 2015-01-05T19:51:15.000Z | 2019-07-08T14:48:19.000Z | app/models/pb_core_instantiation.rb | WGBH/AAPB2 | 18b0de023d3c09f8f750f53f28a7695ac9dfa8d5 | [
"Apache-2.0"
] | 6 | 2015-08-18T13:51:33.000Z | 2019-02-09T22:58:55.000Z | class PBCoreInstantiation
def initialize(rexml_or_media_type, duration = nil)
# Not sure why we're using conditional logic on duration, so
# leaving that as-is, but should probably rethink.
if duration
@media_type = rexml_or_media_type
@duration = duration
else
@rexml = rexml_or_media_type
@organization = organization
@identifier = identifier
@identifier_source = identifier_source
end
end
def ==(other)
self.class == other.class &&
media_type == other.media_type &&
duration == other.duration
end
def media_type
@media_type ||= optional('instantiationMediaType')
end
def duration
@duration ||= begin
dur = optional('instantiationEssenceTrack/essenceTrackDuration')
return dur if dur
optional('instantiationDuration')
end
end
def aspect_ratio
@aspect_ratio ||= optional('instantiationEssenceTrack/essenceTrackAspectRatio')
end
def organization
@organization ||= annotation_element('organization')
end
def identifier
@identifier ||= optional('instantiationIdentifier')
end
def identifier_source
@identifier_source ||= optional_element_attribute('instantiationIdentifier', 'source')
end
def identifier_display
"#{identifier} (#{identifier_source})"
end
def generations
@generations ||= optional('instantiationGenerations')
end
def colors
@colors ||= optional('instantiationColors')
end
def format
@format ||= read_format
end
def annotations
@annotations ||= multiple_optional('instantiationAnnotation').reject { |e| e if e.attributes.values.map(&:value).include?('organization') }.map(&:text)
end
def display_text_fields
@display_text ||= { identifier: identifier_display, format: format, generation: generations, color: colors, duration: duration }.compact
end
private
def optional(xpath)
match = REXML::XPath.match(@rexml, xpath).first
match ? match.text : nil
end
def multiple_optional(xpath)
matches = REXML::XPath.match(@rexml, xpath)
matches ? matches : nil
end
def annotation_element(type)
optional("instantiationAnnotation[@annotationType=\"#{type}\"]")
end
def optional_element_attribute(xpath, attribute)
match = REXML::XPath.match(@rexml, xpath).first.attributes[attribute.to_s]
match ? match : nil
end
def read_format
return optional('instantiationDigital') unless optional('instantiationDigital').nil?
return optional('instantiationPhysical') unless optional('instantiationPhysical').nil?
nil
end
end
| 25.673267 | 155 | 0.709988 |
39bb5facf24ba2a0c9306c173524de18d011d3cf | 281 | asm | Assembly | programs/oeis/173/A173036.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/173/A173036.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/173/A173036.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A173036: a(n) = binomial(n+1, 2) + 13.
; 13,14,16,19,23,28,34,41,49,58,68,79,91,104,118,133,149,166,184,203,223,244,266,289,313,338,364,391,419,448,478,509,541,574,608,643,679,716,754,793,833,874,916,959,1003,1048,1094,1141,1189,1238,1288,1339,1391
sub $1,$0
bin $1,2
add $1,13
| 40.142857 | 209 | 0.686833 |
127c1d7bdc49650a3bb20c2c21ffc7ed569787b0 | 2,413 | h | C | mpc5746r_sdk_demo/mpc5746r_sdk_demo_Z4_1/Sources/can.h | lawdon/NXP_MPC57XX_Demo | e275c57759f382bcc492a4fec29cc25adf6b7feb | [
"MIT"
] | null | null | null | mpc5746r_sdk_demo/mpc5746r_sdk_demo_Z4_1/Sources/can.h | lawdon/NXP_MPC57XX_Demo | e275c57759f382bcc492a4fec29cc25adf6b7feb | [
"MIT"
] | null | null | null | mpc5746r_sdk_demo/mpc5746r_sdk_demo_Z4_1/Sources/can.h | lawdon/NXP_MPC57XX_Demo | e275c57759f382bcc492a4fec29cc25adf6b7feb | [
"MIT"
] | null | null | null | /*
* Copyright (c) 2013 - 2015, Freescale Semiconductor, Inc.
* Copyright 2016-2019 NXP
* All rights reserved.
*
* THIS SOFTWARE IS PROVIDED BY NXP "AS IS" AND ANY EXPRESSED 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 NXP OR ITS 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.
*/
/* ###################################################################
** Filename : can.c/h
** Processor : MPC57xx
** Abstract :
** CAN module.
** This module contains CAN initialization.
** Settings :
** Contents :
** No public methods
**
** ###################################################################*/
/*!
** @file can.c/h
** @version 01.00
** @brief
** CAN module.
** This module contains CAN initialization.
*/
#ifndef CAN_H_
#define CAN_H_
/*******************************************************************************
* Includes
******************************************************************************/
#include "flexcan_driver.h"
/*******************************************************************************
* API
******************************************************************************/
/*!
* @brief Initialize CAN driver.
* bitrate = 500 kbit/s, RX PF[13], TX PF[12]
*
* @param None
* @return STATUS_SUCCESS if successful;
* STATUS_CAN_BUFF_OUT_OF_RANGE if the index of a message buffer is invalid;
* STATUS_ERROR if other error occurred
*/
status_t CAN_Init(void);
/*!
* @brief Receive frame first, then print message with CAN continually.
*
* @param None
* @return None
*/
void CAN_Task(void);
#endif /*#ifndef CAN_H_*/
/*******************************************************************************
* EOF
******************************************************************************/
| 33.513889 | 85 | 0.501036 |
f75ae24355797d90b755a4e6b0e45ee936406aed | 457 | h | C | NetServer/HttpMethod.h | zsccc/4 | 172f3e019fd338533d0f0ee9cc05cd8f7e545659 | [
"MIT"
] | null | null | null | NetServer/HttpMethod.h | zsccc/4 | 172f3e019fd338533d0f0ee9cc05cd8f7e545659 | [
"MIT"
] | null | null | null | NetServer/HttpMethod.h | zsccc/4 | 172f3e019fd338533d0f0ee9cc05cd8f7e545659 | [
"MIT"
] | null | null | null | #ifndef __HTTPMETHOD_H_
#define __HTTPMETHOD_H_
#include "HttpStruct.h"
#include <string>
void HttpMethodGet(const HttpRequestContext &, std::string &, std::string);
void HttpMethodPost(const HttpRequestContext &, std::string &, std::string);
void readFile(std::string path, std::string &responsecontext);
void execCGI(std::string args, std::string &responsecontext, std::string path);
std::string UrlDecode(std::string str);
#endif /* __HTTPMETHOD_H_ */
| 38.083333 | 79 | 0.765864 |
f0574e6e18439c3b0140a8ed7ddefec8cd1bf416 | 299 | py | Python | tests/core/scenario_finder/file_filters/test_file_filter.py | nikitanovosibirsk/vedro | e975a1c1eb065bc6caa32c41c0d7576ee6d284db | [
"Apache-2.0"
] | 2 | 2021-08-24T12:49:30.000Z | 2022-01-23T07:21:25.000Z | tests/core/scenario_finder/file_filters/test_file_filter.py | nikitanovosibirsk/vedro | e975a1c1eb065bc6caa32c41c0d7576ee6d284db | [
"Apache-2.0"
] | 20 | 2015-12-09T11:04:23.000Z | 2022-03-20T09:18:17.000Z | tests/core/scenario_finder/file_filters/test_file_filter.py | nikitanovosibirsk/vedro | e975a1c1eb065bc6caa32c41c0d7576ee6d284db | [
"Apache-2.0"
] | 3 | 2015-12-09T07:31:23.000Z | 2022-01-28T11:03:24.000Z | from pytest import raises
from vedro._core._scenario_finder._file_filters import FileFilter
def test_file_filter():
with raises(Exception) as exc_info:
FileFilter()
assert exc_info.type is TypeError
assert "Can't instantiate abstract class FileFilter" in str(exc_info.value)
| 24.916667 | 79 | 0.769231 |
91ff5a374ffd3530492654296c0ddf9da2bc3dbe | 1,556 | sql | SQL | user.sql | habibmuhammadthariq/sevice-motor | 1823d3904f678b2fd197a9c6e74cf84128ec3289 | [
"MIT"
] | null | null | null | user.sql | habibmuhammadthariq/sevice-motor | 1823d3904f678b2fd197a9c6e74cf84128ec3289 | [
"MIT"
] | null | null | null | user.sql | habibmuhammadthariq/sevice-motor | 1823d3904f678b2fd197a9c6e74cf84128ec3289 | [
"MIT"
] | null | null | null | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 02, 2019 at 10:18 AM
-- Server version: 10.3.16-MariaDB
-- PHP Version: 7.3.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `instakilo`
--
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`username` varchar(20) NOT NULL,
`password` varchar(64) NOT NULL,
`email` varchar(32) NOT NULL,
`name` varchar(32) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`username`, `password`, `email`, `name`) VALUES
('habib', '$2y$10$H3bwOKhzF1hSN3hpWPdwzusE9N6UQIvHjoZ03//i9XiPNhpP5XUQO', 'wowow@gmail.com', 'waduh'),
('hablkfdsa;lkdsaq', '$2y$10$y71DRBS0pVYESX2PBh8z4.Iq1f.0CJiO4c1VOxIEyBULSMKVFJITC', 'dsafasw@gmail.com', 'waduh');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`username`),
ADD UNIQUE KEY `email` (`email`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| 25.508197 | 115 | 0.681877 |
0bc7aaa0d29902e27423f77f3360dbf6f6b04ddb | 128 | sql | SQL | Chapter01/code/data_import_gb_poi.sql | PacktPublishing/Mastering-Postgis | 110e71c2fdd023213792701124f0c8c4c0d051a2 | [
"MIT"
] | null | null | null | Chapter01/code/data_import_gb_poi.sql | PacktPublishing/Mastering-Postgis | 110e71c2fdd023213792701124f0c8c4c0d051a2 | [
"MIT"
] | null | null | null | Chapter01/code/data_import_gb_poi.sql | PacktPublishing/Mastering-Postgis | 110e71c2fdd023213792701124f0c8c4c0d051a2 | [
"MIT"
] | 1 | 2021-05-08T10:17:31.000Z | 2021-05-08T10:17:31.000Z | version https://git-lfs.github.com/spec/v1
oid sha256:93f077196d05561b7c00c725b65e8a0382257a9ad83f811e58dbdd0b27ed016d
size 922
| 32 | 75 | 0.882813 |
24fb08ef1dff6ec685792e40c9835e173b235cfa | 7,607 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1421.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1421.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i7-7700_9_0x48_notsx.log_21829_1421.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r10
push %r12
push %r14
push %r15
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_WC_ht+0x11762, %rsi
lea addresses_UC_ht+0x15f62, %rdi
nop
dec %r12
mov $3, %rcx
rep movsq
nop
nop
sub $43772, %r14
lea addresses_A_ht+0x790, %r15
clflush (%r15)
nop
nop
nop
nop
sub $49642, %rcx
movl $0x61626364, (%r15)
xor %rsi, %rsi
lea addresses_UC_ht+0x14762, %rdi
nop
nop
add %r10, %r10
mov $0x6162636465666768, %rsi
movq %rsi, %xmm6
movups %xmm6, (%rdi)
nop
xor $25131, %r14
lea addresses_UC_ht+0x18822, %rsi
lea addresses_UC_ht+0x1bd62, %rdi
nop
xor %r12, %r12
mov $2, %rcx
rep movsl
nop
and $29919, %rsi
lea addresses_normal_ht+0x17416, %r14
cmp %r15, %r15
mov $0x6162636465666768, %r10
movq %r10, (%r14)
and $64547, %rsi
lea addresses_WC_ht+0x1888a, %rsi
lea addresses_WT_ht+0x6d62, %rdi
nop
nop
nop
nop
cmp %rax, %rax
mov $24, %rcx
rep movsw
nop
sub $58969, %r15
lea addresses_A_ht+0x7962, %r12
nop
nop
nop
add %rcx, %rcx
vmovups (%r12), %ymm0
vextracti128 $1, %ymm0, %xmm0
vpextrq $0, %xmm0, %rdi
nop
nop
nop
nop
nop
xor $44083, %rdi
lea addresses_D_ht+0x15502, %rax
nop
nop
lfence
vmovups (%rax), %ymm0
vextracti128 $0, %ymm0, %xmm0
vpextrq $0, %xmm0, %r10
nop
nop
nop
nop
nop
and $15732, %r15
lea addresses_WT_ht+0x17d62, %rdi
nop
nop
sub %rcx, %rcx
movw $0x6162, (%rdi)
xor $4531, %rdi
lea addresses_D_ht+0x19162, %rsi
nop
nop
xor $24999, %rax
mov $0x6162636465666768, %rcx
movq %rcx, %xmm5
and $0xffffffffffffffc0, %rsi
vmovaps %ymm5, (%rsi)
nop
nop
cmp $44534, %rax
lea addresses_WT_ht+0x13834, %rsi
lea addresses_UC_ht+0x3e62, %rdi
nop
nop
nop
nop
nop
and $1293, %r12
mov $125, %rcx
rep movsl
nop
sub %rdi, %rdi
lea addresses_WT_ht+0x5162, %rcx
nop
nop
add $4803, %rsi
movl $0x61626364, (%rcx)
nop
nop
nop
nop
nop
sub %r10, %r10
lea addresses_UC_ht+0x87fa, %r14
nop
nop
cmp $3669, %rax
mov (%r14), %r12d
add $49831, %r15
lea addresses_A_ht+0x1a8a2, %rcx
sub $59941, %r14
movups (%rcx), %xmm5
vpextrq $0, %xmm5, %r10
inc %r12
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r15
pop %r14
pop %r12
pop %r10
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r13
push %r15
push %rbx
push %rsi
// Faulty Load
lea addresses_PSE+0x18562, %r15
nop
add $1764, %rsi
vmovups (%r15), %ymm1
vextracti128 $1, %ymm1, %xmm1
vpextrq $1, %xmm1, %r13
lea oracles, %r12
and $0xff, %r13
shlq $12, %r13
mov (%r12,%r13,1), %r13
pop %rsi
pop %rbx
pop %r15
pop %r13
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_PSE', 'congruent': 0}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_PSE', 'congruent': 0}}
<gen_prepare_buffer>
{'dst': {'same': False, 'congruent': 9, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 9, 'type': 'addresses_WC_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 4, 'type': 'addresses_A_ht', 'congruent': 0}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_UC_ht', 'congruent': 8}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 9, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_UC_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': False, 'size': 8, 'type': 'addresses_normal_ht', 'congruent': 1}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 7, 'type': 'addresses_WT_ht'}, 'OP': 'REPM', 'src': {'same': True, 'congruent': 3, 'type': 'addresses_WC_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_A_ht', 'congruent': 9}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 32, 'type': 'addresses_D_ht', 'congruent': 5}}
{'dst': {'same': False, 'NT': True, 'AVXalign': True, 'size': 2, 'type': 'addresses_WT_ht', 'congruent': 11}, 'OP': 'STOR'}
{'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 32, 'type': 'addresses_D_ht', 'congruent': 10}, 'OP': 'STOR'}
{'dst': {'same': False, 'congruent': 7, 'type': 'addresses_UC_ht'}, 'OP': 'REPM', 'src': {'same': False, 'congruent': 1, 'type': 'addresses_WT_ht'}}
{'dst': {'same': False, 'NT': False, 'AVXalign': True, 'size': 4, 'type': 'addresses_WT_ht', 'congruent': 10}, 'OP': 'STOR'}
{'OP': 'LOAD', 'src': {'same': False, 'NT': True, 'AVXalign': False, 'size': 4, 'type': 'addresses_UC_ht', 'congruent': 3}}
{'OP': 'LOAD', 'src': {'same': False, 'NT': False, 'AVXalign': False, 'size': 16, 'type': 'addresses_A_ht', 'congruent': 5}}
{'33': 21829}
33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33 33
*/
| 37.658416 | 2,999 | 0.658604 |
b1854cdd0a4c91e59c81112e0eae84102619e0f3 | 96 | css | CSS | src/components/PickupSlot/style.css | Matheuslm10/vending-machine | 2b6aca07f84e538e0645b730d1ab023c632549cc | [
"MIT"
] | null | null | null | src/components/PickupSlot/style.css | Matheuslm10/vending-machine | 2b6aca07f84e538e0645b730d1ab023c632549cc | [
"MIT"
] | null | null | null | src/components/PickupSlot/style.css | Matheuslm10/vending-machine | 2b6aca07f84e538e0645b730d1ab023c632549cc | [
"MIT"
] | null | null | null | .pickup-slot {
border: 2px solid black;
margin-top: 25px;
height: 35%;
padding: 10px;
}
| 13.714286 | 26 | 0.635417 |
5953eb9dfc46fda518f9ec3f286710c5c4048ac8 | 21,466 | c | C | src/microrl.c | mindnever/microrl | e2dbb1e13cbe730fe18bb383f9a69b71e9e12ba3 | [
"Apache-2.0"
] | null | null | null | src/microrl.c | mindnever/microrl | e2dbb1e13cbe730fe18bb383f9a69b71e9e12ba3 | [
"Apache-2.0"
] | null | null | null | src/microrl.c | mindnever/microrl | e2dbb1e13cbe730fe18bb383f9a69b71e9e12ba3 | [
"Apache-2.0"
] | null | null | null | /*
Author: Samoylov Eugene aka Helius (ghelius@gmail.com)
BUGS and TODO:
-- add echo_off feature
-- rewrite history for use more than 256 byte buffer
*/
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include "microrl.h"
#ifdef _USE_LIBC_STDIO
#include <stdio.h>
#endif
// #define DBG(...) fprintf(stderr, "\033[33m");fprintf(stderr,__VA_ARGS__);fprintf(stderr,"\033[0m");
char *prompt_default = _PROMPT_DEFAULT;
#ifdef _USE_HISTORY
#ifdef _HISTORY_DEBUG
// *****************************************************************************
// print buffer content on screen
static void print_hist(ring_history_t *pThis)
{
printf("\n");
for (int i = 0; i < _RING_HISTORY_LEN; i++) {
if (i == pThis->begin) {
printf("b");
} else {
printf(" ");
}
}
printf("\n");
for (int i = 0; i < _RING_HISTORY_LEN; i++) {
if (isalpha(pThis->ring_buf[i])) {
printf("%c", pThis->ring_buf[i]);
} else {
printf("%d", pThis->ring_buf[i]);
}
}
printf("\n");
for (int i = 0; i < _RING_HISTORY_LEN; i++) {
if (i == pThis->end) {
printf("e");
} else {
printf(" ");
}
}
printf("\n");
}
#endif /* ifdef _HISTORY_DEBUG */
// *****************************************************************************
// remove older message from ring buffer
static void hist_erase_older(ring_history_t *pThis)
{
int new_pos = pThis->begin + pThis->ring_buf[pThis->begin] + 1;
if (new_pos >= _RING_HISTORY_LEN) {
new_pos = new_pos - _RING_HISTORY_LEN;
}
pThis->begin = new_pos;
}
// *****************************************************************************
// check space for new line, remove older while not space
static int hist_is_space_for_new(ring_history_t *pThis, int len)
{
if (pThis->ring_buf[pThis->begin] == 0) {
return true;
}
if (pThis->end >= pThis->begin) {
if (_RING_HISTORY_LEN - pThis->end + pThis->begin - 1 > len) {
return true;
}
} else {
if (pThis->begin - pThis->end - 1 > len) {
return true;
}
}
return false;
}
// *****************************************************************************
// put line to ring buffer
static void hist_save_line(ring_history_t *pThis, char *line, int len)
{
if (len > _RING_HISTORY_LEN - 2) {
return;
}
while (!hist_is_space_for_new(pThis, len)) {
hist_erase_older(pThis);
}
// if it's first line
if (pThis->ring_buf[pThis->begin] == 0) {
pThis->ring_buf[pThis->begin] = len;
}
// store line
if (len < _RING_HISTORY_LEN - pThis->end - 1) {
memcpy(pThis->ring_buf + pThis->end + 1, line, len);
} else {
int part_len = _RING_HISTORY_LEN - pThis->end - 1;
memcpy(pThis->ring_buf + pThis->end + 1, line, part_len);
memcpy(pThis->ring_buf, line + part_len, len - part_len);
}
pThis->ring_buf[pThis->end] = len;
pThis->end = pThis->end + len + 1;
if (pThis->end >= _RING_HISTORY_LEN) {
pThis->end -= _RING_HISTORY_LEN;
}
pThis->ring_buf[pThis->end] = 0;
pThis->cur = 0;
#ifdef _HISTORY_DEBUG
print_hist(pThis);
#endif
}
// *****************************************************************************
// copy saved line to 'line' and return size of line
static int hist_restore_line(ring_history_t *pThis, char *line, int dir)
{
int cnt = 0;
// count history record
int header = pThis->begin;
while (pThis->ring_buf[header] != 0) {
header += pThis->ring_buf[header] + 1;
if (header >= _RING_HISTORY_LEN) {
header -= _RING_HISTORY_LEN;
}
cnt++;
}
if (dir == _HIST_UP) {
if (cnt >= pThis->cur) {
int header = pThis->begin;
int j = 0;
// found record for 'pThis->cur' index
while ((pThis->ring_buf[header] != 0) && (cnt - j - 1 != pThis->cur)) {
header += pThis->ring_buf[header] + 1;
if (header >= _RING_HISTORY_LEN) {
header -= _RING_HISTORY_LEN;
}
j++;
}
if (pThis->ring_buf[header]) {
pThis->cur++;
// obtain saved line
if (pThis->ring_buf[header] + header < _RING_HISTORY_LEN) {
memset(line, 0, _COMMAND_LINE_LEN);
memcpy(line, pThis->ring_buf + header + 1, pThis->ring_buf[header]);
} else {
int part0 = _RING_HISTORY_LEN - header - 1;
memset(line, 0, _COMMAND_LINE_LEN);
memcpy(line, pThis->ring_buf + header + 1, part0);
memcpy(line + part0, pThis->ring_buf, pThis->ring_buf[header] - part0);
}
return pThis->ring_buf[header];
}
}
} else {
if (pThis->cur > 0) {
pThis->cur--;
int header = pThis->begin;
int j = 0;
while ((pThis->ring_buf[header] != 0) && (cnt - j != pThis->cur)) {
header += pThis->ring_buf[header] + 1;
if (header >= _RING_HISTORY_LEN) {
header -= _RING_HISTORY_LEN;
}
j++;
}
if (pThis->ring_buf[header] + header < _RING_HISTORY_LEN) {
memcpy(line, pThis->ring_buf + header + 1, pThis->ring_buf[header]);
} else {
int part0 = _RING_HISTORY_LEN - header - 1;
memcpy(line, pThis->ring_buf + header + 1, part0);
memcpy(line + part0, pThis->ring_buf, pThis->ring_buf[header] - part0);
}
return pThis->ring_buf[header];
} else {
/* empty line */
return 0;
}
}
return -1;
}
#endif /* ifdef _USE_HISTORY */
// *****************************************************************************
// split cmdline to tkn array and return nmb of token
static int split(microrl_t *pThis, int limit, char const * *tkn_arr)
{
int i = 0;
int ind = 0;
while (1) {
// go to the first whitespace (zerro for us)
while ((pThis->cmdline[ind] == '\0') && (ind < limit)) {
ind++;
}
if (!(ind < limit)) {
return i;
}
tkn_arr[i++] = pThis->cmdline + ind;
if (i >= _COMMAND_TOKEN_NMB) {
return -1;
}
// go to the first NOT whitespace (not zerro for us)
while ((pThis->cmdline[ind] != '\0') && (ind < limit)) {
ind++;
}
if (!(ind < limit)) {
return i;
}
}
return i;
}
// *****************************************************************************
inline static void print_prompt(microrl_t *pThis)
{
pThis->print(pThis->prompt_str, pThis);
}
// *****************************************************************************
inline static void terminal_backspace(microrl_t *pThis)
{
pThis->print("\033[D \033[D", pThis);
}
// *****************************************************************************
inline static void terminal_newline(microrl_t *pThis)
{
pThis->print(ENDL, pThis);
}
#ifndef _USE_LIBC_STDIO
// *****************************************************************************
// convert 16 bit value to string
// 0 value not supported!!! just make empty string
// Returns pointer to a buffer tail
static char *u16bit_to_str(unsigned int nmb, char *buf)
{
char tmp_str[6] = { 0, };
int i = 0, j;
if (nmb <= 0xFFFF) {
while (nmb > 0) {
tmp_str[i++] = (nmb % 10) + '0';
nmb /= 10;
}
for (j = 0; j < i; ++j) {
*(buf++) = tmp_str[i - j - 1];
}
}
*buf = '\0';
return buf;
}
#endif /* ifndef _USE_LIBC_STDIO */
// *****************************************************************************
// set cursor at position from begin cmdline (after prompt) + offset
static void terminal_move_cursor(microrl_t *pThis, int offset)
{
char str[16] = { 0, };
#ifdef _USE_LIBC_STDIO
if (offset > 0) {
snprintf(str, 16, "\033[%dC", offset);
} else if (offset < 0) {
snprintf(str, 16, "\033[%dD", -(offset));
}
#else
char *endstr;
strcpy(str, "\033[");
if (offset > 0) {
endstr = u16bit_to_str(offset, str + 2);
strcpy(endstr, "C");
} else if (offset < 0) {
endstr = u16bit_to_str(-(offset), str + 2);
strcpy(endstr, "D");
} else {
return;
}
#endif
pThis->print(str, pThis);
}
// *****************************************************************************
static void terminal_reset_cursor(microrl_t *pThis)
{
char str[16];
#ifdef _USE_LIBC_STDIO
snprintf(str, 16, "\033[%dD\033[%dC", \
_COMMAND_LINE_LEN + _PROMPT_LEN + 2, _PROMPT_LEN);
#else
char *endstr;
strcpy(str, "\033[");
endstr = u16bit_to_str(_COMMAND_LINE_LEN + _PROMPT_LEN + 2, str + 2);
strcpy(endstr, "D\033["); endstr += 3;
endstr = u16bit_to_str(_PROMPT_LEN, endstr);
strcpy(endstr, "C");
#endif
pThis->print(str, pThis);
}
// *****************************************************************************
// print cmdline to screen, replace '\0' to wihitespace
static void terminal_print_line(microrl_t *pThis, int pos, int cursor)
{
pThis->print("\033[K", pThis); // delete all from cursor to end
char nch[] = { 0, 0 };
int i;
for (i = pos; i < pThis->cmdlen; i++) {
nch[0] = pThis->cmdline[i];
if (nch[0] == '\0') {
nch[0] = ' ';
}
pThis->print(nch, pThis);
}
terminal_reset_cursor(pThis);
terminal_move_cursor(pThis, cursor);
}
// *****************************************************************************
void microrl_init(microrl_t *pThis, void (*print)(const char *, microrl_t *))
{
memset(pThis->cmdline, 0, _COMMAND_LINE_LEN);
#ifdef _USE_HISTORY
memset(pThis->ring_hist.ring_buf, 0, _RING_HISTORY_LEN);
pThis->ring_hist.begin = 0;
pThis->ring_hist.end = 0;
pThis->ring_hist.cur = 0;
#endif
pThis->cmdlen = 0;
pThis->cursor = 0;
pThis->execute = NULL;
pThis->get_completion = NULL;
#ifdef _USE_CTLR_C
pThis->sigint = NULL;
#endif
pThis->prompt_str = prompt_default;
pThis->print = print;
#ifdef _ENABLE_INIT_PROMPT
print_prompt(pThis);
#endif
#ifdef _USE_ESC_SEQ
pThis->escape = 0;
#endif
}
// *****************************************************************************
void microrl_set_complete_callback(microrl_t *pThis, char * *(*get_completion)(int, const char *const *, microrl_t *))
{
pThis->get_completion = get_completion;
}
// *****************************************************************************
void microrl_set_execute_callback(microrl_t *pThis, int (*execute)(int, const char *const *, microrl_t *))
{
pThis->execute = execute;
}
#ifdef _USE_CTLR_C
// *****************************************************************************
void microrl_set_sigint_callback(microrl_t *pThis, void (*sigintf)(microrl_t *))
{
pThis->sigint = sigintf;
}
#endif
#ifdef _USE_HISTORY
static void hist_search(microrl_t *pThis, int dir)
{
int len = hist_restore_line(&pThis->ring_hist, pThis->cmdline, dir);
if (len >= 0) {
pThis->cmdline[len] = '\0';
pThis->cursor = pThis->cmdlen = len;
terminal_reset_cursor(pThis);
terminal_print_line(pThis, 0, pThis->cursor);
}
}
#endif
#ifdef _USE_ESC_SEQ
// *****************************************************************************
// handling escape sequences
static int escape_process(microrl_t *pThis, char ch)
{
if (ch == '[') {
pThis->escape_seq = _ESC_BRACKET;
return 0;
} else if (pThis->escape_seq == _ESC_BRACKET) {
if (ch == 'A') {
#ifdef _USE_HISTORY
hist_search(pThis, _HIST_UP);
#endif
return 1;
} else if (ch == 'B') {
#ifdef _USE_HISTORY
hist_search(pThis, _HIST_DOWN);
#endif
return 1;
} else if (ch == 'C') {
if (pThis->cursor < pThis->cmdlen) {
terminal_move_cursor(pThis, 1);
pThis->cursor++;
}
return 1;
} else if (ch == 'D') {
if (pThis->cursor > 0) {
terminal_move_cursor(pThis, -1);
pThis->cursor--;
}
return 1;
} else if (ch == '7') {
pThis->escape_seq = _ESC_HOME;
return 0;
} else if (ch == '8') {
pThis->escape_seq = _ESC_END;
return 0;
}
} else if (ch == '~') {
if (pThis->escape_seq == _ESC_HOME) {
terminal_reset_cursor(pThis);
pThis->cursor = 0;
return 1;
} else if (pThis->escape_seq == _ESC_END) {
terminal_move_cursor(pThis, pThis->cmdlen - pThis->cursor);
pThis->cursor = pThis->cmdlen;
return 1;
}
}
/* unknown escape sequence, stop */
return 1;
}
#endif /* ifdef _USE_ESC_SEQ */
// *****************************************************************************
// insert len char of text at cursor position
static int microrl_insert_text(microrl_t *pThis, char *text, int len)
{
int i;
if (pThis->cmdlen + len < _COMMAND_LINE_LEN) {
memmove(pThis->cmdline + pThis->cursor + len,
pThis->cmdline + pThis->cursor,
pThis->cmdlen - pThis->cursor);
for (i = 0; i < len; i++) {
pThis->cmdline[pThis->cursor + i] = text[i];
if (pThis->cmdline[pThis->cursor + i] == ' ') {
pThis->cmdline[pThis->cursor + i] = 0;
}
}
pThis->cursor += len;
pThis->cmdlen += len;
pThis->cmdline[pThis->cmdlen] = '\0';
return true;
}
return false;
}
// *****************************************************************************
// remove one char at cursor
static void microrl_backspace(microrl_t *pThis)
{
if (pThis->cursor > 0) {
terminal_backspace(pThis);
memmove(pThis->cmdline + pThis->cursor - 1,
pThis->cmdline + pThis->cursor,
pThis->cmdlen - pThis->cursor + 1);
pThis->cursor--;
pThis->cmdline[pThis->cmdlen] = '\0';
pThis->cmdlen--;
}
}
#ifdef _USE_COMPLETE
// *****************************************************************************
static int common_len(char * *arr)
{
int i;
int j;
char *shortest = arr[0];
int shortlen = strlen(shortest);
for (i = 0; arr[i] != NULL; ++i) {
if (strlen(arr[i]) < shortlen) {
shortest = arr[i];
shortlen = strlen(shortest);
}
}
for (i = 0; i < shortlen; ++i) {
for (j = 0; arr[j] != 0; ++j) {
if (shortest[i] != arr[j][i]) {
return i;
}
}
}
return i;
}
// *****************************************************************************
static void microrl_get_complite(microrl_t *pThis)
{
char const *tkn_arr[_COMMAND_TOKEN_NMB];
char * *compl_token;
if (pThis->get_completion == NULL) { // callback was not set
return;
}
int status = split(pThis, pThis->cursor, tkn_arr);
if (pThis->cmdline[pThis->cursor - 1] == '\0') {
tkn_arr[status++] = "";
}
compl_token = pThis->get_completion(status, tkn_arr, pThis);
if (compl_token[0] != NULL) {
int i = 0;
int len;
if (compl_token[1] == NULL) {
len = strlen(compl_token[0]);
} else {
len = common_len(compl_token);
terminal_newline(pThis);
while (compl_token[i] != NULL) {
pThis->print(compl_token[i], pThis);
pThis->print(" ", pThis);
i++;
}
terminal_newline(pThis);
print_prompt(pThis);
}
if (len) {
microrl_insert_text(pThis, compl_token[0] + strlen(tkn_arr[status - 1]),
len - strlen(tkn_arr[status - 1]));
if (compl_token[1] == NULL) {
microrl_insert_text(pThis, " ", 1);
}
}
terminal_reset_cursor(pThis);
terminal_print_line(pThis, 0, pThis->cursor);
}
}
#endif /* ifdef _USE_COMPLETE */
// *****************************************************************************
void new_line_handler(microrl_t *pThis)
{
char const *tkn_arr[_COMMAND_TOKEN_NMB];
int status;
terminal_newline(pThis);
#ifdef _USE_HISTORY
if (pThis->cmdlen > 0) {
hist_save_line(&pThis->ring_hist, pThis->cmdline, pThis->cmdlen);
}
#endif
status = split(pThis, pThis->cmdlen, tkn_arr);
if (status == -1) {
// pThis->print ("ERROR: Max token amount exseed\n");
pThis->print("ERROR:too many tokens", pThis);
pThis->print(ENDL, pThis);
}
if ((status > 0) && (pThis->execute != NULL)) {
pThis->execute(status, tkn_arr, pThis);
}
print_prompt(pThis);
pThis->cmdlen = 0;
pThis->cursor = 0;
memset(pThis->cmdline, 0, _COMMAND_LINE_LEN);
#ifdef _USE_HISTORY
pThis->ring_hist.cur = 0;
#endif
}
// *****************************************************************************
void microrl_insert_char(microrl_t *pThis, int ch)
{
#ifdef _USE_ESC_SEQ
if (pThis->escape) {
if (escape_process(pThis, ch)) {
pThis->escape = 0;
}
} else {
#endif
switch (ch) {
// -----------------------------------------------------
#ifdef _ENDL_CR
case KEY_CR:
new_line_handler(pThis);
break;
case KEY_LF:
break;
#elif defined(_ENDL_CRLF)
case KEY_CR:
pThis->tmpch = KEY_CR;
break;
case KEY_LF:
if (pThis->tmpch == KEY_CR) {
new_line_handler(pThis);
}
break;
#elif defined(_ENDL_LFCR)
case KEY_LF:
pThis->tmpch = KEY_LF;
break;
case KEY_CR:
if (pThis->tmpch == KEY_LF) {
new_line_handler(pThis);
}
break;
#else /* ifdef _ENDL_CR */
case KEY_CR:
break;
case KEY_LF:
new_line_handler(pThis);
break;
#endif /* ifdef _ENDL_CR */
// -----------------------------------------------------
#ifdef _USE_COMPLETE
case KEY_HT:
microrl_get_complite(pThis);
break;
#endif
// -----------------------------------------------------
case KEY_ESC:
#ifdef _USE_ESC_SEQ
pThis->escape = 1;
#endif
break;
// -----------------------------------------------------
case KEY_NAK: // ^U
while (pThis->cursor > 0) {
microrl_backspace(pThis);
}
terminal_print_line(pThis, 0, pThis->cursor);
break;
// -----------------------------------------------------
case KEY_VT: // ^K
pThis->print("\033[K", pThis);
pThis->cmdlen = pThis->cursor;
break;
// -----------------------------------------------------
case KEY_ENQ: // ^E
terminal_move_cursor(pThis, pThis->cmdlen - pThis->cursor);
pThis->cursor = pThis->cmdlen;
break;
// -----------------------------------------------------
case KEY_SOH: // ^A
terminal_reset_cursor(pThis);
pThis->cursor = 0;
break;
// -----------------------------------------------------
case KEY_ACK: // ^F
if (pThis->cursor < pThis->cmdlen) {
terminal_move_cursor(pThis, 1);
pThis->cursor++;
}
break;
// -----------------------------------------------------
case KEY_STX: // ^B
if (pThis->cursor) {
terminal_move_cursor(pThis, -1);
pThis->cursor--;
}
break;
// -----------------------------------------------------
case KEY_DLE: // ^P
#ifdef _USE_HISTORY
hist_search(pThis, _HIST_UP);
#endif
break;
// -----------------------------------------------------
case KEY_SO: // ^N
#ifdef _USE_HISTORY
hist_search(pThis, _HIST_DOWN);
#endif
break;
// -----------------------------------------------------
case KEY_DEL: // Backspace
case KEY_BS: // ^U
microrl_backspace(pThis);
terminal_print_line(pThis, pThis->cursor, pThis->cursor);
break;
// -----------------------------------------------------
case KEY_DC2: // ^R
terminal_newline(pThis);
print_prompt(pThis);
terminal_reset_cursor(pThis);
terminal_print_line(pThis, 0, pThis->cursor);
break;
// -----------------------------------------------------
#ifdef _USE_CTLR_C
case KEY_ETX:
if (pThis->sigint != NULL) {
pThis->sigint(pThis);
}
break;
#endif
// -----------------------------------------------------
default:
if (((ch == ' ') && (pThis->cmdlen == 0)) || IS_CONTROL_CHAR(ch)) {
break;
}
if (microrl_insert_text(pThis, (char *)&ch, 1)) {
terminal_print_line(pThis, pThis->cursor - 1, pThis->cursor);
}
break;
}
#ifdef _USE_ESC_SEQ
}
#endif
}
| 29.047361 | 118 | 0.467577 |
b9683bd672e580bb5b04eec8595fab9d7c2e45bf | 649 | h | C | ui/plot/textstyle.h | inet-framework/LIMoSim | d9bdcefe82d41d4c8fd665a268843763fce59363 | [
"MIT"
] | 7 | 2017-07-17T07:13:03.000Z | 2021-10-12T08:39:17.000Z | ui/plot/textstyle.h | tudo-cni/LIMoSim | f0e4c8d964da18dffecea040775f07da3f5a5d46 | [
"MIT"
] | 1 | 2018-03-08T10:28:01.000Z | 2018-03-08T10:28:01.000Z | ui/plot/textstyle.h | tudo-cni/LIMoSim | f0e4c8d964da18dffecea040775f07da3f5a5d46 | [
"MIT"
] | 7 | 2017-09-13T09:05:20.000Z | 2022-01-04T17:20:20.000Z | #ifndef LIMOSIM_TEXTSTYLE_H
#define LIMOSIM_TEXTSTYLE_H
#include <QString>
namespace LIMoSim
{
class TextStyle
{
public:
TextStyle(const QString &_font="Arial", int _fontSize=10, const QString &_color="black", int _rotation=0, int _horizontalAlignment=Qt::AlignHCenter, int _verticalAlignment=Qt::AlignVCenter);
/*
void alignLeft();
void alignRight();
void alignHCenter();
void alignTop();
void alignBottom();
void alignVCenter();*/
public:
QString font;
double fontSize;
QString color;
double rotation;
int horizontalAlignment;
int verticalAlignment;
};
}
#endif // LIMOSIM_TEXTSTYLE_H
| 19.666667 | 194 | 0.711864 |
8c0717c6fc030860775b281bab949de2123f47c1 | 5,630 | swift | Swift | NHS-COVID-19/AppTests/Sources/KeychainStoredTests.swift | faberga/covid-19-app-ios-ag-public | ee43e47aa1c082ea0bbfb0a971327dea807e4533 | [
"MIT"
] | 135 | 2020-08-13T12:37:37.000Z | 2021-02-12T06:07:22.000Z | NHS-COVID-19/AppTests/Sources/KeychainStoredTests.swift | faberga/covid-19-app-ios-ag-public | ee43e47aa1c082ea0bbfb0a971327dea807e4533 | [
"MIT"
] | 15 | 2020-09-21T11:47:19.000Z | 2021-01-11T17:08:29.000Z | NHS-COVID-19/AppTests/Sources/KeychainStoredTests.swift | faberga/covid-19-app-ios-ag-public | ee43e47aa1c082ea0bbfb0a971327dea807e4533 | [
"MIT"
] | 17 | 2020-08-13T13:37:38.000Z | 2020-12-25T20:13:20.000Z | //
// Copyright © 2020 NHSX. All rights reserved.
//
import Foundation
import XCTest
@testable import Domain
class KeychainStoredTests: XCTestCase {
private var storage: KeychainStored<Data>!
override func tearDown() {
super.tearDown()
storage.wrappedValue = nil
}
func testCanSetValue() throws {
let service = UUID().uuidString
let key = UUID().uuidString
storage = KeychainStored<Data>(keychain: Keychain(service: service), key: key)
let value = "test".data(using: .utf8)!
storage.wrappedValue = value
let query: [String: Any] = [
kSecClass as String: kSecClassGenericPassword,
kSecAttrService as String: service,
kSecAttrAccount as String: key,
kSecReturnData as String: true,
]
var result: CFTypeRef?
let status = SecItemCopyMatching(query as CFDictionary, &result)
XCTAssertEqual(status, errSecSuccess)
let item = try XCTUnwrap(result as? Data)
XCTAssertEqual(value, item)
}
func testSettingAValueMakesItAccessibleAfterFirstUnlockThisDeviceOnly() throws {
let service = UUID().uuidString
let key = UUID().uuidString
storage = KeychainStored<Data>(keychain: Keychain(service: service), key: key)
let value = "test".data(using: .utf8)!
storage.wrappedValue = value
let query: [String: Any] = [
kSecClass as String: kSecClassGenericPassword,
kSecAttrService as String: service,
kSecAttrAccount as String: key,
kSecReturnAttributes as String: true,
]
var result: CFTypeRef?
let status = SecItemCopyMatching(query as CFDictionary, &result)
XCTAssertEqual(status, errSecSuccess)
let item = try XCTUnwrap(result as? NSDictionary)
let accessibility = try XCTUnwrap(item[kSecAttrAccessible as String] as? String)
XCTAssertEqual(accessibility, kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly as String)
}
func testCanGetValue() throws {
let service = UUID().uuidString
let key = UUID().uuidString
storage = KeychainStored<Data>(keychain: Keychain(service: service), key: key)
let value = "test".data(using: .utf8)!
let query: [String: Any] = [
kSecClass as String: kSecClassGenericPassword,
kSecAttrService as String: service,
kSecAttrAccount as String: key,
kSecValueData as String: value,
]
SecItemAdd(query as CFDictionary, nil)
let retrievedValue = storage.wrappedValue
XCTAssertEqual(retrievedValue, value)
}
func testCanCorrectlyUpdateValue() throws {
let service = UUID().uuidString
let key = UUID().uuidString
storage = KeychainStored<Data>(keychain: Keychain(service: service), key: key)
let value1 = "test1".data(using: .utf8)!
let value2 = "test2".data(using: .utf8)!
storage.wrappedValue = value1
storage.wrappedValue = value2
XCTAssertEqual(value2, storage.wrappedValue)
}
func testUpdatingAValueAdjustsAccessiblityToAfterFirstUnlockThisDeviceOnly() throws {
let service = UUID().uuidString
let key = UUID().uuidString
let keychain = Keychain(service: service)
storage = KeychainStored<Data>(keychain: keychain, key: key)
let value1 = "test1".data(using: .utf8)!
let value2 = "test2".data(using: .utf8)!
try keychain.add([
kSecClass as String: kSecClassGenericPassword,
kSecAttrAccount as String: key,
kSecValueData as String: value1,
])
storage.wrappedValue = value2
let query: [String: Any] = [
kSecClass as String: kSecClassGenericPassword,
kSecAttrService as String: service,
kSecAttrAccount as String: key,
kSecReturnAttributes as String: true,
]
var result: CFTypeRef?
let status = SecItemCopyMatching(query as CFDictionary, &result)
XCTAssertEqual(status, errSecSuccess)
let item = try XCTUnwrap(result as? NSDictionary)
let accessibility = try XCTUnwrap(item[kSecAttrAccessible as String] as? String)
XCTAssertEqual(accessibility, kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly as String)
}
func testGetWithoutSetReturnsNil() {
let service = UUID().uuidString
let key = UUID().uuidString
storage = KeychainStored<Data>(keychain: Keychain(service: service), key: key)
let result = storage.wrappedValue
XCTAssertNil(result)
}
func testCanDeleteSetValue() {
let service = UUID().uuidString
let key = UUID().uuidString
storage = KeychainStored<Data>(keychain: Keychain(service: service), key: key)
let value = "test".data(using: .utf8)!
storage.wrappedValue = value
storage.wrappedValue = nil
XCTAssertFalse(storage.hasValue)
}
func testHasValueReturnsTrueWhenValueSet() {
let service = UUID().uuidString
let key = UUID().uuidString
storage = KeychainStored<Data>(keychain: Keychain(service: service), key: key)
let value = "test".data(using: .utf8)!
storage.wrappedValue = value
XCTAssertTrue(storage.hasValue)
}
}
| 34.968944 | 97 | 0.620071 |
3bf59c7e8e6f81a6f08884d8996e931665f6833e | 564 | h | C | Game.h | kentaromiura/Hydra | e285cefbb2c1b11635ff66391d85be53c338ee0f | [
"MIT"
] | null | null | null | Game.h | kentaromiura/Hydra | e285cefbb2c1b11635ff66391d85be53c338ee0f | [
"MIT"
] | null | null | null | Game.h | kentaromiura/Hydra | e285cefbb2c1b11635ff66391d85be53c338ee0f | [
"MIT"
] | null | null | null | //
// Created by Kenta on 17/09/2018.
//
#ifndef HYDRA_GAME_H
#define HYDRA_GAME_H
#include <SDL.h>
#include <SDL_main.h>
#include "GameState.h"
#include "Relax.h"
#include "Actions.h"
class Game {
private:
bool isRunning = false;
const Uint32 FPS = 60;
const Uint32 MAX_FRAME_RENDER_TIME = 1000 / FPS; // ~16ms
SDL_Window *window;
SDL_Renderer *renderer;
void Reconstruct();
public:
relax::Store<GameState, Actions> store;
Game(std::function<GameState(GameState, Actions)> reducer);
~Game();
};
#endif //HYDRA_GAME_H
| 16.588235 | 64 | 0.675532 |
79b11be15e9fbb348c73de252762157f3ce245ca | 770 | sql | SQL | tests/input/pandoc-codeblock-include/query1.sql | Kristinn-Stefansson/pandocker | a9e7205a187ad0c3134bfd9c704de58ec89539c5 | [
"BSD-3-Clause"
] | 128 | 2017-12-21T13:24:45.000Z | 2022-03-30T13:12:53.000Z | tests/input/pandoc-codeblock-include/query1.sql | Kristinn-Stefansson/pandocker | a9e7205a187ad0c3134bfd9c704de58ec89539c5 | [
"BSD-3-Clause"
] | 141 | 2017-06-16T10:17:19.000Z | 2022-03-25T15:17:21.000Z | tests/input/pandoc-codeblock-include/query1.sql | Kristinn-Stefansson/pandocker | a9e7205a187ad0c3134bfd9c704de58ec89539c5 | [
"BSD-3-Clause"
] | 27 | 2017-12-21T13:26:34.000Z | 2022-03-05T18:38:21.000Z | WITH RECURSIVE
x(i)
AS (
VALUES(0)
UNION ALL
SELECT i + 1 FROM x WHERE i < 101
),
Z(Ix, Iy, Cx, Cy, X, Y, I)
AS (
SELECT Ix, Iy, X::FLOAT, Y::FLOAT, X::FLOAT, Y::FLOAT, 0
FROM
(SELECT -2.2 + 0.031 * i, i FROM x) AS xgen(x,ix)
CROSS JOIN
(SELECT -1.5 + 0.031 * i, i FROM x) AS ygen(y,iy)
UNION ALL
SELECT Ix, Iy, Cx, Cy, X * X - Y * Y + Cx AS X, Y * X * 2 + Cy, I + 1
FROM Z
WHERE X * X + Y * Y < 16.0
AND I < 27
),
Zt (Ix, Iy, I) AS (
SELECT Ix, Iy, MAX(I) AS I
FROM Z
GROUP BY Iy, Ix
ORDER BY Iy, Ix
)
SELECT array_to_string(
array_agg(
SUBSTRING(
' .,,,-----++++%%%%@@@@#### ',
GREATEST(I,1),
1
)
),''
)
FROM Zt
GROUP BY Iy
ORDER BY Iy; | 20.263158 | 73 | 0.467532 |
f154b261f74ae03d35e83a39c2f5b1bb7b32c42e | 3,482 | rb | Ruby | site-cookbooks/jenkins/recipes/server.rb | haseebalam/cluster_chef | caa1e3b56f4721b192570e82f3d5e1fffdef8ca2 | [
"Apache-2.0"
] | 1 | 2016-11-11T17:54:26.000Z | 2016-11-11T17:54:26.000Z | site-cookbooks/jenkins/recipes/server.rb | haseebalam/cluster_chef | caa1e3b56f4721b192570e82f3d5e1fffdef8ca2 | [
"Apache-2.0"
] | null | null | null | site-cookbooks/jenkins/recipes/server.rb | haseebalam/cluster_chef | caa1e3b56f4721b192570e82f3d5e1fffdef8ca2 | [
"Apache-2.0"
] | 1 | 2015-10-30T12:10:12.000Z | 2015-10-30T12:10:12.000Z | #
# Author:: Doug MacEachern <dougm@vmware.com>
# Cookbook Name:: jenkins
# Recipe:: default
#
# Copyright 2010, VMware, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to 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.
#
group(node[:jenkins][:server][:user]){ gid 360 }
user node[:jenkins][:server][:user] do
comment "Jenkins CI node (ssh)"
home node[:jenkins][:server][:home]
group node[:jenkins][:server][:user]
uid 360
shell "/bin/sh"
action :manage
end
directory node[:jenkins][:server][:home] do
recursive true
owner node[:jenkins][:server][:user]
group node[:jenkins][:server][:group]
end
directory "#{node[:jenkins][:server][:home]}/plugins" do
owner node[:jenkins][:server][:user]
group node[:jenkins][:server][:group]
not_if{ node[:jenkins][:server][:plugins].empty? }
end
node[:jenkins][:server][:plugins].each do |name|
plugin_file = "#{node[:jenkins][:server][:home]}/plugins/#{name}.hpi"
remote_file plugin_file do
Chef::Log.info "plugin: #{name}"
source "#{node[:jenkins][:plugins_mirror]}/latest/#{name}.hpi"
backup false
owner node[:jenkins][:server][:user]
group node[:jenkins][:server][:group]
not_if{ File.exists?(plugin_file) }
end
end
# See http://jenkins-ci.org/debian/
package_provider = Chef::Provider::Package::Dpkg
pid_file = "/var/run/jenkins/jenkins.pid"
install_starts_service = true
apt_key = "/tmp/jenkins-ci.org.key"
remote_file apt_key do
source "#{node[:jenkins][:apt_mirror]}/jenkins-ci.org.key"
action :create
end
execute "add-jenkins_repo-key" do
command %Q{echo "Adding jenkins apt repo key" ; apt-key add #{apt_key}}
action :nothing
end
file "/etc/apt/sources.list.d/jenkins.list" do
owner "root"
group "root"
mode 0644
content "deb #{node[:jenkins][:apt_mirror]} binary/\n"
action :create
notifies :run, "execute[add-jenkins_repo-key]", :immediately
notifies :run, resources(:execute => "apt-get update"), :immediately
end
service "jenkins" do
supports [ :stop, :start, :restart, :status ]
# "jenkins status" will exit(0) even when the process is not running
status_command "test -f #{pid_file} && kill -0 `cat #{pid_file}`"
action :nothing
end
provide_service('jenkins_server', :port => node[:jenkins][:server][:port])
template '/etc/default/jenkins' do
source 'etc-default-jenkins.erb'
mode "0644"
action :create
notifies :restart, "service[jenkins]"
end
# Install jenkins
package "daemon"
package "jenkins"
# restart if this run only added new plugins
log "plugins updated, restarting jenkins" do
# ugh :restart does not work, need to sleep after stop.
notifies :stop, "service[jenkins]", :immediately
notifies :restart, "service[jenkins]"
only_if do
if File.exists?(pid_file)
htime = File.mtime(pid_file)
Dir["#{node[:jenkins][:server][:home]}/plugins/*.hpi"].select { |file|
File.mtime(file) > htime
}.size > 0
end
end
end
| 30.278261 | 76 | 0.676335 |
5b28f0946e863f9fd1bb95d09198c4e3b3eb5206 | 471 | h | C | hubo-ach/include/hubo/hubo-socketcan.h | thedancomplex/mds-ach | 95ad7da8c9679134c9db616c378d71fc472c1136 | [
"BSD-3-Clause"
] | null | null | null | hubo-ach/include/hubo/hubo-socketcan.h | thedancomplex/mds-ach | 95ad7da8c9679134c9db616c378d71fc472c1136 | [
"BSD-3-Clause"
] | null | null | null | hubo-ach/include/hubo/hubo-socketcan.h | thedancomplex/mds-ach | 95ad7da8c9679134c9db616c378d71fc472c1136 | [
"BSD-3-Clause"
] | null | null | null | /* -*- indent-tabs-mode:t; tab-width: 8; c-basic-offset: 8 -*- */
#ifndef HUBO_SOCKETCAN_H
#define HUBO_SOCKETCAN_H
#ifdef __cplusplus
extern "C" {
#endif
typedef int hubo_can_t ;
extern hubo_can_t hubo_socket[4];
int sendCan(hubo_can_t, struct can_frame *f);
void openAllCAN(int vCan);
int readCan(hubo_can_t skt, struct can_frame *f, double timeoD);
int flushCan(hubo_can_t skt, int timeOut, double giveUp);
#ifdef __cplusplus
}
#endif
#endif //HUBO_SOCKETCAN_H
| 20.478261 | 66 | 0.749469 |
78b8dba3947e294756d8f59132d0f6f94b44273c | 600 | asm | Assembly | programs/oeis/009/A009965.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/009/A009965.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/009/A009965.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A009965: Powers of 21.
; 1,21,441,9261,194481,4084101,85766121,1801088541,37822859361,794280046581,16679880978201,350277500542221,7355827511386641,154472377739119461,3243919932521508681,68122318582951682301,1430568690241985328321,30041942495081691894741,630880792396715529789561,13248496640331026125580781,278218429446951548637196401,5842587018385982521381124421,122694327386105632949003612841,2576580875108218291929075869661,54108198377272584130510593262881,1136272165922724266740722458520501,23861715484377209601555171628930521,501096025171921401632658604207540941
mov $1,21
pow $1,$0
mov $0,$1
| 85.714286 | 543 | 0.911667 |
2abb4a60dd5c2a2650e26f00438cd23ebe9ae915 | 589 | swift | Swift | Tests/PredicateFlowTests/Models/Person.swift | excursus/PredicateFlow | 054db4657775701a3b17381a7327f25fe53c0f1a | [
"MIT"
] | 104 | 2018-02-26T21:43:55.000Z | 2022-01-29T18:16:16.000Z | Tests/PredicateFlowTests/Models/Person.swift | excursus/PredicateFlow | 054db4657775701a3b17381a7327f25fe53c0f1a | [
"MIT"
] | 6 | 2019-07-18T17:14:28.000Z | 2020-07-21T13:32:35.000Z | Tests/PredicateFlowTests/Models/Person.swift | excursus/PredicateFlow | 054db4657775701a3b17381a7327f25fe53c0f1a | [
"MIT"
] | 11 | 2018-02-26T22:37:47.000Z | 2022-03-14T01:21:18.000Z | //
// Person.swift
// PredicateFlow_Example
//
// Created by Andrea Del Fante on 19/02/18.
// Copyright © 2018 CocoaPods. All rights reserved.
//
import PredicateFlow
class Person: PredicateSchema {
enum Sex {
case male
case female
}
private var name: String = ""
private var birth: Date?
private var sex: Sex!
private var dogs: [Dog] = []
private var attributes: [String] = []
}
extension PersonSchema {
var sex: PredicateProperty<Person.Sex> { return builder.generic("sex") }
static var sex: PredicateProperty<Person.Sex> { return PersonSchema().sex }
}
| 20.310345 | 79 | 0.687606 |
862d152274f02b3e8efe183a5066a0b52b773872 | 290 | kt | Kotlin | src/main/kotlin/dev/themeinerlp/skinserver/utils/HeadView.kt | TheMeinerLP/SkinServer | df65f32295ab5ccb63e407d7e6912f1c67989928 | [
"MIT"
] | null | null | null | src/main/kotlin/dev/themeinerlp/skinserver/utils/HeadView.kt | TheMeinerLP/SkinServer | df65f32295ab5ccb63e407d7e6912f1c67989928 | [
"MIT"
] | 1 | 2021-11-12T11:12:57.000Z | 2021-11-12T11:12:57.000Z | src/main/kotlin/dev/themeinerlp/skinserver/utils/HeadView.kt | TheMeinerLP/SkinServer | df65f32295ab5ccb63e407d7e6912f1c67989928 | [
"MIT"
] | 1 | 2021-10-03T17:53:45.000Z | 2021-10-03T17:53:45.000Z | package dev.themeinerlp.skinserver.utils
enum class HeadView(val leftHead: Int, val topHead: Int, val overlayLeft: Int, val overlayTop: Int) {
Front(8, 8, 40, 8),
Right(0, 8, 32, 8),
Left(16, 8, 48, 8),
Back(24, 8, 56, 8),
Top(8, 0, 40, 0),
Bottom(16, 0, 48, 0),
} | 26.363636 | 101 | 0.596552 |
a2dcc9e5ad063bf80fba8d8570282b05d8e13f49 | 4,549 | swift | Swift | PhotoFeedDemoTests/UseCases/Feed/UI/UIKit/Feed/FeedViewControllerTests.swift | surakamy/PhotoFeedDemo | 1f9a1cf52d78872f543a75be924430f361802416 | [
"MIT"
] | 5 | 2020-12-29T14:48:02.000Z | 2022-03-20T09:23:07.000Z | PhotoFeedDemoTests/UseCases/Feed/UI/UIKit/Feed/FeedViewControllerTests.swift | surakamy/PhotoFeedDemo | 1f9a1cf52d78872f543a75be924430f361802416 | [
"MIT"
] | null | null | null | PhotoFeedDemoTests/UseCases/Feed/UI/UIKit/Feed/FeedViewControllerTests.swift | surakamy/PhotoFeedDemo | 1f9a1cf52d78872f543a75be924430f361802416 | [
"MIT"
] | null | null | null | //
// FeedViewControllerTests.swift
// PhotoFeedDemoTests
//
// Created by Dmytro Kholodov on 17.12.2020.
//
import XCTest
@testable import PhotoFeedDemo
class FeedViewInteractorTests: XCTestCase {
func test_view_reloadsOnViewDidLoad() {
let (sut, interactor) = makeSUT()
sut.loadViewIfNeeded()
XCTAssertEqual(interactor.messages, [.reload])
}
func test_view_scrollToBottom_callsInteractor() {
let (sut, interactor) = makeSUT()
sut.loadViewIfNeeded()
sut.simulatePagingRequest()
XCTAssertEqual(interactor.messages, [.reload, .load])
}
func test_view_scrolToBottomTwice_callsInteractor() {
let (sut, interactor) = makeSUT()
sut.loadViewIfNeeded()
sut.simulatePagingRequest()
XCTAssertEqual(interactor.messages, [.reload, .load])
sut.simulatePagingRequest()
XCTAssertEqual(interactor.messages, [.reload, .load, .load])
}
private func makeSUT() -> (FeedViewController, SpyFeedInteractor) {
let interactor = SpyFeedInteractor()
let sut = FeedViewController(collectionViewLayout: UICollectionViewFlowLayout())
sut.interactor = interactor
return (sut, interactor)
}
}
class FeedViewControllerTests: XCTestCase {
func test_diffableDatasource_assignedToCollectionView() throws {
let sut = FeedViewController(collectionViewLayout: UICollectionViewFlowLayout())
sut.loadViewIfNeeded()
let datasource = try XCTUnwrap(sut.collectionView.dataSource)
XCTAssertEqual(ObjectIdentifier(datasource), ObjectIdentifier(sut.dataSource))
}
func test_collectionView_dequeues_cell() {
let sut = FeedViewController(collectionViewLayout: UICollectionViewFlowLayout())
sut.loadViewIfNeeded()
let cell = sut.collectionView.dequeueReusableCell(withReuseIdentifier: FeedCardCellController.identifier, for: IndexPath())
XCTAssertNotNil(cell)
}
func test_displayReload_replacesDatasourceItems() {
let sut = FeedViewController(collectionViewLayout: UICollectionViewFlowLayout())
sut.loadViewIfNeeded()
sut.displayReload(FeedViewModel(makeLoaderSuccessItems()))
XCTAssertEqual(sut.dataSource.collectionView(sut.collectionView, numberOfItemsInSection: 0), 5)
}
func test_displayAppend_increasesDatasourceItems() {
let sut = FeedViewController(collectionViewLayout: UICollectionViewFlowLayout())
sut.loadViewIfNeeded()
sut.displayReload(FeedViewModel(makeLoaderSuccessItems(with: 1...5)))
XCTAssertEqual(sut.dataSource.collectionView(sut.collectionView, numberOfItemsInSection: 0), 5)
sut.displayAppend(FeedViewModel(makeLoaderSuccessItems(with: 6...10)))
XCTAssertEqual(sut.dataSource.collectionView(sut.collectionView, numberOfItemsInSection: 0), 10)
}
func test_view_onCellSelect_callsHandler() {
var handlerReceivedValue = -1
let sut = FeedViewController(collectionViewLayout: UICollectionViewFlowLayout())
sut.onSelectFeedCard = { num in
handlerReceivedValue = num
}
sut.loadViewIfNeeded()
sut.displayReload(FeedViewModel([JSONImage(id: "100", author: "", width: 0, height: 0, url: "", download_url: "")]))
sut.collectionView(sut.collectionView, didSelectItemAt: IndexPath(item: 0, section: 0))
XCTAssertEqual(handlerReceivedValue, 100)
}
private func makeLoaderSuccessItems(with range: ClosedRange<Int> = 1...5) -> [JSONImage] {
return range.map {
JSONImage(id: "\($0)", author: "Author \($0)", width: 400, height: 400, url: "http://url", download_url: "http://url")
}
}
}
extension FeedViewController {
var loadingIndicatorIsVisible: Bool {
return collectionView.refreshControl?.isRefreshing == true
}
public override func loadViewIfNeeded() {
super.loadViewIfNeeded()
// make view small to prevent rendering cells
collectionView.frame = CGRect(x: 0, y: 0, width: 1, height: 1)
}
func simulatePagingRequest() {
let scrollView = DraggingScrollView()
scrollView.contentOffset.y = 1000
self.scrollViewDidScroll(scrollView)
}
func simulateUserRefresh() {
collectionView.refreshControl?.beginRefreshing()
scrollViewDidEndDragging(collectionView, willDecelerate: true)
}
}
private class DraggingScrollView: UIScrollView {
override var isDragging: Bool {
true
}
}
| 31.157534 | 131 | 0.697296 |
0cf19d7af68dc81b523b12d529be9b1094af28ac | 891 | py | Python | setup.py | jjhelmus/break_my_python | 4f8165fa3ae2bbe72b21f49156598387ee18b94a | [
"BSD-3-Clause"
] | null | null | null | setup.py | jjhelmus/break_my_python | 4f8165fa3ae2bbe72b21f49156598387ee18b94a | [
"BSD-3-Clause"
] | null | null | null | setup.py | jjhelmus/break_my_python | 4f8165fa3ae2bbe72b21f49156598387ee18b94a | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup
with open('README.md') as f:
long_description = f.read()
setup(
name='break_my_python',
version='0.0.2',
description='This package tries to breaks your python interpreter, do not install it',
long_description=long_description,
author='Jonathan J. Helmus',
author_email='jjhelmus@gmail.com',
url='http://pypi.python.org/pypi/break_my_python/',
license='LICENSE.txt',
py_modules=['break_my_python'],
data_files=[('/', ['break_my_python.pth'])],
classifiers=[
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
]
)
| 31.821429 | 90 | 0.655443 |
5a093c0f386f900625d577474c4acc7dc6232d00 | 229 | kt | Kotlin | permission-base/src/main/kotlin/com/github/b1412/permission/entity/Rule.kt | b1412/permission-api | e184a5313bab6a1485d6c48d3a8a7573e2ecd310 | [
"Apache-2.0"
] | 2 | 2019-09-05T05:37:08.000Z | 2019-11-12T04:38:55.000Z | permission-base/src/main/kotlin/com/github/b1412/permission/entity/Rule.kt | b1412/permission-api | e184a5313bab6a1485d6c48d3a8a7573e2ecd310 | [
"Apache-2.0"
] | 12 | 2019-09-04T14:24:32.000Z | 2019-10-05T04:12:02.000Z | permission-base/src/main/kotlin/com/github/b1412/permission/entity/Rule.kt | b1412/kotlin-cannon | ee02bf12022ad23b334cb90b3f314be048c3d8eb | [
"Apache-2.0"
] | 2 | 2021-02-22T22:05:06.000Z | 2021-02-23T21:34:14.000Z | package com.github.b1412.permission.entity
import com.github.b1412.api.entity.BaseEntity
import java.io.Serializable
import javax.persistence.Entity
@Entity
data class Rule(
var name: String?
) : BaseEntity(), Serializable
| 20.818182 | 45 | 0.79476 |
f017060fe8d577537062aa07dd5e2ceb544e0cb8 | 1,131 | js | JavaScript | backend/config/index.js | booker1337/booker_mvp | 63213ba47245fb91f86ace7c57007cd660fac154 | [
"MIT"
] | null | null | null | backend/config/index.js | booker1337/booker_mvp | 63213ba47245fb91f86ace7c57007cd660fac154 | [
"MIT"
] | 9 | 2020-08-18T07:32:29.000Z | 2020-09-17T17:21:30.000Z | backend/config/index.js | booker1337/booker_mvp | 63213ba47245fb91f86ace7c57007cd660fac154 | [
"MIT"
] | 3 | 2020-08-18T01:22:04.000Z | 2020-08-19T12:06:16.000Z | require('dotenv').config();
const logger = require('./../util/logger');
const crypto = require('crypto');
const NODE_ENV = process.env.NODE_ENV;
logger.info(`Server started in ${NODE_ENV} mode`);
if (!NODE_ENV) logger.error('No NODE_ENV was set!');
if (!process.env.DB_URI) logger.error('DB_URI was not found!');
if (process.env.DB_TEST_URI) logger.error('DB_TEST_URI is now depreciated. DB_URI is now used for all database connections, and you can safely remove this from your .env');
if (!process.env.JWT_SECRET) logger.error(`JWT_SECRET was not found! Generate 64 random bytes such as ${crypto.randomBytes(64).toString('hex')}`);
if (NODE_ENV !== 'test' && !process.env.LOGGER_LEVEL) logger.error('LOGGER_LEVEL was not found!');
if (NODE_ENV !== 'test' && !process.env.BOOKS_API_KEY) logger.error('BOOKS_API_KEY missing!');
const config = {
PORT: process.env.PORT || 3001,
DB_URI: process.env.DB_URI || process.env.DB_TEST_URI,
JWT_SECRET: process.env.JWT_SECRET,
LOGGER_LEVEL: process.env.LOGGER_LEVEL,
BOOKS_API_KEY: process.env.BOOKS_API_KEY,
};
logger.silly('Config Settings: ', config);
module.exports = config;
| 41.888889 | 172 | 0.737401 |
275ca0c07405b698bdb4edc7bebbfa70cf48d478 | 55 | css | CSS | src/css/ja-fix.css | noyanyan/ja.reactjs.org | 2505a2888acb4c099a6f80a1489a1f2f374282f5 | [
"CC-BY-4.0"
] | 175 | 2019-01-31T00:01:53.000Z | 2022-03-30T00:04:40.000Z | src/css/ja-fix.css | noyanyan/ja.reactjs.org | 2505a2888acb4c099a6f80a1489a1f2f374282f5 | [
"CC-BY-4.0"
] | 459 | 2019-01-31T00:13:53.000Z | 2022-03-31T15:26:45.000Z | src/css/ja-fix.css | noyanyan/ja.reactjs.org | 2505a2888acb4c099a6f80a1489a1f2f374282f5 | [
"CC-BY-4.0"
] | 165 | 2019-01-31T00:04:42.000Z | 2022-03-26T06:25:53.000Z | .em-ja {
font-weight: bolder;
font-style: normal;
} | 13.75 | 22 | 0.636364 |
1f978970a289c0ae40283e6f7e4a7ec72bfc4293 | 449 | css | CSS | src/pages/index.module.css | funnicus/helikuparinen.fi | 9239763ca7d36ea18d59a5e8a4f2dddd3fa89ab8 | [
"MIT"
] | 1 | 2021-12-22T14:51:55.000Z | 2021-12-22T14:51:55.000Z | src/pages/index.module.css | funnicus/helikuparinen.fi | 9239763ca7d36ea18d59a5e8a4f2dddd3fa89ab8 | [
"MIT"
] | null | null | null | src/pages/index.module.css | funnicus/helikuparinen.fi | 9239763ca7d36ea18d59a5e8a4f2dddd3fa89ab8 | [
"MIT"
] | null | null | null | .Header {
text-align: center;
font-family: sans-serif;
height: 100vh;
}
.Header header {
height: 100%;
padding: 35vh 0 0;
color: #000000;
}
.Header h1 {
font-size: 4em;
margin: auto;
color: #000000;
}
.Header h1 {
animation: fadeInHeader 2s ease-in both;
animation-delay: 2s;
}
@keyframes fadeInHeader {
0% {
opacity: 0;
transform: translate3d(0, -20%, 0);
}
100% {
opacity: 1;
transform: translate3d(0, 0, 0);
}
} | 13.606061 | 42 | 0.625835 |
e75d48becc02acab48c74bf07610eccd711f908c | 745 | js | JavaScript | src/games/.eslintrc.js | siggame/Cerveau | d327d7daa21c74617e74aec8a0dbde867828f22c | [
"MIT"
] | 9 | 2017-04-12T16:06:20.000Z | 2022-02-20T09:50:00.000Z | src/games/.eslintrc.js | siggame/Cerveau | d327d7daa21c74617e74aec8a0dbde867828f22c | [
"MIT"
] | 32 | 2015-10-02T16:45:27.000Z | 2020-11-07T15:08:40.000Z | src/games/.eslintrc.js | siggame/Cerveau | d327d7daa21c74617e74aec8a0dbde867828f22c | [
"MIT"
] | 12 | 2015-11-14T00:36:27.000Z | 2022-03-03T15:29:11.000Z | // @ts-check
/* eslint-env node */
/** @type {import("eslint").Linter.Config} */
const gamesEslintConfig = {
extends: ["../../.eslintrc.js"],
rules: {
// each GameObject file initially has unused variables, and sometimes
// the variables will never be used, but MUST be part of the function
// signature for the entire API to work.
"@typescript-eslint/no-unused-vars": "off",
// sometimes it's required to re-import a file because it was already
// imported by Creer written code.
"import/no-duplicates": "off",
"@typescript-eslint/require-await": "off",
},
};
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
module.exports = gamesEslintConfig;
| 32.391304 | 77 | 0.644295 |
3e870effdb88145a7ad0ec588c3d1fa22e0b1acc | 549 | h | C | include/engine.h | FlorianRossignol/TurnBaseServer | fabe91abdb107539b11f9633fbe463016f359d22 | [
"MIT"
] | null | null | null | include/engine.h | FlorianRossignol/TurnBaseServer | fabe91abdb107539b11f9633fbe463016f359d22 | [
"MIT"
] | null | null | null | include/engine.h | FlorianRossignol/TurnBaseServer | fabe91abdb107539b11f9633fbe463016f359d22 | [
"MIT"
] | null | null | null | #pragma once
#include <vector>
#include <system.h>
#include <SFML/Graphics/RenderWindow.hpp>
class Engine
{
public:
Engine();
void AddSystem(System* system);
void AddDrawSystem(DrawInterface* drawSystem);
void AddDrawImGuiSystem(DrawImGuiInterface* drawImGuiSystem);
void Run();
private:
void Init();
void Update(sf::Time dt);
void Destroy();
std::vector<System*> systems_;
std::vector<DrawInterface*> drawSystems_;
std::vector<DrawImGuiInterface*> drawImGuiSystems_;
sf::RenderWindow window_;
}; | 21.96 | 65 | 0.704918 |
0b296cbeff42f183e0f9446e0c1d52f582289ecd | 1,129 | py | Python | neuroscout/resources/dataset.py | jdkent/neuroscout | 67aaafdf883988e2048197dc9ce4559a28e3b7b6 | [
"BSD-3-Clause"
] | 5 | 2018-07-16T16:23:21.000Z | 2021-08-20T15:43:23.000Z | neuroscout/resources/dataset.py | jdkent/neuroscout | 67aaafdf883988e2048197dc9ce4559a28e3b7b6 | [
"BSD-3-Clause"
] | 719 | 2018-07-09T17:19:57.000Z | 2022-03-30T15:30:59.000Z | neuroscout/resources/dataset.py | jdkent/neuroscout | 67aaafdf883988e2048197dc9ce4559a28e3b7b6 | [
"BSD-3-Clause"
] | 9 | 2019-07-10T17:45:31.000Z | 2021-08-30T21:51:21.000Z | from flask_apispec import MethodResource, marshal_with, doc, use_kwargs
from webargs import fields
from ..models import Dataset
from ..core import cache
from .utils import first_or_404
from ..schemas.dataset import DatasetSchema
class DatasetResource(MethodResource):
@doc(tags=['dataset'], summary='Get dataset by id.')
@cache.cached(60 * 60 * 24 * 300, query_string=True)
@marshal_with(DatasetSchema)
def get(self, dataset_id):
return first_or_404(Dataset.query.filter_by(id=dataset_id))
class DatasetListResource(MethodResource):
@doc(tags=['dataset'], summary='Returns list of datasets.')
@use_kwargs({
'active_only': fields.Boolean(
missing=True, description="Return only active Datasets")
},
location='query')
@cache.cached(60 * 60 * 24 * 300, query_string=True)
@marshal_with(DatasetSchema(
many=True, exclude=['dataset_address', 'preproc_address', 'runs']))
def get(self, **kwargs):
query = {}
if kwargs.pop('active_only'):
query['active'] = True
return Dataset.query.filter_by(**query).all()
| 35.28125 | 75 | 0.680248 |
8efa51a06d21adb3542f47f52a0c0f180044e649 | 76 | rb | Ruby | db/schema.rb | mrfishball/TicTacToeRubyRails | 7b90998a9d7b596421b53297d8a67d7a9528feea | [
"MIT"
] | null | null | null | db/schema.rb | mrfishball/TicTacToeRubyRails | 7b90998a9d7b596421b53297d8a67d7a9528feea | [
"MIT"
] | 2 | 2018-10-31T21:18:11.000Z | 2018-11-12T17:44:52.000Z | db/schema.rb | mrfishball/TicTacToeRubyRails | 7b90998a9d7b596421b53297d8a67d7a9528feea | [
"MIT"
] | null | null | null | ActiveRecord::Schema.define(version: 0) do
enable_extension "plpgsql"
end
| 19 | 42 | 0.789474 |
7081222c9f84594a4873e05924c35b50ad2a8355 | 1,506 | go | Go | pkg/ml/train/intertitle/train.go | liampulles/cabiria | c651f97c98c87e4bcfbadac07b60e5699093df34 | [
"MIT"
] | null | null | null | pkg/ml/train/intertitle/train.go | liampulles/cabiria | c651f97c98c87e4bcfbadac07b60e5699093df34 | [
"MIT"
] | null | null | null | pkg/ml/train/intertitle/train.go | liampulles/cabiria | c651f97c98c87e4bcfbadac07b60e5699093df34 | [
"MIT"
] | null | null | null | package intertitle
import (
"bufio"
"encoding/csv"
"fmt"
"io"
"os"
"strconv"
"github.com/liampulles/cabiria/pkg/ml"
)
// Train loads a list of intensity stats pointed to by csvPath,
// and trains a predictive intertitle model which is saved to modelPath
func Train(csvPath string, modelPath string) error {
// Load
rawData, err := loadCsv(csvPath)
if err != nil {
return err
}
//Initializes a new KNN classifier
cls := ml.NewKNNClassifier(1)
//Do a training-test split
trainData, testData := ml.Split(rawData, 0.66)
err = cls.Fit(trainData)
if err != nil {
return err
}
// Determine pass-rate
passRate, err := ml.Test(cls, testData)
if err != nil {
return err
}
fmt.Printf("Pass rate on test data: %f%%\n", passRate*100)
// Save model
err = cls.Save(modelPath)
return err
}
func loadCsv(path string) ([]ml.Sample, error) {
csvFile, err := os.Open(path)
if err != nil {
return nil, err
}
reader := csv.NewReader(bufio.NewReader(csvFile))
var samples []ml.Sample
for {
line, err := reader.Read()
if err == io.EOF {
break
} else if err != nil {
return nil, err
}
sample := ml.Sample{}
for i := 0; i < len(line)-1; i++ {
f, err := strconv.ParseFloat(line[i], 64)
if err != nil {
return nil, err
}
sample.Input = append(sample.Input, f)
}
f, err := strconv.ParseFloat(line[len(line)-1], 64)
if err != nil {
return nil, err
}
sample.Output = []float64{f}
samples = append(samples, sample)
}
return samples, nil
}
| 19.815789 | 71 | 0.643426 |
2ffb8b8f4a13b67a4178e98fded02a57b07d99a3 | 2,522 | rs | Rust | src/main.rs | rbieniek/pdns-cli | 427382851aec29ede2d6764535c29dc9a4bac6c4 | [
"Apache-2.0"
] | 1 | 2022-02-05T06:59:45.000Z | 2022-02-05T06:59:45.000Z | src/main.rs | rbieniek/pdns-cli | 427382851aec29ede2d6764535c29dc9a4bac6c4 | [
"Apache-2.0"
] | null | null | null | src/main.rs | rbieniek/pdns-cli | 427382851aec29ede2d6764535c29dc9a4bac6c4 | [
"Apache-2.0"
] | null | null | null | // Copyright 2021 Cumulus Cloud Software und Consulting GmbH & Co KG
//
// 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.
use log::{info, LevelFilter};
use log4rs::append::console::{ConsoleAppender, Target};
use log4rs::Config;
use log4rs::config::{Appender, Root};
use log4rs::filter::threshold::ThresholdFilter;
use crate::app_config::cmd_line_parser::ApplicationConfiguration;
use crate::commands::command_handler::CommandHandler;
mod app_config;
mod rest_client;
mod pdns;
mod commands;
#[tokio::main]
async fn main() {
match ApplicationConfiguration::process_command_line() {
Ok(app_config) => {
setup_logger(&app_config);
info!("Using base URI {}", app_config.base_uri().clone());
let command_handler = CommandHandler::new(&app_config.base_uri(),
&app_config.api_key(), &app_config.zone_name());
let result = command_handler.execute_command(app_config.command());
match result.await {
Err(err) => panic!("Error executing ReST operation: {}", err),
_ => {}
}
}
Err(err) => panic!("Error parsing command line: {}", err)
}
}
fn setup_logger(app_config: &ApplicationConfiguration) -> () {
// Build a stdout logger.
let stdout = ConsoleAppender::builder().target(Target::Stdout).build();
// Log Trace level output to file where trace is the default level
// and the programmatically specified level to stderr.
let config = Config::builder()
.appender(
Appender::builder()
.filter(Box::new(ThresholdFilter::new(app_config.log_level())))
.build("stdout", Box::new(stdout)),
)
.build(
Root::builder()
.appender("stdout")
.build(LevelFilter
::Trace),
)
.unwrap();
// Use this to change log levels at runtime.
log4rs::init_config(config).unwrap();
}
| 35.027778 | 102 | 0.632831 |
4773cb71d6a0a781ae0c7ad7f5d00898e67a42b6 | 1,079 | html | HTML | manuscript/page-264/body.html | marvindanig/beyond-the-black-waters | 429258f7988abadf1f711c1585538ee9e39f6193 | [
"BlueOak-1.0.0",
"CC-BY-4.0",
"Unlicense"
] | null | null | null | manuscript/page-264/body.html | marvindanig/beyond-the-black-waters | 429258f7988abadf1f711c1585538ee9e39f6193 | [
"BlueOak-1.0.0",
"CC-BY-4.0",
"Unlicense"
] | null | null | null | manuscript/page-264/body.html | marvindanig/beyond-the-black-waters | 429258f7988abadf1f711c1585538ee9e39f6193 | [
"BlueOak-1.0.0",
"CC-BY-4.0",
"Unlicense"
] | null | null | null | <div class="leaf flex"><div class="inner justify"><p class="no-indent ">gone to see the rajah’s fireworks. No fires were lighted in the compound, no lamp in the dwelling. It was with some difficulty that even the door was opened to receive the master of the house. The furniture was in the holland wrappings in which Io had left her things when expecting to be absent for weeks. It was a dreary coming home, but more congenial to sad feelings than a cheerful greeting would have been.</p><p>“I will go to rest at once,” said Io. Nature was demanding sleep; after the last two terrible nights the lady could scarcely keep her eyes open.</p><p>“Shall we first pray together?” suggested Oscar.</p><p class=" stretch-last-line ">Blessed rift in the dark, dark cloud! Oscar could at last kneel down by the side of his wife and pray aloud. And what a prayer was his! It seemed to be poured out at the feet of a Saviour in visible presence—a pleading, imploring prayer for mercy on the guiltiest of the guilty. But it was a prayer uttered in faith and hope—faith that</p></div> </div> | 1,079 | 1,079 | 0.764597 |
f7915a332223eeb9ae57424a0a936fde2d8f2303 | 6,018 | h | C | qemu-4.2.0/roms/u-boot-sam460ex/arch/arm/include/asm/arch-at91/at91_pio.h | MisaZhu/qemu_raspi | 50d71ce87bb39470e6725f7428e4b6b9e1ed0359 | [
"Apache-2.0"
] | 8 | 2020-09-06T12:49:00.000Z | 2022-03-09T04:02:06.000Z | src/qemu/src-pmp/roms/u-boot-sam460ex/arch/arm/include/asm/arch-at91/at91_pio.h | newthis/PMP | ef5e05fb4612bb622a9e1039f772c6234b87df7d | [
"MIT"
] | null | null | null | src/qemu/src-pmp/roms/u-boot-sam460ex/arch/arm/include/asm/arch-at91/at91_pio.h | newthis/PMP | ef5e05fb4612bb622a9e1039f772c6234b87df7d | [
"MIT"
] | 7 | 2020-09-08T15:14:34.000Z | 2021-06-24T18:03:49.000Z | /*
* [origin: Linux kernel include/asm-arm/arch-at91/at91_pio.h]
*
* Copyright (C) 2005 Ivan Kokshaysky
* Copyright (C) SAN People
* Copyright (C) 2009 Jens Scharsig (js_at_ng@scharsoft.de)
*
* Parallel I/O Controller (PIO) - System peripherals registers.
* Based on AT91RM9200 datasheet revision E.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef AT91_PIO_H
#define AT91_PIO_H
#define AT91_ASM_PIO_RANGE 0x200
#define AT91_ASM_PIOC_ASR \
(AT91_PIO_BASE + AT91_PIO_PORTC * AT91_ASM_PIO_RANGE + 0x70)
#define AT91_ASM_PIOC_BSR \
(AT91_PIO_BASE + AT91_PIO_PORTC * AT91_ASM_PIO_RANGE + 0x74)
#define AT91_ASM_PIOC_PDR \
(AT91_PIO_BASE + AT91_PIO_PORTC * AT91_ASM_PIO_RANGE + 0x04)
#define AT91_ASM_PIOC_PUDR \
(AT91_PIO_BASE + AT91_PIO_PORTC * AT91_ASM_PIO_RANGE + 0x60)
#define AT91_ASM_PIOD_PDR \
(AT91_PIO_BASE + AT91_PIO_PORTD * AT91_ASM_PIO_RANGE + 0x04)
#define AT91_ASM_PIOD_PUDR \
(AT91_PIO_BASE + AT91_PIO_PORTD * AT91_ASM_PIO_RANGE + 0x60)
#define AT91_ASM_PIOD_ASR \
(AT91_PIO_BASE + AT91_PIO_PORTD * AT91_ASM_PIO_RANGE + 0x70)
#ifndef __ASSEMBLY__
typedef struct at91_port {
u32 per; /* 0x00 PIO Enable Register */
u32 pdr; /* 0x04 PIO Disable Register */
u32 psr; /* 0x08 PIO Status Register */
u32 reserved0;
u32 oer; /* 0x10 Output Enable Register */
u32 odr; /* 0x14 Output Disable Registerr */
u32 osr; /* 0x18 Output Status Register */
u32 reserved1;
u32 ifer; /* 0x20 Input Filter Enable Register */
u32 ifdr; /* 0x24 Input Filter Disable Register */
u32 ifsr; /* 0x28 Input Filter Status Register */
u32 reserved2;
u32 sodr; /* 0x30 Set Output Data Register */
u32 codr; /* 0x34 Clear Output Data Register */
u32 odsr; /* 0x38 Output Data Status Register */
u32 pdsr; /* 0x3C Pin Data Status Register */
u32 ier; /* 0x40 Interrupt Enable Register */
u32 idr; /* 0x44 Interrupt Disable Register */
u32 imr; /* 0x48 Interrupt Mask Register */
u32 isr; /* 0x4C Interrupt Status Register */
u32 mder; /* 0x50 Multi-driver Enable Register */
u32 mddr; /* 0x54 Multi-driver Disable Register */
u32 mdsr; /* 0x58 Multi-driver Status Register */
u32 reserved3;
u32 pudr; /* 0x60 Pull-up Disable Register */
u32 puer; /* 0x64 Pull-up Enable Register */
u32 pusr; /* 0x68 Pad Pull-up Status Register */
u32 reserved4;
u32 asr; /* 0x70 Select A Register */
u32 bsr; /* 0x74 Select B Register */
u32 absr; /* 0x78 AB Select Status Register */
u32 reserved5[9]; /* */
u32 ower; /* 0xA0 Output Write Enable Register */
u32 owdr; /* 0xA4 Output Write Disable Register */
u32 owsr; /* OxA8 utput Write Status Register */
u32 reserved6[85];
} at91_port_t;
#if defined(CONFIG_AT91SAM9260) || defined(CONFIG_AT91SAM9261) || \
defined(CONFIG_AT91SAM9G10) || defined(CONFIG_AT91SAM9G20)
#define AT91_PIO_PORTS 3
#elif defined(CONFIG_AT91SAM9263) || defined(CONFIG_AT91SAM9G45) || \
defined(CONFIG_AT91SAM9M10G45)
#define AT91_PIO_PORTS 5
#elif defined(CONFIG_AT91RM9200) || defined(CONFIG_AT91CAP9) || \
defined(CONFIG_AT91SAM9RL)
#define AT91_PIO_PORTS 4
#else
#error "Unsupported cpu. Please update at91_pio.h"
#endif
typedef union at91_pio {
struct {
at91_port_t pioa;
at91_port_t piob;
at91_port_t pioc;
#if (AT91_PIO_PORTS > 3)
at91_port_t piod;
#endif
#if (AT91_PIO_PORTS > 4)
at91_port_t pioe;
#endif
} ;
at91_port_t port[AT91_PIO_PORTS];
} at91_pio_t;
#ifdef CONFIG_AT91_GPIO
int at91_set_a_periph(unsigned port, unsigned pin, int use_pullup);
int at91_set_b_periph(unsigned port, unsigned pin, int use_pullup);
int at91_set_pio_input(unsigned port, unsigned pin, int use_pullup);
int at91_set_pio_multi_drive(unsigned port, unsigned pin, int is_on);
int at91_set_pio_output(unsigned port, unsigned pin, int value);
int at91_set_pio_periph(unsigned port, unsigned pin, int use_pullup);
int at91_set_pio_pullup(unsigned port, unsigned pin, int use_pullup);
int at91_set_pio_deglitch(unsigned port, unsigned pin, int is_on);
int at91_set_pio_value(unsigned port, unsigned pin, int value);
int at91_get_pio_value(unsigned port, unsigned pin);
#endif
#endif
#define AT91_PIO_PORTA 0x0
#define AT91_PIO_PORTB 0x1
#define AT91_PIO_PORTC 0x2
#define AT91_PIO_PORTD 0x3
#define AT91_PIO_PORTE 0x4
#ifdef CONFIG_AT91_LEGACY
#define PIO_PER 0x00 /* Enable Register */
#define PIO_PDR 0x04 /* Disable Register */
#define PIO_PSR 0x08 /* Status Register */
#define PIO_OER 0x10 /* Output Enable Register */
#define PIO_ODR 0x14 /* Output Disable Register */
#define PIO_OSR 0x18 /* Output Status Register */
#define PIO_IFER 0x20 /* Glitch Input Filter Enable */
#define PIO_IFDR 0x24 /* Glitch Input Filter Disable */
#define PIO_IFSR 0x28 /* Glitch Input Filter Status */
#define PIO_SODR 0x30 /* Set Output Data Register */
#define PIO_CODR 0x34 /* Clear Output Data Register */
#define PIO_ODSR 0x38 /* Output Data Status Register */
#define PIO_PDSR 0x3c /* Pin Data Status Register */
#define PIO_IER 0x40 /* Interrupt Enable Register */
#define PIO_IDR 0x44 /* Interrupt Disable Register */
#define PIO_IMR 0x48 /* Interrupt Mask Register */
#define PIO_ISR 0x4c /* Interrupt Status Register */
#define PIO_MDER 0x50 /* Multi-driver Enable Register */
#define PIO_MDDR 0x54 /* Multi-driver Disable Register */
#define PIO_MDSR 0x58 /* Multi-driver Status Register */
#define PIO_PUDR 0x60 /* Pull-up Disable Register */
#define PIO_PUER 0x64 /* Pull-up Enable Register */
#define PIO_PUSR 0x68 /* Pull-up Status Register */
#define PIO_ASR 0x70 /* Peripheral A Select Register */
#define PIO_BSR 0x74 /* Peripheral B Select Register */
#define PIO_ABSR 0x78 /* AB Status Register */
#define PIO_OWER 0xa0 /* Output Write Enable Register */
#define PIO_OWDR 0xa4 /* Output Write Disable Register */
#define PIO_OWSR 0xa8 /* Output Write Status Register */
#endif
#endif
| 37.378882 | 71 | 0.745597 |
6ca44d321379702b5059fa6024728213234bafe4 | 1,998 | kt | Kotlin | remote/src/main/java/kr/ohyung/remote/response/CurrentLocationWeatherResponse.kt | androiddevnotesforks/android-mvi-redux | c1567d938af59c3ca09c8dc15675358ba1abc63a | [
"MIT"
] | 33 | 2020-10-26T09:16:17.000Z | 2021-08-17T07:55:00.000Z | remote/src/main/java/kr/ohyung/remote/response/CurrentLocationWeatherResponse.kt | JY-Dev/android-mvi-redux | 501261673ac1ed3fe539df2b8d14a37ee148554c | [
"MIT"
] | null | null | null | remote/src/main/java/kr/ohyung/remote/response/CurrentLocationWeatherResponse.kt | JY-Dev/android-mvi-redux | 501261673ac1ed3fe539df2b8d14a37ee148554c | [
"MIT"
] | 6 | 2020-11-07T21:52:54.000Z | 2021-06-18T05:46:50.000Z | /*
* Created by Lee Oh Hyung on 2020/10/18.
*/
package kr.ohyung.remote.response
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import kr.ohyung.data.model.WeatherDataModel
import kr.ohyung.remote.Response
@JsonClass(generateAdapter = true)
data class CurrentLocationWeatherResponse(
@field:Json(name = "cod")
val cod: Int,
@field:Json(name = "name")
val name: String,
@field:Json(name = "id")
val id: Int,
@field:Json(name = "coord")
val coord: Coord,
@field:Json(name = "weather")
val weather: List<Weather>,
@field:Json(name = "base")
val base: String,
@field:Json(name = "visibility")
val visibility: Int,
@field:Json(name = "main")
val main: Main
) : Response {
@JsonClass(generateAdapter = true)
data class Coord(
@field:Json(name = "lat")
val lat: Double,
@field:Json(name = "lon")
val lon: Double
)
@JsonClass(generateAdapter = true)
data class Weather(
@field:Json(name = "id")
val id: Int,
@field:Json(name = "main")
val main: String,
@field:Json(name = "description")
val description: String,
@field:Json(name = "icon")
val icon: String
)
@JsonClass(generateAdapter = true)
data class Main(
@field:Json(name = "temp")
val temp: Double,
@field:Json(name = "feels_like")
val feels_like: Double,
@field:Json(name = "temp_min")
val temp_min: Double,
@field:Json(name = "temp_max")
val temp_max: Double,
@field:Json(name = "pressure")
val pressure: Int,
@field:Json(name = "humidity")
val humidity: Int
)
}
fun CurrentLocationWeatherResponse.toDataModel() = WeatherDataModel(
latitude = coord.lat,
longitude = coord.lon,
weatherName = weather.first().main,
description = weather.first().description,
icon = weather.first().icon,
temp = main.temp
)
| 26.289474 | 68 | 0.60961 |
0a49eefbd8dcc13028ac0a1ebb08346781cec453 | 7,965 | h | C | TDEngine2/include/editor/EditorActions.h | bnoazx005/TDEngine2 | 93ebfecf8af791ff5ecd4f57525a6935e34cd05c | [
"Apache-2.0"
] | 1 | 2019-07-15T01:14:15.000Z | 2019-07-15T01:14:15.000Z | TDEngine2/include/editor/EditorActions.h | bnoazx005/TDEngine2 | 93ebfecf8af791ff5ecd4f57525a6935e34cd05c | [
"Apache-2.0"
] | 76 | 2018-10-27T16:59:36.000Z | 2022-03-30T17:40:39.000Z | TDEngine2/include/editor/EditorActions.h | bnoazx005/TDEngine2 | 93ebfecf8af791ff5ecd4f57525a6935e34cd05c | [
"Apache-2.0"
] | 1 | 2019-07-29T02:02:08.000Z | 2019-07-29T02:02:08.000Z | /*!
\file EditorActions.h
\date 19.04.2020
\authors Kasimov Ildar
*/
#pragma once
#include "../utils/Utils.h"
#include "../utils/Types.h"
#include "../core/IBaseObject.h"
#include "../core/CBaseObject.h"
#include "../math/TMatrix4.h"
#include "../math/TVector3.h"
#include "../math/TQuaternion.h"
#include <string>
#include <functional>
#if TDE2_EDITORS_ENABLED
namespace TDEngine2
{
/*!
interface IEditorAction
\brief The interface describes editor's action to provide undo/redo system
*/
class IEditorAction: public virtual IBaseObject
{
public:
/*!
\brief The method applies some action to global state of the application
\return RC_OK if everything went ok, or some other code, which describes an error
*/
TDE2_API virtual E_RESULT_CODE Execute() = 0;
/*!
\brief The method applies reversed action to restore previous state
\return RC_OK if everything went ok, or some other code, which describes an error
*/
TDE2_API virtual E_RESULT_CODE Restore() = 0;
/*!
\brief The method converts the state of the action into a string
\return A string which contains type information and other additional information
*/
TDE2_API virtual std::string ToString() const = 0;
protected:
DECLARE_INTERFACE_PROTECTED_MEMBERS(IEditorAction)
};
/*!
interface IEditorActionsHistory
\brief The interface describes a functionality of actions log for the editor
*/
class IEditorActionsHistory: public virtual IBaseObject
{
public:
/*!
\brief The method initializes internal state of the object
\return RC_OK if everything went ok, or some other code, which describes an error
*/
TDE2_API virtual E_RESULT_CODE Init() = 0;
/*!
\brief The method pushes given action into the log
\param[in] pAction A pointer to IEditorAction implementation
\return RC_OK if everything went ok, or some other code, which describes an error
*/
TDE2_API virtual E_RESULT_CODE PushAndExecuteAction(IEditorAction* pAction) = 0;
/*!
\brief The method extracts last added action from the log
\return The method retrieves either a pointer to last added action or returnrs an error code
*/
TDE2_API virtual TResult<CScopedPtr<IEditorAction>> PopAction() = 0;
/*!
\brief The method rolls back last editor's action
\return RC_OK if everything went ok, or some other code, which describes an error
*/
TDE2_API virtual E_RESULT_CODE ExecuteUndo() = 0;
/*!
\brief The method applies latest rolled back editor's action
\return RC_OK if everything went ok, or some other code, which describes an error
*/
TDE2_API virtual E_RESULT_CODE ExecuteRedo() = 0;
/*!
\brief The method dumps current state of the log into the logger. The oldest actions are outputed
at last momemnt
*/
TDE2_API virtual void Dump() const = 0;
protected:
DECLARE_INTERFACE_PROTECTED_MEMBERS(IEditorActionsHistory)
};
class IEditorWindow;
class IWorld;
typedef struct TSRTEntity
{
TVector3 mPosition;
TQuaternion mRotation;
TVector3 mScale;
} TSRTEntity;
/*!
\brief A factory function for creation objects of CTransformObjectAction's type
\param[in, out] pWorld A pointer to IWorld implementation
\param[in] entityId Identifier of changed object
\param[in] transform A matrix that represents a new transform that should be applied to the object
\param[out] result Contains RC_OK if everything went ok, or some other code, which describes an error
\return A pointer to CTransformObjectAction's implementation
*/
TDE2_API IEditorAction* CreateTransformObjectAction(IWorld* pWorld, TEntityId entityId, const TSRTEntity& transform, E_RESULT_CODE& result);
/*!
class CTransformObjectAction
\brief The class implement redo action for the editor
*/
class CTransformObjectAction : public IEditorAction, public CBaseObject
{
public:
friend TDE2_API IEditorAction* CreateTransformObjectAction(IWorld*, TEntityId, const TSRTEntity&, E_RESULT_CODE&);
public:
/*!
\brief The method initializes state of the object
\param[in, out] pWorld A pointer to IWorld implementation
\param[in] entityId Identifier of changed object
\param[in] transform A matrix that represents a new transform that should be applied to the object
\return RC_OK if everything went ok, or some other code, which describes an error
*/
TDE2_API E_RESULT_CODE Init(IWorld* pWorld, TEntityId entityId, const TSRTEntity& transform);
/*!
\brief The method frees all memory occupied by the object
\return RC_OK if everything went ok, or some other code, which describes an error
*/
TDE2_API E_RESULT_CODE Free() override;
/*!
\brief The method applies some action to global state of the application
\return RC_OK if everything went ok, or some other code, which describes an error
*/
TDE2_API E_RESULT_CODE Execute() override;
/*!
\brief The method applies reversed action to restore previous state
\return RC_OK if everything went ok, or some other code, which describes an error
*/
TDE2_API E_RESULT_CODE Restore() override;
/*!
\brief The method converts the state of the action into a string
\return A string which contains type information and other additional information
*/
TDE2_API std::string ToString() const override;
protected:
DECLARE_INTERFACE_IMPL_PROTECTED_MEMBERS(CTransformObjectAction)
TDE2_API E_RESULT_CODE _changeTransform();
protected:
IWorld* mpWorld;
TEntityId mEntityId;
TSRTEntity mTransform;
};
/*!
\brief A factory function for creation objects of CCommandAction's type
\param[in] doAction A callback that implements forward action
\param[in] undoAction A callback that cancel previously applied action
\param[out] result Contains RC_OK if everything went ok, or some other code, which describes an error
\return A pointer to CCommandAction's implementation
*/
TDE2_API IEditorAction* CreateCommandAction(const std::function<void()>& doAction, const std::function<void()>& undoAction, E_RESULT_CODE& result);
/*!
class CCommandAction
\brief The class implement common action for the editor
*/
class CCommandAction : public IEditorAction, public CBaseObject
{
public:
typedef std::function<void()> TCommandFunctor;
public:
friend TDE2_API IEditorAction* CreateCommandAction(const TCommandFunctor&, const TCommandFunctor&, E_RESULT_CODE&);
public:
/*!
\brief The method initializes state of the object
\param[in] doAction A callback that implements forward action
\param[in] undoAction A callback that cancel previously applied action
\return RC_OK if everything went ok, or some other code, which describes an error
*/
TDE2_API E_RESULT_CODE Init(const TCommandFunctor& doAction, const TCommandFunctor& undoAction);
/*!
\brief The method frees all memory occupied by the object
\return RC_OK if everything went ok, or some other code, which describes an error
*/
TDE2_API E_RESULT_CODE Free() override;
/*!
\brief The method applies some action to global state of the application
\return RC_OK if everything went ok, or some other code, which describes an error
*/
TDE2_API E_RESULT_CODE Execute() override;
/*!
\brief The method applies reversed action to restore previous state
\return RC_OK if everything went ok, or some other code, which describes an error
*/
TDE2_API E_RESULT_CODE Restore() override;
/*!
\brief The method converts the state of the action into a string
\return A string which contains type information and other additional information
*/
TDE2_API std::string ToString() const override;
protected:
DECLARE_INTERFACE_IMPL_PROTECTED_MEMBERS(CCommandAction)
protected:
TCommandFunctor mDoActionCallback;
TCommandFunctor mUndoActionCallback;
};
}
#endif | 27.1843 | 148 | 0.736723 |
991c28df4ce7e1c35be3e8be84f8956fe4bb9f15 | 13,888 | c | C | machine_learning/slprj/raccel/fuzzy_simulator_intellihire/fuzzy_simulator_intellihire_data.c | caxenie/intellihire | 3f8e4a6ffc785410c9daada0395075eb4f629bb7 | [
"MIT"
] | null | null | null | machine_learning/slprj/raccel/fuzzy_simulator_intellihire/fuzzy_simulator_intellihire_data.c | caxenie/intellihire | 3f8e4a6ffc785410c9daada0395075eb4f629bb7 | [
"MIT"
] | null | null | null | machine_learning/slprj/raccel/fuzzy_simulator_intellihire/fuzzy_simulator_intellihire_data.c | caxenie/intellihire | 3f8e4a6ffc785410c9daada0395075eb4f629bb7 | [
"MIT"
] | 1 | 2020-01-05T01:20:37.000Z | 2020-01-05T01:20:37.000Z | #include "__cf_fuzzy_simulator_intellihire.h"
#include "fuzzy_simulator_intellihire.h"
#include "fuzzy_simulator_intellihire_private.h"
P rtP = { 1.0 , 1.0 , 2.0 , 0.0 , 0.0 , 0.0 , 2.0 , 0.0 , 1.0 , 2.0 , 1.0 ,
2.0 , 0.0 , 2.0 , 1.0 , 2.0 , 2.0 , 3.0 , 1.0 , 1.0 , 1.0 , 3.0 , 1.0 , 2.0 ,
3.0 , 2.0 , 3.0 , 1.0 , 3.0 , 2.0 , 3.0 , 3.0 , 4.0 , 2.0 , 2.0 , 2.0 , 4.0 ,
2.0 , 3.0 , 4.0 , 3.0 , 4.0 , 2.0 , 4.0 , 3.0 , 0.0 , 0.0 , 1.0 , 1.0 , 0.0 ,
0.0 , 1.0 , 1.0 , 0.0 , 0.0 , 1.0 , 1.0 , 0.0 , 0.0 , 1.0 , 1.0 , 0.0 , 0.0 ,
1.0 , 1.0 , 0.0 , 0.0 , 1.0 , 1.0 , 0.0 , 1.0 , 0.0 , 0.0 , 1.0 , 1.0 , 0.0 ,
0.0 , 1.0 , 1.0 , 0.0 , 0.0 , 1.0 , 1.0 , 0.0 , 0.0 , 1.0 , 1.0 , 0.0 , 0.0 ,
1.0 , 1.0 , 0.0 , 0.0 , 1.0 , 1.0 , 0.0 , 0.0 , 1.0 , 1.0 , 0.0 , 0.0 , 1.0 ,
1.0 , 0.0 , 0.0 , 1.0 , 1.0 , { 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0
, 9.0 , 10.0 , 11.0 , 12.0 , 13.0 , 14.0 , 15.0 , 16.0 , 17.0 , 18.0 , 19.0 ,
20.0 , 21.0 , 22.0 , 23.0 , 24.0 , 25.0 , 26.0 , 27.0 , 28.0 , 29.0 , 30.0 ,
31.0 , 32.0 , 33.0 , 34.0 , 35.0 , 36.0 , 37.0 , 38.0 , 39.0 , 40.0 , 41.0 ,
42.0 , 43.0 , 44.0 , 45.0 , 46.0 , 47.0 , 48.0 , 49.0 , 50.0 , 51.0 , 52.0 ,
53.0 , 54.0 , 55.0 , 56.0 , 57.0 , 58.0 , 59.0 , 60.0 , 61.0 , 62.0 , 63.0 ,
64.0 , 65.0 , 66.0 , 67.0 , 68.0 , 69.0 , 70.0 , 71.0 , 72.0 , 73.0 , 74.0 ,
75.0 , 76.0 , 77.0 , 78.0 , 79.0 , 80.0 , 81.0 , 82.0 , 83.0 , 84.0 , 85.0 ,
86.0 , 87.0 , 88.0 , 89.0 , 90.0 , 91.0 , 92.0 , 93.0 , 94.0 , 95.0 , 96.0 ,
97.0 , 98.0 , 99.0 , 100.0 } , { 3.0 , 3.0 , 3.0 , 2.0 , 3.0 , 3.0 , 3.0 ,
3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 2.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 ,
2.0 , 3.0 , 2.0 , 3.0 , 3.0 , 1.0 , 3.0 , 2.0 , 3.0 , 3.0 , 2.0 , 3.0 , 3.0 ,
1.0 , 3.0 , 3.0 , 2.0 , 3.0 , 2.0 , 3.0 , 1.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 ,
3.0 , 3.0 , 3.0 , 2.0 , 3.0 , 3.0 , 3.0 , 1.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 ,
3.0 , 1.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 2.0 , 3.0 , 3.0 , 2.0 , 3.0 ,
3.0 , 2.0 , 1.0 , 2.0 , 2.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 1.0 , 2.0 , 3.0 ,
3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 2.0 , 2.0 , 3.0 , 3.0 , 3.0 , 3.0 , 2.0 , 2.0 ,
3.0 , 3.0 } , { 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 , 9.0 , 10.0 ,
11.0 , 12.0 , 13.0 , 14.0 , 15.0 , 16.0 , 17.0 , 18.0 , 19.0 , 20.0 , 21.0 ,
22.0 , 23.0 , 24.0 , 25.0 , 26.0 , 27.0 , 28.0 , 29.0 , 30.0 , 31.0 , 32.0 ,
33.0 , 34.0 , 35.0 , 36.0 , 37.0 , 38.0 , 39.0 , 40.0 , 41.0 , 42.0 , 43.0 ,
44.0 , 45.0 , 46.0 , 47.0 , 48.0 , 49.0 , 50.0 , 51.0 , 52.0 , 53.0 , 54.0 ,
55.0 , 56.0 , 57.0 , 58.0 , 59.0 , 60.0 , 61.0 , 62.0 , 63.0 , 64.0 , 65.0 ,
66.0 , 67.0 , 68.0 , 69.0 , 70.0 , 71.0 , 72.0 , 73.0 , 74.0 , 75.0 , 76.0 ,
77.0 , 78.0 , 79.0 , 80.0 , 81.0 , 82.0 , 83.0 , 84.0 , 85.0 , 86.0 , 87.0 ,
88.0 , 89.0 , 90.0 , 91.0 , 92.0 , 93.0 , 94.0 , 95.0 , 96.0 , 97.0 , 98.0 ,
99.0 , 100.0 } , { 3.0 , 3.0 , 3.0 , 2.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0
, 3.0 , 3.0 , 2.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 2.0 , 3.0 , 2.0
, 3.0 , 3.0 , 1.0 , 3.0 , 2.0 , 3.0 , 3.0 , 2.0 , 3.0 , 3.0 , 1.0 , 3.0 , 3.0
, 2.0 , 3.0 , 2.0 , 3.0 , 1.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0
, 2.0 , 3.0 , 3.0 , 3.0 , 1.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 1.0 , 3.0
, 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 2.0 , 3.0 , 3.0 , 2.0 , 3.0 , 3.0 , 2.0 , 1.0
, 2.0 , 2.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 1.0 , 2.0 , 3.0 , 3.0 , 3.0 , 3.0
, 3.0 , 3.0 , 2.0 , 2.0 , 3.0 , 3.0 , 3.0 , 3.0 , 2.0 , 2.0 , 3.0 , 3.0 } , {
1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 , 9.0 , 10.0 , 11.0 , 12.0 ,
13.0 , 14.0 , 15.0 , 16.0 , 17.0 , 18.0 , 19.0 , 20.0 , 21.0 , 22.0 , 23.0 ,
24.0 , 25.0 , 26.0 , 27.0 , 28.0 , 29.0 , 30.0 , 31.0 , 32.0 , 33.0 , 34.0 ,
35.0 , 36.0 , 37.0 , 38.0 , 39.0 , 40.0 , 41.0 , 42.0 , 43.0 , 44.0 , 45.0 ,
46.0 , 47.0 , 48.0 , 49.0 , 50.0 , 51.0 , 52.0 , 53.0 , 54.0 , 55.0 , 56.0 ,
57.0 , 58.0 , 59.0 , 60.0 , 61.0 , 62.0 , 63.0 , 64.0 , 65.0 , 66.0 , 67.0 ,
68.0 , 69.0 , 70.0 , 71.0 , 72.0 , 73.0 , 74.0 , 75.0 , 76.0 , 77.0 , 78.0 ,
79.0 , 80.0 , 81.0 , 82.0 , 83.0 , 84.0 , 85.0 , 86.0 , 87.0 , 88.0 , 89.0 ,
90.0 , 91.0 , 92.0 , 93.0 , 94.0 , 95.0 , 96.0 , 97.0 , 98.0 , 99.0 , 100.0 }
, { 3.0 , 3.0 , 3.0 , 2.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 ,
2.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 2.0 , 3.0 , 2.0 , 3.0 , 3.0 ,
1.0 , 3.0 , 2.0 , 3.0 , 3.0 , 2.0 , 3.0 , 3.0 , 1.0 , 3.0 , 3.0 , 2.0 , 3.0 ,
2.0 , 3.0 , 1.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 2.0 , 3.0 ,
3.0 , 3.0 , 1.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 1.0 , 3.0 , 3.0 , 3.0 ,
3.0 , 3.0 , 3.0 , 2.0 , 3.0 , 3.0 , 2.0 , 3.0 , 3.0 , 2.0 , 1.0 , 2.0 , 2.0 ,
3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 1.0 , 2.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 ,
2.0 , 2.0 , 3.0 , 3.0 , 3.0 , 3.0 , 2.0 , 2.0 , 3.0 , 3.0 } , { 1.0 , 2.0 ,
3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 , 9.0 , 10.0 , 11.0 , 12.0 , 13.0 , 14.0 ,
15.0 , 16.0 , 17.0 , 18.0 , 19.0 , 20.0 , 21.0 , 22.0 , 23.0 , 24.0 , 25.0 ,
26.0 , 27.0 , 28.0 , 29.0 , 30.0 , 31.0 , 32.0 , 33.0 , 34.0 , 35.0 , 36.0 ,
37.0 , 38.0 , 39.0 , 40.0 , 41.0 , 42.0 , 43.0 , 44.0 , 45.0 , 46.0 , 47.0 ,
48.0 , 49.0 , 50.0 , 51.0 , 52.0 , 53.0 , 54.0 , 55.0 , 56.0 , 57.0 , 58.0 ,
59.0 , 60.0 , 61.0 , 62.0 , 63.0 , 64.0 , 65.0 , 66.0 , 67.0 , 68.0 , 69.0 ,
70.0 , 71.0 , 72.0 , 73.0 , 74.0 , 75.0 , 76.0 , 77.0 , 78.0 , 79.0 , 80.0 ,
81.0 , 82.0 , 83.0 , 84.0 , 85.0 , 86.0 , 87.0 , 88.0 , 89.0 , 90.0 , 91.0 ,
92.0 , 93.0 , 94.0 , 95.0 , 96.0 , 97.0 , 98.0 , 99.0 , 100.0 } , { 3.0 , 3.0
, 3.0 , 2.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 2.0 , 3.0 , 3.0
, 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 2.0 , 3.0 , 2.0 , 3.0 , 3.0 , 1.0 , 3.0 , 2.0
, 3.0 , 3.0 , 2.0 , 3.0 , 3.0 , 1.0 , 3.0 , 3.0 , 2.0 , 3.0 , 2.0 , 3.0 , 1.0
, 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 2.0 , 3.0 , 3.0 , 3.0 , 1.0
, 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 1.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0
, 2.0 , 3.0 , 3.0 , 2.0 , 3.0 , 3.0 , 2.0 , 1.0 , 2.0 , 2.0 , 3.0 , 3.0 , 3.0
, 3.0 , 3.0 , 1.0 , 2.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 2.0 , 2.0 , 3.0
, 3.0 , 3.0 , 3.0 , 2.0 , 2.0 , 3.0 , 3.0 } , { 1.0 , 1.04 , 1.08 , 1.12 ,
1.16 , 1.2 , 1.24 , 1.28 , 1.32 , 1.3599999999999999 , 1.4 , 1.44 , 1.48 ,
1.52 , 1.56 , 1.6 , 1.6400000000000001 , 1.6800000000000002 , 1.72 , 1.76 ,
1.8 , 1.8399999999999999 , 1.88 , 1.92 , 1.96 , 2.0 , 2.04 , 2.08 , 2.12 ,
2.16 , 2.2 , 2.24 , 2.2800000000000002 , 2.3200000000000003 ,
2.3600000000000003 , 2.4 , 2.44 , 2.48 , 2.52 , 2.56 , 2.6 ,
2.6399999999999997 , 2.6799999999999997 , 2.7199999999999998 , 2.76 , 2.8 ,
2.84 , 2.88 , 2.92 , 2.96 , 3.0 , 3.04 , 3.08 , 3.12 , 3.16 , 3.2 , 3.24 ,
3.28 , 3.32 , 3.36 , 3.4 , 3.44 , 3.48 , 3.52 , 3.56 , 3.6 , 3.64 , 3.68 ,
3.72 , 3.76 , 3.8 , 3.84 , 3.88 , 3.92 , 3.96 , 4.0 , 4.04 , 4.08 , 4.12 ,
4.16 , 4.2 , 4.24 , 4.2799999999999994 , 4.32 , 4.3599999999999994 , 4.4 ,
4.4399999999999995 , 4.48 , 4.52 , 4.5600000000000005 , 4.6 ,
4.6400000000000006 , 4.68 , 4.7200000000000006 , 4.76 , 4.8 , 4.84 , 4.88 ,
4.92 , 4.96 , 5.0 } , 1.0 , { 1.0 , 2.0 , 3.0 , 4.0 , 5.0 , 6.0 , 7.0 , 8.0 ,
9.0 , 10.0 , 11.0 , 12.0 , 13.0 , 14.0 , 15.0 , 16.0 , 17.0 , 18.0 , 19.0 ,
20.0 , 21.0 , 22.0 , 23.0 , 24.0 , 25.0 , 26.0 , 27.0 , 28.0 , 29.0 , 30.0 ,
31.0 , 32.0 , 33.0 , 34.0 , 35.0 , 36.0 , 37.0 , 38.0 , 39.0 , 40.0 , 41.0 ,
42.0 , 43.0 , 44.0 , 45.0 , 46.0 , 47.0 , 48.0 , 49.0 , 50.0 , 51.0 , 52.0 ,
53.0 , 54.0 , 55.0 , 56.0 , 57.0 , 58.0 , 59.0 , 60.0 , 61.0 , 62.0 , 63.0 ,
64.0 , 65.0 , 66.0 , 67.0 , 68.0 , 69.0 , 70.0 , 71.0 , 72.0 , 73.0 , 74.0 ,
75.0 , 76.0 , 77.0 , 78.0 , 79.0 , 80.0 , 81.0 , 82.0 , 83.0 , 84.0 , 85.0 ,
86.0 , 87.0 , 88.0 , 89.0 , 90.0 , 91.0 , 92.0 , 93.0 , 94.0 , 95.0 , 96.0 ,
97.0 , 98.0 , 99.0 , 100.0 } , { 3.0 , 3.0 , 3.0 , 2.0 , 1.0 , 3.0 , 3.0 ,
3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 2.0 , 1.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 2.0 ,
3.0 , 3.0 , 2.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 ,
3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 1.0 , 3.0 , 3.0 , 3.0 , 3.0 ,
1.0 , 3.0 , 1.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 2.0 , 2.0 , 3.0 , 3.0 ,
3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 2.0 , 3.0 ,
1.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 2.0 , 3.0 , 3.0 , 3.0 , 3.0 ,
3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 3.0 , 1.0 , 3.0 ,
3.0 , 3.0 } , { 1.0 , 0.96 , 0.91999999999999993 , 0.87999999999999989 ,
0.84000000000000008 , 0.8 , 0.76 , 0.72 , 0.67999999999999994 ,
0.64000000000000012 , 0.60000000000000009 , 0.56 , 0.52 , 0.48 ,
0.43999999999999995 , 0.39999999999999991 , 0.35999999999999988 ,
0.31999999999999984 , 0.28 , 0.24 , 0.19999999999999996 , 0.16000000000000014
, 0.12000000000000011 , 0.080000000000000071 , 0.040000000000000036 , 0.0 ,
0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ,
0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ,
0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ,
0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ,
0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ,
0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 } , 1.0 , { 0.0 ,
0.040000000000000036 , 0.080000000000000071 , 0.12000000000000011 ,
0.15999999999999992 , 0.19999999999999996 , 0.24 , 0.28 , 0.32000000000000006
, 0.35999999999999988 , 0.39999999999999991 , 0.43999999999999995 , 0.48 ,
0.52 , 0.56 , 0.60000000000000009 , 0.64000000000000012 , 0.68000000000000016
, 0.72 , 0.76 , 0.8 , 0.83999999999999986 , 0.87999999999999989 ,
0.91999999999999993 , 0.96 , 1.0 , 0.96 , 0.91999999999999993 ,
0.87999999999999989 , 0.83999999999999986 , 0.79999999999999982 ,
0.75999999999999979 , 0.71999999999999975 , 0.67999999999999972 ,
0.63999999999999968 , 0.60000000000000009 , 0.56 , 0.52 , 0.48 ,
0.43999999999999995 , 0.39999999999999991 , 0.36000000000000032 ,
0.32000000000000028 , 0.28000000000000025 , 0.24000000000000021 ,
0.20000000000000018 , 0.16000000000000014 , 0.12000000000000011 ,
0.080000000000000071 , 0.040000000000000036 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ,
0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ,
0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ,
0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ,
0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 } , 1.0 , { 0.0 , 0.0 , 0.0 , 0.0 ,
0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ,
0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.040000000000000036 ,
0.080000000000000071 , 0.12000000000000011 , 0.16000000000000014 ,
0.20000000000000018 , 0.24000000000000021 , 0.28000000000000025 ,
0.32000000000000028 , 0.36000000000000032 , 0.39999999999999991 ,
0.43999999999999995 , 0.48 , 0.52 , 0.56 , 0.60000000000000009 ,
0.63999999999999968 , 0.67999999999999972 , 0.71999999999999975 ,
0.75999999999999979 , 0.79999999999999982 , 0.83999999999999986 ,
0.87999999999999989 , 0.91999999999999993 , 0.96 , 1.0 , 0.96 ,
0.91999999999999993 , 0.87999999999999989 , 0.83999999999999986 ,
0.79999999999999982 , 0.75999999999999979 , 0.7200000000000002 ,
0.68000000000000016 , 0.64000000000000012 , 0.60000000000000009 , 0.56 , 0.52
, 0.48 , 0.43999999999999995 , 0.39999999999999991 , 0.35999999999999988 ,
0.31999999999999984 , 0.2799999999999998 , 0.24000000000000021 ,
0.20000000000000018 , 0.16000000000000014 , 0.12000000000000011 ,
0.080000000000000071 , 0.040000000000000036 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ,
0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ,
0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 } , 1.0 , { 0.0 , 0.0 , 0.0 ,
0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ,
0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ,
0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ,
0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.040000000000000036 ,
0.080000000000000071 , 0.12000000000000011 , 0.16000000000000014 ,
0.20000000000000018 , 0.24000000000000021 , 0.2799999999999998 ,
0.31999999999999984 , 0.35999999999999988 , 0.39999999999999991 ,
0.43999999999999995 , 0.48 , 0.52 , 0.56 , 0.60000000000000009 ,
0.64000000000000012 , 0.68000000000000016 , 0.7200000000000002 ,
0.75999999999999979 , 0.79999999999999982 , 0.83999999999999986 ,
0.87999999999999989 , 0.91999999999999993 , 0.96 , 1.0 , 0.96 ,
0.91999999999999993 , 0.87999999999999989 , 0.83999999999999986 ,
0.79999999999999982 , 0.75999999999999979 , 0.72000000000000064 ,
0.67999999999999972 , 0.64000000000000057 , 0.59999999999999964 ,
0.5600000000000005 , 0.51999999999999957 , 0.48000000000000043 ,
0.4399999999999995 , 0.40000000000000036 , 0.35999999999999943 ,
0.32000000000000028 , 0.27999999999999936 , 0.24000000000000021 ,
0.20000000000000018 , 0.16000000000000014 , 0.12000000000000011 ,
0.080000000000000071 , 0.040000000000000036 , 0.0 } , 1.0 , { 0.0 , 0.0 , 0.0
, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0
, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0
, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0
, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0
, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0
, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.040000000000000036 ,
0.080000000000000071 , 0.12000000000000011 , 0.16000000000000014 ,
0.20000000000000018 , 0.24000000000000021 , 0.27999999999999936 ,
0.32000000000000028 , 0.35999999999999943 , 0.40000000000000036 ,
0.4399999999999995 , 0.48000000000000043 , 0.51999999999999957 ,
0.5600000000000005 , 0.59999999999999964 , 0.64000000000000057 ,
0.67999999999999972 , 0.72000000000000064 , 0.75999999999999979 ,
0.79999999999999982 , 0.83999999999999986 , 0.87999999999999989 ,
0.91999999999999993 , 0.96 , 1.0 } , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0 , 1.0
, 1.0 , 0.0 , 3.0 , 1.0 } ;
| 73.094737 | 77 | 0.495536 |
57772453bb8799ebb810298ecce43f8a0d08d5a6 | 1,393 | h | C | sources/VS/ThirdParty/wxWidgets/tests/asserthelper.h | Sasha7b9Work/S8-53M2 | fdc9cb5e3feb8055fd3f7885a6f6362f62ff6b6e | [
"MIT"
] | 86 | 2015-08-06T11:30:01.000Z | 2022-02-28T04:50:22.000Z | sources/VS/ThirdParty/wxWidgets/tests/asserthelper.h | Sasha7b9Work/S8-53M2 | fdc9cb5e3feb8055fd3f7885a6f6362f62ff6b6e | [
"MIT"
] | 6 | 2016-01-04T19:36:22.000Z | 2021-08-08T02:43:48.000Z | sources/VS/ThirdParty/wxWidgets/tests/asserthelper.h | Sasha7b9Work/S8-53M2 | fdc9cb5e3feb8055fd3f7885a6f6362f62ff6b6e | [
"MIT"
] | 22 | 2015-11-04T04:04:54.000Z | 2022-02-28T04:50:24.000Z | ///////////////////////////////////////////////////////////////////////////////
// Name: tests/asserthelper.h
// Purpose: Helper functions for cppunit
// Author: Steven Lamerton
// Created: 2010-07-23
// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TESTS_ASSERTHELPER_H_
#define _WX_TESTS_ASSERTHELPER_H_
#include <ostream>
#include "wx/colour.h"
#include "wx/gdicmn.h"
#include "wx/font.h"
namespace wxTestPrivate
{
// by default colour components values are output incorrectly because they
// are unsigned chars, define a small helper struct which formats them in
// a more useful way
struct ColourChannel
{
ColourChannel(unsigned char value) : m_value(value) { }
unsigned char m_value;
};
std::ostream& operator<<(std::ostream& os, const ColourChannel& cc);
} // wxTestPrivate namespace
// Operators used to show the values of the corresponding types when comparing
// them in the unit tests fails.
std::ostream& operator<<(std::ostream& os, const wxColour& c);
std::ostream& operator<<(std::ostream& os, const wxSize& s);
std::ostream& operator<<(std::ostream& os, const wxFont& f);
std::ostream& operator<<(std::ostream& os, const wxPoint& p);
std::ostream& operator<<(std::ostream& os, const wxRect& r);
#endif
| 33.97561 | 79 | 0.622398 |
670fa5b697e5d22f0b1f8b4116ccf7742f8eaff1 | 726 | asm | Assembly | oeis/213/A213791.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/213/A213791.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/213/A213791.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A213791: Expansion of psi(-x)^6 in powers of x where psi() is a Ramanujan theta function.
; Submitted by Christian Krause
; 1,-6,15,-26,45,-66,82,-120,156,-170,231,-276,290,-390,435,-438,561,-630,651,-780,861,-842,1020,-1170,1095,-1326,1431,-1370,1716,-1740,1682,-2016,2145,-2132,2415,-2550,2353,-2850,3120,-2810,3321,-3486,3285,-3906,4005,-3722,4350,-4560,4420,-4950,5052,-4818,5565,-6006,5330,-6216,6441,-5760,7176,-7140,6643,-7650,7875,-7540,8220,-8646,7922,-9180,9765,-8760,10011,-10092,9410,-11310,11220,-10202,11781,-12090,11388,-12630,13050,-11882,13695,-14586,12770,-14412,15051,-13940,16380,-16110,14521,-16836
mov $2,-1
pow $2,$0
seq $0,8440 ; Expansion of Jacobi theta constant theta_2^6 /(64q^(3/2)).
mul $0,$2
| 80.666667 | 497 | 0.712121 |
d185835c9cd5d3afa84826bcf02369acac7d5baa | 1,275 | lua | Lua | server/Classes/Shop/cDoneasty.lua | StiviiK/iLife | e4b905260d53b5fea47317c48176c77b30f08195 | [
"MIT"
] | null | null | null | server/Classes/Shop/cDoneasty.lua | StiviiK/iLife | e4b905260d53b5fea47317c48176c77b30f08195 | [
"MIT"
] | null | null | null | server/Classes/Shop/cDoneasty.lua | StiviiK/iLife | e4b905260d53b5fea47317c48176c77b30f08195 | [
"MIT"
] | 2 | 2021-02-17T05:19:51.000Z | 2021-02-24T05:31:29.000Z | Doneastys = {}
DoneastyObjects = {}
CDoneasty = inherit(CShop)
function CDoneasty:constructor(iDim)
self.Dim = iDim
self.Ped = createPed(219, 1249, -767.09998, 1084, 220)
setElementInterior(self.Ped, 5)
setElementDimension(self.Ped, self.Dim)
setElementData(self.Ped, "EastereggPed", true)
new(CShopRob, iDim, self.Ped)
self.Objects = {}
for k,v in pairs(mapManager:getMapRootObjects("res/maps/misc/doneasty.map")) do
local x,y,z = getElementPosition(v)
local rx,ry,rz = getElementRotation(v)
local n = createObject(getElementModel(v), x, y, z, rx, ry, rz)
setObjectScale(n, getObjectScale(v))
setElementInterior(n, 5)
setElementDimension(n, self.Dim)
table.insert(self.Objects, n)
table.insert(DoneastyObjects, n)
end
self.ShopMarker = ItemShops[9].addMarker(ItemShops[9], 1, self.Dim, 1250.56640625, -768.8662109375, 1084.0146484375)
setElementInterior(self.ShopMarker, 5)
self.ID = iDim-20000
CShop.constructor(self, "Doneasty", self.ID)
table.insert(Doneastys, self)
end
function CDoneasty:destructor()
end
addEvent("onClientRequestDoneastyObects", true)
addEventHandler("onClientRequestDoneastyObects", getRootElement(),
function()
triggerClientEvent(client, "onServerSendDoneastyObjects", client, DoneastyObjects )
end
)
| 25.5 | 117 | 0.752157 |
5b4026b7b65ad5dfdee415d3ad7640a7b4482725 | 311 | h | C | src/viewscale.h | bouldermachinery/DSB | 492b9017cc384f6858341b1338579a6efbcbc1ce | [
"Unlicense"
] | null | null | null | src/viewscale.h | bouldermachinery/DSB | 492b9017cc384f6858341b1338579a6efbcbc1ce | [
"Unlicense"
] | null | null | null | src/viewscale.h | bouldermachinery/DSB | 492b9017cc384f6858341b1338579a6efbcbc1ce | [
"Unlicense"
] | null | null | null | #define V_DVIEW 0x0000
#define V_INVIEW 0x0010
#define V_OUTVIEW 0x0020
#define V_SIDEVIEW 0x0030
#define V_EXTVIEW 0x0040
#define V_ATTVIEW 0x0100
struct animap *do_dynamic_scale(int sm, struct obj_arch *p_arch,
int view, int blocker);
void invalidate_scale_cache(struct obj_arch *p_arch);
| 25.916667 | 64 | 0.771704 |
47e1c4329f0a2516183ed6ef3acf4af9510111b5 | 540 | css | CSS | components/markdown-styles.module.css | veiko/chakra-nextjs-blog-starter | bfc3692e4c8cac076b7dc0889b29251b0b6db33e | [
"MIT"
] | null | null | null | components/markdown-styles.module.css | veiko/chakra-nextjs-blog-starter | bfc3692e4c8cac076b7dc0889b29251b0b6db33e | [
"MIT"
] | null | null | null | components/markdown-styles.module.css | veiko/chakra-nextjs-blog-starter | bfc3692e4c8cac076b7dc0889b29251b0b6db33e | [
"MIT"
] | null | null | null | .markdown {
font-size: var(--chakra-fontSizes-lg);
line-height: 1.625;
}
.markdown p,
.markdown ul,
.markdown ol,
.markdown blockquote {
margin-bottom: var(--chakra-sizes-6);
margin-top: var(--chakra-sizes-6);
}
.markdown h2 {
font-size: var(--chakra-fontSizes-3xl);
line-height: 1.375;
margin-bottom: var(--chakra-sizes-4);
margin-top: var(--chakra-sizes-12);
}
.markdown h3 {
font-size: var(--chakra-fontSizes-2xl);
line-height: 1.375;
margin-bottom: var(--chakra-sizes-4);
margin-top: var(--chakra-sizes-8);
}
| 20 | 41 | 0.661111 |
663733faedcd7d9b726649592272168623f5b779 | 163 | css | CSS | public/css/footer.css | bogdanlinitskiy/video.test | 1efd049427993f8d1efdd18f23db0e7e524ce61f | [
"MIT"
] | null | null | null | public/css/footer.css | bogdanlinitskiy/video.test | 1efd049427993f8d1efdd18f23db0e7e524ce61f | [
"MIT"
] | null | null | null | public/css/footer.css | bogdanlinitskiy/video.test | 1efd049427993f8d1efdd18f23db0e7e524ce61f | [
"MIT"
] | null | null | null | .logos a img{
width: 25px;
height: 25px;
margin:10px;
}
footer{
background-color: #343a40;
padding-bottom: 25px;
}
span{
font-size: 14px;
} | 13.583333 | 30 | 0.601227 |
1811dc120d22aceeff720adad303154507391285 | 7,949 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1080.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1080.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i3-7100_9_0xca_notsx.log_21829_1080.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 3 | 2020-07-14T17:07:07.000Z | 2022-03-21T01:12:22.000Z | .global s_prepare_buffers
s_prepare_buffers:
push %r14
push %r15
push %r8
push %r9
push %rax
push %rcx
push %rdi
push %rsi
lea addresses_A_ht+0xef57, %r9
nop
nop
nop
nop
nop
inc %r14
movb $0x61, (%r9)
nop
sub $16388, %r8
lea addresses_D_ht+0x1c757, %rsi
lea addresses_A_ht+0x1c937, %rdi
nop
mfence
mov $125, %rcx
rep movsw
and $65532, %rcx
lea addresses_WT_ht+0x12757, %r15
dec %r14
movb $0x61, (%r15)
nop
nop
sub %r9, %r9
lea addresses_WC_ht+0xbd23, %r15
nop
nop
nop
nop
and $2813, %rdi
mov $0x6162636465666768, %r9
movq %r9, %xmm2
movups %xmm2, (%r15)
nop
nop
nop
nop
nop
add $53728, %r9
lea addresses_normal_ht+0x152d7, %rsi
lea addresses_UC_ht+0xc14f, %rdi
nop
nop
nop
nop
nop
xor %r15, %r15
mov $73, %rcx
rep movsq
nop
nop
xor $14314, %rsi
lea addresses_D_ht+0x231, %rsi
lea addresses_A_ht+0x1d357, %rdi
nop
nop
nop
nop
nop
xor %r9, %r9
mov $123, %rcx
rep movsl
nop
nop
nop
sub $18654, %rcx
lea addresses_WT_ht+0x10c88, %rsi
lea addresses_normal_ht+0xf257, %rdi
nop
nop
nop
xor $5235, %rax
mov $1, %rcx
rep movsl
nop
sub $24050, %rdi
lea addresses_WT_ht+0x14c43, %rsi
lea addresses_normal_ht+0x9b6d, %rdi
nop
nop
nop
inc %r9
mov $114, %rcx
rep movsw
nop
nop
nop
nop
nop
and $57574, %rsi
lea addresses_WT_ht+0xa937, %rdi
nop
nop
nop
nop
nop
cmp %r9, %r9
movw $0x6162, (%rdi)
nop
xor %r9, %r9
lea addresses_A_ht+0xeb87, %r8
cmp %rsi, %rsi
mov $0x6162636465666768, %rcx
movq %rcx, %xmm7
vmovups %ymm7, (%r8)
nop
nop
sub %rdi, %rdi
lea addresses_WT_ht+0x1a857, %rsi
lea addresses_A_ht+0x107f7, %rdi
nop
nop
add $56381, %r9
mov $34, %rcx
rep movsb
nop
nop
nop
cmp %rsi, %rsi
lea addresses_WT_ht+0x14397, %rdi
dec %r9
movups (%rdi), %xmm3
vpextrq $1, %xmm3, %rcx
cmp %r14, %r14
lea addresses_normal_ht+0x1e3a8, %rsi
lea addresses_UC_ht+0xd497, %rdi
clflush (%rdi)
nop
nop
nop
nop
cmp $16210, %r15
mov $60, %rcx
rep movsl
nop
nop
nop
xor %r9, %r9
lea addresses_normal_ht+0xc0cc, %rsi
lea addresses_normal_ht+0x15357, %rdi
clflush (%rdi)
nop
nop
sub %r8, %r8
mov $30, %rcx
rep movsl
nop
nop
nop
and $20860, %rsi
lea addresses_normal_ht+0xff57, %r9
nop
nop
nop
and %rax, %rax
movb $0x61, (%r9)
nop
nop
and %rdi, %rdi
pop %rsi
pop %rdi
pop %rcx
pop %rax
pop %r9
pop %r8
pop %r15
pop %r14
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r12
push %r14
push %r15
push %r8
push %rsi
// Faulty Load
lea addresses_D+0x16357, %rsi
nop
nop
xor %r14, %r14
movups (%rsi), %xmm7
vpextrq $1, %xmm7, %r12
lea oracles, %rsi
and $0xff, %r12
shlq $12, %r12
mov (%rsi,%r12,1), %r12
pop %rsi
pop %r8
pop %r15
pop %r14
pop %r12
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'src': {'same': False, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 2, 'AVXalign': False}, 'OP': 'LOAD'}
[Faulty Load]
{'src': {'same': True, 'congruent': 0, 'NT': False, 'type': 'addresses_D', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_A_ht', 'size': 1, 'AVXalign': False}}
{'src': {'type': 'addresses_D_ht', 'congruent': 10, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 5, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 9, 'NT': False, 'type': 'addresses_WT_ht', 'size': 1, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 2, 'NT': False, 'type': 'addresses_WC_ht', 'size': 16, 'AVXalign': False}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 3, 'same': False}}
{'src': {'type': 'addresses_D_ht', 'congruent': 1, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 11, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 6, 'same': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 2, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 1, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 5, 'NT': False, 'type': 'addresses_WT_ht', 'size': 2, 'AVXalign': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 4, 'NT': False, 'type': 'addresses_A_ht', 'size': 32, 'AVXalign': False}}
{'src': {'type': 'addresses_WT_ht', 'congruent': 8, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_A_ht', 'congruent': 4, 'same': False}}
{'src': {'same': False, 'congruent': 6, 'NT': False, 'type': 'addresses_WT_ht', 'size': 16, 'AVXalign': False}, 'OP': 'LOAD'}
{'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_UC_ht', 'congruent': 6, 'same': False}}
{'src': {'type': 'addresses_normal_ht', 'congruent': 0, 'same': False}, 'OP': 'REPM', 'dst': {'type': 'addresses_normal_ht', 'congruent': 10, 'same': False}}
{'OP': 'STOR', 'dst': {'same': False, 'congruent': 10, 'NT': False, 'type': 'addresses_normal_ht', 'size': 1, 'AVXalign': False}}
{'36': 21829}
36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36 36
*/
| 34.262931 | 2,999 | 0.660712 |
71a6a0514af88d41f37932be614ab0a20acf95c0 | 1,502 | ts | TypeScript | packages/graphql-mocks/test/unit/highlight/highlighter/union.test.ts | graphql-mocks/graphql-mocks | 3681c7b5e809314ced0181e40eef875882d38a48 | [
"MIT"
] | 15 | 2020-12-29T13:37:04.000Z | 2022-03-13T12:09:21.000Z | packages/graphql-mocks/test/unit/highlight/highlighter/union.test.ts | graphql-mocks/graphql-mocks | 3681c7b5e809314ced0181e40eef875882d38a48 | [
"MIT"
] | 28 | 2020-12-30T19:58:19.000Z | 2022-03-08T17:44:05.000Z | packages/graphql-mocks/test/unit/highlight/highlighter/union.test.ts | graphql-mocks/graphql-mocks | 3681c7b5e809314ced0181e40eef875882d38a48 | [
"MIT"
] | 1 | 2021-04-16T07:56:08.000Z | 2021-04-16T07:56:08.000Z | import { buildSchema } from 'graphql';
import { expect } from 'chai';
import { union } from '../../../../src/highlight/highlighter/union';
import { HIGHLIGHT_ALL } from '../../../../src/highlight/highlighter/constants';
const schema = buildSchema(`
schema {
query: Query
}
type Query {
pets: [Pet!]!
}
type Dog {
name: String!
}
type Cat {
name: String!
}
type Bird {
name: String!
}
type Wolf {
hasPack: Boolean!
}
type Cheetah {
speedInMilesPerHour: Int!
}
type Eagle {
species: String!
}
union Wild = Cheetah | Wolf | Eagle
union Pet = Dog | Cat | Bird
union FourLegged = Cheetah | Wolf | Dog | Cat
union Winged = Bird | Eagle
`);
describe('highlight/highlighter/union', function () {
it('highlights all unions by default when no arguments are passed in', function () {
expect(union().mark(schema).sort()).to.deep.equal(['Pet', 'Wild', 'FourLegged', 'Winged'].sort());
});
it('highlights all unions when HIGHLIGHT_ALL argument is passed in', function () {
expect(union(HIGHLIGHT_ALL).mark(schema).sort()).to.deep.equal(['Pet', 'Wild', 'FourLegged', 'Winged'].sort());
});
it('highlights unions specified by arguments', function () {
expect(union('Pet', 'Winged').mark(schema)).to.deep.equal(['Pet', 'Winged']);
});
it('ignores specified names that are not unions', function () {
expect(union('Pet', 'ThisIsNoUnion', 'Winged').mark(schema)).to.deep.equal(['Pet', 'Winged']);
});
});
| 24.225806 | 115 | 0.624501 |
1c6fd8c0724b8632eb807f1e11cd46cd58cba93c | 333 | kt | Kotlin | wallet-service/src/main/kotlin/it/polito/ap/walletservice/model/Wallet.kt | bobcorn/ecommerce | a4983a24c27a19202e8cdbbf74259ff64bb34d07 | [
"MIT"
] | null | null | null | wallet-service/src/main/kotlin/it/polito/ap/walletservice/model/Wallet.kt | bobcorn/ecommerce | a4983a24c27a19202e8cdbbf74259ff64bb34d07 | [
"MIT"
] | null | null | null | wallet-service/src/main/kotlin/it/polito/ap/walletservice/model/Wallet.kt | bobcorn/ecommerce | a4983a24c27a19202e8cdbbf74259ff64bb34d07 | [
"MIT"
] | null | null | null | package it.polito.ap.walletservice.model
import org.bson.types.ObjectId
import org.springframework.data.annotation.Id
import org.springframework.data.mongodb.core.mapping.Document
@Document
class Wallet(
@Id
val userId: ObjectId
) {
var funds: Double = 0.0
var transactionList: List<Transaction> = mutableListOf()
} | 23.785714 | 61 | 0.765766 |
9c6deae2b8fdfb544b2a534c47a4778c97e04cf0 | 1,804 | js | JavaScript | api/server.js | siratl/NetWorth-BE | f02a89f70762135b12827e966c377953f282eaf1 | [
"MIT"
] | null | null | null | api/server.js | siratl/NetWorth-BE | f02a89f70762135b12827e966c377953f282eaf1 | [
"MIT"
] | 1 | 2021-09-02T12:46:14.000Z | 2021-09-02T12:46:14.000Z | api/server.js | siratl/NetWorth-BE | f02a89f70762135b12827e966c377953f282eaf1 | [
"MIT"
] | null | null | null | // import express
const express = require("express");
const cors = require("cors");
const helmet = require("helmet");
const session = require("express-session");
const KnexStore = require("connect-session-knex")(session);
// ---------------------> Routers <---------------------
const restricted = require("../auth/restricted-middleware.js");
const authRouter = require("../auth/authRouter.js");
const budgetRouter = require("../budget/budget-router.js");
const billsRouter = require("../bills/bills-router.js");
const usersRouter = require("../users/users-router.js");
const bankRouter = require("../bank/bank-router.js");
const investmentsRouter = require("../invest/investments-router.js");
const knex = require("../data/db-config.js");
const sessionConfig = {
name: "networth",
secret: process.env.COOKIE_SECRET || "this secret",
resave: false,
saveUninitialized: true,
cookie: {
maxAge: 1000 * 60 * 60,
secure: false,
httpOnly: true,
},
store: new KnexStore({
knex,
tablename: "session",
createtable: true,
sidfieldname: "sid",
clearInterval: 1000 * 60 * 65,
}),
};
// create server
const server = express();
server.use(cors());
server.use(helmet());
server.use(express.json());
server.use(session(sessionConfig));
// ----------------------------- SERVER ROOT
server.get("/", restricted, (req, res) => {
res.status(200).send("<h1>Net_Worth App</h1>");
});
// -------------------> Routes <------------------------
server.use("/api/auth", authRouter);
server.use("/api/users", restricted, usersRouter);
server.use("/api/budget", restricted, budgetRouter);
server.use("/api/bills", restricted, billsRouter);
server.use("/api/bank", restricted, bankRouter);
server.use("/api/investments", restricted, investmentsRouter);
module.exports = server;
| 30.576271 | 69 | 0.644124 |
3fa4b7695537608254f1cf9085f946fee6c523e9 | 1,449 | c | C | svn_pod/sw_stm32/trunk/lib/libusartstm32/usartx_txdma_send.c | GliderWinchItems/embed | cc72aa7d8208db3871a15e38185e1e125fa7de47 | [
"MIT"
] | 1 | 2019-07-18T07:22:19.000Z | 2019-07-18T07:22:19.000Z | svn_pod/sw_stm32/trunk/lib/libusartstm32/usartx_txdma_send.c | GliderWinchItems/embed | cc72aa7d8208db3871a15e38185e1e125fa7de47 | [
"MIT"
] | null | null | null | svn_pod/sw_stm32/trunk/lib/libusartstm32/usartx_txdma_send.c | GliderWinchItems/embed | cc72aa7d8208db3871a15e38185e1e125fa7de47 | [
"MIT"
] | 2 | 2019-04-03T01:44:46.000Z | 2020-04-01T07:41:41.000Z | /******************** (C) COPYRIGHT 2010 **************************************
* File Name : usartx_txdma_send.c
* Hackor : deh
* Date First Issued : 10/06/2010
* Description : Step to the next line buffer, thus making this line buffer ready
*******************************************************************************/
#include "../libusartstm32/usartprotoprivate.h"
#include "../libusartstm32/usartall.h"
/*******************************************************************************
* void usartx_txdma_send(struct USARTCBT* pUSARTcbtx);
* @brief : Step to next line tx line buffer; if DMA not sending, start it now.
* @param : pUSARTcbtx Pointer to struct--pUSARTcb1,2,3
* @return : none
*******************************************************************************/
void usartx_txdma_send(struct USARTCBT* pUSARTcbtx)
{
/* Compute number of chars to send (less zero terminator)
and place in array that holds the counts */
*pUSARTcbtx->ptx_ctary_now_m = pUSARTcbtx->ptx_now_m - pUSARTcbtx->ptx_begin_m;
if (*pUSARTcbtx->ptx_ctary_now_m == 0)
{
return; // We should not be coming here!
/* If USARTx_txdma_send(); is executed in the mainline, then there is a possbility
that we end up here, since 'send()' can be executed twice, and this results in
testbusy never exiting. */
}
/* Advance pointers to the next line buffer. */
usartx_txmain_advlnptr(pUSARTcbtx);
return;
}
| 39.162162 | 87 | 0.560386 |
9c210022053249d90d6f3e7b43c283854774a037 | 266 | js | JavaScript | src/components/ResultNotFound/ResultNotFound.js | hoangtien1005/animene | e6c1b07ed605e1e3f06da41f053bff147264634b | [
"MIT"
] | 5 | 2022-03-31T14:17:19.000Z | 2022-03-31T20:52:18.000Z | src/components/ResultNotFound/ResultNotFound.js | hoangtien1005/animene | e6c1b07ed605e1e3f06da41f053bff147264634b | [
"MIT"
] | null | null | null | src/components/ResultNotFound/ResultNotFound.js | hoangtien1005/animene | e6c1b07ed605e1e3f06da41f053bff147264634b | [
"MIT"
] | 1 | 2022-03-31T14:49:22.000Z | 2022-03-31T14:49:22.000Z | import styles from "./styles.module.scss"
const ResultNotFound = ({ message = "Something went wrong" }) => {
return (
<div className={styles.container}>
<h3 className={styles.resultNotFound}>{message}</h3>
</div>
)
}
export default ResultNotFound
| 24.181818 | 66 | 0.672932 |
8564a3f6afcee2a22f7b9997c082980722644168 | 1,403 | js | JavaScript | lib/commons/preproc.js | RechInformatica/rech-environment-ide | 28d84665ca4c57eac1155310630ac964eaca318e | [
"MIT"
] | 2 | 2017-07-08T15:40:29.000Z | 2018-06-20T12:45:50.000Z | lib/commons/preproc.js | RechInformatica/rech-environment-ide | 28d84665ca4c57eac1155310630ac964eaca318e | [
"MIT"
] | 2 | 2017-10-30T14:31:51.000Z | 2020-12-26T07:18:56.000Z | lib/commons/preproc.js | RechInformatica/rech-environment-ide | 28d84665ca4c57eac1155310630ac964eaca318e | [
"MIT"
] | 3 | 2017-07-08T18:22:43.000Z | 2021-02-21T19:44:43.000Z | 'use babel';
import Exec from './exec';
import Path from './path';
import WcVersao from './wc-versao';
export default class Preproc {
constructor() {
this.options = [];
}
/**
* Cria uma instância do préproc para atualização da base local
*/
static localDatabaseUpdate() {
let newPreproc = new Preproc();
newPreproc.addOptions(["-bd", "-bdl", "-is", "-msi"]);
return newPreproc;
}
/**
* Define o caminho a pré-processar
*/
setPath(path) {
if (path instanceof Path) {
this.path = path.fullPath();
} else {
this.path = path;
}
return this;
}
/**
* Adiciona opções
*/
addOptions(options) {
this.options = this.options.concat(options);
return this;
}
/**
* Retorna os argumentos command-line para pré-processar
*/
getCmdArgs() {
return ['preproc.bat'].concat(this.options).concat([this.path]);
}
/**
* Executa o pré-processador
*/
exec() {
return new Promise((resolve) => {
new WcVersao().currentWc().then((wc) => {
new Exec().exec(this.getCmdArgs().concat(this.getWcParams(wc)), (process) => {
resolve();
});
});
});
}
/**
* Retorna os parâmetros do WC
*/
getWcParams(wc) {
return ['-dc=f:\\siger\\wc\\des\\'+wc.name+'\\fon\\;f:\\fontes\\'];
}
}
| 20.042857 | 87 | 0.536707 |
01cdda97f1aae91b48945c3b6878026d7f3a6714 | 2,575 | rs | Rust | rust/src/shell_sort.rs | pop/coding-exercises | 9657b3a7d9bef1ae70f801c8a69cfb2c63a4af21 | [
"MIT"
] | null | null | null | rust/src/shell_sort.rs | pop/coding-exercises | 9657b3a7d9bef1ae70f801c8a69cfb2c63a4af21 | [
"MIT"
] | 12 | 2020-12-13T21:40:14.000Z | 2020-12-29T23:19:21.000Z | rust/src/shell_sort.rs | pop/coding-exercises | 9657b3a7d9bef1ae70f801c8a69cfb2c63a4af21 | [
"MIT"
] | null | null | null | ///
/// Shell Sort
///
/// ```
/// # use exercises::shell_sort;
///
/// let mut input = vec![1,3,5,7,9,8,6,4,2];
/// shell_sort::sort(&mut input);
/// assert_eq!(vec![1,2,3,4,5,6,7,8,9], input);
/// ```
///
/// Note: we sort elements of type u8 as a placeholder. We could just as easily sort elements of
/// type T where T implements PartialOrd (or something like that), but for simplicity we're using
/// a concrete integer type.
///
/// Following thes resources:
/// * https://www.tutorialspoint.com/data_structures_algorithms/shell_sort_algorithm.htm
/// * https://www.toptal.com/developers/sorting-algorithms/shell-sort
///
/// The algorithm goes like this:
/// Step 1 − Initialize the value of h
/// Step 2 − Divide the list into smaller sub-list of equal interval h
/// Step 3 − Sort these sub-lists using insertion sort
/// Step 3 − Repeat until complete list is sorted
///
/// Wikipedia has a good high-level description:
///
/// > The method starts by sorting pairs of elements far apart from each other, then progressively
/// > reducing the gap between elements to be compared. By starting with far apart elements, it can
/// > move some out-of-place elements into position faster than a simple nearest neighbor exchange.
///
pub fn sort(input: &mut Vec<u8>) {
// Initialize `gap` to be length of the input array.
// This immediately gets cut to ~1/3 for faster comparison.
// We cannot initialize it to 1/3 outside of the loop because of the `while` comparison.
let mut gap = input.len();
while gap != 1 {
// We start with a gap of len/3 + 1
// Tutorials/psuedocode complicate this step...
// I'm still not sure why we cannot statically start with this gap.
// And that makes me nervous.
gap = std::cmp::max(gap/2, 1);
for index in gap..input.len() {
// `a` is the left-most value in our tuple comparison
let a = index-gap;
// `b` is our right-most value in our tuple comparison
let b = index;
// If the left value is bigger, swap them
if input[a] > input[b] {
input.swap(a, b);
}
}
}
crate::insertion_sort::sort(input);
}
#[test]
fn test_shell_sort() {
use rand::prelude::*;
let mut rng = thread_rng();
let distr = rand::distributions::Uniform::new_inclusive(1, 100);
let mut input = (1..10).map(|_| rng.sample(distr)).collect::<Vec<u8>>();
let mut sorted = input.clone();
sorted.sort();
sort(&mut input);
assert_eq!(input, sorted);
}
| 33.012821 | 99 | 0.631456 |
498e25779b9f38b7bc20da37675cd94d0618abf2 | 508 | asm | Assembly | oeis/004/A004515.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 11 | 2021-08-22T19:44:55.000Z | 2022-03-20T16:47:57.000Z | oeis/004/A004515.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 9 | 2021-08-29T13:15:54.000Z | 2022-03-09T19:52:31.000Z | oeis/004/A004515.asm | neoneye/loda-programs | 84790877f8e6c2e821b183d2e334d612045d29c0 | [
"Apache-2.0"
] | 3 | 2021-08-22T20:56:47.000Z | 2021-09-29T06:26:12.000Z | ; A004515: Generalized nim sum n + n in base 5.
; Submitted by Christian Krause
; 0,2,4,1,3,10,12,14,11,13,20,22,24,21,23,5,7,9,6,8,15,17,19,16,18,50,52,54,51,53,60,62,64,61,63,70,72,74,71,73,55,57,59,56,58,65,67,69,66,68,100,102,104,101,103,110,112,114,111,113,120,122,124,121,123,105,107,109,106,108,115,117,119,116,118,25,27,29,26,28,35,37,39,36,38,45,47,49,46,48,30,32,34,31,33,40,42,44,41,43
mov $3,1
lpb $0
mov $2,$0
div $0,5
mul $2,2
mod $2,5
mul $2,$3
add $1,$2
mul $3,5
lpe
mov $0,$1
| 31.75 | 316 | 0.641732 |
70be694a78e0db5f13be738b24153354e9512c2f | 2,212 | go | Go | ai.go | fr3fou/tic-tac-toe-ai | a784c4390a272cb432350ca7608dc2952962e30a | [
"MIT"
] | 4 | 2020-08-02T16:33:17.000Z | 2021-05-10T20:28:40.000Z | ai.go | fr3fou/tic-tac-toe-ai | a784c4390a272cb432350ca7608dc2952962e30a | [
"MIT"
] | null | null | null | ai.go | fr3fou/tic-tac-toe-ai | a784c4390a272cb432350ca7608dc2952962e30a | [
"MIT"
] | null | null | null | package main
import "math"
// value should only be called at leaf / terminal nodes (game MUST be over).
func value(b Board, aiWon bool) int {
spots := b.EmptySpots()
if aiWon {
return max(1, spots)
}
return min(-1, -spots)
}
func minimax(b Board, ai, current Player, alpha, beta float64) int {
other := otherPlayer(current)
if b.IsWinner(other) {
return value(b, ai == other)
}
// Draw is 0
if b.EmptySpots() == 0 {
return 0
}
if current == ai {
// Maximizing
max := math.Inf(-1)
for _, state := range nextBoards(b, current) {
value := float64(minimax(state.Board, ai, other, alpha, beta))
max = math.Max(max, value)
alpha = math.Max(alpha, value)
if alpha >= beta {
break
}
}
return int(max)
} else {
// Minimizing
min := math.Inf(+1)
for _, state := range nextBoards(b, current) {
value := float64(minimax(state.Board, ai, other, alpha, beta))
min = math.Min(min, value)
beta = math.Min(beta, value)
if alpha >= beta {
break
}
}
return int(min)
}
}
func Minimax(ai Player, g *Game) {
max := math.Inf(-1)
bestState := State{}
other := otherPlayer(ai)
for _, state := range nextBoards(g.Board, ai) {
value := float64(minimax(state.Board, ai, other, math.Inf(-1), math.Inf(1)))
if value > max {
max = value
bestState = state
}
}
g.Place(bestState.X, bestState.Y)
}
func min(a, b int) int {
if a < b {
return a
}
return b
}
func max(a, b int) int {
if a > b {
return a
}
return b
}
type State struct {
X int
Y int
Board Board
}
func nextBoards(b Board, player Player) []State {
boards := []State{}
for i, row := range b {
for j, square := range row {
if square != None {
continue
}
board := copyBoard(b)
board[i][j] = player
boards = append(boards, State{
X: i,
Y: j,
Board: board,
})
}
}
return boards
}
func copyBoard(src Board) Board {
dst := Board{}
for i, row := range src {
dst = append(dst, []Player{})
for _, square := range row {
dst[i] = append(dst[i], square)
}
}
return dst
}
| 17.555556 | 79 | 0.559222 |
5f050d6412a8041aa72fd1ae35255ed807a2974f | 47 | ts | TypeScript | src/constants/Endpoints.ts | arantesxyz/EasyPayPal | 8facbf758fcd503f16b87504fe5e2861c866eb4c | [
"MIT"
] | 1 | 2021-02-04T00:17:22.000Z | 2021-02-04T00:17:22.000Z | src/constants/Endpoints.ts | arantesxyz/EasyPayPal | 8facbf758fcd503f16b87504fe5e2861c866eb4c | [
"MIT"
] | null | null | null | src/constants/Endpoints.ts | arantesxyz/EasyPayPal | 8facbf758fcd503f16b87504fe5e2861c866eb4c | [
"MIT"
] | null | null | null | export default {
OAUTH: "/v1/oauth2/token"
}; | 15.666667 | 27 | 0.659574 |
7a47c73d33be553efbe5f3a5888d04c67138e31a | 32,865 | rs | Rust | src/count_and_sum.rs | laudv/bitboost | 85caa1163a36e2099d0251caa912b28ad5d39f14 | [
"Apache-2.0"
] | 11 | 2019-07-10T12:50:52.000Z | 2021-08-18T03:27:28.000Z | src/count_and_sum.rs | laudv/bitboost | 85caa1163a36e2099d0251caa912b28ad5d39f14 | [
"Apache-2.0"
] | null | null | null | src/count_and_sum.rs | laudv/bitboost | 85caa1163a36e2099d0251caa912b28ad5d39f14 | [
"Apache-2.0"
] | null | null | null | /*
* Copyright 2019 DTAI Research Group - KU Leuven.
* License: Apache License 2.0
* Author: Laurens Devos
*/
#[cfg(target_arch = "x86_64")]
use std::arch::x86_64::*;
use crate::bitblock::{BitBlock, BitBlocks};
use crate::bitslice::{BitsliceLayout, BitsliceWithLayout};
use crate::bitslice::{BitsliceLayout1, BitsliceLayout2, BitsliceLayout4, BitsliceLayout8};
/// Carry-safe adder.
macro_rules! csa {
( $h:ident, $l:ident; $a:ident, $b:ident, $c:ident ) => {{
let u = _mm256_xor_si256($a, $b);
$h = _mm256_or_si256(_mm256_and_si256($a, $b), _mm256_and_si256(u, $c));
$l = _mm256_xor_si256(u, $c);
}};
( $h:ident, $l:ident <- $d1:expr, $d2:expr ) => {{
let dd1 = $d1;
let dd2 = $d2;
csa!($h, $l; $l, dd1, dd2);
}};
}
// ------------------------------------------------------------------------------------------------
/// Internals that depend on the width of the individual units.
unsafe trait HarleySealInternals {
type Weights;
#[inline(always)]
unsafe fn count_ones(v: __m256i) -> __m256i;
#[inline(always)]
unsafe fn vshiftl(a: __m256i, imm8: i32) -> __m256i;
#[inline(always)]
unsafe fn vadd(a: __m256i, b: __m256i) -> __m256i;
#[inline(always)]
unsafe fn reduce_total(total: __m256i, ws: Self::Weights) -> u64;
}
type HarleySealWeights32 = (u8, u8, u8, u8, u8, u8, u8, u8);
struct Internals32;
unsafe impl HarleySealInternals for Internals32 {
type Weights = HarleySealWeights32;
#[inline(always)]
unsafe fn count_ones(v: __m256i) -> __m256i {
let mut buffer = BitBlock::zeros(); // 64 byte aligned!
let mut counts = BitBlock::zeros();
_mm256_store_si256(buffer.as_mut_ptr() as *mut __m256i, v);
{
let bufptr = buffer.as_ptr() as *const u32;
let cntptr = counts.as_mut_ptr() as *mut u32;
*cntptr.add(0) = (*bufptr.add(0)).count_ones() as u32;
*cntptr.add(1) = (*bufptr.add(1)).count_ones() as u32;
*cntptr.add(2) = (*bufptr.add(2)).count_ones() as u32;
*cntptr.add(3) = (*bufptr.add(3)).count_ones() as u32;
*cntptr.add(4) = (*bufptr.add(4)).count_ones() as u32;
*cntptr.add(5) = (*bufptr.add(5)).count_ones() as u32;
*cntptr.add(6) = (*bufptr.add(6)).count_ones() as u32;
*cntptr.add(7) = (*bufptr.add(7)).count_ones() as u32;
};
_mm256_load_si256(counts.as_ptr() as *const __m256i)
}
#[inline(always)]
unsafe fn vshiftl(a: __m256i, imm8: i32) -> __m256i {
_mm256_slli_epi32(a, imm8)
}
#[inline(always)]
unsafe fn vadd(a: __m256i, b: __m256i) -> __m256i {
_mm256_add_epi32(a, b)
}
#[inline(always)]
unsafe fn reduce_total(total: __m256i, ws: Self::Weights) -> u64 {
let mut sum = 0;
let x0 = _mm256_extract_epi64(total, 0) as u64;
let (y0, y1) = (x0 & 0xFFFFFFFF, x0 >> 32); sum += ws.0 as u64 * y0 + ws.1 as u64 * y1;
let x1 = _mm256_extract_epi64(total, 1) as u64;
let (y2, y3) = (x1 & 0xFFFFFFFF, x1 >> 32); sum += ws.2 as u64 * y2 + ws.3 as u64 * y3;
let x2 = _mm256_extract_epi64(total, 2) as u64;
let (y4, y5) = (x2 & 0xFFFFFFFF, x2 >> 32); sum += ws.4 as u64 * y4 + ws.5 as u64 * y5;
let x3 = _mm256_extract_epi64(total, 3) as u64;
let (y6, y7) = (x3 & 0xFFFFFFFF, x3 >> 32); sum += ws.6 as u64 * y6 + ws.7 as u64 * y7;
sum
}
}
type HarleySealWeights64 = (u8, u8, u8, u8);
struct Internals64;
unsafe impl HarleySealInternals for Internals64 {
type Weights = HarleySealWeights64;
#[inline(always)]
unsafe fn count_ones(v: __m256i) -> __m256i {
let mut buffer = BitBlock::zeros(); // 64 byte aligned!
let mut counts = BitBlock::zeros();
_mm256_store_si256(buffer.as_mut_ptr() as *mut __m256i, v);
{
let bufptr = buffer.as_ptr() as *const u64;
let cntptr = counts.as_mut_ptr() as *mut u64;
*cntptr.add(0) = (*bufptr.add(0)).count_ones() as u64;
*cntptr.add(1) = (*bufptr.add(1)).count_ones() as u64;
*cntptr.add(2) = (*bufptr.add(2)).count_ones() as u64;
*cntptr.add(3) = (*bufptr.add(3)).count_ones() as u64;
};
_mm256_load_si256(counts.as_ptr() as *const __m256i)
}
#[inline(always)]
unsafe fn vshiftl(a: __m256i, imm8: i32) -> __m256i {
_mm256_slli_epi64(a, imm8)
}
#[inline(always)]
unsafe fn vadd(a: __m256i, b: __m256i) -> __m256i {
_mm256_add_epi64(a, b)
}
#[inline(always)]
unsafe fn reduce_total(total: __m256i, ws: Self::Weights) -> u64 {
ws.0 as u64 * _mm256_extract_epi64(total, 0) as u64
+ ws.1 as u64 * _mm256_extract_epi64(total, 1) as u64
+ ws.2 as u64 * _mm256_extract_epi64(total, 2) as u64
+ ws.3 as u64 * _mm256_extract_epi64(total, 3) as u64
}
}
unsafe fn harley_seal<Input, LoadFn, Internals>(d: &Input, n: usize, load: LoadFn,
weights: <Internals as HarleySealInternals>::Weights)
-> u64
where LoadFn: Fn(&Input, usize) -> __m256i,
Internals: HarleySealInternals,
{
let mut total = _mm256_setzero_si256();
let mut b01 = _mm256_setzero_si256();
let mut b02 = _mm256_setzero_si256();
let mut b04 = _mm256_setzero_si256();
let mut b08 = _mm256_setzero_si256();
let mut b16;
let mut b02a;
let mut b02b;
let mut b04a;
let mut b04b;
let mut b08a;
let mut b08b;
let mut i = 0;
while i < n - (n % 16) {
csa!(b02a, b01 <- load(d, i ), load(d, i+1 ));
csa!(b02b, b01 <- load(d, i+2 ), load(d, i+3 ));
csa!(b04a, b02 <- b02a, b02b);
csa!(b02a, b01 <- load(d, i+4 ), load(d, i+5 ));
csa!(b02b, b01 <- load(d, i+6 ), load(d, i+7 ));
csa!(b04b, b02 <- b02a, b02b);
csa!(b08a, b04 <- b04a, b04b);
csa!(b02a, b01 <- load(d, i+8 ), load(d, i+9 ));
csa!(b02b, b01 <- load(d, i+10), load(d, i+11));
csa!(b04a, b02 <- b02a, b02b);
csa!(b02a, b01 <- load(d, i+12), load(d, i+13));
csa!(b02b, b01 <- load(d, i+14), load(d, i+15));
csa!(b04b, b02 <- b02a, b02b);
csa!(b08b, b04 <- b04a, b04b);
csa!(b16, b08 <- b08a, b08b);
total = Internals::vadd(total, Internals::count_ones(b16));
i += 16;
}
total = Internals::vshiftl(total, 4);
total = Internals::vadd(total, Internals::vshiftl(Internals::count_ones(b08), 3));
total = Internals::vadd(total, Internals::vshiftl(Internals::count_ones(b04), 2));
total = Internals::vadd(total, Internals::vshiftl(Internals::count_ones(b02), 1));
total = Internals::vadd(total, Internals::count_ones(b01) );
while i < n {
total = Internals::vadd(total, Internals::count_ones(load(d, i)));
i += 1;
}
Internals::reduce_total(total, weights)
}
fn harley_seal32<Input, LoadFn>(d: &Input, n: usize, load: LoadFn, weights: HarleySealWeights32)
-> u64
where LoadFn: Fn(&Input, usize) -> __m256i
{
unsafe {
harley_seal::<Input, LoadFn, Internals32>(d, n, load, weights)
}
}
fn harley_seal64<Input, LoadFn>(d: &Input, n: usize, load: LoadFn, weights: HarleySealWeights64)
-> u64
where LoadFn: Fn(&Input, usize) -> __m256i
{
unsafe {
harley_seal::<Input, LoadFn, Internals64>(d, n, load, weights)
}
}
// ------------------------------------------------------------------------------------------------
#[allow(unused_macros)]
macro_rules! loadfn {
($name:ident < Uncompressed > () ) => {
fn $name(&(bset1, bset2):
&(*const __m256i, *const __m256i),
index: usize)
-> __m256i
{
unsafe {
let mask1 = loadfn!(@load __m256i: bset1, index);
let mask2 = loadfn!(@load __m256i: bset2, index);
_mm256_and_si256(mask1, mask2)
}
}
};
($name:ident < Compressed10 > () ) => {
fn $name(&(indexes1, bset1, bset2):
&(*const __m256i, *const __m256i, *const __m256i),
index: usize)
-> __m256i
{
unsafe {
let mask1 = loadfn!(@load __m256i: bset1, index);
let mask2 = loadfn!(@gather __m256i: indexes1, bset2, index);
_mm256_and_si256(mask1, mask2)
}
}
};
($name:ident < Uncompressed > ( $in:ident ) ) => {
fn $name(&(bitslice, bset1, bset2):
&(*const __m256i, *const __m256i, *const __m256i),
index: usize)
-> __m256i
{
unsafe {
let slice = loadfn!(@load __m256i: bitslice, index);
let mask1 = loadfn!(@load $in: bset1, index);
let mask2 = loadfn!(@load $in: bset2, index);
let maskx = loadfn!(@and $in: mask1, mask2);
let maskx = loadfn!(@expand $in: maskx);
_mm256_and_si256(slice, maskx)
}
}
};
($name:ident < Compressed10 > ( $in:ident ) ) => {
fn $name(&(bitslice, indexes1, bset1, bset2):
&(*const __m256i, *const __m256i, *const __m256i, *const __m256i),
index: usize)
-> __m256i
{
unsafe {
let slice = loadfn!(@load __m256i: bitslice, index);
let mask1 = loadfn!(@load $in: bset1, index);
let mask2 = loadfn!(@gather $in: indexes1, bset2, index);
let maskx = loadfn!(@and $in: mask1, mask2);
let maskx = loadfn!(@expand $in: maskx);
_mm256_and_si256(slice, maskx)
}
}
};
($name:ident < Compressed01 > ( $in:ident ) ) => {
fn $name(&(bitslice, bset1, indexes2, bset2):
&(*const __m256i, *const __m256i, *const __m256i, *const __m256i),
index: usize)
-> __m256i
{
unsafe {
let slice = loadfn!(@select $in: indexes2, bitslice, index);
let mask1 = loadfn!(@gather $in: indexes2, bset1, index);
let mask2 = loadfn!(@load $in: bset2, index);
let maskx = loadfn!(@and $in: mask1, mask2);
let maskx = loadfn!(@expand $in: maskx);
_mm256_and_si256(slice, maskx)
}
}
};
// 8-bit discretization
(@load u32: $bset:expr, $index:expr) => {{ *($bset as *const u32).add($index) }};
(@and u32: $m1:expr, $m2:expr) => {{ $m1 & $m2 }};
(@expand u32: $value:expr) => {{
let v32 = $value;
let v64 = (((v32 as u64) << 32) | v32 as u64) as i64;
_mm256_set1_epi64x(v64)
}};
(@gather u32: $indexes:ident, $bset:expr, $index:expr) => {{
let index = *(($indexes as *const u32).add($index)) as usize;
*($bset as *const u32).add(index)
}};
(@select u32: $indexes:ident, $slice:expr, $index:expr) => {{
let index = *(($indexes as *const u32).add($index)) as usize;
_mm256_load_si256($slice.add(index))
}};
// 4-bit discretization
(@load u64: $bset:expr, $index:expr) => {{ *($bset as *const u64).add($index) }};
(@and u64: $v1:expr, $v2:expr) => {{ $v1 & $v2 }};
(@expand u64: $value:expr) => {{ let v64 = $value; _mm256_set1_epi64x(v64 as i64) }};
(@gather u64: $indexes:ident, $bset:expr, $index:expr) => {{
let index1 = *(($indexes as *const u32).add(2*$index )) as usize;
let index2 = *(($indexes as *const u32).add(2*$index+1)) as usize;
// 1 1 2 2 3 3 4 4
// m1 m2 m1 m2 m1 m2 m1 m2
//
// m1 = 32-bit mask in bset at index `index1`
// m2 = 32-bit mask in bset at index `index2`
let bset = $bset as *const u32;
(*bset.add(index1) as u64) | ((*bset.add(index2) as u64) << 32)
}};
(@select u64: $indexes:ident, $slice:expr, $index:expr) => {{
let index = *(($indexes as *const u32).add(2 * $index)) as usize;
_mm256_load_si256($slice.add(index / 2))
}};
// 2-bit discretization
(@load __m128i: $bset:expr, $index:expr) => {{
_mm_load_si128(($bset as *const __m128i).add($index)) }};
(@and __m128i: $v1:expr, $v2:expr) => {{ _mm_and_si128($v1, $v2) }};
(@expand __m128i: $value:expr) => {{ let v128 = $value; _mm256_set_m128i(v128, v128) }};
(@gather __m128i: $indexes:ident, $bset:expr, $index:expr) => {{
let indexes = _mm_load_si128(($indexes as *const __m128i).add($index));
_mm_i32gather_epi32($bset as *const i32, indexes, 4)
}};
(@select __m128i: $indexes:ident, $slice:expr, $index:expr) => {{
let index = *(($indexes as *const u32).add(4 * $index)) as usize;
_mm256_load_si256($slice.add(index / 4))
}};
// 1-bit discretization
(@load __m256i: $bset:expr, $index:expr) => {{
_mm256_load_si256(($bset as *const __m256i).add($index)) }};
(@and __m256i: $v1:expr, $v2:expr) => {{ _mm256_and_si256($v1, $v2) }};
(@expand __m256i: $value:expr) => {{ $value }};
(@gather __m256i: $indexes:ident, $bset:expr, $index:expr) => {{
let indexes = _mm256_load_si256(($indexes as *const __m256i).add($index));
_mm256_i32gather_epi32($bset as *const i32, indexes, 4)
}};
(@select __m256i: $indexes:ident, $slice:expr, $index:expr) => {{
let index = *(($indexes as *const u32).add(8 * $index)) as usize;
_mm256_load_si256($slice.add(index / 8))
}}
}
loadfn!(load_and2_c00<Uncompressed>());
loadfn!(load_and2_c10<Compressed10>());
loadfn!(load_and3_w1_c00<Uncompressed>(__m256i));
loadfn!(load_and3_w2_c00<Uncompressed>(__m128i));
loadfn!(load_and3_w4_c00<Uncompressed>(u64));
loadfn!(load_and3_w8_c00<Uncompressed>(u32));
loadfn!(load_and3_w1_c10<Compressed10>(__m256i));
loadfn!(load_and3_w2_c10<Compressed10>(__m128i));
loadfn!(load_and3_w4_c10<Compressed10>(u64));
loadfn!(load_and3_w8_c10<Compressed10>(u32));
loadfn!(load_and3_w1_c01<Compressed01>(__m256i));
loadfn!(load_and3_w2_c01<Compressed01>(__m128i));
loadfn!(load_and3_w4_c01<Compressed01>(u64));
loadfn!(load_and3_w8_c01<Compressed01>(u32));
// - Harley-Seal based counting and summing: uncompressed, compressed10,and compressed01 ----------
pub fn count_and2_c00(blocks1: &BitBlocks, blocks2: &BitBlocks) -> u64 {
let ptr1 = blocks1.as_ptr() as *const __m256i;
let ptr2 = blocks2.as_ptr() as *const __m256i;
harley_seal64(&(ptr1, ptr2), blocks1.len(), load_and2_c00, (1, 1, 1, 1))
}
pub fn count_and2_c10(indexes1: &BitBlocks, blocks1: &BitBlocks, blocks2: &BitBlocks) -> u64 {
let idxs = indexes1.as_ptr() as *const __m256i;
let ptr1 = blocks1.as_ptr() as *const __m256i;
let ptr2 = blocks2.as_ptr() as *const __m256i;
harley_seal64(&(idxs, ptr1, ptr2), blocks1.len(), load_and2_c10, (1, 1, 1, 1))
}
pub fn sum_and3_w1_c00(bitslice: &BitBlocks, bset1: &BitBlocks, bset2: &BitBlocks) -> u64 {
let slice = bitslice.as_ptr() as *const __m256i;
let ptr1 = bset1.as_ptr() as *const __m256i;
let ptr2 = bset2.as_ptr() as *const __m256i;
harley_seal64(&(slice, ptr1, ptr2), bitslice.len(), load_and3_w1_c00, (1, 1, 1, 1))
}
pub fn sum_and3_w2_c00(bitslice: &BitBlocks, bset1: &BitBlocks, bset2: &BitBlocks) -> u64 {
let slice = bitslice.as_ptr() as *const __m256i;
let ptr1 = bset1.as_ptr() as *const __m256i;
let ptr2 = bset2.as_ptr() as *const __m256i;
harley_seal64(&(slice, ptr1, ptr2), bitslice.len(), load_and3_w2_c00, (1, 1, 2, 2))
}
pub fn sum_and3_w4_c00(bitslice: &BitBlocks, bset1: &BitBlocks, bset2: &BitBlocks) -> u64 {
let slice = bitslice.as_ptr() as *const __m256i;
let ptr1 = bset1.as_ptr() as *const __m256i;
let ptr2 = bset2.as_ptr() as *const __m256i;
harley_seal64(&(slice, ptr1, ptr2), bitslice.len(), load_and3_w4_c00, (1, 2, 4, 8))
}
pub fn sum_and3_w8_c00(bitslice: &BitBlocks, bset1: &BitBlocks, bset2: &BitBlocks) -> u64 {
let slice = bitslice.as_ptr() as *const __m256i;
let ptr1 = bset1.as_ptr() as *const __m256i;
let ptr2 = bset2.as_ptr() as *const __m256i;
harley_seal32(&(slice, ptr1, ptr2), bitslice.len(), load_and3_w8_c00,
(1, 2, 4, 8, 16, 32, 64, 128))
}
pub fn sum_and3_w1_c10(bitslice: &BitBlocks, idxs1: &BitBlocks, bset1: &BitBlocks,
bset2: &BitBlocks) -> u64 {
let slice = bitslice.as_ptr() as *const __m256i;
let idxs = idxs1.as_ptr() as *const __m256i;
let ptr1 = bset1.as_ptr() as *const __m256i;
let ptr2 = bset2.as_ptr() as *const __m256i;
harley_seal64(&(slice, idxs, ptr1, ptr2), bitslice.len(), load_and3_w1_c10, (1, 1, 1, 1))
}
pub fn sum_and3_w2_c10(bitslice: &BitBlocks, idxs1: &BitBlocks, bset1: &BitBlocks,
bset2: &BitBlocks) -> u64 {
let slice = bitslice.as_ptr() as *const __m256i;
let idxs = idxs1.as_ptr() as *const __m256i;
let ptr1 = bset1.as_ptr() as *const __m256i;
let ptr2 = bset2.as_ptr() as *const __m256i;
harley_seal64(&(slice, idxs, ptr1, ptr2), bitslice.len(), load_and3_w2_c10, (1, 1, 2, 2))
}
pub fn sum_and3_w4_c10(bitslice: &BitBlocks, idxs1: &BitBlocks, bset1: &BitBlocks,
bset2: &BitBlocks) -> u64 {
let slice = bitslice.as_ptr() as *const __m256i;
let idxs = idxs1.as_ptr() as *const __m256i;
let ptr1 = bset1.as_ptr() as *const __m256i;
let ptr2 = bset2.as_ptr() as *const __m256i;
harley_seal64(&(slice, idxs, ptr1, ptr2), bitslice.len(), load_and3_w4_c10, (1, 2, 4, 8))
}
pub fn sum_and3_w8_c10(bitslice: &BitBlocks, idxs1: &BitBlocks, bset1: &BitBlocks,
bset2: &BitBlocks) -> u64 {
let slice = bitslice.as_ptr() as *const __m256i;
let idxs = idxs1.as_ptr() as *const __m256i;
let ptr1 = bset1.as_ptr() as *const __m256i;
let ptr2 = bset2.as_ptr() as *const __m256i;
harley_seal32(&(slice, idxs, ptr1, ptr2), bitslice.len(), load_and3_w8_c10,
(1, 2, 4, 8, 16, 32, 64, 128))
}
// - Non-Harley-Seal based counting: compressed11; does not fit well in Harley-Seal template ------
macro_rules! count_and_sum_c11 {
(count_and2_c11) => {
pub fn count_and2_c11(idxs1: &BitBlocks, bset1: &BitBlocks,
idxs2: &BitBlocks, bset2: &BitBlocks) -> u64 {
count_and_sum_c11!(@body count: idxs1, bset1, idxs2, bset2, 1, ())
}
};
(sum_and3_wx_c11: $name:ident, $width:expr, $layout:ident) => {
pub fn $name(bitslice: &BitBlocks,
idxs1: &BitBlocks, bset1: &BitBlocks,
idxs2: &BitBlocks, bset2: &BitBlocks) -> u64 {
count_and_sum_c11!(@body sum: idxs1, bset1, idxs2, bset2, $width,
BitsliceWithLayout::<_, $layout>::for_bitblocks(bitslice))
}
};
(@body $count_or_sum:ident: $idxs1:expr, $bset1:expr, $idxs2:expr, $bset2:expr,
$width:expr, $bitslice:expr) => {{
let mut i1 = 0;
let mut i2 = 0;
let mut sums = [0u64; $width];
let idxs1 = $idxs1.cast::<u32>();
let idxs2 = $idxs2.cast::<u32>();
let bset1 = $bset1.cast::<u32>();
let bset2 = $bset2.cast::<u32>();
#[allow(unused_variables)]
let bitslice = $bitslice;
safety_check!(idxs1.len() == bset1.len());
safety_check!(idxs2.len() == bset2.len());
while i1 < idxs1.len() && i2 < idxs2.len() {
let idx1 = unsafe { idxs1.get_unchecked(i1) };
let idx2 = unsafe { idxs2.get_unchecked(i2) };
if idx1 < idx2 { i1 += 1; }
else if idx1 > idx2 { i2 += 1; }
else { // equal!
let m1 = unsafe { bset1.get_unchecked(i1) };
let m2 = unsafe { bset2.get_unchecked(i2) };
let mask = m1 & m2;
for lane in 0..$width {
let sum = unsafe { sums.get_unchecked_mut(lane) };
let block = count_and_sum_c11!(@load $count_or_sum: bitslice, mask, i1, lane);
*sum += block.count_ones() as u64;
}
i1 += 1;
i2 += 1;
}
}
let mut sum = 0;
for lane in 0..$width {
sum += (1<<lane) * sums[lane];
}
sum
}};
(@load sum: $bitslice:expr, $mask:expr, $index:expr, $lane:expr) => {{
let block = unsafe { $bitslice.get_block_unchecked($index, $lane) };
block & $mask
}};
(@load count: $bitslice:expr, $mask:expr, $index:expr, $lane:expr) => {{
$mask
}}
}
count_and_sum_c11!(count_and2_c11);
count_and_sum_c11!(sum_and3_wx_c11: sum_and3_w1_c11, 1, BitsliceLayout1);
count_and_sum_c11!(sum_and3_wx_c11: sum_and3_w2_c11, 2, BitsliceLayout2);
count_and_sum_c11!(sum_and3_wx_c11: sum_and3_w4_c11, 4, BitsliceLayout4);
count_and_sum_c11!(sum_and3_wx_c11: sum_and3_w8_c11, 8, BitsliceLayout8);
// ------------------------------------------------------------------------------------------------
#[cfg(test)]
mod test {
use crate::bitblock::{BitBlocks};
use crate::bitset::Bitset;
use crate::bitslice::{Bitslice, BitsliceLayout};
use crate::bitslice::{BitsliceLayout1, BitsliceLayout2, BitsliceLayout4, BitsliceLayout8};
use super::*;
#[test]
fn test_count_and2_c00() {
let n = 20_000;
let seed = 112;
let mut sum = 0;
let mut bset1 = Bitset::zeros(n);
let mut bset2 = Bitset::zeros(n);
for i in 0..n {
let b1 = (((1123*i) % 3 + 51) % 3 + seed) % 3 == 1;
let b2 = (((8827*i) % 2 + 99) % 2 + seed) % 2 == 1;
bset1.set_bit(i, b1);
bset2.set_bit(i, b2);
if b1 && b2 { sum += 1; }
}
let bset1_ptr = bset1.as_ptr() as *const __m256i;
let bset2_ptr = bset2.as_ptr() as *const __m256i;
let sum_harley_seal1 = harley_seal64(&(bset1_ptr, bset2_ptr), bset1.len(),
load_and2_c00, (1, 1, 1, 1));
let sum_harley_seal2 = count_and2_c00(&bset1, &bset2);
assert_eq!(sum, sum_harley_seal1);
assert_eq!(sum, sum_harley_seal2);
}
#[test]
fn test_count_and2_c10_1() {
let m1 = 4*128;
let m2 = 4*1024;
let seed = 112;
let mut sum = 0;
let mut bset1 = Bitset::zeros(m1 * 32);
let mut bset2 = Bitset::zeros(m2 * 32);
let indexes = BitBlocks::from_iter(m1, 0u32..m1 as u32);
for i in 0..(32*m1) {
let b1 = (((1123*i) % 3 + 51) % 3 + seed) % 3 == 1;
let b2 = (((8827*i) % 2 + 99) % 2 + seed) % 2 == 1;
bset1.set_bit(i, b1);
bset2.set_bit(i, b2);
if b1 && b2 { sum += 1; }
}
let indexes_ptr = indexes.as_ptr() as *const __m256i;
let bset1_ptr = bset1.as_ptr() as *const __m256i;
let bset2_ptr = bset2.as_ptr() as *const __m256i;
let sum_harley_seal1 = harley_seal64(&(indexes_ptr, bset1_ptr, bset2_ptr),
bset1.len(), load_and2_c10, (1, 1, 1, 1));
let sum_harley_seal2 = count_and2_c10(&indexes, &bset1, &bset2);
assert_eq!(sum, sum_harley_seal1);
assert_eq!(sum, sum_harley_seal2);
}
#[test]
fn test_count_and2_c10_2() {
let m1 = 4*128;
let m2 = 4*1024;
let seed = 92;
let mut sum = 0;
let mut bset1 = Bitset::zeros(m1 * 32);
let mut bset2 = Bitset::zeros(m2 * 32);
let indexes_iter = (0..m1).map(|i| ((((i*31)%m2)+12284+seed)%m2) as u32);
let mut indexes = BitBlocks::from_iter(m1, indexes_iter);
indexes.cast_mut::<u32>()[0..m1].sort();
for i in 0..m1 {
for j in 0..32 {
let b1 = (((1123*(i*32+j)) % 3 + 51) % 3 + seed) % 3 == 1;
let b2 = (((8827*(i*32+j)) % 2 + 99) % 2 + seed) % 2 == 1;
bset1.set_bit(i*32+j, b1);
bset2.set_bit(*indexes.get::<u32>(i) as usize*32+j, b2);
if b1 && b2 { sum += 1; }
}
}
let indexes_ptr = indexes.as_ptr() as *const __m256i;
let bset1_ptr = bset1.as_ptr() as *const __m256i;
let bset2_ptr = bset2.as_ptr() as *const __m256i;
let sum_harley_seal1 = harley_seal64(&(indexes_ptr, bset1_ptr, bset2_ptr),
bset1.len(), load_and2_c10, (1, 1, 1, 1));
let sum_harley_seal2 = count_and2_c10(&indexes, &bset1, &bset2);
assert_eq!(sum, sum_harley_seal1);
assert_eq!(sum, sum_harley_seal2);
}
#[test]
fn test_count_and2_c11() {
}
#[test]
fn test_sum_and3_c00() {
sum_c00::<BitsliceLayout1>(20);
sum_c00::<BitsliceLayout2>(111);
sum_c00::<BitsliceLayout4>(222);
sum_c00::<BitsliceLayout8>(333);
}
fn sum_c00<L>(seed: usize)
where L: BitsliceLayout
{
let n = 20_000;
let m = L::nunique_values();
let mut bitslice = Bitslice::new();
let mut view = bitslice.with_layout_mut::<L>();
view.resize(n);
let nblocks = view.nblocks();
let mut bset1 = Bitset::zeros(n);
let mut bset2 = Bitset::zeros(n);
let mut sum = 0;
for i in 0..n {
let k = ((((1123*i) % m + 51) % m + seed) % m) as u8;
let b1 = (((1123*i) % 3 + 51) % 3 + seed) % 3 == 1;
let b2 = (((8827*i) % 2 + 99) % 2 + seed) % 2 == 1;
view.set_value(i, k);
bset1.set_bit(i, b1);
bset2.set_bit(i, b2);
if b1 && b2 {
sum += k as u64;
//println!("{:3}: {:5} = {}", i, k, sum);
}
}
let bitslice_ptr = bitslice.as_bitblocks().as_ptr() as *const __m256i;
let bset1_ptr = bset1.as_ptr() as *const __m256i;
let bset2_ptr = bset2.as_ptr() as *const __m256i;
let w1 = (1, 1, 1, 1);
let w2 = (1, 1, 2, 2);
let w4 = (1, 2, 4, 8);
let w8 = (1, 2, 4, 8, 16, 32, 64, 128);
let sum_harley_seal1 = match L::width() {
1 => { harley_seal64(&(bitslice_ptr, bset1_ptr, bset2_ptr), nblocks, load_and3_w1_c00, w1) }
2 => { harley_seal64(&(bitslice_ptr, bset1_ptr, bset2_ptr), nblocks, load_and3_w2_c00, w2) }
4 => { harley_seal64(&(bitslice_ptr, bset1_ptr, bset2_ptr), nblocks, load_and3_w4_c00, w4) }
8 => { harley_seal32(&(bitslice_ptr, bset1_ptr, bset2_ptr), nblocks, load_and3_w8_c00, w8) }
_ => { panic!() }
};
let sum_harley_seal2 = match L::width() {
1 => { sum_and3_w1_c00(bitslice.as_bitblocks(), &bset1, &bset2) }
2 => { sum_and3_w2_c00(bitslice.as_bitblocks(), &bset1, &bset2) }
4 => { sum_and3_w4_c00(bitslice.as_bitblocks(), &bset1, &bset2) }
8 => { sum_and3_w8_c00(bitslice.as_bitblocks(), &bset1, &bset2) }
_ => { panic!() }
};
assert_eq!(sum, sum_harley_seal1);
assert_eq!(sum, sum_harley_seal2);
}
#[test]
fn test_sum_and3_c10() {
sum_c10::<BitsliceLayout1>(20);
sum_c10::<BitsliceLayout2>(111);
sum_c10::<BitsliceLayout4>(222);
sum_c10::<BitsliceLayout8>(333);
}
fn sum_c10<L>(seed: usize)
where L: BitsliceLayout
{
let m1 = 2048;
let m2 = 4*m1;
let m = L::nunique_values();
let mut bitslice = Bitslice::new();
let mut view = bitslice.with_layout_mut::<L>();
view.resize(m1 * 32);
let nblocks = view.nblocks();
let mut bset1 = Bitset::zeros(m1 * 32);
let mut bset2 = Bitset::zeros(m2 * 32);
let mut sum = 0;
let indexes_iter = (0..m1).map(|i| ((((i*79)%m2)+12284+seed)%m2) as u32);
let mut indexes = BitBlocks::from_iter(m1, indexes_iter);
indexes.cast_mut::<u32>()[0..m1].sort();
for i in 0..m1 {
for j in 0..32 {
let k = ((((1123*i+j) % m + 51) % m + seed) % m) as u8;
let b1 = (((1123*i+j) % 3 + 51) % 3 + seed) % 3 == 1;
let b2 = (((8827*i+j) % 2 + 99) % 2 + seed) % 2 == 1;
view.set_value(i*32+j, k);
bset1.set_bit(i*32+j, b1);
bset2.set_bit(*indexes.get::<u32>(i) as usize*32+j, b2);
if b1 && b2 {
sum += k as u64;
//println!("{:3}: {:5} = {}", i, k, sum);
}
}
}
let bitslice_ptr = bitslice.as_bitblocks().as_ptr() as *const __m256i;
let indexes1_ptr = indexes.as_ptr() as *const __m256i;
let bset1_ptr = bset1.as_ptr() as *const __m256i;
let bset2_ptr = bset2.as_ptr() as *const __m256i;
let w1 = (1, 1, 1, 1);
let w2 = (1, 1, 2, 2);
let w4 = (1, 2, 4, 8);
let w8 = (1, 2, 4, 8, 16, 32, 64, 128);
let sum_harley_seal1 = match L::width() {
1 => { harley_seal64(&(bitslice_ptr, indexes1_ptr, bset1_ptr, bset2_ptr), nblocks, load_and3_w1_c10, w1) }
2 => { harley_seal64(&(bitslice_ptr, indexes1_ptr, bset1_ptr, bset2_ptr), nblocks, load_and3_w2_c10, w2) }
4 => { harley_seal64(&(bitslice_ptr, indexes1_ptr, bset1_ptr, bset2_ptr), nblocks, load_and3_w4_c10, w4) }
8 => { harley_seal32(&(bitslice_ptr, indexes1_ptr, bset1_ptr, bset2_ptr), nblocks, load_and3_w8_c10, w8) }
_ => { panic!() }
};
let sum_harley_seal2 = match L::width() {
1 => { sum_and3_w1_c10(bitslice.as_bitblocks(), &indexes, &bset1, &bset2) }
2 => { sum_and3_w2_c10(bitslice.as_bitblocks(), &indexes, &bset1, &bset2) }
4 => { sum_and3_w4_c10(bitslice.as_bitblocks(), &indexes, &bset1, &bset2) }
8 => { sum_and3_w8_c10(bitslice.as_bitblocks(), &indexes, &bset1, &bset2) }
_ => { panic!() }
};
assert_eq!(sum, sum_harley_seal1);
assert_eq!(sum, sum_harley_seal2);
}
#[test]
fn test_sum_and3_c11() {
sum_c11::<BitsliceLayout1>();
sum_c11::<BitsliceLayout2>();
sum_c11::<BitsliceLayout4>();
sum_c11::<BitsliceLayout8>();
}
fn sum_c11<L>()
where L: BitsliceLayout
{
let m = L::nunique_values();
let mut bset1 = Bitset::zeros(3 * 32);
bset1.enable_bit(0);
bset1.enable_bit(2);
bset1.enable_bit(31);
bset1.enable_bit(64);
bset1.enable_bit(65);
bset1.enable_bit(66);
let mut bset2 = Bitset::zeros(3 * 32);
bset2.enable_bit(32);
bset2.enable_bit(33);
bset2.enable_bit(34);
bset2.enable_bit(35);
bset2.enable_bit(63);
bset2.enable_bit(65);
bset2.enable_bit(96);
let indexes1 = BitBlocks::from_iter::<u32, _>(3, [1u32, 2, 12].iter().cloned());
let indexes2 = BitBlocks::from_iter::<u32, _>(4, [0u32, 1, 12, 14].iter().cloned());
let mut bitslice = Bitslice::new();
let mut view = bitslice.with_layout_mut::<L>();
view.resize(3 * 32);
view.set_value( 0, (7 % m) as u8);
view.set_value( 1, (11 % m) as u8);
view.set_value( 2, (13 % m) as u8);
view.set_value( 3, (15 % m) as u8);
view.set_value(31, (97 % m) as u8);
view.set_value(32, (23 % m) as u8);
view.set_value(63, (27 % m) as u8);
view.set_value(64, (31 % m) as u8);
view.set_value(65, (33 % m) as u8);
view.set_value(66, (37 % m) as u8);
view.set_value(67, (51 % m) as u8);
view.set_value(96, (51 % m) as u8);
let sum_check =
view.get_value(0 ) as u64
+ view.get_value(2 ) as u64
+ view.get_value(31) as u64
+ view.get_value(65) as u64;
println!("indexes1 {:?}", &indexes1.cast::<u32>()[0..3]);
println!("indexes2 {:?}", &indexes2.cast::<u32>()[0..4]);
let sum = match L::width() {
1 => { sum_and3_w1_c11(bitslice.as_bitblocks(), &indexes1, &bset1, &indexes2, &bset2) }
2 => { sum_and3_w2_c11(bitslice.as_bitblocks(), &indexes1, &bset1, &indexes2, &bset2) }
4 => { sum_and3_w4_c11(bitslice.as_bitblocks(), &indexes1, &bset1, &indexes2, &bset2) }
8 => { sum_and3_w8_c11(bitslice.as_bitblocks(), &indexes1, &bset1, &indexes2, &bset2) }
_ => { panic!() }
};
println!("sum {}, check {}", sum, sum_check);
assert_eq!(sum, sum_check);
}
}
| 37.346591 | 118 | 0.546478 |
6bc0c8f4f556e40135eae839ccf5127571cc1d33 | 8,782 | rs | Rust | src/lib.rs | 715209/irc_parser | 13e6a784d0ce1ff79034b5dd7d4ba6f08d8c57b0 | [
"MIT"
] | null | null | null | src/lib.rs | 715209/irc_parser | 13e6a784d0ce1ff79034b5dd7d4ba6f08d8c57b0 | [
"MIT"
] | null | null | null | src/lib.rs | 715209/irc_parser | 13e6a784d0ce1ff79034b5dd7d4ba6f08d8c57b0 | [
"MIT"
] | null | null | null | use std::collections::HashMap;
/*
<message> ::= ['@' <tags> <SPACE>] [':' <prefix> <SPACE> ] <command> <params> <crlf>
<tags> ::= <tag> [';' <tag>]*
<tag> ::= <key> ['=' <escaped_value>]
<key> ::= [ <client_prefix> ] [ <vendor> '/' ] <key_name>
<client_prefix> ::= '+'
<key_name> ::= <non-empty sequence of ascii letters, digits, hyphens ('-')>
<escaped_value> ::= <sequence of zero or more utf8 characters except NUL, CR, LF, semicolon (`;`) and SPACE>
<vendor> ::= <host>
<prefix> ::= <servername> | <nick> [ '!' <user> ] [ '@' <host> ]
<command> ::= <letter> { <letter> } | <number> <number> <number>
<SPACE> ::= ' ' { ' ' }
<params> ::= <SPACE> [ ':' <trailing> | <middle> <params> ]
<middle> ::= <Any *non-empty* sequence of octets not including SPACE
or NUL or CR or LF, the first of which may not be ':'>
<trailing> ::= <Any, possibly *empty*, sequence of octets not including
NUL or CR or LF>
<crlf> ::= CR LF
*/
#[derive(Debug, PartialEq, Clone)]
pub enum Prefix {
Servername(String),
Nick(String, String, String),
}
#[derive(Debug, Clone)]
pub struct Message {
pub tags: Option<HashMap<String, Option<String>>>,
pub prefix: Option<Prefix>,
pub command: Option<String>,
pub params: Option<Vec<String>>,
}
impl Default for Message {
fn default() -> Self {
Message {
tags: None,
prefix: None,
command: None,
params: None,
}
}
}
// TODO: Replace errors with real errors
impl Message {
pub fn parse(message: &str) -> Result<Message, &'static str> {
if message.is_empty() {
return Err("Nothing found to parse");
}
let mut msg: Message = Message::default();
let mut pos_head = 0;
let mut pos_tail;
if message.starts_with('@') {
let tags = if let Some(i) = message.find(' ') {
pos_tail = i;
&message[..pos_tail]
} else {
return Err("No command found");
};
msg.tags = Some(
tags[1..]
.split(';')
.map(|kv| kv.split('='))
.map(|mut kv| {
let k: String = kv.next().unwrap().to_owned();
let mut v: Option<String> = Some(kv.next().unwrap().to_owned());
if v == Some("".to_string()) {
v = None
};
(k, v)
})
.collect(),
);
pos_head = pos_tail + 1;
}
if message[pos_head..].starts_with(':') {
let prefix = if let Some(i) = &message[pos_head..].find(' ') {
pos_tail = pos_head + i;
&message[pos_head..pos_tail]
} else {
return Err("No command found");
};
let prefix: Vec<&str> = prefix[1..].split(|ch| ch == '!' || ch == '@').collect();
if prefix.len() == 1 {
msg.prefix = Some(Prefix::Servername(prefix[0].to_owned()));
} else if prefix.len() == 3 {
msg.prefix = Some(Prefix::Nick(
prefix[0].to_owned(),
prefix[1].to_owned(),
prefix[2].to_owned(),
));
}
pos_head = pos_tail + 1;
}
let command_and_params = &message[pos_head..];
if let Some(i) = command_and_params.find(' ') {
msg.command = Some(command_and_params[..i].to_owned());
let params_string: &str = &command_and_params[i + 1..];
let text_loc = params_string.find(':');
let mut params: Vec<String> = Vec::new();
match text_loc {
Some(0) => {
params.push(params_string[1..].to_owned());
}
Some(loc) => {
params = params_string[..loc - 1]
.split_ascii_whitespace()
.map(|s| s.to_string())
.collect();
params.push(params_string[loc + 1..].to_owned());
}
None => {
params = params_string
.split_ascii_whitespace()
.map(|s| s.to_string())
.collect();
}
}
msg.params = Some(params);
} else {
msg.command = Some(command_and_params.to_owned());
}
Ok(msg)
}
}
#[cfg(test)]
mod tests {
use super::{Message, Prefix};
#[test]
fn normal_message() {
let parsed = Message::parse("@badge-info=;badges=broadcaster/1;color=#008000;display-name=715209;emotes=;flags=;id=8a90aa05-eea3-4699-84eb-1d4c65b85f94;mod=0;room-id=21621987;subscriber=0;tmi-sent-ts=1559891010190;turbo=0;user-id=21621987;user-type= :715209!715209@715209.tmi.twitch.tv PRIVMSG #715209 :hello").unwrap();
assert_ne!(parsed.tags, None);
assert_eq!(
parsed.prefix,
Some(Prefix::Nick(
"715209".to_string(),
"715209".to_string(),
"715209.tmi.twitch.tv".to_string()
))
);
assert_eq!(parsed.command, Some("PRIVMSG".to_string()));
assert_eq!(
parsed.params,
Some(vec!["#715209".to_string(), "hello".to_string()])
);
}
#[test]
fn normal_message_no_tags() {
let parsed =
Message::parse(":715209!715209@715209.tmi.twitch.tv PRIVMSG #715209 :hello").unwrap();
assert_eq!(parsed.tags, None);
assert_eq!(
parsed.prefix,
Some(Prefix::Nick(
"715209".to_string(),
"715209".to_string(),
"715209.tmi.twitch.tv".to_string()
))
);
assert_eq!(parsed.command, Some("PRIVMSG".to_string()));
assert_eq!(
parsed.params,
Some(vec!["#715209".to_string(), "hello".to_string()])
);
}
#[test]
fn ping() {
let parsed = Message::parse("PING :tmi.twitch.tv").unwrap();
assert_eq!(parsed.tags, None);
assert_eq!(parsed.prefix, None);
assert_eq!(parsed.command, Some("PING".to_string()));
assert_eq!(parsed.params, Some(vec!["tmi.twitch.tv".to_string()]));
}
#[test]
fn no_params() {
let parsed = Message::parse("@badge-info=;badges=;color=#008000;display-name=715209;emote-sets=0,33563,231890,300206296,300242181;user-id=21621987;user-type= :tmi.twitch.tv GLOBALUSERSTATE").unwrap();
assert_ne!(parsed.tags, None);
assert_eq!(
parsed.prefix,
Some(Prefix::Servername("tmi.twitch.tv".to_string()))
);
assert_eq!(parsed.command, Some("GLOBALUSERSTATE".to_string()));
assert_eq!(parsed.params, None);
}
#[test]
fn tags_no_prefix() {
let parsed = Message::parse("@badge-info=;badges=;color=#008000;display-name=715209;emote-sets=0,33563,231890,300206296,300242181;user-id=21621987;user-type= GLOBALUSERSTATE").unwrap();
assert_ne!(parsed.tags, None);
assert_eq!(parsed.prefix, None);
assert_eq!(parsed.command, Some("GLOBALUSERSTATE".to_string()));
assert_eq!(parsed.params, None);
}
#[test]
fn tags_and_params_no_prefix() {
let parsed = Message::parse("@badge-info=;badges=;color=#008000;display-name=715209;emote-sets=0,33563,231890,300206296,300242181;user-id=21621987;user-type= PRIVMSG #715209 :hello").unwrap();
assert_ne!(parsed.tags, None);
assert_eq!(parsed.prefix, None);
assert_eq!(parsed.command, Some("PRIVMSG".to_string()));
assert_eq!(
parsed.params,
Some(vec!["#715209".to_string(), "hello".to_string()])
);
}
#[test]
fn only_command() {
let parsed = Message::parse("PRIVMSG").unwrap();
assert_eq!(parsed.tags, None);
assert_eq!(parsed.prefix, None);
assert_eq!(parsed.command, Some("PRIVMSG".to_string()));
assert_eq!(parsed.params, None);
}
#[test]
fn nothing_to_parse() {
let parsed = Message::parse("");
assert!(parsed.is_err(), "Nothing found to parse");
}
#[test]
fn only_tags() {
let parsed = Message::parse("@badge-info=;badges=;color=#008000;display-name=715209;emote-sets=0,33563,231890,300206296,300242181;user-id=21621987;user-type=");
assert!(parsed.is_err(), "No command found");
}
}
| 33.64751 | 328 | 0.511501 |
70e5e9efc65877c5ba4f88c5d9ebc603910cc38a | 1,100 | h | C | RFW/system/src/rfw/texture.h | MeirBon/rendering-fw | dff775c816d19cd9e11eac2c2a2b3c608216ad4c | [
"Apache-2.0"
] | 77 | 2020-01-03T18:32:47.000Z | 2021-08-08T01:06:52.000Z | RFW/system/src/rfw/texture.h | meirbon/rendering-fw | dff775c816d19cd9e11eac2c2a2b3c608216ad4c | [
"Apache-2.0"
] | 1 | 2020-01-09T01:59:27.000Z | 2020-01-09T08:47:28.000Z | RFW/system/src/rfw/texture.h | meirbon/rendering-fw | dff775c816d19cd9e11eac2c2a2b3c608216ad4c | [
"Apache-2.0"
] | 2 | 2022-02-20T01:55:07.000Z | 2022-03-30T03:02:48.000Z | //
// Created by Mèir Noordermeer on 2019-08-20.
//
#ifndef RENDERING_FW_SRC_TEXTURE_HPP
#define RENDERING_FW_SRC_TEXTURE_HPP
#include <string>
#include <vector>
#include <rfw/math.h>
namespace rfw
{
struct texture
{
enum Type
{
FLOAT4,
UNSIGNED_INT
};
enum Flags
{
INVERTED = 1,
LINEARIZED = 2,
FLIPPED = 4,
NORMAL_MAP = 8
};
enum Properties
{
HAS_ALPHA = 1,
LDR = 2,
HDR = 4,
NMAP = 8,
};
texture() = default;
explicit texture(const std::string_view &file, uint flags = 0);
explicit texture(const uint *data, uint width, uint height);
explicit texture(const glm::vec4 *data, uint width, uint height);
void cleanup()
{
if (fdata)
delete[] fdata;
fdata = nullptr;
if (udata)
delete[] udata;
udata = nullptr;
}
uint sample(float x, float y);
void construct_mipmaps();
static uint required_pixel_count(uint width, uint height, uint mipLevels);
Type type;
uint texelCount;
uint width, height;
uint mipLevels;
uint flags = 0;
union {
glm::vec4 *fdata;
uint *udata;
};
};
} // namespace rfw
#endif // RENDERING_FW_SRC_TEXTURE_HPP
| 15.492958 | 75 | 0.677273 |
de5ccf09c5923d4ca67331f08f3afc52537c2438 | 4,087 | rs | Rust | src/test/run-pass/try-operator.rs | canaltinova/rust | 7323ac4add33363a4bdee910b70b09ee82fef7bb | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2017-09-15T23:58:12.000Z | 2019-09-24T02:31:48.000Z | src/test/run-pass/try-operator.rs | canaltinova/rust | 7323ac4add33363a4bdee910b70b09ee82fef7bb | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2020-07-16T16:18:48.000Z | 2020-07-16T16:18:48.000Z | src/test/run-pass/try-operator.rs | canaltinova/rust | 7323ac4add33363a4bdee910b70b09ee82fef7bb | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(question_mark)]
use std::fs::File;
use std::io::{Read, self};
use std::num::ParseIntError;
use std::str::FromStr;
fn on_method() -> Result<i32, ParseIntError> {
Ok("1".parse::<i32>()? + "2".parse::<i32>()?)
}
fn in_chain() -> Result<String, ParseIntError> {
Ok("3".parse::<i32>()?.to_string())
}
fn on_call() -> Result<i32, ParseIntError> {
fn parse<T: FromStr>(s: &str) -> Result<T, T::Err> {
s.parse()
}
Ok(parse("4")?)
}
fn nested() -> Result<i32, ParseIntError> {
Ok("5".parse::<i32>()?.to_string().parse()?)
}
fn on_path() -> Result<i32, ParseIntError> {
let x = "6".parse::<i32>();
Ok(x?)
}
fn on_macro() -> Result<i32, ParseIntError> {
macro_rules! id {
($e:expr) => { $e }
}
Ok(id!("7".parse::<i32>())?)
}
fn on_parens() -> Result<i32, ParseIntError> {
let x = "8".parse::<i32>();
Ok((x)?)
}
fn on_block() -> Result<i32, ParseIntError> {
let x = "9".parse::<i32>();
Ok({x}?)
}
fn on_field() -> Result<i32, ParseIntError> {
struct Pair<A, B> { a: A, b: B }
let x = Pair { a: "10".parse::<i32>(), b: 0 };
Ok(x.a?)
}
fn on_tuple_field() -> Result<i32, ParseIntError> {
let x = ("11".parse::<i32>(), 0);
Ok(x.0?)
}
fn on_try() -> Result<i32, ParseIntError> {
let x = "12".parse::<i32>().map(|i| i.to_string().parse::<i32>());
Ok(x??)
}
fn on_binary_op() -> Result<i32, ParseIntError> {
let x = 13 - "14".parse::<i32>()?;
let y = "15".parse::<i32>()? - 16;
let z = "17".parse::<i32>()? - "18".parse::<i32>()?;
Ok(x + y + z)
}
fn on_index() -> Result<i32, ParseIntError> {
let x = [19];
let y = "0".parse::<usize>();
Ok(x[y?])
}
fn on_args() -> Result<i32, ParseIntError> {
fn sub(x: i32, y: i32) -> i32 { x - y }
let x = "20".parse();
let y = "21".parse();
Ok(sub(x?, y?))
}
fn on_if() -> Result<i32, ParseIntError> {
Ok(if true {
"22".parse::<i32>()
} else {
"23".parse::<i32>()
}?)
}
fn on_if_let() -> Result<i32, ParseIntError> {
Ok(if let Ok(..) = "24".parse::<i32>() {
"25".parse::<i32>()
} else {
"26".parse::<i32>()
}?)
}
fn on_match() -> Result<i32, ParseIntError> {
Ok(match "27".parse::<i32>() {
Err(..) => "28".parse::<i32>(),
Ok(..) => "29".parse::<i32>(),
}?)
}
fn tight_binding() -> Result<bool, ()> {
fn ok<T>(x: T) -> Result<T, ()> { Ok(x) }
let x = ok(true);
Ok(!x?)
}
// just type check
fn merge_error() -> Result<i32, Error> {
let mut s = String::new();
File::open("foo.txt")?.read_to_string(&mut s)?;
Ok(s.parse::<i32>()? + 1)
}
fn main() {
assert_eq!(Ok(3), on_method());
assert_eq!(Ok("3".to_string()), in_chain());
assert_eq!(Ok(4), on_call());
assert_eq!(Ok(5), nested());
assert_eq!(Ok(6), on_path());
assert_eq!(Ok(7), on_macro());
assert_eq!(Ok(8), on_parens());
assert_eq!(Ok(9), on_block());
assert_eq!(Ok(10), on_field());
assert_eq!(Ok(11), on_tuple_field());
assert_eq!(Ok(12), on_try());
assert_eq!(Ok(-3), on_binary_op());
assert_eq!(Ok(19), on_index());
assert_eq!(Ok(-1), on_args());
assert_eq!(Ok(22), on_if());
assert_eq!(Ok(25), on_if_let());
assert_eq!(Ok(29), on_match());
assert_eq!(Ok(false), tight_binding());
}
enum Error {
Io(io::Error),
Parse(ParseIntError),
}
impl From<io::Error> for Error {
fn from(e: io::Error) -> Error {
Error::Io(e)
}
}
impl From<ParseIntError> for Error {
fn from(e: ParseIntError) -> Error {
Error::Parse(e)
}
}
| 20.333333 | 70 | 0.543675 |
5741a052e5089393e9fea6b07266afdf96024d2a | 7,029 | c | C | src/mod/fortinet/fortinet_actions_wtp.c | 7u83/actube | 0f6cfb9eab2843cf8269187d64cc797491d55b02 | [
"BSD-2-Clause"
] | 35 | 2015-01-16T04:33:02.000Z | 2021-04-29T02:22:33.000Z | src/mod/fortinet/fortinet_actions_wtp.c | 7u83/actube | 0f6cfb9eab2843cf8269187d64cc797491d55b02 | [
"BSD-2-Clause"
] | 4 | 2015-05-28T21:59:43.000Z | 2016-03-25T18:34:13.000Z | src/mod/fortinet/fortinet_actions_wtp.c | 7u83/actube | 0f6cfb9eab2843cf8269187d64cc797491d55b02 | [
"BSD-2-Clause"
] | 26 | 2015-01-16T04:32:56.000Z | 2022-02-21T09:14:22.000Z | /*
This file is part of libcapwap.
libcapwap is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
libcapwap 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foobar. If not, see <http://www.gnu.org/licenses/>.
*/
#include "cw/cipwap.h"
#include "cw/action.h"
#include "cw/capwap_items.h"
#include "cw/strheap.h"
#include "cw/radio.h"
#include "cw/capwap_cisco.h"
#include "cw/capwap80211.h"
#include "mod_fortinet.h"
#include "fortinet.h"
static cw_action_in_t actions_in[] = {
/* ----------------------------------------------------------------
* Discovery Response
*/
#if 0
/* AC Descriptor - Discovery Response */
{
.capwap_state = CW_STATE_DISCOVERY,
.msg_id = CW_MSG_DISCOVERY_RESPONSE,
.elem_id = CW_ELEM_AC_DESCRIPTOR,
.item_id = CW_ITEM_AC_DESCRIPTOR,
.start = cisco_in_ac_descriptor,
.min_len = 12,
.max_len = 8192,
.mand = 1
}
,
/* ----------------------------------------------------------------
* Join Response
*/
/* ECN Support - Join Response */
{
/* Make ECN Support non-mand */
.capwap_state = CAPWAP_STATE_JOIN,
.msg_id = CW_MSG_JOIN_RESPONSE,
.elem_id = CAPWAP_ELEM_ECN_SUPPORT,
.item_id = CW_ITEM_ECN_SUPPORT,
.start = cw_in_generic2,
.mand = 0,
.min_len = 1,
.max_len = 1
}
,
/* AC Descriptor - Join Response */
{
/* Cisco's AC Descriptor */
.capwap_state = CAPWAP_STATE_JOIN,
.msg_id = CW_MSG_JOIN_RESPONSE,
.elem_id = CW_ELEM_AC_DESCRIPTOR,
.item_id = CW_ITEM_AC_DESCRIPTOR,
.start = cisco_in_ac_descriptor,
.min_len = 12,
.max_len = 8192,
.mand = 1
}
,
/* ----------------------------------------------------------------
* Configuration Update Request
*/
/* Location Data - Conf Update Req */
{
.capwap_state = CW_STATE_RUN,
.vendor_id = CW_VENDOR_ID_CISCO,
.msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST,
.elem_id = LW_ELEM_LOCATION_DATA,
.item_id = CW_ITEM_LOCATION_DATA,
.start = cw_in_generic2,
.min_len = 0,
.max_len = 1024,
.mand = 0
}
,
/* WTP Name - Conf Update Req */
{
.capwap_state = CW_STATE_RUN,
.vendor_id = CW_VENDOR_ID_CISCO,
.msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST,
.elem_id = CISCO_ELEM_RAD_NAME,
.item_id = CW_ITEM_WTP_NAME,
.start = cw_in_generic2,
.min_len = 0,
.max_len = 1024,
.mand = 0
}
,
/* Radio Admin State - Config Status Request */
{
.capwap_state = CW_STATE_RUN,
.msg_id = CAPWAP_MSG_CONFIGURATION_UPDATE_REQUEST,
.elem_id = CAPWAP_ELEM_RADIO_ADMINISTRATIVE_STATE,
.item_id = CW_ITEM_RADIO_ADMINISTRATIVE_STATE,
.start = cisco_in_radio_administrative_state_wtp,
.mand = 1
}
,
#endif
/* End of list */
{0, 0}
};
static cw_action_out_t actions_out[]={
/* ----------------------------------------------------------------
* Message Discover Request
*/
#if 0
/* WTP Descriptor - Discovery */
{
.msg_id = CW_MSG_DISCOVERY_REQUEST,
.elem_id = CW_ELEM_WTP_DESCRIPTOR,
.item_id = CW_ITEM_WTP_DESCRIPTOR,
.out = cisco_out_wtp_descriptor,
.mand = 1
}
,
/* Cisco RAD Name (WTP Name) - Discovery */
{
.msg_id = CW_MSG_DISCOVERY_REQUEST,
.vendor_id = CW_VENDOR_ID_CISCO,
.elem_id = CISCO_ELEM_RAD_NAME,
.item_id = CW_ITEM_WTP_NAME,
.out = cw_out_generic,
.get = cw_out_get_config,
.mand = 1
}
,
/* ----------------------------------------------------------------
* Message Join Rquest
*/
/* CAPWAP Local IP Address - Join Request */
{
/* use draft 7 elem ids */
.msg_id = CW_MSG_JOIN_REQUEST,
.item_id = CW_ITEM_CAPWAP_LOCAL_IP_ADDRESS,
.out = cw_out_capwap_local_ip_address_7,
.mand = 1
}
,
/* WTP Descriptor - Join Request */
{
.msg_id = CW_MSG_JOIN_REQUEST,
.elem_id = CW_ELEM_WTP_DESCRIPTOR,
.item_id = CW_ITEM_WTP_DESCRIPTOR,
.out = cisco_out_wtp_descriptor,
.mand = 1
}
,
/* WTP Group Name (WTP Name) - Join Request */
{
.msg_id = CW_MSG_JOIN_REQUEST,
.vendor_id = CW_VENDOR_ID_CISCO,
.elem_id = CISCO_ELEM_AP_GROUP_NAME,
.item_id = CW_ITEM_WTP_GROUP_NAME,
.out = cw_out_generic,
.get = cw_out_get_config,
.mand = 1
}
,
/* WTP Board Data Options - Join Request */
{
.msg_id = CW_MSG_JOIN_REQUEST,
.vendor_id = CW_VENDOR_ID_CISCO,
.elem_id = CW_CISCO_BOARD_DATA_OPTIONS,
.item_id = CW_ITEM_CISCO_BOARD_DATA_OPTIONS,
.out = cisco_out_board_data_options,
.get = cw_out_get_config,
.mand = 1
}
,
/* ECN Support - Join Request */
{
/* Cisco doesn't know ECN support, so we
define no output method */
.msg_id = CW_MSG_JOIN_REQUEST,
.elem_id = CAPWAP_ELEM_ECN_SUPPORT,
.item_id = CW_ITEM_ECN_SUPPORT,
.mand = 0
}
,
/* ----------------------------------------------------------------
* Configuration Status Request
*/
{
.vendor_id = CW_VENDOR_ID_CISCO,
.msg_id = CW_MSG_CONFIGURATION_STATUS_REQUEST,
.elem_id = CAPWAP80211_ELEM_WTP_RADIO_INFORMATION,
.item_id = CW_ITEM_RADIO_CFG,
.out = cisco_out_80211_wtp_radio_cfg,
.get = cw_out_get_config,
.mand = 1
}
,
// {CW_MSG_CONFIGURATION_STATUS_REQUEST, CW_ITEM_RADIO_CFG, CW_VENDOR_ID_CISCO,
// CW_CISCO_AP_GROUP_NAME, NULL,cw_out_cisco_wtp_radio_cfg, cw_out_get_config, 1}
// ,
#endif
{0,0}
};
#include "cw/item.h"
static struct cw_itemdef _capwap_itemdefs[] = {
{"wtp_name_cisco",CW_ITEM_NONE,MBAG_STR},
/* {"wtp_mac_type",CW_ITEM_NONE,MBAG_BYTE},
{"discovery_type",CW_ITEM_NONE,MBAG_BYTE},
{"wtp_frame_tunnel_mode",CW_ITEM_NONE,MBAG_BYTE},
*/ {CW_ITEM_NONE}
};
#include "../modload.h"
int fortinet_register_actions_wtp(struct cw_actiondef *def)
{
int rc;
rc = cw_actionlist_in_register_actions(def->in, actions_in);
rc += cw_actionlist_out_register_actions(def->out, actions_out);
rc += cw_strheap_register_strings(def->strmsg, capwap_strings_msg);
rc += cw_strheap_register_strings(def->strelem, cipwap_strings_elem);
rc += cw_itemdefheap_register(def->items, _capwap_itemdefs);
rc += cw_itemdefheap_register(def->radioitems, capwap_radioitemdefs);
// intavltree_add(def->wbids, 0);
return rc;
}
int fortinet_register_actions80211_wtp(struct cw_actiondef *def)
{
int rc;
rc=0;
// rc = cw_actionlist_in_register_actions(def->in, actions80211_in);
/* rc += cw_actionlist_out_register_actions(def->out, actions_out);
rc += cw_strheap_register_strings(def->strmsg, capwap_strings_msg);
rc += cw_strheap_register_strings(def->strelem, cipwap_strings_elem);
rc += cw_itemdefheap_register(def->items, _capwap_itemdefs);
rc += cw_itemdefheap_register(def->radioitems, capwap_radioitemdefs);
intavltree_add(def->wbids, 0);
*/
return rc;
}
| 22.103774 | 81 | 0.667947 |
1e0a5556fbc0cf42d2f8036a3f1641133ea0657a | 440 | css | CSS | public/stylesheets/commerce.css | platinum-otabek/agro | eb7c6af96c98fa823030890c4f3b4e0bf3bb568c | [
"Apache-2.0"
] | null | null | null | public/stylesheets/commerce.css | platinum-otabek/agro | eb7c6af96c98fa823030890c4f3b4e0bf3bb568c | [
"Apache-2.0"
] | 1 | 2022-01-22T13:29:06.000Z | 2022-01-22T13:29:06.000Z | public/stylesheets/commerce.css | platinum-otabek/agro | eb7c6af96c98fa823030890c4f3b4e0bf3bb568c | [
"Apache-2.0"
] | null | null | null | .my-table-scrollbar {
position: relative;
height: 150px;
overflow: auto;
margin-top: 20px;
}
.wrapper-scroll-y {
display: block;
}
.my-item-scrollbar {
position: relative;
height: 140px;
overflow: auto;
margin-top: 10px;
}
.sum{
margin-bottom: 12px;
display: flex;
font-size: 2rem;
justify-content: space-around;
align-items: center;
}
.price{
width: 30%;
font-size: 2rem;
} | 15.714286 | 34 | 0.609091 |
858d180fbdee08540631fde6e1d6012f68f48fe8 | 7,365 | js | JavaScript | lib/es6_global/src/core/utils/engine/job/init/initTransformGizmosJob/rotation/AffectRotationGizmosUtils.js | DreamForeast/Wonder-editor | 44193817c6a0782e5667b4882360c26e6bc4ceb8 | [
"Apache-2.0"
] | 146 | 2018-01-05T16:24:32.000Z | 2022-03-28T06:37:18.000Z | lib/es6_global/src/core/utils/engine/job/init/initTransformGizmosJob/rotation/AffectRotationGizmosUtils.js | DreamForeast/Wonder-editor | 44193817c6a0782e5667b4882360c26e6bc4ceb8 | [
"Apache-2.0"
] | 57 | 2018-03-30T06:38:34.000Z | 2022-01-13T07:13:29.000Z | lib/es6_global/src/core/utils/engine/job/init/initTransformGizmosJob/rotation/AffectRotationGizmosUtils.js | DreamForeast/Wonder-editor | 44193817c6a0782e5667b4882360c26e6bc4ceb8 | [
"Apache-2.0"
] | 35 | 2019-03-11T08:03:43.000Z | 2022-03-19T09:57:22.000Z |
import * as Curry from "../../../../../../../../../../node_modules/bs-platform/lib/es6/curry.js";
import * as RayUtils$WonderEditor from "../../../rayCaster/RayUtils.js";
import * as AngleService$WonderEditor from "../../../../../../../service/primitive/AngleService.js";
import * as CoordinateUtils$WonderEditor from "../../../coordinate/CoordinateUtils.js";
import * as RayIntersectUtils$WonderEditor from "../../../rayCaster/RayIntersectUtils.js";
import * as SceneTreeEditorService$WonderEditor from "../../../../../../../service/state/editor/sceneTree/SceneTreeEditorService.js";
import * as SceneViewEditorService$WonderEditor from "../../../../../../../service/state/editor/view/sceneView/SceneViewEditorService.js";
import * as TransformEngineService$WonderEditor from "../../../../../../../service/state/engine/TransformEngineService.js";
import * as CircleRotationGizmosUtils$WonderEditor from "./CircleRotationGizmosUtils.js";
import * as GameObjectComponentEngineService$WonderEditor from "../../../../../../../service/state/engine/gameObject/GameObjectComponentEngineService.js";
import * as TransformGameObjectEngineService$WonderEditor from "../../../../../../../service/state/engine/gameObject/TransformGameObjectEngineService.js";
import * as AngleRotationGizmoSceneViewEditorService$WonderEditor from "../../../../../../../service/state/editor/view/sceneView/transform/rotation/AngleRotationGizmoSceneViewEditorService.js";
import * as SelectRotationGizmoSceneViewEditorService$WonderEditor from "../../../../../../../service/state/editor/view/sceneView/transform/rotation/SelectRotationGizmoSceneViewEditorService.js";
import * as OperateRotationGizmoSceneViewEditorService$WonderEditor from "../../../../../../../service/state/editor/view/sceneView/transform/rotation/OperateRotationGizmoSceneViewEditorService.js";
import * as CoordinateSystemTransformGizmoSceneViewEditorService$WonderEditor from "../../../../../../../service/state/editor/view/sceneView/transform/CoordinateSystemTransformGizmoSceneViewEditorService.js";
function _computeXYPlaneTotalAngle(param, param$1) {
return Math.atan2(param$1[1], param$1[0]) * AngleService$WonderEditor.getRadToDeg(/* () */0) - Math.atan2(param[1], param[0]) * AngleService$WonderEditor.getRadToDeg(/* () */0);
}
function _computeXZPlaneTotalAngle(param, param$1) {
return Math.atan2(param$1[0], param$1[2]) * AngleService$WonderEditor.getRadToDeg(/* () */0) - Math.atan2(param[0], param[2]) * AngleService$WonderEditor.getRadToDeg(/* () */0);
}
function _computeYZPlaneTotalAngle(param, param$1) {
return Math.atan2(param$1[2], param$1[1]) * AngleService$WonderEditor.getRadToDeg(/* () */0) - Math.atan2(param[2], param[1]) * AngleService$WonderEditor.getRadToDeg(/* () */0);
}
function _computeNeedRotateAngle(totalAngle, editorState) {
var match = AngleRotationGizmoSceneViewEditorService$WonderEditor.getLastTotalAngle(editorState);
return totalAngle - (
match !== undefined ? match : 0
);
}
function _rotateCurrentSceneTreeNode(param, rotateOnAxisFunc, editorState, engineState) {
return Curry._3(rotateOnAxisFunc, GameObjectComponentEngineService$WonderEditor.unsafeGetTransformComponent(SceneTreeEditorService$WonderEditor.unsafeGetCurrentSceneTreeNode(editorState), engineState), /* tuple */[
param[0],
param[1]
], engineState);
}
function _affectGizmo(ray, param, computeTotalAngleFunc, param$1) {
var engineState = param$1[1];
var editorState = param$1[0];
var match = RayIntersectUtils$WonderEditor.checkIntersectPlane(param[0], ray);
var match$1;
if (match !== undefined) {
var localToWorldMatrixTypeArray = TransformGameObjectEngineService$WonderEditor.getLocalToWorldMatrixTypeArray(OperateRotationGizmoSceneViewEditorService$WonderEditor.unsafeGetRotationWholeGizmo(editorState), engineState);
var dragStartPoint = AngleRotationGizmoSceneViewEditorService$WonderEditor.unsafeGetDragStartPoint(editorState);
var totalAngle = Curry._2(computeTotalAngleFunc, CoordinateUtils$WonderEditor.convertPosFromWorldToLocalCoordSystem(dragStartPoint, localToWorldMatrixTypeArray, engineState), CoordinateUtils$WonderEditor.convertPosFromWorldToLocalCoordSystem(match, localToWorldMatrixTypeArray, engineState));
match$1 = /* tuple */[
totalAngle,
_computeNeedRotateAngle(totalAngle, editorState)
];
} else {
match$1 = /* tuple */[
AngleRotationGizmoSceneViewEditorService$WonderEditor.getLastTotalAngle(editorState),
0
];
}
var editorState$1 = AngleRotationGizmoSceneViewEditorService$WonderEditor.setLastTotalAngle(match$1[0], editorState);
var match$2 = CoordinateSystemTransformGizmoSceneViewEditorService$WonderEditor.getCoordinateSystem(editorState$1);
_rotateCurrentSceneTreeNode(/* tuple */[
match$1[1],
param[1]
], match$2 ? TransformEngineService$WonderEditor.rotateLocalOnAxis : TransformEngineService$WonderEditor.rotateWorldOnAxis, editorState$1, engineState);
return /* tuple */[
editorState$1,
engineState
];
}
function affectRotationGizmo($$event, param) {
var engineState = param[1];
var editorState = param[0];
var cameraGameObject = SceneViewEditorService$WonderEditor.unsafeGetEditCamera(editorState);
var ray = RayUtils$WonderEditor.createPerspectiveCameraRayFromEvent($$event, cameraGameObject, /* tuple */[
editorState,
engineState
]);
var match = SelectRotationGizmoSceneViewEditorService$WonderEditor.isXYCircleGizmoSelected(editorState);
if (match) {
return _affectGizmo(ray, /* tuple */[
CircleRotationGizmosUtils$WonderEditor.buildXYPlane(editorState, engineState),
CircleRotationGizmosUtils$WonderEditor.getXYPlaneLocalAxis(/* () */0)
], _computeXYPlaneTotalAngle, /* tuple */[
editorState,
engineState
]);
} else {
var match$1 = SelectRotationGizmoSceneViewEditorService$WonderEditor.isXZCircleGizmoSelected(editorState);
if (match$1) {
return _affectGizmo(ray, /* tuple */[
CircleRotationGizmosUtils$WonderEditor.buildXZPlane(editorState, engineState),
CircleRotationGizmosUtils$WonderEditor.getXZPlaneLocalAxis(/* () */0)
], _computeXZPlaneTotalAngle, /* tuple */[
editorState,
engineState
]);
} else {
var match$2 = SelectRotationGizmoSceneViewEditorService$WonderEditor.isYZCircleGizmoSelected(editorState);
if (match$2) {
return _affectGizmo(ray, /* tuple */[
CircleRotationGizmosUtils$WonderEditor.buildYZPlane(editorState, engineState),
CircleRotationGizmosUtils$WonderEditor.getYZPlaneLocalAxis(/* () */0)
], _computeYZPlaneTotalAngle, /* tuple */[
editorState,
engineState
]);
} else {
return /* tuple */[
editorState,
engineState
];
}
}
}
}
export {
_computeXYPlaneTotalAngle ,
_computeXZPlaneTotalAngle ,
_computeYZPlaneTotalAngle ,
_computeNeedRotateAngle ,
_rotateCurrentSceneTreeNode ,
_affectGizmo ,
affectRotationGizmo ,
}
/* RayUtils-WonderEditor Not a pure module */
| 54.962687 | 296 | 0.71704 |
bbb3a6acdfa31ce7ed65206a82acbba0923bb079 | 3,347 | swift | Swift | Feature/Timer/Sources/Classes/TimerViewController.swift | SunnyDayDev/Rich-Harvest | 4b112eba658aa4f847f2522183444e283b40d9c5 | [
"Apache-2.0"
] | null | null | null | Feature/Timer/Sources/Classes/TimerViewController.swift | SunnyDayDev/Rich-Harvest | 4b112eba658aa4f847f2522183444e283b40d9c5 | [
"Apache-2.0"
] | null | null | null | Feature/Timer/Sources/Classes/TimerViewController.swift | SunnyDayDev/Rich-Harvest | 4b112eba658aa4f847f2522183444e283b40d9c5 | [
"Apache-2.0"
] | null | null | null | //
// Created by Александр Цикин on 2018-11-20.
//
import Foundation
import RxSwift
import RxCocoa
import RichHarvest_Core_Core
public class TimerViewController: NSViewController {
@IBOutlet weak var projectsPopUpButton: NSPopUpButton!
@IBOutlet weak var tasksPopUpButton: NSPopUpButton!
@IBOutlet weak var urlLabel: NSTextField!
@IBOutlet weak var notesTextField: NSTextField!
@IBOutlet weak var startButton: NSButton!
var viewModel: TimerViewModel!
private let dispose = DisposeBag()
public override func viewDidLoad() {
super.viewDidLoad()
guard let viewModel = self.viewModel else { return }
// TODO: generalize NSPopUpButton binding
viewModel.projects
.drive(onNext: { [weak self] (projects: [String]) in
guard let `self` = self else { return }
self.projectsPopUpButton.removeAllItems()
self.projectsPopUpButton.addItems(withTitles: projects)
})
.disposed(by: dispose)
viewModel.projects
.flatMap { _ in viewModel.selectedProject.asDriver() }
.drive(onNext: { [weak self] (position: Int) in
guard let `self` = self else { return }
self.projectsPopUpButton.selectItem(at: position)
})
.disposed(by: dispose)
viewModel.tasks
.drive(onNext: { [weak self] (projects: [String]) in
guard let `self` = self else { return }
self.tasksPopUpButton.removeAllItems()
self.tasksPopUpButton.addItems(withTitles: projects)
})
.disposed(by: dispose)
viewModel.tasks
.flatMap { _ in viewModel.selectedTask.asDriver() }
.drive(onNext: { [weak self] (position: Int) in
guard let `self` = self else { return }
self.tasksPopUpButton.selectItem(at: position)
})
.disposed(by: dispose)
viewModel.url.drive(urlLabel.rx.text).disposed(by: dispose)
viewModel.notes
.filter { [unowned self] in self.notesTextField.stringValue != $0 }
.bind(to: notesTextField.rx.text)
.disposed(by: dispose)
notesTextField.rx.text
.map { $0 ?? "" }
.filter { [unowned self] in self.viewModel.notes.value != $0 }
.bind(to: viewModel.notes)
.disposed(by: dispose)
startButton.rx.tap.bind(to: viewModel.startTap).disposed(by: dispose)
}
public override func viewWillAppear() {
super.viewWillAppear()
viewModel.viewWillAppear()
}
@IBAction func projectSelected(_ sender: Any) {
guard let item = projectsPopUpButton.selectedItem,
let index = projectsPopUpButton.menu?.items.firstIndex(of: item)
else { return }
viewModel.selectedProject.accept(index)
}
@IBAction func taskSelected(_ sender: Any) {
guard let item = tasksPopUpButton.selectedItem,
let index = tasksPopUpButton.menu?.items.firstIndex(of: item)
else { return }
viewModel.selectedTask.accept(index)
}
}
extension TimerViewController {
func inject(viewModel: TimerViewModel) {
self.viewModel = viewModel
}
}
| 30.990741 | 79 | 0.606513 |
baae497b1e0867931eb07e4c1e4b909a34055de4 | 1,271 | asm | Assembly | programs/oeis/128/A128470.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | 1 | 2021-03-15T11:38:20.000Z | 2021-03-15T11:38:20.000Z | programs/oeis/128/A128470.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | programs/oeis/128/A128470.asm | karttu/loda | 9c3b0fc57b810302220c044a9d17db733c76a598 | [
"Apache-2.0"
] | null | null | null | ; A128470: a(n) = 30*n + 1.
; 1,31,61,91,121,151,181,211,241,271,301,331,361,391,421,451,481,511,541,571,601,631,661,691,721,751,781,811,841,871,901,931,961,991,1021,1051,1081,1111,1141,1171,1201,1231,1261,1291,1321,1351,1381,1411,1441,1471,1501,1531,1561,1591,1621,1651,1681,1711,1741,1771,1801,1831,1861,1891,1921,1951,1981,2011,2041,2071,2101,2131,2161,2191,2221,2251,2281,2311,2341,2371,2401,2431,2461,2491,2521,2551,2581,2611,2641,2671,2701,2731,2761,2791,2821,2851,2881,2911,2941,2971,3001,3031,3061,3091,3121,3151,3181,3211,3241,3271,3301,3331,3361,3391,3421,3451,3481,3511,3541,3571,3601,3631,3661,3691,3721,3751,3781,3811,3841,3871,3901,3931,3961,3991,4021,4051,4081,4111,4141,4171,4201,4231,4261,4291,4321,4351,4381,4411,4441,4471,4501,4531,4561,4591,4621,4651,4681,4711,4741,4771,4801,4831,4861,4891,4921,4951,4981,5011,5041,5071,5101,5131,5161,5191,5221,5251,5281,5311,5341,5371,5401,5431,5461,5491,5521,5551,5581,5611,5641,5671,5701,5731,5761,5791,5821,5851,5881,5911,5941,5971,6001,6031,6061,6091,6121,6151,6181,6211,6241,6271,6301,6331,6361,6391,6421,6451,6481,6511,6541,6571,6601,6631,6661,6691,6721,6751,6781,6811,6841,6871,6901,6931,6961,6991,7021,7051,7081,7111,7141,7171,7201,7231,7261,7291,7321,7351,7381,7411,7441,7471
mov $1,$0
mul $1,30
add $1,1
| 181.571429 | 1,212 | 0.778914 |
3e2ed8f302d349add324bb4b87f25825281d1ba2 | 1,434 | h | C | printscan/wia/core/twcompat/scanerds.h | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | printscan/wia/core/twcompat/scanerds.h | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | printscan/wia/core/twcompat/scanerds.h | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | #ifndef __SCANERDS_H_
#define __SCANERDS_H_
class CWiaScannerDS : public CWiaDataSrc
{
protected:
//
// overridden function definitions
//
virtual TW_UINT16 OpenDS(PTWAIN_MSG ptwMsg);
virtual TW_UINT16 CloseDS(PTWAIN_MSG ptwMsg);
virtual TW_UINT16 EnableDS(TW_USERINTERFACE *pUI);
virtual TW_UINT16 SetCapability(CCap *pCap, TW_CAPABILITY *ptwCap);
virtual TW_UINT16 OnImageLayoutMsg(PTWAIN_MSG ptwMsg);
virtual TW_UINT16 OnPendingXfersMsg (PTWAIN_MSG ptwMsg);
virtual TW_UINT16 TransferToFile(GUID guidFormatID);
virtual TW_UINT16 TransferToDIB(HGLOBAL *phDIB);
virtual TW_UINT16 TransferToMemory(GUID guidFormatID);
private:
//
// scanner specific function definitions
//
TW_UINT16 SetImageLayout(TW_IMAGELAYOUT *pImageLayout);
TW_UINT16 GetImageLayout(TW_IMAGELAYOUT *pImageLayout);
TW_UINT16 GetResolutions();
TW_UINT16 GetSettings();
TW_UINT16 SetSettings(CCap *pCap);
BOOL IsUnknownPageLengthDevice();
BOOL IsFeederEnabled();
BOOL IsFeederEmpty();
//
// scanner specific member variables
//
DWORD m_FeederCaps;
BOOL m_bEnforceUIMode;
//
// unknown page lenght scanning variables (cached data scans)
//
ULONG m_ulBitsSize;
BOOL m_bUnknownPageLength;
BOOL m_bUnknownPageLengthMultiPageOverRide;
};
#endif //__SCANERDS_H_
| 26.555556 | 72 | 0.704324 |
64829cd7818a5b750f896d0c3317b199a7cbc794 | 126 | lua | Lua | scripts/world/bread.lua | flotts/cake | 216774a20d141fda7da554a408ed25cd93210a99 | [
"MIT"
] | null | null | null | scripts/world/bread.lua | flotts/cake | 216774a20d141fda7da554a408ed25cd93210a99 | [
"MIT"
] | null | null | null | scripts/world/bread.lua | flotts/cake | 216774a20d141fda7da554a408ed25cd93210a99 | [
"MIT"
] | null | null | null | bread = {}
function bread:load()
end
function bread:new()
end
function bread:update(dt)
end
function bread:draw()
end
| 7 | 25 | 0.698413 |
9c7a9239d76eeb5e42d5be3e99b0a4ac482f08dc | 39 | js | JavaScript | packages/1981/05/22/index.js | antonmedv/year | ae5d8524f58eaad481c2ba599389c7a9a38c0819 | [
"MIT"
] | 7 | 2017-07-03T19:53:01.000Z | 2021-04-05T18:15:55.000Z | packages/1981/05/22/index.js | antonmedv/year | ae5d8524f58eaad481c2ba599389c7a9a38c0819 | [
"MIT"
] | 1 | 2018-09-05T11:53:41.000Z | 2018-12-16T12:36:21.000Z | packages/1981/05/22/index.js | antonmedv/year | ae5d8524f58eaad481c2ba599389c7a9a38c0819 | [
"MIT"
] | 2 | 2019-01-27T16:57:34.000Z | 2020-10-11T09:30:25.000Z | module.exports = new Date(1981, 4, 22)
| 19.5 | 38 | 0.692308 |
18829b0e17f0c00d663fcc6f7e987c043273b38b | 330 | rb | Ruby | spec/models/user_spec.rb | mosesogwo/Xplore-API | a87066c825114035dbd2e0312541635442062d17 | [
"MIT"
] | 2 | 2020-03-08T10:01:28.000Z | 2020-03-31T12:49:00.000Z | spec/models/user_spec.rb | mosesogwo/Xplore-API | a87066c825114035dbd2e0312541635442062d17 | [
"MIT"
] | 7 | 2020-03-04T21:10:57.000Z | 2022-03-31T00:41:56.000Z | spec/models/user_spec.rb | mosesogwo/Xplore-API | a87066c825114035dbd2e0312541635442062d17 | [
"MIT"
] | null | null | null | require 'rails_helper'
RSpec.describe User, type: :model do
describe 'Validations' do
it { should validate_presence_of(:username) }
it { should validate_uniqueness_of(:username) }
end
describe 'Associations' do
it { should have_many(:wishes) }
it { should have_many(:packages).through(:wishes) }
end
end
| 23.571429 | 55 | 0.709091 |
16105dc96994406bee1d9f0c9e50457583c174a7 | 688 | ts | TypeScript | src/containers/counter-page.ts | pkanal/angular2-test | 4f5f7d03e3a63e7e43dfa9ece2ec7a5822f39145 | [
"MIT"
] | null | null | null | src/containers/counter-page.ts | pkanal/angular2-test | 4f5f7d03e3a63e7e43dfa9ece2ec7a5822f39145 | [
"MIT"
] | null | null | null | src/containers/counter-page.ts | pkanal/angular2-test | 4f5f7d03e3a63e7e43dfa9ece2ec7a5822f39145 | [
"MIT"
] | null | null | null | import { Component} from '@angular/core';
import { RioCounterComponent, RioContainerComponent } from '../components';
import { CounterService } from '../services/counter-service';
@Component({
selector: 'rio-counter-page',
providers: [CounterService],
directives: [RioCounterComponent, RioContainerComponent],
template: `
<rio-container>
<h2 class="center caps">Counter</h2>
<rio-counter
[counter]="counterPage.counter"
[increment]="counterPage.increment"
[decrement]="counterPage.decrement">
</rio-counter>
</rio-container>
`
})
export class RioCounterPageComponent {
constructor(private counterPage: CounterService) { }
}
| 28.666667 | 75 | 0.694767 |
63fab61be0c6b9e9f8c36e330718859beff3a264 | 6,208 | kt | Kotlin | sdk/src/sharedTest/java/co/omise/android/ui/PaymentChooserFragmentTest.kt | ChoCoFire/omise-android | 6d97d990761ba07099e611e2c4699d8d350ddc02 | [
"MIT"
] | null | null | null | sdk/src/sharedTest/java/co/omise/android/ui/PaymentChooserFragmentTest.kt | ChoCoFire/omise-android | 6d97d990761ba07099e611e2c4699d8d350ddc02 | [
"MIT"
] | null | null | null | sdk/src/sharedTest/java/co/omise/android/ui/PaymentChooserFragmentTest.kt | ChoCoFire/omise-android | 6d97d990761ba07099e611e2c4699d8d350ddc02 | [
"MIT"
] | null | null | null | package co.omise.android.ui
import android.app.Activity
import android.app.Instrumentation
import android.content.Intent
import androidx.test.core.app.ActivityScenario
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.contrib.RecyclerViewActions.actionOnItemAtPosition
import androidx.test.espresso.intent.Intents
import androidx.test.espresso.intent.Intents.intending
import androidx.test.espresso.intent.matcher.ComponentNameMatchers.hasClassName
import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.isEnabled
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withText
import androidx.test.ext.junit.runners.AndroidJUnit4
import co.omise.android.R
import co.omise.android.models.Capability
import co.omise.android.models.PaymentMethod
import co.omise.android.models.Source
import co.omise.android.utils.itemCount
import com.nhaarman.mockitokotlin2.any
import com.nhaarman.mockitokotlin2.doReturn
import com.nhaarman.mockitokotlin2.mock
import com.nhaarman.mockitokotlin2.verify
import org.hamcrest.CoreMatchers.not
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class PaymentChooserFragmentTest {
private lateinit var scenario: ActivityScenario<TestFragmentActivity>
private lateinit var fragment: PaymentChooserFragment
private val mockNavigation: PaymentCreatorNavigation = mock()
private val mockRequester: PaymentCreatorRequester<Source> = mock {
on { amount }.doReturn(500000L)
on { currency }.doReturn("thb")
}
@Before
fun setUp() {
Intents.init()
val paymentMethods = listOf(
PaymentMethod(name = "card"),
PaymentMethod(name = "installment_bay"),
PaymentMethod(name = "installment_bbl"),
PaymentMethod(name = "installment_first_choice"),
PaymentMethod(name = "installment_kbank"),
PaymentMethod(name = "installment_ktc"),
PaymentMethod(name = "internet_banking_bay"),
PaymentMethod(name = "internet_banking_bbl"),
PaymentMethod(name = "internet_banking_ktb"),
PaymentMethod(name = "internet_banking_scb"),
PaymentMethod(name = "bill_payment_tesco_lotus"),
PaymentMethod(name = "econtext"),
PaymentMethod(name = "alipay")
)
val capability = Capability(
paymentMethods = paymentMethods
)
fragment = PaymentChooserFragment.newInstance(capability).apply {
navigation = mockNavigation
requester = mockRequester
}
intending(hasComponent(hasClassName(TestFragmentActivity::class.java.name)))
.respondWith(Instrumentation.ActivityResult(Activity.RESULT_CANCELED, Intent()))
scenario = ActivityScenario.launch(TestFragmentActivity::class.java).onActivity {
it.startActivityForResult(Intent(it, TestFragmentActivity::class.java), 0)
it.replaceFragment(fragment)
}
}
@After
fun tearDown() {
Intents.release()
}
@Test
fun displayPaymentMethods_showPaymentMethodsFromCapability() {
onView(withText(R.string.payment_chooser_title)).check(matches(isDisplayed()))
onView(withId(R.id.recycler_view)).check(matches(itemCount(8)))
}
@Test
fun closeMenu_finishActivityWithCanceledCode() {
onView(withId(R.id.close_menu)).perform(click())
scenario.onActivity {
assertEquals(Activity.RESULT_CANCELED, it.activityResult?.resultCode)
}
}
@Test
fun clickCreditCardPaymentMethod_navigateToCreditCardFrom() {
onView(withId(R.id.recycler_view))
.perform(actionOnItemAtPosition<OmiseItemViewHolder>(0, click()))
verify(fragment.navigation)?.navigateToCreditCardForm()
}
@Test
fun clickInternetBankingPaymentMethod_navigateToInternetBankingChooser() {
onView(withId(R.id.recycler_view))
.perform(actionOnItemAtPosition<OmiseItemViewHolder>(2, click()))
val expectedMethods = listOf(
PaymentMethod(name = "internet_banking_bay"),
PaymentMethod(name = "internet_banking_bbl"),
PaymentMethod(name = "internet_banking_ktb"),
PaymentMethod(name = "internet_banking_scb")
)
verify(fragment.navigation)?.navigateToInternetBankingChooser(expectedMethods)
}
@Test
fun clickInstallmentPaymentMethod_navigateToInstallmentChooser() {
onView(withId(R.id.recycler_view))
.perform(actionOnItemAtPosition<OmiseItemViewHolder>(1, click()))
val expectedMethods = listOf(
PaymentMethod(name = "installment_bay"),
PaymentMethod(name = "installment_bbl"),
PaymentMethod(name = "installment_first_choice"),
PaymentMethod(name = "installment_kbank"),
PaymentMethod(name = "installment_ktc")
)
verify(fragment.navigation)?.navigateToInstallmentChooser(expectedMethods)
}
@Test
fun clickBillPaymentTescoLotusPaymentMethod_sendRequestToCreateSource() {
onView(withId(R.id.recycler_view))
.perform(actionOnItemAtPosition<OmiseItemViewHolder>(3, click()))
onView(withId(R.id.recycler_view)).check(matches(not(isEnabled())))
verify(mockRequester).request(any(), any())
}
@Test
fun clickAlipayPaymentMethod_sendRequestToCreateSource() {
onView(withId(R.id.recycler_view))
.perform(actionOnItemAtPosition<OmiseItemViewHolder>(7, click()))
onView(withId(R.id.recycler_view)).check(matches(not(isEnabled())))
verify(mockRequester).request(any(), any())
}
}
| 39.044025 | 96 | 0.703608 |
61f86cd128532cb82455937e01a0c5da408e9b41 | 1,908 | swift | Swift | PredictionIOSDKTests/EventTests.swift | minhtule/PredictionIO-Swift-SDK-backup | 38c5f1da127982bb008d22cdd4ce872e30117146 | [
"Apache-2.0"
] | null | null | null | PredictionIOSDKTests/EventTests.swift | minhtule/PredictionIO-Swift-SDK-backup | 38c5f1da127982bb008d22cdd4ce872e30117146 | [
"Apache-2.0"
] | null | null | null | PredictionIOSDKTests/EventTests.swift | minhtule/PredictionIO-Swift-SDK-backup | 38c5f1da127982bb008d22cdd4ce872e30117146 | [
"Apache-2.0"
] | null | null | null | //
// EventTests.swift
// PredictionIOSDK
//
// Created by Minh Tu Le on 3/5/15.
// Copyright (c) 2015 PredictionIO. All rights reserved.
//
import XCTest
import PredictionIOSDK
class EventTests: XCTestCase {
func testInit() {
let event = Event(
event: "rate",
entityType: "customer",
entityID: "c1",
targetEntityType: "book",
targetEntityID: "b1",
properties: ["rating": 5],
eventTime: NSDate(timeIntervalSince1970: 0)
)
XCTAssertEqual(event.event, "rate", "Event name should be \"rate\"")
XCTAssertEqual(event.entityType, "customer", "Entity type should be \"customer\"")
XCTAssertEqual(event.entityID, "c1", "Entity ID should be \"c1\"")
XCTAssertEqual(event.targetEntityType!, "book", "Target entity type should be \"book\"")
XCTAssertEqual(event.targetEntityID!, "b1", "Target entity ID should be \"rate\"")
XCTAssert(event.properties!["rating"] as? Int == 5, "Rating should be 5")
XCTAssertEqual(event.eventTime, NSDate(timeIntervalSince1970: 0), "Event date should be equal")
}
func testInitWithoutOptionalParameters() {
let event = Event(
event: "create",
entityType: "customer",
entityID: "c1"
)
XCTAssertEqual(event.event, "create", "Event name should be \"create\"")
XCTAssertEqual(event.entityType, "customer", "Entity type should be \"customer\"")
XCTAssertEqual(event.entityID, "c1", "Entity ID should be \"c1\"")
XCTAssertNil(event.targetEntityType, "Target entity type should be nil")
XCTAssertNil(event.targetEntityID, "Target entity ID should be nil")
XCTAssertNil(event.properties, "Properties should be nil")
XCTAssertNotNil(event.eventTime, "Event date should not be nil")
}
}
| 38.16 | 103 | 0.62369 |
a843f989a6426b48bc8fd2e6fe6156964f1f559e | 725 | rs | Rust | examples/npm/src/lib.rs | g-s-k/rsch | fc16086a7fcf2030beacdad0afe162c5e3b7681a | [
"Apache-2.0",
"MIT"
] | 4 | 2019-01-14T18:17:07.000Z | 2021-09-07T11:08:02.000Z | examples/npm/src/lib.rs | g-s-k/rsch | fc16086a7fcf2030beacdad0afe162c5e3b7681a | [
"Apache-2.0",
"MIT"
] | 15 | 2019-01-02T05:02:14.000Z | 2019-02-12T22:29:12.000Z | examples/npm/src/lib.rs | g-s-k/parsley | fc16086a7fcf2030beacdad0afe162c5e3b7681a | [
"Apache-2.0",
"MIT"
] | null | null | null | use wasm_bindgen::prelude::*;
#[wasm_bindgen]
pub struct Context(parsley::Context);
#[wasm_bindgen]
impl Context {
#[wasm_bindgen(constructor)]
pub fn new() -> Self {
Self(parsley::Context::base().capturing())
}
pub fn run(&mut self, code: &str) -> String {
// do it
let evaled = self.0.run(code);
// get the output
let mut buf = self.0.get_output().unwrap_or_default();
self.0.capture();
// put the results in the string
buf.extend(
match evaled {
Ok(exp) => exp.to_string(),
Err(error) => error.to_string(),
}
.chars(),
);
// return
buf
}
}
| 21.323529 | 62 | 0.507586 |
c105c094ce2467dcfc5a09d4f04c8a6b96ebcf55 | 12,413 | rs | Rust | src/operator_construction/operatorargs.rs | busstoptaktik/geodesy | 2718c094001b0a2168deb4fbaaa09c4ab9f78a7c | [
"Apache-2.0",
"MIT"
] | 9 | 2021-09-22T21:38:12.000Z | 2022-03-21T12:34:52.000Z | src/operator_construction/operatorargs.rs | busstoptaktik/geodesy | 2718c094001b0a2168deb4fbaaa09c4ab9f78a7c | [
"Apache-2.0",
"MIT"
] | 15 | 2021-07-29T13:31:18.000Z | 2022-02-05T23:28:50.000Z | src/operator_construction/operatorargs.rs | busstoptaktik/geodesy | 2718c094001b0a2168deb4fbaaa09c4ab9f78a7c | [
"Apache-2.0",
"MIT"
] | null | null | null | use std::collections::HashMap;
use yaml_rust::{Yaml, YamlEmitter, YamlLoader};
use crate::GeodesyError;
#[derive(Debug, Clone, Default, PartialEq)]
pub struct OperatorArgs {
pub name: String,
pub args: HashMap<String, String>,
pub used: HashMap<String, String>,
pub all_used: HashMap<String, String>,
}
impl OperatorArgs {
#[must_use]
pub fn new() -> OperatorArgs {
let mut op = OperatorArgs {
name: String::new(),
args: HashMap::new(),
used: HashMap::new(),
all_used: HashMap::new(),
};
// Global defaults
op.insert("ellps", "GRS80");
op
}
/// Provides an `OperatorArgs` object, populated by the defaults from an existing
/// `OperatorArgs`, combined with a new object definition.
///
/// This is the mechanism for inheritance of global args in pipelines.
#[must_use]
pub fn spawn(&self, definition: &str) -> OperatorArgs {
let mut oa = OperatorArgs::new();
for (arg, val) in &self.args {
if arg.starts_with('_') || (arg == "inv") {
continue;
}
oa.insert(arg, val);
}
oa.populate(definition, "");
oa
}
///
/// Insert PROJ style operator definition arguments, converted from a YAML
/// setup string.
///
/// If `which` is set to the empty string, we first look for a pipeline
/// definition. If that is not found, and there is only one list element
/// in the setup string, we assert that this is the element to handle.
///
/// If `which` is not the empty string, we look for a list element with
/// that name, and handle that either as a pipeline definition, or as a
/// single operator definition.
///
/// # Returns
///
/// `true` on success, `false` on sseccus.
///
/// # Examples
///
/// ```rust
/// use geodesy::operator_construction::OperatorArgs;
///
/// let mut args = OperatorArgs::new();
/// let txt = std::fs::read_to_string("tests/tests.yml").unwrap_or_default();
///
/// assert!(args.populate(&txt, "a_pipeline_for_testing"));
/// assert_eq!(&args.value("_step_0", "")[0..4], "cart");
/// ```
///
///
pub fn populate(&mut self, definition: &str, which: &str) -> bool {
// First, we copy the full text in the args, to enable recursive definitions
self.insert("_definition", definition);
// Read the entire YAML-document and try to locate the `which` document
let docs = YamlLoader::load_from_str(definition);
if docs.is_err() {
return false;
}
let docs = docs.unwrap();
let mut index = Some(0_usize);
if !which.is_empty() {
index = docs.iter().position(|doc| !doc[which].is_badvalue());
if index.is_none() {
return self.badvalue("Cannot locate definition");
}
}
let index = index.unwrap();
let main = &docs[index].as_hash();
if main.is_none() {
return self.badvalue("Cannot parse definition");
}
let main = main.unwrap();
// Is it conforming?
let mut main_entry_name = which;
if main_entry_name.is_empty() {
for (arg, val) in main {
if val.is_badvalue() {
return self.badvalue("Cannot parse definition");
}
let name = &arg.as_str().unwrap();
if name.starts_with('_') {
continue;
}
if !main_entry_name.is_empty() {
return self.badvalue("Too many items in definition root");
}
main_entry_name = name;
}
}
self.name = main_entry_name.to_string();
// Grab the sub-tree defining the 'main_entry_name'
let main_entry = &docs[index][main_entry_name];
if main_entry.is_badvalue() {
return self.badvalue("Cannot locate definition");
}
// Loop over all globals and create the corresponding OperatorArgs entries
if let Some(globals) = main_entry["globals"].as_hash() {
for (arg, val) in globals {
let thearg = arg.as_str().unwrap();
if thearg != "inv" {
let theval = match val {
Yaml::Integer(val) => val.to_string(),
Yaml::Real(val) => val.as_str().to_string(),
Yaml::String(val) => val.to_string(),
Yaml::Boolean(val) => val.to_string(),
_ => "".to_string(),
};
if !theval.is_empty() {
self.insert(thearg, &theval);
}
}
}
}
// Try to locate the step definitions, to determine whether we
// are handling a pipeline or a plain operator definition
let steps = main_entry["steps"].as_vec();
// Not a pipeline? Just insert the operator args and return
if steps.is_none() {
let args = main_entry.as_hash();
if args.is_none() {
return self.badvalue("Cannot read args");
}
let args = args.unwrap();
for (arg, val) in args {
let thearg = arg.as_str().unwrap_or("");
if thearg.is_empty() {
continue;
}
let theval = match val {
Yaml::Integer(val) => val.to_string(),
Yaml::Real(val) => val.as_str().to_string(),
Yaml::String(val) => val.to_string(),
Yaml::Boolean(val) => val.to_string(),
_ => "".to_string(),
};
if !theval.is_empty() {
self.insert(thearg, &theval);
}
}
return true;
}
// It's a pipeline - insert the number of steps into the argument list.
let steps = steps.unwrap();
self.insert("_nsteps", &steps.len().to_string());
// Insert each step into the argument list, formatted as YAML.
for (index, step) in steps.iter().enumerate() {
// Write the step definition to a new string
let mut step_definition = String::new();
let mut emitter = YamlEmitter::new(&mut step_definition);
emitter.dump(step).unwrap();
// Remove the initial doc separator "---\n"
let stripped_definition = step_definition.trim_start_matches("---\n");
let step_key = format!("_step_{}", index);
self.insert(&step_key, stripped_definition);
}
true
}
fn badvalue(&mut self, cause: &str) -> bool {
self.name = "badvalue".to_string();
self.insert("cause", cause);
false
}
pub fn name(&mut self, name: &str) {
self.name = name.to_string();
}
pub fn insert(&mut self, key: &str, value: &str) {
// Self-referencing keys (x: ^x), are no-ops.
// The syntax "x: ^x" makes sense in a nested command (or a pipeline
// step), but the meaning is "use the value already in the hashmap".
// Actually inserting it will lead to overwriting of the actual
// value-of-interest, and to infinite recursion on lookup.
if key != value.trim_start_matches('^') {
self.args.insert(key.to_string(), value.to_string());
}
}
// Recursive workhorse, tracing indirect definitions for ::value
fn value_search(&mut self, key: &str, default: &str, recursions: usize) -> String {
if recursions > 100 {
return default.to_string();
}
let arg = self.args.get(key);
let arg = match arg {
Some(arg) => arg.to_string(),
None => return default.to_string(),
};
// all_used includes intermediate steps in indirect definitions
self.all_used.insert(key.to_string(), arg.to_string());
if let Some(arg) = arg.strip_prefix('^') {
// Default if looking for an out-of-scope arg.
if self.args.get(arg).is_none() {
return default.to_string();
}
return self.value_search(arg, default, recursions + 1);
}
arg
}
/// Return the arg for a given key; maintain usage info.
pub fn value(&mut self, key: &str, default: &str) -> String {
let arg = self.value_search(key, default, 0);
if arg != default {
self.used.insert(key.to_string(), arg.to_string());
}
arg
}
pub fn numeric_value(&mut self, key: &str, default: f64) -> Result<f64, GeodesyError> {
let arg = self.value(key, "");
// key not given: return default
if arg.is_empty() {
return Ok(default);
}
// key given, value numeric: return value
if let Ok(v) = arg.parse::<f64>() {
return Ok(v);
}
// key given, but not numeric: return error string
Err(GeodesyError::Syntax(format!(
"Numeric value expected for '{}.{}' - got [{}: {}].",
self.name, key, key, arg
)))
}
// If key is given, and value != false: true; else: false
pub fn flag(&mut self, key: &str) -> bool {
self.value(key, "false") != "false"
}
}
//----------------------------------------------------------------------------------
#[cfg(test)]
mod tests {
#[test]
fn operator_args() {
use super::*;
let mut args = OperatorArgs::new();
// dx and dy are straightforward
args.insert("dx", "11");
args.insert("dy", "22");
// But we hide dz behind two levels of indirection
args.insert("dz", "^ddz");
args.insert("ddz", "^dddz");
args.insert("dddz", "33");
assert_eq!("00", args.value("", "00"));
assert_eq!("11", args.value("dx", ""));
assert_eq!("22", args.value("dy", ""));
assert_eq!(args.used.len(), 2);
args.insert("dx", "^dx");
assert_eq!("11", args.value("dx", ""));
args.insert("dx", "^^^^dx");
assert_eq!("11", args.value("dx", ""));
assert_eq!("33", args.value("dz", ""));
assert_eq!(33.0, args.numeric_value("dz", 42.0).unwrap());
assert_eq!(42.0, args.numeric_value("bar", 42.0).unwrap());
assert_eq!(args.used.len(), 3);
assert_eq!(args.all_used.len(), 5);
// println!("used: {:?}", &args.used);
// println!("all_used: {:?}", &args.all_used);
assert_eq!("", args.value("abcdefg", ""));
// Finally one for testing 'err' returned for non-numerics
args.insert("ds", "foo");
assert!(args.numeric_value("ds", 0.0).is_err());
// if let Err(msg) = args.numeric_value("bar", "ds", 0.0) {
// println!("**** err: {}", msg)
// }
}
#[test]
fn preparing_args() {
use super::*;
let mut args = OperatorArgs::new();
// Explicitly stating the name of the pipeline
let txt = std::fs::read_to_string("tests/tests.yml").unwrap_or_default();
assert!(args.populate(&txt, "a_pipeline_for_testing"));
assert_eq!(&args.value("_step_0", " ")[0..4], "cart");
// Let populate() figure out what we want
let mut args = OperatorArgs::new();
assert!(args.populate(&txt, ""));
assert_eq!(&args.value("x", "5"), "3");
// When op is not a pipeline
let mut args = OperatorArgs::new();
assert!(args.populate("cart: {ellps: intl}", ""));
assert_eq!(args.name, "cart");
assert_eq!(&args.value("ellps", ""), "intl");
// Inheritance
let mut moreargs = args.spawn("foo: {bar: baz}");
assert_eq!(&moreargs.name, "foo");
assert_eq!(&moreargs.value("ellps", ""), "intl");
assert_eq!(&moreargs.value("bar", ""), "baz");
}
#[test]
fn bad_value() {
use super::*;
let v = Yaml::BadValue;
assert!(v.is_badvalue());
let v = Yaml::Null;
assert!(v.is_null());
let v = Yaml::Integer(77);
assert!(v == Yaml::Integer(77));
}
}
| 34.480556 | 91 | 0.520422 |
9943539cccc0da82a82d9627863ddbfc33201dc5 | 879 | c | C | src/free.c | Faudil/malloc | 95229c0295e4d96f50d9b33906a4d561e7b8ea82 | [
"MIT"
] | null | null | null | src/free.c | Faudil/malloc | 95229c0295e4d96f50d9b33906a4d561e7b8ea82 | [
"MIT"
] | null | null | null | src/free.c | Faudil/malloc | 95229c0295e4d96f50d9b33906a4d561e7b8ea82 | [
"MIT"
] | null | null | null | /*
** free.c for malloc in /home/guacamole/Epitech/malloc
**
** Made by guacamole
** Login <faudil.puttilli@epitech.eu>
**
** Started on Thu Sep 7 20:04:49 2017 guacamole
** Last update Tue Sep 26 20:25:40 2017 guacamole
*/
#include "malloc.h"
extern t_info *head;
void free_last()
{
t_header *header;
if (head->end != head->begin)
{
header = head->end;
brk(header);
header = getPrev(head->end);
header->next = NULL;
head->end = header;
}
head->nbr_ptr--;
}
void markAsFree(t_header *header)
{
header->is_free = 0;
head->nbr_free_ptr++;
}
void free(void *block)
{
t_header *header;
if (head == NULL)
return ;
header = GET_HEADER(block);
if (header == head->end)
free_last();
else
header->is_free = 0;
if (head->nbr_ptr == head->nbr_free_ptr)
{
brk(head);
head = NULL;
}
}
| 16.584906 | 54 | 0.596132 |
1d904dbfacabcf595924694910cb8fad0f9c8f7f | 384 | kt | Kotlin | src/main/kotlin/dev/lunarcoffee/risako/framework/core/std/idgen/IdGenerator.kt | LunarCoffee/Risako | 8ae6c0fa0f85c90725667055493276116a0c0870 | [
"MIT"
] | null | null | null | src/main/kotlin/dev/lunarcoffee/risako/framework/core/std/idgen/IdGenerator.kt | LunarCoffee/Risako | 8ae6c0fa0f85c90725667055493276116a0c0870 | [
"MIT"
] | null | null | null | src/main/kotlin/dev/lunarcoffee/risako/framework/core/std/idgen/IdGenerator.kt | LunarCoffee/Risako | 8ae6c0fa0f85c90725667055493276116a0c0870 | [
"MIT"
] | null | null | null | package dev.lunarcoffee.risako.framework.core.std.idgen
import kotlin.random.Random
object IdGenerator {
suspend fun generate(): Long {
var id: Long
do {
id = Random.nextLong(Long.MAX_VALUE)
} while (IdDatabase.contains(id))
IdDatabase.register(id)
return id
}
suspend fun delete(id: Long) = IdDatabase.delete(id)
}
| 21.333333 | 56 | 0.635417 |
b90f4ec358b842da67b7c868871cca0292934fbd | 2,023 | c | C | ext/hal/ti/simplelink/source/ti/devices/cc32xx/driverlib/pin.c | dmgerman/zephyrd3 | b6a23cc9c5d534c352e33fd18fff7799ac3c2886 | [
"Apache-2.0"
] | null | null | null | ext/hal/ti/simplelink/source/ti/devices/cc32xx/driverlib/pin.c | dmgerman/zephyrd3 | b6a23cc9c5d534c352e33fd18fff7799ac3c2886 | [
"Apache-2.0"
] | null | null | null | ext/hal/ti/simplelink/source/ti/devices/cc32xx/driverlib/pin.c | dmgerman/zephyrd3 | b6a23cc9c5d534c352e33fd18fff7799ac3c2886 | [
"Apache-2.0"
] | null | null | null | DECL|PAD_CONFIG_BASE|macro|PAD_CONFIG_BASE
DECL|PAD_MODE_MASK|macro|PAD_MODE_MASK
DECL|PAD_STRENGTH_MASK|macro|PAD_STRENGTH_MASK
DECL|PAD_TYPE_MASK|macro|PAD_TYPE_MASK
DECL|PinConfigGet|function|void PinConfigGet(unsigned long ulPin,unsigned long *pulPinStrength, unsigned long *pulPinType)
DECL|PinConfigSet|function|void PinConfigSet(unsigned long ulPin,unsigned long ulPinStrength,unsigned long ulPinType)
DECL|PinDirModeGet|function|unsigned long PinDirModeGet(unsigned long ulPin)
DECL|PinDirModeSet|function|void PinDirModeSet(unsigned long ulPin, unsigned long ulPinIO)
DECL|PinFromPadGet|function|unsigned long PinFromPadGet(unsigned long ulPad)
DECL|PinHysteresisSet|function|void PinHysteresisSet(unsigned long ulHysteresis)
DECL|PinLockLevelSet|function|void PinLockLevelSet(unsigned long ulPin, unsigned char ucLevel)
DECL|PinLock|function|void PinLock(unsigned long ulOutEnable)
DECL|PinModeGet|function|unsigned long PinModeGet(unsigned long ulPin)
DECL|PinModeSet|function|void PinModeSet(unsigned long ulPin,unsigned long ulPinMode)
DECL|PinToPadGet|function|unsigned long PinToPadGet(unsigned long ulPin)
DECL|PinTypeADC|function|void PinTypeADC(unsigned long ulPin,unsigned long ulPinMode)
DECL|PinTypeCamera|function|void PinTypeCamera(unsigned long ulPin,unsigned long ulPinMode)
DECL|PinTypeGPIO|function|void PinTypeGPIO(unsigned long ulPin,unsigned long ulPinMode,tBoolean bOpenDrain)
DECL|PinTypeI2C|function|void PinTypeI2C(unsigned long ulPin,unsigned long ulPinMode)
DECL|PinTypeI2S|function|void PinTypeI2S(unsigned long ulPin,unsigned long ulPinMode)
DECL|PinTypeSDHost|function|void PinTypeSDHost(unsigned long ulPin,unsigned long ulPinMode)
DECL|PinTypeSPI|function|void PinTypeSPI(unsigned long ulPin,unsigned long ulPinMode)
DECL|PinTypeTimer|function|void PinTypeTimer(unsigned long ulPin,unsigned long ulPinMode)
DECL|PinTypeUART|function|void PinTypeUART(unsigned long ulPin,unsigned long ulPinMode)
DECL|PinUnlock|function|void PinUnlock()
DECL|g_ulPinToPadMap|variable|g_ulPinToPadMap
| 74.925926 | 122 | 0.868512 |
3572df1f927526b36b840a90dfbe4e17409c32d2 | 3,155 | lua | Lua | resources/[fivem]/money/server.lua | raag2005/development-vrp | 1f78f2a10fd0cfdd8b470bb263aee8947763beda | [
"MIT"
] | null | null | null | resources/[fivem]/money/server.lua | raag2005/development-vrp | 1f78f2a10fd0cfdd8b470bb263aee8947763beda | [
"MIT"
] | null | null | null | resources/[fivem]/money/server.lua | raag2005/development-vrp | 1f78f2a10fd0cfdd8b470bb263aee8947763beda | [
"MIT"
] | 1 | 2022-01-25T23:01:13.000Z | 2022-01-25T23:01:13.000Z | local playerData = exports['cfx.re/playerData.v1alpha1']
local validMoneyTypes = {
bank = true,
cash = true,
}
local function getMoneyForId(playerId, moneyType)
return GetResourceKvpInt(('money:%s:%s'):format(playerId, moneyType)) / 100.0
end
local function setMoneyForId(playerId, moneyType, money)
local s = playerData:getPlayerById(playerId)
TriggerEvent('money:updated', {
dbId = playerId,
source = s,
moneyType = moneyType,
money = money
})
return SetResourceKvpInt(('money:%s:%s'):format(playerId, moneyType), math.tointeger(money * 100.0))
end
local function addMoneyForId(playerId, moneyType, amount)
local curMoney = getMoneyForId(playerId, moneyType)
curMoney += amount
if curMoney >= 0 then
setMoneyForId(playerId, moneyType, curMoney)
return true, curMoney
end
return false, 0
end
exports('addMoney', function(playerIdx, moneyType, amount)
amount = tonumber(amount)
if amount <= 0 or amount > (1 << 30) then
return false
end
if not validMoneyTypes[moneyType] then
return false
end
local playerId = playerData:getPlayerId(playerIdx)
local success, money = addMoneyForId(playerId, moneyType, amount)
if success then
Player(playerIdx).state['money_' .. moneyType] = money
end
return true
end)
exports('removeMoney', function(playerIdx, moneyType, amount)
amount = tonumber(amount)
if amount <= 0 or amount > (1 << 30) then
return false
end
if not validMoneyTypes[moneyType] then
return false
end
local playerId = playerData:getPlayerId(playerIdx)
local success, money = addMoneyForId(playerId, moneyType, -amount)
if success then
Player(playerIdx).state['money_' .. moneyType] = money
end
return success
end)
exports('getMoney', function(playerIdx, moneyType)
local playerId = playerData:getPlayerId(playerIdx)
return getMoneyForId(playerId, moneyType)
end)
-- player display bits
AddEventHandler('money:updated', function(data)
if data.source then
TriggerClientEvent('money:displayUpdate', data.source, data.moneyType, data.money)
end
end)
RegisterNetEvent('money:requestDisplay')
AddEventHandler('money:requestDisplay', function()
local source = source
local playerId = playerData:getPlayerId(source)
for type, _ in pairs(validMoneyTypes) do
local amount = getMoneyForId(playerId, type)
TriggerClientEvent('money:displayUpdate', source, type, amount)
Player(source).state['money_' .. type] = amount
end
end)
RegisterCommand('earn', function(source, args)
local type = args[1]
local amount = tonumber(args[2])
exports['money']:addMoney(source, type, amount)
end, true)
RegisterCommand('spend', function(source, args)
local type = args[1]
local amount = tonumber(args[2])
if not exports['money']:removeMoney(source, type, amount) then
print('you are broke??')
end
end, true) | 26.512605 | 105 | 0.660222 |
75dd045e1873ddb54db6652bf8182f0f9670eefe | 468 | php | PHP | src/Extension/Workspace/Task/WorkspaceTask.php | dantleech/maestro | 766ca5b69d4cbe42ea6fcffbff70957822fa5f74 | [
"MIT"
] | 21 | 2019-05-16T17:55:27.000Z | 2020-10-01T18:01:14.000Z | src/Extension/Workspace/Task/WorkspaceTask.php | dantleech/maestro | 766ca5b69d4cbe42ea6fcffbff70957822fa5f74 | [
"MIT"
] | 38 | 2019-05-04T10:43:41.000Z | 2019-11-08T13:48:10.000Z | src/Extension/Workspace/Task/WorkspaceTask.php | dantleech/maestro | 766ca5b69d4cbe42ea6fcffbff70957822fa5f74 | [
"MIT"
] | 1 | 2019-05-16T19:25:26.000Z | 2019-05-16T19:25:26.000Z | <?php
namespace Maestro\Extension\Workspace\Task;
use Maestro\Library\Task\Task;
class WorkspaceTask implements Task
{
/**
* @var string
*/
private $name;
public function __construct(string $name)
{
$this->name = $name;
}
public function description(): string
{
return sprintf('creating simple workspace "%s"', $this->name);
}
public function name(): string
{
return $this->name;
}
}
| 16.137931 | 70 | 0.596154 |
f26b60ee22e2844829dcc478e2137803676afc7b | 20,539 | sql | SQL | InvoiceDocuments_Flow.sql | GoogleCloudPlatform/cortex-reporting | ecb745faf6fc1b4b84bc8ab117d6e21712cf8644 | [
"Apache-2.0"
] | 2 | 2022-03-15T02:19:34.000Z | 2022-03-28T18:58:29.000Z | InvoiceDocuments_Flow.sql | GoogleCloudPlatform/cortex-reporting | ecb745faf6fc1b4b84bc8ab117d6e21712cf8644 | [
"Apache-2.0"
] | null | null | null | InvoiceDocuments_Flow.sql | GoogleCloudPlatform/cortex-reporting | ecb745faf6fc1b4b84bc8ab117d6e21712cf8644 | [
"Apache-2.0"
] | null | null | null | #-- Copyright 2022 Google LLC
#--
#-- Licensed under the Apache License, Version 2.0 (the "License");
#-- you may not use this file except in compliance with the License.
#-- You may obtain a copy of the License at
#--
#-- https://www.apache.org/licenses/LICENSE-2.0
#--
#-- Unless required by applicable law or agreed to in 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.
CREATE OR REPLACE TABLE `{{ project_id_tgt }}.{{ dataset_reporting_tgt }}.InvoiceDocuments_Flow`
OPTIONS(
description = "Incoming Invoice (Invoice Receipt) Header, Item, & Account Assignment."
)
AS
WITH
TCURX AS (
-- Joining to this table is necesssary to fix the decimal place of
-- amounts for non-decimal-based currencies. SAP stores these amounts
-- offset by a factor of 1/100 within the system (FYI this gets
-- corrected when a user observes these in the GUI) Currencies w/
-- decimals are unimpacted.
--
-- Example of impacted currencies JPY, IDR, KRW, TWD
-- Example of non-impacted currencies USD, GBP, EUR
-- Example 1,000 JPY will appear as 10.00 JPY
SELECT DISTINCT
CURRKEY,
CAST(POWER(10, 2 - COALESCE(CURRDEC, 0)) AS NUMERIC) AS CURRFIX
FROM
`{{ project_id_src }}.{{ dataset_cdc_processed }}.tcurx`
),
-- Subquery to flip debit/credit in to positive/negative
RSEG AS (
SELECT
* EXCEPT (wrbtr, bnkan),
CASE
WHEN shkzg = 'S' THEN 'debit'
WHEN shkzg = 'H' THEN 'credit'
END AS dr_cr_flag,
CASE
WHEN shkzg = 'S' THEN wrbtr -- S = Debit | Amount in document currency
WHEN shkzg = 'H' THEN wrbtr * -1 -- H = Credit | Amount in document currency
ELSE wrbtr
END AS wrbtr,
CASE
WHEN shkzg = 'S' THEN bnkan -- S = Debit | Delivery Cost Share of Item Value
WHEN shkzg = 'H' THEN bnkan * -1 -- H = Credit | Delivery Cost Share of Item Value
ELSE bnkan
END AS bnkan
FROM
`{{ project_id_src }}.{{ dataset_cdc_processed }}.rseg`
),
-- Subquery to flip debit/credit in to positive/negative
RBCO AS (
SELECT
* EXCEPT (wrbtr, bnkan_fw),
CASE
WHEN shkzg = 'S' THEN 'debit'
WHEN shkzg = 'H' THEN 'credit'
END AS dr_cr_flag,
CASE
WHEN shkzg = 'S' THEN wrbtr -- Debit | Amount in document currency
WHEN shkzg = 'H' THEN wrbtr * -1 -- Credit | Amount in document currency
ELSE wrbtr
END AS wrbtr,
CASE
WHEN shkzg = 'S' THEN bnkan_fw -- Debit | Delivery Cost Share of Item Value
WHEN shkzg = 'H' THEN bnkan_fw * -1 -- Credit | Delivery Cost Share of Item Value
ELSE bnkan_fw
END AS bnkan_fw
FROM
`{{ project_id_src }}.{{ dataset_cdc_processed }}.rbco`
),
RSEG_RBCO AS (
SELECT
RBCO.cobl_nr,
RSEG.ebeln,
RSEG.ebelp,
RSEG.matnr,
RSEG.bwkey,
RSEG.bwtar,
RSEG.bstme,
RSEG.bprme,
RSEG.lbkum,
RSEG.vrkum,
RSEG.pstyp,
RSEG.knttp,
RSEG.bklas,
RSEG.erekz,
RSEG.exkbe,
RSEG.xekbz,
RSEG.tbtkz,
RSEG.spgrp,
RSEG.spgrm,
RSEG.spgrt,
RSEG.spgrg,
RSEG.spgrv,
RSEG.spgrq,
RSEG.spgrc,
RSEG.spgrext,
RSEG.bustw,
RSEG.xblnr,
RSEG.xrueb,
RSEG.bnkan,
RSEG.kschl,
RSEG.salk3,
RSEG.vmsal,
RSEG.xlifo,
RSEG.lfbnr,
RSEG.lfgja,
RSEG.lfpos,
RSEG.matbf,
RSEG.rbmng,
RSEG.bprbm,
RSEG.rbwwr,
RSEG.lfehl,
RSEG.gricd,
RSEG.grirg,
RSEG.gityp,
RSEG.packno,
RSEG.introw,
RSEG.kzmek,
RSEG.mrmok,
RSEG.stunr,
RSEG.zaehk,
RSEG.stock_posting,
RSEG.stock_posting_pp,
RSEG.stock_posting_py,
RSEG.werec,
RSEG.lifnr,
RSEG.frbnr,
RSEG.xhistma,
RSEG.complaint_reason,
RSEG.retamt_fc,
RSEG.retpc,
RSEG.retduedt,
RSEG.xrettaxnet,
RSEG.re_account,
RSEG.erp_contract_id,
RSEG.erp_contract_itm,
RSEG.srm_contract_id,
RSEG.srm_contract_itm,
RSEG.cont_pstyp,
RSEG.srvmapkey,
RSEG.charg,
RSEG.inv_itm_origin,
RSEG.invrel,
RSEG.xdinv,
RSEG.diff_amount,
RSEG.xcprf,
RSEG.fsh_season_year,
RSEG.fsh_season,
RSEG.fsh_collection,
RSEG.fsh_theme,
RSEG.licno,
RSEG.zeile,
RSEG.sgt_scat,
RSEG.wrf_charstc1,
RSEG.wrf_charstc2,
RSEG.wrf_charstc3,
RBCO.anln1,
RBCO.anln2,
RBCO.aplzl,
RBCO.aufnr,
RBCO.dabrz,
RBCO.fipos,
RBCO.fistl,
RBCO.fkber,
RBCO.geber,
RBCO.grant_nbr,
RBCO.gsber,
RBCO.imkey,
RBCO.kokrs,
RBCO.kostl,
RBCO.kstrg,
RBCO.paobjnr,
RBCO.prctr,
RBCO.ps_psp_pnr,
RBCO.recid,
RBCO.saknr,
RBCO.vbeln,
RBCO.vbelp,
RBCO.vptnr,
-- RBCO.zzspreg,
-- RBCO.zzbuspartn,
-- RBCO.zzproduct,
-- RBCO.zzloca,
-- RBCO.zzchan,
-- RBCO.zzlob,
-- RBCO.zznfal,
-- RBCO.zzuserfld1,
-- RBCO.zzuserfld2,
-- RBCO.zzuserfld3,
-- RBCO.zzregion,
-- RBCO.zzstate,
RBCO.xunpl,
RBCO.lstar,
RBCO.prznr,
RBCO.aufpl,
RBCO.bzdat,
RBCO.bnkan_fw,
RBCO.xnegp,
RBCO.erlkz,
RBCO.fikrs,
RBCO.kblnr,
RBCO.kblpos,
RBCO.pargb,
RBCO.pernr,
RBCO.nplnr,
RBCO.vornr,
RBCO.zuonr,
RBCO.mwart,
RBCO.fwbas,
RBCO.hwbas,
RBCO.abper,
RBCO.ledat,
RBCO.menge_f,
RBCO.bpmng_f,
RBCO.budget_pd,
RBCO.measure,
RBCO.fmfgus_key,
RBCO.koart,
RBCO.aa_final_ind,
RBCO.aa_final_qty,
RBCO.aa_final_qty_f,
RBCO.parked_qty,
RBCO.parked_qty_f,
COALESCE(RSEG.mandt, RBCO.mandt) AS mandt,
COALESCE(RSEG.belnr, RBCO.belnr) AS belnr,
COALESCE(RSEG.gjahr, RBCO.gjahr) AS gjahr,
COALESCE(RSEG.buzei, RBCO.buzei) AS buzei,
COALESCE(RSEG.zekkn, RBCO.zekkn) AS zekkn,
COALESCE(RSEG.bukrs, RBCO.bukrs) AS bukrs,
COALESCE(RSEG.werks, RBCO.werks) AS werks,
COALESCE(RSEG.wrbtr, RBCO.wrbtr) AS wrbtr,
COALESCE(RSEG.shkzg, RBCO.shkzg) AS shkzg,
COALESCE(RSEG.mwskz, RBCO.mwskz) AS mwskz,
COALESCE(RSEG.txjcd, RBCO.txjcd) AS txjcd,
COALESCE(RSEG.menge, RBCO.menge) AS menge,
COALESCE(RSEG.bpmng, RBCO.bpmng) AS bpmng,
COALESCE(RSEG.meins, RBCO.meins) AS meins,
COALESCE(RSEG.spgrs, RBCO.spgrs) AS spgrs,
COALESCE(RSEG.sgtxt, RBCO.sgtxt) AS sgtxt,
COALESCE(RSEG.xskrl, RBCO.xskrl) AS xskrl
FROM
RSEG
FULL OUTER JOIN
RBCO
ON
RSEG.mandt = RBCO.mandt
AND RSEG.belnr = RBCO.belnr
AND RSEG.gjahr = RBCO.gjahr
AND RSEG.buzei = RBCO.buzei
)
SELECT
-- Primary Key
RBKP.mandt AS Client_MANDT,
RBKP.gjahr AS FiscalYear_GJAHR,
RBKP.belnr AS InvoiceDocNum_BELNR,
RSEG_RBCO.buzei AS InvoiceDocLineNum_BUZEI,
RSEG_RBCO.cobl_nr AS InvoiceDocAssignmentNum_COBL_NR,
RBKP.blart AS Documenttype_BLART,
RBKP.bldat AS DocumentDate_BLDAT,
RBKP.budat AS PostingDate_BUDAT,
RBKP.usnam AS UserName_USNAM,
RBKP.tcode AS TransactionCode_TCODE,
RBKP.cpudt AS EnteredOn_CPUDT,
RBKP.cputm AS Enteredat_CPUTM,
RBKP.vgart AS TransactnType_VGART,
RBKP.xblnr AS Reference_XBLNR,
COALESCE(RBKP.bukrs, RSEG_RBCO.bukrs) AS CompanyCode_BUKRS,
RBKP.lifnr AS InvoicingParty_LIFNR,
RBKP.waers AS Currency_WAERS,
RBKP.kursf AS Exchangerate_KURSF,
RBKP.rmwwr AS GrossInvAmnt_RMWWR,
RBKP.beznk AS UnplDelCsts_BEZNK,
RBKP.wmwst1 AS ValueAddedTax_WMWST1,
RBKP.mwskz1 AS TaxCode_MWSKZ1,
RBKP.wmwst2 AS notinuse_WMWST2,
RBKP.mwskz2 AS notinuse_MWSKZ2,
RBKP.zterm AS Paytterms_ZTERM,
RBKP.zbd1t AS Days1_ZBD1T,
RBKP.zbd1p AS Discpercent1_ZBD1P,
RBKP.zbd2t AS Days2_ZBD2T,
RBKP.zbd2p AS Discpercent2_ZBD2P,
RBKP.zbd3t AS DaysNet_ZBD3T,
RBKP.wskto AS CDAmount_WSKTO,
RBKP.xrech AS Invoice_XRECH,
RBKP.bktxt AS DocHeaderText_BKTXT,
RBKP.saprl AS SAPRelease_SAPRL,
RBKP.logsys AS Logicalsystem_LOGSYS,
RBKP.xmwst AS CalculateTax_XMWST,
RBKP.stblg AS Reversedby_STBLG,
RBKP.stjah AS Year_STJAH,
RBKP.mwskz_bnk AS TaxCode_MWSKZ_BNK,
RBKP.txjcd_bnk AS TaxJur_TXJCD_BNK,
RBKP.ivtyp AS IVcategory_IVTYP,
RBKP.xrbtx AS Sevtaxcodes_XRBTX,
RBKP.repart AS InvVerType_REPART,
RBKP.rbstat AS Invstatus_RBSTAT,
RBKP.knumve AS DocCondition_KNUMVE,
RBKP.knumvl AS SupplierCond_KNUMVL,
RBKP.arkuen AS Invreduction_ARKUEN,
RBKP.arkuemw AS TaxInvRed_ARKUEMW,
RBKP.makzn AS ManAccpdNetAmnt_MAKZN,
RBKP.makzmw AS Taxaccptdman_MAKZMW,
RBKP.lieffn AS SuppErrornet_LIEFFN,
RBKP.lieffmw AS TaxSuppError_LIEFFMW,
RBKP.xautakz AS Autoaccepted_XAUTAKZ,
RBKP.esrnr AS ISRnumber_ESRNR,
RBKP.esrpz AS Checkdigit_ESRPZ,
RBKP.esrre AS ISRQRRef_ESRRE,
RBKP.qsshb AS WTaxBase_QSSHB,
RBKP.qsfbt AS WTaxExempt_QSFBT,
RBKP.qsskz AS WTaxCode_QSSKZ,
RBKP.diekz AS ServiceInd_DIEKZ,
RBKP.landl AS SupplCntry_LANDL,
RBKP.lzbkz AS SCBInd_LZBKZ,
RBKP.txkrs AS RateforTaxes_TXKRS,
RBKP.ctxkrs AS TaxRateLC_CTXKRS,
RBKP.empfb AS Payer_EMPFB,
RBKP.bvtyp AS Partbanktype_BVTYP,
RBKP.hbkid AS Housebank_HBKID,
RBKP.zuonr AS Assignment_ZUONR,
RBKP.zlspr AS Pmntblock_ZLSPR,
RBKP.zlsch AS PymtMeth_ZLSCH,
RBKP.zfbdt AS BaselineDate_ZFBDT,
RBKP.kidno AS PaymentRef_KIDNO,
RBKP.rebzg AS InRRefno_REBZG,
RBKP.rebzj AS FiscalYear_REBZJ,
RBKP.xinve AS InvestID_XINVE,
RBKP.egmld AS ReportingCntry_EGMLD,
RBKP.xegdr AS EUTriangDeal_XEGDR,
RBKP.vatdate AS TaxReportingDate_VATDATE,
RBKP.hkont AS GLAcct_HKONT,
RBKP.j_1bnftype AS NFtype_J_1BNFTYPE,
RBKP.brnch AS Branchnumber_BRNCH,
RBKP.erfpr AS EntryProfile_ERFPR,
RBKP.secco AS SectionCode_SECCO,
RBKP.name1 AS Name_NAME1,
RBKP.name2 AS Name2_NAME2,
RBKP.name3 AS Name3_NAME3,
RBKP.name4 AS Name4_NAME4,
RBKP.pstlz AS PostalCode_PSTLZ,
RBKP.ort01 AS City_ORT01,
RBKP.land1 AS Country_LAND1,
RBKP.stras AS Street_STRAS,
RBKP.pfach AS POBox_PFACH,
RBKP.pstl2 AS POBoxPCode_PSTL2,
RBKP.pskto AS Postbankno_PSKTO,
RBKP.bankn AS BankAccount_BANKN,
RBKP.bankl AS Banknumber_BANKL,
RBKP.banks AS BankCountry_BANKS,
RBKP.stcd1 AS TaxNumber1_STCD1,
RBKP.stcd2 AS TaxNumber2_STCD2,
RBKP.stkzu AS LiableforVAT_STKZU,
RBKP.stkza AS Equalizatntax_STKZA,
RBKP.regio AS Region_REGIO,
RBKP.bkont AS Controlkey_BKONT,
RBKP.dtaws AS Instructionkey_DTAWS,
RBKP.dtams AS DMEindicator_DTAMS,
RBKP.spras AS CHAR1_SPRAS,
RBKP.xcpdk AS Onetimeacct_XCPDK,
RBKP.empfg AS Pmntrecipient_EMPFG,
RBKP.fityp AS Taxtype_FITYP,
RBKP.stcdt AS Taxnumbertype_STCDT,
RBKP.stkzn AS Naturalperson_STKZN,
RBKP.stcd3 AS TaxNumber3_STCD3,
RBKP.stcd4 AS TaxNumber4_STCD4,
RBKP.bkref AS Reference_BKREF,
RBKP.j_1kfrepre AS RepsName_J_1KFREPRE,
RBKP.j_1kftbus AS TypeofBusiness_J_1KFTBUS,
RBKP.j_1kftind AS TypeofIndustry_J_1KFTIND,
RBKP.anred AS Title_ANRED,
RBKP.stceg AS VATRegNo_STCEG,
RBKP.ername AS Createdby_ERNAME,
RBKP.reindat AS Invrecptdate_REINDAT,
RBKP.uzawe AS Pmtmethsupl_UZAWE,
RBKP.fdlev AS PlanningLevel_FDLEV,
RBKP.fdtag AS PlanningDate_FDTAG,
RBKP.zbfix AS Fixed_ZBFIX,
RBKP.frgkz AS ReleaseInd_FRGKZ,
RBKP.erfnam AS EnteredBy_ERFNAM,
RBKP.bupla AS Businessplace_BUPLA,
RBKP.filkd AS Branch_FILKD,
COALESCE(RBKP.gsber, RSEG_RBCO.gsber) AS BusinessArea_GSBER,
RBKP.lotkz AS LotNo_LOTKZ,
RBKP.sgtxt AS Text_SGTXT,
RBKP.inv_tran AS Transaction_INV_TRAN,
RBKP.prepay_status AS PrepaymentStatus_PREPAY_STATUS,
RBKP.prepay_awkey AS InvoiceNumber_PREPAY_AWKEY,
RBKP.assign_status AS AssignmTest_ASSIGN_STATUS,
RBKP.assign_next_date AS NextAssignment_ASSIGN_NEXT_DATE,
RBKP.assign_end_date AS AssignmentEnd_ASSIGN_END_DATE,
RBKP.copy_by_belnr AS OriginalInvoice_COPY_BY_BELNR,
RBKP.copy_by_year AS FiscalYear_COPY_BY_YEAR,
RBKP.copy_to_belnr AS CopiedInvoice_COPY_TO_BELNR,
RBKP.copy_to_year AS FYearInvCopy_COPY_TO_YEAR,
RBKP.copy_user AS CreatorofCopy_COPY_USER,
RBKP.kursx AS ExchangeRate_KURSX,
RBKP.wwert AS Translationdte_WWERT,
RBKP.xref3 AS Referencekey3_XREF3,
RBKP.j_1tpbupl AS BranchCode_J_1TPBUPL,
RSEG_RBCO.ebeln AS PoNum_EBELN,
RSEG_RBCO.ebelp AS PoLineNum_EBELP,
RSEG_RBCO.zekkn AS PoAssignmentNum_ZEKKN,
RSEG_RBCO.matnr AS MaterialNumber_MATNR,
RSEG_RBCO.bwkey AS ValuationArea_BWKEY,
RSEG_RBCO.bwtar AS ValuationType_BWTAR,
RSEG_RBCO.bstme AS PoUOM_BSTME,
RSEG_RBCO.bprme AS OrderPriceUnit_BPRME,
RSEG_RBCO.lbkum AS TotalValuatedStock_LBKUM,
RSEG_RBCO.vrkum AS TotalValuatedStockPreviousPeriod_VRKUM,
RSEG_RBCO.pstyp AS PoItemCategory_PSTYP,
RSEG_RBCO.knttp AS AccountAssignmentCategory_KNTTP,
RSEG_RBCO.bklas AS ValuationClass_BKLAS,
RSEG_RBCO.erekz AS IndicatorFinalInvoice_EREKZ,
RSEG_RBCO.exkbe AS IndicatorUpdateEKBE_EXKBE,
RSEG_RBCO.xekbz AS IndicatorUpdatePurchaseOrderDeliveryCosts_XEKBZ,
RSEG_RBCO.tbtkz AS IndicatorSubsequentDebitCredit_TBTKZ,
RSEG_RBCO.spgrp AS BlockingReasonPrice_SPGRP,
RSEG_RBCO.spgrm AS BlockingReasonQuantity_SPGRM,
RSEG_RBCO.spgrt AS BlockingReasonDate_SPGRT,
RSEG_RBCO.spgrg AS BlockingReasonOrderPriceQuantity_SPGRG,
RSEG_RBCO.spgrv AS BlockingReasonProjectBudget_SPGRV,
RSEG_RBCO.spgrq AS ManualBlockingReason_SPGRQ,
RSEG_RBCO.spgrc AS BlockingReasonQuality_SPGRC,
RSEG_RBCO.spgrext AS BlockingReasonEnhancementFields_SPGREXT,
RSEG_RBCO.bustw AS PostingStringforValues_BUSTW,
RSEG_RBCO.xblnr AS ReferenceDocumentNumber_XBLNR,
RSEG_RBCO.xrueb AS IndicatorDocumentIsPostedPreviousPeriod_XRUEB,
RSEG_RBCO.bnkan AS DeliveryCostsItemSplit_BNKAN,
RSEG_RBCO.kschl AS Conditiontype_KSCHL,
RSEG_RBCO.salk3 AS TotalValuatedStockValue_SALK3,
RSEG_RBCO.vmsal AS TotalValuatedStockPreviousPeriodValue_VMSAL,
RSEG_RBCO.xlifo AS LIFOFIFO_XLIFO,
RSEG_RBCO.lfbnr AS ReferenceDoc_LFBNR,
RSEG_RBCO.lfgja AS FiscalYearofCurrentPeriod_LFGJA,
RSEG_RBCO.lfpos AS ReferenceDocLineNum_LFPOS,
RSEG_RBCO.matbf AS MaterialinRespectofWhichStockisManaged_MATBF,
RSEG_RBCO.rbmng AS QuantityInvoicedinSupplierInvoiceinPOOrderUnits_RBMNG,
RSEG_RBCO.bprbm AS QuantityInvoicedinSupplierInvoiceinPOPriceUnits_BPRBM,
COALESCE(RSEG_RBCO.rbwwr * TCURX_WAER.currfix, RSEG_RBCO.rbwwr) AS InvoiceAmountinDocumentCurrencyofSupplierInvoice_RBWWR,
RSEG_RBCO.lfehl AS TypeofSupplierError_LFEHL,
RSEG_RBCO.gricd AS GrossIncomeTaxActivityCode_GRICD,
RSEG_RBCO.grirg AS Region_GRIRG,
RSEG_RBCO.gityp AS DistributionTypeforEmploymentTax_GITYP,
RSEG_RBCO.packno AS PackageNumberofService_PACKNO,
RSEG_RBCO.introw AS LineNumberofService_INTROW,
RSEG_RBCO.kzmek AS Correctionindicator_KZMEK,
RSEG_RBCO.mrmok AS IndicatorInvoiceItemProcessed_MRMOK,
RSEG_RBCO.stunr AS StepNumber_STUNR,
RSEG_RBCO.zaehk AS ConditionCounter_ZAEHK,
RSEG_RBCO.stock_posting AS StockPostingofLinefromanIncomingInvoice_STOCK_POSTING,
RSEG_RBCO.stock_posting_pp AS StockPostingPrevPeriod_STOCK_POSTING_PP,
RSEG_RBCO.stock_posting_py AS StockPostingPrevYear_STOCK_POSTING_PY,
RSEG_RBCO.werec AS ClearingIndicatorGRIRPosting_WEREC,
RSEG_RBCO.lifnr AS AccountNumber_LIFNR,
RSEG_RBCO.frbnr AS BillOfLading_FRBNR,
RSEG_RBCO.xhistma AS UpdateMultipleAccountAssignment_XHISTMA,
RSEG_RBCO.complaint_reason AS ComplaintsReason_COMPLAINT_REASON,
COALESCE(RSEG_RBCO.retamt_fc * TCURX_WAER.currfix, RSEG_RBCO.retamt_fc) AS RetentionAmount_RETAMT_FC,
RSEG_RBCO.retpc AS RetentionPercent_RETPC,
RSEG_RBCO.retduedt AS RetentionDueDate_RETDUEDT,
RSEG_RBCO.xrettaxnet AS RetentionTaxReduction_XRETTAXNET,
RSEG_RBCO.re_account AS CashLedgerAccount_RE_ACCOUNT,
RSEG_RBCO.erp_contract_id AS PrincipalPurchaseAgreementNum_ERP_CONTRACT_ID,
RSEG_RBCO.erp_contract_itm AS PrincipalPurchaseAgreementItemNum_ERP_CONTRACT_ITM,
RSEG_RBCO.srm_contract_id AS CentralContractNum_SRM_CONTRACT_ID,
RSEG_RBCO.srm_contract_itm AS CentralContractItemNumber_SRM_CONTRACT_ITM,
RSEG_RBCO.cont_pstyp AS PoItemCategory2_CONT_PSTYP,
RSEG_RBCO.srvmapkey AS eSOAKey_SRVMAPKEY,
RSEG_RBCO.charg AS BatchNumber_CHARG,
RSEG_RBCO.inv_itm_origin AS InvoiceItemOrigin_INV_ITM_ORIGIN,
RSEG_RBCO.invrel AS GroupingCharacteristic_INVREL,
RSEG_RBCO.xdinv AS IndicatorInvoicingDifferential_XDINV,
COALESCE(RSEG_RBCO.diff_amount * TCURX_WAER.currfix, RSEG_RBCO.diff_amount) AS DifferenceAmount_DIFF_AMOUNT,
RSEG_RBCO.xcprf AS IndicatorCommodityRepricing_XCPRF,
RSEG_RBCO.fsh_season_year AS SeasonYear_FSH_SEASON_YEAR,
RSEG_RBCO.fsh_season AS Season_FSH_SEASON,
RSEG_RBCO.fsh_collection AS FashionCollection_FSH_COLLECTION,
RSEG_RBCO.fsh_theme AS FashionTheme_FSH_THEME,
RSEG_RBCO.licno AS InternalLicenseNumber_LICNO,
RSEG_RBCO.zeile AS ItemNumber_ZEILE,
RSEG_RBCO.sgt_scat AS StockSegment_SGT_SCAT,
RSEG_RBCO.wrf_charstc1 AS CharacteristicValue1_WRF_CHARSTC1,
RSEG_RBCO.wrf_charstc2 AS CharacteristicValue2_WRF_CHARSTC2,
RSEG_RBCO.wrf_charstc3 AS CharacteristicValue3_WRF_CHARSTC3,
RSEG_RBCO.anln1 AS MainAssetNumber_ANLN1,
RSEG_RBCO.anln2 AS AssetSubnumber_ANLN2,
RSEG_RBCO.aplzl AS RoutingNumber_APLZL,
RSEG_RBCO.aufnr AS OrderNumber_AUFNR,
RSEG_RBCO.dabrz AS SettlementReferenceDate_DABRZ,
RSEG_RBCO.fipos AS CommitmentItem_FIPOS,
RSEG_RBCO.fistl AS FundsCenter_FISTL,
RSEG_RBCO.fkber AS FunctionalArea_FKBER,
RSEG_RBCO.geber AS Fund_GEBER,
RSEG_RBCO.grant_nbr AS Grant_GRANT_NBR,
RSEG_RBCO.imkey AS RealEstateObjectKey_IMKEY,
RSEG_RBCO.kokrs AS ControllingArea_KOKRS,
RSEG_RBCO.kostl AS CostCenter_KOSTL,
RSEG_RBCO.kstrg AS CostObject_KSTRG,
RSEG_RBCO.paobjnr AS ProfitabilitySegmentNumber_PAOBJNR,
RSEG_RBCO.prctr AS ProfitCenter_PRCTR,
RSEG_RBCO.ps_psp_pnr AS WbsElement_PS_PSP_PNR,
PRPS.posid AS WbsElement_POSID,
RSEG_RBCO.recid AS RulesforIssuinganInvoice_RECID,
RSEG_RBCO.saknr AS GlAccount_SAKNR,
RSEG_RBCO.vbeln AS SalesDocNum_VBELN,
RSEG_RBCO.vbelp AS SalesDocLineNum_VBELP,
RSEG_RBCO.vptnr AS PartnerAccountNum_VPTNR,
RSEG_RBCO.xunpl AS UnplannedAccountAssignment_XUNPL,
RSEG_RBCO.lstar AS ActivityType_LSTAR,
RSEG_RBCO.prznr AS BusinessProcess_PRZNR,
RSEG_RBCO.aufpl AS Routingnumberofoperationsintheorder_AUFPL,
RSEG_RBCO.bzdat AS AssetValueDate_BZDAT,
COALESCE(RSEG_RBCO.bnkan_fw * TCURX_WAER.currfix, RSEG_RBCO.bnkan_fw) AS DeliveryCostsDistributionAmount_BNKAN_FW,
RSEG_RBCO.xnegp AS IndicatorNegativePosting_XNEGP,
RSEG_RBCO.erlkz AS UsedEarmarkedFunds_ERLKZ,
RSEG_RBCO.fikrs AS FinancialManagementArea_FIKRS,
RSEG_RBCO.kblnr AS EarmarkedFundsDocumentNum_KBLNR,
RSEG_RBCO.kblpos AS EarmarkedFundsDocumentItemNum_KBLPOS,
RSEG_RBCO.pargb AS Tradingpartner_PARGB,
RSEG_RBCO.pernr AS PersonnelNumber_PERNR,
RSEG_RBCO.nplnr AS NetworkNumberAccountAssignment_NPLNR,
RSEG_RBCO.vornr AS OperationActivityNumber_VORNR,
RSEG_RBCO.zuonr AS Assignmentnumber_ZUONR,
RSEG_RBCO.mwart AS TaxType_MWART,
COALESCE(RSEG_RBCO.fwbas * TCURX_WAER.currfix, RSEG_RBCO.fwbas) AS TaxBaseAmount_FWBAS,
RSEG_RBCO.hwbas AS TaxBaseLocalCurrencyAmount_HWBAS,
RSEG_RBCO.abper AS SettlementPeriod_ABPER,
RSEG_RBCO.ledat AS DeliveryCreationDate_LEDAT,
RSEG_RBCO.menge_f AS Quantity_MENGE_F,
RSEG_RBCO.bpmng_f AS QuantityPOPriceUnit_BPMNG_F,
RSEG_RBCO.budget_pd AS BudgetPeriod_BUDGET_PD,
RSEG_RBCO.measure AS FundedProgram_MEASURE,
RSEG_RBCO.fmfgus_key AS UnitedStatesFederalGovernmentFields_FMFGUS_KEY,
RSEG_RBCO.koart AS Accounttype_KOART,
RSEG_RBCO.aa_final_ind AS FinalAccountAssignmentIndicator_AA_FINAL_IND,
RSEG_RBCO.aa_final_qty AS FinalAccountAssignmentQuantity_AA_FINAL_QTY,
RSEG_RBCO.aa_final_qty_f AS FinalAccountAssignmentQuantityFloat_AA_FINAL_QTY_F,
RSEG_RBCO.parked_qty AS ParkedInvoiceQuantity_PARKED_QTY,
RSEG_RBCO.parked_qty_f AS ParkedInvoiceQuantityFloat_PARKED_QTY_F,
RSEG_RBCO.werks AS Plant_WERKS,
COALESCE(RSEG_RBCO.wrbtr * TCURX_WAER.currfix, RSEG_RBCO.wrbtr) AS AmountinDocumentCurrency_WRBTR,
RSEG_RBCO.shkzg AS DebitCreditIndicator_SHKZG,
RSEG_RBCO.mwskz AS Taxonsalespurchasescode_MWSKZ,
RSEG_RBCO.txjcd AS TaxJurisdiction_TXJCD,
RSEG_RBCO.menge AS Quantity_MENGE,
RSEG_RBCO.bpmng AS QuantityinPurchaseOrderPriceUnit_BPMNG,
RSEG_RBCO.meins AS BaseUnitofMeasure_MEINS,
RSEG_RBCO.spgrs AS BlockingReasonItemAmount_SPGRS,
RSEG_RBCO.sgtxt AS ItemText_SGTXT,
RSEG_RBCO.xskrl AS IndicatorLineItemCashDiscountNotLiable_XSKRL
FROM `{{ project_id_src }}.{{ dataset_cdc_processed }}.rbkp` AS RBKP
INNER JOIN RSEG_RBCO
ON
RSEG_RBCO.mandt = RBKP.mandt
AND RSEG_RBCO.belnr = RBKP.belnr
AND RSEG_RBCO.gjahr = RBKP.gjahr
LEFT JOIN `{{ project_id_src }}.{{ dataset_cdc_processed }}.prps` AS PRPS
ON RSEG_RBCO.ps_psp_pnr = PRPS.pspnr
LEFT JOIN TCURX AS TCURX_WAER
ON RBKP.waers = TCURX_WAER.currkey
| 35.72 | 124 | 0.774429 |
eae3a15d2bf31791efb64463530f9ef6fafed5ab | 1,315 | lua | Lua | scripts/endpoints/event.lua | ICESat2-SlideRule/sliderule | 90776d7e174e151c5806077001f5f9c21ef81f48 | [
"BSD-3-Clause"
] | 2 | 2021-05-06T19:56:26.000Z | 2021-05-27T16:41:56.000Z | scripts/endpoints/event.lua | ICESat2-SlideRule/sliderule | 90776d7e174e151c5806077001f5f9c21ef81f48 | [
"BSD-3-Clause"
] | 54 | 2021-03-30T18:45:12.000Z | 2022-03-17T20:13:04.000Z | scripts/endpoints/event.lua | ICESat2-SlideRule/sliderule | 90776d7e174e151c5806077001f5f9c21ef81f48 | [
"BSD-3-Clause"
] | 1 | 2021-05-14T16:34:08.000Z | 2021-05-14T16:34:08.000Z | --
-- ENDPOINT: /source/event
--
-- INPUT: arg[1] -
-- {
-- "type": <core.LOG | core.TRACE | core.METRIC>
-- "level": "<event level string>" -OR- <event level number>
-- "format": <core.FMT_TEXT | core.FMT_JSON>
-- "duration": <seconds to hold connection open | 0 for indefinite>
-- }
--
-- rspq - output queue to stream log messages
--
-- OUTPUT: application event messages
--
local global = require("global")
local json = require("json")
local parm = json.decode(arg[1])
local type = global.eval(parm["type"]) or core.LOG
local level = global.eval(parm["level"]) or core.INFO
local format = global.eval(parm["format"]) or nil
local duration = parm["duration"] or 0
-- Attach monitor to post event to response queue --
local userevents = core.dispatcher(core.EVENTQ)
userevents:attach(core.monitor(type, level, format, rspq), "eventrec")
userevents:run()
-- Bounds check duration
if duration > 300 then
duration = 300
end
-- Watch response queue
local watchq = msg.publish(rspq)
-- Pend for duration (in 1 second intervals to allow hooks to execute) --
local seconds = 0
while (watchq:numsubs() > 0) and (seconds < duration) do
seconds = seconds + 1
sys.wait(1)
end
| 29.222222 | 84 | 0.620532 |
b1a29f6176e2318619b3c99349b036f97c944ee3 | 133,159 | sql | SQL | database/pairquest_db.sql | viacheslavoleshko/laravel-pairquest | 884fa0e4329c95aa02b604dd6fbef6fe9c52ce9b | [
"MIT"
] | null | null | null | database/pairquest_db.sql | viacheslavoleshko/laravel-pairquest | 884fa0e4329c95aa02b604dd6fbef6fe9c52ce9b | [
"MIT"
] | null | null | null | database/pairquest_db.sql | viacheslavoleshko/laravel-pairquest | 884fa0e4329c95aa02b604dd6fbef6fe9c52ce9b | [
"MIT"
] | null | null | null | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1
-- Время создания: Авг 06 2021 г., 11:01
-- Версия сервера: 10.3.16-MariaDB
-- Версия PHP: 7.3.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- База данных: `pairquest_db`
--
-- --------------------------------------------------------
--
-- Структура таблицы `accessories`
--
CREATE TABLE `accessories` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`url` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `accessories`
--
INSERT INTO `accessories` (`id`, `name`, `description`, `image`, `url`) VALUES
(9, 'Вино', 'Як правильно вибрати вино – ми навчимо', 'accessories\\July2021\\75IifsPRru9n1ELu9gep.png', 'https://rozetka.com.ua/vino/c4594285/'),
(10, 'Сукня', NULL, NULL, NULL),
(13, 'Фотоапарат', NULL, NULL, NULL),
(22, 'Панамка', NULL, NULL, NULL);
-- --------------------------------------------------------
--
-- Структура таблицы `categories`
--
CREATE TABLE `categories` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `categories`
--
INSERT INTO `categories` (`id`, `name`) VALUES
(1, 'voluptas'),
(2, 'consequuntur'),
(3, 'assumenda'),
(4, 'dolore'),
(5, 'nam');
-- --------------------------------------------------------
--
-- Структура таблицы `data_rows`
--
CREATE TABLE `data_rows` (
`id` int(10) UNSIGNED NOT NULL,
`data_type_id` int(10) UNSIGNED NOT NULL,
`field` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`display_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`required` tinyint(1) NOT NULL DEFAULT 0,
`browse` tinyint(1) NOT NULL DEFAULT 1,
`read` tinyint(1) NOT NULL DEFAULT 1,
`edit` tinyint(1) NOT NULL DEFAULT 1,
`add` tinyint(1) NOT NULL DEFAULT 1,
`delete` tinyint(1) NOT NULL DEFAULT 1,
`details` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`order` int(11) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `data_rows`
--
INSERT INTO `data_rows` (`id`, `data_type_id`, `field`, `type`, `display_name`, `required`, `browse`, `read`, `edit`, `add`, `delete`, `details`, `order`) VALUES
(1, 1, 'id', 'number', 'ID', 1, 0, 0, 0, 0, 0, '{}', 1),
(2, 1, 'name', 'text', 'Name', 1, 1, 1, 1, 1, 1, '{}', 2),
(3, 1, 'email', 'text', 'Email', 1, 1, 1, 1, 1, 1, '{}', 3),
(4, 1, 'password', 'password', 'Password', 1, 0, 0, 1, 1, 0, '{}', 8),
(5, 1, 'remember_token', 'text', 'Remember Token', 0, 0, 0, 0, 0, 0, '{}', 9),
(6, 1, 'created_at', 'timestamp', 'Created At', 0, 1, 1, 0, 0, 0, '{}', 10),
(7, 1, 'updated_at', 'timestamp', 'Updated At', 0, 0, 0, 0, 0, 0, '{}', 11),
(8, 1, 'avatar', 'image', 'Avatar', 0, 1, 1, 1, 1, 1, '{}', 13),
(9, 1, 'user_belongsto_role_relationship', 'relationship', 'Role', 0, 1, 1, 1, 1, 0, '{\"model\":\"TCG\\\\Voyager\\\\Models\\\\Role\",\"table\":\"roles\",\"type\":\"belongsTo\",\"column\":\"role_id\",\"key\":\"id\",\"label\":\"display_name\",\"pivot_table\":\"roles\",\"pivot\":\"0\",\"taggable\":\"0\"}', 15),
(10, 1, 'user_belongstomany_role_relationship', 'relationship', 'Roles', 0, 1, 1, 1, 1, 0, '{\"model\":\"TCG\\\\Voyager\\\\Models\\\\Role\",\"table\":\"roles\",\"type\":\"belongsToMany\",\"column\":\"id\",\"key\":\"id\",\"label\":\"display_name\",\"pivot_table\":\"user_roles\",\"pivot\":\"1\",\"taggable\":\"0\"}', 16),
(11, 1, 'settings', 'hidden', 'Settings', 0, 0, 0, 0, 0, 0, '{}', 17),
(12, 2, 'id', 'number', 'ID', 1, 0, 0, 0, 0, 0, NULL, 1),
(13, 2, 'name', 'text', 'Name', 1, 1, 1, 1, 1, 1, NULL, 2),
(14, 2, 'created_at', 'timestamp', 'Created At', 0, 0, 0, 0, 0, 0, NULL, 3),
(15, 2, 'updated_at', 'timestamp', 'Updated At', 0, 0, 0, 0, 0, 0, NULL, 4),
(16, 3, 'id', 'number', 'ID', 1, 0, 0, 0, 0, 0, NULL, 1),
(17, 3, 'name', 'text', 'Name', 1, 1, 1, 1, 1, 1, NULL, 2),
(18, 3, 'created_at', 'timestamp', 'Created At', 0, 0, 0, 0, 0, 0, NULL, 3),
(19, 3, 'updated_at', 'timestamp', 'Updated At', 0, 0, 0, 0, 0, 0, NULL, 4),
(20, 3, 'display_name', 'text', 'Display Name', 1, 1, 1, 1, 1, 1, NULL, 5),
(21, 1, 'role_id', 'text', 'Role', 0, 1, 1, 1, 1, 1, '{}', 14),
(22, 1, 'user_hasone_gender_relationship', 'relationship', 'Gender', 1, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\Gender\",\"table\":\"genders\",\"type\":\"belongsTo\",\"column\":\"gender_id\",\"key\":\"id\",\"label\":\"name\",\"pivot_table\":\"data_rows\",\"pivot\":\"0\",\"taggable\":\"0\"}', 7),
(23, 1, 'email_verified_at', 'timestamp', 'Email Verified At', 0, 1, 1, 1, 1, 1, '{}', 12),
(24, 1, 'partner_email', 'text', 'Partner Email', 0, 1, 1, 1, 1, 1, '{}', 18),
(25, 1, 'gender_id', 'text', 'Gender Id', 0, 1, 1, 1, 1, 1, '{}', 6),
(26, 4, 'id', 'text', 'Id', 1, 0, 0, 0, 0, 0, '{}', 1),
(27, 4, 'name', 'text', 'Name', 1, 1, 1, 1, 1, 1, '{}', 2),
(28, 6, 'id', 'text', 'Id', 1, 0, 0, 0, 0, 0, '{}', 1),
(29, 6, 'name', 'text', 'Name', 1, 1, 1, 1, 1, 1, '{}', 2),
(30, 1, 'user_hasone_user_level_relationship', 'relationship', 'User Level', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\UserLevel\",\"table\":\"user_levels\",\"type\":\"belongsTo\",\"column\":\"id\",\"key\":\"id\",\"label\":\"name\",\"pivot_table\":\"accessories\",\"pivot\":\"0\",\"taggable\":\"0\"}', 5),
(47, 8, 'id', 'text', 'Id', 1, 0, 0, 0, 0, 0, '{}', 1),
(49, 8, 'gender_id', 'text', 'Gender Id', 1, 1, 1, 1, 1, 1, '{}', 2),
(50, 8, 'partner_task_belongsto_gender_relationship', 'relationship', 'Gender', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\Gender\",\"table\":\"genders\",\"type\":\"belongsTo\",\"column\":\"gender_id\",\"key\":\"id\",\"label\":\"name\",\"pivot_table\":\"accessories\",\"pivot\":\"0\",\"taggable\":\"0\"}', 3),
(51, 8, 'partner_task_belongstomany_task_relationship', 'relationship', 'Main task', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\DetailedTask\",\"table\":\"detailed_tasks\",\"type\":\"belongsToMany\",\"column\":\"id\",\"key\":\"id\",\"label\":\"description\",\"pivot_table\":\"task_combinations\",\"pivot\":\"1\",\"taggable\":\"on\"}', 5),
(54, 8, 'description', 'text', 'Description', 1, 1, 1, 1, 1, 1, '{}', 4),
(55, 10, 'id', 'text', 'Id', 1, 0, 0, 0, 0, 0, '{}', 1),
(56, 10, 'name', 'text', 'Name', 1, 1, 1, 1, 1, 1, '{}', 2),
(59, 11, 'id', 'text', 'Id', 1, 0, 0, 0, 0, 0, '{}', 1),
(60, 11, 'name', 'text', 'Name', 1, 1, 1, 1, 1, 1, '{}', 2),
(61, 11, 'location_type_hasmany_location_relationship', 'relationship', 'locations', 0, 1, 1, 0, 0, 1, '{\"model\":\"App\\\\Models\\\\Location\",\"table\":\"locations\",\"type\":\"hasMany\",\"column\":\"location_type_id\",\"key\":\"id\",\"label\":\"name\",\"pivot_table\":\"accessories\",\"pivot\":\"0\",\"taggable\":\"0\"}', 3),
(62, 12, 'id', 'text', 'Id', 1, 0, 0, 0, 0, 0, '{}', 1),
(63, 12, 'name', 'text', 'Name', 1, 1, 1, 1, 1, 1, '{}', 2),
(64, 12, 'location_type_id', 'text', 'Location Type Id', 1, 1, 1, 1, 1, 1, '{}', 3),
(65, 12, 'location_belongsto_location_type_relationship', 'relationship', 'location_types', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\LocationType\",\"table\":\"location_types\",\"type\":\"belongsTo\",\"column\":\"location_type_id\",\"key\":\"id\",\"label\":\"name\",\"pivot_table\":\"accessories\",\"pivot\":\"0\",\"taggable\":\"0\"}', 4),
(66, 14, 'id', 'text', 'Id', 1, 0, 0, 0, 0, 0, '{}', 1),
(67, 14, 'description', 'text', 'Description', 1, 1, 1, 1, 1, 1, '{}', 4),
(68, 14, 'location_id', 'text', 'Location Id', 1, 1, 1, 1, 1, 1, '{}', 2),
(69, 14, 'location_description_belongsto_location_relationship', 'relationship', 'locations', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\Location\",\"table\":\"locations\",\"type\":\"belongsTo\",\"column\":\"location_id\",\"key\":\"id\",\"label\":\"name\",\"pivot_table\":\"accessories\",\"pivot\":\"0\",\"taggable\":\"0\"}', 3),
(70, 12, 'location_hasmany_location_description_relationship', 'relationship', 'location_descriptions', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\LocationDescription\",\"table\":\"location_descriptions\",\"type\":\"hasMany\",\"column\":\"location_id\",\"key\":\"id\",\"label\":\"description\",\"pivot_table\":\"accessories\",\"pivot\":\"0\",\"taggable\":\"0\"}', 5),
(73, 15, 'id', 'text', 'Id', 1, 0, 0, 0, 0, 0, '{}', 1),
(74, 15, 'description', 'text', 'Description', 1, 1, 1, 1, 1, 1, '{}', 2),
(76, 15, 'preference_belongstomany_user_relationship', 'relationship', 'users', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\User\",\"table\":\"users\",\"type\":\"belongsToMany\",\"column\":\"id\",\"key\":\"id\",\"label\":\"email\",\"pivot_table\":\"user_preference\",\"pivot\":\"1\",\"taggable\":\"on\"}', 4),
(77, 1, 'user_belongstomany_preference_relationship', 'relationship', 'preferences', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\Preference\",\"table\":\"preferences\",\"type\":\"belongsToMany\",\"column\":\"id\",\"key\":\"id\",\"label\":\"description\",\"pivot_table\":\"user_preference\",\"pivot\":\"1\",\"taggable\":\"on\"}', 19),
(78, 16, 'id', 'text', 'Id', 1, 0, 0, 0, 0, 0, '{}', 1),
(79, 16, 'location_type_id', 'text', 'Location Type Id', 1, 1, 1, 1, 1, 1, '{}', 4),
(80, 16, 'preference_id', 'text', 'Preference Id', 1, 1, 1, 1, 1, 1, '{}', 6),
(82, 16, 'user_level_id', 'text', 'User Level Id', 1, 1, 1, 1, 1, 1, '{}', 10),
(84, 16, 'description', 'text', 'Description', 1, 1, 1, 1, 1, 1, '{}', 2),
(85, 16, 'gender_id', 'text', 'Gender Id', 1, 1, 1, 1, 1, 1, '{}', 12),
(86, 16, 'image', 'image', 'Image', 0, 1, 1, 1, 1, 1, '{}', 14),
(87, 16, 'detailed_task_belongsto_user_level_relationship', 'relationship', 'user_levels', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\UserLevel\",\"table\":\"user_levels\",\"type\":\"belongsTo\",\"column\":\"user_level_id\",\"key\":\"id\",\"label\":\"name\",\"pivot_table\":\"accessories\",\"pivot\":\"0\",\"taggable\":\"0\"}', 11),
(88, 16, 'detailed_task_belongsto_location_type_relationship', 'relationship', 'location_types', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\LocationType\",\"table\":\"location_types\",\"type\":\"belongsTo\",\"column\":\"location_type_id\",\"key\":\"id\",\"label\":\"name\",\"pivot_table\":\"accessories\",\"pivot\":\"0\",\"taggable\":\"0\"}', 5),
(89, 16, 'detailed_task_belongsto_preference_relationship', 'relationship', 'preferences', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\Preference\",\"table\":\"preferences\",\"type\":\"belongsTo\",\"column\":\"preference_id\",\"key\":\"id\",\"label\":\"description\",\"pivot_table\":\"accessories\",\"pivot\":\"0\",\"taggable\":\"0\"}', 7),
(91, 16, 'detailed_task_belongsto_gender_relationship', 'relationship', 'genders', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\Gender\",\"table\":\"genders\",\"type\":\"belongsTo\",\"column\":\"gender_id\",\"key\":\"id\",\"label\":\"name\",\"pivot_table\":\"accessories\",\"pivot\":\"0\",\"taggable\":\"0\"}', 13),
(93, 15, 'preference_hasmany_detailed_task_relationship', 'relationship', 'detailed_tasks', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\DetailedTask\",\"table\":\"detailed_tasks\",\"type\":\"hasMany\",\"column\":\"preference_id\",\"key\":\"id\",\"label\":\"description\",\"pivot_table\":\"accessories\",\"pivot\":\"0\",\"taggable\":null}', 5),
(94, 10, 'accessory_belongstomany_detailed_task_relationship', 'relationship', 'detailed_tasks', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\DetailedTask\",\"table\":\"detailed_tasks\",\"type\":\"belongsToMany\",\"column\":\"id\",\"key\":\"id\",\"label\":\"description\",\"pivot_table\":\"task_accessory\",\"pivot\":\"1\",\"taggable\":\"on\"}', 3),
(95, 16, 'detailed_task_belongstomany_partner_task_relationship', 'relationship', 'partner_tasks', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\PartnerTask\",\"table\":\"partner_tasks\",\"type\":\"belongsToMany\",\"column\":\"id\",\"key\":\"id\",\"label\":\"description\",\"pivot_table\":\"task_combinations\",\"pivot\":\"1\",\"taggable\":\"on\"}', 15),
(96, 16, 'detailed_task_belongstomany_accessory_relationship', 'relationship', 'accessories', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\Accessory\",\"table\":\"accessories\",\"type\":\"belongsToMany\",\"column\":\"id\",\"key\":\"id\",\"label\":\"name\",\"pivot_table\":\"task_accessory\",\"pivot\":\"1\",\"taggable\":\"on\"}', 16),
(97, 18, 'id', 'text', 'Id', 1, 0, 0, 0, 0, 0, '{}', 1),
(98, 18, 'description', 'text', 'Description', 1, 1, 1, 1, 1, 1, '{}', 2),
(99, 18, 'location_type_id', 'text', 'Location Type Id', 1, 1, 1, 1, 1, 1, '{}', 4),
(100, 18, 'preference_id', 'text', 'Preference Id', 1, 1, 1, 1, 1, 1, '{}', 6),
(101, 18, 'task_belongsto_location_type_relationship', 'relationship', 'location_types', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\LocationType\",\"table\":\"location_types\",\"type\":\"belongsTo\",\"column\":\"location_type_id\",\"key\":\"id\",\"label\":\"name\",\"pivot_table\":\"accessories\",\"pivot\":\"0\",\"taggable\":\"0\"}', 5),
(102, 18, 'task_belongsto_preference_relationship', 'relationship', 'preferences', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\Preference\",\"table\":\"preferences\",\"type\":\"belongsTo\",\"column\":\"preference_id\",\"key\":\"id\",\"label\":\"description\",\"pivot_table\":\"accessories\",\"pivot\":\"0\",\"taggable\":\"0\"}', 7),
(103, 19, 'id', 'text', 'Id', 1, 0, 0, 0, 0, 0, '{}', 1),
(104, 19, 'description', 'text', 'Description', 1, 1, 1, 1, 1, 1, '{}', 2),
(105, 19, 'rule_belongstomany_task_relationship', 'relationship', 'tasks', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\Task\",\"table\":\"tasks\",\"type\":\"belongsToMany\",\"column\":\"id\",\"key\":\"id\",\"label\":\"description\",\"pivot_table\":\"task_rule\",\"pivot\":\"1\",\"taggable\":\"on\"}', 3),
(106, 20, 'id', 'text', 'Id', 1, 0, 0, 0, 0, 0, '{}', 1),
(107, 20, 'description', 'text', 'Description', 1, 1, 1, 1, 1, 1, '{}', 2),
(108, 20, 'notion_belongstomany_detailed_task_relationship', 'relationship', 'detailed_tasks', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\DetailedTask\",\"table\":\"detailed_tasks\",\"type\":\"belongsToMany\",\"column\":\"id\",\"key\":\"id\",\"label\":\"description\",\"pivot_table\":\"detailed_task_notion\",\"pivot\":\"1\",\"taggable\":\"on\"}', 3),
(109, 16, 'detailed_task_belongstomany_notion_relationship', 'relationship', 'notions', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\Notion\",\"table\":\"notions\",\"type\":\"belongsToMany\",\"column\":\"id\",\"key\":\"id\",\"label\":\"description\",\"pivot_table\":\"detailed_task_notion\",\"pivot\":\"1\",\"taggable\":\"on\"}', 17),
(110, 18, 'task_belongstomany_rule_relationship', 'relationship', 'rules', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\Rule\",\"table\":\"rules\",\"type\":\"belongsToMany\",\"column\":\"id\",\"key\":\"id\",\"label\":\"description\",\"pivot_table\":\"task_rule\",\"pivot\":\"1\",\"taggable\":\"on\"}', 8),
(111, 18, 'partner_description', 'text', 'Partner Description', 1, 1, 1, 1, 1, 1, '{}', 3),
(112, 8, 'partner_task_belongstomany_partner_rule_relationship', 'relationship', 'partner_rules', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\PartnerRule\",\"table\":\"partner_rules\",\"type\":\"belongsToMany\",\"column\":\"id\",\"key\":\"id\",\"label\":\"description\",\"pivot_table\":\"partner_task_rule\",\"pivot\":\"1\",\"taggable\":\"on\"}', 6),
(113, 22, 'id', 'text', 'Id', 1, 0, 0, 0, 0, 0, '{}', 1),
(114, 22, 'description', 'text', 'Description', 1, 1, 1, 1, 1, 1, '{}', 2),
(115, 22, 'partner_rule_belongstomany_partner_task_relationship', 'relationship', 'partner_tasks', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\PartnerTask\",\"table\":\"partner_tasks\",\"type\":\"belongsToMany\",\"column\":\"id\",\"key\":\"id\",\"label\":\"description\",\"pivot_table\":\"partner_task_rule\",\"pivot\":\"1\",\"taggable\":\"on\"}', 3),
(116, 16, 'custom_partner_task', 'text', 'Custom Partner Task', 0, 1, 1, 1, 1, 1, '{}', 3),
(117, 14, 'partner_description', 'text', 'Partner Description', 1, 1, 1, 1, 1, 1, '{}', 5),
(118, 23, 'id', 'text', 'Id', 1, 0, 0, 0, 0, 0, '{}', 1),
(119, 23, 'name', 'text', 'Name', 1, 1, 1, 1, 1, 1, '{}', 2),
(120, 24, 'id', 'text', 'Id', 1, 0, 0, 0, 0, 0, '{}', 1),
(121, 24, 'title', 'text', 'Title', 1, 1, 1, 1, 1, 1, '{}', 3),
(122, 24, 'content', 'text', 'Content', 1, 1, 1, 1, 1, 1, '{}', 4),
(123, 24, 'image', 'image', 'Image', 0, 1, 1, 1, 1, 1, '{}', 5),
(124, 24, 'created_at', 'timestamp', 'Created At', 0, 1, 1, 1, 0, 1, '{}', 6),
(125, 24, 'updated_at', 'timestamp', 'Updated At', 0, 0, 0, 0, 0, 0, '{}', 7),
(126, 24, 'category_id', 'text', 'Category Id', 1, 1, 1, 1, 1, 1, '{}', 2),
(127, 24, 'post_belongsto_category_relationship', 'relationship', 'categories', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\Category\",\"table\":\"categories\",\"type\":\"belongsTo\",\"column\":\"category_id\",\"key\":\"id\",\"label\":\"name\",\"pivot_table\":\"accessories\",\"pivot\":\"0\",\"taggable\":\"0\"}', 8),
(128, 23, 'category_hasmany_post_relationship', 'relationship', 'posts', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\Post\",\"table\":\"posts\",\"type\":\"hasMany\",\"column\":\"category_id\",\"key\":\"id\",\"label\":\"title\",\"pivot_table\":\"accessories\",\"pivot\":\"0\",\"taggable\":\"0\"}', 3),
(129, 14, 'image', 'image', 'Image', 0, 1, 1, 1, 1, 1, '{}', 6),
(130, 18, 'image', 'image', 'Image', 0, 1, 1, 1, 1, 1, '{}', 9),
(131, 8, 'image', 'image', 'Image', 0, 1, 1, 1, 1, 1, '{}', 7),
(132, 26, 'id', 'text', 'Id', 1, 0, 0, 0, 0, 0, '{}', 1),
(133, 26, 'name', 'text', 'Name', 1, 1, 1, 1, 1, 1, '{}', 2),
(134, 26, 'feedback_type_hasmany_feedback_relationship', 'relationship', 'feedback', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\Feedback\",\"table\":\"feedback\",\"type\":\"hasMany\",\"column\":\"type_id\",\"key\":\"id\",\"label\":\"feedback\",\"pivot_table\":\"accessories\",\"pivot\":\"0\",\"taggable\":null}', 3),
(135, 27, 'id', 'text', 'Id', 1, 0, 0, 0, 0, 0, '{}', 1),
(136, 27, 'user_id', 'text', 'User Id', 1, 1, 1, 1, 1, 1, '{}', 2),
(137, 27, 'type_id', 'text', 'Type Id', 1, 1, 1, 1, 1, 1, '{}', 3),
(138, 27, 'feedback', 'text', 'Feedback', 1, 1, 1, 1, 1, 1, '{}', 4),
(139, 27, 'created_at', 'timestamp', 'Created At', 0, 1, 1, 1, 0, 1, '{}', 5),
(140, 27, 'updated_at', 'timestamp', 'Updated At', 0, 0, 0, 0, 0, 0, '{}', 6),
(141, 27, 'feedback_belongsto_user_relationship', 'relationship', 'users', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\User\",\"table\":\"users\",\"type\":\"belongsTo\",\"column\":\"user_id\",\"key\":\"id\",\"label\":\"name\",\"pivot_table\":\"accessories\",\"pivot\":\"0\",\"taggable\":\"0\"}', 7),
(142, 27, 'feedback_belongsto_feedback_type_relationship', 'relationship', 'feedback_types', 0, 1, 1, 1, 1, 1, '{\"model\":\"App\\\\Models\\\\FeedbackType\",\"table\":\"feedback_types\",\"type\":\"belongsTo\",\"column\":\"type_id\",\"key\":\"id\",\"label\":\"name\",\"pivot_table\":\"accessories\",\"pivot\":\"0\",\"taggable\":\"0\"}', 8),
(143, 10, 'description', 'text', 'Description', 0, 1, 1, 1, 1, 1, '{}', 3),
(144, 10, 'image', 'image', 'Image', 0, 1, 1, 1, 1, 1, '{}', 4),
(145, 10, 'url', 'text', 'Url', 0, 1, 1, 1, 1, 1, '{}', 5),
(146, 1, 'telegram_user_id', 'text', 'Telegram User Id', 0, 1, 1, 1, 1, 1, '{}', 7),
(148, 1, 'accept', 'text', 'Accept', 0, 1, 1, 1, 1, 1, '{}', 16),
(149, 1, 'intimate', 'text', 'Intimate', 1, 1, 1, 1, 1, 1, '{}', 17),
(150, 16, 'intimate', 'select_dropdown', 'Intimate', 1, 1, 1, 1, 1, 1, '{\"options\":{\"0\":\"No\",\"1\":\"Yes\"}}', 9);
-- --------------------------------------------------------
--
-- Структура таблицы `data_types`
--
CREATE TABLE `data_types` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`display_name_singular` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`display_name_plural` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`icon` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`model_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`policy_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`controller` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`generate_permissions` tinyint(1) NOT NULL DEFAULT 0,
`server_side` tinyint(4) NOT NULL DEFAULT 0,
`details` text 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;
--
-- Дамп данных таблицы `data_types`
--
INSERT INTO `data_types` (`id`, `name`, `slug`, `display_name_singular`, `display_name_plural`, `icon`, `model_name`, `policy_name`, `controller`, `description`, `generate_permissions`, `server_side`, `details`, `created_at`, `updated_at`) VALUES
(1, 'users', 'users', 'User', 'Users', 'voyager-person', 'TCG\\Voyager\\Models\\User', 'TCG\\Voyager\\Policies\\UserPolicy', 'TCG\\Voyager\\Http\\Controllers\\VoyagerUserController', NULL, 1, 0, '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"desc\",\"default_search_key\":null,\"scope\":null}', '2021-07-06 08:28:42', '2021-08-06 08:40:04'),
(2, 'menus', 'menus', 'Menu', 'Menus', 'voyager-list', 'TCG\\Voyager\\Models\\Menu', NULL, '', '', 1, 0, NULL, '2021-07-06 08:28:42', '2021-07-06 08:28:42'),
(3, 'roles', 'roles', 'Role', 'Roles', 'voyager-lock', 'TCG\\Voyager\\Models\\Role', NULL, 'TCG\\Voyager\\Http\\Controllers\\VoyagerRoleController', '', 1, 0, NULL, '2021-07-06 08:28:42', '2021-07-06 08:28:42'),
(4, 'genders', 'genders', 'Gender', 'Genders', NULL, 'App\\Models\\Gender', NULL, NULL, NULL, 1, 0, '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}', '2021-07-06 09:15:55', '2021-07-07 05:36:12'),
(6, 'user_levels', 'user-levels', 'User Level', 'User Levels', NULL, 'App\\Models\\UserLevel', NULL, NULL, NULL, 1, 0, '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}', '2021-07-06 13:01:18', '2021-07-06 13:01:18'),
(8, 'partner_tasks', 'partner-tasks', 'Partner Task', 'Partner Tasks', NULL, 'App\\Models\\PartnerTask', NULL, NULL, NULL, 1, 0, '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}', '2021-07-06 13:27:51', '2021-07-26 10:03:23'),
(10, 'accessories', 'accessories', 'Accessory', 'Accessories', NULL, 'App\\Models\\Accessory', NULL, NULL, NULL, 1, 0, '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}', '2021-07-16 11:59:29', '2021-07-26 15:43:05'),
(11, 'location_types', 'location-types', 'Location Type', 'Location Types', NULL, 'App\\Models\\LocationType', NULL, NULL, NULL, 1, 0, '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}', '2021-07-16 14:33:02', '2021-07-16 14:42:10'),
(12, 'locations', 'locations', 'Location', 'Locations', NULL, 'App\\Models\\Location', NULL, NULL, NULL, 1, 0, '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}', '2021-07-16 14:35:43', '2021-07-19 10:06:02'),
(13, 'locations_description', 'locations-description', 'Locations Description', 'Locations Descriptions', NULL, 'App\\Models\\LocationDescription', NULL, NULL, NULL, 1, 0, '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}', '2021-07-19 09:56:23', '2021-07-19 09:57:27'),
(14, 'location_descriptions', 'location-descriptions', 'Location Description', 'Location Descriptions', NULL, 'App\\Models\\LocationDescription', NULL, NULL, NULL, 1, 0, '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}', '2021-07-19 10:04:06', '2021-07-26 10:02:39'),
(15, 'preferences', 'preferences', 'Preference', 'Preferences', NULL, 'App\\Models\\Preference', NULL, NULL, NULL, 1, 0, '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}', '2021-07-19 13:10:12', '2021-07-19 14:18:55'),
(16, 'detailed_tasks', 'detailed-tasks', 'Detailed Task', 'Detailed Tasks', NULL, 'App\\Models\\DetailedTask', NULL, NULL, NULL, 1, 0, '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}', '2021-07-19 13:40:33', '2021-08-06 08:39:34'),
(18, 'tasks', 'tasks', 'Task', 'Tasks', NULL, 'App\\Models\\Task', NULL, NULL, NULL, 1, 0, '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}', '2021-07-19 15:27:51', '2021-07-26 10:03:04'),
(19, 'rules', 'rules', 'Rule', 'Rules', NULL, 'App\\Models\\Rule', NULL, NULL, NULL, 1, 0, '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}', '2021-07-20 12:15:10', '2021-07-20 12:15:10'),
(20, 'notions', 'notions', 'Notion', 'Notions', NULL, 'App\\Models\\Notion', NULL, NULL, NULL, 1, 0, '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}', '2021-07-20 12:16:00', '2021-07-20 12:16:00'),
(22, 'partner_rules', 'partner-rules', 'Partner Rule', 'Partner Rules', NULL, 'App\\Models\\PartnerRule', NULL, NULL, NULL, 1, 0, '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}', '2021-07-20 13:23:40', '2021-07-20 13:23:40'),
(23, 'categories', 'categories', 'Category', 'Categories', NULL, 'App\\Models\\Category', NULL, NULL, NULL, 1, 0, '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}', '2021-07-22 09:44:30', '2021-07-22 09:46:39'),
(24, 'posts', 'posts', 'Post', 'Posts', NULL, 'App\\Models\\Post', NULL, NULL, NULL, 1, 0, '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}', '2021-07-22 09:44:47', '2021-07-22 09:45:49'),
(26, 'feedback_types', 'feedback-types', 'Feedback Type', 'Feedback Types', NULL, 'App\\Models\\FeedbackType', NULL, NULL, NULL, 1, 0, '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null}', '2021-07-26 13:43:59', '2021-07-26 13:43:59'),
(27, 'feedback', 'feedback', 'Feedback', 'Feedback', NULL, 'App\\Models\\Feedback', NULL, NULL, NULL, 1, 0, '{\"order_column\":null,\"order_display_column\":null,\"order_direction\":\"asc\",\"default_search_key\":null,\"scope\":null}', '2021-07-26 13:45:00', '2021-07-26 13:45:54');
-- --------------------------------------------------------
--
-- Структура таблицы `detailed_tasks`
--
CREATE TABLE `detailed_tasks` (
`id` bigint(20) UNSIGNED NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci NOT NULL,
`custom_partner_task` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`location_type_id` bigint(20) UNSIGNED NOT NULL,
`preference_id` bigint(20) UNSIGNED NOT NULL,
`user_level_id` bigint(20) UNSIGNED NOT NULL,
`gender_id` bigint(20) UNSIGNED NOT NULL,
`intimate` tinyint(4) NOT NULL DEFAULT 0,
`image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `detailed_tasks`
--
INSERT INTO `detailed_tasks` (`id`, `description`, `custom_partner_task`, `location_type_id`, `preference_id`, `user_level_id`, `gender_id`, `intimate`, `image`) VALUES
(18, 'Ходити на рука ви будете найпростішим способом, просто беріть і йдіть на тих руках до біса.', NULL, 3, 1, 1, 1, 0, NULL),
(19, 'Завязуєте очі і йдете на руках по канату між двома багатоповерхівками жонглюючи ногами пушечними ядрами. А з землі у вас будуть стріляти великокалібреного кулемету.', NULL, 3, 1, 3, 1, 0, NULL),
(20, 'Берете два яйця і смажите яєшню. До яєшні можна додати бекончику.', NULL, 1, 13, 1, 2, 0, 'detailed-tasks\\July2021\\v8g3b3eAbHW9G4a2K3LP.png'),
(21, 'Їдете на ферму алігаторів, ниряєте в озеро відбираєте в алігатора яйця. Якщо вам не відкусили руки, ноги чи голову то частуєте свого коханого яєшнею. Смачного!', NULL, 1, 13, 3, 2, 0, NULL),
(22, 'Копаєте яму на задньому дворі і лягаєте туди, притворяєтесь мертвим.', 'Сходіть на задній двір, там вас чекає сюрприз.', 2, 1, 3, 1, 0, NULL),
(23, 'Забронюйте місце у ресторані, замовте улюблену їжу вашої пари.', 'Приходьте у ресторан.', 1, 13, 1, 1, 0, NULL);
-- --------------------------------------------------------
--
-- Структура таблицы `detailed_task_notion`
--
CREATE TABLE `detailed_task_notion` (
`id` bigint(20) UNSIGNED NOT NULL,
`detailed_task_id` bigint(20) UNSIGNED NOT NULL,
`notion_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `detailed_task_notion`
--
INSERT INTO `detailed_task_notion` (`id`, `detailed_task_id`, `notion_id`) VALUES
(1, 18, 1),
(2, 19, 1),
(3, 20, 2),
(4, 21, 2),
(5, 20, 3),
(6, 21, 3);
-- --------------------------------------------------------
--
-- Структура таблицы `failed_jobs`
--
CREATE TABLE `failed_jobs` (
`id` bigint(20) UNSIGNED NOT NULL,
`uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
`queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Структура таблицы `feedback`
--
CREATE TABLE `feedback` (
`id` bigint(20) UNSIGNED NOT NULL,
`user_id` bigint(20) UNSIGNED NOT NULL,
`type_id` bigint(20) UNSIGNED NOT NULL,
`feedback` text 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;
--
-- Дамп данных таблицы `feedback`
--
INSERT INTO `feedback` (`id`, `user_id`, `type_id`, `feedback`, `created_at`, `updated_at`) VALUES
(1, 14, 2, 'test', '2021-07-26 13:31:28', '2021-07-26 13:31:28'),
(2, 32, 1, 'fwreagfawe', '2021-07-26 14:16:47', '2021-07-26 14:16:47');
-- --------------------------------------------------------
--
-- Структура таблицы `feedback_types`
--
CREATE TABLE `feedback_types` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `feedback_types`
--
INSERT INTO `feedback_types` (`id`, `name`) VALUES
(1, 'Ідея'),
(2, 'Побажання'),
(3, 'Технічна проблема'),
(4, 'Зауваження'),
(5, 'Проблема з оплатою');
-- --------------------------------------------------------
--
-- Структура таблицы `genders`
--
CREATE TABLE `genders` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `genders`
--
INSERT INTO `genders` (`id`, `name`) VALUES
(1, 'Male'),
(2, 'Female');
-- --------------------------------------------------------
--
-- Структура таблицы `generated_tasks`
--
CREATE TABLE `generated_tasks` (
`id` bigint(20) UNSIGNED NOT NULL,
`user_id` bigint(20) UNSIGNED NOT NULL,
`partner_id` bigint(20) UNSIGNED NOT NULL,
`location_description_id` bigint(20) UNSIGNED DEFAULT NULL,
`started_at` timestamp NULL DEFAULT NULL,
`task_id` bigint(20) UNSIGNED NOT NULL,
`detailed_task_id` bigint(20) UNSIGNED NOT NULL,
`partner_task_id` bigint(20) UNSIGNED DEFAULT NULL,
`is_rejected` tinyint(1) DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `generated_tasks`
--
INSERT INTO `generated_tasks` (`id`, `user_id`, `partner_id`, `location_description_id`, `started_at`, `task_id`, `detailed_task_id`, `partner_task_id`, `is_rejected`, `created_at`, `updated_at`) VALUES
(47, 14, 3, 4, NULL, 1, 18, NULL, 1, '2021-07-20 08:14:56', '2021-07-20 08:23:34'),
(48, 14, 3, 4, '2021-07-23 09:30:00', 1, 18, NULL, 1, '2021-07-20 08:23:53', '2021-07-20 09:23:09'),
(49, 14, 3, 2, '2021-07-22 09:23:00', 2, 20, 37, 1, '2021-07-20 09:23:20', '2021-07-21 14:40:28'),
(50, 14, 3, 4, '2021-07-22 14:41:00', 1, 18, 36, 1, '2021-07-21 14:41:25', '2021-07-21 14:42:48'),
(51, 14, 3, 3, '2021-07-22 14:43:00', 1, 18, 32, 1, '2021-07-21 14:43:16', '2021-07-23 10:03:55'),
(52, 19, 14, 3, NULL, 1, 18, 32, 1, '2021-07-21 15:18:04', '2021-07-21 15:18:24'),
(53, 19, 14, 4, NULL, 1, 18, 32, 1, '2021-07-21 15:18:30', '2021-07-21 15:19:05'),
(54, 19, 14, 1, NULL, 2, 20, 34, 1, '2021-07-21 15:19:32', '2021-07-21 15:19:40'),
(55, 19, 14, 4, NULL, 1, 18, 36, 1, '2021-07-21 15:25:38', '2021-07-21 15:25:54'),
(56, 19, 14, 4, NULL, 1, 18, 36, 1, '2021-07-21 15:26:18', '2021-07-21 15:26:30'),
(57, 19, 14, 4, NULL, 1, 18, 36, 1, '2021-07-21 15:26:56', '2021-07-21 15:27:02'),
(58, 14, 3, 3, '2021-07-24 13:03:00', 1, 18, 32, 1, '2021-07-23 13:04:03', '2021-07-23 13:06:23'),
(59, 14, 3, 1, NULL, 3, 20, 34, 1, '2021-07-23 13:09:31', '2021-07-23 13:10:56'),
(60, 14, 3, 2, NULL, 3, 20, 37, 1, '2021-07-23 13:11:13', '2021-07-23 13:21:51'),
(61, 14, 3, 3, NULL, 1, 18, 32, 1, '2021-07-23 13:22:00', '2021-07-23 13:52:02'),
(62, 14, 3, 1, NULL, 3, 20, 37, 1, '2021-07-23 13:52:29', '2021-07-23 13:54:30'),
(63, 14, 3, 3, '2021-07-24 13:54:00', 1, 18, 32, 1, '2021-07-23 13:54:39', '2021-07-23 13:55:15'),
(64, 14, 3, 3, '2021-07-24 13:55:00', 1, 18, 32, 1, '2021-07-23 13:55:25', '2021-07-23 13:57:13'),
(65, 14, 3, 3, '2021-07-24 13:57:00', 1, 18, 36, 1, '2021-07-23 13:57:23', '2021-07-23 14:13:57'),
(66, 14, 3, 4, '2021-07-25 14:15:00', 1, 18, 36, 1, '2021-07-23 14:15:16', '2021-07-23 14:16:03'),
(67, 3, 14, 1, NULL, 3, 20, 34, 1, '2021-07-23 14:16:14', '2021-07-23 14:23:25'),
(68, 3, 14, 3, '2021-07-24 14:23:00', 1, 18, 32, 1, '2021-07-23 14:23:49', '2021-07-23 14:27:36'),
(69, 3, 14, 3, '2021-07-24 15:51:00', 1, 18, 32, 1, '2021-07-23 15:51:55', '2021-07-23 15:54:34'),
(70, 3, 14, 4, '2021-07-24 07:19:00', 1, 18, 36, 0, '2021-07-26 07:19:24', '2021-07-26 07:24:09'),
(71, 14, 3, 2, NULL, 3, 20, 37, 0, '2021-07-26 07:25:46', '2021-07-26 07:26:51'),
(72, 14, 3, 4, NULL, 1, 18, 36, 0, '2021-07-26 07:27:30', '2021-07-26 07:27:38'),
(73, 14, 3, 4, NULL, 1, 18, 32, 0, '2021-07-26 07:30:34', '2021-07-26 07:30:41'),
(74, 3, 14, 3, NULL, 1, 18, 36, 0, '2021-07-26 07:31:17', '2021-07-26 07:31:51'),
(75, 14, 3, 3, NULL, 1, 18, 36, 0, '2021-07-26 07:32:09', '2021-07-26 07:32:16'),
(76, 14, 3, 4, NULL, 1, 18, 32, 0, '2021-07-26 07:34:25', '2021-07-26 07:34:32'),
(77, 14, 3, 2, NULL, 3, 20, 37, 0, '2021-07-26 07:36:08', '2021-07-26 07:36:12'),
(78, 14, 3, 3, NULL, 1, 18, 36, 0, '2021-07-26 07:38:58', '2021-07-26 07:44:12'),
(79, 3, 14, 4, NULL, 1, 18, 36, 0, '2021-07-26 07:51:56', '2021-07-26 07:52:02'),
(80, 3, 14, 2, NULL, 2, 20, 37, 0, '2021-07-26 07:52:23', '2021-07-26 07:52:30'),
(81, 14, 3, 1, NULL, 3, 20, 34, 1, '2021-07-26 09:28:23', '2021-07-26 10:42:03'),
(82, 14, 3, 2, NULL, 2, 20, 34, 1, '2021-07-26 10:42:15', '2021-07-28 10:27:57'),
(83, 32, 14, 2, '2021-07-27 14:31:00', 3, 20, 34, 1, '2021-07-26 14:32:01', '2021-07-26 14:33:50'),
(84, 32, 14, 1, '2021-07-27 14:31:00', 3, 20, 34, 1, '2021-07-26 14:32:25', '2021-07-26 14:33:54'),
(85, 32, 14, 1, '2021-07-27 14:34:00', 2, 20, 37, 0, '2021-07-26 14:34:19', '2021-07-26 14:42:48'),
(86, 32, 14, 1, NULL, 3, 20, 34, 1, '2021-07-26 15:15:44', '2021-07-28 10:28:02'),
(88, 14, 3, 2, NULL, 2, 20, 34, 1, '2021-07-28 11:26:04', '2021-07-28 11:37:47'),
(89, 14, 3, 3, NULL, 1, 18, 32, 1, '2021-07-28 11:38:11', '2021-07-28 11:38:18'),
(90, 14, 3, 2, NULL, 3, 20, 34, 1, '2021-07-28 11:46:32', '2021-07-28 11:46:56'),
(91, 14, 3, 3, NULL, 1, 18, 32, 1, '2021-07-28 11:47:04', '2021-07-28 11:47:18'),
(92, 14, 3, 1, NULL, 2, 20, 37, 1, '2021-07-28 11:47:29', '2021-07-28 11:47:37'),
(93, 14, 3, 1, NULL, 2, 20, 34, 1, '2021-07-28 13:21:44', '2021-08-06 07:23:50'),
(94, 14, 3, 4, NULL, 1, 18, 36, 1, '2021-08-06 08:29:27', '2021-08-06 08:33:05');
-- --------------------------------------------------------
--
-- Структура таблицы `likes`
--
CREATE TABLE `likes` (
`id` bigint(20) UNSIGNED NOT NULL,
`task_id` bigint(20) UNSIGNED NOT NULL,
`user_id` bigint(20) UNSIGNED NOT NULL,
`is_like` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `likes`
--
INSERT INTO `likes` (`id`, `task_id`, `user_id`, `is_like`) VALUES
(10, 18, 14, 1),
(11, 20, 14, 1),
(12, 20, 32, 1);
-- --------------------------------------------------------
--
-- Структура таблицы `locations`
--
CREATE TABLE `locations` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`location_type_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `locations`
--
INSERT INTO `locations` (`id`, `name`, `location_type_id`) VALUES
(1, 'Ресторан', 1),
(2, 'Дім', 1),
(3, 'Парк', 3),
(8, 'Сіновал', 2),
(13, 'Ліс', 2),
(14, 'Міст', 3),
(15, 'Готель', 1);
-- --------------------------------------------------------
--
-- Структура таблицы `location_descriptions`
--
CREATE TABLE `location_descriptions` (
`id` bigint(20) UNSIGNED NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci NOT NULL,
`partner_description` text COLLATE utf8mb4_unicode_ci NOT NULL,
`location_id` bigint(20) UNSIGNED NOT NULL,
`image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `location_descriptions`
--
INSERT INTO `location_descriptions` (`id`, `description`, `partner_description`, `location_id`, `image`) VALUES
(1, 'Cтвори затишну атмосферу у себе вдома, зроби тьмяне світло ароматичні свічки.', 'Сьогоді все відбудеться вдома.', 2, 'location-descriptions\\July2021\\FebMSUi8ZkdC8JwWsXUF.png'),
(2, 'Зроби у невеличку перестановку у своєму домі, включи романтичну музику. Приготуйся гарно провести час.', 'Зручно влаштовуйся на своєму улюбленому кріслі.', 2, 'location-descriptions\\July2021\\ZAl92QzTWUqA4ZjDKlpL.png'),
(3, 'Знайди затишне місце у парку, де можна провести час.', 'Зустрінься зі своєю парою у парку.', 3, 'location-descriptions\\July2021\\ECDNs8LHKbF3YFj82YAf.png'),
(4, 'Знайди місце в парку звідки відкривається гарний вид на місто.', 'Приходь у ваш улюблений парк у місті.', 3, 'location-descriptions\\July2021\\USbNAKsSoOZWjauxycFQ.png'),
(5, 'Зніми номер у затишному готелі. Приготуйся гарно провести час.', 'Сьогодні романтична зустріч в готелі.', 15, NULL),
(6, 'Арендуй кучу сіна у фермера.', 'Приходть на ферму, буде цікаво :)', 8, NULL);
-- --------------------------------------------------------
--
-- Структура таблицы `location_types`
--
CREATE TABLE `location_types` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `location_types`
--
INSERT INTO `location_types` (`id`, `name`) VALUES
(1, 'В приміщенні'),
(2, 'На дворі'),
(3, 'В публічних місцях'),
(4, 'Дистанційно');
-- --------------------------------------------------------
--
-- Структура таблицы `menus`
--
CREATE TABLE `menus` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(255) 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;
--
-- Дамп данных таблицы `menus`
--
INSERT INTO `menus` (`id`, `name`, `created_at`, `updated_at`) VALUES
(1, 'admin', '2021-07-06 08:28:43', '2021-07-06 08:28:43');
-- --------------------------------------------------------
--
-- Структура таблицы `menu_items`
--
CREATE TABLE `menu_items` (
`id` int(10) UNSIGNED NOT NULL,
`menu_id` int(10) UNSIGNED DEFAULT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`url` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`target` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '_self',
`icon_class` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`color` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`parent_id` int(11) DEFAULT NULL,
`order` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`route` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`parameters` text COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `menu_items`
--
INSERT INTO `menu_items` (`id`, `menu_id`, `title`, `url`, `target`, `icon_class`, `color`, `parent_id`, `order`, `created_at`, `updated_at`, `route`, `parameters`) VALUES
(1, 1, 'Dashboard', '', '_self', 'voyager-boat', NULL, NULL, 1, '2021-07-06 08:28:43', '2021-07-06 08:28:43', 'voyager.dashboard', NULL),
(2, 1, 'Media', '', '_self', 'voyager-images', NULL, NULL, 9, '2021-07-06 08:28:43', '2021-07-26 13:47:14', 'voyager.media.index', NULL),
(3, 1, 'Users', '', '_self', 'voyager-person', NULL, 16, 1, '2021-07-06 08:28:43', '2021-07-06 15:05:41', 'voyager.users.index', NULL),
(4, 1, 'Roles', '', '_self', 'voyager-lock', NULL, 16, 2, '2021-07-06 08:28:44', '2021-07-06 15:05:42', 'voyager.roles.index', NULL),
(5, 1, 'Tools', '', '_self', 'voyager-tools', NULL, NULL, 8, '2021-07-06 08:28:44', '2021-07-26 13:47:14', NULL, NULL),
(6, 1, 'Menu Builder', '', '_self', 'voyager-list', NULL, 5, 1, '2021-07-06 08:28:44', '2021-07-06 09:18:28', 'voyager.menus.index', NULL),
(7, 1, 'Database', '', '_self', 'voyager-data', NULL, 5, 2, '2021-07-06 08:28:44', '2021-07-06 09:18:28', 'voyager.database.index', NULL),
(8, 1, 'Compass', '', '_self', 'voyager-compass', NULL, 5, 3, '2021-07-06 08:28:44', '2021-07-06 09:18:28', 'voyager.compass.index', NULL),
(9, 1, 'BREAD', '', '_self', 'voyager-bread', NULL, 5, 4, '2021-07-06 08:28:44', '2021-07-06 09:18:28', 'voyager.bread.index', NULL),
(10, 1, 'Settings', '', '_self', 'voyager-settings', NULL, NULL, 10, '2021-07-06 08:28:44', '2021-07-26 13:47:14', 'voyager.settings.index', NULL),
(11, 1, 'Hooks', '', '_self', 'voyager-hook', NULL, 5, 5, '2021-07-06 08:28:48', '2021-07-06 09:18:28', 'voyager.hooks', NULL),
(12, 1, 'Genders', '', '_self', 'voyager-paw', '#000000', 16, 3, '2021-07-06 09:15:55', '2021-07-06 15:05:42', 'voyager.genders.index', 'null'),
(13, 1, 'User Levels', '', '_self', 'voyager-double-up', '#000000', 16, 4, '2021-07-06 13:01:18', '2021-07-06 15:05:43', 'voyager.user-levels.index', 'null'),
(15, 1, 'Partner Tasks', '', '_self', 'voyager-list-add', '#000000', 32, 2, '2021-07-06 13:27:51', '2021-07-22 09:43:00', 'voyager.partner-tasks.index', 'null'),
(16, 1, 'User Info', '', '_self', 'voyager-people', '#000000', NULL, 2, '2021-07-06 15:05:32', '2021-07-06 15:05:40', NULL, ''),
(18, 1, 'Accessories', '', '_self', 'voyager-trophy', '#000000', 32, 4, '2021-07-16 11:59:29', '2021-07-26 13:47:14', 'voyager.accessories.index', 'null'),
(19, 1, 'Location Types', '', '_self', 'voyager-location', '#000000', 21, 3, '2021-07-16 14:33:02', '2021-07-22 09:52:26', 'voyager.location-types.index', 'null'),
(20, 1, 'Locations', '', '_self', 'voyager-location', '#000000', 21, 1, '2021-07-16 14:35:43', '2021-07-22 09:52:11', 'voyager.locations.index', 'null'),
(21, 1, 'Locations Info', '', '_self', 'voyager-location', '#000000', NULL, 5, '2021-07-16 14:43:45', '2021-07-22 09:42:42', NULL, ''),
(23, 1, 'Location Descriptions', '', '_self', 'voyager-location', '#000000', 21, 2, '2021-07-19 10:04:06', '2021-07-22 09:52:19', 'voyager.location-descriptions.index', 'null'),
(24, 1, 'Preferences', '', '_self', 'voyager-params', '#000000', 16, 5, '2021-07-19 13:10:12', '2021-07-19 15:32:17', 'voyager.preferences.index', 'null'),
(25, 1, 'Detailed Tasks', '', '_self', 'voyager-list', '#000000', 32, 1, '2021-07-19 13:40:34', '2021-07-22 09:42:49', 'voyager.detailed-tasks.index', 'null'),
(26, 1, 'Tasks Info', '', '_blank', 'voyager-window-list', '#000000', NULL, 3, '2021-07-19 13:48:23', '2021-07-22 09:41:20', NULL, ''),
(27, 1, 'Tasks', '', '_self', 'voyager-star', '#000000', 26, 1, '2021-07-19 15:27:51', '2021-07-22 09:41:58', 'voyager.tasks.index', 'null'),
(28, 1, 'Rules', '', '_self', 'voyager-info-circled', '#000000', 26, 2, '2021-07-20 12:15:11', '2021-07-22 09:41:59', 'voyager.rules.index', 'null'),
(29, 1, 'Notions', '', '_self', 'voyager-lightbulb', '#000000', 32, 3, '2021-07-20 12:16:00', '2021-07-22 09:43:00', 'voyager.notions.index', 'null'),
(30, 1, 'Partner Rules', '', '_self', 'voyager-info-circled', '#000000', 26, 3, '2021-07-20 13:23:40', '2021-07-22 09:42:00', 'voyager.partner-rules.index', 'null'),
(32, 1, 'Detailed Tasks Info', '', '_self', 'voyager-documentation', '#000000', NULL, 4, '2021-07-22 09:42:35', '2021-07-22 09:44:10', NULL, ''),
(33, 1, 'Categories', '', '_self', 'voyager-categories', '#000000', 35, 2, '2021-07-22 09:44:30', '2021-07-22 09:50:21', 'voyager.categories.index', 'null'),
(34, 1, 'Posts', '', '_self', 'voyager-news', '#000000', 35, 1, '2021-07-22 09:44:48', '2021-07-22 09:50:19', 'voyager.posts.index', 'null'),
(35, 1, 'News Info', '', '_self', 'voyager-documentation', '#000000', NULL, 6, '2021-07-22 09:50:14', '2021-07-22 09:51:16', NULL, ''),
(36, 1, 'Feedback Types', '', '_self', NULL, NULL, 38, 2, '2021-07-26 13:44:00', '2021-07-26 13:46:50', 'voyager.feedback-types.index', NULL),
(37, 1, 'Feedback', '', '_self', NULL, NULL, 38, 1, '2021-07-26 13:45:01', '2021-07-26 13:46:47', 'voyager.feedback.index', NULL),
(38, 1, 'Feedback Info', '', '_self', 'voyager-group', '#000000', NULL, 7, '2021-07-26 13:46:41', '2021-07-26 13:46:56', NULL, '');
-- --------------------------------------------------------
--
-- Структура таблицы `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `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, '2016_01_01_000000_add_voyager_user_fields', 1),
(4, '2016_01_01_000000_create_data_types_table', 1),
(5, '2016_05_19_173453_create_menu_table', 1),
(6, '2016_10_21_190000_create_roles_table', 1),
(7, '2016_10_21_190000_create_settings_table', 1),
(8, '2016_11_30_135954_create_permission_table', 1),
(9, '2016_11_30_141208_create_permission_role_table', 1),
(10, '2016_12_26_201236_data_types__add__server_side', 1),
(11, '2017_01_13_000000_add_route_to_menu_items_table', 1),
(12, '2017_01_14_005015_create_translations_table', 1),
(13, '2017_01_15_000000_make_table_name_nullable_in_permissions_table', 1),
(14, '2017_03_06_000000_add_controller_to_data_types_table', 1),
(15, '2017_04_21_000000_add_order_to_data_rows_table', 1),
(16, '2017_07_05_210000_add_policyname_to_data_types_table', 1),
(17, '2017_08_05_000000_add_group_to_settings_table', 1),
(18, '2017_11_26_013050_add_user_role_relationship', 1),
(19, '2017_11_26_015000_create_user_roles_table', 1),
(20, '2018_03_11_000000_add_user_settings', 1),
(21, '2018_03_14_000000_add_details_to_data_types_table', 1),
(22, '2018_03_16_000000_make_settings_value_nullable', 1),
(23, '2019_08_19_000000_create_failed_jobs_table', 1),
(24, '2021_07_06_090715_create_genders_table', 2),
(33, '2021_07_06_101435_create_user_levels_table', 3),
(34, '2021_07_06_114852_add_gender_to_users_table', 3),
(35, '2021_07_06_122123_create_preferences_table', 3),
(36, '2021_07_06_122632_create_user_preference_table', 3),
(37, '2021_07_06_123811_create_locations_table', 3),
(38, '2021_07_06_123851_create_accessories_table', 3),
(39, '2021_07_06_125122_create_durations_table', 3),
(41, '2021_07_06_134848_create_detailed_tasks_table', 4),
(42, '2021_07_06_142445_create_partner_tasks_table', 4),
(43, '2021_07_06_143408_create_task_combinations_table', 5),
(44, '2021_07_19_144123_create_generated_tasks_table', 6),
(45, '2021_07_06_154841_create_likes_table', 7),
(46, '2021_07_15_113644_create_user_level_stack_table', 8),
(47, '2021_07_16_143544_create_task_accessory_table', 9),
(48, '2021_07_16_171027_create_user_location_table', 10),
(49, '2021_07_06_122507_create_location_types_table', 11),
(50, '2021_07_19_110119_create_locations_description_table', 12),
(51, '2021_07_19_180606_create_tasks_table', 13),
(52, '2021_07_20_142250_create_rules_table', 14),
(53, '2021_07_20_142644_create_notions_table', 14),
(54, '2021_07_20_144635_create_task_rule_table', 14),
(55, '2021_07_20_144648_create_detailed_task_notion_table', 14),
(56, '2021_07_20_155545_create_partner_rules_table', 15),
(57, '2021_07_20_155645_create_partner_task_rule_table', 15),
(58, '2021_07_22_113828_create_categories_table', 16),
(59, '2021_07_22_114905_create_posts_table', 16),
(60, '2021_07_26_152154_create_feedback_types_table', 17),
(61, '2021_07_26_152943_create_feedback_table', 17);
-- --------------------------------------------------------
--
-- Структура таблицы `notions`
--
CREATE TABLE `notions` (
`id` bigint(20) UNSIGNED NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `notions`
--
INSERT INTO `notions` (`id`, `description`) VALUES
(1, 'Одягніть незвичний костюм'),
(2, 'Дізнайтеся які улюблені страви вашої половинки'),
(3, 'Якщо не вмієте готувати замовте страви в ресторані');
-- --------------------------------------------------------
--
-- Структура таблицы `partner_rules`
--
CREATE TABLE `partner_rules` (
`id` bigint(20) UNSIGNED NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `partner_rules`
--
INSERT INTO `partner_rules` (`id`, `description`) VALUES
(1, 'Вам ніхто не заважає просто прийти і понасолоджуватися вечерею, але якщо ви зробите якийсь сюрприз для вашої половинки, то вечір стане набагато цікавіше. Подумайте що для вашого коханого могло би бути приємним сюрпризом.');
-- --------------------------------------------------------
--
-- Структура таблицы `partner_tasks`
--
CREATE TABLE `partner_tasks` (
`id` bigint(20) UNSIGNED NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci NOT NULL,
`gender_id` bigint(20) UNSIGNED NOT NULL,
`image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `partner_tasks`
--
INSERT INTO `partner_tasks` (`id`, `description`, `gender_id`, `image`) VALUES
(32, 'Допоможіть сходити до біса.', 2, NULL),
(33, 'Допоможіть зав\'язати очі партнеру, а потім стріляйте з великокаліберного кулемету по ньому під час його прохождення по канату.', 2, NULL),
(34, 'Купіть два яйца і м\'ясо у магазині.', 1, 'partner-tasks\\July2021\\xmdb2EHxFT1QbHSdDsSu.png'),
(35, 'Вам потрібно звозити свою кохану на ферму алігаторів. Буде цікаво!', 2, NULL),
(36, 'Допоможіть партнеру зрозуміти сенс його задачі.', 2, NULL),
(37, 'Замаринуйте м\'ясо, та приготуйтеся смачно попоїсти.', 1, NULL),
(38, 'Сходіть на задній двір, там вас чекає сюрприз.', 2, NULL);
-- --------------------------------------------------------
--
-- Структура таблицы `partner_task_rule`
--
CREATE TABLE `partner_task_rule` (
`id` bigint(20) UNSIGNED NOT NULL,
`partner_task_id` bigint(20) UNSIGNED NOT NULL,
`partner_rule_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `partner_task_rule`
--
INSERT INTO `partner_task_rule` (`id`, `partner_task_id`, `partner_rule_id`) VALUES
(1, 34, 1),
(3, 35, 1),
(4, 37, 1),
(5, 32, 1),
(6, 36, 1);
-- --------------------------------------------------------
--
-- Структура таблицы `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Структура таблицы `permissions`
--
CREATE TABLE `permissions` (
`id` bigint(20) UNSIGNED NOT NULL,
`key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`table_name` varchar(255) 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;
--
-- Дамп данных таблицы `permissions`
--
INSERT INTO `permissions` (`id`, `key`, `table_name`, `created_at`, `updated_at`) VALUES
(1, 'browse_admin', NULL, '2021-07-06 08:28:44', '2021-07-06 08:28:44'),
(2, 'browse_bread', NULL, '2021-07-06 08:28:44', '2021-07-06 08:28:44'),
(3, 'browse_database', NULL, '2021-07-06 08:28:44', '2021-07-06 08:28:44'),
(4, 'browse_media', NULL, '2021-07-06 08:28:44', '2021-07-06 08:28:44'),
(5, 'browse_compass', NULL, '2021-07-06 08:28:45', '2021-07-06 08:28:45'),
(6, 'browse_menus', 'menus', '2021-07-06 08:28:45', '2021-07-06 08:28:45'),
(7, 'read_menus', 'menus', '2021-07-06 08:28:45', '2021-07-06 08:28:45'),
(8, 'edit_menus', 'menus', '2021-07-06 08:28:45', '2021-07-06 08:28:45'),
(9, 'add_menus', 'menus', '2021-07-06 08:28:45', '2021-07-06 08:28:45'),
(10, 'delete_menus', 'menus', '2021-07-06 08:28:45', '2021-07-06 08:28:45'),
(11, 'browse_roles', 'roles', '2021-07-06 08:28:45', '2021-07-06 08:28:45'),
(12, 'read_roles', 'roles', '2021-07-06 08:28:45', '2021-07-06 08:28:45'),
(13, 'edit_roles', 'roles', '2021-07-06 08:28:45', '2021-07-06 08:28:45'),
(14, 'add_roles', 'roles', '2021-07-06 08:28:45', '2021-07-06 08:28:45'),
(15, 'delete_roles', 'roles', '2021-07-06 08:28:45', '2021-07-06 08:28:45'),
(16, 'browse_users', 'users', '2021-07-06 08:28:45', '2021-07-06 08:28:45'),
(17, 'read_users', 'users', '2021-07-06 08:28:45', '2021-07-06 08:28:45'),
(18, 'edit_users', 'users', '2021-07-06 08:28:45', '2021-07-06 08:28:45'),
(19, 'add_users', 'users', '2021-07-06 08:28:45', '2021-07-06 08:28:45'),
(20, 'delete_users', 'users', '2021-07-06 08:28:45', '2021-07-06 08:28:45'),
(21, 'browse_settings', 'settings', '2021-07-06 08:28:45', '2021-07-06 08:28:45'),
(22, 'read_settings', 'settings', '2021-07-06 08:28:45', '2021-07-06 08:28:45'),
(23, 'edit_settings', 'settings', '2021-07-06 08:28:46', '2021-07-06 08:28:46'),
(24, 'add_settings', 'settings', '2021-07-06 08:28:46', '2021-07-06 08:28:46'),
(25, 'delete_settings', 'settings', '2021-07-06 08:28:46', '2021-07-06 08:28:46'),
(26, 'browse_hooks', NULL, '2021-07-06 08:28:48', '2021-07-06 08:28:48'),
(27, 'browse_genders', 'genders', '2021-07-06 09:15:55', '2021-07-06 09:15:55'),
(28, 'read_genders', 'genders', '2021-07-06 09:15:55', '2021-07-06 09:15:55'),
(29, 'edit_genders', 'genders', '2021-07-06 09:15:55', '2021-07-06 09:15:55'),
(30, 'add_genders', 'genders', '2021-07-06 09:15:55', '2021-07-06 09:15:55'),
(31, 'delete_genders', 'genders', '2021-07-06 09:15:55', '2021-07-06 09:15:55'),
(32, 'browse_user_levels', 'user_levels', '2021-07-06 13:01:18', '2021-07-06 13:01:18'),
(33, 'read_user_levels', 'user_levels', '2021-07-06 13:01:18', '2021-07-06 13:01:18'),
(34, 'edit_user_levels', 'user_levels', '2021-07-06 13:01:18', '2021-07-06 13:01:18'),
(35, 'add_user_levels', 'user_levels', '2021-07-06 13:01:18', '2021-07-06 13:01:18'),
(36, 'delete_user_levels', 'user_levels', '2021-07-06 13:01:18', '2021-07-06 13:01:18'),
(42, 'browse_partner_tasks', 'partner_tasks', '2021-07-06 13:27:51', '2021-07-06 13:27:51'),
(43, 'read_partner_tasks', 'partner_tasks', '2021-07-06 13:27:51', '2021-07-06 13:27:51'),
(44, 'edit_partner_tasks', 'partner_tasks', '2021-07-06 13:27:51', '2021-07-06 13:27:51'),
(45, 'add_partner_tasks', 'partner_tasks', '2021-07-06 13:27:51', '2021-07-06 13:27:51'),
(46, 'delete_partner_tasks', 'partner_tasks', '2021-07-06 13:27:51', '2021-07-06 13:27:51'),
(47, 'browse_accessories', 'accessories', '2021-07-16 11:59:29', '2021-07-16 11:59:29'),
(48, 'read_accessories', 'accessories', '2021-07-16 11:59:29', '2021-07-16 11:59:29'),
(49, 'edit_accessories', 'accessories', '2021-07-16 11:59:29', '2021-07-16 11:59:29'),
(50, 'add_accessories', 'accessories', '2021-07-16 11:59:29', '2021-07-16 11:59:29'),
(51, 'delete_accessories', 'accessories', '2021-07-16 11:59:29', '2021-07-16 11:59:29'),
(52, 'browse_location_types', 'location_types', '2021-07-16 14:33:02', '2021-07-16 14:33:02'),
(53, 'read_location_types', 'location_types', '2021-07-16 14:33:02', '2021-07-16 14:33:02'),
(54, 'edit_location_types', 'location_types', '2021-07-16 14:33:02', '2021-07-16 14:33:02'),
(55, 'add_location_types', 'location_types', '2021-07-16 14:33:02', '2021-07-16 14:33:02'),
(56, 'delete_location_types', 'location_types', '2021-07-16 14:33:02', '2021-07-16 14:33:02'),
(57, 'browse_locations', 'locations', '2021-07-16 14:35:43', '2021-07-16 14:35:43'),
(58, 'read_locations', 'locations', '2021-07-16 14:35:43', '2021-07-16 14:35:43'),
(59, 'edit_locations', 'locations', '2021-07-16 14:35:43', '2021-07-16 14:35:43'),
(60, 'add_locations', 'locations', '2021-07-16 14:35:43', '2021-07-16 14:35:43'),
(61, 'delete_locations', 'locations', '2021-07-16 14:35:43', '2021-07-16 14:35:43'),
(62, 'browse_locations_description', 'locations_description', '2021-07-19 09:56:23', '2021-07-19 09:56:23'),
(63, 'read_locations_description', 'locations_description', '2021-07-19 09:56:23', '2021-07-19 09:56:23'),
(64, 'edit_locations_description', 'locations_description', '2021-07-19 09:56:23', '2021-07-19 09:56:23'),
(65, 'add_locations_description', 'locations_description', '2021-07-19 09:56:23', '2021-07-19 09:56:23'),
(66, 'delete_locations_description', 'locations_description', '2021-07-19 09:56:23', '2021-07-19 09:56:23'),
(67, 'browse_location_descriptions', 'location_descriptions', '2021-07-19 10:04:06', '2021-07-19 10:04:06'),
(68, 'read_location_descriptions', 'location_descriptions', '2021-07-19 10:04:06', '2021-07-19 10:04:06'),
(69, 'edit_location_descriptions', 'location_descriptions', '2021-07-19 10:04:06', '2021-07-19 10:04:06'),
(70, 'add_location_descriptions', 'location_descriptions', '2021-07-19 10:04:06', '2021-07-19 10:04:06'),
(71, 'delete_location_descriptions', 'location_descriptions', '2021-07-19 10:04:06', '2021-07-19 10:04:06'),
(72, 'browse_preferences', 'preferences', '2021-07-19 13:10:12', '2021-07-19 13:10:12'),
(73, 'read_preferences', 'preferences', '2021-07-19 13:10:12', '2021-07-19 13:10:12'),
(74, 'edit_preferences', 'preferences', '2021-07-19 13:10:12', '2021-07-19 13:10:12'),
(75, 'add_preferences', 'preferences', '2021-07-19 13:10:12', '2021-07-19 13:10:12'),
(76, 'delete_preferences', 'preferences', '2021-07-19 13:10:12', '2021-07-19 13:10:12'),
(77, 'browse_detailed_tasks', 'detailed_tasks', '2021-07-19 13:40:34', '2021-07-19 13:40:34'),
(78, 'read_detailed_tasks', 'detailed_tasks', '2021-07-19 13:40:34', '2021-07-19 13:40:34'),
(79, 'edit_detailed_tasks', 'detailed_tasks', '2021-07-19 13:40:34', '2021-07-19 13:40:34'),
(80, 'add_detailed_tasks', 'detailed_tasks', '2021-07-19 13:40:34', '2021-07-19 13:40:34'),
(81, 'delete_detailed_tasks', 'detailed_tasks', '2021-07-19 13:40:34', '2021-07-19 13:40:34'),
(82, 'browse_tasks', 'tasks', '2021-07-19 15:27:51', '2021-07-19 15:27:51'),
(83, 'read_tasks', 'tasks', '2021-07-19 15:27:51', '2021-07-19 15:27:51'),
(84, 'edit_tasks', 'tasks', '2021-07-19 15:27:51', '2021-07-19 15:27:51'),
(85, 'add_tasks', 'tasks', '2021-07-19 15:27:51', '2021-07-19 15:27:51'),
(86, 'delete_tasks', 'tasks', '2021-07-19 15:27:51', '2021-07-19 15:27:51'),
(87, 'browse_rules', 'rules', '2021-07-20 12:15:11', '2021-07-20 12:15:11'),
(88, 'read_rules', 'rules', '2021-07-20 12:15:11', '2021-07-20 12:15:11'),
(89, 'edit_rules', 'rules', '2021-07-20 12:15:11', '2021-07-20 12:15:11'),
(90, 'add_rules', 'rules', '2021-07-20 12:15:11', '2021-07-20 12:15:11'),
(91, 'delete_rules', 'rules', '2021-07-20 12:15:11', '2021-07-20 12:15:11'),
(92, 'browse_notions', 'notions', '2021-07-20 12:16:00', '2021-07-20 12:16:00'),
(93, 'read_notions', 'notions', '2021-07-20 12:16:00', '2021-07-20 12:16:00'),
(94, 'edit_notions', 'notions', '2021-07-20 12:16:00', '2021-07-20 12:16:00'),
(95, 'add_notions', 'notions', '2021-07-20 12:16:00', '2021-07-20 12:16:00'),
(96, 'delete_notions', 'notions', '2021-07-20 12:16:00', '2021-07-20 12:16:00'),
(97, 'browse_partner_rules', 'partner_rules', '2021-07-20 13:23:40', '2021-07-20 13:23:40'),
(98, 'read_partner_rules', 'partner_rules', '2021-07-20 13:23:40', '2021-07-20 13:23:40'),
(99, 'edit_partner_rules', 'partner_rules', '2021-07-20 13:23:40', '2021-07-20 13:23:40'),
(100, 'add_partner_rules', 'partner_rules', '2021-07-20 13:23:40', '2021-07-20 13:23:40'),
(101, 'delete_partner_rules', 'partner_rules', '2021-07-20 13:23:40', '2021-07-20 13:23:40'),
(102, 'browse_categories', 'categories', '2021-07-22 09:44:30', '2021-07-22 09:44:30'),
(103, 'read_categories', 'categories', '2021-07-22 09:44:30', '2021-07-22 09:44:30'),
(104, 'edit_categories', 'categories', '2021-07-22 09:44:30', '2021-07-22 09:44:30'),
(105, 'add_categories', 'categories', '2021-07-22 09:44:30', '2021-07-22 09:44:30'),
(106, 'delete_categories', 'categories', '2021-07-22 09:44:30', '2021-07-22 09:44:30'),
(107, 'browse_posts', 'posts', '2021-07-22 09:44:47', '2021-07-22 09:44:47'),
(108, 'read_posts', 'posts', '2021-07-22 09:44:47', '2021-07-22 09:44:47'),
(109, 'edit_posts', 'posts', '2021-07-22 09:44:47', '2021-07-22 09:44:47'),
(110, 'add_posts', 'posts', '2021-07-22 09:44:47', '2021-07-22 09:44:47'),
(111, 'delete_posts', 'posts', '2021-07-22 09:44:47', '2021-07-22 09:44:47'),
(112, 'browse_feedback_types', 'feedback_types', '2021-07-26 13:43:59', '2021-07-26 13:43:59'),
(113, 'read_feedback_types', 'feedback_types', '2021-07-26 13:43:59', '2021-07-26 13:43:59'),
(114, 'edit_feedback_types', 'feedback_types', '2021-07-26 13:43:59', '2021-07-26 13:43:59'),
(115, 'add_feedback_types', 'feedback_types', '2021-07-26 13:43:59', '2021-07-26 13:43:59'),
(116, 'delete_feedback_types', 'feedback_types', '2021-07-26 13:43:59', '2021-07-26 13:43:59'),
(117, 'browse_feedback', 'feedback', '2021-07-26 13:45:00', '2021-07-26 13:45:00'),
(118, 'read_feedback', 'feedback', '2021-07-26 13:45:01', '2021-07-26 13:45:01'),
(119, 'edit_feedback', 'feedback', '2021-07-26 13:45:01', '2021-07-26 13:45:01'),
(120, 'add_feedback', 'feedback', '2021-07-26 13:45:01', '2021-07-26 13:45:01'),
(121, 'delete_feedback', 'feedback', '2021-07-26 13:45:01', '2021-07-26 13:45:01');
-- --------------------------------------------------------
--
-- Структура таблицы `permission_role`
--
CREATE TABLE `permission_role` (
`permission_id` bigint(20) UNSIGNED NOT NULL,
`role_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `permission_role`
--
INSERT INTO `permission_role` (`permission_id`, `role_id`) VALUES
(1, 1),
(2, 1),
(3, 1),
(4, 1),
(5, 1),
(6, 1),
(7, 1),
(8, 1),
(9, 1),
(10, 1),
(11, 1),
(12, 1),
(13, 1),
(14, 1),
(15, 1),
(16, 1),
(17, 1),
(18, 1),
(19, 1),
(20, 1),
(21, 1),
(22, 1),
(23, 1),
(24, 1),
(25, 1),
(26, 1),
(27, 1),
(28, 1),
(29, 1),
(30, 1),
(31, 1),
(32, 1),
(33, 1),
(34, 1),
(35, 1),
(36, 1),
(42, 1),
(43, 1),
(44, 1),
(45, 1),
(46, 1),
(47, 1),
(48, 1),
(49, 1),
(50, 1),
(51, 1),
(52, 1),
(53, 1),
(54, 1),
(55, 1),
(56, 1),
(57, 1),
(58, 1),
(59, 1),
(60, 1),
(61, 1),
(62, 1),
(63, 1),
(64, 1),
(65, 1),
(66, 1),
(67, 1),
(68, 1),
(69, 1),
(70, 1),
(71, 1),
(72, 1),
(73, 1),
(74, 1),
(75, 1),
(76, 1),
(77, 1),
(78, 1),
(79, 1),
(80, 1),
(81, 1),
(82, 1),
(83, 1),
(84, 1),
(85, 1),
(86, 1),
(87, 1),
(88, 1),
(89, 1),
(90, 1),
(91, 1),
(92, 1),
(93, 1),
(94, 1),
(95, 1),
(96, 1),
(97, 1),
(98, 1),
(99, 1),
(100, 1),
(101, 1),
(102, 1),
(103, 1),
(104, 1),
(105, 1),
(106, 1),
(107, 1),
(108, 1),
(109, 1),
(110, 1),
(111, 1),
(112, 1),
(113, 1),
(114, 1),
(115, 1),
(116, 1),
(117, 1),
(118, 1),
(119, 1),
(120, 1),
(121, 1);
-- --------------------------------------------------------
--
-- Структура таблицы `posts`
--
CREATE TABLE `posts` (
`id` bigint(20) UNSIGNED NOT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`content` text COLLATE utf8mb4_unicode_ci NOT NULL,
`image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`category_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `posts`
--
INSERT INTO `posts` (`id`, `title`, `content`, `image`, `created_at`, `updated_at`, `category_id`) VALUES
(1, 'Omnis beatae mollitia quo excepturi aut est doloribus.', 'Tempore enim deleniti quam earum. Aliquam porro nemo tempore quae laudantium totam. Distinctio atque eum quia qui excepturi. Provident neque adipisci sint impedit similique aliquid. Sunt sunt accusantium esse occaecati labore cupiditate dicta.\n\nAccusamus corporis quaerat aperiam iste. Deserunt dignissimos sit eaque fuga architecto. Sed sed animi aut. Ea quis totam odit expedita sit.\n\nSed at quo quas. At optio repudiandae ducimus ratione eos.\n\nQuos facere facere consequatur necessitatibus enim aperiam. Nihil animi ipsam et ab non voluptatum. Magnam qui occaecati repellat atque aut asperiores voluptatem. Tempora praesentium temporibus quisquam consequatur fuga beatae.\n\nConsectetur quod cumque ipsa assumenda. Corrupti rem dolores magni qui ullam et nesciunt. Ipsa voluptatem voluptatibus modi fugiat itaque corporis est. Iure voluptatum necessitatibus quaerat in quas quia maxime. Quia blanditiis aut repudiandae adipisci minus aut.\n\nAssumenda possimus aut eveniet placeat et est. Dolor excepturi aut nam eos. Aliquid voluptatem quos illo autem atque voluptas atque ut. Reiciendis rerum dicta voluptas molestiae blanditiis rerum.\n\nAut vero maxime sit adipisci. Delectus itaque totam sunt reprehenderit eligendi nisi. Aliquam voluptas nisi optio corrupti voluptates maxime aspernatur. Expedita error ratione voluptatem.\n\nNeque consequatur fuga voluptas voluptatibus reprehenderit sint debitis. Et voluptatem eum rerum distinctio est repudiandae. Dolorem placeat sit quia eos labore.\n\nRepellendus dolor saepe mollitia voluptatem. Vel enim dolores quo eos molestiae quidem amet. Et eum et voluptatum quis maiores.\n\nAut quia voluptas et vitae est quos voluptatem. Nobis optio tempore cupiditate sunt blanditiis. Sit sit facere nesciunt ad sint aspernatur. Nam dicta veritatis velit possimus natus.', NULL, '2021-05-11 19:45:37', '2021-07-22 09:26:42', 2),
(2, 'Sunt voluptates qui earum minima.', 'Provident unde magni vel praesentium adipisci natus velit. Fuga saepe ut beatae suscipit quas saepe sunt. Optio dolores soluta voluptate laboriosam ab. Reiciendis dolorem tempore perferendis quia numquam enim quae.\n\nOmnis itaque itaque natus amet sequi sed. Et earum tenetur commodi dolor nobis. Sunt est recusandae ad eos dignissimos et. Magnam qui et ad nisi illo necessitatibus. Et ipsam id praesentium dolor et.\n\nSint labore est suscipit molestiae qui eum. Consequatur occaecati atque mollitia tempore aut aut. Rerum nostrum tempore repudiandae sit minus nobis similique.\n\nConsequatur aut consequatur rem dolorem et earum aspernatur. Reprehenderit possimus perspiciatis rem. Facilis enim pariatur est ipsa deserunt necessitatibus.\n\nEt inventore animi veritatis aperiam molestias autem quod omnis. Vel iure dolor quisquam iste occaecati placeat. Atque qui voluptas dignissimos iste ipsa sapiente distinctio.\n\nDoloremque sed laudantium voluptate vero aut. Excepturi iusto itaque magni in. Eligendi tempore voluptatem iste corrupti saepe consequatur asperiores illo.\n\nExcepturi necessitatibus facilis laudantium voluptas aliquid. Nulla at sed adipisci non. Consequatur qui nihil tempora. Voluptas aut voluptas voluptatem quia in ea placeat. Suscipit deleniti est reprehenderit non.\n\nQui iure expedita expedita soluta soluta rerum eaque. Ut nihil reprehenderit id officiis non ad. A quos voluptatibus dolores quaerat velit sit molestiae sed. Sit ipsa qui qui labore. Modi provident vel optio fugit cumque laborum laboriosam et.\n\nAutem suscipit unde expedita explicabo ut nisi. Est tempora doloremque odit fuga sequi consectetur sapiente. Ut fugit exercitationem et quis.\n\nEsse vel asperiores ipsa totam aut dolorem. Distinctio accusamus natus illum aut esse et. Voluptatem a quaerat quos aliquam quasi doloribus. Error architecto ullam voluptatem et rem et aliquid.', NULL, '2021-05-15 22:16:30', '2021-07-22 09:26:42', 1),
(3, 'Et rerum aspernatur officiis architecto repellendus suscipit tenetur rerum.', 'Vitae et eaque praesentium veritatis vitae molestias quasi aut. Esse totam impedit est saepe qui et. Enim quia accusantium hic praesentium. Harum et numquam sint nobis doloribus nostrum.\n\nAsperiores quasi harum quis quis. Quidem eius sed harum. Iste voluptas delectus amet eius.\n\nQuaerat aut reprehenderit accusantium ea adipisci. Temporibus nihil quibusdam non ut. Quo assumenda veritatis possimus aut. Voluptatum inventore quam dolore illum.\n\nSoluta aut eveniet est rerum qui modi ut. Eveniet totam exercitationem consequatur optio. Magnam sed ut omnis autem voluptas sint et. Architecto nostrum labore ut aliquam dignissimos.\n\nEt labore qui est amet qui dolor. Eum dolor illo eaque necessitatibus numquam ut. Commodi velit exercitationem nemo eligendi cumque debitis aut.\n\nUt aliquid aut ratione et. Aliquam expedita velit hic aspernatur occaecati porro. Nihil consequatur rerum dolor delectus suscipit iusto quia.\n\nCommodi inventore aperiam reiciendis laboriosam tempora fugiat. Autem ipsum repellat rerum. Suscipit maiores sed tempora nesciunt.\n\nSed animi ut id doloremque qui assumenda cum. Porro sit officiis libero harum praesentium tenetur. Et accusamus vitae sint in minima et.\n\nSit sit consequatur repellat hic voluptatem autem quia. Consequatur suscipit qui ducimus praesentium. Voluptas in minus minus consequuntur voluptas necessitatibus.\n\nOptio officiis fuga soluta quos. Ipsam dolor aut aperiam numquam consequatur impedit veniam. Qui natus et tenetur delectus aut porro reprehenderit. Iure pariatur quaerat dolore et totam. Aliquid non qui et et dolorem.', NULL, '2021-05-31 13:22:40', '2021-07-22 09:26:42', 2),
(4, 'Qui minus autem harum sunt.', 'Itaque consequatur cum aut. Dolores quia laudantium laudantium qui eum quo. Quae molestiae non molestiae maiores reprehenderit.\n\nRerum dolorem beatae cum est. Dignissimos sapiente architecto eos sapiente. Animi quia voluptatem distinctio unde voluptas. Ipsam consequatur optio perspiciatis sed aspernatur voluptas.\n\nNulla incidunt qui doloribus soluta sed magnam asperiores adipisci. Est voluptatum natus accusamus magni. Iste eum iste voluptatum deserunt qui mollitia voluptatem.\n\nQui exercitationem ut natus aut doloribus ad. Adipisci sit maxime in rerum optio id fugit ut. Corrupti consequatur accusantium temporibus laborum quam culpa. Omnis ea molestias modi veritatis.\n\nIn veritatis quibusdam mollitia nostrum qui architecto et tenetur. Consectetur repudiandae odit porro pariatur.\n\nNon labore corrupti ut doloremque magni. Sequi beatae vero doloremque. Aut nam nostrum et id et. Quisquam consequuntur nulla in labore aliquid.\n\nOmnis id modi quia accusantium. Qui pariatur sit aliquam possimus quia inventore voluptate. Provident repudiandae et cum sit.\n\nUt vel quo officia labore velit. Atque amet error iste consequatur debitis ducimus nam. Quia quibusdam dolor molestias nisi tenetur quis laborum. Accusantium libero omnis vitae aut numquam quos placeat.\n\nHarum dolores sit eligendi occaecati voluptatem. Nam mollitia ut ut voluptas doloremque cumque expedita. Mollitia maiores minima magnam consequuntur.\n\nIn nobis dolor amet magnam quis molestiae. Harum alias corporis debitis perferendis nostrum impedit recusandae. Repellat qui omnis exercitationem omnis quia. Sed optio voluptas autem nobis recusandae excepturi pariatur. Dolor accusantium tenetur mollitia quam ut laborum sit.', NULL, '2021-05-20 08:50:52', '2021-07-22 09:26:42', 1),
(5, 'Alias rerum voluptatem et optio.', 'Ut quae harum labore consectetur laboriosam autem eligendi. Consectetur voluptatibus molestias qui iusto labore eum excepturi repudiandae. Nihil et corrupti ut ex. Consequatur omnis est enim optio.\n\nNatus perferendis qui autem. Sequi nobis dolores earum consequatur impedit perferendis. Soluta error non error qui dignissimos cum aut. Quisquam fuga alias placeat distinctio.\n\nNon ducimus illo perferendis voluptatibus id a doloremque eligendi. Eaque unde et id quasi maiores et natus. Quis quis ullam vel rerum.\n\nOfficiis sunt eius aut dolore. Commodi magni ullam et. Ut est error eius omnis accusamus.\n\nQuia repudiandae provident aut voluptatem tenetur. Eum ea nihil dolor aut. Dolore eos qui qui asperiores necessitatibus. Laborum est veritatis ut id ut recusandae.\n\nDolorem omnis rem quo velit itaque est nemo. Eveniet quaerat nostrum nihil et beatae temporibus iste. Culpa error deserunt sequi dolores laboriosam qui. Consequatur corrupti et illo quos.\n\nEt vel sed repellat et eum ullam. Amet repellendus voluptas deleniti corporis dolores beatae. Voluptatem dolor minus culpa quia voluptatem omnis. Iure laudantium odio magni quibusdam non iste. Deserunt id tempore odio corporis fuga assumenda.\n\nEt et et non in eos totam. Sint soluta molestias officiis a harum debitis nihil. Harum voluptatem et dolores. Officia rem numquam tenetur asperiores. Dolor laboriosam accusantium labore officiis nulla.\n\nIncidunt suscipit ipsa repellendus soluta. Iure et et et tempore neque rem incidunt. Quos dolorum facere architecto cum aut voluptatibus.\n\nEnim adipisci facilis sint numquam doloribus voluptatem. Quo explicabo soluta illo magni dolor incidunt dolores fugit. Est nisi inventore velit similique nesciunt architecto illo. Commodi ad quam deserunt vitae iusto doloremque.', NULL, '2021-06-19 23:28:19', '2021-07-22 09:26:42', 2),
(6, 'Sunt sed architecto a impedit quis et.', 'Eum voluptates quisquam expedita dolorem quis. Optio qui iure amet blanditiis nulla aut odit. Et minus occaecati tempore possimus repudiandae aut in. Nesciunt vel voluptates adipisci fugiat saepe.\n\nVoluptatum aliquid corrupti vel qui minus animi. Sed ut recusandae ratione autem autem vel recusandae. Voluptas cumque illum ipsum et excepturi possimus aut ullam. Alias delectus aut optio et.\n\nConsequatur enim quasi aut qui et. Est inventore non repellendus saepe. Ut vel molestiae et veritatis voluptas qui.\n\nVeritatis repellendus assumenda sed numquam maxime in. Corrupti dolor cum mollitia dolorem rerum neque quo. Est voluptatem ipsam eligendi distinctio amet et ea voluptas. Sint pariatur quos et ut sed. Consequatur eveniet nisi aut nam suscipit.\n\nNon debitis numquam quos odit quia natus corporis hic. Velit ducimus nostrum ea quod. Saepe nam nulla tempore sed praesentium. Dolore aliquid adipisci quia voluptates tempora enim aliquam.\n\nDucimus vel laborum qui minima suscipit. Repudiandae aut mollitia fuga. Et sunt hic numquam ipsum recusandae officia ut.\n\nVoluptatem enim sunt repudiandae similique nostrum cum unde et. Sint et saepe enim veniam accusantium itaque consequuntur. Sapiente quia doloremque sint.\n\nAperiam non dolore dolorem perspiciatis. Impedit sint quos et. Ab laborum expedita architecto ullam temporibus.\n\nQuaerat fugiat possimus eos architecto. Vitae ducimus voluptates eum. Quia rerum nostrum vel quia expedita.\n\nHarum qui maiores officia suscipit odit illum. Accusamus laudantium ut et temporibus. Autem sit vel assumenda. Optio delectus officia enim non iure aperiam.', NULL, '2021-07-10 04:12:20', '2021-07-22 09:26:42', 2),
(7, 'Sit debitis similique sint expedita nihil tempore.', 'Aliquid dicta ipsam ut libero quis eum. Aut ex soluta quas aut. Molestiae non similique dicta distinctio suscipit inventore atque.\n\nQuia nisi cum ea qui animi. Debitis id quaerat ipsa consectetur asperiores. Dolor natus numquam earum sint sequi.\n\nUt earum nihil et ut praesentium totam. Officia numquam animi aut soluta. Ut expedita illo magnam quo consequatur est ut. Aut nulla quisquam quos delectus excepturi quae.\n\nAut sed nulla non omnis reiciendis et sed. Ut sit cumque consequatur qui in quia. Dolorem quo labore consequatur sed quia. Facilis ea expedita et ea dolorum.\n\nDolores qui numquam doloribus nihil tempora ipsa. Perspiciatis eligendi ea exercitationem maxime aut aspernatur aspernatur. Sit nemo ad qui pariatur aut.\n\nEius et numquam aliquam laboriosam labore ut praesentium eum. Numquam eum accusantium facere autem commodi sapiente enim. Ducimus id quia est velit. Porro quis cumque exercitationem quae et laudantium rem.\n\nPlaceat qui aperiam ipsa eveniet voluptatem laborum. Maxime vel numquam non doloribus aut id qui. Dignissimos repellat distinctio rerum quas sint dolores nisi. Praesentium beatae mollitia officia quod iusto.\n\nEt quisquam esse ut qui reiciendis quo. Dolorem et exercitationem voluptate fuga. Minima eum ipsa voluptatem enim maxime et molestias.\n\nPossimus et enim incidunt voluptatem quis quia. Et eveniet harum magni cum ullam.\n\nEt deleniti voluptatem voluptatem porro fuga dolor est. Quia illum quis voluptate quia aut qui quae. Aut assumenda earum ab saepe repellendus. Omnis unde qui reiciendis corporis omnis optio.', NULL, '2021-05-11 09:05:02', '2021-07-22 09:26:43', 2),
(8, 'Et ipsa id quam eligendi quia dolore.', 'Quisquam beatae vel molestiae repellendus facilis. Iste aperiam velit explicabo repudiandae. Et quo quisquam quia ullam neque maxime eveniet.\n\nQuidem quasi laudantium laborum autem totam assumenda. Blanditiis et animi aut eos. Aut labore et molestiae qui accusamus tempore. Modi quos voluptatum aut laborum voluptatibus eum.\n\nQuas iure cumque molestiae omnis harum aut. Incidunt porro necessitatibus consequatur dolorem totam. Mollitia enim corrupti quibusdam sed.\n\nMollitia aliquam ratione vel perferendis sit eius. Magnam ex consequatur perferendis quas sint dolorem aut natus. Delectus mollitia voluptas quisquam.\n\nSit praesentium repellat qui voluptas dolore. Perspiciatis possimus dignissimos sit eos. Explicabo fugit tenetur enim facilis et quaerat est.\n\nQuaerat repudiandae quasi aut ratione qui tempore. Ut voluptas quo qui est provident. Rerum ut suscipit necessitatibus sit ratione blanditiis.\n\nAutem qui dolorem qui et dolorem consequatur. Nobis doloribus repudiandae esse ut fugit aut. Dolores odit doloribus nemo animi.\n\nOfficia recusandae alias tempora molestiae necessitatibus quas quia fugit. Sequi qui totam voluptatem harum minus natus. Ut tenetur quos soluta error. Explicabo nesciunt quam minima tempora architecto iure quia.\n\nSint odio illo pariatur iste. Rerum quos voluptatem quisquam et praesentium libero. Veritatis ad est recusandae aut est aliquid. Repellendus et beatae quis ducimus.\n\nSunt qui ut dolor reiciendis magni. Ea sunt nesciunt quisquam. Necessitatibus quis aperiam ipsam ea quia aut blanditiis suscipit.', NULL, '2021-05-03 23:15:17', '2021-07-22 09:26:43', 2),
(9, 'Nemo aperiam dignissimos itaque quod commodi.', 'Commodi id omnis sunt. Quibusdam ullam non ipsa est distinctio esse quia iure. Nihil et ducimus occaecati qui ratione ipsa.\n\nAlias quisquam aliquam amet molestiae ut placeat. Rerum quibusdam dignissimos voluptas libero et voluptatem odit.\n\nAdipisci sint voluptatum voluptatum nemo tempora. Et molestias dignissimos non voluptas esse. Nulla voluptatem et rerum.\n\nNecessitatibus nihil incidunt reiciendis. Ut et ea voluptas sed nemo iusto et. Ipsum ex quos ut iusto voluptates. Fuga dolorum voluptatem vero adipisci qui explicabo accusantium.\n\nEt ipsum possimus sequi eaque praesentium ut cumque. Et aut aliquam dolorem nihil est dolores quis. Possimus architecto doloremque eos ut in voluptatem libero. Adipisci fuga non voluptas blanditiis quaerat. Debitis asperiores quam minima voluptatem incidunt perspiciatis.\n\nQui fugiat totam quis iusto hic accusantium. A eum voluptas facere error molestiae. Magni sit qui sit et quas libero. Iure ipsam reiciendis nam pariatur dolor eligendi.\n\nQui dolores nihil voluptas dolor. Impedit eum qui saepe et ad voluptate dicta suscipit. Hic consequatur sunt rerum et.\n\nRepellendus quo id praesentium nisi voluptas. Et aperiam culpa sed eaque voluptatum voluptas voluptatem. Quis distinctio cupiditate quis qui perspiciatis fuga perspiciatis. Enim ut autem et quasi necessitatibus.\n\nMaiores velit consectetur perferendis explicabo aut aut. Suscipit facilis quia qui placeat sequi harum. Sed numquam qui ipsa incidunt quis. Esse non unde exercitationem possimus iste magnam.\n\nEsse iusto voluptas voluptatibus corrupti. Perferendis praesentium aut ut maiores quo beatae. Expedita modi omnis quas dolor.', NULL, '2021-05-25 09:29:51', '2021-07-22 09:26:43', 5),
(10, 'Ea est voluptas fugit voluptates sit voluptatum.', 'Eveniet enim porro qui et exercitationem ratione omnis. Et tempore et error sint officia. Incidunt enim libero asperiores. A et qui nihil quaerat quia quidem. Impedit earum cum quis alias excepturi iste quia.\n\nEa aliquam laudantium quia quisquam mollitia quo. Doloribus esse neque nisi facere quis impedit omnis qui. Et ipsa eaque sapiente exercitationem quasi est.\n\nDelectus aut minus in ipsum nulla quae minima. Est voluptas similique aut molestias.\n\nRecusandae ullam nihil eum architecto dolor nobis. Possimus qui quia qui tenetur aut qui. Dolorum quia enim in laudantium nam odit. Ducimus nobis dignissimos quia.\n\nSit occaecati suscipit cum enim vero sunt. Repudiandae rem aut id maxime. Consequatur sapiente blanditiis vel vel sint odit labore.\n\nSuscipit sed laboriosam ea quidem sint eveniet eos. Ipsam dignissimos aut iure placeat consequatur quia sint debitis. Reiciendis est sed quae et quia rerum.\n\nMagni sit dolores mollitia sint nemo. Sed qui id blanditiis ipsum. Aut sit asperiores nihil culpa.\n\nUt voluptatum magni rerum sint in voluptatem quisquam tempora. Omnis culpa aut facere aspernatur quod sit sit.\n\nLaboriosam quo deleniti aut sed voluptatibus eligendi. Quidem sapiente vel vel nisi animi quae fugit. Reprehenderit maxime voluptas laborum non vel aut voluptatem. At dolor modi deleniti quas qui. Ipsum omnis porro ea amet dolorum.\n\nQui ipsa accusantium consequatur veritatis rerum. Rerum doloremque fugit odit omnis repellendus molestiae aut. Eveniet cupiditate aut iusto dolores atque minima necessitatibus.', NULL, '2021-06-24 08:55:45', '2021-07-22 09:26:43', 4),
(11, 'Id iure voluptatum nesciunt nihil qui sint laboriosam.', 'Ab exercitationem eius in sed rerum rerum. Quo aperiam assumenda voluptas dignissimos laboriosam dolores. Id provident maiores ab aut dicta. Debitis cum enim aut alias nam.\n\nMaxime expedita facilis ipsum. Nostrum dolor dolor sed necessitatibus. Vel assumenda hic et quos eos ad.\n\nOptio reprehenderit quo recusandae eligendi est. Et dolorem commodi architecto qui placeat id distinctio. Nam aliquid exercitationem aliquam eveniet. Tempore et aut voluptates ut et accusamus.\n\nPraesentium ab velit tenetur quidem corrupti et similique quo. Nisi molestiae fugit facilis eligendi mollitia nobis et. Aliquid nam ullam et eum. Corporis ut doloremque id qui amet.\n\nSint facere saepe recusandae enim aut alias nobis. Expedita sapiente cupiditate qui minus eveniet rerum odit.\n\nDignissimos ratione adipisci neque qui sit animi voluptatum. Ipsa cupiditate modi laboriosam facere et veritatis. Ullam similique eum occaecati pariatur.\n\nNon natus aut quia quia voluptatem eveniet voluptas. Quia numquam nihil odit nisi. Esse perferendis sequi molestias dicta aut debitis veritatis.\n\nSint dolorem quia consequatur et. Quia repellendus dolore quae unde fugiat. Ut at ducimus repellendus nam cupiditate.\n\nLibero dicta dolorum tempore est eius animi omnis. Saepe id tenetur sint ut consequatur. Minima temporibus occaecati sit reprehenderit. Aliquam molestias temporibus occaecati.\n\nConsequatur omnis temporibus fugit et vitae. Voluptas doloremque laboriosam ut nihil. Minima quam sed libero maxime nam.', NULL, '2021-05-13 22:05:47', '2021-07-22 09:26:43', 5),
(12, 'Tenetur aut blanditiis reprehenderit pariatur harum ducimus.', 'Dicta ut rerum inventore. Animi ipsum pariatur aliquid et repellendus unde similique non. Asperiores corrupti praesentium velit consectetur ratione. Eum sed reiciendis dolorum ullam.\n\nSimilique est quia qui voluptas debitis dolores. Sed ex voluptatem tenetur in dignissimos incidunt culpa.\n\nQuis fugiat id reprehenderit nam ut. Ipsum et qui dolor saepe temporibus dolores illo nihil. Sit aut quasi est vel explicabo necessitatibus perferendis.\n\nIn dolorem minima quaerat provident voluptatibus autem. Eligendi voluptatem accusantium iste nisi consequatur cum. Consequatur rerum libero molestiae nihil id aut expedita. A dolorem et quis provident ut vero. Expedita enim et velit non voluptas.\n\nEum cumque dicta a dolorem eveniet. Consequatur explicabo quidem quidem consequatur corrupti vel sunt.\n\nQui enim et earum. Quo fuga incidunt quidem quo. Facere et magnam fuga quaerat earum aut.\n\nLaudantium inventore eum sunt praesentium facere ullam laborum. Debitis sequi voluptas rerum et aperiam quos. Omnis doloribus doloribus sit omnis et corporis.\n\nAdipisci qui incidunt sed distinctio dolore et. Magnam amet quos ratione quisquam dolor quae. Quis ea sed qui eos architecto voluptas est perspiciatis.\n\nOdit vel necessitatibus illo et aut est consequuntur. Iure est voluptas explicabo officiis ipsa est earum quia. Possimus doloremque adipisci nam quisquam pariatur cumque est. Voluptatibus magnam harum voluptatem at voluptatibus. Nisi minus sapiente sint odit ex.\n\nQui voluptatem perferendis dignissimos et non autem. Dicta vel ratione vitae eos vitae. Amet quam voluptas eos atque. Repellendus esse nemo quidem ipsum vel aut a.', NULL, '2021-07-15 21:55:17', '2021-07-22 09:26:43', 2),
(13, 'Unde ut eaque sequi accusamus quos sequi.', 'Autem vitae explicabo quia non blanditiis iusto nemo. Dolores est delectus sit odio laborum. Ea dolores voluptatum rerum quasi consequatur incidunt. Asperiores ad vel deserunt consequuntur et tenetur.\n\nDolor harum repudiandae et reprehenderit sequi possimus. Vel provident est consequatur consequatur. Ipsa exercitationem ratione et mollitia aliquid molestiae.\n\nRerum fugiat hic voluptatem. Quo ut autem assumenda. Enim qui debitis ea sed. Necessitatibus omnis similique quaerat qui deserunt rerum quidem.\n\nExplicabo mollitia exercitationem omnis in necessitatibus accusantium aut. Nihil harum deserunt qui. Voluptatem et eaque voluptate corporis perspiciatis tempore.\n\nUnde quo nulla adipisci recusandae nihil sed. Explicabo voluptas minus nesciunt est pariatur. Illum ratione aliquam hic ipsum minima necessitatibus saepe.\n\nOmnis inventore autem recusandae mollitia in impedit qui dolorem. Possimus saepe reprehenderit illum numquam quasi corporis. Atque et qui blanditiis quod quia doloremque.\n\nInventore aut perferendis inventore dolores maiores. Et facere inventore omnis fuga voluptatem. Quasi reiciendis atque commodi optio. Ut expedita cum aut ipsa mollitia esse quia.\n\nArchitecto rerum eaque maxime blanditiis. Cum occaecati aliquid aut maiores unde inventore. Molestias aut amet atque ea incidunt eum. Error ea officiis eum.\n\nQui doloribus nihil et. Dolorum harum deserunt praesentium. Eum ut quae cum vitae architecto magni. Corporis dolor maxime aspernatur. Aut sunt quo ea.\n\nVoluptas tempora in perspiciatis sapiente. Iste voluptas sit sed aut. Aut qui natus assumenda aut.', NULL, '2021-06-21 17:41:19', '2021-07-22 09:26:43', 4),
(14, 'Minima aut laudantium est iure nemo sit natus.', 'Aut quae est praesentium blanditiis alias consequuntur. Quia sunt quia hic quisquam. Et similique sed totam sapiente veniam. Voluptas et illo dolorem.\n\nDolore quis fuga et cupiditate. Aperiam sed ipsum dolores corrupti eos animi maxime. Repellendus delectus consequatur qui omnis cupiditate assumenda et.\n\nAut ea laboriosam sapiente aut commodi sit delectus. Sequi ex quis qui alias et. Iste non dolorem iure beatae.\n\nEst aut in et rerum. Sed sapiente corrupti quia quia dolorem. Aut eveniet facilis eius mollitia voluptatem qui.\n\nAccusamus debitis ut esse laboriosam. Sint inventore quia voluptatem et similique minus. Qui saepe voluptas sint ea. Blanditiis vel dicta quia et aut. Qui velit voluptate et qui omnis id praesentium.\n\nVelit possimus quo est tenetur. Facilis iure ab reiciendis iste ipsa deleniti. Ipsa maxime suscipit molestias debitis quia natus nisi. Ducimus quia eum ea.\n\nQui fuga eum praesentium ex et quia. Eum voluptatem quia qui et dolores consectetur officiis eveniet. Sit perferendis non et perspiciatis tempora exercitationem itaque recusandae. Consequuntur ab possimus officiis ut commodi enim.\n\nIpsa debitis eveniet similique voluptas hic cumque libero. Totam perspiciatis dignissimos dignissimos ut omnis quo nesciunt. Quaerat voluptates corporis omnis quo fugit architecto. Placeat rerum qui pariatur.\n\nMinima nihil facere consequatur temporibus animi. Ratione quo neque alias quia dolor dolores et. Voluptatibus non et inventore ad eos qui. Ea et est et asperiores officiis.\n\nQuibusdam culpa sed ut praesentium. Consequuntur temporibus et perspiciatis eveniet distinctio est quos quia. Facilis est earum repellendus quasi non. Animi quaerat totam unde est aut magnam qui.', NULL, '2021-04-27 17:49:29', '2021-07-22 09:26:43', 3),
(15, 'Magni molestias adipisci suscipit eum.', 'Sint illum occaecati natus ut dolores tenetur numquam. Velit mollitia corporis est beatae necessitatibus consequatur. Cupiditate aperiam voluptas doloribus minima porro debitis.\n\nVoluptatem nam qui doloremque qui provident est consequatur magnam. Dignissimos pariatur culpa sunt quas blanditiis et.\n\nNostrum quia accusantium beatae beatae eaque. Amet a unde eveniet sed suscipit ut. Qui officia voluptas et aut. Autem qui ea corporis vel.\n\nSed qui temporibus rerum ut. Saepe natus corrupti aut dolorum modi. Consequuntur consectetur repudiandae enim. Similique nisi voluptates odio quaerat.\n\nNeque officiis sint rerum maxime. Doloribus ut dolorum qui aliquam rerum et delectus eum. Id ratione id sit quo.\n\nQuam cumque minima vel et eaque. Iste et soluta ex molestias dolorem.\n\nPlaceat quaerat tempore recusandae fugiat rerum. Qui et illo officiis et et dolorum. Asperiores odio quia asperiores qui.\n\nQuaerat quos placeat harum natus nihil suscipit est. Et et architecto itaque id deserunt quam. Ut culpa eligendi nostrum tenetur cumque.\n\nCorrupti dolore temporibus amet deserunt. Accusantium sint qui corporis fugit dolore.\n\nEst enim quod ea non et. Expedita maiores et ut eius iure mollitia. Placeat et dolorum architecto quos quia a et. Natus voluptatem id aut.', NULL, '2021-06-08 14:38:04', '2021-07-22 09:26:43', 4),
(16, 'Omnis qui temporibus aut aut dolore quaerat ut.', 'Est ab facere magni. Magni id iste placeat est unde tempora ab. Sed ullam tempora inventore amet aut.\n\nVoluptatum consectetur et et. Nobis quibusdam ducimus aut. Quia dolorem et voluptas in.\n\nFuga placeat perferendis earum inventore accusantium quos consequatur quo. Maiores est adipisci dignissimos voluptate fuga debitis deserunt. Aut aperiam praesentium autem et quo expedita sed.\n\nSunt illo consequuntur rem sed. Voluptas provident fugit nihil ut. Placeat mollitia harum qui consequatur dolores.\n\nAt possimus ea expedita accusamus consequatur. Voluptas eveniet inventore quo eum sunt animi. Incidunt et vero labore aliquam sapiente aliquid est. Libero suscipit eos soluta et assumenda.\n\nUt tenetur pariatur ipsam voluptatem. Id incidunt a rem quod consequatur amet.\n\nNeque in qui est maxime ipsum. Molestiae est rem aut et omnis omnis.\n\nCumque nesciunt esse et voluptatibus iure. Repellendus blanditiis minus quidem sit qui aperiam corporis eum. Iusto optio sapiente ducimus ut voluptatem eos aut. At similique saepe sit iure minus.\n\nReprehenderit nihil atque sit perspiciatis quas aperiam. Molestiae illum aperiam quas doloribus recusandae et voluptates. Et aut qui a quia et.\n\nNulla dolor officia dolorem voluptas assumenda consequuntur neque iure. Quis non illum dicta qui. Sit sapiente maiores eum.', NULL, '2021-05-25 12:48:32', '2021-07-22 09:26:43', 1),
(17, 'Asperiores quaerat in at id.', 'Nam enim et placeat non vero. Vero molestiae saepe aut in. Et laborum ratione ea facere ex autem eveniet officia. Earum dolores tempore at ut.\n\nOptio excepturi qui possimus quos esse hic enim et. Quidem perferendis doloribus aut qui non quas.\n\nEt deleniti vel mollitia quis ut. Eum cupiditate enim illum voluptatem inventore quia et.\n\nCumque sit vel libero ea. Autem adipisci explicabo doloremque et temporibus. Incidunt vero qui accusamus.\n\nNulla ut inventore ut unde distinctio repellat reiciendis ut. A quo odio voluptatibus et. Aut nemo suscipit sit quia ut recusandae.\n\nExpedita quia qui optio amet. Nostrum qui possimus neque ab voluptatem est est laborum. Qui sed quaerat et fugit eaque vero sed. Odio aliquid quae natus at rerum eum.\n\nNostrum necessitatibus dolore molestias et velit sit. Sunt non quidem culpa omnis. Cumque quod praesentium repellendus amet doloremque rem blanditiis.\n\nAliquam accusantium excepturi eum voluptatum architecto laudantium. Reprehenderit dolores a autem fugiat. Eos molestiae laborum aliquam quod saepe eum dignissimos. Sed nesciunt optio aut cum voluptatem eius eligendi.\n\nQuasi voluptatem sit maiores impedit ullam saepe quae totam. Quo ut natus repellat ducimus quisquam quam. Ratione pariatur laborum iste et.\n\nAmet corporis atque assumenda cupiditate est est sequi qui. Atque quia suscipit explicabo debitis commodi rem. Qui eum delectus dolore. Earum odio fugit numquam.', NULL, '2021-07-01 00:43:15', '2021-07-22 09:26:43', 2),
(18, 'Nesciunt nostrum voluptas velit temporibus sunt.', 'Qui inventore dolore aliquam impedit laboriosam neque corporis. Sint impedit officia recusandae molestiae sint omnis. Illum quia omnis ipsam sunt fugit aut. Deleniti quo accusantium qui tempore laudantium id.\n\nAccusantium aspernatur non et fuga ut mollitia. Adipisci doloribus velit rerum deserunt. Debitis id reiciendis necessitatibus vitae tempora in consequatur.\n\nEa eveniet doloremque repudiandae in minus et. Cumque et qui eum ut quis dolorem ut. Error omnis quo voluptatem totam nisi sequi excepturi.\n\nSimilique architecto autem dignissimos. Sint velit exercitationem repudiandae. Est cupiditate non consequuntur suscipit et ut. Adipisci optio aspernatur est vel qui reprehenderit vel.\n\nVoluptates quisquam earum et et et. Qui fuga officiis repudiandae corrupti ut sed minima. Dolorem soluta vitae et recusandae aspernatur dolores dolorum. Quae ratione qui officia quia aut vel non. Repellat rerum cumque molestiae sed magni quibusdam quia quo.\n\nAut sit quo aspernatur tenetur voluptatum inventore. Eum et et ut pariatur optio recusandae. Et totam qui eaque. Dolores voluptatem corporis libero sed velit autem.\n\nFuga soluta quia veniam placeat et. Voluptas cumque atque voluptatem fuga. Et non iusto asperiores repellendus est eos.\n\nId reprehenderit ea eius commodi et officia. Voluptatibus laboriosam fuga enim molestiae ea et odio ipsum. Porro corporis totam sed et. Hic alias est ut saepe ad debitis.\n\nPerferendis nemo consectetur quia eius quis sint quidem et. Et aut sit in placeat nostrum amet voluptatem. Velit dicta qui autem. Reiciendis nemo dolores consectetur facilis hic in.\n\nMollitia qui quo quibusdam est qui et veritatis eaque. Doloremque quo in aut soluta. Voluptates at itaque et accusamus qui aut. Deserunt officiis nulla qui voluptas.', NULL, '2021-05-08 00:52:58', '2021-07-22 09:26:43', 3),
(19, 'Assumenda nostrum nobis architecto reprehenderit.', 'Sit ducimus vel dolores tempora delectus alias corrupti et. Omnis reiciendis nulla nulla repudiandae. Possimus et doloribus voluptatibus ad qui alias. Consequuntur error magni quod blanditiis atque dicta aut id.\n\nEt illo quia aut officia optio voluptas magni et. Deserunt quae ut et dolorum aut perspiciatis. Reprehenderit mollitia aut tenetur harum. Officiis aperiam tenetur amet.\n\nArchitecto sint iusto quasi voluptatem aperiam cumque natus officiis. In consequatur voluptas quam repudiandae mollitia. At eius aliquid optio vel.\n\nQuia voluptatem a quis eaque. At eaque quia quaerat delectus sunt quia qui voluptatibus. Nostrum ad aut reprehenderit consequatur non eligendi praesentium dolores. Voluptatem iste voluptates eaque vel accusamus autem quae et.\n\nAliquid dolores rerum dignissimos qui. Consequatur et temporibus qui blanditiis exercitationem veritatis molestias. Modi dolorem quasi voluptate sed quo illo.\n\nAb repudiandae est magni aperiam. Dolores occaecati voluptas unde est maiores. Nisi aut unde qui enim qui.\n\nDelectus quia velit consequuntur aut nihil nihil voluptas architecto. Sint perspiciatis sit molestiae et impedit. Ut id voluptates corrupti aut laborum vitae. Nulla et laboriosam et incidunt laborum voluptatem nisi.\n\nQuia aspernatur aut voluptate et eaque voluptatum ad. Debitis rerum aperiam minima repellendus assumenda est autem.\n\nAliquam dolor sapiente dolor. Amet laudantium mollitia rerum harum.\n\nIpsum esse dolore vel voluptas quia ea. Voluptatem ipsa libero ut et rem natus suscipit. Quidem in quaerat numquam cupiditate sit accusantium similique. Quas optio error qui aut reiciendis.', NULL, '2021-07-18 05:26:05', '2021-07-22 09:26:43', 3),
(20, 'Ea aut vero rem unde.', 'Et sed soluta rem id possimus nemo eos. Sed porro placeat illum inventore a nostrum quia. Nemo ex accusamus ut quisquam consectetur atque.\n\nAccusamus eos corrupti hic nihil iure. Quasi iure et aut quidem sed fugit voluptas nulla. Suscipit iusto et consectetur veritatis. Odit excepturi possimus eveniet unde ea ipsum itaque.\n\nSint amet quisquam esse et laboriosam voluptatem sunt. Deleniti debitis consequatur qui odio soluta deserunt nam. Nihil in praesentium suscipit rerum eveniet minus dolor odio. Odit aut architecto perspiciatis sed asperiores.\n\nAlias voluptatem fugiat qui facilis quis asperiores. Minus ut sunt quis aut. Magni at sapiente sequi quaerat eum nihil deleniti.\n\nOfficia enim vel animi pariatur. Consequatur velit voluptatem voluptas facere quidem sed non. Debitis aut placeat ut. Quo enim ut recusandae omnis rerum.\n\nEa repellendus quisquam soluta culpa sint. Quia molestiae et rerum delectus.\n\nMinima consequuntur provident velit. Quidem non nam consequatur consequuntur recusandae recusandae maxime et. Tempore voluptatem perspiciatis perferendis molestiae et facilis eligendi.\n\nNecessitatibus illo delectus quia minima saepe. Voluptas sit saepe recusandae unde itaque. Et laborum ad eos est inventore voluptatum harum. Atque similique vel reiciendis similique aut.\n\nQuo esse consequuntur ipsum quaerat nesciunt. Dolor amet sit accusantium qui omnis ratione voluptatibus. Esse dolorum laboriosam dolores nulla nihil asperiores tenetur.\n\nIn in repudiandae quidem. Inventore molestiae sed ipsa neque rem totam excepturi. Quod fuga quibusdam eveniet reiciendis dicta quia dolorem. Autem hic culpa cumque voluptate dicta odit qui.', NULL, '2021-05-16 02:24:05', '2021-07-22 09:26:43', 4);
-- --------------------------------------------------------
--
-- Структура таблицы `preferences`
--
CREATE TABLE `preferences` (
`id` bigint(20) UNSIGNED NOT NULL,
`description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `preferences`
--
INSERT INTO `preferences` (`id`, `description`) VALUES
(1, 'Подорожі'),
(2, 'Кіно'),
(3, 'Концерти'),
(13, 'Домашня кухня');
-- --------------------------------------------------------
--
-- Структура таблицы `roles`
--
CREATE TABLE `roles` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`display_name` varchar(255) 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;
--
-- Дамп данных таблицы `roles`
--
INSERT INTO `roles` (`id`, `name`, `display_name`, `created_at`, `updated_at`) VALUES
(1, 'admin', 'Administrator', '2021-07-06 08:28:44', '2021-07-06 08:28:44'),
(2, 'user', 'Normal User', '2021-07-06 08:28:44', '2021-07-06 08:28:44');
-- --------------------------------------------------------
--
-- Структура таблицы `rules`
--
CREATE TABLE `rules` (
`id` bigint(20) UNSIGNED NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `rules`
--
INSERT INTO `rules` (`id`, `description`) VALUES
(1, 'Побачення – незамінні для тривалих міцних стосунків! Такі маленькі паузи-втечі від реальності тільки вдвох дозволяють подивитись один на одного і на стосунки дещо по-іншому, свіжим поглядом і знову закохатись в партнера.');
-- --------------------------------------------------------
--
-- Структура таблицы `settings`
--
CREATE TABLE `settings` (
`id` int(10) UNSIGNED NOT NULL,
`key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`display_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`value` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`details` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`order` int(11) NOT NULL DEFAULT 1,
`group` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `settings`
--
INSERT INTO `settings` (`id`, `key`, `display_name`, `value`, `details`, `type`, `order`, `group`) VALUES
(1, 'site.title', 'Site Title', 'Site Title', '', 'text', 1, 'Site'),
(2, 'site.description', 'Site Description', 'Site Description', '', 'text', 2, 'Site'),
(3, 'site.logo', 'Site Logo', '', '', 'image', 3, 'Site'),
(4, 'site.google_analytics_tracking_id', 'Google Analytics Tracking ID', '', '', 'text', 4, 'Site'),
(5, 'admin.bg_image', 'Admin Background Image', '', '', 'image', 5, 'Admin'),
(6, 'admin.title', 'Admin Title', 'Voyager', '', 'text', 1, 'Admin'),
(7, 'admin.description', 'Admin Description', 'Welcome to Voyager. The Missing Admin for Laravel', '', 'text', 2, 'Admin'),
(8, 'admin.loader', 'Admin Loader', '', '', 'image', 3, 'Admin'),
(9, 'admin.icon_image', 'Admin Icon Image', '', '', 'image', 4, 'Admin'),
(10, 'admin.google_analytics_client_id', 'Google Analytics Client ID (used for admin dashboard)', '', '', 'text', 1, 'Admin');
-- --------------------------------------------------------
--
-- Структура таблицы `tasks`
--
CREATE TABLE `tasks` (
`id` bigint(20) UNSIGNED NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci NOT NULL,
`partner_description` text COLLATE utf8mb4_unicode_ci NOT NULL,
`location_type_id` bigint(20) UNSIGNED NOT NULL,
`preference_id` bigint(20) UNSIGNED NOT NULL,
`image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `tasks`
--
INSERT INTO `tasks` (`id`, `description`, `partner_description`, `location_type_id`, `preference_id`, `image`) VALUES
(1, 'Сьогодні ви будете займатися хотьбою на руках, перший раз в житті спробуєте цей дивовижний пересування, відомий людству з давніх давен.', 'Сьогодні буде дуже весело.', 3, 1, 'tasks\\July2021\\VEzIkEXFcsULPVNsKuhF.png'),
(2, 'Сьогодні ви будете готувати яєшню.', 'Сьогодні ви смачно поїсте.', 1, 13, 'tasks\\July2021\\CyNM4nNlbRWXGMhRLboN.png'),
(3, 'Сьогодні ви будете готувати торт.', 'Сьогодні ви скуштуєте щось солоденьке.', 1, 13, 'tasks\\July2021\\QLblRiCNF1EwpjkjbIa7.png');
-- --------------------------------------------------------
--
-- Структура таблицы `task_accessory`
--
CREATE TABLE `task_accessory` (
`id` bigint(20) UNSIGNED NOT NULL,
`detailed_task_id` bigint(20) UNSIGNED DEFAULT NULL,
`accessory_id` bigint(20) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `task_accessory`
--
INSERT INTO `task_accessory` (`id`, `detailed_task_id`, `accessory_id`) VALUES
(12, 20, 9);
-- --------------------------------------------------------
--
-- Структура таблицы `task_combinations`
--
CREATE TABLE `task_combinations` (
`id` bigint(20) UNSIGNED NOT NULL,
`detailed_task_id` bigint(20) UNSIGNED NOT NULL,
`partner_task_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `task_combinations`
--
INSERT INTO `task_combinations` (`id`, `detailed_task_id`, `partner_task_id`) VALUES
(14, 18, 32),
(15, 19, 33),
(16, 20, 34),
(17, 21, 35),
(18, 18, 36),
(19, 20, 37),
(20, 22, 38);
-- --------------------------------------------------------
--
-- Структура таблицы `task_rule`
--
CREATE TABLE `task_rule` (
`id` bigint(20) UNSIGNED NOT NULL,
`task_id` bigint(20) UNSIGNED NOT NULL,
`rule_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `task_rule`
--
INSERT INTO `task_rule` (`id`, `task_id`, `rule_id`) VALUES
(1, 2, 1),
(2, 1, 1),
(3, 3, 1);
-- --------------------------------------------------------
--
-- Структура таблицы `translations`
--
CREATE TABLE `translations` (
`id` int(10) UNSIGNED NOT NULL,
`table_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`column_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`foreign_key` int(10) UNSIGNED NOT NULL,
`locale` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`value` text 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;
-- --------------------------------------------------------
--
-- Структура таблицы `users`
--
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL,
`role_id` bigint(20) UNSIGNED DEFAULT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`telegram_user_id` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`avatar` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`settings` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`partner_email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`gender_id` bigint(20) UNSIGNED DEFAULT NULL,
`accept` tinyint(4) DEFAULT NULL,
`intimate` tinyint(4) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `users`
--
INSERT INTO `users` (`id`, `role_id`, `name`, `email`, `telegram_user_id`, `avatar`, `email_verified_at`, `password`, `remember_token`, `settings`, `created_at`, `updated_at`, `partner_email`, `gender_id`, `accept`, `intimate`) VALUES
(1, 1, 'admin', 'admin@admin.com', NULL, 'users/default.png', NULL, '$2y$10$vALnBdtdRR7MYVorxGGEi.NwolxJ3R3/vqYPV1xdq2SyFdeBHjDre', NULL, '{\"locale\":\"en\"}', '2021-07-06 08:30:05', '2021-07-12 11:52:52', NULL, NULL, NULL, 0),
(3, 2, 'John', 'john@laravel.test', '378686094', 'users/default.png', NULL, '$2y$10$Vh0l/JzwtwBnCDcquRcOr.zfMsVUA57ebiHe2zL6X90e9CzPdjATO', NULL, NULL, '2021-07-07 05:56:24', '2021-07-16 13:18:17', 'vyacheslav.oleshko.work@gmail.com', 1, NULL, 0),
(14, 2, 'Viacheslav', 'vyacheslav.oleshko.work@gmail.com', '378686094', 'users/ZP3ogKXFVm2PxsWiSy00XgpJTkuJqC12Gkj6TWta.png', NULL, '$2y$10$McRMdlbXwnsrCQseuaM8yuck9Sa6kARczRgd/prCEi2QG9Z3RigC.', NULL, NULL, '2021-07-07 11:46:32', '2021-08-06 08:33:32', 'john@laravel.test', 1, 1, 1),
(19, 2, 'Girl', 'girl@laravel.test', NULL, 'users/4aVbZFOMCtCPrH546gDbtlgamLtps9AbvycpSM0M.jpg', NULL, '$2y$10$XOW2AkhBgL2DEoFDo1zyeun6PYSkXPqkBU0ahWJiBFFEuGgkkhxmO', NULL, NULL, '2021-07-21 15:16:20', '2021-07-27 09:33:43', NULL, 2, NULL, 0),
(32, 2, 'BigBoy', 'boy@laravel.test', '168384665', 'users/default.png', NULL, '$2y$10$cTvrhgtontC1Dzu4D8kbh.Ai0pesS9csk31NiI6IJblCrJw1OxvEe', NULL, NULL, '2021-07-26 14:12:24', '2021-07-26 14:31:42', 'vyacheslav.oleshko.work@gmail.com', 1, NULL, 0),
(37, 2, 'test', 'test@laravel.test', NULL, NULL, NULL, '$2y$10$r1J0pNFuutTGBtqzueOs7exbCseccfZm95GbAM/sTO1020DghE8Ra', NULL, NULL, '2021-07-27 13:00:58', '2021-07-27 13:51:31', NULL, 1, 1, 0);
-- --------------------------------------------------------
--
-- Структура таблицы `user_levels`
--
CREATE TABLE `user_levels` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `user_levels`
--
INSERT INTO `user_levels` (`id`, `name`) VALUES
(1, 'Лінивий'),
(2, 'Середній'),
(3, 'Готовий двіжувати');
-- --------------------------------------------------------
--
-- Структура таблицы `user_level_stack`
--
CREATE TABLE `user_level_stack` (
`id` bigint(20) UNSIGNED NOT NULL,
`user_id` bigint(20) UNSIGNED DEFAULT NULL,
`user_level_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `user_level_stack`
--
INSERT INTO `user_level_stack` (`id`, `user_id`, `user_level_id`) VALUES
(24, 3, 1),
(25, 3, 2),
(26, 14, 3),
(29, 32, 1),
(30, 32, 3),
(35, 14, 1),
(36, 14, 2);
-- --------------------------------------------------------
--
-- Структура таблицы `user_location`
--
CREATE TABLE `user_location` (
`id` bigint(20) UNSIGNED NOT NULL,
`user_id` bigint(20) UNSIGNED DEFAULT NULL,
`location_id` bigint(20) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `user_location`
--
INSERT INTO `user_location` (`id`, `user_id`, `location_id`) VALUES
(6, 3, 2),
(7, 3, 3),
(17, 32, 2),
(18, 32, 3),
(25, 14, 2),
(26, 14, 3);
-- --------------------------------------------------------
--
-- Структура таблицы `user_preference`
--
CREATE TABLE `user_preference` (
`id` bigint(20) UNSIGNED NOT NULL,
`user_id` bigint(20) UNSIGNED DEFAULT NULL,
`preference_id` bigint(20) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Дамп данных таблицы `user_preference`
--
INSERT INTO `user_preference` (`id`, `user_id`, `preference_id`) VALUES
(72, 3, 2),
(73, 3, 3),
(74, 3, 1),
(101, 14, 1),
(102, 3, 13),
(103, 14, 13),
(106, 32, 1),
(107, 32, 13);
-- --------------------------------------------------------
--
-- Структура таблицы `user_roles`
--
CREATE TABLE `user_roles` (
`user_id` bigint(20) UNSIGNED NOT NULL,
`role_id` bigint(20) UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Индексы сохранённых таблиц
--
--
-- Индексы таблицы `accessories`
--
ALTER TABLE `accessories`
ADD PRIMARY KEY (`id`);
--
-- Индексы таблицы `categories`
--
ALTER TABLE `categories`
ADD PRIMARY KEY (`id`);
--
-- Индексы таблицы `data_rows`
--
ALTER TABLE `data_rows`
ADD PRIMARY KEY (`id`),
ADD KEY `data_rows_data_type_id_foreign` (`data_type_id`);
--
-- Индексы таблицы `data_types`
--
ALTER TABLE `data_types`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `data_types_name_unique` (`name`),
ADD UNIQUE KEY `data_types_slug_unique` (`slug`);
--
-- Индексы таблицы `detailed_tasks`
--
ALTER TABLE `detailed_tasks`
ADD PRIMARY KEY (`id`),
ADD KEY `detailed_tasks_preference_id_index` (`preference_id`) USING BTREE,
ADD KEY `detailed_tasks_location_type_id_index` (`location_type_id`) USING BTREE,
ADD KEY `detailed_tasks_gender_id_index` (`gender_id`) USING BTREE,
ADD KEY `detailed_tasks_user_level_id_index` (`user_level_id`) USING BTREE;
--
-- Индексы таблицы `detailed_task_notion`
--
ALTER TABLE `detailed_task_notion`
ADD PRIMARY KEY (`id`),
ADD KEY `detailed_task_notion_detailed_task_id_index` (`detailed_task_id`),
ADD KEY `detailed_task_notion_notion_id_index` (`notion_id`);
--
-- Индексы таблицы `failed_jobs`
--
ALTER TABLE `failed_jobs`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);
--
-- Индексы таблицы `feedback`
--
ALTER TABLE `feedback`
ADD PRIMARY KEY (`id`),
ADD KEY `feedback_user_id_index` (`user_id`),
ADD KEY `feedback_type_id_index` (`type_id`);
--
-- Индексы таблицы `feedback_types`
--
ALTER TABLE `feedback_types`
ADD PRIMARY KEY (`id`);
--
-- Индексы таблицы `genders`
--
ALTER TABLE `genders`
ADD PRIMARY KEY (`id`);
--
-- Индексы таблицы `generated_tasks`
--
ALTER TABLE `generated_tasks`
ADD PRIMARY KEY (`id`),
ADD KEY `generated_tasks_user_id_index` (`user_id`),
ADD KEY `generated_tasks_task_id_index` (`task_id`),
ADD KEY `generated_tasks_partner_task_id_index` (`partner_task_id`),
ADD KEY `generated_tasks_location_description_id_index` (`location_description_id`),
ADD KEY `generated_tasks_detailed_task_id_index` (`detailed_task_id`);
--
-- Индексы таблицы `likes`
--
ALTER TABLE `likes`
ADD PRIMARY KEY (`id`),
ADD KEY `likes_user_id_index` (`user_id`),
ADD KEY `likes_task_id_index` (`task_id`) USING BTREE;
--
-- Индексы таблицы `locations`
--
ALTER TABLE `locations`
ADD PRIMARY KEY (`id`),
ADD KEY `locations_location_type_id_index` (`location_type_id`);
--
-- Индексы таблицы `location_descriptions`
--
ALTER TABLE `location_descriptions`
ADD PRIMARY KEY (`id`),
ADD KEY `locations_description_location_id_index` (`location_id`);
--
-- Индексы таблицы `location_types`
--
ALTER TABLE `location_types`
ADD PRIMARY KEY (`id`);
--
-- Индексы таблицы `menus`
--
ALTER TABLE `menus`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `menus_name_unique` (`name`);
--
-- Индексы таблицы `menu_items`
--
ALTER TABLE `menu_items`
ADD PRIMARY KEY (`id`),
ADD KEY `menu_items_menu_id_foreign` (`menu_id`);
--
-- Индексы таблицы `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Индексы таблицы `notions`
--
ALTER TABLE `notions`
ADD PRIMARY KEY (`id`);
--
-- Индексы таблицы `partner_rules`
--
ALTER TABLE `partner_rules`
ADD PRIMARY KEY (`id`);
--
-- Индексы таблицы `partner_tasks`
--
ALTER TABLE `partner_tasks`
ADD PRIMARY KEY (`id`),
ADD KEY `partner_tasks_gender_id_index` (`gender_id`);
--
-- Индексы таблицы `partner_task_rule`
--
ALTER TABLE `partner_task_rule`
ADD PRIMARY KEY (`id`),
ADD KEY `partner_task_rule_partner_task_id_index` (`partner_task_id`),
ADD KEY `partner_task_rule_partner_rule_id_index` (`partner_rule_id`);
--
-- Индексы таблицы `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Индексы таблицы `permissions`
--
ALTER TABLE `permissions`
ADD PRIMARY KEY (`id`),
ADD KEY `permissions_key_index` (`key`);
--
-- Индексы таблицы `permission_role`
--
ALTER TABLE `permission_role`
ADD PRIMARY KEY (`permission_id`,`role_id`),
ADD KEY `permission_role_permission_id_index` (`permission_id`),
ADD KEY `permission_role_role_id_index` (`role_id`);
--
-- Индексы таблицы `posts`
--
ALTER TABLE `posts`
ADD PRIMARY KEY (`id`),
ADD KEY `posts_category_id_index` (`category_id`);
--
-- Индексы таблицы `preferences`
--
ALTER TABLE `preferences`
ADD PRIMARY KEY (`id`);
--
-- Индексы таблицы `roles`
--
ALTER TABLE `roles`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `roles_name_unique` (`name`);
--
-- Индексы таблицы `rules`
--
ALTER TABLE `rules`
ADD PRIMARY KEY (`id`);
--
-- Индексы таблицы `settings`
--
ALTER TABLE `settings`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `settings_key_unique` (`key`);
--
-- Индексы таблицы `tasks`
--
ALTER TABLE `tasks`
ADD PRIMARY KEY (`id`),
ADD KEY `tasks_location_type_id_index` (`location_type_id`),
ADD KEY `tasks_preference_id_index` (`preference_id`);
--
-- Индексы таблицы `task_accessory`
--
ALTER TABLE `task_accessory`
ADD PRIMARY KEY (`id`),
ADD KEY `task_accessory_accessory_id_index` (`accessory_id`),
ADD KEY `task_accessory_detailed_task_id_index` (`detailed_task_id`) USING BTREE;
--
-- Индексы таблицы `task_combinations`
--
ALTER TABLE `task_combinations`
ADD PRIMARY KEY (`id`),
ADD KEY `task_combinations_partner_task_id_index` (`partner_task_id`),
ADD KEY `task_combinations_detailed_task_id_index` (`detailed_task_id`) USING BTREE;
--
-- Индексы таблицы `task_rule`
--
ALTER TABLE `task_rule`
ADD PRIMARY KEY (`id`),
ADD KEY `task_rule_task_id_index` (`task_id`),
ADD KEY `task_rule_rule_id_index` (`rule_id`);
--
-- Индексы таблицы `translations`
--
ALTER TABLE `translations`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `translations_table_name_column_name_foreign_key_locale_unique` (`table_name`,`column_name`,`foreign_key`,`locale`);
--
-- Индексы таблицы `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`),
ADD KEY `users_role_id_foreign` (`role_id`),
ADD KEY `users_gender_id_index` (`gender_id`),
ADD KEY `gender_id` (`gender_id`);
--
-- Индексы таблицы `user_levels`
--
ALTER TABLE `user_levels`
ADD PRIMARY KEY (`id`);
--
-- Индексы таблицы `user_level_stack`
--
ALTER TABLE `user_level_stack`
ADD PRIMARY KEY (`id`),
ADD KEY `user_level_stack_user_id_index` (`user_id`),
ADD KEY `user_level_stack_user_level_id_index` (`user_level_id`);
--
-- Индексы таблицы `user_location`
--
ALTER TABLE `user_location`
ADD PRIMARY KEY (`id`),
ADD KEY `user_location_user_id_index` (`user_id`),
ADD KEY `user_location_location_id_index` (`location_id`);
--
-- Индексы таблицы `user_preference`
--
ALTER TABLE `user_preference`
ADD PRIMARY KEY (`id`),
ADD KEY `user_preference_user_id_index` (`user_id`),
ADD KEY `user_preference_preference_id_index` (`preference_id`);
--
-- Индексы таблицы `user_roles`
--
ALTER TABLE `user_roles`
ADD PRIMARY KEY (`user_id`,`role_id`),
ADD KEY `user_roles_user_id_index` (`user_id`),
ADD KEY `user_roles_role_id_index` (`role_id`);
--
-- AUTO_INCREMENT для сохранённых таблиц
--
--
-- AUTO_INCREMENT для таблицы `accessories`
--
ALTER TABLE `accessories`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;
--
-- AUTO_INCREMENT для таблицы `categories`
--
ALTER TABLE `categories`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT для таблицы `data_rows`
--
ALTER TABLE `data_rows`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=151;
--
-- AUTO_INCREMENT для таблицы `data_types`
--
ALTER TABLE `data_types`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;
--
-- AUTO_INCREMENT для таблицы `detailed_tasks`
--
ALTER TABLE `detailed_tasks`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;
--
-- AUTO_INCREMENT для таблицы `detailed_task_notion`
--
ALTER TABLE `detailed_task_notion`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT для таблицы `failed_jobs`
--
ALTER TABLE `failed_jobs`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT для таблицы `feedback`
--
ALTER TABLE `feedback`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT для таблицы `feedback_types`
--
ALTER TABLE `feedback_types`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT для таблицы `genders`
--
ALTER TABLE `genders`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT для таблицы `generated_tasks`
--
ALTER TABLE `generated_tasks`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=95;
--
-- AUTO_INCREMENT для таблицы `likes`
--
ALTER TABLE `likes`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT для таблицы `locations`
--
ALTER TABLE `locations`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
--
-- AUTO_INCREMENT для таблицы `location_descriptions`
--
ALTER TABLE `location_descriptions`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT для таблицы `location_types`
--
ALTER TABLE `location_types`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT для таблицы `menus`
--
ALTER TABLE `menus`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT для таблицы `menu_items`
--
ALTER TABLE `menu_items`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=39;
--
-- AUTO_INCREMENT для таблицы `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=62;
--
-- AUTO_INCREMENT для таблицы `notions`
--
ALTER TABLE `notions`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT для таблицы `partner_rules`
--
ALTER TABLE `partner_rules`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT для таблицы `partner_tasks`
--
ALTER TABLE `partner_tasks`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=39;
--
-- AUTO_INCREMENT для таблицы `partner_task_rule`
--
ALTER TABLE `partner_task_rule`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT для таблицы `permissions`
--
ALTER TABLE `permissions`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=122;
--
-- AUTO_INCREMENT для таблицы `posts`
--
ALTER TABLE `posts`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;
--
-- AUTO_INCREMENT для таблицы `preferences`
--
ALTER TABLE `preferences`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT для таблицы `roles`
--
ALTER TABLE `roles`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT для таблицы `rules`
--
ALTER TABLE `rules`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT для таблицы `settings`
--
ALTER TABLE `settings`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT для таблицы `tasks`
--
ALTER TABLE `tasks`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT для таблицы `task_accessory`
--
ALTER TABLE `task_accessory`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT для таблицы `task_combinations`
--
ALTER TABLE `task_combinations`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;
--
-- AUTO_INCREMENT для таблицы `task_rule`
--
ALTER TABLE `task_rule`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT для таблицы `translations`
--
ALTER TABLE `translations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT для таблицы `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=38;
--
-- AUTO_INCREMENT для таблицы `user_levels`
--
ALTER TABLE `user_levels`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT для таблицы `user_level_stack`
--
ALTER TABLE `user_level_stack`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=37;
--
-- AUTO_INCREMENT для таблицы `user_location`
--
ALTER TABLE `user_location`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=27;
--
-- AUTO_INCREMENT для таблицы `user_preference`
--
ALTER TABLE `user_preference`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=111;
--
-- Ограничения внешнего ключа сохраненных таблиц
--
--
-- Ограничения внешнего ключа таблицы `data_rows`
--
ALTER TABLE `data_rows`
ADD CONSTRAINT `data_rows_data_type_id_foreign` FOREIGN KEY (`data_type_id`) REFERENCES `data_types` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Ограничения внешнего ключа таблицы `detailed_tasks`
--
ALTER TABLE `detailed_tasks`
ADD CONSTRAINT `detailed_tasks_gender_id_foreign` FOREIGN KEY (`gender_id`) REFERENCES `genders` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `detailed_tasks_ibfk_1` FOREIGN KEY (`location_type_id`) REFERENCES `location_types` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `detailed_tasks_preference_id_foreign` FOREIGN KEY (`preference_id`) REFERENCES `preferences` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `detailed_tasks_user_level_id_foreign` FOREIGN KEY (`user_level_id`) REFERENCES `user_levels` (`id`) ON DELETE CASCADE;
--
-- Ограничения внешнего ключа таблицы `detailed_task_notion`
--
ALTER TABLE `detailed_task_notion`
ADD CONSTRAINT `detailed_task_notion_detailed_task_id_foreign` FOREIGN KEY (`detailed_task_id`) REFERENCES `detailed_tasks` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `detailed_task_notion_notion_id_foreign` FOREIGN KEY (`notion_id`) REFERENCES `notions` (`id`) ON DELETE CASCADE;
--
-- Ограничения внешнего ключа таблицы `feedback`
--
ALTER TABLE `feedback`
ADD CONSTRAINT `feedback_type_id_foreign` FOREIGN KEY (`type_id`) REFERENCES `feedback_types` (`id`),
ADD CONSTRAINT `feedback_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Ограничения внешнего ключа таблицы `generated_tasks`
--
ALTER TABLE `generated_tasks`
ADD CONSTRAINT `generated_tasks_ibfk_1` FOREIGN KEY (`location_description_id`) REFERENCES `location_descriptions` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `generated_tasks_ibfk_2` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `generated_tasks_ibfk_3` FOREIGN KEY (`detailed_task_id`) REFERENCES `detailed_tasks` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `generated_tasks_partner_task_id_foreign` FOREIGN KEY (`partner_task_id`) REFERENCES `task_combinations` (`partner_task_id`),
ADD CONSTRAINT `generated_tasks_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Ограничения внешнего ключа таблицы `likes`
--
ALTER TABLE `likes`
ADD CONSTRAINT `likes_ibfk_1` FOREIGN KEY (`task_id`) REFERENCES `detailed_tasks` (`id`),
ADD CONSTRAINT `likes_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
--
-- Ограничения внешнего ключа таблицы `locations`
--
ALTER TABLE `locations`
ADD CONSTRAINT `locations_ibfk_1` FOREIGN KEY (`location_type_id`) REFERENCES `location_types` (`id`) ON DELETE CASCADE;
--
-- Ограничения внешнего ключа таблицы `location_descriptions`
--
ALTER TABLE `location_descriptions`
ADD CONSTRAINT `locations_description_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `locations` (`id`) ON DELETE CASCADE;
--
-- Ограничения внешнего ключа таблицы `menu_items`
--
ALTER TABLE `menu_items`
ADD CONSTRAINT `menu_items_menu_id_foreign` FOREIGN KEY (`menu_id`) REFERENCES `menus` (`id`) ON DELETE CASCADE;
--
-- Ограничения внешнего ключа таблицы `partner_tasks`
--
ALTER TABLE `partner_tasks`
ADD CONSTRAINT `partner_tasks_ibfk_1` FOREIGN KEY (`gender_id`) REFERENCES `genders` (`id`) ON DELETE CASCADE;
--
-- Ограничения внешнего ключа таблицы `partner_task_rule`
--
ALTER TABLE `partner_task_rule`
ADD CONSTRAINT `partner_task_rule_partner_rule_id_foreign` FOREIGN KEY (`partner_rule_id`) REFERENCES `partner_rules` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `partner_task_rule_partner_task_id_foreign` FOREIGN KEY (`partner_task_id`) REFERENCES `partner_tasks` (`id`) ON DELETE CASCADE;
--
-- Ограничения внешнего ключа таблицы `permission_role`
--
ALTER TABLE `permission_role`
ADD CONSTRAINT `permission_role_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `permission_role_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;
--
-- Ограничения внешнего ключа таблицы `posts`
--
ALTER TABLE `posts`
ADD CONSTRAINT `posts_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE;
--
-- Ограничения внешнего ключа таблицы `tasks`
--
ALTER TABLE `tasks`
ADD CONSTRAINT `tasks_location_type_id_foreign` FOREIGN KEY (`location_type_id`) REFERENCES `location_types` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `tasks_preference_id_foreign` FOREIGN KEY (`preference_id`) REFERENCES `preferences` (`id`) ON DELETE CASCADE;
--
-- Ограничения внешнего ключа таблицы `task_accessory`
--
ALTER TABLE `task_accessory`
ADD CONSTRAINT `task_accessory_accessory_id_foreign` FOREIGN KEY (`accessory_id`) REFERENCES `accessories` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `task_accessory_task_id_foreign` FOREIGN KEY (`detailed_task_id`) REFERENCES `detailed_tasks` (`id`) ON DELETE CASCADE;
--
-- Ограничения внешнего ключа таблицы `task_combinations`
--
ALTER TABLE `task_combinations`
ADD CONSTRAINT `task_combinations_partner_task_id_foreign` FOREIGN KEY (`partner_task_id`) REFERENCES `partner_tasks` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `task_combinations_task_id_foreign` FOREIGN KEY (`detailed_task_id`) REFERENCES `detailed_tasks` (`id`) ON DELETE CASCADE;
--
-- Ограничения внешнего ключа таблицы `task_rule`
--
ALTER TABLE `task_rule`
ADD CONSTRAINT `task_rule_rule_id_foreign` FOREIGN KEY (`rule_id`) REFERENCES `rules` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `task_rule_task_id_foreign` FOREIGN KEY (`task_id`) REFERENCES `tasks` (`id`) ON DELETE CASCADE;
--
-- Ограничения внешнего ключа таблицы `users`
--
ALTER TABLE `users`
ADD CONSTRAINT `users_gender_id_foreign` FOREIGN KEY (`gender_id`) REFERENCES `genders` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `users_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`);
--
-- Ограничения внешнего ключа таблицы `user_level_stack`
--
ALTER TABLE `user_level_stack`
ADD CONSTRAINT `user_level_stack_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `user_level_stack_user_level_id_foreign` FOREIGN KEY (`user_level_id`) REFERENCES `user_levels` (`id`) ON DELETE CASCADE;
--
-- Ограничения внешнего ключа таблицы `user_location`
--
ALTER TABLE `user_location`
ADD CONSTRAINT `user_location_location_id_foreign` FOREIGN KEY (`location_id`) REFERENCES `locations` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `user_location_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Ограничения внешнего ключа таблицы `user_preference`
--
ALTER TABLE `user_preference`
ADD CONSTRAINT `user_preference_preference_id_foreign` FOREIGN KEY (`preference_id`) REFERENCES `preferences` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `user_preference_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Ограничения внешнего ключа таблицы `user_roles`
--
ALTER TABLE `user_roles`
ADD CONSTRAINT `user_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `user_roles_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| 61.278877 | 1,983 | 0.696693 |
277f76c50ab7b940a0f7d5a1174e762391270a23 | 6,488 | css | CSS | assets/styles/global/color.css | ilikescience/moxy | 2c94df187f3454c1bcb50eb00ff578c4d31055ed | [
"MIT"
] | null | null | null | assets/styles/global/color.css | ilikescience/moxy | 2c94df187f3454c1bcb50eb00ff578c4d31055ed | [
"MIT"
] | null | null | null | assets/styles/global/color.css | ilikescience/moxy | 2c94df187f3454c1bcb50eb00ff578c4d31055ed | [
"MIT"
] | null | null | null | :root {
/* black and white */
--c--black: hsl(0, 0%, 15%);
--c--white: hsl(0, 0%, 100%);
/* gray */
--c--gray: hsl(210, 7%, 50%);
/* colors */
--c--blue: hsl(208, 80%, 50%);
--c--green: hsl(131, 50%, 50%);
--c--yellow: hsl(52, 100%, 50%);
--c--orange: hsl(28, 100%, 50%);
--c--red: hsl(0, 100%, 50%);
--c--purple: hsl(276, 75%, 50%);
/* variants: gray */
--c--gray-lighter: color(var(--c--gray) l(90%));
--c--gray-light: color(var(--c--gray) l(70%));
--c--gray-dark: color(var(--c--gray) l(35%));
--c--gray-darker: color(var(--c--gray) l(20%));
/* variants: blue */
--c--blue-lighter: color(var(--c--blue) l(80%));
--c--blue-light: color(var(--c--blue) l(65%));
--c--blue-dark: color(var(--c--blue) l(35%));
--c--blue-darker: color(var(--c--blue) l(20%));
/* variants: green */
--c--green-lighter: color(var(--c--green) l(80%));
--c--green-light: color(var(--c--green) l(65%));
--c--green-dark: color(var(--c--green) l(35%));
--c--green-darker: color(var(--c--green) l(20%));
/* variants: yellow */
--c--yellow-lighter: color(var(--c--yellow) l(80%));
--c--yellow-light: color(var(--c--yellow) l(65%));
--c--yellow-dark: color(var(--c--yellow) l(35%));
--c--yellow-darker: color(var(--c--yellow) l(20%));
/* variants: orange */
--c--orange-lighter: color(var(--c--orange) l(80%));
--c--orange-light: color(var(--c--orange) l(65%));
--c--orange-dark: color(var(--c--orange) l(35%));
--c--orange-darker: color(var(--c--orange) l(20%));
/* variants: red */
--c--red-lighter: color(var(--c--red) l(80%));
--c--red-light: color(var(--c--red) l(65%));
--c--red-dark: color(var(--c--red) l(35%));
--c--red-darker: color(var(--c--red) l(20%));
/* variants: purple */
--c--purple-lighter: color(var(--c--purple) l(80%));
--c--purple-light: color(var(--c--purple) l(65%));
--c--purple-dark: color(var(--c--purple) l(35%));
--c--purple-darker: color(var(--c--purple) l(20%));
}
/* color utilities */
.c--black { color: var(--c--black); }
.c--white { color: var(--c--white); }
.c--gray { color: var(--c--gray); }
.c--blue { color: var(--c--blue); }
.c--green { color: var(--c--green); }
.c--yellow { color: var(--c--yellow); }
.c--orange { color: var(--c--orange); }
.c--red { color: var(--c--red); }
.c--purple { color: var(--c--purple); }
/* color variant utilities: gray */
.c--gray-lighter { color: var(--c--gray-lighter); }
.c--gray-light { color: var(--c--gray-light); }
.c--gray-dark { color: var(--c--gray-dark); }
.c--gray-darker { color: var(--c--gray-darker); }
/* color variant utilities: blue */
.c--blue-lighter { color: var(--c--blue-lighter); }
.c--blue-light { color: var(--c--blue-light); }
.c--blue-dark { color: var(--c--blue-dark); }
.c--blue-darker { color: var(--c--blue-darker); }
/* color variant utilities: green */
.c--green-lighter { color: var(--c--green-lighter); }
.c--green-light { color: var(--c--green-light); }
.c--green-dark { color: var(--c--green-dark); }
.c--green-darker { color: var(--c--green-darker); }
/* color variant utilities: yellow */
.c--yellow-lighter { color: var(--c--yellow-lighter); }
.c--yellow-light { color: var(--c--yellow-light); }
.c--yellow-dark { color: var(--c--yellow-dark); }
.c--yellow-darker { color: var(--c--yellow-darker); }
/* color variant utilities: orange */
.c--orange-lighter { color: var(--c--orange-lighter); }
.c--orange-light { color: var(--c--orange-light); }
.c--orange-dark { color: var(--c--orange-dark); }
.c--orange-darker { color: var(--c--orange-darker); }
/* color variant utilities: red */
.c--red-lighter { color: var(--c--red-lighter); }
.c--red-light { color: var(--c--red-light); }
.c--red-dark { color: var(--c--red-dark); }
.c--red-darker { color: var(--c--red-darker); }
/* color variant utilities: purple */
.c--purple-lighter { color: var(--c--purple-lighter); }
.c--purple-light { color: var(--c--purple-light); }
.c--purple-dark { color: var(--c--purple-dark); }
.c--purple-darker { color: var(--c--purple-darker); }
/* background color utilities */
.c--bg-black { background: var(--c--black); }
.c--bg-white { background: var(--c--white); }
.c--bg-gray { background: var(--c--gray); }
.c--bg-blue { background: var(--c--blue); }
.c--bg-green { background: var(--c--green); }
.c--bg-yellow { background: var(--c--yellow); }
.c--bg-orange { background: var(--c--orange); }
.c--bg-red { background: var(--c--red); }
.c--bg-purple { background: var(--c--purple); }
/* background color utilities: gray */
.c--bg-gray-lighter { background: var(--c--gray-lighter); }
.c--bg-gray-light { background: var(--c--gray-light); }
.c--bg-gray-dark { background: var(--c--gray-dark); }
.c--bg-gray-darker { background: var(--c--gray-darker); }
/* background color utilities: blue */
.c--bg-blue-lighter { background: var(--c--blue-lighter); }
.c--bg-blue-light { background: var(--c--blue-light); }
.c--bg-blue-dark { background: var(--c--blue-dark); }
.c--bg-blue-darker { background: var(--c--blue-darker); }
/* background color utilities: green */
.c--bg-green-lighter { background: var(--c--green-lighter); }
.c--bg-green-light { background: var(--c--green-light); }
.c--bg-green-dark { background: var(--c--green-dark); }
.c--bg-green-darker { background: var(--c--green-darker); }
/* background color utilities: yellow */
.c--bg-yellow-lighter { background: var(--c--yellow-lighter); }
.c--bg-yellow-light { background: var(--c--yellow-light); }
.c--bg-yellow-dark { background: var(--c--yellow-dark); }
.c--bg-yellow-darker { background: var(--c--yellow-darker); }
/* background color utilities: orange */
.c--bg-orange-lighter { background: var(--c--orange-lighter); }
.c--bg-orange-light { background: var(--c--orange-light); }
.c--bg-orange-dark { background: var(--c--orange-dark); }
.c--bg-orange-darker { background: var(--c--orange-darker); }
/* background color utilities: red */
.c--bg-red-lighter { background: var(--c--red-lighter); }
.c--bg-red-light { background: var(--c--red-light); }
.c--bg-red-dark { background: var(--c--red-dark); }
.c--bg-red-darker { background: var(--c--red-darker); }
/* background color utilities: purple */
.c--bg-purple-lighter { background: var(--c--purple-lighter); }
.c--bg-purple-light { background: var(--c--purple-light); }
.c--bg-purple-dark { background: var(--c--purple-dark); }
.c--bg-purple-darker { background: var(--c--purple-darker); }
| 39.321212 | 63 | 0.585543 |
5f1950ac49eb7dc7c7f413783d41ff4050b292f6 | 529 | ts | TypeScript | backend/src/utils/constants.ts | f1lander/prieto-chat | 72c66988ab889e32015e56a22f3b915334407461 | [
"MIT"
] | null | null | null | backend/src/utils/constants.ts | f1lander/prieto-chat | 72c66988ab889e32015e56a22f3b915334407461 | [
"MIT"
] | 8 | 2019-09-15T00:37:01.000Z | 2022-02-26T17:50:50.000Z | backend/src/utils/constants.ts | f1lander/prieto-chat | 72c66988ab889e32015e56a22f3b915334407461 | [
"MIT"
] | 1 | 2020-07-27T01:24:49.000Z | 2020-07-27T01:24:49.000Z | import { ChatMessage } from "./types";
export enum ChatEvent {
CONNECT = "connect",
DISCONNECT = "disconnect",
MESSAGE = "message"
}
export const PRIETO_BOOT_DEFAULT: ChatMessage = {
author: "Prieto Stooq-Bot🤖",
message:
"I can't understand this command, please try something like /stock_quote=<stock_code>",
timestamp: new Date()
};
export const PRIETO_BOOT_BAD_REQUEST: ChatMessage = {
author: "Prieto Stooq-Bot🤖",
message: "Something get wrong with the request 🤔, try again",
timestamp: new Date()
};
| 25.190476 | 91 | 0.705104 |
9a505692489d8e9c3c14c0bbf610f1927f995e1c | 479 | lua | Lua | src/curses.lua | Barocena/unotfm | cf0e59eb08a04818a8bd3d838b04b06378aa6fb6 | [
"MIT"
] | 4 | 2020-07-08T20:04:29.000Z | 2022-02-13T14:19:14.000Z | src/curses.lua | Barocena/unotfm | cf0e59eb08a04818a8bd3d838b04b06378aa6fb6 | [
"MIT"
] | null | null | null | src/curses.lua | Barocena/unotfm | cf0e59eb08a04818a8bd3d838b04b06378aa6fb6 | [
"MIT"
] | 4 | 2021-07-22T05:04:43.000Z | 2022-01-21T20:13:16.000Z | CURSE = {
anvil = {
img = "162598dff2b.png",
desc = "CURSE_ANVIL",
turns = 4,
},
ice = {
img = "162598de0d7.png",
desc = "CURSE_ICE",
turns = 3,
},
shoe = {
img = "162598dc59c.png",
desc = "CURSE_SHOE",
turns = 3,
},
thorn = {
img = "162598d992f.png",
desc = "CURSE_THORN",
turns = 1,
},
time = {
img = "162598d7b11.png",
desc = "CURSE_TIME",
turns = 4,
},
poison = {
img = "162598d5ad2.png",
desc = "CURSE_POISON",
turns = 2,
},
} | 14.96875 | 26 | 0.536534 |
c1454ea89bac70de95d22b1b57bf081a9f875670 | 1,148 | rs | Rust | network/src/constants.rs | zekun000/aptos-core | 4fac00575269ce5b77ab6a18ac0a5f75abfe153d | [
"Apache-2.0"
] | 350 | 2022-03-15T14:13:08.000Z | 2022-03-31T14:12:19.000Z | network/src/constants.rs | zekun000/aptos-core | 4fac00575269ce5b77ab6a18ac0a5f75abfe153d | [
"Apache-2.0"
] | 179 | 2022-03-15T15:36:02.000Z | 2022-03-31T23:53:51.000Z | network/src/constants.rs | zekun000/aptos-core | 4fac00575269ce5b77ab6a18ac0a5f75abfe153d | [
"Apache-2.0"
] | 104 | 2022-03-15T13:53:52.000Z | 2022-03-31T05:54:06.000Z | // Copyright (c) Aptos
// SPDX-License-Identifier: Apache-2.0
/// A collection of constants and default values for configuring various network components.
// NB: Almost all of these values are educated guesses, and not determined using any empirical
// data. If you run into a limit and believe that it is unreasonably tight, please submit a PR
// with your use-case. If you do change a value, please add a comment linking to the PR which
// advocated the change.
/// The timeout for any inbound RPC call before it's cut off
pub const INBOUND_RPC_TIMEOUT_MS: u64 = 10_000;
/// Limit on concurrent Outbound RPC requests before backpressure is applied
pub const MAX_CONCURRENT_OUTBOUND_RPCS: u32 = 100;
/// Limit on concurrent Inbound RPC requests before backpressure is applied
pub const MAX_CONCURRENT_INBOUND_RPCS: u32 = 100;
// These are only used in tests
// TODO: Fix this so the tests and the defaults in config are the same
pub const NETWORK_CHANNEL_SIZE: usize = 1024;
pub const MAX_FRAME_SIZE: usize = 8 * 1024 * 1024; /* 8 MiB */
pub const MAX_CONCURRENT_NETWORK_REQS: usize = 100;
pub const MAX_CONCURRENT_NETWORK_NOTIFS: usize = 100;
| 49.913043 | 94 | 0.773519 |
41145f1872e9e42e83bd02327debd3b3f81b062c | 455 | h | C | YLCleaner/Xcode-RuntimeHeaders/DevToolsCore/XCRoots.h | liyong03/YLCleaner | 7453187a884c8e783bda1af82cbbb51655ec41c6 | [
"MIT"
] | 1 | 2019-02-15T02:16:35.000Z | 2019-02-15T02:16:35.000Z | YLCleaner/Xcode-RuntimeHeaders/DevToolsCore/XCRoots.h | liyong03/YLCleaner | 7453187a884c8e783bda1af82cbbb51655ec41c6 | [
"MIT"
] | null | null | null | YLCleaner/Xcode-RuntimeHeaders/DevToolsCore/XCRoots.h | liyong03/YLCleaner | 7453187a884c8e783bda1af82cbbb51655ec41c6 | [
"MIT"
] | null | null | null | /*
* Generated by class-dump 3.3.4 (64 bit).
*
* class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2011 by Steve Nygard.
*/
#import "NSObject.h"
@class NSMutableArray, PBXProject;
@interface XCRoots : NSObject
{
PBXProject *_project;
NSMutableArray *_roots;
}
- (id)absolutePathForRoot:(id)arg1;
- (id)description;
- (void)setRoots:(id)arg1;
- (id)roots;
- (void)dealloc;
- (id)initWithArray:(id)arg1 project:(id)arg2;
@end
| 17.5 | 83 | 0.67033 |
a0980e28ce481a9d181a3309c623e64bb09f4d53 | 579 | sql | SQL | bp2/predavanja/pred14_q13_spoljni_kljuc.sql | jasarsoft/fit-src | d9b963be3afbd4494de9d0289c947b0a41ad91d7 | [
"MIT"
] | null | null | null | bp2/predavanja/pred14_q13_spoljni_kljuc.sql | jasarsoft/fit-src | d9b963be3afbd4494de9d0289c947b0a41ad91d7 | [
"MIT"
] | null | null | null | bp2/predavanja/pred14_q13_spoljni_kljuc.sql | jasarsoft/fit-src | d9b963be3afbd4494de9d0289c947b0a41ad91d7 | [
"MIT"
] | null | null | null | --ogranicanja
--foreign key
--spoljni kljuc
USE TestDB;
CREATE TABLE Gradovi
( GradID int IDENTITY(1,1) CONSTRAINT PK_Grad PRIMARY KEY,
Naziv varchar(30) NOT NULL
);
CREATE TABLE Kupci
( KupacID int IDENTITY(1,1) CONSTRAINT PK_Kupac PRIMARY KEY,
Prezime nvarchar(30) NOT NULL,
Ime nvarchar(30) NOT NULL,
Telefon nvarchar(30) NULL,
Email nvarchar(30) NOT NULL CONSTRAINT UQ_Email UNIQUE,
DatumRodjenja date NOT NULL,
GradID int NOT NULL CONSTRAINT FK_KupacGrad FOREIGN KEY REFERENCES Gradovi(GradID),
GodinaRodjenja AS DATEPART(YEAR, DatumRodjenja) PERSISTED
); | 27.571429 | 85 | 0.772021 |
3b740612f3a4fe97f675b53cab8227ad581b038c | 748 | h | C | Qlink/Vender/NEO/JS/NEOJSView.h | QlcChainOrg/winq-ios | 21dc93068e2f4bfe14b1fa65a398a049782894c5 | [
"MIT"
] | 8 | 2018-07-11T12:31:20.000Z | 2019-08-14T03:38:45.000Z | Qlink/Vender/NEO/JS/NEOJSView.h | QlcChainOrg/winq-ios | 21dc93068e2f4bfe14b1fa65a398a049782894c5 | [
"MIT"
] | 65 | 2020-03-29T08:17:07.000Z | 2021-01-14T22:41:10.000Z | Qlink/Vender/NEO/JS/NEOJSView.h | QlcChainOrg/winq-ios | 21dc93068e2f4bfe14b1fa65a398a049782894c5 | [
"MIT"
] | 9 | 2018-07-11T10:37:19.000Z | 2019-08-03T10:33:14.000Z | //
// QContractView.h
// Qlink
//
// Created by Jelly Foo on 2019/9/4.
// Copyright © 2019 pan. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef void(^NEOJSResultBlock)(id _Nullable result, BOOL success, NSString * _Nullable message);
@interface NEOJSView : UIView
+ (NEOJSView *)add;
- (void)remove;
- (void)config;
- (void)neoTransferWithFromAddress:(NSString *)fromAddress toAddress:(NSString *)toAddress assetHash:(NSString *)assetHash amount:(NSString *)amount numOfDecimals:(NSString *)numOfDecimals wif:(NSString *)wif resultHandler:(NEOJSResultBlock)resultHandler;
- (void)claimgasWithPrivateKey:(NSString *)privateKey resultHandler:(NEOJSResultBlock)resultHandler;
@end
NS_ASSUME_NONNULL_END
| 24.933333 | 255 | 0.766043 |
cabcd5764da9b9df35249dd4e1e1b5c4dea420b5 | 4,332 | lua | Lua | rz/mods/JingCai.lua | DnoYT/Gteam | 00b3b673232fbd07637ff6530aaa4ee2933d9be0 | [
"Apache-2.0"
] | 1 | 2022-03-18T20:07:21.000Z | 2022-03-18T20:07:21.000Z | rz/mods/JingCai.lua | DnoYT/Gteam | 00b3b673232fbd07637ff6530aaa4ee2933d9be0 | [
"Apache-2.0"
] | null | null | null | rz/mods/JingCai.lua | DnoYT/Gteam | 00b3b673232fbd07637ff6530aaa4ee2933d9be0 | [
"Apache-2.0"
] | null | null | null | function 控件圆角(view,左上,右上,左下,右下,InsideColor)
import "android.graphics.drawable.GradientDrawable"
drawable = GradientDrawable()
drawable.setShape(GradientDrawable.RECTANGLE)
drawable.setColor(InsideColor)
drawable.setCornerRadii({左上,左上,右上,右上,左下,左下,右下,右下});
view.setBackgroundDrawable(drawable)
end
function 沉浸(col)
--activity.supportActionBar.hide()
activity.overridePendingTransition(android.R.anim.fade_in,android.R.anim.fade_out)
activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
--View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS).setStatusBarColor(col);
end
function 沉浸二(col)
--activity.supportActionBar.hide()
activity.overridePendingTransition(android.R.anim.fade_in,android.R.anim.fade_out)
activity.getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR);
activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS).setStatusBarColor(col);
end
function 状态栏高度()
local h=activity.getResources().getDimensionPixelSize(luajava.bindClass("com.android.internal.R$dimen")().status_bar_height)
return h
end
function 导航栏高度()
local h=activity.getResources().getDimensionPixelSize(luajava.bindClass("com.android.internal.R$dimen")().navigation_bar_height)
return h
end
function 波纹(控件,颜色)
RippleHelper(控件).RippleColor=颜色
end
function 旋转动画(控件,a,b,c,d,时间)
import "android.animation.ObjectAnimator"
ObjectAnimator().ofFloat(控件,"rotation",{a,b,c,d}).setDuration(时间).start()
end
function 水珠动画(控件,时间)
import "android.animation.ObjectAnimator"
ObjectAnimator().ofFloat(控件,"scaleX",{1,.8,1.3,.9,1}).setDuration(时间).start()
ObjectAnimator().ofFloat(控件,"scaleY",{1,.8,1.3,.9,1}).setDuration(时间).start()
end
function 底部会员提示(内容,颜色,文字颜色)
local 布局=loadlayout({
FrameLayout;
layout_height="fill";
layout_width="wrap_content";
{
LinearLayout;
layout_height="34dp";
layout_width="wrap_content";
layout_gravity="center";
orientation="horizontal";
{
CardView;
layout_height="fill";
layout_width="wrap_content";
radius="3dp";
elevation="0dp";
CardBackgroundColor=颜色;
{
TextView;
id="toast_text";
textSize="11dp";
textColor=文字颜色;
layout_height="fill";
layout_width="wrap_content";
layout_marginLeft="15dp";
layout_marginRight="15dp";
gravity="center";
}
};
}
})
local toast=Toast.makeText(activity,nil,Toast.LENGTH_LONG).setView(布局).show()
toast_text.setText(内容)
end
function 加载图标(icoid)
IcoObj={}
IcoNme={}
IcoImg={}
--阿里图标库API地址
url="https://www.iconfont.cn/api/collection/detail.json"
--post传入数据
if icoid=="" then
data="?id=16213&t=1557707700703&ctoken=XKY6LDqlWlOHDv8g5bBDO-S9"
--16213
else
data="?id="..icoid.."&t=1557707700703&ctoken=XKY6LDqlWlOHDv8g5bBDO-S9"--"&sortType=updated_at&page=1&pageSize=0&fromCollection=1&fills=null&ctoken=sh6GKQur-48KjRv0-IDssPrQ"
end
--阿里图标库所需header,用于验证用户身份
header={["Cookie"]="ctoken=XKY6LDqlWlOHDv8g5bBDO-S9"}
--异步加载:目的获得图标最大数量
Http.get(url..data,cookie,"utf-8",header,function(code,content,cookie,header)
if code==200 then
cjson=import "cjson"
json=cjson.decode(content)
--图标数量
icoCount=json["data"]["collection"]["icons_count"]
底部会员提示("今日为您推荐"..tointeger(icoCount).."个图标",0xFF4C21AF,0xffffffff)
if icoCount>=52 then
for i=1,icoCount do
SvgJsonStr=json["data"]["icons"][i]["show_svg"]
SvgJsonName=json["data"]["icons"][i]["name"]
table.insert(IcoImg,SvgJsonStr)
SvgJsonStr=SVG.getFromString(tostring(SvgJsonStr))
table.insert(IcoObj,SvgJsonStr)
table.insert(IcoNme,SvgJsonName)
end
for i=1,200 do
--给GridView添加内容
a={
SVG=IcoObj[i],
}
adapter2.add{item_img=a,item_name=IcoNme[i]}
end
else
print("好几页页图标")
end
else
底部会员提示("链接服务器失败",0xFF4C21AF,0xffffffff)
end
end)
end | 26.254545 | 176 | 0.689751 |
d01ee6ee09a07440bd8d63fc2855645b4ecb62ad | 185 | rb | Ruby | lib/active_service.rb | chloerei/activeservice | 7c844de7d560e3e8d587f38b310052e94825f385 | [
"MIT"
] | 67 | 2015-03-22T09:17:04.000Z | 2022-01-22T07:10:06.000Z | lib/active_service.rb | chloerei/activeservice | 7c844de7d560e3e8d587f38b310052e94825f385 | [
"MIT"
] | 2 | 2015-03-23T02:15:18.000Z | 2018-03-14T00:37:00.000Z | lib/active_service.rb | chloerei/activeservice | 7c844de7d560e3e8d587f38b310052e94825f385 | [
"MIT"
] | 9 | 2015-03-22T10:26:41.000Z | 2019-05-30T11:44:45.000Z | require "active_service/version"
require "active_service/base"
if defined?(Rails)
require "active_service/test_case"
require "active_service/railtie"
end
module ActiveService
end
| 16.818182 | 36 | 0.810811 |
48f2ff77a938c6df5eb152055e754cd41e58e436 | 12,345 | c | C | examples/axis_remap/axis_remap.c | IvanoBono/BMI090L-Sensor-API | f0e1c9197857a8fbe468149f813cefd1fef07740 | [
"BSD-3-Clause"
] | 6 | 2020-09-30T12:28:34.000Z | 2021-12-16T19:15:34.000Z | examples/axis_remap/axis_remap.c | IvanoBono/BMI090L-Sensor-API | f0e1c9197857a8fbe468149f813cefd1fef07740 | [
"BSD-3-Clause"
] | 3 | 2020-07-03T06:15:22.000Z | 2022-03-23T08:57:51.000Z | examples/axis_remap/axis_remap.c | IvanoBono/BMI090L-Sensor-API | f0e1c9197857a8fbe468149f813cefd1fef07740 | [
"BSD-3-Clause"
] | 2 | 2020-07-03T05:17:51.000Z | 2022-01-11T08:33:01.000Z | /**
* Copyright (C) 2021 Bosch Sensortec GmbH
*
* SPDX-License-Identifier: BSD-3-Clause
*
* @file axis_remap.c
* @brief Test code to demonstrate on axis remap feature
*
*/
#include <stdio.h>
#include <stdlib.h>
#include "bmi090l.h"
#include "common.h"
/*********************************************************************/
/* Function Declarations */
/*********************************************************************/
/*!
* @brief This internal API is used to initialize the bmi090l sensor
*/
static void init_bmi090l(struct bmi090l_dev *bmi090ldev);
/*!
* @brief This internal API is used to configure accel and gyro data ready interrupts
*/
static void configure_accel_data_ready_interrupts(struct bmi090l_dev *bmi090ldev);
/*********************************************************************/
/* Functions */
/*********************************************************************/
/*!
* @brief This internal API is used to initializes the bmi090l sensor
*
* @param[in] void
*
* @return void
*
*/
static void init_bmi090l(struct bmi090l_dev *bmi090ldev)
{
int8_t rslt = BMI090L_OK;
/* Initialize bmi090l sensors (accel & gyro)*/
if (bmi090la_init(bmi090ldev) == BMI090L_OK && bmi090lg_init(bmi090ldev) == BMI090L_OK)
{
printf("BMI090L initialization success!\n");
printf("Accel chip ID - 0x%x\n", bmi090ldev->accel_chip_id);
printf("Gyro chip ID - 0x%x\n", bmi090ldev->gyro_chip_id);
/* Reset the accelerometer */
rslt = bmi090la_soft_reset(bmi090ldev);
}
else
{
printf("BMI090L initialization failure!\n");
exit(COINES_E_FAILURE);
}
/*! Max read/write length (maximum supported length is 32).
* To be set by the user */
bmi090ldev->read_write_len = 32;
/* Set accel power mode */
bmi090ldev->accel_cfg.power = BMI090L_ACCEL_PM_ACTIVE;
rslt = bmi090la_set_power_mode(bmi090ldev);
if (rslt == BMI090L_OK)
{
bmi090ldev->gyro_cfg.power = BMI090L_GYRO_PM_NORMAL;
bmi090lg_set_power_mode(bmi090ldev);
}
printf("Uploading config file !\n");
rslt = bmi090la_apply_config_file(bmi090ldev);
/* API uploads the bmi090l config file onto the device */
if (rslt == BMI090L_OK)
{
printf("Upload done !\n");
if (rslt == BMI090L_OK)
{
bmi090ldev->accel_cfg.bw = BMI090L_ACCEL_BW_NORMAL;
bmi090ldev->accel_cfg.odr = BMI090L_ACCEL_ODR_200_HZ;
bmi090ldev->accel_cfg.range = BMI090L_ACCEL_RANGE_3G;
bmi090la_set_meas_conf(bmi090ldev);
}
}
}
static void configure_accel_data_ready_interrupts(struct bmi090l_dev *bmi090ldev)
{
int8_t rslt;
struct bmi090l_accel_int_channel_cfg accel_int_config;
/* Configure the Interrupt configurations for accel */
accel_int_config.int_channel = BMI090L_INT_CHANNEL_1;
accel_int_config.int_type = BMI090L_ACCEL_DATA_RDY_INT;
accel_int_config.int_pin_cfg.lvl = BMI090L_INT_ACTIVE_HIGH;
accel_int_config.int_pin_cfg.output_mode = BMI090L_INT_MODE_PUSH_PULL;
accel_int_config.int_pin_cfg.enable_int_pin = BMI090L_ENABLE;
/* Set the interrupt configuration */
rslt = bmi090la_set_int_config(&accel_int_config, bmi090ldev);
if (rslt != BMI090L_OK)
{
printf("Failure in interrupt configurations \n");
exit(COINES_E_FAILURE);
}
}
/*!
* @brief Main Function where the execution getting started to test the code.
*
* @param[in] argc
* @param[in] argv
*
* @return status
*
*/
int main(int argc, char *argv[])
{
int8_t rslt = BMI090L_OK;
struct bmi090l_dev bmi090l;
uint8_t status = 0;
struct bmi090l_remap remap_data = { 0 };
struct bmi090l_sensor_data accel;
char data_array[13][14] =
{ { 0 }, { "BMI090L_X" }, { "BMI090L_Y" }, { 0 }, { "BMI090L_Z" }, { 0 }, { 0 }, { 0 }, { 0 }, { "BMI090L_NEG_X" },
{ "BMI090L_NEG_Y" }, { 0 }, { "BMI090L_NEG_Z" } };
/* Interface reference is given as a parameter
* For I2C : BMI090L_I2C_INTF
* For SPI : BMI090L_SPI_INTF
*/
rslt = bmi090l_interface_init(&bmi090l, BMI090L_I2C_INTF);
bmi090l_check_rslt("bmi090l_interface_init", rslt);
/* Initialize the sensors */
init_bmi090l(&bmi090l);
configure_accel_data_ready_interrupts(&bmi090l);
printf("\nAXIS_REMAP_FUNC_TEST 1\n");
printf("Get sensor data of re-mapped axes\n");
rslt = bmi090la_get_remap_axes(&remap_data, &bmi090l);
bmi090l_check_rslt("bmi090la_get_remap_axes", rslt);
printf("Re-mapped x value = %s\n", data_array[remap_data.x]);
printf("Re-mapped y value = %s\n", data_array[remap_data.y]);
printf("Re-mapped z value = %s\n", data_array[remap_data.z]);
printf("Expected Re-mapped x value = BMI090L_X\n");
printf("Expected Re-mapped y value = BMI090L_Y\n");
printf("Expected Re-mapped z value = BMI090L_Z\n");
if ((remap_data.x == BMI090L_X) && (remap_data.y == BMI090L_Y) && (remap_data.z == BMI090L_Z))
{
printf(">> PASS\n");
}
else
{
printf(">> FAIL\n");
}
printf("Print mapped data\n");
while (1)
{
/* Read accel data ready interrupt status */
rslt = bmi090la_get_data_int_status(&status, &bmi090l);
if (status & BMI090L_ACCEL_DATA_READY_INT)
{
rslt = bmi090la_get_data(&accel, &bmi090l);
bmi090l_check_rslt("bmi090la_get_data", rslt);
printf("Accel :: X = %d Y = %d Z = %d\n", accel.x, accel.y, accel.z);
break;
}
}
printf("\nAXIS_REMAP_FUNC_TEST 2\n");
printf("Get sensor data of re-mapped axes\n");
remap_data.x = BMI090L_NEG_Y;
remap_data.y = BMI090L_Z;
remap_data.z = BMI090L_NEG_X;
rslt = bmi090la_set_remap_axes(&remap_data, &bmi090l);
bmi090l_check_rslt("bmi090la_set_remap_axes", rslt);
if (rslt == BMI090L_OK)
{
rslt = bmi090la_get_remap_axes(&remap_data, &bmi090l);
bmi090l_check_rslt("bmi090la_get_remap_axes", rslt);
if (rslt == BMI090L_OK)
{
printf("Re-mapped x value = %s\n", data_array[remap_data.x]);
printf("Re-mapped y value = %s\n", data_array[remap_data.y]);
printf("Re-mapped z value = %s\n", data_array[remap_data.z]);
}
printf("Expected Re-mapped x value = BMI090L_NEG_Y\n");
printf("Expected Re-mapped y value = BMI090L_Z\n");
printf("Expected Re-mapped z value = BMI090L_NEG_X\n");
if ((remap_data.x == BMI090L_NEG_Y) && (remap_data.y == BMI090L_Z) && (remap_data.z == BMI090L_NEG_X))
{
printf(">> PASS\n");
}
else
{
printf(">> FAIL\n");
}
}
printf("Print mapped data\n");
while (1)
{
/* Read accel data ready interrupt status */
rslt = bmi090la_get_data_int_status(&status, &bmi090l);
if (status & BMI090L_ACCEL_DATA_READY_INT)
{
rslt = bmi090la_get_data(&accel, &bmi090l);
bmi090l_check_rslt("bmi090la_get_data", rslt);
printf("Accel :: X = %d Y = %d Z = %d\n", accel.x, accel.y, accel.z);
break;
}
}
printf("\nAXIS_REMAP_FUNC_TEST 3\n");
printf("Get sensor data of re-mapped axes - 2nd combination\n");
remap_data.x = BMI090L_NEG_Z;
remap_data.y = BMI090L_NEG_X;
remap_data.z = BMI090L_Y;
rslt = bmi090la_set_remap_axes(&remap_data, &bmi090l);
bmi090l_check_rslt("bmi090la_set_remap_axes", rslt);
if (rslt == BMI090L_OK)
{
rslt = bmi090la_get_remap_axes(&remap_data, &bmi090l);
bmi090l_check_rslt("bmi090la_get_remap_axes", rslt);
if (rslt == BMI090L_OK)
{
printf("Re-mapped x value = %s\n", data_array[remap_data.x]);
printf("Re-mapped y value = %s\n", data_array[remap_data.y]);
printf("Re-mapped z value = %s\n", data_array[remap_data.z]);
}
printf("Expected Re-mapped x value = BMI090L_NEG_Z\n");
printf("Expected Re-mapped y value = BMI090L_NEG_X\n");
printf("Expected Re-mapped z value = BMI090L_Y\n");
if ((remap_data.x == BMI090L_NEG_Z) && (remap_data.y == BMI090L_NEG_X) && (remap_data.z == BMI090L_Y))
{
printf(">> PASS\n");
}
else
{
printf(">> FAIL\n");
}
}
printf("Print mapped data\n");
while (1)
{
/* Read accel data ready interrupt status */
rslt = bmi090la_get_data_int_status(&status, &bmi090l);
if (status & BMI090L_ACCEL_DATA_READY_INT)
{
rslt = bmi090la_get_data(&accel, &bmi090l);
bmi090l_check_rslt("bmi090la_get_data", rslt);
printf("Accel :: X = %d Y = %d Z = %d\n", accel.x, accel.y, accel.z);
break;
}
}
printf("\nAXIS_REMAP_FUNC_TEST 4\n");
printf("Get sensor data of re-mapped axes - 3rd combination\n");
remap_data.x = BMI090L_Y;
remap_data.y = BMI090L_Z;
remap_data.z = BMI090L_X;
rslt = bmi090la_set_remap_axes(&remap_data, &bmi090l);
bmi090l_check_rslt("bmi090la_set_remap_axes", rslt);
if (rslt == BMI090L_OK)
{
rslt = bmi090la_get_remap_axes(&remap_data, &bmi090l);
bmi090l_check_rslt("bmi090la_get_remap_axes", rslt);
if (rslt == BMI090L_OK)
{
printf("Re-mapped x value = %s\n", data_array[remap_data.x]);
printf("Re-mapped y value = %s\n", data_array[remap_data.y]);
printf("Re-mapped z value = %s\n", data_array[remap_data.z]);
}
printf("Expected Re-mapped x value = BMI090L_Y\n");
printf("Expected Re-mapped y value = BMI090L_Z\n");
printf("Expected Re-mapped z value = BMI090L_X\n");
if ((remap_data.x == BMI090L_Y) && (remap_data.y == BMI090L_Z) && (remap_data.z == BMI090L_X))
{
printf(">> PASS\n");
}
else
{
printf(">> FAIL\n");
}
}
printf("Print mapped data\n");
while (1)
{
/* Read accel data ready interrupt status */
rslt = bmi090la_get_data_int_status(&status, &bmi090l);
if (status & BMI090L_ACCEL_DATA_READY_INT)
{
rslt = bmi090la_get_data(&accel, &bmi090l);
bmi090l_check_rslt("bmi090la_get_data", rslt);
printf("Accel :: X = %d Y = %d Z = %d\n", accel.x, accel.y, accel.z);
break;
}
}
printf("\nAXIS_REMAP_FUNC_TEST 5\n");
printf("Get sensor data of re-mapped axes - 4th combination\n");
remap_data.x = BMI090L_NEG_X;
remap_data.y = BMI090L_NEG_Y;
remap_data.z = BMI090L_NEG_Z;
rslt = bmi090la_set_remap_axes(&remap_data, &bmi090l);
bmi090l_check_rslt("bmi090la_set_remap_axes", rslt);
if (rslt == BMI090L_OK)
{
rslt = bmi090la_get_remap_axes(&remap_data, &bmi090l);
bmi090l_check_rslt("bmi090la_get_remap_axes", rslt);
if (rslt == BMI090L_OK)
{
printf("Re-mapped x value = %s\n", data_array[remap_data.x]);
printf("Re-mapped y value = %s\n", data_array[remap_data.y]);
printf("Re-mapped z value = %s\n", data_array[remap_data.z]);
}
printf("Expected Re-mapped x value = BMI090L_NEG_X\n");
printf("Expected Re-mapped y value = BMI090L_NEG_Y\n");
printf("Expected Re-mapped z value = BMI090L_NEG_Z\n");
if ((remap_data.x == BMI090L_NEG_X) && (remap_data.y == BMI090L_NEG_Y) && (remap_data.z == BMI090L_NEG_Z))
{
printf(">> PASS\n");
}
else
{
printf(">> FAIL\n");
}
}
printf("Print mapped data\n");
while (1)
{
/* Read accel data ready interrupt status */
rslt = bmi090la_get_data_int_status(&status, &bmi090l);
if (status & BMI090L_ACCEL_DATA_READY_INT)
{
rslt = bmi090la_get_data(&accel, &bmi090l);
bmi090l_check_rslt("bmi090la_get_data", rslt);
printf("Accel :: X = %d Y = %d Z = %d\n", accel.x, accel.y, accel.z);
break;
}
}
bmi090l_coines_deinit();
return rslt;
}
| 30.183374 | 119 | 0.59109 |
06cde76e01bbea2fa66e454c48e9b79f68da77da | 138 | swift | Swift | Tests/LinuxMain.swift | TheSwiftEssentials/TheSwiftEssentials | 7b0a7ef75d45d7cf8e5f42cde380d8b217b49a01 | [
"MIT"
] | 1 | 2021-01-31T03:39:44.000Z | 2021-01-31T03:39:44.000Z | Tests/LinuxMain.swift | TheSwiftEssentials/TheSwiftEssentials | 7b0a7ef75d45d7cf8e5f42cde380d8b217b49a01 | [
"MIT"
] | null | null | null | Tests/LinuxMain.swift | TheSwiftEssentials/TheSwiftEssentials | 7b0a7ef75d45d7cf8e5f42cde380d8b217b49a01 | [
"MIT"
] | null | null | null | import XCTest
import TheSwiftEssentialsTests
var tests = [XCTestCaseEntry]()
tests += TheSwiftEssentialsTests.allTests()
XCTMain(tests)
| 17.25 | 43 | 0.811594 |
1826c0f39308b015e0ad4cdf1f98802a58606e90 | 685 | css | CSS | public/css/style.css | eddiegingco971/SemiFinal-Project-Destination | 57fd1aa5a99b987089ad226965b4e67574a20b0b | [
"MIT"
] | null | null | null | public/css/style.css | eddiegingco971/SemiFinal-Project-Destination | 57fd1aa5a99b987089ad226965b4e67574a20b0b | [
"MIT"
] | null | null | null | public/css/style.css | eddiegingco971/SemiFinal-Project-Destination | 57fd1aa5a99b987089ad226965b4e67574a20b0b | [
"MIT"
] | null | null | null | .main-container {
margin-top: 30px;
margin-bottom: 100px;
}
.hero{
color: gray;
}
.add{
margin-top: 5px;
}
h2{
font-size: 100px;
color:blue;
text-shadow: rgb(red, green, blue);
font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;
}
footer {
width: 100%;
padding: 5px;
text-align: center;
font-size: 15px;
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
}
.card1{
background-color: lightgrey;
}
.card2{
background-color: lightgrey;
}
.card3{
background-color: lightgrey;
}
.card-title{
color: blue;
}
.index{
margin-top: 20px;
}
p{
text-align: justify;
}
| 15.222222 | 77 | 0.611679 |
62d635903affcb84508aaede18d528452b20fa3f | 1,091 | swift | Swift | aoc-2021/aoc2021/Day6-Lanternfish/Test/LanternFishTests.swift | bi1zi1/adventofcode-2021 | 50e8e7031551d107d21ec3303427768e362842b3 | [
"MIT"
] | null | null | null | aoc-2021/aoc2021/Day6-Lanternfish/Test/LanternFishTests.swift | bi1zi1/adventofcode-2021 | 50e8e7031551d107d21ec3303427768e362842b3 | [
"MIT"
] | null | null | null | aoc-2021/aoc2021/Day6-Lanternfish/Test/LanternFishTests.swift | bi1zi1/adventofcode-2021 | 50e8e7031551d107d21ec3303427768e362842b3 | [
"MIT"
] | null | null | null | @testable import AOCFramework
import Foundation
import XCTest
class LanternFishTests: XCTestCase {
func testPopulationCount80day() throws {
// given
let lanternFish = LanternFish(measurementsFile: .testLanternfishSpawnData)
// when
let populationCount80day = lanternFish.populationCount80day()
// then
let expectedPopulationCount80day = 5934
XCTAssertEqual(populationCount80day, expectedPopulationCount80day)
}
func testPopulationCount256day() throws {
// given
let lanternFish = LanternFish(measurementsFile: .testLanternfishSpawnData)
// when
let populationCount256day = lanternFish.populationCount256day()
// then
let expectedPopulationCount256day = 26984457539
XCTAssertEqual(populationCount256day, expectedPopulationCount256day)
}
func testPerformanceExample() throws {
let lanternFish = LanternFish(measurementsFile: .testLanternfishSpawnData)
self.measure {
_ = lanternFish.populationCount80day()
}
}
}
| 27.974359 | 82 | 0.700275 |