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
sequencelengths 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
sequencelengths 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
sequencelengths 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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
20913f67f5c7e98b2f46e32b9bd679205b18fbc1 | 312 | asm | Assembly | programs/oeis/040/A040752.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 22 | 2018-02-06T19:19:31.000Z | 2022-01-17T21:53:31.000Z | programs/oeis/040/A040752.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 41 | 2021-02-22T19:00:34.000Z | 2021-08-28T10:47:47.000Z | programs/oeis/040/A040752.asm | neoneye/loda | afe9559fb53ee12e3040da54bd6aa47283e0d9ec | [
"Apache-2.0"
] | 5 | 2021-02-24T21:14:16.000Z | 2021-08-09T19:48:05.000Z | ; A040752: Continued fraction for sqrt(780).
; 27,1,12,1,54,1,12,1,54,1,12,1,54,1,12,1,54,1,12,1,54,1,12,1,54,1,12,1,54,1,12,1,54,1,12,1,54,1,12,1,54,1,12,1,54,1,12,1,54,1,12,1,54,1,12,1,54,1,12,1,54,1,12,1,54,1,12,1,54,1,12,1,54,1,12
mul $0,2
seq $0,40329 ; Continued fraction for sqrt(348).
mul $0,3
div $0,2
| 39 | 189 | 0.634615 |
6b5c2f1c8ad315eaebf314454accf3b794b4106c | 1,038 | hpp | C++ | src/catch2/catch_tag_alias_autoregistrar.hpp | signal-Processor/Catch2 | 2dbe63a6ba949c3f0a2078770f7d12cfe5adc10c | [
"BSL-1.0"
] | 8 | 2021-03-17T19:25:12.000Z | 2022-02-05T02:08:21.000Z | src/catch2/catch_tag_alias_autoregistrar.hpp | signal-Processor/Catch2 | 2dbe63a6ba949c3f0a2078770f7d12cfe5adc10c | [
"BSL-1.0"
] | null | null | null | src/catch2/catch_tag_alias_autoregistrar.hpp | signal-Processor/Catch2 | 2dbe63a6ba949c3f0a2078770f7d12cfe5adc10c | [
"BSL-1.0"
] | 2 | 2021-09-22T14:39:51.000Z | 2021-11-08T09:47:38.000Z |
// Copyright Catch2 Authors
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)
// SPDX-License-Identifier: BSL-1.0
#ifndef CATCH_TAG_ALIAS_AUTOREGISTRAR_HPP_INCLUDED
#define CATCH_TAG_ALIAS_AUTOREGISTRAR_HPP_INCLUDED
#include <catch2/internal/catch_compiler_capabilities.hpp>
#include <catch2/internal/catch_source_line_info.hpp>
namespace Catch {
struct RegistrarForTagAliases {
RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo );
};
} // end namespace Catch
#define CATCH_REGISTER_TAG_ALIAS( alias, spec ) \
CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
namespace{ Catch::RegistrarForTagAliases INTERNAL_CATCH_UNIQUE_NAME( AutoRegisterTagAlias )( alias, spec, CATCH_INTERNAL_LINEINFO ); } \
CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
#endif // CATCH_TAG_ALIAS_AUTOREGISTRAR_HPP_INCLUDED
| 35.793103 | 140 | 0.785164 |
bee87113cfde4750d83b8c16ca53c808197d1295 | 158 | ts | TypeScript | node_modules/@lion/localize/src/isLocalizeESModule.d.ts | daKmoR/studies | befe573ee29d18deb5fb3dd45ecd63ad4285ee73 | [
"CC0-1.0"
] | null | null | null | node_modules/@lion/localize/src/isLocalizeESModule.d.ts | daKmoR/studies | befe573ee29d18deb5fb3dd45ecd63ad4285ee73 | [
"CC0-1.0"
] | null | null | null | node_modules/@lion/localize/src/isLocalizeESModule.d.ts | daKmoR/studies | befe573ee29d18deb5fb3dd45ecd63ad4285ee73 | [
"CC0-1.0"
] | null | null | null | /**
* @param {Object.<string, Object>} obj
* @returns {boolean}
*/
export default function isLocalizeESModule(obj: {
[x: string]: Object;
}): boolean;
| 19.75 | 49 | 0.64557 |
dab50cbf33b9fa57b9744cdf839a22bea0ac3582 | 2,776 | php | PHP | vendor/fancyecommerce/fecshop/config/services/Helper.php | solo307/fecshop | a8021fca53efb4e349a8e9f8eb538d2eebf6c6c8 | [
"BSD-3-Clause"
] | null | null | null | vendor/fancyecommerce/fecshop/config/services/Helper.php | solo307/fecshop | a8021fca53efb4e349a8e9f8eb538d2eebf6c6c8 | [
"BSD-3-Clause"
] | null | null | null | vendor/fancyecommerce/fecshop/config/services/Helper.php | solo307/fecshop | a8021fca53efb4e349a8e9f8eb538d2eebf6c6c8 | [
"BSD-3-Clause"
] | null | null | null | <?php
/**
* FecShop file.
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
return [
'helper' => [
'class' => 'fecshop\services\Helper',
// 子服务
'childService' => [
'ar' => [
'class' => 'fecshop\services\helper\AR',
],
/* 已经废除,现在使用Yii::$app->serviceLog
'log' => [
'class' => 'fecshop\services\helper\Log',
'log_config' => [
// service log config
'services' => [
// if enable is false , all services will be close
'enable' => false,
// print log info to db.
'dbprint' => false,
// print log info to front html
'htmlprint' => false,
// print log
'htmlprintbyparam' => [
// like :http://fecshop.appfront.fancyecommerce.com/cn/?servicelog=xxxxxxxx
'enable' => false,
'paramKey' => 'servicelog',
'paramVal' => 'xxxxxxxx',
],
],
],
],
*/
'errors' => [
'class' => 'fecshop\services\helper\Errors',
],
'errorHandler' => [
'class' => 'fecshop\services\helper\ErrorHandler',
],
'mobileDetect' => [
'class' => 'fecshop\services\helper\MobileDetect',
],
'captcha' => [
'class' => 'fecshop\services\helper\Captcha',
'charset' => '023456789', //随机因子
'codelen' => 4, //验证码长度
'width' => 130, //宽度
'height' => 50, //高度
'fontsize' => 20, //子体大小
'case_sensitive'=> false, // 是否区分大小写,false代表不区分
],
'country' => [
'class' => 'fecshop\services\helper\Country',
//'default_country' => 'US',
],
'format' => [
'class' => 'fecshop\services\helper\Format',
//'default_country' => 'US',
],
'appserver' => [
'class' => 'fecshop\services\helper\Appserver',
],
'appapi' => [
'class' => 'fecshop\services\helper\Appapi',
],
'echart' => [
'class' => 'fecshop\services\helper\Echart',
],
],
],
];
| 35.589744 | 103 | 0.372839 |
0be0cf20fa2c32b437561def4a37be2112c00286 | 6,213 | hpp | C++ | src/common/low_precision_transformations/include/low_precision/propagate_shared_value.hpp | ytorzuk-altran/openvino | 68d460a3bb578a738ba0e4d0e1f2e321afa73ab0 | [
"Apache-2.0"
] | 1 | 2021-12-10T09:37:20.000Z | 2021-12-10T09:37:20.000Z | src/common/low_precision_transformations/include/low_precision/propagate_shared_value.hpp | ytorzuk-altran/openvino | 68d460a3bb578a738ba0e4d0e1f2e321afa73ab0 | [
"Apache-2.0"
] | 48 | 2020-11-20T10:24:33.000Z | 2022-03-30T17:46:48.000Z | src/common/low_precision_transformations/include/low_precision/propagate_shared_value.hpp | ytorzuk-altran/openvino | 68d460a3bb578a738ba0e4d0e1f2e321afa73ab0 | [
"Apache-2.0"
] | 1 | 2022-03-27T06:37:35.000Z | 2022-03-27T06:37:35.000Z | // Copyright (C) 2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
#pragma once
#include <assert.h>
#include <memory>
#include <vector>
#include <ngraph/node.hpp>
#include <ngraph/variant.hpp>
#include <low_precision/lpt_visibility.hpp>
#include <ngraph/pass/graph_rewrite.hpp>
#include "low_precision/network_helper.hpp"
#include "lpt_itt.hpp"
namespace ngraph {
namespace pass {
namespace low_precision {
template <class AttributeType>
class LP_TRANSFORMATIONS_API PropagateSharedValue;
} // namespace low_precision
} // namespace pass
} // namespace ngraph
template <class AttributeType>
class ngraph::pass::low_precision::PropagateSharedValue : public ngraph::pass::FunctionPass {
public:
bool run_on_function(std::shared_ptr<ngraph::Function> f) override {
OV_ITT_SCOPE(FIRST_INFERENCE, itt::domains::LPT_LT, "PropagateSharedValue");
std::vector<std::shared_ptr<ngraph::Node>> nodes(f->get_ordered_ops());
for (auto it = nodes.begin(); it != nodes.end(); it++) {
const std::shared_ptr<Node> node = *it;
if (ov::is_type<opset1::FakeQuantize>(node)) {
assert(node->get_output_size() == 1ul);
auto& outputRtInfo = node->output(0).get_rt_info();
outputRtInfo[AttributeType::get_type_info_static()] = AttributeType{std::set<element::Type>{element::u8, element::i8}};
continue;
}
if (!NetworkHelper::isPrecisionPreserved(node)) {
for (auto& input : node->inputs()) {
auto parentNode = input.get_source_output().get_node_shared_ptr();
auto getAttributes = [](const Input<Node>& nodeInput) {
const std::string name = PrecisionsAttribute::get_type_info_static();
auto node = nodeInput.get_source_output().get_node_shared_ptr();
std::vector<ov::Any> attributes;
if (ov::is_type<opset1::FakeQuantize>(node)) {
// output
auto& rt = nodeInput.get_source_output().get_rt_info();
auto it = rt.find(name);
if (it != rt.end()) {
attributes.push_back(it->second);
}
}
return attributes;
};
auto& nodeRt = input.get_rt_info();
const std::string name = PrecisionsAttribute::get_type_info_static();
const auto it = nodeRt.find(name);
if (it == nodeRt.end()) {
continue;
}
std::vector<ov::Any> attributes{ it->second };
auto parentAttributes = getAttributes(input);
if (parentAttributes.empty()) {
continue;
}
for (auto& parentAttribute : parentAttributes) {
parentAttribute.as<PrecisionsAttribute>.merge(attributes);
}
nodeRt[name] = parentAttributes[0];
}
continue;
}
handle(f, node);
}
return true;
}
private:
std::vector<ov::Any> getParentInputRestrictions(
const std::shared_ptr<ngraph::Node> node) {
std::vector<ov::Any> parentAttributes;
for (size_t index = 0ul; index < node->get_input_size(); index++) {
const Input<Node>& input = node->input(index);
auto inputNode = input.get_source_output().get_node()->shared_from_this();
const auto dequantization = NetworkHelper::getDequantization(node, index);
if (!dequantization.empty() &&
(ov::is_type<opset1::Convert>(dequantization.data.get_node())) &&
ov::is_type<opset1::FakeQuantize>(dequantization.data.get_node()->get_input_node_ptr(0))) {
inputNode = dequantization.data.get_node()->get_input_node_shared_ptr(0);
}
if (NetworkHelper::isPrecisionPreserved(inputNode)) {
auto& inputRtInfo = inputNode->get_rt_info();
auto inputAttributeIt = inputRtInfo.find(PrecisionsAttribute::get_type_info_static());
if (inputAttributeIt != inputRtInfo.end()) {
parentAttributes.push_back(inputAttributeIt->second);
}
} else if (ov::is_type<opset1::FakeQuantize>(inputNode)) {
const auto& outputPortRtInfo = inputNode->outputs()[0].get_rt_info();
auto attributeIt = outputPortRtInfo.find(PrecisionsAttribute::get_type_info_static());
if (attributeIt != outputPortRtInfo.end()) {
parentAttributes.push_back(attributeIt->second);
}
}
}
return parentAttributes;
}
void handle(std::shared_ptr<ngraph::Function> f, const std::shared_ptr<ngraph::Node>& node) {
const bool precisionPreserved = NetworkHelper::isPrecisionPreserved(node);
if (precisionPreserved) {
const auto parentRestrictions = getParentInputRestrictions(node);
if (parentRestrictions.empty()) {
return;
}
// one operation - one output precision
// merge parent inputs to one current output
auto resultAttribute = parentRestrictions[0];
std::vector<ov::Any> toMerge = parentRestrictions;
toMerge.erase(toMerge.begin());
resultAttribute.as<PrecisionsAttribute>().merge(toMerge);
for (size_t index = 1ul; index < parentRestrictions.size(); index++) {
NetworkHelper::reassign(
resultAttribute.as<PrecisionsAttribute>().attribute->sharedValue,
parentRestrictions[index].as<PrecisionsAttribute>().attribute->sharedValue->attributes);
}
auto& rt = node->get_rt_info();
rt[PrecisionsAttribute::get_type_info_static()] = resultAttribute;
}
}
};
| 39.826923 | 135 | 0.570095 |
e2d3aa4ddd549b8ddfd33eb2f759e06da2d9b154 | 1,649 | py | Python | src/model/synapses/numba_backend/ExpSyn.py | Fassial/pku-intern | 4463e7d5a5844c8002f7e3d01b4fadc3a20e2038 | [
"MIT"
] | null | null | null | src/model/synapses/numba_backend/ExpSyn.py | Fassial/pku-intern | 4463e7d5a5844c8002f7e3d01b4fadc3a20e2038 | [
"MIT"
] | null | null | null | src/model/synapses/numba_backend/ExpSyn.py | Fassial/pku-intern | 4463e7d5a5844c8002f7e3d01b4fadc3a20e2038 | [
"MIT"
] | null | null | null | """
Created on 12:58, June. 4th, 2021
Author: fassial
Filename: ExpSyn.py
"""
import brainpy as bp
__all__ = [
"ExpSyn",
]
class ExpSyn(bp.TwoEndConn):
target_backend = ['numpy', 'numba', 'numba-parallel', 'numba-cuda']
@staticmethod
def derivative(s, t, tau):
dsdt = -s / tau
return dsdt
def __init__(self, pre, post, conn, weight = .1, delay = 0., tau = 8., **kwargs):
# init params
self.tau = tau
self.delay = delay
self.weight = weight
# init connections
self.conn = conn(pre.size, post.size)
self.pre_ids, self.post_ids = self.conn.requires("pre_ids", "post_ids")
self.size = len(self.pre_ids)
# init vars
self.s = bp.ops.zeros(self.size)
self.Isyn = self.register_constant_delay("Isyn",
size = self.size,
delay_time = self.delay
)
# init integral
self.integral = bp.odeint(
f = ExpSyn.derivative,
method = "exponential_euler"
)
# init super
super(ExpSyn, self).__init__(pre = pre, post = post, **kwargs)
def update(self, _t):
for i in range(self.size):
pre_id, post_id = self.pre_ids[i], self.post_ids[i]
# get Isyn
self.s[i] = self.integral(
s = self.s[i],
t = _t,
tau = self.tau
)
self.s[i] += self.pre.spike[pre_id]
self.Isyn.push(i,
self.weight * self.s[i]
)
# update post.input
self.post.input[post_id] += self.Isyn.pull(i)
| 26.174603 | 85 | 0.521528 |
0df8a673b1ab5818059682788e2e3362d7540e08 | 2,401 | rb | Ruby | lib/simplygenius/atmos/commands/terraform.rb | simplygenius/atmos | f98b7ff8297cff46aa5011a1c506aaf7a4b8af56 | [
"Apache-2.0"
] | 93 | 2018-04-13T10:54:20.000Z | 2021-09-14T00:38:01.000Z | lib/simplygenius/atmos/commands/terraform.rb | simplygenius/atmos | f98b7ff8297cff46aa5011a1c506aaf7a4b8af56 | [
"Apache-2.0"
] | 9 | 2018-06-02T02:41:46.000Z | 2022-01-04T21:32:24.000Z | lib/simplygenius/atmos/commands/terraform.rb | simplygenius/atmos | f98b7ff8297cff46aa5011a1c506aaf7a4b8af56 | [
"Apache-2.0"
] | 7 | 2018-04-26T16:51:50.000Z | 2020-11-04T04:02:59.000Z | require_relative 'base_command'
require_relative '../../atmos/terraform_executor'
module SimplyGenius
module Atmos
module Commands
class Terraform < BaseCommand
include FileUtils
attr_accessor :auto_init
def self.description
"Runs terraform"
end
# override so we can pass all options/flags/parameters directly to
# terraform instead of having clamp parse them
def parse(arguments)
@terraform_arguments = arguments
end
def init_automatically(auth_env, get_modules)
tf_init_dir = File.join(Atmos.config.tf_working_dir, 'recipes', '.terraform')
backend_initialized = File.exist?(File.join(tf_init_dir, 'terraform.tfstate'))
auto_init_enabled = Atmos.config["atmos.terraform.auto_init"].to_s == "true"
if auto_init && auto_init_enabled && ! backend_initialized
exe = TerraformExecutor.new(process_env: auth_env)
exe.run("init", get_modules: get_modules.present?)
end
end
def enable_shared_plugins(env)
if ! Atmos.config["atmos.terraform.disable_shared_plugins"]
home_dir = OS.windows? ? File.join("~", "Application Data") : "~"
plugin_cache_dir = File.expand_path(File.join(home_dir,".terraform.d", "plugin-cache"))
logger.debug("Plugin cache dir: #{plugin_cache_dir}")
mkdir_p(plugin_cache_dir)
env["TF_PLUGIN_CACHE_DIR"] = plugin_cache_dir
end
end
def execute
unless Atmos.config.is_atmos_repo?
signal_usage_error <<~EOF
Atmos can only run terraform from a location configured for atmos.
Have you run atmos init?"
EOF
end
Atmos.config.provider.auth_manager.authenticate(ENV) do |auth_env|
begin
get_modules = @terraform_arguments.delete("--get-modules")
enable_shared_plugins(auth_env)
init_automatically(auth_env, get_modules)
exe = TerraformExecutor.new(process_env: auth_env)
exe.run(*@terraform_arguments, get_modules: get_modules.present?)
rescue TerraformExecutor::ProcessFailed => e
logger.error(e.message)
exit(1)
end
end
end
end
end
end
end
| 32.013333 | 99 | 0.619325 |
f71d9a47c9fd67ce0ebf36ef589341302f49bef6 | 757 | rb | Ruby | lib/zen/search/updater.rb | elitenomad/zen-search | ce61a2158d31ed09f953219a57355bb5ac33db02 | [
"MIT"
] | null | null | null | lib/zen/search/updater.rb | elitenomad/zen-search | ce61a2158d31ed09f953219a57355bb5ac33db02 | [
"MIT"
] | null | null | null | lib/zen/search/updater.rb | elitenomad/zen-search | ce61a2158d31ed09f953219a57355bb5ac33db02 | [
"MIT"
] | null | null | null | # frozen_string_literal: true
require "json"
# Updating the collection objects to achieve 2 relationships
# - User has many tickets
# - Ticket belongs to a User
module Zen
module Search
class Updater
def self.run(users, tickets)
users.each do |user|
# List all the ticket for a user
user.tickets = tickets.select do |ticket|
ticket.assignee_id == user.id
end
# Update the values with first 8 Uniq chars
user.tickets = user.tickets.map { |ticket| ticket.id[0, 8] }
end
tickets.each do |ticket|
ticket.assignee_name = users.find { |user| user.id == ticket.assignee_id }&.name
end
[users, tickets]
end
end
end
end
| 23.65625 | 90 | 0.607662 |
da5cadae496631c24099546ee56a9f110775dc89 | 282 | ts | TypeScript | src/main.ts | Zhaocl1997/walnut-admin-client | 5d051af9d2445820f879128e694c5528c86ff43a | [
"MIT"
] | 5 | 2021-02-04T15:45:24.000Z | 2022-02-21T11:38:33.000Z | src/main.ts | Zhaocl1997/walnut-admin-client | 5d051af9d2445820f879128e694c5528c86ff43a | [
"MIT"
] | null | null | null | src/main.ts | Zhaocl1997/walnut-admin-client | 5d051af9d2445820f879128e694c5528c86ff43a | [
"MIT"
] | null | null | null | import 'virtual:windi.css'
import 'virtual:windi-devtools'
import './assets/styles/main.scss'
import 'vfonts/Lato.css'
import 'vfonts/FiraCode.css'
import { App, setupApp } from './App'
;(async () => {
const app = createApp(App)
await setupApp(app)
app.mount('#app')
})()
| 17.625 | 37 | 0.677305 |
c5131b2a93554661298e012a774812273ce56de4 | 1,449 | css | CSS | web/src/pages/Institucional/styles.css | YagoYJ/FESK | a13d3b704823b6af2f87ea2e749e355465b0a757 | [
"MIT"
] | null | null | null | web/src/pages/Institucional/styles.css | YagoYJ/FESK | a13d3b704823b6af2f87ea2e749e355465b0a757 | [
"MIT"
] | null | null | null | web/src/pages/Institucional/styles.css | YagoYJ/FESK | a13d3b704823b6af2f87ea2e749e355465b0a757 | [
"MIT"
] | null | null | null | .institucionalPage .pageTitle {
text-align: center;
margin: 30px auto;
}
.institucionalPage .card .container h2 {
text-align: center;
margin: 30px auto;
}
.institucionalPage .card .container img {
width: 100%;
max-width: 800px;
}
.institucionalPage .card .container p {
text-align: center;
color: #ffffff;
}
.institucionalPage .card .container .linksToTickets {
width: 100%;
max-width: 300px;
margin-top: 20px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.institucionalPage .card .container .linksToTickets .ticketLink {
width: 100%;
}
.institucionalPage .card .container .linksToTickets .documents {
width: 100%;
margin-top: 10px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.institucionalPage .card .container .linksToTickets .documents .documentLink {
width: 48%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.institucionalPage
.card
.container
.linksToTickets
.documents
.documentLink
svg {
color: #ffffff;
margin-bottom: 10px;
}
.institucionalPage .card .container .skateParkImages {
width: 100%;
display: flex;
flex-direction: row;
flex-wrap: wrap;
align-items: center;
justify-content: space-around;
}
.institucionalPage .card .container .skateParkImages img {
width: 400px;
height: 400px;
margin-bottom: 10px;
}
| 19.065789 | 78 | 0.708765 |
799a8e73998fc16bba7c7b39a27d542d0a1bfcd6 | 242 | rb | Ruby | lib/inline_encryption/errors.rb | sybitetechnologies/inline_encryption | 3ffa851aa366b995808b24db62b226bf1264af46 | [
"MIT"
] | null | null | null | lib/inline_encryption/errors.rb | sybitetechnologies/inline_encryption | 3ffa851aa366b995808b24db62b226bf1264af46 | [
"MIT"
] | null | null | null | lib/inline_encryption/errors.rb | sybitetechnologies/inline_encryption | 3ffa851aa366b995808b24db62b226bf1264af46 | [
"MIT"
] | null | null | null | module InlineEncryption
class MissingRequiredVariableError < StandardError; end
class DecryptionFailureError < StandardError; end
class EncryptionFailureError < StandardError; end
class MisconfigurationError < StandardError; end
end | 30.25 | 57 | 0.834711 |
5db210271b7fdf2ef1417d204ad6eba497f79670 | 1,076 | cpp | C++ | codeforces/1254a.cpp | sogapalag/problems | 0ea7d65448e1177f8b3f81124a82d187980d659c | [
"MIT"
] | 1 | 2020-04-04T14:56:12.000Z | 2020-04-04T14:56:12.000Z | codeforces/1254a.cpp | sogapalag/problems | 0ea7d65448e1177f8b3f81124a82d187980d659c | [
"MIT"
] | null | null | null | codeforces/1254a.cpp | sogapalag/problems | 0ea7d65448e1177f8b3f81124a82d187980d659c | [
"MIT"
] | null | null | null | #include <bits/stdc++.h>
using namespace std;
char c[62];
int cnt[62];
// zig-zag
void solve() {
int n,m,k;
cin >> n >> m >> k;
int rice = 0;
vector<string> s(n);
for (int i = 0; i < n; i++) {
cin >> s[i];
if (i&1) reverse(s[i].begin(), s[i].end());
for (char x: s[i]) if (x == 'R') rice++;
}
int avg = rice/k, rem = rice%k;
for (int i = 0; i < k; i++) {
cnt[i] = avg + (i<rem);
}
int x = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (s[i][j] == 'R') {
cnt[x]--;
}
s[i][j] = c[x];
if (cnt[x] == 0 && x+1 < k) x++;
}
if (i&1) reverse(s[i].begin(), s[i].end());
cout << s[i] << '\n';
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
for (int i = 0; i < 26; i++) {
c[i] = 'a'+i;
c[i+26] = 'A'+i;
}
for (int i = 0; i < 10; i++) {
c[i+52] = '0'+i;
}
int t; cin >> t;
while(t--)solve();
cout << endl;
}
| 20.692308 | 51 | 0.362454 |
f4146758bd5a7c7e4cc69b50ccc37eb456437a2c | 4,310 | cs | C# | src/Umbraco.Core/Exceptions/DataOperationException.cs | nul800sebastiaan/Umbraco-CMS | dfdb498537a6253c417f4f755283959416608243 | [
"MIT"
] | 3,375 | 2015-01-02T17:21:08.000Z | 2022-03-31T17:56:19.000Z | src/Umbraco.Core/Exceptions/DataOperationException.cs | nul800sebastiaan/Umbraco-CMS | dfdb498537a6253c417f4f755283959416608243 | [
"MIT"
] | 9,473 | 2015-01-02T01:10:10.000Z | 2022-03-31T23:39:34.000Z | src/Umbraco.Core/Exceptions/DataOperationException.cs | nul800sebastiaan/Umbraco-CMS | dfdb498537a6253c417f4f755283959416608243 | [
"MIT"
] | 3,059 | 2015-01-02T04:31:28.000Z | 2022-03-31T05:27:07.000Z | using System;
using System.Runtime.Serialization;
namespace Umbraco.Cms.Core.Exceptions
{
/// <summary>
///
/// </summary>
/// <typeparam name="T"></typeparam>
/// <seealso cref="System.Exception" />
[Serializable]
public class DataOperationException<T> : Exception
where T : Enum
{
/// <summary>
/// Gets the operation.
/// </summary>
/// <value>
/// The operation.
/// </value>
/// <remarks>
/// This object should be serializable to prevent a <see cref="SerializationException" /> to be thrown.
/// </remarks>
public T Operation { get; private set; }
/// <summary>
/// Initializes a new instance of the <see cref="DataOperationException{T}" /> class.
/// </summary>
public DataOperationException()
{ }
/// <summary>
/// Initializes a new instance of the <see cref="DataOperationException{T}" /> class.
/// </summary>
/// <param name="message">The message that describes the error.</param>
public DataOperationException(string message)
: base(message)
{ }
/// <summary>
/// Initializes a new instance of the <see cref="DataOperationException{T}" /> class.
/// </summary>
/// <param name="message">The error message that explains the reason for the exception.</param>
/// <param name="innerException">The exception that is the cause of the current exception, or a null reference (<see langword="Nothing" /> in Visual Basic) if no inner exception is specified.</param>
public DataOperationException(string message, Exception innerException)
: base(message, innerException)
{ }
/// <summary>
/// Initializes a new instance of the <see cref="DataOperationException{T}" /> class.
/// </summary>
/// <param name="operation">The operation.</param>
public DataOperationException(T operation)
: this(operation, "Data operation exception: " + operation)
{ }
/// <summary>
/// Initializes a new instance of the <see cref="DataOperationException{T}" /> class.
/// </summary>
/// <param name="operation">The operation.</param>
/// <param name="message">The message.</param>
public DataOperationException(T operation, string message)
: base(message)
{
Operation = operation;
}
/// <summary>
/// Initializes a new instance of the <see cref="DataOperationException{T}" /> class.
/// </summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
/// <exception cref="ArgumentNullException">info</exception>
protected DataOperationException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
Operation = (T)Enum.Parse(typeof(T), info.GetString(nameof(Operation)));
}
/// <summary>
/// When overridden in a derived class, sets the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> with information about the exception.
/// </summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
/// <exception cref="ArgumentNullException">info</exception>
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
if (info == null)
{
throw new ArgumentNullException(nameof(info));
}
info.AddValue(nameof(Operation), Enum.GetName(typeof(T), Operation));
base.GetObjectData(info, context);
}
}
}
| 43.535354 | 207 | 0.616009 |
689ce6e5a50b6419b4be25888500a24a98f3c54c | 316 | kt | Kotlin | desktop/gui/src/main/kotlin/com/soyle/stories/soylestories/welcomeScreen/WelcomeScreenPresenter.kt | Soyle-Productions/soyle-stories | 1a110536865250dcd8d29270d003315062f2b032 | [
"Apache-2.0"
] | 7 | 2021-08-10T18:20:25.000Z | 2022-03-31T07:23:18.000Z | desktop/gui/src/main/kotlin/com/soyle/stories/soylestories/welcomeScreen/WelcomeScreenPresenter.kt | Soyle-Productions/soyle-stories | 1a110536865250dcd8d29270d003315062f2b032 | [
"Apache-2.0"
] | 37 | 2021-08-04T22:51:02.000Z | 2022-02-10T21:29:55.000Z | desktop/gui/src/main/kotlin/com/soyle/stories/soylestories/welcomeScreen/WelcomeScreenPresenter.kt | Soyle-Productions/soyle-stories | 1a110536865250dcd8d29270d003315062f2b032 | [
"Apache-2.0"
] | null | null | null | package com.soyle.stories.soylestories.welcomeScreen
class WelcomeScreenPresenter(
private val view: WelcomeScreenView
) {
fun displayWelcomeScreen() {
view.update {
WelcomeScreenViewModel(
"Welcome to Soyle Stories",
"Soyle Stories",
"Create New Project",
"Open Project"
)
}
}
} | 17.555556 | 52 | 0.696203 |
c718cce57df4925cca51bbeefaf8f84b7d29374a | 156 | sh | Shell | tools/build.sh | lammas/devsmtpd | 6d02db4bd0c902d036bd55a558d3fab3a24f4847 | [
"MIT"
] | null | null | null | tools/build.sh | lammas/devsmtpd | 6d02db4bd0c902d036bd55a558d3fab3a24f4847 | [
"MIT"
] | null | null | null | tools/build.sh | lammas/devsmtpd | 6d02db4bd0c902d036bd55a558d3fab3a24f4847 | [
"MIT"
] | null | null | null | #!/bin/sh
REPO_ROOT=$(cd $(dirname "$0")/..; pwd)
cd "${REPO_ROOT}"
set -e
docker build -t lammas/devsmtpd:latest -t lammas/devsmtpd:1.0.3 -f Dockerfile .
| 22.285714 | 79 | 0.660256 |
905bd3e04972018c5bff47d648ce8f0ede7d626c | 2,329 | rs | Rust | hv/crates/hv-yaks/src/resource/cell.rs | lenscas/hv-dev | 7ae07cb889b20f382acd7293d80dfe3319a91123 | [
"Apache-2.0",
"MIT"
] | 11 | 2021-11-03T20:58:13.000Z | 2022-03-18T00:00:48.000Z | hv/crates/hv-yaks/src/resource/cell.rs | lenscas/hv-dev | 7ae07cb889b20f382acd7293d80dfe3319a91123 | [
"Apache-2.0",
"MIT"
] | 2 | 2022-03-18T18:19:48.000Z | 2022-03-22T00:17:14.000Z | hv/crates/hv-yaks/src/resource/cell.rs | lenscas/hv-dev | 7ae07cb889b20f382acd7293d80dfe3319a91123 | [
"Apache-2.0",
"MIT"
] | 1 | 2022-03-07T17:57:42.000Z | 2022-03-07T17:57:42.000Z | use std::{ptr::NonNull, thread::panicking};
use super::AtomicBorrow;
/// A pointer to a resource, with runtime borrow checking via an `AtomicBorrow`,
/// accessed through a pointer to a cached one in an executor.
pub struct ResourceCell<R0> {
cell: NonNull<R0>,
borrow: NonNull<AtomicBorrow>,
mutable: bool,
}
impl<R0> ResourceCell<R0> {
pub fn new_mut(resource: &mut R0, borrow: &mut AtomicBorrow) -> Self {
Self {
cell: NonNull::from(resource),
borrow: NonNull::from(borrow),
mutable: true,
}
}
pub fn new_shared(resource: &R0, borrow: &mut AtomicBorrow) -> Self {
let this = Self {
cell: NonNull::from(resource),
borrow: NonNull::from(borrow),
mutable: false,
};
// make a "virtual" immutable borrow to prevent any mutable borrows of this resource.
this.borrow();
this
}
pub fn borrow(&self) -> &R0 {
assert!(
unsafe { self.borrow.as_ref().borrow() },
"cannot borrow {} immutably: already borrowed mutably",
std::any::type_name::<R0>()
);
unsafe { self.cell.as_ref() }
}
#[allow(clippy::mut_from_ref)]
pub fn borrow_mut(&self) -> &mut R0 {
assert!(
unsafe { self.borrow.as_ref().borrow_mut() },
"cannot borrow {} mutably: already borrowed",
std::any::type_name::<R0>()
);
unsafe { &mut *self.cell.as_ptr() }
}
pub unsafe fn release(&self) {
self.borrow.as_ref().release();
}
pub unsafe fn release_mut(&self) {
self.borrow.as_ref().release_mut();
}
}
impl<R0> Drop for ResourceCell<R0> {
fn drop(&mut self) {
#[cfg(debug_assertions)]
if !panicking() {
// if this is not a mutable borrow, we release the "virtual" immutable borrow.
if !self.mutable {
unsafe { self.release() };
}
assert!(
unsafe { self.borrow.as_ref().is_free() },
"borrows of {} were not released properly",
std::any::type_name::<R0>()
)
}
}
}
unsafe impl<R0> Send for ResourceCell<R0> where R0: Send {}
unsafe impl<R0> Sync for ResourceCell<R0> where R0: Sync {}
| 28.402439 | 93 | 0.550021 |
b0973189822407c493fe0388f164f4d546ff4ccb | 13,279 | py | Python | rss_temple/api/migrations/0001_initial.py | murrple-1/rss_temple | 289197923b1e7d1213f1673d164337df17d7269b | [
"MIT"
] | null | null | null | rss_temple/api/migrations/0001_initial.py | murrple-1/rss_temple | 289197923b1e7d1213f1673d164337df17d7269b | [
"MIT"
] | 8 | 2019-12-04T21:58:35.000Z | 2021-12-15T02:29:49.000Z | rss_temple/api/migrations/0001_initial.py | murrple-1/rss_temple | 289197923b1e7d1213f1673d164337df17d7269b | [
"MIT"
] | null | null | null | # Generated by Django 2.1.7 on 2019-03-10 18:32
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='FacebookLogin',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4,
primary_key=True, serialize=False)),
('profile_id', models.CharField(max_length=96)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='FavoriteFeedEntryUserMapping',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4,
primary_key=True, serialize=False)),
],
),
migrations.CreateModel(
name='Feed',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4,
primary_key=True, serialize=False)),
('feed_url', models.TextField(unique=True)),
('title', models.TextField()),
('home_url', models.TextField(null=True)),
('published_at', models.DateTimeField(
default=django.utils.timezone.now)),
('updated_at', models.DateTimeField(null=True)),
('db_created_at', models.DateTimeField(
default=django.utils.timezone.now)),
('db_updated_at', models.DateTimeField(null=True)),
],
),
migrations.CreateModel(
name='FeedEntry',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4,
primary_key=True, serialize=False)),
('id', models.TextField(null=True)),
('created_at', models.DateTimeField(null=True)),
('published_at', models.DateTimeField(
default=django.utils.timezone.now)),
('updated_at', models.DateTimeField(null=True)),
('title', models.TextField(null=True)),
('url', models.TextField(null=True)),
('content', models.TextField(null=True)),
('author_name', models.TextField(null=True)),
('hash', models.IntegerField()),
('db_created_at', models.DateTimeField(
default=django.utils.timezone.now)),
('db_updated_at', models.DateTimeField(null=True)),
('feed', models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to='api.Feed')),
],
),
migrations.CreateModel(
name='FeedEntryTagMapping',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4,
primary_key=True, serialize=False)),
('feed_entry', models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to='api.FeedEntry')),
],
),
migrations.CreateModel(
name='FeedSubscriptionProgressEntry',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4,
primary_key=True, serialize=False)),
('status', models.IntegerField(choices=[
(0, 'Not Started'), (1, 'Started'), (2, 'Finished')], default=0)),
],
),
migrations.CreateModel(
name='FeedSubscriptionProgressEntryDescriptor',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4,
primary_key=True, serialize=False)),
('feed_url', models.TextField()),
('custom_feed_title', models.TextField(null=True)),
('user_category_text', models.TextField(null=True)),
('is_finished', models.BooleanField(default=False)),
('feed_subscription_progress_entry', models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to='api.FeedSubscriptionProgressEntry')),
],
),
migrations.CreateModel(
name='FeedTagMapping',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4,
primary_key=True, serialize=False)),
('feed', models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to='api.Feed')),
],
),
migrations.CreateModel(
name='FeedUserCategoryMapping',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4,
primary_key=True, serialize=False)),
('feed', models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to='api.Feed')),
],
),
migrations.CreateModel(
name='GoogleLogin',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4,
primary_key=True, serialize=False)),
('g_user_id', models.CharField(max_length=96)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='MyLogin',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4,
primary_key=True, serialize=False)),
('pw_hash', models.CharField(max_length=96)),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='PasswordResetToken',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4,
primary_key=True, serialize=False)),
('expires_at', models.DateTimeField()),
],
),
migrations.CreateModel(
name='ReadFeedEntryUserMapping',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4,
primary_key=True, serialize=False)),
('read_at', models.DateTimeField(
default=django.utils.timezone.now)),
('feed_entry', models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to='api.FeedEntry')),
],
),
migrations.CreateModel(
name='Session',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4,
primary_key=True, serialize=False)),
('expires_at', models.DateTimeField(null=True)),
],
),
migrations.CreateModel(
name='SubscribedFeedUserMapping',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4,
primary_key=True, serialize=False)),
('custom_feed_title', models.TextField(null=True)),
('feed', models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to='api.Feed')),
],
),
migrations.CreateModel(
name='Tag',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4,
primary_key=True, serialize=False)),
('label_text', models.TextField(unique=True)),
],
),
migrations.CreateModel(
name='User',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4,
primary_key=True, serialize=False)),
('email', models.CharField(max_length=64, unique=True)),
('created_at', models.DateTimeField(
default=django.utils.timezone.now)),
],
),
migrations.CreateModel(
name='UserCategory',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4,
primary_key=True, serialize=False)),
('text', models.TextField()),
('user', models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to='api.User')),
],
),
migrations.CreateModel(
name='VerificationToken',
fields=[
('uuid', models.UUIDField(default=uuid.uuid4,
primary_key=True, serialize=False)),
('expires_at', models.DateTimeField()),
('user', models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE, to='api.User')),
],
),
migrations.AddField(
model_name='subscribedfeedusermapping',
name='user',
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to='api.User'),
),
migrations.AddField(
model_name='session',
name='user',
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to='api.User'),
),
migrations.AddField(
model_name='readfeedentryusermapping',
name='user',
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to='api.User'),
),
migrations.AddField(
model_name='passwordresettoken',
name='user',
field=models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE, to='api.User'),
),
migrations.AddField(
model_name='mylogin',
name='user',
field=models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE, to='api.User'),
),
migrations.AddField(
model_name='googlelogin',
name='user',
field=models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE, to='api.User'),
),
migrations.AddField(
model_name='feedusercategorymapping',
name='user_category',
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to='api.UserCategory'),
),
migrations.AddField(
model_name='feedtagmapping',
name='tag',
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to='api.Tag'),
),
migrations.AddField(
model_name='feedsubscriptionprogressentry',
name='user',
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to='api.User'),
),
migrations.AddField(
model_name='feedentrytagmapping',
name='tag',
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to='api.Tag'),
),
migrations.AddField(
model_name='favoritefeedentryusermapping',
name='feed_entry',
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to='api.FeedEntry'),
),
migrations.AddField(
model_name='favoritefeedentryusermapping',
name='user',
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to='api.User'),
),
migrations.AddField(
model_name='facebooklogin',
name='user',
field=models.OneToOneField(
on_delete=django.db.models.deletion.CASCADE, to='api.User'),
),
migrations.AlterUniqueTogether(
name='usercategory',
unique_together={('user', 'text')},
),
migrations.AlterUniqueTogether(
name='subscribedfeedusermapping',
unique_together={('user', 'feed'), ('user', 'custom_feed_title')},
),
migrations.AlterUniqueTogether(
name='readfeedentryusermapping',
unique_together={('feed_entry', 'user')},
),
migrations.AlterUniqueTogether(
name='feedusercategorymapping',
unique_together={('feed', 'user_category')},
),
migrations.AlterUniqueTogether(
name='feedtagmapping',
unique_together={('feed', 'tag')},
),
migrations.AlterUniqueTogether(
name='feedentrytagmapping',
unique_together={('feed_entry', 'tag')},
),
migrations.AddIndex(
model_name='feedentry',
index=models.Index(
fields=['id'], name='api_feedent_id_6f9c14_idx'),
),
migrations.AlterUniqueTogether(
name='favoritefeedentryusermapping',
unique_together={('feed_entry', 'user')},
),
]
| 40.117825 | 106 | 0.504631 |
da49abbd91cc5ad6775df04af1679a7717ee94b8 | 3,400 | php | PHP | api/config.php | MarkusWb/BasicPHPcrud | 7c1811066cb255259b323efee650b4bd4b3815fd | [
"BSD-3-Clause"
] | null | null | null | api/config.php | MarkusWb/BasicPHPcrud | 7c1811066cb255259b323efee650b4bd4b3815fd | [
"BSD-3-Clause"
] | null | null | null | api/config.php | MarkusWb/BasicPHPcrud | 7c1811066cb255259b323efee650b4bd4b3815fd | [
"BSD-3-Clause"
] | null | null | null | <?php
error_reporting(0);
$jwt_key = 'someatleast256bitlongencryptionkey------------------------------';
// db infos
$host_name = 'dbhost.com';
$database = 'db12345';
$user_name = 'user12345';
$password = '12345';
$auth_header_field = 'REDIRECT_HTTP_AUTHORIZATION'; // could also be 'HTTP_AUTHORIZATION' depending on Apache settings
$path_info = 'ORIG_PATH_INFO'; // could also be 'PATH_INFO' depending on Apache settings
$user_meta = [
't_users' => 'users',
't_roles' => 'userroles',
't_join' => 'users_roles',
'f_username' => 'username',
'f_hash' => 'pwd_hash',
'f_mail' => 'mail',
'f_reset' => 'reset_code',
'f_role' => 'role',
'allowed_fields' => 'id,username'
];
$auth_filter = [
'users' => array('admin')
];
function handle_db_error($link) {
$msg = $link->error;
$link->close();
exit_msg_code($msg, 500);
}
function handle_statement_error($link, $statement) {
$msg = $statement->error;
$link->close();
exit_msg_code($msg, 500);
}
function exit_msg_code($msg, $status) {
http_response_code($status);
exit('{"status": "failed", "message": "' . $msg . '"}');
}
function exit_on_bad_connection($link) {
if ($link->connect_errno) {
exit_msg_code($link->connect_error, 500);
}
}
function load_user($credentials, $host_name, $user_name, $password, $database, $u) {
$link = new mysqli($host_name, $user_name, $password, $database);
exit_on_bad_connection($link);
$query = 'SELECT u.id, u.' . $u['f_hash'] . ', u.' . $u['f_mail'] . ', u.' . $u['f_reset'] .
', group_concat(DISTINCT r.' . $u['f_role']. ' SEPARATOR ",") as roles' .
' FROM ' . $u['t_users'] . ' u' .
' INNER JOIN ' . $u['t_join'] . ' ur ON u.id = ur.' . $u['t_users'] . '_id' .
' INNER JOIN ' . $u['t_roles'] . ' r ON ur.' . $u['t_roles'] . '_id = r.id' .
' WHERE u.' . $u['f_username'] . ' = "' . $credentials['user'] . '"';
$result = $link->query($query);
if (!$result) {
echo 'ERROR ';
handle_db_error($link);
}
$entry = $result->fetch_all(MYSQLI_ASSOC);
//echo json_encode($entry);
$link->close();
return $entry;
}
function run_sql_statement($method, $host_name, $user_name, $password, $database, $sql, $parameters) {
$link = new mysqli($host_name, $user_name, $password, $database);
exit_on_bad_connection($link);
$value = 0;
$statement = $link->prepare($sql);
if (!$statement) {
handle_db_error($link);
}
$types = '';
foreach ($parameters as $key => $value) {
if (is_float($value)) {
$types = $types . 'd';
} elseif (is_int($value)) {
$types = $types . 'i';
} else {
$types = $types . 's';
}
}
if (!empty($parameters)) {
if (!$statement->bind_param($types, ...$parameters)) {
handle_statement_error($link, $statement);
}
}
if (!$statement->execute()) {
handle_statement_error($link, $statement);
}
$result = $statement->get_result();
if (!$result && str_starts_with($method, 'GET')) {
handle_statement_error($link, $statement);
}
if ($method === 'POST') {
$value = $statement->insert_id;
}
if ($method === 'GET') {
$value = $result->fetch_all(MYSQLI_ASSOC);
}
if ($method === 'DELETE') {
if ($statement->affected_rows < 1) {
exit_msg_code('Resource not found', 404);
}
}
$link->close();
return $value;
}
?> | 28.099174 | 118 | 0.578824 |
8081f02599dea897db7abe6cff3883a40c15650d | 1,207 | html | HTML | runs/templates/runs/input_run.html | bitblueprint/RunningCause | 22114cec0a68ba8a2b7a3c143b71a587f273c7f1 | [
"MIT"
] | 3 | 2015-09-29T14:12:34.000Z | 2016-07-29T08:20:16.000Z | runs/templates/runs/input_run.html | bitblueprint/RunningCause | 22114cec0a68ba8a2b7a3c143b71a587f273c7f1 | [
"MIT"
] | 1 | 2016-07-29T10:38:47.000Z | 2016-08-01T08:32:48.000Z | runs/templates/runs/input_run.html | bitblueprint/RunningCause | 22114cec0a68ba8a2b7a3c143b71a587f273c7f1 | [
"MIT"
] | 3 | 2015-07-16T07:52:27.000Z | 2018-01-05T08:03:09.000Z | {% extends "narrow_base.html" %}
{% load staticfiles %}
{% load i18n %}
{% load bootstrap3 %}
{% block title %}
{% blocktrans %}Input a Run{% endblocktrans %}
{% endblock %}
{% block imports %}
<script src="{% static 'js/bootstrap-datepicker.js' %}"></script>
<script type=text/javascript>
$(document).ready(function() {
$('#start_datepicker').datepicker({
format:'yyyy-mm-dd',
weekStart: 1,
autoclose: true
});
$('#end_datepicker').datepicker({
format:'yyyy-mm-dd',
weekStart: 1,
autoclose: true
});
});
</script>
{% endblock %}
{% block body %}
<h1>{% trans "Add your run" %}</h1>
<p>
{% blocktrans %}
Here, you can input a run! All your sponsors will have the distance you
ran added to tab for their sponsorship, and they'll be billed at the end
of the quarter.
{% endblocktrans %}
</p>
<form action="{% url 'runs:input_run' %}" method="post">
{% csrf_token %}
{% bootstrap_form form layout="form-horizontal" %}
{% buttons %}
<button type="submit" class="btn btn-primary">
{% bootstrap_icon "plus" %} {% trans 'Add run' %}
</button>
{% endbuttons %}
</form>
{% endblock %}
| 24.632653 | 76 | 0.586578 |
79766ff9b73e7db6490d0d7bd25979a1c34df7df | 2,805 | php | PHP | module/Api/src/Service/Document/Bookmark/PhoneNumbers.php | FeatureToggleStudy/olcs-backend | dce3c1aac50fb62842c300208046bccb253b63b9 | [
"MIT"
] | 1 | 2018-10-12T19:16:10.000Z | 2018-10-12T19:16:10.000Z | module/Api/src/Service/Document/Bookmark/PhoneNumbers.php | FeatureToggleStudy/olcs-backend | dce3c1aac50fb62842c300208046bccb253b63b9 | [
"MIT"
] | 1 | 2020-06-24T15:56:58.000Z | 2020-08-28T13:47:46.000Z | module/Api/src/Service/Document/Bookmark/PhoneNumbers.php | FeatureToggleStudy/olcs-backend | dce3c1aac50fb62842c300208046bccb253b63b9 | [
"MIT"
] | 2 | 2019-11-03T18:43:35.000Z | 2021-04-10T22:08:46.000Z | <?php
namespace Dvsa\Olcs\Api\Service\Document\Bookmark;
use Dvsa\Olcs\Api\Entity\ContactDetails\PhoneContact;
use Dvsa\Olcs\Api\Service\Document\Bookmark\Base\DynamicBookmark;
use Dvsa\Olcs\Api\Domain\Query\Bookmark\LicenceBundle as Qry;
/**
* PhoneNumbers bookmark
*
* @author Alex Peshkov <[email protected]>
*/
class PhoneNumbers extends DynamicBookmark
{
/**
* Get the Query to retrieve data
*
* @param array $data Known data
*
* @return Qry
*/
public function getQuery(array $data)
{
$bundle = [
'correspondenceCd' => [
'phoneContacts' => [
'phoneContactType'
]
]
];
return Qry::create(['id' => $data['licence'], 'bundle' => $bundle]);
}
/**
* Render bookmark
*
* @return string
*/
public function render()
{
if (empty($this->data)) {
return '';
}
$header = [
[
'BOOKMARK1' => 'Phone number(s)',
'BOOKMARK2' => ''
],
[
'BOOKMARK1' => 'Type of contact number',
'BOOKMARK2' => 'Number'
]
];
$numbers = [];
if (isset($this->data['correspondenceCd']['phoneContacts'])) {
foreach ($this->data['correspondenceCd']['phoneContacts'] as $phoneContact) {
$numbers[] = [
'BOOKMARK1' => $phoneContact['phoneContactType']['description'],
'BOOKMARK2' => $phoneContact['phoneNumber'],
'type' => $phoneContact['phoneContactType']['id']
];
}
usort(
$numbers,
function ($a, $b) {
$types = [
PhoneContact::TYPE_PRIMARY => 1,
PhoneContact::TYPE_SECONDARY => 2,
];
if ($types[$a['type']] == $types[$b['type']]) {
return 0;
} elseif ($types[$a['type']] < $types[$b['type']]) {
return -1;
} else {
return 1;
}
}
);
for ($i = 0; $i < count($numbers); $i++) {
unset($numbers[$i]['type']);
}
}
$numbers = array_pad($numbers, 5, ['BOOKMARK1' => '', 'BOOKMARK2' => '']);
$rows = array_merge($header, $numbers);
$snippet = $this->getSnippet('CHECKLIST_2CELL_TABLE');
$parser = $this->getParser();
$str = '';
foreach ($rows as $tokens) {
$str .= $parser->replace($snippet, $tokens);
}
return $str;
}
}
| 28.622449 | 89 | 0.438859 |
33f06b203676f96e2649b7516d69fdc35148c983 | 2,101 | c | C | games/hack/hack.rip.c | ivadasz/DragonFlyBSD | 460227f342554313be3c7728ff679dd4a556cce9 | [
"BSD-3-Clause"
] | 48 | 2015-04-05T13:47:38.000Z | 2022-01-13T18:32:19.000Z | games/hack/hack.rip.c | jorisgio/DragonFlyBSD | d37cc9027d161f3e36bf2667d32f41f87606b2ac | [
"BSD-3-Clause"
] | 8 | 2015-04-15T19:15:41.000Z | 2021-09-20T16:18:43.000Z | games/hack/hack.rip.c | jorisgio/DragonFlyBSD | d37cc9027d161f3e36bf2667d32f41f87606b2ac | [
"BSD-3-Clause"
] | 13 | 2015-09-05T14:25:18.000Z | 2022-01-30T21:28:27.000Z | /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* hack.rip.c - version 1.0.2 */
/* $FreeBSD: src/games/hack/hack.rip.c,v 1.4 1999/11/16 10:26:37 marcel Exp $ */
/* $DragonFly: src/games/hack/hack.rip.c,v 1.4 2006/08/21 19:45:32 pavalos Exp $ */
#include "hack.h"
static void center(int, const char *);
static char rip[][60] = {
" ----------",
" / \\",
" / REST \\",
" / IN \\",
" / PEACE \\",
" / \\",
" | |",
" | |",
" | |",
" | |",
" | |",
" | 1001 |",
" *| * * * | *",
" _________)/\\\\_//(\\/(/\\)/\\//\\/|_)_______\n",
};
static const int n_rips = sizeof(rip) / sizeof(rip[0]);
void
outrip(void)
{
char *dpx;
char buf[BUFSZ];
int j, x, y;
cls();
strcpy(buf, plname);
buf[16] = 0;
center(6, buf);
sprintf(buf, "%ld AU", u.ugold);
center(7, buf);
sprintf(buf, "killed by%s",
!strncmp(killer, "the ", 4) ? "" :
!strcmp(killer, "starvation") ? "" :
strchr(vowels, *killer) ? " an" : " a");
center(8, buf);
strcpy(buf, killer);
if (strlen(buf) > 16) {
int i, i0, i1;
i0 = i1 = 0;
for (i = 0; i <= 16; i++)
if (buf[i] == ' ')
i0 = i, i1 = i + 1;
if (!i0)
i0 = i1 = 16;
buf[i1 + 16] = 0;
center(10, buf + i1);
buf[i0] = 0;
}
center(9, buf);
sprintf(buf, "%4d", getyear());
center(11, buf);
for (y = 8, j = 0; j < n_rips; y++, j++) {
x = 0;
dpx = rip[j];
while (dpx[x]) {
while (dpx[x] == ' ')
x++;
curs(x, y);
while (dpx[x] && dpx[x] != ' ') {
if (done_stopprint)
return;
curx++;
putchar(dpx[x++]);
}
}
}
getret();
}
static void
center(int line, const char *text)
{
const char *ip = text;
char *op;
op = &rip[line][28 - ((strlen(text) + 1) / 2)];
while (*ip)
*op++ = *ip++;
}
| 23.344444 | 83 | 0.39743 |
beabbb0fde89f554970b79f8eed99175783e7049 | 678 | tsx | TypeScript | src/shared/components/ReviewDetails/ReviewDetails.tsx | ChiranjibNandy/n11-delta-bookshelf-frontend | 0ff79f354c6d3fb588958f1d94f20b75a47e2b2d | [
"MIT"
] | null | null | null | src/shared/components/ReviewDetails/ReviewDetails.tsx | ChiranjibNandy/n11-delta-bookshelf-frontend | 0ff79f354c6d3fb588958f1d94f20b75a47e2b2d | [
"MIT"
] | null | null | null | src/shared/components/ReviewDetails/ReviewDetails.tsx | ChiranjibNandy/n11-delta-bookshelf-frontend | 0ff79f354c6d3fb588958f1d94f20b75a47e2b2d | [
"MIT"
] | null | null | null | import {ReadMore} from "..";
import {Review} from "../../models";
import {MemoizedRatingBox} from "../RatingBox/RatingBox";
import styles from "./ReviewDetails.module.scss";
export const ReviewDetails = ({review}: {review: Partial<Review>}) => {
return (
<div className={styles.reviewLayout}>
<div className={styles.heading}>
<MemoizedRatingBox small="true" roundOff="0" rating={review.rating} />
<div className={styles.title}>{review.title}</div>
</div>
<div className={styles.msg}>
<ReadMore limit="100">{review.message}</ReadMore>
</div>
<div className={styles.userInfo}>{review.userName}</div>
</div>
);
};
| 33.9 | 78 | 0.640118 |
c0e11c2f11909a26a38d6389dfed485bfde591e1 | 1,013 | ps1 | PowerShell | scripts/opencppcoverage/tools/chocolateyinstall.ps1 | Guekka/bsa | 513ea4f5213635e04cbb9383b3fe7e67261e45dc | [
"MIT"
] | 16 | 2020-02-13T05:46:18.000Z | 2022-01-15T06:25:09.000Z | scripts/opencppcoverage/tools/chocolateyinstall.ps1 | Guekka/bsa | 513ea4f5213635e04cbb9383b3fe7e67261e45dc | [
"MIT"
] | 9 | 2021-08-03T18:51:29.000Z | 2022-03-04T14:23:16.000Z | scripts/opencppcoverage/tools/chocolateyinstall.ps1 | Guekka/bsa | 513ea4f5213635e04cbb9383b3fe7e67261e45dc | [
"MIT"
] | 6 | 2020-07-26T01:15:24.000Z | 2021-12-11T22:04:42.000Z | $ErrorActionPreference = 'Stop';
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$url = 'https://github.com/OpenCppCoverage/OpenCppCoverage/releases/download/release-0.9.9.0/OpenCppCoverageSetup-x86-0.9.9.0.exe'
$url64 = 'https://github.com/OpenCppCoverage/OpenCppCoverage/releases/download/release-0.9.9.0/OpenCppCoverageSetup-x64-0.9.9.0.exe'
$packageArgs = @{
packageName = $env:ChocolateyPackageName
unzipLocation = $toolsDir
fileType = 'exe'
url = $url
url64bit = $url64
softwareName = 'opencppcoverage*'
checksum = 'D6CE9F61457AC084DEFC7A37B383E81CEEB01EF30933E104017DB9F33BC3AB05'
checksumType = 'sha256'
checksum64 = '2295A733DA39412C61E4F478677519DD0BB1893D88313CE56B468C9E50517888'
checksumType64 = 'sha256'
silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
validExitCodes = @(0)
}
Install-ChocolateyPackage @packageArgs
Install-ChocolateyPath "$($env:SystemDrive)\Program Files\OpenCppCoverage" 'Machine'
| 38.961538 | 132 | 0.753208 |
dbd36e8530252c241298cfe3890650cc12d39d36 | 1,871 | lua | Lua | steamypb.lua | NotQuiteApex/LoveJam21 | a0bca7654a0189521147cd0729a59a2f4792bc61 | [
"Zlib"
] | null | null | null | steamypb.lua | NotQuiteApex/LoveJam21 | a0bca7654a0189521147cd0729a59a2f4792bc61 | [
"Zlib"
] | null | null | null | steamypb.lua | NotQuiteApex/LoveJam21 | a0bca7654a0189521147cd0729a59a2f4792bc61 | [
"Zlib"
] | null | null | null | steamypb = class:new()
steamypbs = {}
local pb_spr = polygon.new("soda/ui_steamypb.soda")
local maxradius = 450
local radiusvel = 1000
function steamypb:init(x, y, dir)
self.x = x
self.y = y
self.yv = -300
self.radius = 1
self.dir = dir
self.state = "throw" -- throw, explode
bumpwrld:add(self, self.x, self.y, 30, 30)
end
function steamypb:update(dt)
random_color = math.random()
if self.state == "throw" then
self.x = self.x+ self.dir*600*dt
self.y = self.y + self.yv*dt
self.yv = self.yv + 20*60*dt
else
self.radius = self.radius + radiusvel * dt
bumpwrld:update(self, self.x-self.radius/2, self.y-self.radius/2, self.radius, self.radius/2)
if self.radius > maxradius then
self.deleteself = true
end
end
local function filter(i, o)
if self.state == "throw" and o.type ~= "player" then
return "touch"
else
return "cross"
end
end
local ax, ay, cols, len
if self.state == "throw" then
ax, ay, cols, len = bumpwrld:move(self, self.x, self.y, filter)
else
ax, ay, cols, len = bumpwrld:move(self, self.x-self.radius/2, self.y-self.radius/2, filter)
end
local o
for i, v in ipairs(cols) do
o = v.other
if self.state == "throw" then
if o.type == "ground" or o.isEnemy then
self.state = "explode"
sfx_explode:clone():play()
ay = ay + 30
break
end
else
if o.isEnemy then
o:damage()
end
end
end
self.x = ax+self.radius/2
self.y = ay+self.radius/2
end
function steamypb:draw()
if self.state == "throw" then
lg.push()
lg.translate(self.x-15, self.y-15)
lg.scale(0.3, 0.3)
polygon.draw(pb_spr)
lg.pop()
else
lg.setColor(1, random_color*0.75, 0, 1)
lg.rectangle("fill", self.x-self.radius/2, self.y-self.radius/2, self.radius, self.radius/2)
lg.setColor(1,1,1)
end
end
function steamypb:damage()
end
function steamypb:delete()
bumpwrld:remove(self)
end
| 20.336957 | 95 | 0.660075 |
5da8da04f30037a3ebffb28d5b021149c11fed2d | 951 | cpp | C++ | 2017-08-19/C.cpp | tangjz/Three-Investigators | 46dc9b2f0fbb4fe89b075a81feaacc33feeb1b52 | [
"MIT"
] | 3 | 2018-04-02T06:00:51.000Z | 2018-05-29T04:46:29.000Z | 2017-08-19/C.cpp | tangjz/Three-Investigators | 46dc9b2f0fbb4fe89b075a81feaacc33feeb1b52 | [
"MIT"
] | 2 | 2018-03-31T17:54:30.000Z | 2018-05-02T11:31:06.000Z | 2017-08-19/C.cpp | tangjz/Three-Investigators | 46dc9b2f0fbb4fe89b075a81feaacc33feeb1b52 | [
"MIT"
] | 2 | 2018-10-07T00:08:06.000Z | 2021-06-28T11:02:59.000Z | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;
const int NMAX = 31;
int T, N;
int adj[NMAX][NMAX];
int main()
{
int i, j, k, t;
bool flag;
scanf("%d", &T);
for(t = 0;t < T;t += 1)
{
flag = true;
scanf("%d", &N);
if(N >= 6)
{
for(i = 1;i <= N;i += 1)
{
for(j = 1;j <= N - i;j += 1)
scanf("%*d");
}
}
else
{
for(i = 1;i <= N;i += 1)
{
for(j = 1;j <= N - i;j += 1)
{
scanf("%d", &adj[i][i + j]);
adj[i + j][i] = adj[i][i + j];
}
}
}
if(N >= 6)
printf("Bad Team!\n");
else
{
for(i = 1;i <= N;i += 1)
{
for(j = i + 1;j <= N;j += 1)
{
for(k = j + 1;k <= N;k += 1)
{
if((adj[i][j] && adj[j][k] && adj[k][i])
|| (!adj[i][j] && !adj[j][k] && !adj[k][i]))
flag = false;
}
}
}
if(flag)
printf("Great Team!\n");
else
printf("Bad Team!\n");
}
}
exit(0);
}
| 14.630769 | 51 | 0.392219 |
e72ca7107a008a3665cde599a2265c16e54d4320 | 2,652 | php | PHP | shuipf/Template/Default/Content/Show/show.php | rentianhua/tsf | 5aa420b063bf8bee20c2954963b7c8bf6f5b846b | [
"MIT"
] | null | null | null | shuipf/Template/Default/Content/Show/show.php | rentianhua/tsf | 5aa420b063bf8bee20c2954963b7c8bf6f5b846b | [
"MIT"
] | 131 | 2017-04-10T06:10:03.000Z | 2017-12-06T10:27:02.000Z | shuipf/Template/Default/Content/Show/show.php | rentianhua/tsf | 5aa420b063bf8bee20c2954963b7c8bf6f5b846b | [
"MIT"
] | null | null | null | <template file="Content/header.php"/>
<template file="Content/nav.php"/>
<style>
.max-wrapper {
/*background-color: #f1f1f1;*/
border-top: 1px solid #f1f1f1;
clear: both;
padding-bottom: 80px;
position: relative;
top: -1px;
}
.max-wrapper .wrapper {
position: relative;
}
.wrapper {
margin: 0 auto;
width: 1000px;
}
.fl {
float: left;
}
.max-wrapper .menu_fixed {
position: fixed;
top: 15px;
}
.max-wrapper .menu {
background-color: #fff;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
width: 255px;
}
.max-wrapper .menu {
background-color: #fff;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
width: 255px;
}
.max-wrapper ul {
padding: 0;
margin: 0;
}
.max-wrapper .menu li {
border-bottom: 1px solid #f5f5f5;
line-height: 60px;
list-style: none;
}
.max-wrapper .menu li i {
display: inline-block;
height: 21px;
margin-left: 22px;
margin-right: 10px;
position: relative;
top: -3px;
width: 21px;
}
.max-wrapper .menu li a {
color: #555;
font-size: 14px;
}
.max-wrapper .hover {
background-color: #ED1B24;
color: #fff;
}
.max-wrapper .menu .hover a {
color: #fff;
}
.max-wrapper .count {
background-color: #fff;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
height: auto;
min-height: 400px;
padding: 30px 40px;
position: relative;
width: 728px;
}
.fr {
float: right;
}
.max-wrapper .count .name {
border-bottom: 1px solid #f5f5f5;
color: #333;
font-size: 22px;
height: 75px;
}
.max-wrapper .count .contactUs {
padding: 35px 0 20px;
}
.clear::after {
clear: both;
content: ".";
display: block;
font-size: 0;
height: 0;
line-height: 0;
visibility: hidden;
}
.clear {
display: block;
}
</style>
<div class="max-wrapper">
<div class="wrapper">
<br><div>当前位置:<a href="{$config_siteurl}">{$Config.sitename}</a> > <navigate catid="$catid" space=" > " /></div><br>
<div class="fl menu menu_abs">
<ul>
<content action="lists" catid="$catid" order="listorder ASC">
<volist name="data" id="vo">
<li class="aboutLj <?php if($vo['id']==$_GET['id']){echo "hover";}?>"><i class="am-icon-pagelines"></i>
<a href="{$vo.url}">{$vo.title}</a>
</li>
</volist>
</content>
</ul>
</div>
<div class="count fr">
<div class="name">{$title}</div>
<div class="contactUs">
{$content}
</div>
</div>
<div class="clear"></div>
</div>
</div>
<template file="Content/bottom.php"/>
<template file="Content/footer.php"/>
<template file="Content/sidebar.php"/>
| 21.047619 | 124 | 0.578808 |
c4c097d367481bfdb40a6fdfc522bb94a6b33db3 | 13,071 | cpp | C++ | data/627.cpp | TianyiChen/rdcpp-data | 75c6868c876511e3ce143fdc3c08ddd74c7aa4ea | [
"MIT"
] | null | null | null | data/627.cpp | TianyiChen/rdcpp-data | 75c6868c876511e3ce143fdc3c08ddd74c7aa4ea | [
"MIT"
] | null | null | null | data/627.cpp | TianyiChen/rdcpp-data | 75c6868c876511e3ce143fdc3c08ddd74c7aa4ea | [
"MIT"
] | null | null | null | int AJ,vaBae
,//y38
uvxYkLF , x94ea
, u1, u5//D
,JtNU ,/*Q*/
UR , ajM0,
Fuz
/*bOM*/, A, otxhG,ny ,/*DFb*/wLF /*gk*/,V,Ol ,w2s, Tf
,/**/SI7,
Ae4Z
,kw,
l1, f,aVQR ,WwiI
, md, z3BV8p
,Ko9i//6b
,FBUU9 ,SI2Uo ,//te
CMoBR,B3Jr ,
WKM, GOTsm/**/, Ks2 ,R , //X
Bjd ,Tmd
/*D*/
,
RDy9d ,
Z2eEw
,pJ7
,
ULa3J ,k9d , QKvV ,
VF5E4N
;
void
f_f0() {volatile int
o9 ,RbZ/*Pmc*/
,PV,
NaMa , bg
;if( true )
if(
true )
{{if(true )
{{int ticc,
V9 ;volatile int X7r/*I*/,cke , yN
; if(
true)V9 = yN +
X7r ;else ticc= cke; } }else ;
{{ return
; }
}/*Af4y*/{ int k5fL ;
volatile int m,xO1, sls;if//w
(
true/*4f*/
)
if ( true)
if//B
(true){ }else return ;
else ;else ;for/*pa4Y*/
(int i=1; i<1 ;++i )
k5fL= sls/**///8u
+ m+xO1 ;{
{
}}return ;}{//YcjP
;
{
{ /*C*/} { } } {
}}}
for //
(int i=1
;i<//
2
;++i//Fw40
){ volatile int MoZ0
, UT
,Y;
if( true
) ;/*FZtK*/ else//vu8c
{
int LNri; volatile int gZUho , dRH
,
V6z ;return ; LNri
=
V6z +gZUho/*w*/ +
dRH
; }
VF5E4N //BGc
= Y +
//a8aa
MoZ0+ UT ;
}for(int i=1;i< 3//j
;++i
)
{
volatile int xR7E ,nisr
,bGd ,lz , LM5
;if(
true) for (int i=1;i<4;++i) return ; else
AJ= LM5+ //qd
xR7E +nisr +bGd+lz;
{
{{ } {{}} { }} return ;};}}else
return
;else vaBae
=
bg
+ o9 + RbZ
+
PV
+
NaMa; {{
return ; return ;
}
for
(int i=1; i< 5
;++i
)return
;/*a*//*VWi*/;
{{//Bup
//w
volatile int uiY6,Sgk
, /**/EuPh ,//iA
Lm
; {
//XRvPV
} uvxYkLF =
Lm /*tE*/+uiY6+ /*y*/Sgk+
EuPh ;{} for(int i=1 ; i< 6//5k8C
;++i)
{ ; }
}{{ volatile int//i5N
ha4/*IF*/, nNh ,s50b ; {
}/**/ x94ea
=s50b
+ha4+
nNh//JL9
;}for(int i=1 ; i< 7
//j
;++i)return ;
} {{ if
( true
){}else{
}{for
(int i=1; i< 8 ;++i/*X*/ )//r
for(int
i=1
;i< //KhdC
9;++i )return
/*Umbrx*/ ;}
} }if( true )
{ for
(int i=1; i<//8ET
10 ;++i)//7J
//iU2
; if
(
true ){{ return ;}{ } }else
return //cD
;
} else
{
/*cpE*/volatile int
NfLMr , j0iC; ;u1 =j0iC + NfLMr ;
{ }}} }; for (int //gv
//blu
i=1
;
i<11 ;++i
) { {; {for (int i=1;
i<12;++i ){ //Ruy2
{ }
}for (int i=1//RqE
; i<13
;++i );{ return ;}
}{{} }} return ;
return//Dv2
; { {volatile int
fX ,
VejTz; for(int i=1 ; i<
14 ;++i);return
;
{ }
return ; if(true ) if (
true) {
;
}
else u5
=
VejTz +
fX/*1*/
;else return ;};}}return ; }void f_f1(){ volatile int w3n ,
rc4 ,QtaQ, A8
,EwE
, r9 ;for /*Q*/(int i=1/*z3*/
;i<15;++i ) {int eA2m
; volatile int oDETT,
Ne,
UP
,Vg/*5*/ , Fc,S
,
Ma0Y ,x3OJc6
,Gfq0 ;
{
{{}/*y*/ {
}/*GFyS*/{;
{
} return/**/ ;} for/*eA*/ (int
i=1
;i<16
;++i)return ; {} }
{
if (true)
{ if/*h*//*hiAGz*/(true
) //
return ;//ZaF
else {
{}
}
} else {}{}
{ {volatile int nPZ
;{}if (/*f*/
true) ; else JtNU
= nPZ
;}}{volatile int HMf,Z,//v
jeg; UR
=jeg + HMf +Z ;} { } }
for(int
//no
i=1//a
; /*Gk*/ i<
17;++i )return ; {
{}
} /*8*/}
ajM0=//8n7
Gfq0+ oDETT +Ne+ UP+Vg ;
for(int i=1 ; i< 18;++i
)
{volatile int
GY,ZCt//E1
,
//JG
KGF5
,SxK
;if (
true
)
Fuz =SxK +
GY+//9
ZCt+KGF5;else/*asVQ*/ {; for(int i=1;i<19
;++i )
{ {}{{ } if (true) {}else{}}} }if (true )
for(int i=1; i<20/*48v*/ ;++i
)/*s*/for
(int
i=1;i<
//q
21;++i ) if
(
true )
return ;else{
int I47
,
KS
;
//
volatile int O ,Xh, kodB , GooBuNt
;KS = GooBuNt+
O; I47 //W
=
Xh//EfzL
/*2uba*/+
kodB ;{ {
}
{
{
}{
volatile int urt;for(int i=1 ;
/*ELO0*/i< 22
;++i) A =urt ;//gQsh7
}
}return ;} } else{int MG/*fUs*/;
volatile int byApK , vg4mD,Gjzp , VVX ;for
(int
i=1; i<23;++i ){/*KY*/{ }
}MG =VVX+ byApK+vg4mD+/*70*/
Gjzp ;return /*2DJ*/ ;}
}{
for//aw
(int i=1 ;
i<24 ;++i)
return
; for//a08E
(int i=1
;i<
25 ;++i
) { for (int i=1;i<26;++i)//
{ {}
}}} {//07Z
;; return
;}
eA2m =
Fc +
S +Ma0Y +x3OJc6 ; } { volatile int
//H
gI4,
Paukv, l/*p*/, /*kuD*/T,
Ki
;/*Q*/
return ;otxhG
=
Ki +gI4//NWo
+
Paukv +l
+T
;
return ; {
volatile int
T5D , FTS,/*ZziVK*/PEJ ;
ny =
PEJ+
/*iZ1H*/ T5D//gyU
+FTS ;
;{{ int gH3//SR
;//8
volatile int HxQH,
//vd
fn , TckB
;
gH3= TckB/*os*/
+
//0
HxQH+fn;
for(int i=1;i< //
27 ;++i
)
return
;{ }}; {
for(int i=1;i< 28
;++i ) { } }{int UY;volatile int
Aw,in//Mn
;//TUF
{ //7rW
/*x*/}
for
(int i=1
;i</*Enw*/29;++i)UY= in+ Aw ;} }
}{ volatile int ubOEWn,X,
v33l,
Gn ;
wLF
= Gn+ ubOEWn +
X
+v33l;;{ //c
{}{
}; ;} } }
{ volatile int LgNjUb
,iJz, v/*1p*/,z
; {
;return ;
{
{
return ;} {;}
{ //k
}
}} { volatile int/*zc*/ cn//dcdo
, /*N1m*/Ck ,Y91A, HVF;
{{ volatile int FiZh;
V= FiZh;//XfS
}} for(int
i=1;
i<
30 ;++i)
Ol /*G*/
=HVF+ cn
//GzzF
+//lk
Ck +
Y91A;{
int
Tw;
volatile int
Knp ,
f3h//T5u
,SaO,
Vf
, AJr ,/**/RD6//
;
{} Tw= RD6 +
Knp /*gvP*/+f3h;{; } w2s=SaO
+ Vf +AJr//G
;} for(int i=1; i< 31;++i);} {{
{/*Fd*/ {}}}return ;
}Tf =z+ LgNjUb
+iJz+
v ;
{{ for (int i=1 ; i<32//2N
;++i ) for/*Q*/(int i=1
;i< 33 ;++i){
;}
}
{volatile int Rv, rdV3,Q0U;
SI7
=Q0U +
Rv +rdV3 ;{
}
} { return ; return ; {
{ }
;return ;/*uD*/{
}}}
{{
}{/*5F*/{
{ }
/*niC*/}}
}} {
{/*7vy*/;} {/**/for(int i=1 ;i<34
;++i) ; } for(int i=1
;i< /*b7g35*/35;++i){{ int zkjR
;volatile int YF,
HVN2O2z;zkjR
//
= HVN2O2z +YF;
for
(int
i=1
;i<36;++i) {}for (int i=1 ;/*T*/
i< 37;++i )
{
}{ }}for(int
/*vd*/ i=1 ; i<38;++i)if(true )
return/*VY*/ ;else ;
{ }}
}}
{{ {
{{}} //GoKfwy
;
{
}}for(int
i=1 ; //AWK6
/**/i< 39
;++i
)if(
true )
{ { }//Acp
} else ;
} { {{; {} }
} for(int
i=1
;
i<40 ;++i)
{int Q8WA ;volatile int/*Stv*/ M0wk0,
gz,FLnW/*Vf*/, z9K,/*qs*/ o5Tme/*uW4*/ , YZ
; /*E*/Ae4Z=
YZ+//yVp
M0wk0 +
gz
; if
( true ) ;
//
else for(int i=1
;
i<41;++i )
{} Q8WA=FLnW +z9K
+ /*T*/ o5Tme;
} }for (int i=1;
i<42
;++i) {{ return ;/*Kg*/ }{int
QF3jR ;volatile int ce62, hD8S
;
{} for//ZVcof
(int i=1
;i<43 ;++i)
;QF3jR
=hD8S +ce62 ;}}if ( true) {for (int i=1; i< 44
;++i ) //t
; {{}/*hv*/
{
{;{} return
; }} } } else
if(true)
{
//7
volatile int/*loF*/ Nr , B99lL, m0qN
, gk;
{ {
for/*JFK*//*vSCh*/ (int i=1; i<45;++i){//KtP
//0
}} {
} }if(true
){ //S7Jw
for (int
i=1//e8
;i<
46 ;++i) {volatile int/*71*/ MJWY
, Yh8L ,//
eJe;if ( true)
/*Wx*/ { }/*k*/else ;kw=
eJe +
MJWY+Yh8L ;
}
{for(int i=1
; i<
47;++i )
if
(true
)/*s*/
if ( true) return ;else{ for(int
i=1
;i<48 //SA
;++i)/*j*/ {
}
} else
{}{{}} }/**/} else l1 =gk
+//X
Nr+ B99lL+
m0qN
;{
/*M*/if/**/ (
true ){int Q7sa; volatile int/**/ e5,XojCf
; { } if(
true)Q7sa=
XojCf
+ e5
; else for(int i=1;i<49 ;++i ) return ;
}
else
for(int i=1 ; i<50;++i)
{
}}} else {
volatile int l0k,zaQZ,jqbHg2;//W5s
{if
( true
); else if (true){ }else
{{ }/*Hc*/} //M
{{{ }
}
}}
for//8aYZ
(int /*gY*/i=1; i< 51
;++i
) f/**/=
jqbHg2+
l0k+zaQZ/*8j*/ ;
for(int i=1;i<
52 //Bh
;++i){{{ }
} if
(
true )for
(int
i=1; i< 53
;++i/*z*/
) {//uOp
/*u*/{}}else {volatile int BGbu ,
Waeb;aVQR
= Waeb +BGbu ; } {//
{ } } } }}
WwiI = r9+w3n+ rc4
+ QtaQ +
A8+ EwE; return ;
return
; }void f_f2(){volatile int lo ,fkF
,
rMz,
OQt,nSgRK8 ; md= nSgRK8 +
lo//MUy
+
fkF +
rMz +OQt
; {
; {{for (int i=1
; i< 54;++i
) {
if
(true
//4l
)
{} else /*1L1*/ return ; return
;
return ;}
}{;{; {} if(/*B*/true ){volatile int wdi, PPg
;
return ;
z3BV8p = //E
PPg/*Q9d*/+/*m29*/
wdi ;} else //I
{}
} }return
;
/*i*/ return ;}for(int i=1;i<
55;++i) {volatile int//8f
pud,iWfNS,
khP/*b2I*/, sPu05Wo ; {; ;
{{ }for(int
i=1;i<56
;++i)
{/*m*/} {}{{ } ;}
}} return ;for
(int /*k*/i=1 ;i< 57 //sfl
;++i
){volatile int
b7 ,O0nEm,ILPJU; {
int B0 ;volatile int
/**/ hUlV, L ,
lP3zc; B0= lP3zc+ hUlV +L
; return ; }Ko9i= /*8o*/ILPJU +b7+O0nEm ;
;{}}
{ int sKOZ ;volatile int CqsXp ,
GReG,b ;sKOZ = b
+
CqsXp+GReG ;{
return ;} }
/**/
FBUU9 =
sPu05Wo /*So*/+
pud +iWfNS
+khP;} if(true)/*9p8*//*T*/{
{ int pRS; volatile int h4
,G2
;pRS//3
=
G2 +
h4 /*MM6*/ ; return ; } if(true)return ; /*A*/else if(true)
{{for
//Z
(int i=1 ;i< //l8BZ
58;++i)
{ }
}for
(int i=1 ; i<59;++i ) { } }else
for (int
i=1 ;
i<
60;++i ){{ { } } {/*UU*/volatile int
F31
;SI2Uo
=F31;}} } else
return
;
}
{ if//44jbl8y
(
/*YlE*/true)
{
for(int
i=1
;i<
61 ;++i/*EE6*/) { { {volatile int uq,
V6; for
(int /**/i=1 ;
i< 62;++i ) {
for (int i=1 ;
i<63;++i)
return
; }CMoBR
//o
= V6 +uq;}}{ { //dh
}} {
{
return ;
{
}
;}}
} { int ey ;volatile int gN
, tpIMK//XeC
,
cQ3I, OGU
;
ey =OGU +
gN + tpIMK
+ cQ3I ;
return ;}/*EL*/{{
for/*rEV*/
(int //
i=1 ;i<64/*Yysn*/;++i) ;/*C2i*/}{
for (int i=1;
i< 65
;++i )
{ }/*HPf*/} for
(int i=1//a
; i</*Z*/ 66;++i
) { }{ int
S6M9 ;volatile int au
/**/ , s ;{ } if
( true
) S6M9
= s+ au
;else
{}}}{for//kHl
(int i=1
;
i<67 ;++i)
{
if(
true ) ;else{}
}}}else{{
int SVN7; volatile int MFz
, hS3J
,RS2 ; if( /*xVAU*/true
){
}else if(true){{ { if( true
) { }else/*Vy*/ if(
true ) return ;//G
else{}
} //kz
}
} else ;SVN7
=//
RS2 +
MFz +hS3J; }//cK
{
if( true ){
/*mr1*/int GafAJ;
volatile int
kZ,Fihkt, e3rU
,Q; GafAJ=Q+kZ+Fihkt//RJ
+e3rU
; }else for(int
i=1
; i<
68;++i) {/*FCE*/volatile int FU7B
,BcB ,
F1Zq ;B3Jr=F1Zq +FU7B
/*ei*/+ BcB
/*h*/; }//jGy
{;}
{
{}//ty
} /*lX3*/}}
return
;{
if//
(true
)
; else{ return
;} //32
if(true){ {} {
{ /*tg6D*/ } //c
/*xj4m*/if
(true ) if (
true
)return
;
else{}
else {}}
} else ;{ if (true//vs1Q
)
return ;else{
{ }
}}} }
;return ; } int//m
main (){
volatile int
XSj,//i
g, //V
NtL//Ujb
,ph
,
yl
; { {/*cBMQ*/int
XnvYZ
; volatile int
z5bB,UU, q,//MDN
qp , jiw, Gb
,sF
; {{ { }//
} //R
//m
{ if
(
true
) ; //gM
/*qm*/else{//xGn
}/*zs*/{int ik;volatile int e;{
} ik = e;
}}//W
return 930134187 //
; }{ volatile int
kb78P ,
ZVNKO /**/; if
( true) //5
WKM =
ZVNKO+
kb78P//GkqYBn
;else/*4l*/ return 478038699;}//pJ
GOTsm=
sF +z5bB+UU
+q ;if//
(true) /*jbc*/XnvYZ/*LCKh*/=qp
+jiw+ Gb
;else{volatile int Zj , KGszh,Mz, Xe ;{} { } Ks2/*tP*/=Xe
+Zj
+KGszh+//
Mz ;}
}{/**/ for (int i=1
;i<
69;++i//vPV
){
volatile int MJ6
,
kO1xn6
; {volatile int m7mS4//fvZ
,
A2;
for
(int
i=1 ;i< 70 ;++i){{}for(int
i=1//3D
; i<
71//VH
;++i
)
return 46971695
;} if (
true ) {
; }
else if( true ) R/*Q48d*/
/*5TwJ2*/ = A2 +
m7mS4; else/*a*/{
}
{{} }
}
Bjd/**/=kO1xn6 +MJ6; return
1482348458;}for(int i=1
;i<72;++i) {//t
int Aca ;
volatile int FN2i,Pii8 ,
Li0DW ,G5 ;
{ {
int p;/*Ic*/volatile int lu1,gPe , BNJ4;return 293325026
;if
(true )p
=/*P*/ BNJ4 ;else if
( true) for
(int i=1;i< 73 ;++i ){ }else Tmd/*G8g*/=
lu1
+
gPe
; }
}
Aca =G5+
FN2i +Pii8+
Li0DW ;} if(true ){{ { if(
true);else
{}
{ }
} }} else if ( true ){//xPIo
if( true) return/*IT*/ 1538199053; else { {{{}} }} { } }
else {
{ }/*g7*/}}for
(int
i=1;i<74;++i )
{ if/**/( true) { int aB
;volatile int mN3 ,GLt;
aB=GLt
+mN3 ;}else if
(true )if
(true ) {volatile int
N10 ,/*YK*/
wU0d , n2Q
,
NMIB ;
RDy9d=NMIB
+N10 +wU0d+ n2Q;{ {
//4
{ }{} if(true
) {} else ; } } ;
}else
{for(int //DXj
i=1 ; i<75;++i ) {/*9b8*/return 2095662402 ; if(true
)if
( true
)//
;else return 1018612394
;
else for (int //z
i=1
;i<76
;++i ) {
{ }}}}
else //v
return 1774500152 ; {//yZQ
/*rd*/;}return 785199703
;}/*TBA*/} ;{ int
iJu
;
volatile int Rid28a,
dD ,lawf, jwO8Pc; { int hz;/*C*/ volatile int
jp
,//jTa
o,XoF,
lY
/**/; hz=lY+
jp
+o +XoF;
{{
}
{
}for (int
i=1; i<77 ;++i) { ; { int sf5w,Pvekk67 ; volatile int MBU2
,//
IDI,
hvM; for(int i=1;i< 78;++i//9Q
)Pvekk67
=hvM
;
sf5w = //lg
//k
MBU2+ IDI;; } if( true)
if ( true)return //DF
1232281831
; else for(int i=1 //k
;i<79 ;++i/*QAGq*/
) { }else {}//tKU
} } }
//N
{ int
G ; volatile int Niedt, tDAb , pba;return 92264665 //u2
;
if (true)
{ for(int
i=1
; i<
80
;++i/*oA*/){volatile int lO0p
;
Z2eEw =lO0p;
}} else
G =pba+Niedt+tDAb
;
;//c
/*fg*/}if( true
)if(
true )for
(int i=1//L
; i</*btyamH*/ 81;++i)/*Z3M*/ {
{{
{
}{
{}return 327558265 ;
} ;/**/
} }return 1572568547;}
else iJu
= jwO8Pc
+ Rid28a+
dD
+lawf
;else
for (int i=1
; i<
82 //U
;++i ){return
159735872//vag
//ep
; ;}
return 551747984 ; {
{
{
{
} ;{;} {}
}if( //mD
true);
else {
//
{
}/*2oG*/}{ return
1790378835; { ;
}}}
{for
(int i=1;
i< 83;++i){
} } {
for(int /*5*/ /*dO*/i=1 ;i<84 ;++i
){ } if(
true/*C4N*/ ) { {
} ;{
} } else{ {/*qopE*/ }{ }//
} }{/*p8Uk*/ for(int i=1 ;
i<85
;++i
)/*09q*/;//n1FN
}
{//TRf
volatile int lBG , Cq , cmPES
;
for
(int i=1 ;//
i< 86 ;++i //zhb
)pJ7 = cmPES + lBG
+
/*Z*/ Cq;
}if
(true )
{//e9fY1H
;} else //sz
{ {
{} }}//
}
} ULa3J = yl +XSj +g+
NtL
+ ph;{volatile int kl, IBy6,lD2u6QI,RsfHt
,KQ,VT
,//T
Qb, SCY ; /*KZ*//*IObjc*/k9d/*1*/=SCY+
kl +
/*7T6*/IBy6+
lD2u6QI; QKvV= RsfHt+KQ + VT + Qb/**/
; ;/*6*/}
} | 11.366087 | 66 | 0.461633 |
7f0639448459673c32ebd77a476fc89b653c1ec8 | 1,180 | cs | C# | TestExamples/TestExamples.Api/Controllers/AddressesController.cs | lucashmalcantara/test-examples-dotnet | bd77cf3cb133c7f17df7894ebc444047e00302e7 | [
"MIT"
] | null | null | null | TestExamples/TestExamples.Api/Controllers/AddressesController.cs | lucashmalcantara/test-examples-dotnet | bd77cf3cb133c7f17df7894ebc444047e00302e7 | [
"MIT"
] | null | null | null | TestExamples/TestExamples.Api/Controllers/AddressesController.cs | lucashmalcantara/test-examples-dotnet | bd77cf3cb133c7f17df7894ebc444047e00302e7 | [
"MIT"
] | null | null | null | using Microsoft.AspNetCore.Mvc;
using TestExamples.ViaCep.Domain.Entities;
using TestExamples.ViaCep.Domain.Repositories;
namespace TestExamples.Api.Controllers
{
[ApiController]
[Route("addresses")]
public class AddressesController : ControllerBase
{
[HttpGet("{zipCode}")]
[ProducesResponseType(typeof(Address), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(Address), StatusCodes.Status400BadRequest)]
[ProducesResponseType(typeof(Address), StatusCodes.Status500InternalServerError)]
public async Task<IActionResult> GetAsync(string zipCode, [FromServices] IAddressRepository addressRepository)
{
try
{
var address = await addressRepository.GetAddressByZipCodeAsync(zipCode);
return Ok(address);
}
catch (Exception ex)
{
var isGenericException = ex.GetType() == typeof(Exception);
if (isGenericException)
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
return BadRequest(ex.Message);
}
}
}
}
| 34.705882 | 118 | 0.645763 |
ffa4032bbac1d72dc701e09deefe78a2de4d4702 | 560 | py | Python | LineSketch/LineSketch.py | avinashkranjan/PraticalPythonProjects | 12c1f7cedae57a843ceb6aba68cca48df505f341 | [
"MIT"
] | 930 | 2020-09-05T22:07:28.000Z | 2022-03-30T07:56:18.000Z | LineSketch/LineSketch.py | maheshdbabar9340/Amazing-Python-Scripts | e2272048cbe49b4bda5072bbdd8479739bb6c18d | [
"MIT"
] | 893 | 2020-09-04T07:57:24.000Z | 2022-02-08T02:12:26.000Z | LineSketch/LineSketch.py | maheshdbabar9340/Amazing-Python-Scripts | e2272048cbe49b4bda5072bbdd8479739bb6c18d | [
"MIT"
] | 497 | 2020-09-05T08:16:24.000Z | 2022-03-31T00:55:57.000Z | import turtle as t
tim = t.Turtle()
scr = t.Screen()
def move_forward():
tim.forward(10)
def move_backward():
tim.backward(10)
def clockwise():
tim.setheading(tim.heading() - 10)
def anticlockwise():
tim.setheading(tim.heading() + 10)
def clear():
tim.clear()
tim.penup()
tim.home()
tim.pendown()
scr.listen()
scr.onkey(key="f", fun=move_forward)
scr.onkey(key="d", fun=move_backward)
scr.onkeypress(key="c", fun=clockwise)
scr.onkeypress(key="a", fun=anticlockwise)
scr.onkey(key="x", fun=clear)
scr.exitonclick()
| 15.135135 | 42 | 0.660714 |
abe032da6b6f51f2fb254e37050bc5e9dd1e15ae | 5,312 | sql | SQL | misc/sql/r_areas-insert.sql | common-good/rCredits | bb046bfe78d32d912766bdd307f0a39c717e90f7 | [
"FSFAP"
] | 4 | 2015-07-01T15:46:37.000Z | 2017-11-17T16:52:27.000Z | misc/sql/r_areas-insert.sql | common-good/rCredits | bb046bfe78d32d912766bdd307f0a39c717e90f7 | [
"FSFAP"
] | null | null | null | misc/sql/r_areas-insert.sql | common-good/rCredits | bb046bfe78d32d912766bdd307f0a39c717e90f7 | [
"FSFAP"
] | 3 | 2015-05-09T21:06:22.000Z | 2016-02-07T22:04:35.000Z | INSERT INTO `r_areas` (`area_code`, `region`) VALUES
('201', 'NJ'),
('202', 'DC'),
('203', 'CT'),
('204', 'MB'),
('205', 'AL'),
('206', 'WA'),
('207', 'ME'),
('208', 'ID'),
('209', 'CA'),
('210', 'TX'),
('212', 'NY'),
('213', 'CA'),
('214', 'TX'),
('215', 'PA'),
('216', 'OH'),
('217', 'IL'),
('218', 'MN'),
('219', 'IN'),
('224', 'IL'),
('225', 'LA'),
('226', 'ON'),
('228', 'MS'),
('229', 'GA'),
('231', 'MI'),
('234', 'OH'),
('239', 'FL'),
('240', 'MD'),
('242', 'Bahamas'),
('246', 'Barbados'),
('248', 'MI'),
('250', 'BC'),
('251', 'AL'),
('252', 'NC'),
('253', 'WA'),
('254', 'TX'),
('256', 'AL'),
('260', 'IN'),
('262', 'WI'),
('264', 'Anguilla'),
('267', 'PA'),
('268', 'Antigua and Barbuda'),
('269', 'MI'),
('270', 'KY'),
('276', 'VA'),
('281', 'TX'),
('284', 'British Virgin Islands'),
('289', 'ON'),
('301', 'MD'),
('302', 'DE'),
('303', 'CO'),
('304', 'WV'),
('305', 'FL'),
('306', 'SK'),
('307', 'WY'),
('308', 'NE'),
('309', 'IL'),
('310', 'CA'),
('312', 'IL'),
('313', 'MI'),
('314', 'MO'),
('315', 'NY'),
('316', 'KS'),
('317', 'IN'),
('318', 'LA'),
('319', 'IA'),
('320', 'MN'),
('321', 'FL'),
('323', 'CA'),
('325', 'TX'),
('330', 'OH'),
('334', 'AL'),
('336', 'NC'),
('337', 'LA'),
('339', 'MA'),
('340', 'USVI'),
('345', 'Cayman Islands'),
('347', 'NY'),
('351', 'MA'),
('352', 'FL'),
('360', 'WA'),
('361', 'TX'),
('386', 'FL'),
('401', 'RI'),
('402', 'NE'),
('403', 'AB'),
('404', 'GA'),
('405', 'OK'),
('406', 'MT'),
('407', 'FL'),
('408', 'CA'),
('409', 'TX'),
('410', 'MD'),
('412', 'PA'),
('413', 'MA'),
('414', 'WI'),
('415', 'CA'),
('416', 'ON'),
('417', 'MO'),
('418', 'QC'),
('419', 'OH'),
('423', 'TN'),
('424', 'CA'),
('425', 'WA'),
('430', 'TX'),
('432', 'TX'),
('434', 'VA'),
('435', 'UT'),
('438', 'QC'),
('440', 'OH'),
('441', 'Bermuda'),
('443', 'MD'),
('450', 'QC'),
('456', 'Reserved'),
('469', 'TX'),
('473', 'Grenada'),
('478', 'GA'),
('479', 'AR'),
('480', 'AZ'),
('484', 'PA'),
('500', 'Reserved'),
('501', 'AR'),
('502', 'KY'),
('503', 'OR'),
('504', 'LA'),
('505', 'NM'),
('506', 'NB'),
('507', 'MN'),
('508', 'MA'),
('509', 'WA'),
('510', 'CA'),
('512', 'TX'),
('513', 'OH'),
('514', 'QC'),
('515', 'IA'),
('516', 'NY'),
('517', 'MI'),
('518', 'NY'),
('519', 'ON'),
('520', 'AZ'),
('530', 'CA'),
('540', 'VA'),
('541', 'OR'),
('551', 'NJ'),
('559', 'CA'),
('561', 'FL'),
('562', 'CA'),
('563', 'IA'),
('567', 'OH'),
('570', 'PA'),
('571', 'VA'),
('573', 'MO'),
('574', 'IN'),
('580', 'OK'),
('585', 'NY'),
('586', 'MI'),
('600', 'Reserved'),
('601', 'MS'),
('602', 'AZ'),
('603', 'NH'),
('604', 'BC'),
('605', 'SD'),
('606', 'KY'),
('607', 'NY'),
('608', 'WI'),
('609', 'NJ'),
('610', 'PA'),
('612', 'MN'),
('613', 'ON'),
('614', 'OH'),
('615', 'TN'),
('616', 'MI'),
('617', 'MA'),
('618', 'IL'),
('619', 'CA'),
('620', 'KS'),
('623', 'AZ'),
('626', 'CA'),
('630', 'IL'),
('631', 'NY'),
('636', 'MO'),
('641', 'IA'),
('646', 'NY'),
('647', 'ON'),
('649', 'Turks & Caicos Islands'),
('650', 'CA'),
('651', 'MN'),
('660', 'MO'),
('661', 'CA'),
('662', 'MS'),
('664', 'Montserrat'),
('670', 'MP'),
('671', 'GU'),
('678', 'GA'),
('682', 'TX'),
('684', 'AS'),
('700', 'Reserved'),
('701', 'ND'),
('702', 'NV'),
('703', 'VA'),
('704', 'NC'),
('705', 'ON'),
('706', 'GA'),
('707', 'CA'),
('708', 'IL'),
('709', 'NL'),
('710', 'US Government'),
('712', 'IA'),
('713', 'TX'),
('714', 'CA'),
('715', 'WI'),
('716', 'NY'),
('717', 'PA'),
('718', 'NY'),
('719', 'CO'),
('720', 'CO'),
('724', 'PA'),
('727', 'FL'),
('731', 'TN'),
('732', 'NJ'),
('734', 'MI'),
('740', 'OH'),
('754', 'FL'),
('757', 'VA'),
('758', 'St. Lucia'),
('760', 'CA'),
('762', 'GA'),
('763', 'MN'),
('765', 'IN'),
('767', 'Dominica'),
('769', 'MS'),
('770', 'GA'),
('772', 'FL'),
('773', 'IL'),
('774', 'MA'),
('775', 'NV'),
('778', 'BC'),
('780', 'AB'),
('781', 'MA'),
('784', 'St. Vincent & Grenadines'),
('785', 'KS'),
('786', 'FL'),
('787', 'PR'),
('800', 'Toll Free'),
('801', 'UT'),
('802', 'VT'),
('803', 'SC'),
('804', 'VA'),
('805', 'CA'),
('806', 'TX'),
('807', 'ON'),
('808', 'HI'),
('809', 'Dominican Republic'),
('810', 'MI'),
('812', 'IN'),
('813', 'FL'),
('814', 'PA'),
('815', 'IL'),
('816', 'MO'),
('817', 'TX'),
('818', 'CA'),
('819', 'QC'),
('828', 'NC'),
('829', 'Dominican Republic'),
('830', 'TX'),
('831', 'CA'),
('832', 'TX'),
('843', 'SC'),
('845', 'NY'),
('847', 'IL'),
('848', 'NJ'),
('850', 'FL'),
('856', 'NJ'),
('857', 'MA'),
('858', 'CA'),
('859', 'KY'),
('860', 'CT'),
('862', 'NJ'),
('863', 'FL'),
('864', 'SC'),
('865', 'TN'),
('866', 'Toll Free'),
('867', 'YT'),
('868', 'Trinidad & Tobago'),
('869', 'St. Kitts & Nevis'),
('870', 'AR'),
('876', 'Jamaica'),
('877', 'Toll Free'),
('878', 'PA'),
('888', 'Toll Free'),
('900', 'Toll Calls'),
('901', 'TN'),
('902', 'NS'),
('903', 'TX'),
('904', 'FL'),
('905', 'ON'),
('906', 'MI'),
('907', 'AK'),
('908', 'NJ'),
('909', 'CA'),
('910', 'NC'),
('912', 'GA'),
('913', 'KS'),
('914', 'NY'),
('915', 'TX'),
('916', 'CA'),
('917', 'NY'),
('918', 'OK'),
('919', 'NC'),
('920', 'WI'),
('925', 'CA'),
('928', 'AZ'),
('931', 'TN'),
('936', 'TX'),
('937', 'OH'),
('939', 'PR'),
('940', 'TX'),
('941', 'FL'),
('947', 'MI'),
('949', 'CA'),
('951', 'CA'),
('952', 'MN'),
('954', 'FL'),
('956', 'TX'),
('970', 'CO'),
('971', 'OR'),
('972', 'TX'),
('973', 'NJ'),
('978', 'MA'),
('979', 'TX'),
('980', 'NC'),
('985', 'LA'),
('989', 'MI');
| 15.904192 | 52 | 0.366152 |
b1913a55354ed6c7d69d6c355020bf0aec1bf70b | 307 | py | Python | examples/python_only_vcp.py | Lcvette/qtpyvcp | 4143a4a4e1f557f7d0c8998c886b4a254f0be60b | [
"BSD-3-Clause-LBNL",
"MIT"
] | 71 | 2018-12-13T20:31:18.000Z | 2022-03-26T08:44:22.000Z | examples/python_only_vcp.py | adargel/qtpyvcp | 2fcb9c26616ac4effa8d92befa9e1c00a80daafa | [
"BSD-3-Clause-LBNL",
"MIT"
] | 78 | 2019-01-10T18:16:33.000Z | 2022-03-18T19:30:49.000Z | examples/python_only_vcp.py | adargel/qtpyvcp | 2fcb9c26616ac4effa8d92befa9e1c00a80daafa | [
"BSD-3-Clause-LBNL",
"MIT"
] | 38 | 2018-10-10T19:02:26.000Z | 2022-01-30T04:38:14.000Z | from qtpyvcp.widgets.form_widgets.main_window import VCPMainWindow
class PythonOnlyVCP(VCPMainWindow):
"""Main window class for the python only VCP."""
def __init__(self, *args, **kwargs):
super(PythonOnlyVCP, self).__init__(*args, **kwargs)
self.setWindowTitle("Python-only VCP")
| 34.111111 | 66 | 0.71987 |
2ac1850a994ac6facc9d44bbdeacb5c28092e059 | 40 | ps1 | PowerShell | Scripts/Nuget/Push-AspNetCore.Service.ps1 | krzysztofdudek/DecoupleIt | 6783e3c2c265eb223a791fad6c67eeb80d93b6f5 | [
"MIT"
] | null | null | null | Scripts/Nuget/Push-AspNetCore.Service.ps1 | krzysztofdudek/DecoupleIt | 6783e3c2c265eb223a791fad6c67eeb80d93b6f5 | [
"MIT"
] | 8 | 2020-11-26T20:33:11.000Z | 2020-12-03T15:34:17.000Z | Scripts/Nuget/Push-AspNetCore.Service.ps1 | krzysztofdudek/DecoupleIt | 6783e3c2c265eb223a791fad6c67eeb80d93b6f5 | [
"MIT"
] | null | null | null | .\Push-Generic.ps1 "AspNetCore.Service"
| 20 | 39 | 0.775 |
88c8e4df8393f26eb6a2960f32b0890ee24441da | 114 | swift | Swift | Tests/LinuxMain.swift | App-Maker-Software/GitProviders | d15c3ba015616f5660cb057dfc8ff7def65c481f | [
"MIT"
] | 8 | 2021-05-08T19:02:44.000Z | 2022-02-28T17:36:15.000Z | Tests/LinuxMain.swift | App-Maker-Software/GitProviders | d15c3ba015616f5660cb057dfc8ff7def65c481f | [
"MIT"
] | null | null | null | Tests/LinuxMain.swift | App-Maker-Software/GitProviders | d15c3ba015616f5660cb057dfc8ff7def65c481f | [
"MIT"
] | 2 | 2021-05-14T00:11:39.000Z | 2022-02-28T17:36:16.000Z | import XCTest
import GitAPITests
var tests = [XCTestCaseEntry]()
tests += GitAPITests.allTests()
XCTMain(tests)
| 14.25 | 31 | 0.77193 |
ea8b9b57ff5ddb5a4c9869fe0d3fc6960d308887 | 211 | lua | Lua | actx/design/config/export/output/server/prop_local.lua | oathx/myactx | 0a66511f173713d1aab0ef5d60ee0aaec1c8c6da | [
"MIT"
] | null | null | null | actx/design/config/export/output/server/prop_local.lua | oathx/myactx | 0a66511f173713d1aab0ef5d60ee0aaec1c8c6da | [
"MIT"
] | null | null | null | actx/design/config/export/output/server/prop_local.lua | oathx/myactx | 0a66511f173713d1aab0ef5d60ee0aaec1c8c6da | [
"MIT"
] | null | null | null | --
-- $Id$
--
module( "resmng" )
svnnum("$Id$")
propLocal = {
[GAME_LOCAL] = { ID = GAME_LOCAL, IPAddress = "127.0.0.1", Port = 9527, MainLogicScriptPath = "Game/System/SystemPlugin", Version = "0.0.1",},
}
| 17.583333 | 143 | 0.601896 |
923e2affe1af84c8c078916fa33e48738d749655 | 21 | rb | Ruby | lib/lbrt/cli.rb | codenize-tools/lbrt | 7b8468b1165071d7cdd493f2eecd4cbb8f5a9fba | [
"MIT"
] | null | null | null | lib/lbrt/cli.rb | codenize-tools/lbrt | 7b8468b1165071d7cdd493f2eecd4cbb8f5a9fba | [
"MIT"
] | null | null | null | lib/lbrt/cli.rb | codenize-tools/lbrt | 7b8468b1165071d7cdd493f2eecd4cbb8f5a9fba | [
"MIT"
] | null | null | null | module Lbrt::CLI
end
| 7 | 16 | 0.761905 |
fda09a0590cbc31be73881389ad0203bb8e25ee9 | 226 | sql | SQL | 01-intro-spring-hibernate-native-config/sql/book.sql | iproduct/course-hibernate | a51f3b6fe28b3c6d012c9542679ba33d05b98491 | [
"Apache-2.0"
] | null | null | null | 01-intro-spring-hibernate-native-config/sql/book.sql | iproduct/course-hibernate | a51f3b6fe28b3c6d012c9542679ba33d05b98491 | [
"Apache-2.0"
] | null | null | null | 01-intro-spring-hibernate-native-config/sql/book.sql | iproduct/course-hibernate | a51f3b6fe28b3c6d012c9542679ba33d05b98491 | [
"Apache-2.0"
] | 1 | 2022-03-27T17:08:38.000Z | 2022-03-27T17:08:38.000Z | create table Book
(
id bigint not null,
author varchar(255),
publisher_country varchar(255),
publisher_name varchar(255),
title varchar(255),
primary key (id)
)
| 22.6 | 38 | 0.548673 |
25e30472e4efb64746b49d9322b2d80e1dcc5096 | 1,499 | cs | C# | src/CurrentTimestamps/Core/Migrations/20211229135937_InitialMigration.Designer.cs | djek-sweng/blog-change-tracking-efcore | ce1e68d5f2b6b18e53577f0326ad2a6792f748cc | [
"MIT"
] | null | null | null | src/CurrentTimestamps/Core/Migrations/20211229135937_InitialMigration.Designer.cs | djek-sweng/blog-change-tracking-efcore | ce1e68d5f2b6b18e53577f0326ad2a6792f748cc | [
"MIT"
] | null | null | null | src/CurrentTimestamps/Core/Migrations/20211229135937_InitialMigration.Designer.cs | djek-sweng/blog-change-tracking-efcore | ce1e68d5f2b6b18e53577f0326ad2a6792f748cc | [
"MIT"
] | null | null | null | // <auto-generated />
using System;
using Core.Database;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
#nullable disable
namespace Core.Migrations
{
[DbContext(typeof(DatabaseContext))]
[Migration("20211229135937_InitialMigration")]
partial class InitialMigration
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.1")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("Core.Models.Note", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("char(36)");
b.Property<DateTime?>("ChangedAt")
.HasColumnType("datetime(6)");
b.Property<DateTime>("CreatedAt")
.HasColumnType("datetime(6)");
b.Property<string>("Message")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("varchar(256)");
b.HasKey("Id");
b.ToTable("Notes", (string)null);
});
#pragma warning restore 612, 618
}
}
}
| 30.591837 | 75 | 0.559039 |
c67c17dae772365779c1d0f21a3813ec49f7d982 | 118 | py | Python | tests/context.py | Sergey190309/211019-JF | 70e6198447181b45f444b3e8a84205e44e4af018 | [
"MIT"
] | null | null | null | tests/context.py | Sergey190309/211019-JF | 70e6198447181b45f444b3e8a84205e44e4af018 | [
"MIT"
] | null | null | null | tests/context.py | Sergey190309/211019-JF | 70e6198447181b45f444b3e8a84205e44e4af018 | [
"MIT"
] | null | null | null | import sys
import os
sys.path.index(0, os.path.abspath(os.path.join((os.path.dirname(__file__), '..'))))
import src
| 16.857143 | 83 | 0.70339 |
08b2522f57992e04f485ea962a2484656c113867 | 4,103 | css | CSS | src/index.css | mellowmorgan/tap-room-react | f09801fe18815a0fe2fd2049a006374985c3e644 | [
"MIT"
] | null | null | null | src/index.css | mellowmorgan/tap-room-react | f09801fe18815a0fe2fd2049a006374985c3e644 | [
"MIT"
] | null | null | null | src/index.css | mellowmorgan/tap-room-react | f09801fe18815a0fe2fd2049a006374985c3e644 | [
"MIT"
] | null | null | null | body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
.one-edge-shadow {
-webkit-box-shadow: 0 8px 6px -6px black;
-moz-box-shadow: 0 8px 6px -6px black;
box-shadow: 0 8px 6px -6px black;
}
.header{
padding:1.75rem;
color:white;
font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
text-transform: uppercase;
letter-spacing:3px;
background-color: rgb(52, 52, 52);
}
.header h1 {
margin: 0;
font-size:2rem;
}
.button-5 {
align-items: center;
background-clip: padding-box;
background-color: #fa6400;
border: 1px solid transparent;
border-radius: .25rem;
box-shadow: rgba(0, 0, 0, 0.02) 0 1px 3px 0;
box-sizing: border-box;
color: #fff;
cursor: pointer;
display: inline-flex;
font-family: system-ui,-apple-system,system-ui,"Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 16px;
font-weight: 750;
letter-spacing: 2px;
text-transform: uppercase;
justify-content: center;
line-height: 1.25;
margin: 0;
min-height: 3rem;
padding: calc(.875rem - 1px) calc(1.5rem - 1px);
position: relative;
text-decoration: none;
transition: all 250ms;
user-select: none;
-webkit-user-select: none;
touch-action: manipulation;
vertical-align: baseline;
width: auto;
}
.button-5:hover,
.button-5:focus {
background-color: #fb8332;
box-shadow: rgba(0, 0, 0, 0.1) 0 4px 12px;
}
.button-5:hover {
transform: translateY(-1px);
}
.button-5:active {
background-color: #c85000;
box-shadow: rgba(0, 0, 0, .06) 0 2px 4px;
transform: translateY(0);
}
h4{
margin-bottom:1.75rem !important;
}
.form-holder{
margin: 4rem auto;
width:350px;
}
.form-input{
min-height: 3rem;
margin-bottom:1rem;
}
.holder-center{
text-align:center;
margin:3rem;
}
.header-img{
background: url(./img/tapRoom.jpeg);
background-repeat: no-repeat;
background-size: cover;
height:350px;
}
.carousel-holder{
background-color: rgb(52, 52, 52);
margin:2rem;
height:200px;
}
.carousel-item{
min-height: 180px;
}
.card-style{
width:320px;
padding:2.5rem;
}
.space-main{
margin:2rem;
}
.grid-container {
justify-items: center;
display: grid;
grid-template-columns: auto auto auto;
padding: 10px;
}
.grid-item {
background-color: rgba(255, 255, 255, 0.8);
border: 1px solid rgba(0, 0, 0, 0.8);
padding: 20px;
font-size: 30px;
text-align: center;
}
.button-holder{
margin-top:1rem;
text-align:center;
}
.button-gray {
align-items: center;
background-clip: padding-box;
background-color: rgb(188, 188, 188);
border: 1px solid transparent;
border-radius: .25rem;
box-shadow: rgba(0, 0, 0, 0.02) 0 1px 3px 0;
box-sizing: border-box;
color: #fff;
cursor: pointer;
display: inline-flex;
font-family: system-ui,-apple-system,system-ui,"Helvetica Neue",Helvetica,Arial,sans-serif;
font-size: 14px;
font-weight: 750;
letter-spacing: 2px;
text-transform: uppercase;
justify-content: center;
line-height: 1.25;
margin: 0;
min-height: 3rem;
padding: calc(.875rem - 1px) calc(1.5rem - 1px);
position: relative;
text-decoration: none;
transition: all 250ms;
user-select: none;
-webkit-user-select: none;
touch-action: manipulation;
vertical-align: baseline;
width: 160px;
}
.button-gray:hover,
.button-gray:focus {
background-color: rgb(171, 171, 171);
box-shadow:rgb(205, 205, 205);
}
.button-gray:hover {
transform: translateY(-1px);
}
.button-gray:active {
background-color: rgb(126, 126, 126);
box-shadow: rgba(144, 144, 144, 0.06) 0 2px 4px;
transform: translateY(0);
}
.detail-btn-space{
margin-left:auto;
margin-right:auto;
width:80%;
display: flex;
justify-content: space-between;
}
.content-detail{
width:fit-content;
margin-left:auto;
margin-right:auto;
}
p{
font-size:1.2rem;
} | 20.933673 | 93 | 0.674628 |
022eae3012eae819fd423e1332a2137f7e7f9179 | 8,905 | lua | Lua | usb_wcid20.lua | teenydt/teenydt.github.io | 4e5651fe12cff8be378d2e5d2a5c91900e22b1b4 | [
"MIT"
] | 11 | 2020-06-16T03:22:40.000Z | 2022-03-27T00:04:08.000Z | usb_wcid20.lua | teenydt/teenydt.github.io | 4e5651fe12cff8be378d2e5d2a5c91900e22b1b4 | [
"MIT"
] | 2 | 2019-12-13T03:16:00.000Z | 2021-02-10T02:38:30.000Z | usb_wcid20.lua | teenydt/teenydt.github.io | 4e5651fe12cff8be378d2e5d2a5c91900e22b1b4 | [
"MIT"
] | 8 | 2019-11-06T06:08:55.000Z | 2022-01-08T04:58:22.000Z | -- usb_wcid20.lua
-- _______ _____ _______
-- |__ __| | __ \__ __|
-- | | ___ ___ _ __ _ _| | | | | |
-- | |/ _ \/ _ \ '_ \| | | | | | | | |
-- | | __/ __/ | | | |_| | |__| | | |
-- |_|\___|\___|_| |_|\__, |_____/ |_|
-- __/ |
-- |___/
--
-- TeenyDT - GUI and command line tool to generate USB descriptors and drivers
--
-- Copyright (c) 2019 XToolBox - [email protected]
-- www.tusb.org
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in all
-- copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-- SOFTWARE.
--[[
Windows compatible ID related descriptors
visit https://github.com/xtoolbox/TeenyUSB/wiki/WCID-Device for more info
--]]
require("usb_wcid")
local WIN8_1 = 0x06030000
function WCID20DeviceCapDescriptor(param)
local uuid = param.uuid or {0xDF, 0x60, 0xDD, 0xD8,
0x89, 0x45, 0xC7, 0x4C,
0x9C, 0xD2, 0x65, 0x9D,
0x9E, 0x64, 0x8A, 0x9F,}
local desc = CreateDescriptor({
{ bLength = DUMMY },
{ bDescriptorType = 0x10 },
{ bDevCapabilityType = 0x05 },
{ bReserved = 0x00 },
{ bPlatformCapabilityUUID_16 = uuid },
{ dwWindowsVersion = WIN8_1 },
{ wDescriptorSetTotalLength = 0 },
{ bVendorCode = 1 },
{ bAltEnumCode = 0 },
},param, "WCID20 device capability descriptor")
return desc
end
function USB20ExtensionCapbility(param)
local desc = CreateDescriptor({
{ bLength = DUMMY },
{ bDescriptorType = 0x10 },
{ bDevCapabilityType = 0x02 },
{ dwAttributes = 0x06 },
},param, "USB 2.0 Extension Capability Descriptor")
return desc
end
function SuperSpeedDeviceCapbility(param)
local desc = CreateDescriptor({
{ bLength = DUMMY },
{ bDescriptorType = 0x10 },
{ bDevCapabilityType = 0x03 },
{ bAttributes = 0x00 },
{ wSpeedsSupported = 0x0e },
{ bFunctionalitySupport = 0x01 },
{ bU1DevExitLat = 0x0a },
{ wU2DevExitLat = 0x7ff },
},param, "SuperSpeed Device Capability Descriptor")
return desc
end
function WCID20BOSDescriptor(param)
local desc = CreateDescriptor({
{ bLength = DUMMY },
{ bDescriptorType = BOS_DESCRIPTOR_TYPE },
{ wTotalLength = TotalLength },
{ bNumDeviceCaps = #param },
}, param, "WCID20 BOS descriptor")
return desc
end
function WCID20CompatibleID(CID, subCID)
CID = CID or "WINUSB"
subCID = subCID or ""
assert(#CID<9, "Compatible ID too long >> " .. CID)
assert(#subCID<9, "sub Compatible ID too long >> " .. subCID)
CID = CID .. string.rep("\x00", 8-#CID)
subCID = subCID .. string.rep("\x00", 8-#subCID)
local desc = CreateDescriptor({
{ wLength = TotalLength },
{ wDescriptorType = 3 },
{ cCID_8 = CID },
{ cSubCID_8 = subCID },
}, {}, "WCID20 compatible ID descriptor")
return desc
end
function WCID20RegValue(name, data)
local dType = REG_SZ
if name:byte(#name) ~= 0 then
name = name .. "\x00"
end
if type(data) == "table" then
dType = REG_MULTI_SZ
local t = ""
for i,v in ipairs(data) do
assert(type(v) == "string")
if v:byte(#v) ~= 0 then
v = v .. "\x00"
end
t = t .. v
end
data = t .. "\x00"
elseif type(data) == "string" then
if data:byte(#data) ~= 0 then
data = data .. "\x00"
end
end
local nameLen = uniLength(name)
local dataLen = uniLength(data)
local nameField = "wcPropertyName_" .. (nameLen/2 | 0)
local dataField = "wcPropertyData_" .. (dataLen/2 | 0)
local desc = CreateDescriptor({
{ wLength = TotalLength },
{ wDescriptorType = 4 },
{ wPropertyDataType = dType },
{ wPropertyNameLength = nameLen },
{ [nameField] = name },
{ wPropertyDataLength = dataLen },
{ [dataField] = data }
}, {}, "WCID20 registry property descriptor")
return desc
end
function WCID20FunctionSubset(param)
local desc = CreateDescriptor({
{ wLength = 0 },
{ wDescriptorType = 2 },
{ bFirstInterface = param.interface or 0 },
{ bReserved = 0 },
{ wSubsetLength = TotalLength },
}, param, "WCID20 function subset descriptor")
desc.content.wLength = desc.content.bLength
desc.content.wTotalLength = TotalLength
return desc
end
function WCID20DescriptorSet(param)
local desc = CreateDescriptor({
{ wLength = 0 },
{ wDescriptorType = 0 },
{ dwWindowsVersion = WIN8_1 },
{ wDescriptorSetTotalLength = TotalLength },
},param, "WCID20 descriptor set descriptor")
desc.content.wLength = desc.content.bLength
return desc
end
function OutputWinUSB20Info(dev)
local r = [[
//////////////////////////////////////////////////////
///// WCID 2.0 descripors
/////////////////////////////////////////////////////
#if defined(HAS_WCID_20)
]]
local genCode = BeginGenCode(dev)
local ifs = GetWinUSBInterface(dev)
local data = {}
for i,v in ipairs(ifs) do
if #ifs > 1 then
if v.type == "WinUSB" then
data[#data+1] = WCID20FunctionSubset{
interface = v.interface.content.bInterfaceNumber,
WCID20CompatibleID("WINUSB"),
WCID20RegValue("DeviceInterfaceGUIDs", {v.data}),
}
elseif v.type == "RNDIS" then
data[#data+1] = WCID20FunctionSubset{
interface = v.interface.content.bInterfaceNumber,
WCID20CompatibleID("RNDIS", v.subCID),
}
end
else
if v.type == "RNDIS" then
data = {
WCID20CompatibleID("RNDIS", v.subCID),
}
else
data = {
WCID20CompatibleID("WINUSB"),
WCID20RegValue("DeviceInterfaceGUIDs", {v.data}),
}
end
end
end
local set = WCID20DescriptorSet(data)
r = r .. genCode({
SIZE = fieldValue(set, "wDescriptorSetTotalLength"),
BODY = Ident( descToString(set, true) )
},[[
#define $(PREFIX)WCID_DESC_SET_SIZE ($(SIZE))
WEAK __ALIGN_BEGIN const uint8_t $(PREFIX)WCIDDescriptorSet [$(SIZE)] __ALIGN_END = {
$(BODY)};
]])
local bosContent = {}
if dev.content.bcdUSB >= 0x300 then
bosContent = {
USB20ExtensionCapbility{},
SuperSpeedDeviceCapbility{},
}
end
bosContent[#bosContent+1] = WCID20DeviceCapDescriptor{
bVendorCode = "WCID_VENDOR_CODE",
wDescriptorSetTotalLength = genCode({}, "$(PREFIX)WCID_DESC_SET_SIZE")
}
local bos = WCID20BOSDescriptor(bosContent)
r = r .. genCode({
SIZE = fieldValue(bos, "wTotalLength"),
BODY = Ident( descToString(bos, true) )
},[[
#define $(PREFIX)WCID_BOS_SIZE ($(SIZE))
WEAK __ALIGN_BEGIN const uint8_t $(PREFIX)WCIDBOS [$(SIZE)] __ALIGN_END = {
$(BODY)};
#endif // #if defined(HAS_WCID_20)
]])
return r
end
| 34.785156 | 85 | 0.536777 |
c6e27c93a6415b10d124089fe446ba4211c77835 | 151 | css | CSS | docs/_template/light-dark-theme/styles/theme-switcher.css | Samrux/Discord.Net | 193f0f0301eb6ceb9755de7992e245ad0255c537 | [
"MIT"
] | 1,762 | 2019-01-29T14:18:55.000Z | 2022-03-31T22:23:36.000Z | docs/_template/light-dark-theme/styles/theme-switcher.css | Samrux/Discord.Net | 193f0f0301eb6ceb9755de7992e245ad0255c537 | [
"MIT"
] | 742 | 2019-01-29T03:48:54.000Z | 2022-03-31T20:35:24.000Z | docs/_template/light-dark-theme/styles/theme-switcher.css | Samrux/Discord.Net | 193f0f0301eb6ceb9755de7992e245ad0255c537 | [
"MIT"
] | 648 | 2019-01-29T20:51:28.000Z | 2022-03-31T02:20:04.000Z | div.theme-switch-field {
padding-left: 10px;
padding-bottom: 15px
}
div.theme-switch-field > p{
font-weight: bold;
font-size: 1.2em;
} | 16.777778 | 27 | 0.642384 |
07065476bc614993f4f7bbbf0949d9b057fbe13e | 1,482 | cpp | C++ | src/asn-one-objects/BooleanAsnOneObject.cpp | gflix/LdapServer | 1865caeec95c0e984cfab70d54976197349457eb | [
"MIT"
] | 1 | 2020-10-04T21:00:42.000Z | 2020-10-04T21:00:42.000Z | src/asn-one-objects/BooleanAsnOneObject.cpp | gflix/LdapServer | 1865caeec95c0e984cfab70d54976197349457eb | [
"MIT"
] | null | null | null | src/asn-one-objects/BooleanAsnOneObject.cpp | gflix/LdapServer | 1865caeec95c0e984cfab70d54976197349457eb | [
"MIT"
] | null | null | null | /*
* BooleanAsnOneObject.cpp
*
* Created on: 14.05.2017
* Author: felix
*/
#include <asn-one-objects/BooleanAsnOneObject.h>
namespace Flix {
BooleanAsnOneObject::BooleanAsnOneObject():
GenericAsnOneObject(AsnOneObjectType::BOOLEAN),
value(false)
{
}
BooleanAsnOneObject::~BooleanAsnOneObject()
{
}
bool BooleanAsnOneObject::getValue(void) const
{
return value;
}
void BooleanAsnOneObject::setValue(bool value)
{
this->value = value;
}
BooleanAsnOneObject* BooleanAsnOneObject::decode(StreamBuffer buffer, AsnOneDecodeStatus& decodeStatus)
{
decodeStatus = AsnOneDecodeStatus::OK;
BooleanAsnOneObject* asnOneObject = new BooleanAsnOneObject();
bool value = false;
auto currentValue = buffer.cbegin();
while (currentValue != buffer.cend()) {
if (*currentValue > 0) {
value = true;
break;
}
++currentValue;
}
asnOneObject->setValue(value);
return asnOneObject;
}
BooleanAsnOneObject* BooleanAsnOneObject::castObject(GenericAsnOneObject* object)
{
return static_cast<BooleanAsnOneObject*>(object);
}
StreamBuffer BooleanAsnOneObject::serialize(void) const
{
StreamBuffer payload;
payload.push_back(value ? 1 : 0);
return addAsnOneHeader(PDU_CLASS_UNIVERSAL, false, PDU_TYPE_UNIVERSAL_BOOLEAN, payload);
}
std::string BooleanAsnOneObject::dump(void) const
{
return "Bool(" + std::string(value ? "true" : "false") + ")";
}
} /* namespace Flix */
| 20.873239 | 103 | 0.69973 |
bce1b34dfc069de7c8729a8dea43fb12a10a60ce | 7,755 | sql | SQL | microsoft-wpa-framework-code/SQLPoolObjects/SqlPoolDB/Data/Activity.sql | MSUSSolutionAccelerators/Workplace-Intelligence-Solution-Accelerator | 181773ca367a3efc49bcbb05b4e0aa18b30be883 | [
"MIT"
] | null | null | null | microsoft-wpa-framework-code/SQLPoolObjects/SqlPoolDB/Data/Activity.sql | MSUSSolutionAccelerators/Workplace-Intelligence-Solution-Accelerator | 181773ca367a3efc49bcbb05b4e0aa18b30be883 | [
"MIT"
] | null | null | null | microsoft-wpa-framework-code/SQLPoolObjects/SqlPoolDB/Data/Activity.sql | MSUSSolutionAccelerators/Workplace-Intelligence-Solution-Accelerator | 181773ca367a3efc49bcbb05b4e0aa18b30be883 | [
"MIT"
] | null | null | null | /*********************************************************************************************************************
File: Activity.sql
Desc: Data hydration script.
**********************************************************************************************************************/
TRUNCATE TABLE dbo.Activity;
SET IDENTITY_INSERT dbo.Activity ON;
INSERT INTO dbo.Activity (ActivityId, ActivityName, ActivityDescription, ActivityTypeId)
SELECT 1,'Emails_sent_to_50_or_more_recipients','Emailssentto50ormorerecipients',1
UNION SELECT 2,'Bloated_meeting_hours','Bloatedmeetinghours',6
UNION SELECT 3,'Git_Commit_Add','GitCommitAdd',6
UNION SELECT 4,'Meeting_hours_with_manager','Meetinghourswithmanager',2
UNION SELECT 5,'Call_hours','Callhours',3
UNION SELECT 6,'Meeting_hours_1_to_2_hours','Meetinghours1to2hours',2
UNION SELECT 7,'Meetings_with_skip_level','Meetingswithskiplevel',2
UNION SELECT 8,'Emails_sent_11_to_50_recipients','Emailssent11to50recipients',1
UNION SELECT 9,'Lengthy_meeting_hours','Lengthymeetinghours',2
UNION SELECT 10,'Git_Commit_Edit','GitCommitEdit',6
UNION SELECT 11,'Meeting_hours_during_working_hours','Meetinghoursduringworkinghours',2
UNION SELECT 12,'After_hours_meeting_hours','Afterhoursmeetinghours',2
UNION SELECT 13,'Meeting_hours_1_hour','Meetinghours1hour',2
UNION SELECT 14,'Meetings_with_manager_1_on_1','Meetingswithmanager1on1',2
UNION SELECT 15,'Emails_sent_6_to_10_recipients','Emailssent6to10recipients',1
UNION SELECT 16,'Status_update_meeting_hours','Statusupdatemeetinghours',2
UNION SELECT 17,'Git_Commit_Delete','GitCommitDelete',6
UNION SELECT 18,'Meeting_hours','Meetinghours',2
UNION SELECT 19,'After_hours_instant_messages','Afterhoursinstantmessages',5
UNION SELECT 20,'Meeting_hours_31_to_59_min','Meetinghours31to59min',2
UNION SELECT 21,'Meetings_with_manager','Meetingswithmanager',2
UNION SELECT 22,'Emails_sent_2_to_5_recipients','Emailssent2to5recipients',1
UNION SELECT 23,'Decision_making_meeting_hours','Decisionmakingmeetinghours',2
UNION SELECT 24,'Feature_Count','FeatureCount',7
UNION SELECT 25,'Manager_coaching_hours_1_on_1','Managercoachinghours1on1',4
UNION SELECT 26,'After_hours_in_calls','Afterhoursincalls',3
UNION SELECT 27,'Meeting_hours_30_min_or_less','Meetinghours30minorless',2
UNION SELECT 28,'Meetings','Meetings',2
UNION SELECT 29,'Emails_sent_1_recipient','Emailssent1recipient',1
UNION SELECT 30,'One_on_one_meeting_hours','Oneononemeetinghours',2
UNION SELECT 31,'Task_Count','TaskCount',7
UNION SELECT 32,'Low_quality_meeting_hours','Lowqualitymeetinghours',2
UNION SELECT 33,'After_hours_email_hours','Afterhoursemailhours',1
UNION SELECT 34,'Meeting_hours_for_19_or_more_attendees','Meetinghoursfor19ormoreattendees',2
UNION SELECT 35,'Meeting_hours_with_skip_level','Meetinghourswithskiplevel',2
UNION SELECT 36,'All_hands_recurring_meeting_hours','Allhandsrecurringmeetinghours',2
UNION SELECT 37,'Meeting_hours_more_than_2_hours','Meetinghoursmorethan2hours',2
UNION SELECT 38,'User_Story_Count','UserStoryCount',7
UNION SELECT 39,'Internal_network_size','Internalnetworksize',4
UNION SELECT 40,'After_hours_collaboration_hours','Afterhourscollaborationhours',4
UNION SELECT 41,'Meeting_hours_for_9_to_18_attendees','Meetinghoursfor9to18attendees',2
UNION SELECT 42,'Meeting_hours_with_manager_1_on_1','Meetinghourswithmanager1on1',2
UNION SELECT 43,'Workshop_recurring_meeting_hours','Workshoprecurringmeetinghours',2
UNION SELECT 44,'User_Story_Story_Points','UserStoryStoryPoints',7
UNION SELECT 45,'Instant_messages_sent','Instantmessagessent',5
UNION SELECT 46,'Meeting_hours_for_3_to_8_attendees','Meetinghoursfor3to8attendees',2
UNION SELECT 47,'Bloated_recurring_meeting_hours','Bloatedrecurringmeetinghours',2
UNION SELECT 48,'Bug_Count','BugCount',7
UNION SELECT 49,'Instant_message_hours','Instantmessagehours',5
UNION SELECT 50,'Meeting_hours_for_2_attendees','Meetinghoursfor2attendees',2
UNION SELECT 51,'Lengthy_recurring_meeting_hours','Lengthyrecurringmeetinghours',2
UNION SELECT 52,'Generated_workload_meetings_organized','Generatedworkloadmeetingsorganized',2
UNION SELECT 53,'Workweek_span','Workweekspan',4
UNION SELECT 54,'Status_update_recurring_meeting_hours','Statusupdaterecurringmeetinghours',2
UNION SELECT 55,'Generated_workload_meeting_hours','Generatedworkloadmeetinghours',2
UNION SELECT 56,'Working_hours_instant_messages','Workinghoursinstantmessages',4
UNION SELECT 57,'Decision_making_recurring_meeting_hours','Decisionmakingrecurringmeetinghours',2
UNION SELECT 58,'Generated_workload_meeting_attendees','Generatedworkloadmeetingattendees',2
UNION SELECT 59,'Working_hours_in_calls','Workinghoursincalls',4
UNION SELECT 60,'One_on_one_recurring_meeting_hours','Oneononerecurringmeetinghours',2
UNION SELECT 61,'Generated_workload_instant_messages_recipients','Generatedworkloadinstantmessagesrecipients',5
UNION SELECT 62,'Working_hours_email_hours','Workinghoursemailhours',4
UNION SELECT 63,'Total_unscheduled_calls','Totalunscheduledcalls',3
UNION SELECT 64,'Generated_workload_instant_messages_hours','Generatedworkloadinstantmessageshours',5
UNION SELECT 65,'Working_hours_collaboration_hours','Workinghourscollaborationhours',4
UNION SELECT 66,'Total_scheduled_calls','Totalscheduledcalls',3
UNION SELECT 67,'Generated_workload_email_recipients','Generatedworkloademailrecipients',1
UNION SELECT 68,'Total_focus_hours','Totalfocushours',4
UNION SELECT 69,'Working_hours_in_unscheduled_calls','Workinghoursinunscheduledcalls',3
UNION SELECT 70,'Generated_workload_email_hours','Generatedworkloademailhours',1
UNION SELECT 71,'Total_emails_sent_during_meeting','Totalemailssentduringmeeting',1
UNION SELECT 72,'Working_hours_in_scheduled_calls','Workinghoursinscheduledcalls',3
UNION SELECT 73,'Generated_workload_calls_organized','Generatedworkloadcallsorganized',3
UNION SELECT 74,'Total_calls','Totalcalls',3
UNION SELECT 75,'After_hours_in_unscheduled_calls','Afterhoursinunscheduledcalls',3
UNION SELECT 76,'Generated_workload_call_participants','Generatedworkloadcallparticipants',3
UNION SELECT 77,'Time_in_self_organized_meetings','Timeinselforganizedmeetings',2
UNION SELECT 78,'After_hours_in_scheduled_calls','Afterhoursinscheduledcalls',3
UNION SELECT 79,'Generated_workload_call_hours','Generatedworkloadcallhours',3
UNION SELECT 80,'Redundant_meeting_hours__organizational_','Redundantmeetinghoursorganizational',2
UNION SELECT 81,'Unscheduled_Call_hours','UnscheduledCallhours',3
UNION SELECT 82,'External_network_size','Externalnetworksize',4
UNION SELECT 83,'Redundant_meeting_hours__lower_level_','Redundantmeetinghourslowerlevel',2
UNION SELECT 84,'Scheduled_Call_hours','ScheduledCallhours',3
UNION SELECT 85,'Emails_sent','Emailssent',1
UNION SELECT 86,'Open_2_hour_blocks','Open2hourblocks',4
UNION SELECT 87,'Recurring_or_regular_meeting_hours','Recurringorregularmeetinghours',2
UNION SELECT 88,'Email_hours','Emailhours',1
UNION SELECT 89,'Open_1_hour_block','Open1hourblock',4
UNION SELECT 90,'Status_update_review_meeting_hours','Statusupdatereviewmeetinghours',2
UNION SELECT 91,'Conflicting_meeting_hours','Conflictingmeetinghours',2
UNION SELECT 92,'Networking_outside_organization','Networkingoutsideorganization',4
UNION SELECT 93,'All_hands_meeting_hours','Allhandsmeetinghours',2
UNION SELECT 94,'Collaboration_hours_external','Collaborationhoursexternal',4
UNION SELECT 95,'Networking_outside_company','Networkingoutsidecompany',4
UNION SELECT 96,'Workshop_meeting_hours','Workshopmeetinghours',2
UNION SELECT 97,'Collaboration_hrs','Collaborationhrs',4
UNION SELECT 98,'Multitasking_meeting_hours','Multitaskingmeetinghours',2
SET IDENTITY_INSERT dbo.Activity OFF; | 69.864865 | 119 | 0.823598 |
6de98a6a8f0ab684205337b8e4918f8cbe5e3af7 | 2,881 | c | C | src/emscripten/iupemscripten_progressbar.c | istiak101/iup | c04aecf103c211860b88ab6801376add949ad1d8 | [
"MIT"
] | null | null | null | src/emscripten/iupemscripten_progressbar.c | istiak101/iup | c04aecf103c211860b88ab6801376add949ad1d8 | [
"MIT"
] | null | null | null | src/emscripten/iupemscripten_progressbar.c | istiak101/iup | c04aecf103c211860b88ab6801376add949ad1d8 | [
"MIT"
] | null | null | null | /** \file
* \brief Progress bar Control
*
* See Copyright Notice in "iup.h"
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <memory.h>
#include <stdarg.h>
#include "iup.h"
#include "iup.h"
#include "iupcbs.h"
#include "iup_object.h"
#include "iup_layout.h"
#include "iup_attrib.h"
#include "iup_str.h"
#include "iup_progressbar.h"
#include "iup_drv.h"
#include "iupemscripten_drv.h"
// TODO: API: I think we're going to need a separate start/stop key.
// emscripten Indeterminate is for progresses you don't know the range for, but are still animated when in progress.
// TODO: FEATURE: emscripten provides spinner style
extern int emjsProgressBar_Create(void);
extern int emjsProgressBar_SetValueAttrib(int handle_id, double value);
static int emscriptenProgressBarMapMethod(Ihandle* ih)
{
int progressBar_id = 0;
InativeHandle* new_handle = NULL;
progressBar_id = emjsProgressBar_Create();
new_handle = (InativeHandle*)calloc(1, sizeof(InativeHandle));
new_handle->handleID = progressBar_id;
ih->handle = new_handle;
iupEmscripten_SetIntKeyForIhandleValue(progressBar_id, ih);
iupEmscripten_AddWidgetToParent(ih);
return IUP_NOERROR;
}
static int emscriptenProgressBarSetValueAttrib(Ihandle* ih, const char* value)
{
if (ih->data->marquee) return 0; /* Hypothesis: If user wanted a marquee, just give up setting value because that will be default behavior in browser */
if (!value) { /* If no value, put 0 (to avoid default marquee state) */
iupStrToDouble("0", &(ih->data->value));
return 0; }
else {
iupStrToDouble(value, &(ih->data->value)); /*idk what I'm doing just copying GTK don't mind me */
emjsProgressBar_SetValueAttrib(ih->handle->handleID, ih->data->value);
return 0;
}
}
static void emscriptenProgressBarUnMapMethod(Ihandle* ih)
{
}
void iupdrvProgressBarInitClass(Iclass* ic)
{
/* Driver Dependent Class functions */
ic->Map = emscriptenProgressBarMapMethod;
ic->UnMap = emscriptenProgressBarUnMapMethod;
/* Driver Dependent Attribute functions */
/* Visual */
// iupClassRegisterAttribute(ic, "BGCOLOR", NULL, iupdrvBaseSetBgColorAttrib, IUPAF_SAMEASSYSTEM, "DLGBGCOLOR", IUPAF_DEFAULT);
/* Special */
// iupClassRegisterAttribute(ic, "FGCOLOR", NULL, NULL, NULL, NULL, IUPAF_DEFAULT);
/* #if 0 */
/* IupProgressBar only */
iupClassRegisterAttribute(ic, "VALUE", iProgressBarGetValueAttrib, emscriptenProgressBarSetValueAttrib, NULL, NULL, IUPAF_NO_DEFAULTVALUE|IUPAF_NO_INHERIT);
/* iupClassRegisterAttribute(ic, "ORIENTATION", NULL, NULL, IUPAF_SAMEASSYSTEM, "HORIZONTAL", IUPAF_NO_INHERIT); */
/* iupClassRegisterAttribute(ic, "MARQUEE", NULL, emscriptenProgressBarSetMarqueeAttrib, NULL, NULL, IUPAF_NO_INHERIT); */
/* iupClassRegisterAttribute(ic, "DASHED", NULL, NULL, NULL, NULL, IUPAF_NO_INHERIT); */
/* #endif */
}
| 28.81 | 161 | 0.736203 |
70bdb620e0c1bd7f39e9009e7143df61879cf665 | 3,362 | sql | SQL | bonus/database/forum.sql | ericbaranowski/host | e8c1142957a1bc33ba6f2cbea0b9c3d054d71b52 | [
"MIT"
] | null | null | null | bonus/database/forum.sql | ericbaranowski/host | e8c1142957a1bc33ba6f2cbea0b9c3d054d71b52 | [
"MIT"
] | null | null | null | bonus/database/forum.sql | ericbaranowski/host | e8c1142957a1bc33ba6f2cbea0b9c3d054d71b52 | [
"MIT"
] | null | null | null | -- phpMyAdmin SQL Dump
-- version 4.5.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Oct 31, 2016 at 08:33 AM
-- Server version: 5.7.11
-- PHP Version: 5.6.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `sximo6`
--
-- --------------------------------------------------------
--
-- Table structure for table `forums`
--
CREATE TABLE `forums` (
`ForumID` int(11) NOT NULL,
`Name` varchar(100) DEFAULT NULL,
`Note` varchar(255) DEFAULT NULL,
`Icon` char(30) DEFAULT NULL,
`Color` char(10) DEFAULT NULL,
`Active` enum('1','0') DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `forum_categories`
--
CREATE TABLE `forum_categories` (
`CategoryID` int(6) NOT NULL,
`Name` varchar(100) DEFAULT NULL,
`ForumID` int(6) DEFAULT NULL,
`Note` varchar(100) DEFAULT NULL,
`Ordering` int(3) NOT NULL,
`Allow` enum('0','1') NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `forum_comments`
--
CREATE TABLE `forum_comments` (
`CommentID` int(11) NOT NULL,
`Comment` text,
`UserID` int(6) DEFAULT NULL,
`Posted` datetime DEFAULT NULL,
`PostID` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `forum_posts`
--
CREATE TABLE `forum_posts` (
`PostID` int(11) NOT NULL,
`Title` varchar(255) DEFAULT NULL,
`Alias` varchar(255) DEFAULT NULL,
`Content` text,
`CategoryID` int(11) DEFAULT NULL,
`Posted` datetime DEFAULT NULL,
`Hint` int(11) NOT NULL DEFAULT '0',
`UserID` int(11) DEFAULT NULL,
`Sticky` enum('0','1') DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `forums`
--
ALTER TABLE `forums`
ADD PRIMARY KEY (`ForumID`);
--
-- Indexes for table `forum_categories`
--
ALTER TABLE `forum_categories`
ADD PRIMARY KEY (`CategoryID`);
--
-- Indexes for table `forum_comments`
--
ALTER TABLE `forum_comments`
ADD PRIMARY KEY (`CommentID`);
--
-- Indexes for table `forum_posts`
--
ALTER TABLE `forum_posts`
ADD PRIMARY KEY (`PostID`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `forums`
--
ALTER TABLE `forums`
MODIFY `ForumID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
--
-- AUTO_INCREMENT for table `forum_categories`
--
ALTER TABLE `forum_categories`
MODIFY `CategoryID` int(6) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `forum_comments`
--
ALTER TABLE `forum_comments`
MODIFY `CommentID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=386;
--
-- AUTO_INCREMENT for table `forum_posts`
--
ALTER TABLE `forum_posts`
MODIFY `PostID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| 24.014286 | 73 | 0.65467 |
b0d8edcd48cd78a814e625923bee834dbed12a92 | 2,135 | dart | Dart | lib/global_providers.dart | LeeMatthewHiggins/FeatureBasedApp | dc80596cd5e8141dfb3607fbb72ab79691d31857 | [
"MIT"
] | null | null | null | lib/global_providers.dart | LeeMatthewHiggins/FeatureBasedApp | dc80596cd5e8141dfb3607fbb72ab79691d31857 | [
"MIT"
] | null | null | null | lib/global_providers.dart | LeeMatthewHiggins/FeatureBasedApp | dc80596cd5e8141dfb3607fbb72ab79691d31857 | [
"MIT"
] | null | null | null | import 'package:feature_based_app/common/repository/imp/json_bundle_repository.dart';
import 'package:feature_based_app/feature/feature_transformer.dart';
import 'package:feature_based_app/features/fork/fork_business_logic.dart';
import 'package:feature_based_app/features/fork/fork_viewmodel.dart';
import 'common/cast_utilities.dart';
import 'common/provider_repository.dart';
import 'feature/feature_business_logic.dart';
import 'features/list/feature_list_business_logic.dart';
import 'features/list/feature_list_viewmodel.dart';
import 'feature/feature_viewmodel.dart';
import 'features/cat_purchase/cat_purchase_business_logic.dart';
import 'features/cat_purchase/cat_purchase_viewmodel.dart';
import 'features/rainbow/rainbow_business_logic.dart';
import 'features/rainbow/rainbow_viewmodel.dart';
//final featureRepo = FirestoreRepository<Feature>(
// firestore: FirebaseFirestore.instance,
// transformer: FeatureTransformer(),
//);
final jsonFeatureRepo = JsonBundleRepository(
path: 'assets/config/features/featureRepository.json',
transformer: FeatureTransformer(),
);
void registerGlobalProviders() {
ProviderRepository.global.registerProviderBuilder<FeatureViewModel>(
(Object? context) {
final uri = castAssert<String>(context);
return FeatureBusinessLogic(
uri,
jsonFeatureRepo,
);
},
);
ProviderRepository.global.registerProviderBuilder<FeatureListViewModel>(
(Object? context) {
final uri = castAssert<String>(context);
return FeatureListBusinessLogic(
uri,
jsonFeatureRepo,
);
},
);
ProviderRepository.global.registerProviderBuilder<RainbowViewModel>(
(Object? context) {
return RainbowBusinessLogic();
},
);
ProviderRepository.global.registerProviderBuilder<CatPurchaseViewModel>(
(Object? context) {
return CatPurchaseBusinessLogic();
},
);
ProviderRepository.global.registerProviderBuilder<ForkViewModel>(
(Object? context) {
final uri = castAssert<String>(context);
return ForkBusinessLogic(
uri,
jsonFeatureRepo,
);
},
);
}
| 30.942029 | 85 | 0.750351 |
78a2ad6a8d535768494e9cfcc1e9de5d5f9e4623 | 176 | sql | SQL | patches/PRIM-65-before.sql | prime-space/old-marketplace | 6e3150445a72e85d42f99c23d02939091d689533 | [
"Apache-2.0"
] | 1 | 2021-03-09T15:41:36.000Z | 2021-03-09T15:41:36.000Z | patches/PRIM-65-before.sql | prime-space/old-marketplace | 6e3150445a72e85d42f99c23d02939091d689533 | [
"Apache-2.0"
] | null | null | null | patches/PRIM-65-before.sql | prime-space/old-marketplace | 6e3150445a72e85d42f99c23d02939091d689533 | [
"Apache-2.0"
] | 2 | 2021-03-15T15:46:24.000Z | 2021-03-17T04:54:26.000Z | ALTER TABLE `promocode_el` ADD `user_id` INT(10) UNSIGNED NOT NULL AFTER `comment`;
ALTER TABLE `promocode_el` DROP INDEX `code`, ADD UNIQUE `code_user_id` (`code`, `user_id`); | 88 | 92 | 0.744318 |
c0cff3d5eba93ec66f30c662574bc9e7158a7b14 | 2,681 | cpp | C++ | wpa_roam/main.cpp | 9A9A/wpa_supplicant-fork | f33468a35109317ef0ed9cdd6eceb8b068a4278b | [
"Unlicense"
] | null | null | null | wpa_roam/main.cpp | 9A9A/wpa_supplicant-fork | f33468a35109317ef0ed9cdd6eceb8b068a4278b | [
"Unlicense"
] | null | null | null | wpa_roam/main.cpp | 9A9A/wpa_supplicant-fork | f33468a35109317ef0ed9cdd6eceb8b068a4278b | [
"Unlicense"
] | null | null | null | #include "wpa_roam.h"
#include "wpa_application.h"
using namespace std;
using namespace chrono;
void signal_handler(int signum)
{
if(Application::locker()->locked())
{
Application::locker()->unlock();
}
else
{
exit(0);
}
}
int main(int argc,char* argv[])
{
#ifdef DEBUG
ThrdInf thr("MainThread");
#endif
try
{
int default_rssi = DEFAULT_RSSI_LEVEL;
int default_diff = DEFAULT_DIFF;
const char* iface_name = nullptr;
const char* unix_socket_dir = nullptr;
string param;
int scan_treshold = default_rssi;
int difference = default_diff;
int minrssi = default_rssi;
int transition_time = default_diff;
string str_t;
int c;
while(true)
{
c = getopt(argc,argv,"p:i:t:s:m:h:");
if(c<0)
{
break;
}
switch(c)
{
case 'i':
iface_name = optarg;
break;
case 'p':
unix_socket_dir = optarg;
break;
case 's':
param = optarg;
scan_treshold = stoi(param);
break;
case 't':
param = optarg;
transition_time = stoi(param);
break;
case 'm':
param = optarg;
minrssi = stoi(param);
break;
case 'h':
param = optarg;
difference = stoi(param);
break;
default:
Application::usage();
return -1;
}
}
if((scan_treshold == default_rssi) || (difference == default_diff) || (minrssi == default_rssi) || (transition_time == default_diff))
{
Application::usage();
}
else if(iface_name)
{
string path;
if(unix_socket_dir)
{
path = unix_socket_dir;
}
else
{
path = DEFAULT_DIR;
}
signal(SIGINT,signal_handler);
signal(SIGTERM,signal_handler);
signal(SIGHUP,signal_handler);
Application app(path,iface_name,difference,transition_time,scan_treshold,minrssi);
Application::locker()->lock();
}
else
{
Application::usage();
printf("Control interface isn't specified\n");
}
}
catch(runtime_error& err)
{
Application::locker()->unlock();
cout << err.what() << endl;
}
}
| 25.056075 | 141 | 0.464752 |
e3660d7ddacbd7f2ee7310c1de55ad661408b87e | 629 | sql | SQL | apex/application/shared_components/user_interface/shortcuts/delete_confirm_msg.sql | jkvetina/PMP | 7de23d6ab60fb6fbafdf0ba5fb8371a2d58f4eaa | [
"MIT"
] | null | null | null | apex/application/shared_components/user_interface/shortcuts/delete_confirm_msg.sql | jkvetina/PMP | 7de23d6ab60fb6fbafdf0ba5fb8371a2d58f4eaa | [
"MIT"
] | null | null | null | apex/application/shared_components/user_interface/shortcuts/delete_confirm_msg.sql | jkvetina/PMP | 7de23d6ab60fb6fbafdf0ba5fb8371a2d58f4eaa | [
"MIT"
] | null | null | null | prompt --application/shared_components/user_interface/shortcuts/delete_confirm_msg
begin
-- Manifest
-- SHORTCUT: DELETE_CONFIRM_MSG
-- Manifest End
wwv_flow_api.component_begin (
p_version_yyyy_mm_dd=>'2020.10.01'
,p_release=>'20.2.0.00.20'
,p_default_workspace_id=>116577013837797376
,p_default_application_id=>1000
,p_default_id_offset=>0
,p_default_owner=>'PMP_APEX'
);
wwv_flow_api.create_shortcut(
p_id=>wwv_flow_api.id(116728268048910513)
,p_shortcut_name=>'DELETE_CONFIRM_MSG'
,p_shortcut_type=>'TEXT_ESCAPE_JS'
,p_shortcut=>'Would you like to perform this delete action?'
);
wwv_flow_api.component_end;
end;
/
| 27.347826 | 82 | 0.807631 |
b8bda05fec7302603a2ca87d709d6c3961b4b5a5 | 1,584 | h | C | src/sconelib/scone/controllers/FeedForwardController.h | tgeijten/scone-core | d435b22f34b7fea71552dcf7d6def71508c39132 | [
"Apache-2.0"
] | 5 | 2021-04-30T14:30:20.000Z | 2022-03-27T09:58:24.000Z | src/sconelib/scone/controllers/FeedForwardController.h | tgeijten/scone-core | d435b22f34b7fea71552dcf7d6def71508c39132 | [
"Apache-2.0"
] | 4 | 2021-06-15T10:52:10.000Z | 2021-12-15T10:25:21.000Z | src/sconelib/scone/controllers/FeedForwardController.h | tgeijten/scone-core | d435b22f34b7fea71552dcf7d6def71508c39132 | [
"Apache-2.0"
] | 2 | 2021-05-02T13:38:19.000Z | 2021-07-22T19:37:07.000Z | /*
** FeedForwardController.h
**
** Copyright (C) 2013-2019 Thomas Geijtenbeek and contributors. All rights reserved.
**
** This file is part of SCONE. For more information, see http://scone.software.
*/
#pragma once
#include "scone/core/types.h"
#include "scone/controllers/Controller.h"
#include "scone/core/PropNode.h"
#include "scone/optimization/Params.h"
#include "scone/core/Function.h"
#include "scone/model/Leg.h"
namespace OpenSim
{
class PiecewiseLinearFunction;
}
namespace scone
{
/// Controller that produces a feed-forward control signal for any actuator, based on a Function.
class FeedForwardController : public Controller
{
public:
FeedForwardController( const PropNode& props, Params& par, Model& model, const Location& target_area );
virtual ~FeedForwardController() { };
/// Bool indicating if function should be the same for left and right; default = true.
bool symmetric;
/// Actuator names to include (semicolon separated); default = "*"
String include;
/// Actuator names to exclude (semicolon separated); default = ""
String exclude;
virtual bool ComputeControls( Model& model, double timestamp ) override;
virtual String GetClassSignature() const override;
private:
// actuator info
struct ActInfo
{
ActInfo() : side( Side::None ), function_idx( NoIndex ), actuator_idx( NoIndex ) {};
String name;
Side side;
String full_name;
size_t function_idx;
size_t actuator_idx;
std::vector< double > mode_weights;
};
std::vector< FunctionUP > m_Functions;
std::vector< ActInfo > m_ActInfos;
};
}
| 25.967213 | 105 | 0.72601 |
c6c9790762a00723c57b5cfa93ec1ed3bb9ca9aa | 5,500 | css | CSS | files/SaiNudurupati_2018_AGU_iPoster_files/template1.css | saisiddu/saisiddu.github.io | f8ac6891ad14b56a66c7374034d53ed2bb711437 | [
"MIT"
] | null | null | null | files/SaiNudurupati_2018_AGU_iPoster_files/template1.css | saisiddu/saisiddu.github.io | f8ac6891ad14b56a66c7374034d53ed2bb711437 | [
"MIT"
] | null | null | null | files/SaiNudurupati_2018_AGU_iPoster_files/template1.css | saisiddu/saisiddu.github.io | f8ac6891ad14b56a66c7374034d53ed2bb711437 | [
"MIT"
] | null | null | null | /*Christer removed body background color and added overflow: hidden*/
body {
/* background-color: rgba(155,156,157,1) !important;*/
font-family: 'P22JohnstonUndergroundW 945068';
}
/*Christer added overflow: hidden when box open*/
.redactor-open {
overflow: hidden;
}
.visual strong {
font-family: 'P22JohnstonUndergroundW 945065';
}
h1, h2, h3, h4 {
font-family: 'Trade Gothic LT W01 Bold';
}
#main h2 {
font-family: 'P22JohnstonUndergroundW 945068';
}
/*.emaac2017 div#popuptextbox, .iposter div#popuptextbox, .paraguay-tephinet div#popuptextbox {
max-width: 900px;
}*/
/*Christer: template 1 css*/
@supports (-webkit-line-clamp: 1) {
#iTitleField1, #iTitleField2, #iTitleField3, #iTitleField4, #iTitleField5 {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
height: 3vw !important;
padding: 0.78vw 0.5vw 0.47vw 0vw;
}
.wrapper__minify #iTitleField1, .wrapper__minify #iTitleField2, .wrapper__minify #iTitleField3, .wrapper__minify #iTitleField4, .wrapper__minify #iTitleField5 {
display: block !important;
}
}
.scrollable-area {
height: 12vw !important;
}
.block {
height: 18.7vw !important;
}
.block.bg1 {
height: 41.05vw !important;
}
.block.bg1 .scrollable-area {
min-height: 34.4vw;
}
.template1 .block .more span {
line-height: 0.3vw !important;
background-size: 4.3vw !important;
}
/*Christer: changed position of popup textbox to reveal header*/
.kiosk #popuptextbox {
top: 10.3vw !important;
height: 46vw !important;
width: 45.4vw !important;
display: flex;
flex-direction: column;
}
#popuptextbox {
display: flex;
flex-direction: column;
width: 45.4vw !important;
}
.texttitle {
min-height: inherit !important;
flex: 0;
}
#popuptextbox .content {
height: auto !important;
max-height: 87.5% !important;
flex: auto;
margin-bottom: 1vw;
}
.kiosk #popuptextboxback {
/*z-index: 98 !important;
position: absolute !important;*/
top: 10.3vw !important;
}
/*#header {
z-index: 99 !important;
position: relative !important;
}*/
/*Christer added css code for the editor*/
.dark-skin-nav .column .block1 {
height: 17.3vw !important;
padding: 1vw 2vw;
margin: 0 0 4vw;
}
.dark-skin-nav .column .block3 {
height: 17.3vw !important;
padding: 1vw 2vw;
margin: 0 0 4vw;
}
.dark-skin-nav .column .block4 {
height: 23vw !important;
padding: 1vw 2vw;
margin: 0 0 4vw;
}
.dark-skin-nav .column .block2 {
height: 23vw !important;
padding: 1vw 2vw;
margin: 0 0 4vw;
}
.dark-skin-nav .column .block.bg1 {
height: 46.2vw !important;
padding: 1vw 2vw;
margin: 0 0 4vw;
}
.dark-skin-nav .column .block.edited {
height: 45.7vw !important;
}
.block.bg1.edited {
height: 47.6vw !important;
}
.dark-skin-nav .holder {
padding: 0 0 0 6vw !important;
}
.dark-skin-nav .block2 .scrollable-area, .dark-skin-nav .block2 .scrollable-area-wrapper {
height: 16.2vw !important;
}
.dark-skin-nav .block2.edited .scrollable-area, .dark-skin-nav .block2.edited .scrollable-area-wrapper {
height: 39vw !important;
}
.dark-skin-nav .block4 .scrollable-area, .dark-skin-nav .block4 .scrollable-area-wrapper {
height: 16.2vw !important;
}
.dark-skin-nav .block4.edited .scrollable-area, .dark-skin-nav .block4.edited .scrollable-area-wrapper {
height: 39vw !important;
}
.dark-skin-nav .block3 .scrollable-area, .dark-skin-nav .block3 .scrollable-area-wrapper {
height: 10.5vw !important;
}
.dark-skin-nav .block3.edited .scrollable-area, .dark-skin-nav .block3.edited .scrollable-area-wrapper {
height: 39vw !important;
}
.dark-skin-nav .block1 .scrollable-area, .dark-skin-nav .block1 .scrollable-area-wrapper {
height: 10.5vw !important;
}
.dark-skin-nav .block1.edited .scrollable-area, .dark-skin-nav .block1.edited .scrollable-area-wrapper {
height: 39vw !important;
}
.dark-skin-nav .block.bg1 .scrollable-area, .dark-skin-nav .block.bg1 .scrollable-area-wrapper {
height: 39.5vw !important;
}
.dark-skin-nav .block.bg1.edited .scrollable-area, .dark-skin-nav .block.bg1.edited .scrollable-area-wrapper {
height: 39vw !important;
}
.dark-skin-nav .edited .scrollable-area {
height: 40.7vw !important;
}
.block.edited {
top: 5vw !important;
}
.dark-skin-nav .column .block h2 {
font-size: 1.6vw;
line-height: 2vw;
font-weight: normal;
margin: 0;
padding: 0vw 0 0.5vw;
/*min-height: 3vw;*/
}
/*Christer End of added css code for the editor*/
.assh h2#iTitleField1, .assh h2#iTitleField2, .assh h2#iTitleField3, .assh h2#iTitleField4, .assh h2#iTitleField5 {
background-color: #f15500;
margin: -1vw -2vw 1vw -2vw;
padding: 1.2vw 0vw 0vw 1vw;
}
.assh .texttitle {
background: rgb(241, 85, 0) !important;
} | 26.442308 | 164 | 0.603273 |
256dbdf1f9e4dbdd6c575fac52415aee74b7856d | 5,647 | cs | C# | test/xunit.analyzers.tests/AssertEqualShouldNotBeUsedForNullCheckTests.cs | onovotny/xunit.analyzers | 643131ab4dbb35b0db87aead92e5275c20d5c3c3 | [
"Apache-2.0"
] | null | null | null | test/xunit.analyzers.tests/AssertEqualShouldNotBeUsedForNullCheckTests.cs | onovotny/xunit.analyzers | 643131ab4dbb35b0db87aead92e5275c20d5c3c3 | [
"Apache-2.0"
] | null | null | null | test/xunit.analyzers.tests/AssertEqualShouldNotBeUsedForNullCheckTests.cs | onovotny/xunit.analyzers | 643131ab4dbb35b0db87aead92e5275c20d5c3c3 | [
"Apache-2.0"
] | null | null | null | using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
namespace Xunit.Analyzers
{
public class AssertEqualShouldNotBeUsedForNullCheckTests
{
readonly DiagnosticAnalyzer analyzer = new AssertEqualShouldNotBeUsedForNullCheck();
public static TheoryData<string> Methods = new TheoryData<string> { "Equal", "NotEqual", "StrictEqual", "NotStrictEqual", "Same", "NotSame" };
[Theory]
[InlineData("Equal")]
[InlineData("NotEqual")]
public async void FindsWarning_ForFirstNullLiteral_StringOverload(string method)
{
var diagnostics = await CodeAnalyzerHelper.GetDiagnosticsAsync(analyzer,
@"class TestClass { void TestMethod() {
string val = null;
Xunit.Assert." + method + @"(null, val);
} }");
Assert.Collection(diagnostics, d =>
{
Assert.Equal($"Do not use Assert.{method}() to check for null value.", d.GetMessage());
Assert.Equal("xUnit2003", d.Id);
Assert.Equal(DiagnosticSeverity.Warning, d.Severity);
});
}
[Theory]
[InlineData("Equal")]
[InlineData("NotEqual")]
public async void FindsWarning_ForFirstNullLiteral_StringOverload_WithCustomComparer(string method)
{
var diagnostics = await CodeAnalyzerHelper.GetDiagnosticsAsync(analyzer,
@"class TestClass { void TestMethod() {
string val = null;
Xunit.Assert." + method + @"(null, val, System.StringComparer.Ordinal);
} }");
Assert.Collection(diagnostics, d =>
{
Assert.Equal($"Do not use Assert.{method}() to check for null value.", d.GetMessage());
Assert.Equal("xUnit2003", d.Id);
Assert.Equal(DiagnosticSeverity.Warning, d.Severity);
});
}
[Theory]
[MemberData(nameof(Methods))]
public async void FindsWarning_ForFirstNullLiteral_ObjectOverload(string method)
{
var diagnostics = await CodeAnalyzerHelper.GetDiagnosticsAsync(analyzer,
@"class TestClass { void TestMethod() {
object val = null;
Xunit.Assert." + method + @"(null, val);
} }");
Assert.Collection(diagnostics, d =>
{
Assert.Equal($"Do not use Assert.{method}() to check for null value.", d.GetMessage());
Assert.Equal("xUnit2003", d.Id);
Assert.Equal(DiagnosticSeverity.Warning, d.Severity);
});
}
[Theory]
[InlineData("Equal")]
[InlineData("NotEqual")]
public async void FindsWarning_ForFirstNullLiteral_ObjectOverload_WithCustomComparer(string method)
{
var diagnostics = await CodeAnalyzerHelper.GetDiagnosticsAsync(analyzer,
@"class TestClass { void TestMethod() {
object val = null;
Xunit.Assert." + method + @"(null, val, System.Collections.Generic.EqualityComparer<object>.Default);
} }");
Assert.Collection(diagnostics, d =>
{
Assert.Equal($"Do not use Assert.{method}() to check for null value.", d.GetMessage());
Assert.Equal("xUnit2003", d.Id);
Assert.Equal(DiagnosticSeverity.Warning, d.Severity);
});
}
[Theory]
[InlineData("Equal")]
[InlineData("NotEqual")]
[InlineData("StrictEqual")]
[InlineData("NotStrictEqual")]
public async void FindsWarning_ForFirstNullLiteral_GenericOverload(string method)
{
var diagnostics = await CodeAnalyzerHelper.GetDiagnosticsAsync(analyzer,
@"class TestClass { void TestMethod() {
TestClass val = null;
Xunit.Assert." + method + @"<TestClass>(null, val);
} }");
Assert.Collection(diagnostics, d =>
{
Assert.Equal($"Do not use Assert.{method}() to check for null value.", d.GetMessage());
Assert.Equal("xUnit2003", d.Id);
Assert.Equal(DiagnosticSeverity.Warning, d.Severity);
});
}
[Theory]
[InlineData("Equal")]
[InlineData("NotEqual")]
public async void FindsWarning_ForFirstNullLiteral_GenericOverload_WithCustomComparer(string method)
{
var diagnostics = await CodeAnalyzerHelper.GetDiagnosticsAsync(analyzer,
@"class TestClass { void TestMethod() {
TestClass val = null;
Xunit.Assert." + method + @"<TestClass>(null, val, System.Collections.Generic.EqualityComparer<TestClass>.Default);
} }");
Assert.Collection(diagnostics, d =>
{
Assert.Equal($"Do not use Assert.{method}() to check for null value.", d.GetMessage());
Assert.Equal("xUnit2003", d.Id);
Assert.Equal(DiagnosticSeverity.Warning, d.Severity);
});
}
[Theory]
[MemberData(nameof(Methods))]
public async void DoesNotFindWarning_ForOtherLiteral(string method)
{
var diagnostics = await CodeAnalyzerHelper.GetDiagnosticsAsync(analyzer,
@"class TestClass { void TestMethod() {
int val = 1;
Xunit.Assert." + method + @"(1, val);
} }");
Assert.Empty(diagnostics);
}
[Theory]
[MemberData(nameof(Methods))]
public async void DoesNotFindWarning_ForSecondNullLiteral(string method)
{
var diagnostics = await CodeAnalyzerHelper.GetDiagnosticsAsync(analyzer,
@"class TestClass { void TestMethod() {
string val = null;
Xunit.Assert." + method + @"(val, null);
} }");
Assert.Empty(diagnostics);
}
}
}
| 36.668831 | 150 | 0.609881 |
f4c917d6ffdb98a3a99422074624b95a7aa460c4 | 179 | ts | TypeScript | src/testing/constants.ts | jrhee17/exaka-client | 03a3c97dc02ef1b4996f62021f4c2f82b0b3d276 | [
"MIT"
] | null | null | null | src/testing/constants.ts | jrhee17/exaka-client | 03a3c97dc02ef1b4996f62021f4c2f82b0b3d276 | [
"MIT"
] | null | null | null | src/testing/constants.ts | jrhee17/exaka-client | 03a3c97dc02ef1b4996f62021f4c2f82b0b3d276 | [
"MIT"
] | null | null | null | import {Auth} from "../app/auth/service/auth";
/**
* Created by john on 02/10/2017.
*/
export const TEST_CONST = {
AUTH_ID : '1234',
AUTH_OBJ : new Auth({_id: '1234'}),
};
| 17.9 | 46 | 0.608939 |
b5ef38ab68a6f2ca5691355270ef1ae24c94da39 | 2,248 | lua | Lua | BGAnimations/ScreenSelectMusic overlay/SortMenu/InputHandler.lua | xiaowuc1/Simply-Love-SM5 | 7b2b977fbe24fee2486c3617f8c2f403d25ad0a5 | [
"MIT"
] | null | null | null | BGAnimations/ScreenSelectMusic overlay/SortMenu/InputHandler.lua | xiaowuc1/Simply-Love-SM5 | 7b2b977fbe24fee2486c3617f8c2f403d25ad0a5 | [
"MIT"
] | null | null | null | BGAnimations/ScreenSelectMusic overlay/SortMenu/InputHandler.lua | xiaowuc1/Simply-Love-SM5 | 7b2b977fbe24fee2486c3617f8c2f403d25ad0a5 | [
"MIT"
] | null | null | null | local sort_wheel = ...
-- this handles user input
local function input(event)
if not event.PlayerNumber or not event.button then
return false
end
if event.type ~= "InputEventType_Release" then
local overlay = SCREENMAN:GetTopScreen():GetChild("Overlay")
if event.GameButton == "MenuRight" then
sort_wheel:scroll_by_amount(1)
overlay:GetChild("SortMenu"):GetChild("change_sound"):play()
elseif event.GameButton == "MenuLeft" then
sort_wheel:scroll_by_amount(-1)
overlay:GetChild("SortMenu"):GetChild("change_sound"):play()
elseif event.GameButton == "Start" then
overlay:GetChild("SortMenu"):GetChild("start_sound"):play()
local focus = sort_wheel:get_actor_item_at_focus_pos()
if focus.kind == "SortBy" then
MESSAGEMAN:Broadcast('Sort',{order=focus.sort_by})
overlay:queuecommand("HideSortMenu")
elseif focus.kind == "ChangeMode" then
SL.Global.GameMode = focus.change
SetGameModePreferences()
THEME:ReloadMetrics()
-- Change the header text to reflect the newly selected GameMode.
overlay:GetParent():GetChild("Header"):playcommand("UpdateHeaderText")
-- Reload the SortMenu's available options and queue "HideSortMenu"
-- which also returns input back away from Lua back to the engine.
overlay:GetChild("SortMenu"):playcommand("On"):queuecommand("HideSortMenu")
elseif focus.kind == "ChangeStyle" then
-- If the MenuTimer is in effect, make sure to grab its current
-- value before reloading the screen.
if PREFSMAN:GetPreference("MenuTimer") then
overlay:playcommand("ShowPressStartForOptions")
end
-- Get the style we want to change to
local new_style = focus.change:lower()
-- accommodate techno game
if GAMESTATE:GetCurrentGame():GetName()=="techno" then new_style = new_style.."8" end
-- set it in the engine
GAMESTATE:SetCurrentStyle(new_style)
-- finally, reload the screen
local topscreen = SCREENMAN:GetTopScreen()
topscreen:SetNextScreenName("ScreenReloadSSM")
topscreen:StartTransitioningScreen("SM_GoToNextScreen")
end
elseif event.GameButton == "Back" or event.GameButton == "Select" then
overlay:queuecommand("HideSortMenu")
end
end
return false
end
return input | 32.114286 | 89 | 0.729093 |
8b5bb5a41a588a4066c2f1eaac1f7060331922d1 | 28,071 | sql | SQL | uni (1).sql | rajaariffs18/e-commerce | dfae82d2f177efc4ade4c113b10d49e38b3af409 | [
"BSD-3-Clause"
] | null | null | null | uni (1).sql | rajaariffs18/e-commerce | dfae82d2f177efc4ade4c113b10d49e38b3af409 | [
"BSD-3-Clause"
] | null | null | null | uni (1).sql | rajaariffs18/e-commerce | dfae82d2f177efc4ade4c113b10d49e38b3af409 | [
"BSD-3-Clause"
] | null | null | null | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Waktu pembuatan: 08 Bulan Mei 2019 pada 23.33
-- Versi server: 8.0.13
-- Versi PHP: 7.1.25
SET FOREIGN_KEY_CHECKS=0;
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: `uni`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `migration`
--
CREATE TABLE `migration` (
`version` varchar(180) NOT NULL,
`apply_time` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data untuk tabel `migration`
--
INSERT INTO `migration` (`version`, `apply_time`) VALUES
('m000000_000000_base', 1545669070),
('m130524_201442_init', 1545669074);
-- --------------------------------------------------------
--
-- Struktur dari tabel `ref_kabupaten`
--
CREATE TABLE `ref_kabupaten` (
`Kd_Prov` tinyint(4) NOT NULL,
`Kd_Kab` tinyint(4) NOT NULL,
`Nm_Kab` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
--
-- Dumping data untuk tabel `ref_kabupaten`
--
INSERT INTO `ref_kabupaten` (`Kd_Prov`, `Kd_Kab`, `Nm_Kab`) VALUES
(5, 1, 'KAB. TAPANULI TENGAH'),
(5, 2, 'KAB. TAPANULI UTARA'),
(5, 3, 'KAB. TAPANULI SELATAN'),
(5, 4, 'KAB. NIAS'),
(5, 5, 'KAB. LANGKAT'),
(5, 6, 'KAB. KARO'),
(5, 7, 'KAB. DELI SERDANG'),
(5, 8, 'KAB. SIMALUNGUN'),
(5, 9, 'KAB. ASAHAN'),
(5, 10, 'KAB. LABUHANBATU'),
(5, 11, 'KAB. DAIRI'),
(5, 12, 'KAB. TOBA SAMOSIR'),
(5, 13, 'KAB. MANDAILING NATAL'),
(5, 14, 'KAB. NIAS SELATAN'),
(5, 15, 'KAB. PAKPAK BHARAT'),
(5, 16, 'KAB. HUMBANG HASUNDUTAN'),
(5, 17, 'KAB. SAMOSIR'),
(5, 18, 'KAB. SERDANG BEDAGAI'),
(5, 19, 'KAB. BATU BARA'),
(5, 20, 'KAB. PADANG LAWAS UTARA'),
(5, 21, 'KAB. PADANG LAWAS'),
(5, 22, 'KAB. LABUHANBATU SELATAN'),
(5, 23, 'KAB. LABUHANBATU UTARA'),
(5, 24, 'KAB. NIAS UTARA'),
(5, 25, 'KAB. NIAS BARAT'),
(5, 71, 'KOTA MEDAN'),
(5, 72, 'KOTA PEMATANG SIANTAR'),
(5, 73, 'KOTA SIBOLGA'),
(5, 74, 'KOTA TANJUNG BALAI'),
(5, 75, 'KOTA BINJAI'),
(5, 76, 'KOTA TEBING TINGGI'),
(5, 77, 'KOTA PADANGSIDIMPUAN'),
(5, 78, 'KOTA GUNUNGSITOLI');
-- --------------------------------------------------------
--
-- Struktur dari tabel `ref_kecamatan`
--
CREATE TABLE `ref_kecamatan` (
`Kd_Prov` tinyint(4) NOT NULL,
`Kd_Kab` tinyint(4) NOT NULL,
`Kd_Kec` tinyint(4) NOT NULL,
`Nm_Kec` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
-- --------------------------------------------------------
--
-- Struktur dari tabel `ref_provinsi`
--
CREATE TABLE `ref_provinsi` (
`Kd_Prov` tinyint(4) NOT NULL,
`Nm_Prov` varchar(200) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
--
-- Dumping data untuk tabel `ref_provinsi`
--
INSERT INTO `ref_provinsi` (`Kd_Prov`, `Nm_Prov`) VALUES
(1, 'BALI'),
(2, 'KEPULAUAN BANGKA BELITUNG'),
(3, 'BANTEN'),
(4, 'BENGKULU'),
(5, 'DAERAH ISTIMEWA YOGYAKARTA'),
(6, 'DAERAH KHUSUS IBUKOTA JAKARTA'),
(8, 'JAMBI'),
(9, 'JAWA BARAT'),
(10, 'JAWA TENGAH'),
(11, 'JAWA TIMUR'),
(12, 'KALIMANTAN BARAT'),
(13, 'KALIMANTAN SELATAN'),
(14, 'KALIMANTAN TENGAH'),
(15, 'KALIMANTAN TIMUR'),
(17, 'KEPULAUAN RIAU'),
(18, 'LAMPUNG'),
(21, 'ACEH'),
(22, 'NUSA TENGGARA BARAT'),
(23, 'NUSA TENGGARA TIMUR'),
(26, 'RIAU'),
(29, 'SULAWESI TENGAH'),
(31, 'SULAWESI UTARA'),
(32, 'SUMATERA BARAT'),
(33, 'SUMATERA SELATAN'),
(34, 'SUMATERA UTARA'),
(73, 'SULAWESI SELATAN'),
(74, 'SULAWESI TENGGARA'),
(75, 'GORONTALO'),
(76, 'SULAWESI BARAT'),
(81, 'MALUKU'),
(82, 'MALUKU UTARA'),
(91, 'PAPUA'),
(92, 'PAPUA BARAT');
-- --------------------------------------------------------
--
-- Struktur dari tabel `ref_rekening`
--
CREATE TABLE `ref_rekening` (
`id` int(11) NOT NULL,
`no_rek` varchar(150) NOT NULL,
`atas_nama` varchar(150) NOT NULL,
`nama_atm` varchar(16) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data untuk tabel `ref_rekening`
--
INSERT INTO `ref_rekening` (`id`, `no_rek`, `atas_nama`, `nama_atm`) VALUES
(1, '213123127838712', 'Adinda Amira', 'Bri'),
(2, '3561235616235612', 'Adinda Amira', 'Bni');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_kategori`
--
CREATE TABLE `tb_kategori` (
`id` int(11) NOT NULL,
`kategori` varchar(255) NOT NULL,
`status` tinyint(4) NOT NULL,
`id_file` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data untuk tabel `tb_kategori`
--
INSERT INTO `tb_kategori` (`id`, `kategori`, `status`, `id_file`) VALUES
(1, 'Gamis', 2, 0),
(2, 'Khimar', 1, 0),
(3, 'Outer', 1, 0),
(4, 'Rok', 1, 0),
(5, 'Set Syari', 1, 0);
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_kategori_media`
--
CREATE TABLE `tb_kategori_media` (
`id` int(11) NOT NULL,
`id_produk` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`filename` varchar(350) NOT NULL,
`size` int(11) NOT NULL,
`type` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data untuk tabel `tb_kategori_media`
--
INSERT INTO `tb_kategori_media` (`id`, `id_produk`, `name`, `filename`, `size`, `type`) VALUES
(1, 1, '43608725_356986128440336_7126646213172798877_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/43608725_356986128440336_7126646213172798877_n.jpg', 94449, '.jpg'),
(2, 2, 'h5', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/h5.jpg', 62227, '.jpg'),
(3, 3, 'a1', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/a1.jpg', 46748, '.jpg'),
(4, 4, '79e96f09-e76c-4533-82b3-eaa8c390486c', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/79e96f09-e76c-4533-82b3-eaa8c390486c.jpg', 149549, '.jpg'),
(5, 5, '0c980b7d-a056-41ec-be87-58f95a52a146', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/0c980b7d-a056-41ec-be87-58f95a52a146.jpg', 53335, '.jpg'),
(6, 7, 'Screen Shot 2019-04-18 at 20.06.35', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/Screen Shot 2019-04-18 at 20.06.35.png', 1123358, '.png'),
(7, 3, '32918875_634889596845702_6603638446688829440_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/32918875_634889596845702_6603638446688829440_n.jpg', 740637, '.jpg');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_konfimasi_pembayaran`
--
CREATE TABLE `tb_konfimasi_pembayaran` (
`id` int(11) NOT NULL,
`id_user` int(11) NOT NULL,
`nama_pengirim` varchar(255) NOT NULL,
`no_pesanan` int(11) NOT NULL,
`nama_bank` varchar(255) NOT NULL,
`jumlah_transfer` int(11) NOT NULL,
`id_file` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data untuk tabel `tb_konfimasi_pembayaran`
--
INSERT INTO `tb_konfimasi_pembayaran` (`id`, `id_user`, `nama_pengirim`, `no_pesanan`, `nama_bank`, `jumlah_transfer`, `id_file`) VALUES
(16, 2, 'Arya Duta', 294583, 'Bri', 12755123, NULL);
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_konfirmasi_media`
--
CREATE TABLE `tb_konfirmasi_media` (
`id` int(11) NOT NULL,
`id_konfirmasi` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`filename` varchar(350) NOT NULL,
`size` int(11) NOT NULL,
`type` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data untuk tabel `tb_konfirmasi_media`
--
INSERT INTO `tb_konfirmasi_media` (`id`, `id_konfirmasi`, `name`, `filename`, `size`, `type`) VALUES
(1, 16, 'Screen Shot 2019-04-18 at 20.06.35', '/Users/rajaariffadillah/Sites/uni-rancak/frontend/web/uploads/Screen Shot 2019-04-18 at 20.06.35.png', 1123358, '.png');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_produk`
--
CREATE TABLE `tb_produk` (
`id` int(11) NOT NULL,
`nama_barang` varchar(350) NOT NULL,
`deskripsi` text NOT NULL,
`stok` smallint(6) NOT NULL,
`harga_barang` bigint(20) NOT NULL,
`tanggal_upload` int(11) NOT NULL,
`kd_kategori` tinyint(4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data untuk tabel `tb_produk`
--
INSERT INTO `tb_produk` (`id`, `nama_barang`, `deskripsi`, `stok`, `harga_barang`, `tanggal_upload`, `kd_kategori`) VALUES
(22, 'gamis 1', 'Gamis 1 Wanita', 15, 213456, 1546011189, 1),
(23, 'Gamis 2', 'Gamis 2 Wanita', 15, 234231, 1546011245, 1),
(24, 'Gamis 3', 'Gamis 3 Wanita', 15, 12321211, 1546011299, 1),
(25, 'Khimar 1', 'Khimar 1 Wanita', 15, 150000, 1555641426, 2),
(26, 'Khimar 2', 'Khimar 2 Wanita', 15, 150000, 1555641488, 2),
(27, 'Outer 1', 'Outer 1 Wanita', 15, 175000, 1555641591, 3),
(28, 'Outer 2', 'Outer 2 Wanita', 17, 175000, 1555641638, 3),
(29, 'Rok 1', 'Deskripsi', 17, 120000, 1555641689, 4),
(30, 'Syari 1', 'Syari 1 Wanita', 15, 200000, 1555641754, 5),
(31, 'Syari 2', 'Syari 2 Wanita', 15, 200000, 1555641802, 5);
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_produk_media`
--
CREATE TABLE `tb_produk_media` (
`id` int(11) NOT NULL,
`id_produk` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`filename` varchar(350) NOT NULL,
`size` int(11) NOT NULL,
`type` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data untuk tabel `tb_produk_media`
--
INSERT INTO `tb_produk_media` (`id`, `id_produk`, `name`, `filename`, `size`, `type`) VALUES
(3, 21, 'Screen Shot 2018-12-18 at 13.59.28', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/Screen Shot 2018-12-18 at 13.59.28.png', 814164, '.png'),
(4, 21, 'Screen Shot 2018-12-18 at 15.07.03', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/Screen Shot 2018-12-18 at 15.07.03.png', 909073, '.png'),
(5, 21, 'Screen Shot 2018-12-21 at 22.07.11', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/Screen Shot 2018-12-21 at 22.07.11.png', 1995016, '.png'),
(6, 21, 'Screen Shot 2018-12-21 at 22.07.25', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/Screen Shot 2018-12-21 at 22.07.25.png', 1058966, '.png'),
(7, 22, '43608725_356986128440336_7126646213172798877_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/43608725_356986128440336_7126646213172798877_n.jpg', 94449, '.jpg'),
(8, 22, '44868323_209715896573796_1321991322084182426_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/44868323_209715896573796_1321991322084182426_n.jpg', 107970, '.jpg'),
(9, 22, '44887060_353779708715825_5698987327466834135_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/44887060_353779708715825_5698987327466834135_n.jpg', 141906, '.jpg'),
(10, 22, '45424767_519467888530645_8448373900692713264_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/45424767_519467888530645_8448373900692713264_n.jpg', 107123, '.jpg'),
(11, 22, '46737411_300485153914309_975797533811839643_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/46737411_300485153914309_975797533811839643_n.jpg', 139198, '.jpg'),
(12, 23, '43748111_182790402670248_4740114858907122239_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/43748111_182790402670248_4740114858907122239_n.jpg', 59228, '.jpg'),
(13, 23, '44721709_1899051970185178_6343105257978891793_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/44721709_1899051970185178_6343105257978891793_n.jpg', 56654, '.jpg'),
(14, 23, '44790848_338759963630513_7044382354356214633_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/44790848_338759963630513_7044382354356214633_n.jpg', 62422, '.jpg'),
(15, 23, '44871203_798896827119283_4427612093396032849_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/44871203_798896827119283_4427612093396032849_n.jpg', 61215, '.jpg'),
(16, 24, '44417951_566935193735079_5471050323051920883_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/44417951_566935193735079_5471050323051920883_n.jpg', 56542, '.jpg'),
(17, 24, '44498271_252568652085596_5181073777758251952_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/44498271_252568652085596_5181073777758251952_n.jpg', 51601, '.jpg'),
(18, 24, '44499476_279936329324674_1127131952547838678_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/44499476_279936329324674_1127131952547838678_n.jpg', 47963, '.jpg'),
(19, 24, '44511559_2294258263982789_2532682104359219877_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/44511559_2294258263982789_2532682104359219877_n.jpg', 58031, '.jpg'),
(20, 24, '44773058_2160556054262603_8015461450349925362_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/44773058_2160556054262603_8015461450349925362_n.jpg', 40815, '.jpg'),
(21, 24, '44774056_481853535640782_2824922404838474979_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/44774056_481853535640782_2824922404838474979_n.jpg', 52386, '.jpg'),
(22, 24, '44872558_267156470649974_2624082778253676651_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/44872558_267156470649974_2624082778253676651_n.jpg', 57006, '.jpg'),
(23, 24, '45358938_288702668652620_8580271294609611966_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/45358938_288702668652620_8580271294609611966_n.jpg', 59868, '.jpg'),
(24, 24, '46122929_264554604245936_2778760170815549099_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/46122929_264554604245936_2778760170815549099_n.jpg', 51383, '.jpg'),
(25, 25, 'h5', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/h5.jpg', 62227, '.jpg'),
(26, 25, 'img-20180503-154137', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/img-20180503-154137.jpg', 96651, '.jpg'),
(27, 25, 'img-20180503-154458', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/img-20180503-154458.jpg', 104277, '.jpg'),
(28, 25, 'img-20180503-154557', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/img-20180503-154557.jpg', 92501, '.jpg'),
(29, 25, 'whatsappimage2018-11-02at163718', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/whatsappimage2018-11-02at163718.jpeg', 52601, '.jpeg'),
(30, 26, '41220730_176651453264224_4852246944745625586_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/41220730_176651453264224_4852246944745625586_n.jpg', 25051, '.jpg'),
(31, 26, '43628364_257359445134071_4285823511833455830_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/43628364_257359445134071_4285823511833455830_n.jpg', 29491, '.jpg'),
(32, 26, '43666839_153682125588470_5674901538162775423_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/43666839_153682125588470_5674901538162775423_n.jpg', 24940, '.jpg'),
(33, 26, '43778607_2194971660746370_9147110953431746258_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/43778607_2194971660746370_9147110953431746258_n.jpg', 25795, '.jpg'),
(34, 26, '43778945_100440064281744_1410506545550400093_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/43778945_100440064281744_1410506545550400093_n.jpg', 29348, '.jpg'),
(35, 26, '44182040_1409098212557723_4568656831327127183_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/44182040_1409098212557723_4568656831327127183_n.jpg', 26059, '.jpg'),
(36, 26, '44626696_310334506456794_4626376629665508308_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/44626696_310334506456794_4626376629665508308_n.jpg', 23512, '.jpg'),
(37, 26, '46072918_316293049206245_8296057872813954624_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/46072918_316293049206245_8296057872813954624_n.jpg', 22810, '.jpg'),
(38, 27, 'a1', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/a1.jpg', 46748, '.jpg'),
(39, 27, 'a2', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/a2.jpg', 21014, '.jpg'),
(40, 27, 'a3', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/a3.jpg', 22678, '.jpg'),
(41, 27, 'a4', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/a4.jpg', 27032, '.jpg'),
(42, 27, 'a5', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/a5.jpg', 29955, '.jpg'),
(43, 27, 'a6', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/a6.jpg', 23562, '.jpg'),
(44, 27, 'a7', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/a7.jpg', 22203, '.jpg'),
(45, 28, '32918875_634889596845702_6603638446688829440_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/32918875_634889596845702_6603638446688829440_n.jpg', 740637, '.jpg'),
(46, 28, '33437807_2049722415277023_8025325720345509888_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/33437807_2049722415277023_8025325720345509888_n.jpg', 837226, '.jpg'),
(47, 28, '33473529_1009077922550820_6938065645695139840_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/33473529_1009077922550820_6938065645695139840_n.jpg', 788120, '.jpg'),
(48, 29, '79e96f09-e76c-4533-82b3-eaa8c390486c', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/79e96f09-e76c-4533-82b3-eaa8c390486c.jpg', 149549, '.jpg'),
(49, 29, '309a079a-d923-4be2-82ac-b4037372d4fb', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/309a079a-d923-4be2-82ac-b4037372d4fb.jpg', 129255, '.jpg'),
(50, 29, '996e3fb4-067b-4ed5-b6a1-41bbcfe0f78e', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/996e3fb4-067b-4ed5-b6a1-41bbcfe0f78e.jpg', 119650, '.jpg'),
(51, 29, '56480347-0e6e-4cd0-9ef3-228cd72c899d', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/56480347-0e6e-4cd0-9ef3-228cd72c899d.jpg', 117735, '.jpg'),
(52, 29, 'a2a3f978-40a2-4695-aead-f7760e5a9f9e', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/a2a3f978-40a2-4695-aead-f7760e5a9f9e.jpg', 112944, '.jpg'),
(53, 29, 'wordswag-1519704172453', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/wordswag-1519704172453.png', 2025157, '.png'),
(54, 30, '0c980b7d-a056-41ec-be87-58f95a52a146', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/0c980b7d-a056-41ec-be87-58f95a52a146.jpg', 53335, '.jpg'),
(55, 30, '9b7eb730-c61f-4382-9d29-f6f8a12c1725', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/9b7eb730-c61f-4382-9d29-f6f8a12c1725.jpg', 56784, '.jpg'),
(56, 30, '528004ae-9ca4-477c-bb90-b3b58c1c32f5', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/528004ae-9ca4-477c-bb90-b3b58c1c32f5.jpg', 52108, '.jpg'),
(57, 30, '04264011-a299-40e0-bb6f-a348397592b9', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/04264011-a299-40e0-bb6f-a348397592b9.jpg', 55696, '.jpg'),
(58, 30, 'ae48aa3b-589b-4bd7-91db-c24279a26c2d', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/ae48aa3b-589b-4bd7-91db-c24279a26c2d.jpg', 57341, '.jpg'),
(59, 31, '47338178_2200801053518441_4967187277912439982_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/47338178_2200801053518441_4967187277912439982_n.jpg', 143326, '.jpg'),
(60, 31, '47382564_722969058101929_704744896620002446_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/47382564_722969058101929_704744896620002446_n.jpg', 126723, '.jpg'),
(61, 31, '47581388_123391092023930_4541844608242608162_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/47581388_123391092023930_4541844608242608162_n.jpg', 47344, '.jpg'),
(62, 31, '47583175_1162542277243885_5663921342171729202_n', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/47583175_1162542277243885_5663921342171729202_n.jpg', 83790, '.jpg'),
(63, 31, '47585865_312616159586945_6670814646680151547_n (1)', '/Users/rajaariffadillah/Sites/uni-rancak/backend/web/uploads/47585865_312616159586945_6670814646680151547_n (1).jpg', 88671, '.jpg');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_transaksi_barang`
--
CREATE TABLE `tb_transaksi_barang` (
`id` int(11) NOT NULL,
`id_user` int(11) NOT NULL,
`id_transaksi` int(11) NOT NULL,
`id_barang` int(11) NOT NULL,
`qty` int(11) NOT NULL,
`catatan` varchar(255) NOT NULL,
`total_harga` bigint(20) DEFAULT NULL,
`status_transaksi` tinyint(4) NOT NULL,
`kd_prov` int(11) DEFAULT NULL,
`kd_city` int(11) DEFAULT NULL,
`alamat` text,
`harga_final` bigint(20) DEFAULT NULL,
`kurir` varchar(15) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data untuk tabel `tb_transaksi_barang`
--
INSERT INTO `tb_transaksi_barang` (`id`, `id_user`, `id_transaksi`, `id_barang`, `qty`, `catatan`, `total_harga`, `status_transaksi`, `kd_prov`, `kd_city`, `alamat`, `harga_final`, `kurir`) VALUES
(1, 2, 294583, 22, 2, 'Warnah Putih', 426912, 3, NULL, 278, NULL, 12755123, NULL),
(2, 2, 294583, 24, 1, 'Warna kuning', 12321211, 3, NULL, NULL, NULL, NULL, NULL);
-- --------------------------------------------------------
--
-- Struktur dari tabel `tb_transaksi_data`
--
CREATE TABLE `tb_transaksi_data` (
`id_user` int(11) NOT NULL,
`id_transaksi` int(11) NOT NULL,
`nama_depan` varchar(225) NOT NULL,
`nama_belakang` varchar(225) NOT NULL,
`kode_pos` varchar(225) NOT NULL,
`no_telp` varchar(225) NOT NULL,
`metode_pembayaran` varchar(225) NOT NULL,
`estimasi_pengiriman` varchar(225) NOT NULL,
`ongkos_kirim` int(11) NOT NULL,
`kd_atm` varchar(11) NOT NULL,
`provinsi` varchar(255) NOT NULL,
`kab_kota` varchar(255) NOT NULL,
`alamat` varchar(355) NOT NULL,
`total_pembayaran` bigint(20) NOT NULL,
`status` tinyint(4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data untuk tabel `tb_transaksi_data`
--
INSERT INTO `tb_transaksi_data` (`id_user`, `id_transaksi`, `nama_depan`, `nama_belakang`, `kode_pos`, `no_telp`, `metode_pembayaran`, `estimasi_pengiriman`, `ongkos_kirim`, `kd_atm`, `provinsi`, `kab_kota`, `alamat`, `total_pembayaran`, `status`) VALUES
(2, 294583, 'Arya', 'Duta', '', '', 'jne', '1-2', 7000, '1', 'Sumatera Utara', 'Medan', 'Medan kota', 12755123, 4);
-- --------------------------------------------------------
--
-- Struktur dari tabel `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`username` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`auth_key` varchar(32) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`password_hash` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`password_reset_token` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
`email` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
`status` smallint(6) NOT NULL DEFAULT '10',
`nama` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`tempat_lahir` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`tanggal_lahir` date DEFAULT NULL,
`no_hp` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`alamat` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`role` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
`created_at` int(11) NOT NULL,
`updated_at` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data untuk tabel `user`
--
INSERT INTO `user` (`id`, `username`, `auth_key`, `password_hash`, `password_reset_token`, `email`, `status`, `nama`, `tempat_lahir`, `tanggal_lahir`, `no_hp`, `alamat`, `role`, `created_at`, `updated_at`) VALUES
(1, 'admin', '1Kkca8uFwzBo1sS4Ntzk1QgoJ_b2t0tY', '$2y$13$bdYG0QWtvr7f.P8.tBy/W.ikdE.Z4nWw7L8yM8RUqh0cC8FOgLpeK', NULL, '[email protected]', 10, '', '', NULL, '', '', '', 1545669240, 1545669240),
(2, 'user', 'Y1pi7U8SM_wm3Trk9dmLeEevEVW8NaUj', '$2y$13$6kGamV1V6R9ITY2LeoY4.O/PZ0oeChTZ6.ZW7k/v1jO1/jcCsHECG', NULL, '[email protected]', 10, '', '', NULL, '', '', '', 1548808228, 1548808228),
(3, 'aa', 'WsYUQw4XNGX58kl13o4cnHn_0kHSKKcj', '$2y$13$.fcviLi0YCnOAOdv8OYQjey567S1PrwCHZMaDOgtvcY8q0GlOwd9O', NULL, '[email protected]', 10, '', '', NULL, '', '', '', 1554728834, 1554728834),
(4, 'anra', 'X_4hQenaq0zd5JAUSAbOiNZwbPQLtT3q', '$2y$13$se.SFsBytbmbOWJBeRJ7O.RDeenA3Ywsc9EFeZQ6FfA4SypVnBCWa', NULL, '[email protected]', 10, 'anra', 'Medan', '1995-06-19', '081234567898', 'Medan Barat', 'user', 1557357602, 1557357602);
--
-- Indexes for dumped tables
--
--
-- Indeks untuk tabel `migration`
--
ALTER TABLE `migration`
ADD PRIMARY KEY (`version`);
--
-- Indeks untuk tabel `ref_kabupaten`
--
ALTER TABLE `ref_kabupaten`
ADD PRIMARY KEY (`Kd_Prov`,`Kd_Kab`) USING BTREE;
--
-- Indeks untuk tabel `ref_kecamatan`
--
ALTER TABLE `ref_kecamatan`
ADD PRIMARY KEY (`Kd_Prov`,`Kd_Kab`,`Kd_Kec`) USING BTREE;
--
-- Indeks untuk tabel `ref_provinsi`
--
ALTER TABLE `ref_provinsi`
ADD PRIMARY KEY (`Kd_Prov`,`Nm_Prov`);
--
-- Indeks untuk tabel `ref_rekening`
--
ALTER TABLE `ref_rekening`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tb_kategori`
--
ALTER TABLE `tb_kategori`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tb_kategori_media`
--
ALTER TABLE `tb_kategori_media`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tb_konfimasi_pembayaran`
--
ALTER TABLE `tb_konfimasi_pembayaran`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tb_konfirmasi_media`
--
ALTER TABLE `tb_konfirmasi_media`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tb_produk`
--
ALTER TABLE `tb_produk`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tb_produk_media`
--
ALTER TABLE `tb_produk_media`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tb_transaksi_barang`
--
ALTER TABLE `tb_transaksi_barang`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tb_transaksi_data`
--
ALTER TABLE `tb_transaksi_data`
ADD PRIMARY KEY (`id_transaksi`);
--
-- Indeks untuk tabel `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `username` (`username`),
ADD UNIQUE KEY `email` (`email`),
ADD UNIQUE KEY `password_reset_token` (`password_reset_token`);
--
-- AUTO_INCREMENT untuk tabel yang dibuang
--
--
-- AUTO_INCREMENT untuk tabel `ref_rekening`
--
ALTER TABLE `ref_rekening`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT untuk tabel `tb_kategori`
--
ALTER TABLE `tb_kategori`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT untuk tabel `tb_kategori_media`
--
ALTER TABLE `tb_kategori_media`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT untuk tabel `tb_konfimasi_pembayaran`
--
ALTER TABLE `tb_konfimasi_pembayaran`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
--
-- AUTO_INCREMENT untuk tabel `tb_konfirmasi_media`
--
ALTER TABLE `tb_konfirmasi_media`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT untuk tabel `tb_produk`
--
ALTER TABLE `tb_produk`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32;
--
-- AUTO_INCREMENT untuk tabel `tb_produk_media`
--
ALTER TABLE `tb_produk_media`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=64;
--
-- AUTO_INCREMENT untuk tabel `tb_transaksi_barang`
--
ALTER TABLE `tb_transaksi_barang`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT untuk tabel `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- Ketidakleluasaan untuk tabel pelimpahan (Dumped Tables)
--
--
-- Ketidakleluasaan untuk tabel `ref_kabupaten`
--
ALTER TABLE `ref_kabupaten`
ADD CONSTRAINT `FK_Ref_Kabupaten` FOREIGN KEY (`Kd_Prov`) REFERENCES `ref_provinsi` (`kd_prov`) ON UPDATE CASCADE;
--
-- Ketidakleluasaan untuk tabel `ref_kecamatan`
--
ALTER TABLE `ref_kecamatan`
ADD CONSTRAINT `FK_Ref_Kecamatan` FOREIGN KEY (`Kd_Prov`,`Kd_Kab`) REFERENCES `ref_kabupaten` (`kd_prov`, `kd_kab`) ON UPDATE CASCADE;
SET FOREIGN_KEY_CHECKS=1;
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 */;
| 42.791159 | 254 | 0.714474 |
1c32bf0929100a843323806a75bc62781ca884cf | 8,370 | asm | Assembly | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_997.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 9 | 2020-08-13T19:41:58.000Z | 2022-03-30T12:22:51.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_997.asm | ljhsiun2/medusa | 67d769b8a2fb42c538f10287abaf0e6dbb463f0c | [
"MIT"
] | 1 | 2021-04-29T06:29:35.000Z | 2021-05-13T21:02:30.000Z | Transynther/x86/_processed/NONE/_xt_/i9-9900K_12_0xca_notsx.log_21829_997.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 %r11
push %r14
push %r15
push %rax
push %rbx
push %rcx
push %rdi
push %rsi
lea addresses_normal_ht+0x1b59e, %r11
nop
nop
add %rcx, %rcx
mov $0x6162636465666768, %rbx
movq %rbx, (%r11)
nop
nop
nop
nop
cmp %rdi, %rdi
lea addresses_D_ht+0x1d0de, %rsi
lea addresses_normal_ht+0x104f6, %rdi
clflush (%rsi)
add %r14, %r14
mov $34, %rcx
rep movsl
nop
nop
nop
nop
and $14431, %rcx
lea addresses_A_ht+0x1149e, %rsi
lea addresses_A_ht+0x15a1e, %rdi
nop
add %r15, %r15
mov $52, %rcx
rep movsw
nop
nop
nop
cmp %rdi, %rdi
lea addresses_A_ht+0xfd9e, %rsi
lea addresses_UC_ht+0x591e, %rdi
nop
nop
nop
nop
and %r14, %r14
mov $6, %rcx
rep movsw
nop
and %rcx, %rcx
lea addresses_UC_ht+0x1041e, %r11
nop
and $24255, %r15
movb (%r11), %cl
xor %r15, %r15
lea addresses_normal_ht+0x559e, %rsi
lea addresses_WC_ht+0x1d11e, %rdi
nop
nop
sub $52010, %rax
mov $18, %rcx
rep movsb
nop
nop
nop
add $13740, %r11
lea addresses_WC_ht+0xe59e, %rsi
lea addresses_UC_ht+0xbd3b, %rdi
clflush (%rsi)
clflush (%rdi)
xor %rbx, %rbx
mov $85, %rcx
rep movsq
nop
nop
nop
sub %rbx, %rbx
lea addresses_WT_ht+0x1031e, %r14
clflush (%r14)
nop
nop
nop
nop
nop
xor %r15, %r15
mov (%r14), %r11
nop
nop
nop
cmp $25202, %rcx
lea addresses_D_ht+0x659e, %rsi
nop
nop
nop
nop
nop
and $5113, %r15
mov (%rsi), %rcx
nop
nop
sub %r14, %r14
lea addresses_UC_ht+0xf77e, %r15
nop
nop
inc %r11
movb (%r15), %al
nop
dec %r11
lea addresses_WC_ht+0xbf9e, %rsi
lea addresses_D_ht+0xd19e, %rdi
nop
nop
nop
nop
nop
xor %r15, %r15
mov $12, %rcx
rep movsl
nop
inc %rsi
lea addresses_WC_ht+0x6d9e, %rdi
nop
nop
nop
nop
nop
and $38226, %rcx
movups (%rdi), %xmm4
vpextrq $1, %xmm4, %rbx
dec %rdi
lea addresses_WT_ht+0x1889e, %r11
nop
sub $18797, %rbx
movups (%r11), %xmm3
vpextrq $0, %xmm3, %r15
sub $6628, %rbx
lea addresses_A_ht+0x1dd9e, %rax
clflush (%rax)
nop
nop
nop
nop
and %rdi, %rdi
movl $0x61626364, (%rax)
nop
nop
nop
nop
nop
sub %r15, %r15
pop %rsi
pop %rdi
pop %rcx
pop %rbx
pop %rax
pop %r15
pop %r14
pop %r11
ret
.global s_faulty_load
s_faulty_load:
push %r11
push %r13
push %r8
push %rcx
push %rdi
push %rdx
push %rsi
// Store
lea addresses_PSE+0x156ee, %r11
nop
nop
nop
and $57768, %r13
movl $0x51525354, (%r11)
nop
nop
nop
nop
nop
and %rdx, %rdx
// Load
lea addresses_RW+0x1e59e, %r11
nop
nop
nop
nop
cmp %rsi, %rsi
movups (%r11), %xmm5
vpextrq $1, %xmm5, %rdi
nop
nop
nop
nop
xor $31295, %rdx
// Store
lea addresses_UC+0x1a99e, %rsi
dec %rcx
mov $0x5152535455565758, %r11
movq %r11, %xmm1
movups %xmm1, (%rsi)
add %r11, %r11
// Faulty Load
lea addresses_RW+0x1e59e, %rdx
cmp %r13, %r13
movups (%rdx), %xmm0
vpextrq $0, %xmm0, %rsi
lea oracles, %rdx
and $0xff, %rsi
shlq $12, %rsi
mov (%rdx,%rsi,1), %rsi
pop %rsi
pop %rdx
pop %rdi
pop %rcx
pop %r8
pop %r13
pop %r11
ret
/*
<gen_faulty_load>
[REF]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_RW', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_PSE', 'NT': False, 'AVXalign': False, 'size': 4, 'congruent': 4}}
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_RW', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_UC', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 7}}
[Faulty Load]
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_RW', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 0}}
<gen_prepare_buffer>
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_normal_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 10}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 5, 'type': 'addresses_D_ht'}, 'dst': {'same': False, 'congruent': 3, 'type': 'addresses_normal_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 4, 'type': 'addresses_A_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_A_ht'}, 'dst': {'same': False, 'congruent': 1, 'type': 'addresses_UC_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': False, 'AVXalign': False, 'size': 1, 'congruent': 7}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 11, 'type': 'addresses_normal_ht'}, 'dst': {'same': False, 'congruent': 5, 'type': 'addresses_WC_ht'}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 10, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 0, 'type': 'addresses_UC_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'same': True, 'type': 'addresses_D_ht', 'NT': False, 'AVXalign': False, 'size': 8, 'congruent': 11}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_UC_ht', 'NT': True, 'AVXalign': False, 'size': 1, 'congruent': 4}}
{'OP': 'REPM', 'src': {'same': False, 'congruent': 7, 'type': 'addresses_WC_ht'}, 'dst': {'same': False, 'congruent': 9, 'type': 'addresses_D_ht'}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WC_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 7}}
{'OP': 'LOAD', 'src': {'same': False, 'type': 'addresses_WT_ht', 'NT': False, 'AVXalign': False, 'size': 16, 'congruent': 8}}
{'OP': 'STOR', 'dst': {'same': False, 'type': 'addresses_A_ht', 'NT': True, 'AVXalign': False, 'size': 4, 'congruent': 11}}
{'32': 21829}
32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32
*/
| 32.695313 | 2,999 | 0.655556 |
b7249ba881fb650412f2237a305df5df7af6d5c2 | 7,139 | cs | C# | FlowSimulation.Core/Service/QueueService.cs | nomoreserious/FlowSimulation | 38eab0e00a457b588181d46c86e394f59d822c3e | [
"MIT"
] | null | null | null | FlowSimulation.Core/Service/QueueService.cs | nomoreserious/FlowSimulation | 38eab0e00a457b588181d46c86e394f59d822c3e | [
"MIT"
] | null | null | null | FlowSimulation.Core/Service/QueueService.cs | nomoreserious/FlowSimulation | 38eab0e00a457b588181d46c86e394f59d822c3e | [
"MIT"
] | null | null | null | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using FlowSimulation.Agents;
using FlowSimulation.Map.Model;
namespace FlowSimulation.Service
{
public class QueueService : ServiceBase
{
[XmlIgnore]
private List<List<int>> AgentsQueuesList;
[XmlIgnore]
private Dictionary<int, System.Windows.Point> AgentsLocationsDictionary;
[XmlIgnore]
private List<int> Times;
[XmlArray]
[XmlArrayItem(typeof(WayPoint))]
public List<WayPoint> InputPoints { get; set; }
/// <summary>
/// Not parametred constructor
/// </summary>
public QueueService()
{
InputPoints = new List<WayPoint>();
}
public QueueService(List<WayPoint> servicePoint)
{
InputPoints = servicePoint;
}
public double AverangeQueueLenght { get { return (from queue in AgentsQueuesList select queue.Count).Average(); } }
internal override void Initialize()
{
AgentsLocationsDictionary = new Dictionary<int, System.Windows.Point>();
AgentsQueuesList = new List<List<int>>(InputPoints.Count);
for (int i = 0; i < InputPoints.Count; i++)
{
AgentsQueuesList.Add(new List<int>());
}
Times = new List<int>(InputPoints.Count);
for (int i = 0; i < InputPoints.Count; i++)
{
Times.Add(0);
}
}
public override void DoStep()
{
}
public override WayPoint GetAgentDirection(int agentID, System.Windows.Point position)
{
WayPoint wp = new WayPoint();
Random rand = new Random(agentID);
int index = AgentsQueuesList.FindIndex(delegate(List<int> queue) { return queue.Contains(agentID); });
if (index == -1)
{
index = 0;
int count = AgentsQueuesList[index].Count;
for (int i = 1; i < AgentsQueuesList.Count; i++)
{
if (AgentsQueuesList[i].Count < count)
{
index = i;
count = AgentsQueuesList[i].Count;
}
}
if (AgentsQueuesList[index].Count == 0)
{
wp.LocationPoint = InputPoints[index].LocationPoint;
}
else
{
System.Windows.Point last_in_queue = AgentsLocationsDictionary[AgentsQueuesList[index][AgentsQueuesList[index].Count-1]];
System.Windows.Vector vect = last_in_queue - position;
if (Math.Abs(vect.X) + Math.Abs(vect.Y) == 1)
{
wp.LocationPoint = position;
}
else if (Math.Abs(vect.X) + Math.Abs(vect.Y) == 2)
{
if (vect.X == 0 || vect.Y == 0)
{
if (rand.Next(0, 100) < 50)
{
wp.LocationPoint = position;
}
else
{
wp.LocationPoint = last_in_queue;
}
}
else
{
wp.LocationPoint = position;
}
}
else
{
wp.LocationPoint = last_in_queue;
}
}
AgentsQueuesList[index].Add(agentID);
AgentsLocationsDictionary.Add(agentID, position);
}
else
{
AgentsLocationsDictionary[agentID] = position;
int id = AgentsQueuesList[index].FindIndex(delegate(int item) { return item == agentID; });
if (id == 0)
{
wp.LocationPoint = InputPoints[index].LocationPoint;
}
else
{
System.Windows.Point previos = AgentsLocationsDictionary[AgentsQueuesList[index][id - 1]];
System.Windows.Vector vect = previos - position;
if (Math.Abs(vect.X) + Math.Abs(vect.Y) == 1)
{
wp.LocationPoint = position;
}
else if (Math.Abs(vect.X) + Math.Abs(vect.Y) == 2)
{
if (vect.X == 0 || vect.Y == 0)
{
if (rand.Next(0, 100) < 50)
{
wp.LocationPoint = position;
}
else
{
wp.LocationPoint = previos;
}
}
else
{
wp.LocationPoint = position;
}
}
else
{
wp.LocationPoint = previos;
}
}
}
wp.PointHeight = 1;
wp.PointWidth = 1;
wp.IsServicePoint = true;
wp.ServiceID = ID;
wp.IsWaitPoint = true;
wp.MinWait = rand.Next(MinServedTime, MaxServedTime);
return wp;
}
public override ServiceBase.ServedState GetServedState(int agentID)
{
if (!agentsList.Contains(agentID))
{
return ServedState.NotInService;
}
else
{
int index = AgentsQueuesList.FindIndex(delegate(List<int> queue) { return queue.Count != 0 && queue.Contains(agentID); });
if (index == -1)
{
return ServedState.MoveToQueue;
}
if(AgentsLocationsDictionary[AgentsQueuesList[index][0]] != InputPoints[index].LocationPoint)
{
return ServedState.InQueue;
}
agentsList.Remove(agentID);
AgentsQueuesList[index].Remove(agentID);
AgentsLocationsDictionary.Remove(agentID);
return ServedState.Served;
}
}
public override void AddAgentToService(int agentID)
{
agentsList.Add(agentID);
}
public override bool AddAgentToQueue(int agentID, System.Windows.Point location)
{
int index = new Random(agentID).Next(0, InputPoints.Count);
AgentsQueuesList[index].Add(agentID);
AgentsLocationsDictionary.Add(agentID, location);
return true;
}
}
}
| 35.167488 | 141 | 0.441799 |
2e6df0b11361e48c997b9b6abe4a2f3a533ea312 | 832 | rs | Rust | src/tile.rs | iMplode-nZ/bevy_tilemap | 34cf37e6fe0e21fbdf660c1f478757053460f18d | [
"MIT"
] | null | null | null | src/tile.rs | iMplode-nZ/bevy_tilemap | 34cf37e6fe0e21fbdf660c1f478757053460f18d | [
"MIT"
] | null | null | null | src/tile.rs | iMplode-nZ/bevy_tilemap | 34cf37e6fe0e21fbdf660c1f478757053460f18d | [
"MIT"
] | null | null | null | //! Tile traits to implement for a custom tile.
use crate::lib::*;
/// A tile with an index value and color.
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[derive(Copy, Clone, PartialEq, Debug)]
pub struct Tile<P: Into<Point3>> {
/// A point where the tile will exist.
pub point: P,
/// The Z order layer of the tile. Higher will place the tile above others.
pub sprite_order: usize,
/// The sprites index in the texture atlas.
pub sprite_index: usize,
/// The desired tint and alpha of the tile. White means no change.
pub tint: Color,
}
impl<P: Into<Point3> + Default> Default for Tile<P> {
fn default() -> Tile<P> {
Tile {
point: P::default(),
sprite_order: 0,
sprite_index: 0,
tint: Color::WHITE,
}
}
}
| 28.689655 | 79 | 0.609375 |
dbd3b52cb7eb21da672b95564c4f4cd27f910a17 | 526 | php | PHP | app/Users.php | RezaNum1/ticketbox | bc35a0b1f811e69c151457e0a6c987462d8068f6 | [
"Unlicense"
] | 1 | 2019-07-12T09:55:26.000Z | 2019-07-12T09:55:26.000Z | app/Users.php | RezaNum1/ticketbox | bc35a0b1f811e69c151457e0a6c987462d8068f6 | [
"Unlicense"
] | 3 | 2019-07-19T14:09:51.000Z | 2019-07-19T14:13:38.000Z | app/Users.php | RezaNum1/ticketbox | bc35a0b1f811e69c151457e0a6c987462d8068f6 | [
"Unlicense"
] | null | null | null | <?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Users extends Model
{
protected $table = 'users';
protected $fillable = ['name', 'username', 'password', 'email', 'phone'];
public function eventowners(){
return $this->hasMany('App\EventOwners', 'owner_id');
}
public function bookingUser(){
return $this->hasMany('App\BookingTicket', 'customer_id');
}
public function bookingOwner(){
return $this->hasMany('App\BookingTicket', 'owner_id');
}
}
| 20.230769 | 77 | 0.640684 |
458f94508acf24214bf9619115466da8bae13132 | 2,059 | py | Python | Products/BeakerZopeSessionManager/SessionObject.py | gabrielgisoldo/Products.BeakerZopeSessionManager | 8a764933af61bf734b8ee8ca941acb793169f66f | [
"MIT"
] | null | null | null | Products/BeakerZopeSessionManager/SessionObject.py | gabrielgisoldo/Products.BeakerZopeSessionManager | 8a764933af61bf734b8ee8ca941acb793169f66f | [
"MIT"
] | null | null | null | Products/BeakerZopeSessionManager/SessionObject.py | gabrielgisoldo/Products.BeakerZopeSessionManager | 8a764933af61bf734b8ee8ca941acb793169f66f | [
"MIT"
] | 3 | 2021-03-17T19:38:40.000Z | 2021-04-08T17:57:12.000Z | from collections import UserDict
import time
from AccessControl.class_init import InitializeClass
from AccessControl.SecurityInfo import ClassSecurityInfo
# from Acquisition import Implicit
from zope.interface import implementer
from .Interfaces import ISessionDataObject
def session_mutator(func):
"""Decorator to make a UserDict mutator save the session."""
def mutating_func(self, *args, **kw):
"""."""
res = func(self, *args, **kw)
self.data.save()
return res
return mutating_func
@implementer(ISessionDataObject)
class SessionObject(UserDict):
"""Docstring for SessionObject."""
security = ClassSecurityInfo()
security.setDefaultAccess('allow')
security.declareObjectPublic()
def __init__(self, session):
"""."""
self.data = self.session = session
self._valid = True
clear = session_mutator(UserDict.clear)
update = session_mutator(UserDict.update)
setdefault = session_mutator(UserDict.setdefault)
pop = session_mutator(UserDict.pop)
popitem = session_mutator(UserDict.popitem)
__setitem__ = session_mutator(UserDict.__setitem__)
__delitem__ = session_mutator(UserDict.__delitem__)
set = __setitem__
__guarded_setitem__ = __setitem__
__guarded_delitem__ = __delitem__
delete = __delitem__
def __len__(self):
"""."""
try:
return self.data.__len__()
except:
return len(self.data.keys())
def getId(self):
"""."""
return self.session.id
def invalidate(self):
"""."""
self.session.invalidate()
def isValid(self):
"""."""
return self._valid
def getCreated(self):
"""."""
return time.mktime(self.session['_creation_time'].timetuple())
getContainerKey = getId
def _get_p_changed(self):
return 1
def _set_p_changed(self, v):
if v:
self.session.save()
_p_changed = property(_get_p_changed, _set_p_changed)
InitializeClass(SessionObject)
| 25.419753 | 70 | 0.662458 |
444c276fed8a2f52c4bfc671803cb99f075b3a78 | 171 | py | Python | butter_cms/feed.py | ButterCMS/buttercms-python | 46892eff36f20829b130684a85994e7178eb4ef2 | [
"MIT"
] | 33 | 2017-03-28T03:11:23.000Z | 2020-12-21T16:13:59.000Z | butter_cms/feed.py | skroys/buttercms-python | 6797e2a5f1ded6112e7d2b2f60561798ca4e2731 | [
"MIT"
] | 4 | 2017-09-16T05:08:20.000Z | 2022-03-11T15:19:53.000Z | butter_cms/feed.py | skroys/buttercms-python | 6797e2a5f1ded6112e7d2b2f60561798ca4e2731 | [
"MIT"
] | 9 | 2017-11-03T12:51:48.000Z | 2021-11-09T08:40:13.000Z | from .client import Client
class Feed(Client):
"""Feed"""
def __init__(self, auth_token):
Client.__init__(self, auth_token)
self.path = 'feeds/'
| 19 | 41 | 0.625731 |
a12dbcd63c356d4c937e43e70cb7851c33c28492 | 3,726 | tsx | TypeScript | src/components/Buttons/ModernButton.component.tsx | CasuallyCaffeinated/community-ui | 7f1c3fee03742e9d4ee84c62790922b686a65eaf | [
"MIT"
] | null | null | null | src/components/Buttons/ModernButton.component.tsx | CasuallyCaffeinated/community-ui | 7f1c3fee03742e9d4ee84c62790922b686a65eaf | [
"MIT"
] | null | null | null | src/components/Buttons/ModernButton.component.tsx | CasuallyCaffeinated/community-ui | 7f1c3fee03742e9d4ee84c62790922b686a65eaf | [
"MIT"
] | null | null | null | import React, { FC } from 'react';
import styled from 'styled-components';
import { ButtonVariant, TextButtonProps } from './Button.types';
import { ButtonPadding, DefaultButtonThemes } from './Button.constants';
import { FontSize } from '../../config';
import { Colors } from '../../config';
const StyledButton = styled.button<TextButtonProps>`
position: relative;
padding: ${(props) => props.buttonPadding || ButtonPadding.default};
width: fit-content;
font-size: ${(props) => props.fontSize || FontSize.default};
color: ${(props) => getTextColorForVariant(props)};
background-color: ${(props) => getBackgroundColorForVariant(props)};
border: solid 0.125em ${(props) => resolveBorderColor(props)};
transition: all 0.4s;
cursor: ${(props) => (props.disabled ? 'not-allowed' : 'pointer')};
box-sizing: content-box;
&:focus,
&:active {
outline: ${(props) => resolveBorderColor(props)};
}
&::after {
content: '';
position: absolute;
top: 0;
left: 50%;
transform: translateX(-50%);
height: 100%;
width: 0;
opacity: 1;
z-index: -1;
transition: all 0.15s ease;
}
&:hover::after {
content: '';
position: absolute;
top: -2%;
left: 50%;
transform: translateX(-50%);
background-color: ${(props) => resolveBackgroundColor(props)};
border: none;
height: 104%;
width: 101%;
opacity: 1;
z-index: -1;
}
&:hover {
border: solid 0.125em ${(props) => resolveBorderColor(props)};
color: ${(props) => resolveTextColor(props)};
}
`;
const getBackgroundColorForVariant = (props: TextButtonProps) => {
switch (props.buttonVariant) {
case ButtonVariant.OUTLINE:
return Colors.TRANSPARENT;
case ButtonVariant.SOLID:
return resolveBackgroundColor(props);
}
};
const resolveBackgroundColor = ({ buttonTheme, disabled }: TextButtonProps) => {
let color =
buttonTheme?.backgroundColor ||
DefaultButtonThemes.PRIMARY.backgroundColor;
return disabled
? buttonTheme?.disabledBackgroundColor ||
DefaultButtonThemes.PRIMARY.disabledBackgroundColor
: color;
};
const resolveBorderColor = ({ buttonTheme, disabled }: TextButtonProps) => {
let color =
buttonTheme?.borderColor || DefaultButtonThemes.PRIMARY.borderColor;
return disabled
? buttonTheme?.disabledBorderColor ||
DefaultButtonThemes.PRIMARY.disabledBorderColor
: color;
};
const getTextColorForVariant = (props: TextButtonProps) => {
switch (props.buttonVariant) {
case ButtonVariant.OUTLINE:
return resolveBorderColor(props);
case ButtonVariant.SOLID:
return resolveTextColor(props);
}
};
const resolveTextColor = ({ disabled, buttonTheme }: TextButtonProps) => {
let color =
buttonTheme?.contentColor || DefaultButtonThemes.PRIMARY.contentColor;
return disabled
? buttonTheme?.disabledContentColor ||
DefaultButtonThemes.PRIMARY.disabledContentColor
: color;
};
const Button: FC<TextButtonProps> = ({
buttonTheme,
buttonPadding,
buttonVariant,
children,
fontSize,
onClick,
...props
}) => {
return (
<StyledButton
type="button"
buttonVariant={buttonVariant}
buttonTheme={buttonTheme}
buttonPadding={buttonPadding}
fontSize={fontSize}
onClick={onClick}
{...props}
>
{children}
</StyledButton>
);
};
export default Button;
| 28.883721 | 80 | 0.609232 |
e236dc101e5a7105782c44c9082cbbb37cc362b0 | 2,722 | py | Python | test/benchmark/parse.py | smehringer/raptor | ac00dbd654e4f2b1eb720eb1ae4587b8d84b8d63 | [
"BSD-3-Clause"
] | 33 | 2020-10-09T07:25:23.000Z | 2022-03-16T13:11:39.000Z | test/benchmark/parse.py | smehringer/raptor | ac00dbd654e4f2b1eb720eb1ae4587b8d84b8d63 | [
"BSD-3-Clause"
] | 122 | 2020-12-04T14:17:43.000Z | 2022-03-10T08:54:06.000Z | test/benchmark/parse.py | smehringer/raptor | ac00dbd654e4f2b1eb720eb1ae4587b8d84b8d63 | [
"BSD-3-Clause"
] | 9 | 2020-10-07T14:17:05.000Z | 2021-09-30T13:06:47.000Z | #!/usr/bin/env python3
# -----------------------------------------------------------------------------------------------------
# Copyright (c) 2006-2021, Knut Reinert & Freie Universität Berlin
# Copyright (c) 2016-2021, Knut Reinert & MPI für molekulare Genetik
# This file may be used, modified and/or redistributed under the terms of the 3-clause BSD-License
# shipped with this file and also available at: https://github.com/seqan/raptor/blob/master/LICENSE.md
# -----------------------------------------------------------------------------------------------------
#
# Usage parse.py <input_file>
#
# Extracts relative slowdown from benchmark results.
# E.g. ./test/benchmark/bin_influence_benchmark --benchmark_repetitions=5 --benchmark_report_aggregates_only=true
# --benchmark_out=results_minimiser.json --benchmark_out_format=json
import argparse
import json
import pandas
def create_data_frame(json_string, aggregate_name):
assert aggregate_name == 'mean' or aggregate_name == 'median'
with pandas.option_context('mode.chained_assignment', None):
data = pandas.read_json(json_string, convert_dates=False)
data = data[data.aggregate_name == aggregate_name]
data = data.loc[:, ['run_name','cpu_time']]
data.reset_index(drop=True, inplace=True)
min_time = data['cpu_time'][0]
data['Factor'] = data.apply(lambda row: round(row['cpu_time'] / min_time, 2), axis='columns')
data['run_name'] = data['run_name'].apply(lambda x: x.split('/')[1])
data.rename(columns={'run_name' : 'Bins', 'cpu_time' : 'Time [ns]'}, inplace=True)
return data
def process_json(path, aggregate_name):
assert aggregate_name == 'mean' or aggregate_name == 'median'
with open(path, 'r') as json_file:
benchmark_json_string = json.dumps(json.load(json_file)['benchmarks'])
return create_data_frame(benchmark_json_string, aggregate_name)
parser = argparse.ArgumentParser(description='Extracts relative slowdown from benchmark results. E.g., from the file '
'generated by calling `./test/benchmark/bin_influence_benchmark --benchm'
'ark_repetitions=5 --benchmark_report_aggregates_only=true --benchmark_o'
'ut=results_minimiser.json --benchmark_out_format=json`',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('input', type=str, help='JSON File from bin_influence_benchmark.')
arguments = parser.parse_args()
print(process_json(arguments.input, 'mean'))
print(process_json(arguments.input, 'median'))
| 57.914894 | 118 | 0.631154 |
e2b5b44759a8d9d391cf0bc89760558fb19f53f2 | 966 | py | Python | duplex.py | honkling/duplex | 807f12f7cd1ea0ab60b78667cbb9aa5c0b805f5a | [
"MIT"
] | null | null | null | duplex.py | honkling/duplex | 807f12f7cd1ea0ab60b78667cbb9aa5c0b805f5a | [
"MIT"
] | null | null | null | duplex.py | honkling/duplex | 807f12f7cd1ea0ab60b78667cbb9aa5c0b805f5a | [
"MIT"
] | null | null | null | from re import sub
from sys import stdout
from readline import get_line_buffer
from time import sleep
class Duplex:
def __init__(self, prefix: str = '> '):
self.ERASE = '\x1b[2K'
if type(prefix) != str:
received_type = sub('(<class\ \'|\'>)', '', str(type(text)))
raise TypeError(f'Expected type \'str\', received type \'{received_type}\'')
self.prefix = f'\n{prefix}'
def print(self, text: str = ''):
if text == '':
raise Exception('Text must not be empty.')
elif type(text) != str:
received_type = sub('(<class\ \'|\'>)', '', str(type(text)))
raise TypeError(f'Expected type \'str\', received type \'{received_type}\'')
inp = get_line_buffer()
stdout.write(self.ERASE)
print(f'\r{text}{self.prefix}{inp}', end='')
def listen(self, listener):
if not callable(listener):
raise Exception(f'Listener must be callable.')
print(self.prefix, end='')
inp = ''
while inp == '':
inp = input()
listener(inp)
inp = '' | 30.1875 | 79 | 0.630435 |
66480f6b2aeee659048bacb1e574758c36517476 | 3,746 | sql | SQL | dbFunctions/res_calculate.sql | uucly/FleetTelematicManagementSystem | 30e44731ad35ea46a7dbef8260416f79fee94896 | [
"Apache-2.0"
] | null | null | null | dbFunctions/res_calculate.sql | uucly/FleetTelematicManagementSystem | 30e44731ad35ea46a7dbef8260416f79fee94896 | [
"Apache-2.0"
] | null | null | null | dbFunctions/res_calculate.sql | uucly/FleetTelematicManagementSystem | 30e44731ad35ea46a7dbef8260416f79fee94896 | [
"Apache-2.0"
] | null | null | null | -- Function: public.res_calculate(integer, point, point)
-- DROP FUNCTION public.res_calculate(integer, point, point);
CREATE OR REPLACE FUNCTION public.res_calculate(
auftragid integer,
sourceneworder point,
targetneworder point)
RETURNS integer AS
$BODY$
DECLARE
vehicleID int[];
choosenVehicleID int;
currentVehiclePosition Point;
currentOrderSource Point;
currentOrderTarget Point;
currentOrderCosts double precision;
currentStatus int;
sourceCosts double precision;
currentTargetCosts double precision;
waitCosts double precision;
total_costs double precision;
minCosts double precision;
minCostsVehicleID int;
minSourceCosts double precision;
minWaitCosts double precision;
minOrderStatus int;
orderStatus int;
order_costs double precision;
i int;
currentDeviceOrder int;
choosenVehiclePosition Point;
lastOrderTarget Point;
rec record;
BEGIN
update vehicleorder set targetCosts = 0 where id = auftragid;
update vehicleorder set sourceCosts = 0 where id = auftragid;
update vehicleorder set ordercosts = 0 where id = auftragid;
update vehicleorder set totalcosts = 0 where id = auftragid;
update vehicleorder set waitcosts = 0 where id = auftragid;
minCosts = 99999999;
vehicleID = array(SELECT id FROM vehicledevice);
FOR i IN SELECT generate_subscripts(vehicleID, 1) LOOP
SELECT currentposition::point FROM vehicledevice INTO currentVehiclePosition WHERE id = vehicleID[i];
select order_id from vehicledevice into currentDeviceOrder where id = vehicleID[i];
IF currentDeviceOrder IS NULL THEN --vehicle ist frei und kann direkt zu source fahren
sourceCosts = costsFromAtoB(currentVehiclePosition,sourceneworder);
waitcosts = sourceCosts;
orderStatus = 1;
ELSE --vehicle ist nicht frei sonder hat bereits auftrag
select * from handleBusyVehiclenew(vehicleID[i],auftragID, sourceneworder ,targetneworder) into waitCosts, sourceCosts;
orderStatus = 3;
waitCosts = (waitCosts + sourceCosts);
END IF;
--costs = waitcosts + sourceCosts;
IF waitCosts < minCosts THEN
minCosts = waitCosts;
minSourceCosts = sourceCosts;
minwaitcosts = waitcosts;
minCostsVehicleID = vehicleID[i];
minOrderStatus = orderStatus;
END IF;
END LOOP;
currentTargetCosts = costsFromAtoB(sourceneworder,targetneworder);
IF (minOrderStatus = 1) THEN
select currentposition::point from vehicleDevice where id = minCostsVehicleID into choosenVehiclePosition;
perform(createRouteTable('sourceRoute', minCostsVehicleID, auftragid, choosenVehiclePosition, sourceneworder));
update vehicledevice set order_id = auftragid where id = minCostsVehicleID;
ELSEIF minOrderStatus = 3 THEN
select target::point from vehicleorder where id = getLastOrderID(minCostsVehicleID, auftragid) into lastOrderTarget;
perform(createRouteTable('sourceRoute', minCostsVehicleID, auftragid, lastOrderTarget, sourceneworder));
END IF;
perform(createRouteTable('targetRoute',minCostsVehicleID, auftragid, sourceneworder, targetneworder));
update vehicleorder set status = minOrderStatus where id = auftragid;
update vehicleorder set targetCosts = currentTargetCosts where id = auftragid;
update vehicleorder set sourceCosts = minSourceCosts where id = auftragid;
update vehicleorder set ordercosts = currentTargetCosts + minSourceCosts where id = auftragid;
update vehicleorder set totalcosts = minWaitCosts + currentTargetCosts where id = auftragid;
update vehicleorder set waitcosts = minWaitCosts where id = auftragid;
update vehicleorder set device_id = minCostsVehicleID where id = auftragid;
RETURN minCostsVehicleID;
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100;
ALTER FUNCTION public.res_calculate(integer, point, point)
OWNER TO postgres;
| 31.745763 | 123 | 0.792846 |
c4b3834a3ced9015f6db46be6e6f5fc176787725 | 1,234 | cc | C++ | src/platform/udp_server_test.cc | AnthonyBrunasso/test_games | 31354d2bf95aae9a880e7292bc78ad8577b3f09c | [
"MIT"
] | null | null | null | src/platform/udp_server_test.cc | AnthonyBrunasso/test_games | 31354d2bf95aae9a880e7292bc78ad8577b3f09c | [
"MIT"
] | null | null | null | src/platform/udp_server_test.cc | AnthonyBrunasso/test_games | 31354d2bf95aae9a880e7292bc78ad8577b3f09c | [
"MIT"
] | 2 | 2019-11-12T23:15:18.000Z | 2020-01-15T17:49:27.000Z | #include "platform.cc"
#include <cstdio>
volatile bool running = true;
s32
main(s32 argc, char** argv)
{
const char* ip = "127.0.0.1";
const char* port = "9845";
while (1) {
s32 opt = platform_getopt(argc, argv, "i:p:");
if (opt == -1) break;
switch (opt) {
case 'i':
ip = platform_optarg;
break;
case 'p':
port = platform_optarg;
break;
};
}
#define MAX_BUFFER 4 * 1024
u8 buffer[MAX_BUFFER];
udp::Init();
Udp4 location;
if (!udp::GetAddr4(ip, port, &location)) {
puts("fail GetAddr4");
exit(1);
}
printf("Server binding %s:%s\n", ip, port);
if (!udp::Bind(location)) {
puts("fail Bind");
exit(1);
}
while (running) {
u16 received_bytes;
Udp4 peer;
if (!udp::ReceiveAny(location, MAX_BUFFER, buffer, &received_bytes,
&peer)) {
if (udp_errno) running = false;
if (udp_errno) printf("udp_errno %d\n", udp_errno);
continue;
}
// Echo bytes to peer
printf("socket %d echo %d bytes\n", location.socket, received_bytes);
if (!udp::SendTo(location, peer, buffer, received_bytes)) {
puts("send failed");
} else {
puts("send ok");
}
}
}
| 19.903226 | 73 | 0.559157 |
1ab6bf5a87b0a5b5f9d8b75194f516683735c80a | 485 | py | Python | app/settings.py | npmmirror/daochain | 303bfb627e68d6cd89b4e4023db85ced32f620cc | [
"Apache-2.0"
] | 92 | 2016-12-17T09:08:24.000Z | 2021-11-12T00:13:04.000Z | app/settings.py | npmmirror/daochain | 303bfb627e68d6cd89b4e4023db85ced32f620cc | [
"Apache-2.0"
] | 10 | 2016-12-13T11:31:07.000Z | 2018-09-25T01:46:00.000Z | app/settings.py | npmmirror/daochain | 303bfb627e68d6cd89b4e4023db85ced32f620cc | [
"Apache-2.0"
] | 27 | 2016-12-20T05:31:57.000Z | 2022-02-12T03:42:49.000Z | import os
ERROR_404_HELP = False
SECRET_KEY = os.getenv('SECRET_KEY') or 'monitor'
HUB_ENDPOINT = os.getenv('HUB_ENDPOINT') or 'http://api.daocloud.io'
ETH_RPC_ENDPOINT = os.getenv('ETH_RPC_ENDPOINT') or 'localhost:8545'
DATA_DIR = os.path.expanduser('~/.daocloud')
RECENT_HASH_TIME_BUCKET_SIZE = 50
if not os.path.exists(DATA_DIR):
os.mkdir(DATA_DIR)
SOURCE_ROOT = os.path.abspath(os.path.dirname(__file__))
def in_data_dir(*path):
return os.path.join(DATA_DIR, *path)
| 24.25 | 68 | 0.748454 |
dd7aa287d1c1d1aa761ccf0bfdd495c0f968af50 | 1,166 | java | Java | src/main/java/ru/teamrocket/csrsysteamdesktop/Model/ProductProperty.java | team-rocket-trio/csr-system | 3f6aa2778e938984e2c4943a6a7d6ed3df6d4896 | [
"Apache-2.0"
] | null | null | null | src/main/java/ru/teamrocket/csrsysteamdesktop/Model/ProductProperty.java | team-rocket-trio/csr-system | 3f6aa2778e938984e2c4943a6a7d6ed3df6d4896 | [
"Apache-2.0"
] | 1 | 2016-11-08T06:49:15.000Z | 2016-11-08T10:45:03.000Z | src/main/java/ru/teamrocket/csrsysteamdesktop/Model/ProductProperty.java | team-rocket-trio/csr-system-desktop | 3f6aa2778e938984e2c4943a6a7d6ed3df6d4896 | [
"Apache-2.0"
] | null | null | null | package ru.teamrocket.csrsysteamdesktop.Model;
import javafx.beans.property.IntegerProperty;
/**
* Created by Kate on 06.11.2016.
*/
public class ProductProperty {
private final IntegerProperty characteristicsId;
private final IntegerProperty characteristicsValueId;
public ProductProperty(IntegerProperty characteristicsId, IntegerProperty characteristicsValueId) {
this.characteristicsId = characteristicsId;
this.characteristicsValueId = characteristicsValueId;
}
public int getCharacteristicsId() {
return characteristicsId.get();
}
public IntegerProperty characteristicsIdProperty() {
return characteristicsId;
}
public void setCharacteristicsId(int characteristicsId) {
this.characteristicsId.set(characteristicsId);
}
public int getCharacteristicsValueId() {
return characteristicsValueId.get();
}
public IntegerProperty characteristicsValueIdProperty() {
return characteristicsValueId;
}
public void setCharacteristicsValueId(int characteristicsValueId) {
this.characteristicsValueId.set(characteristicsValueId);
}
}
| 27.116279 | 103 | 0.745283 |
f4b94d42574e7156c87e3bfcd588f4f76d2c2592 | 530 | ts | TypeScript | src/app/core/services/forgot-password.service.ts | lucas-almeida-silva/gama-sports | c287680a645941bc16fc09a350167922171fa30d | [
"MIT"
] | null | null | null | src/app/core/services/forgot-password.service.ts | lucas-almeida-silva/gama-sports | c287680a645941bc16fc09a350167922171fa30d | [
"MIT"
] | null | null | null | src/app/core/services/forgot-password.service.ts | lucas-almeida-silva/gama-sports | c287680a645941bc16fc09a350167922171fa30d | [
"MIT"
] | 1 | 2020-11-28T13:44:45.000Z | 2020-11-28T13:44:45.000Z | import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import ForgotPassword from 'src/app/shared/models/ForgotPassword';
import { environment } from 'src/environments/environment';
@Injectable({
providedIn: 'root'
})
export class ForgotPasswordService {
private baseUrl = `${environment.apiBaseUrl}/forgot-password`;
constructor(private httpClient: HttpClient) { }
postEmail(forgotPassword: ForgotPassword) {
return this.httpClient.post(this.baseUrl, forgotPassword);
}
}
| 29.444444 | 66 | 0.754717 |
338ee434769c53fb1d6fe26f7e1d4beabf378962 | 481 | rb | Ruby | report.rb | alexreisner/tennis_stats | bb86379e40222a9d9e3ee5a7aa377375a81da571 | [
"MIT"
] | null | null | null | report.rb | alexreisner/tennis_stats | bb86379e40222a9d9e3ee5a7aa377375a81da571 | [
"MIT"
] | null | null | null | report.rb | alexreisner/tennis_stats | bb86379e40222a9d9e3ee5a7aa377375a81da571 | [
"MIT"
] | 1 | 2019-07-13T07:42:52.000Z | 2019-07-13T07:42:52.000Z | ##
# Tennis Stats: Report
# Extremely simple stat tracking for tennis.
#
# Copyright (c) 2009 Alex Reisner. (MIT license)
#
require 'tennis_stats'
#require 'rubygems'; require 'ruby-debug'; debugger
puts ""
# gather command-line argument
filename = ARGV[0]
# make sure data file specified
if filename.nil?
puts "Usage: ruby tennis_stats.rb [datafile]"
puts ""
exit
end
# parse and report
matches = TennisStats::Parser.new(filename).matches
matches.each{ |m| m.report }
| 17.814815 | 51 | 0.721414 |
456998b84bd84d5a945624faab3ed7ce2be13f17 | 891 | py | Python | plot_images.py | awesome-archive/python-utils | 0e130a649faf7297aa67720c69ae7f1cc7d3ffb0 | [
"MIT"
] | null | null | null | plot_images.py | awesome-archive/python-utils | 0e130a649faf7297aa67720c69ae7f1cc7d3ffb0 | [
"MIT"
] | null | null | null | plot_images.py | awesome-archive/python-utils | 0e130a649faf7297aa67720c69ae7f1cc7d3ffb0 | [
"MIT"
] | null | null | null | import numpy as np
def map_range(x, in_min, in_max, out_min, out_max):
return out_min + (out_max - out_min) * (x - in_min) / (in_max - in_min)
def plot_images(images, xy, blend=np.maximum, canvas_shape=(512,512), fill=0):
h,w = images.shape[1:3]
if images.ndim == 4:
canvas_shape = (canvas_shape[0], canvas_shape[1], images.shape[3])
min_xy = np.amin(xy, 0)
max_xy = np.amax(xy, 0)
min_canvas = np.array((0, 0))
max_canvas = np.array((canvas_shape[0] - h, canvas_shape[1] - w))
canvas = np.full(canvas_shape, fill)
for image, pos in zip(images, xy):
x_off, y_off = map_range(pos, min_xy, max_xy, min_canvas, max_canvas).astype(int)
sub_canvas = canvas[y_off:y_off+h, x_off:x_off+w]
sub_image = image[:h, :w]
canvas[y_off:y_off+h, x_off:x_off+w] = blend(sub_canvas, sub_image)
return canvas | 37.125 | 89 | 0.632997 |
a325d9d9cb4ed0b23be8966398b6557465b1a3e4 | 2,628 | c | C | ch16-thread-synchronization/ExtremeC_examples_chapter16_1_cv.c | Grahame-student/Extreme-C | b5fa8c6575147e095d8e72b829f08d04b9d4e2e2 | [
"MIT"
] | 162 | 2019-07-02T21:58:08.000Z | 2022-03-27T20:53:31.000Z | ch16-thread-synchronization/ExtremeC_examples_chapter16_1_cv.c | Grahame-student/Extreme-C | b5fa8c6575147e095d8e72b829f08d04b9d4e2e2 | [
"MIT"
] | 2 | 2020-09-01T22:00:49.000Z | 2021-09-05T13:57:14.000Z | ch16-thread-synchronization/ExtremeC_examples_chapter16_1_cv.c | Grahame-student/Extreme-C | b5fa8c6575147e095d8e72b829f08d04b9d4e2e2 | [
"MIT"
] | 80 | 2019-01-26T09:51:33.000Z | 2022-03-30T13:53:23.000Z | // File name: ExtremeC_examples_chapter16_1_cv.c
// Description: This example demonstrates how to use a condition
// variable to wait for an event to happen.
#include <stdio.h>
#include <stdlib.h>
// The POSIX standard header for using pthread library
#include <pthread.h>
#define TRUE 1
#define FALSE 0
typedef unsigned int bool_t;
// A structure for keeping all the variables related
// to a shared state
typedef struct {
// The flag which indicates whether 'A' has been printed or not
bool_t done;
// The mutex object protecting the critical sections
pthread_mutex_t mtx;
// The condition variable used to synchronize two threads
pthread_cond_t cv;
} shared_state_t;
// Initializes the memebrs of a shared_state_t object
void shared_state_init(shared_state_t *shared_state) {
shared_state->done = FALSE;
pthread_mutex_init(&shared_state->mtx, NULL);
pthread_cond_init(&shared_state->cv, NULL);
}
// Destroy the memebrs of a shared_state_t object
void shared_state_destroy(shared_state_t *shared_state) {
pthread_mutex_destroy(&shared_state->mtx);
pthread_cond_destroy(&shared_state->cv);
}
void* thread_body_1(void* arg) {
shared_state_t* ss = (shared_state_t*)arg;
pthread_mutex_lock(&ss->mtx);
printf("A\n");
ss->done = TRUE;
// Signal the threads waiting on the condition variable
pthread_cond_signal(&ss->cv);
pthread_mutex_unlock(&ss->mtx);
return NULL;
}
void* thread_body_2(void* arg) {
shared_state_t* ss = (shared_state_t*)arg;
pthread_mutex_lock(&ss->mtx);
// Wait until the flag becomes TRUE
while (!ss->done) {
// Wait on the condition variable
pthread_cond_wait(&ss->cv, &ss->mtx);
}
printf("B\n");
pthread_mutex_unlock(&ss->mtx);
return NULL;
}
int main(int argc, char** argv) {
// The shared state
shared_state_t shared_state;
// Initialize the shared state
shared_state_init(&shared_state);
// The thread handlers
pthread_t thread1;
pthread_t thread2;
// Create new threads
int result1 =
pthread_create(&thread1, NULL, thread_body_1, &shared_state);
int result2 =
pthread_create(&thread2, NULL, thread_body_2, &shared_state);
if (result1 || result2) {
printf("The threads could not be created.\n");
exit(1);
}
// Wait for the threads to finish
result1 = pthread_join(thread1, NULL);
result2 = pthread_join(thread2, NULL);
if (result1 || result2) {
printf("The threads could not be joined.\n");
exit(2);
}
// Destory the shared state and release the mutex
// and condition variable objects
shared_state_destroy(&shared_state);
return 0;
}
| 25.764706 | 65 | 0.715373 |
8475affbe0fa565eae39ed6dc2432280d0ee54bc | 483 | cs | C# | src/Exadel.CrazyPrice/Exadel.CrazyPrice.Services/Mail/MailSenderMailKit/IntegrationEvents/CompanyBusParams.cs | ssivazhalezau/exadel_discounts_be | 651b9f346fd24df52ee8573e04d3317538c3644e | [
"BSD-3-Clause"
] | 3 | 2021-01-25T13:22:11.000Z | 2022-03-15T06:31:58.000Z | src/Exadel.CrazyPrice/Exadel.CrazyPrice.Services/Mail/MailSenderMailKit/IntegrationEvents/CompanyBusParams.cs | ssivazhalezau/exadel_discounts_be | 651b9f346fd24df52ee8573e04d3317538c3644e | [
"BSD-3-Clause"
] | 3 | 2021-01-18T10:16:22.000Z | 2021-03-04T20:56:49.000Z | src/Exadel.CrazyPrice/Exadel.CrazyPrice.Services/Mail/MailSenderMailKit/IntegrationEvents/CompanyBusParams.cs | ssivazhalezau/exadel_discounts_be | 651b9f346fd24df52ee8573e04d3317538c3644e | [
"BSD-3-Clause"
] | 2 | 2021-03-14T08:53:17.000Z | 2022-03-15T06:31:35.000Z | using Exadel.CrazyPrice.Services.Bus.EventBus.Events;
using Exadel.CrazyPrice.Services.Common.IntegrationEvents.Events;
using Exadel.CrazyPrice.Services.Common.IntegrationEvents.Models;
namespace Exadel.CrazyPrice.Services.Mail.MailSenderMailKit.IntegrationEvents
{
public record CompanyBusParams : BusParams<PromocodeAddedIntegrationEvent<CompanyMailContent>>
{
public CompanyBusParams() : base("crazyprice.direct", "mail.company")
{ }
}
}
| 37.153846 | 99 | 0.768116 |
e21fd88be14bbbe5b8b79413331c165ec4fad8ce | 5,161 | py | Python | benchmark/compute_gt.py | babylonhealth/multiverse | 32e5301ef7910e80d4eac1f27dd6cbcd6be7c975 | [
"MIT"
] | 12 | 2020-02-03T15:38:56.000Z | 2021-08-14T20:53:46.000Z | benchmark/compute_gt.py | babylonhealth/multiverse | 32e5301ef7910e80d4eac1f27dd6cbcd6be7c975 | [
"MIT"
] | null | null | null | benchmark/compute_gt.py | babylonhealth/multiverse | 32e5301ef7910e80d4eac1f27dd6cbcd6be7c975 | [
"MIT"
] | 5 | 2020-02-04T12:07:31.000Z | 2021-03-03T16:46:42.000Z |
"""
We compute the ground truth values of counterfactual queries
using enumeration.
To compute, we enumerate over all possible combinations
of exogenous variables twice:
1. First time we execute the program with each combination
without interventions to calculate the posterior log-probabilities
(incorporating priors and observation likelihoods).
It is called `first_run`.
2. Second time we execute the program with each combination
with interventions to get the predicted counterfactual values.
It is called `second_run`.
Then, we weight the counterfactual predictions with log-probabilities
from the posterior. By doing so, we receive the counterfactual query
result.
"""
import itertools
import math
import numpy
import json
import os
from tqdm import tqdm
try:
from scipy.misc import logsumexp
except ImportError:
from scipy.special import logsumexp
from experiment_utils import load_experiment, toposort
EXPERIMENT_RANGE = range(1000)
OUTPUT_FOLDER = "output/calculated_gts/"
os.makedirs(OUTPUT_FOLDER, exist_ok=True)
def calc_prob_val(model, var_name, dict_values, configuration_dict):
if model[var_name]['type'] == "exogenous":
val = configuration_dict[var_name]
prob = model[var_name]['prior'] if val else 1.0 - model[var_name]['prior']
return prob, val
elif model[var_name]['type'] == "endogenous":
weights = model[var_name]['parameters']
parents = model[var_name]['parents']
sum_parents = 0
for index, parent in enumerate(parents):
sum_parents += weights[index] * dict_values[parent]
if sum_parents > 0.5: # activation function
val = 1
else:
val = 0
# configuration_dict[var_name] is the value of its "noisy flipper"
# parent (which is exogenous) rather than this endogenous variable
# itself
if configuration_dict[var_name] == 1:
if val == 0:
val = 1
else:
val = 0
# this is not the probability of this variable but of the "noise flipper"
if configuration_dict[var_name]:
prob = model[var_name]['flip_noise']
else:
prob = 1.0 - model[var_name]['flip_noise']
return prob, val
else:
raise ValueError
def program(
mode, model, toposorted_nodes, configuration_dict,
intervention, evidence, var_to_predict,
):
log_prob = 0.0
dict_values = {}
for node in toposorted_nodes:
if mode == "first_run" or node not in intervention:
prob, dict_values[node] = calc_prob_val(
model, node, dict_values, configuration_dict
)
log_prob += math.log(prob)
else:
dict_values[node] = intervention[node]
for var_name, val in evidence.items():
if dict_values[var_name] != val:
# Rejecting this sample completely:
log_prob = float("-inf")
if mode == "first_run":
return log_prob
else:
return dict_values[var_to_predict]
def gen_state_space(toposorted_nodes):
return itertools.product((0, 1), repeat=len(toposorted_nodes))
def extract_state_space_configuration_as_dict(configuration, toposorted_nodes, index):
configuration_dict = {}
for node_index, node in enumerate(toposorted_nodes):
configuration_dict[node] = configuration[node_index]
return configuration_dict
for EXPERIMENT_ID in tqdm(EXPERIMENT_RANGE):
model, intervention, evidence, var_to_predict = load_experiment(EXPERIMENT_ID)
toposorted_nodes = toposort(model)
logprobs = []
for index, configuration in enumerate(gen_state_space(toposorted_nodes)):
# The values of a particular state space configurations.
configuration_dict = extract_state_space_configuration_as_dict(
configuration, toposorted_nodes, index
)
# (Note: for endogenous variables, these are the values of
# its noisy-flipper rather than the endogenous node values themselves.)
log_prob = program(
"first_run", model, toposorted_nodes, configuration_dict,
intervention, evidence, var_to_predict,
)
logprobs += [log_prob]
values = []
for index, configuration in enumerate(gen_state_space(toposorted_nodes)):
if logprobs[index] != float("-inf"):
configuration_dict = extract_state_space_configuration_as_dict(
configuration, toposorted_nodes, index
)
value = program(
"second_run", model, toposorted_nodes, configuration_dict,
intervention, evidence, var_to_predict,
)
values += [value]
else:
values += [0] # the value does not matter as the weight is 0.0
assert any([el for el in logprobs if el > float("-inf")])
values_by_weights = logsumexp(a=logprobs, b=values)
weights = logsumexp(a=logprobs)
expectation = numpy.exp(values_by_weights - weights)
json.dump(expectation, open(OUTPUT_FOLDER + str(EXPERIMENT_ID) + ".json", "w"))
| 29.491429 | 86 | 0.665181 |
0afba1a07898524c1ce1cf2e4f9a9d28fb78d07a | 1,710 | cs | C# | DirectN/DirectN/Generated/DD_VIDEOPORTCALLBACKS.cs | riQQ/DirectN | 9f9ec790c317448b0f5ddfeea423959d8227ee1d | [
"MIT"
] | 1 | 2019-11-30T20:41:08.000Z | 2019-11-30T20:41:08.000Z | DirectN/DirectN/Generated/DD_VIDEOPORTCALLBACKS.cs | bbday/DirectN | 5db37386f44078ffa082c6499a29361a50ea11a5 | [
"MIT"
] | null | null | null | DirectN/DirectN/Generated/DD_VIDEOPORTCALLBACKS.cs | bbday/DirectN | 5db37386f44078ffa082c6499a29361a50ea11a5 | [
"MIT"
] | null | null | null | // c:\program files (x86)\windows kits\10\include\10.0.18362.0\um\ddrawint.h(539,9)
using System;
using System.Runtime.InteropServices;
using PDD_VPORTCB_CANCREATEVIDEOPORT = System.IntPtr;
using PDD_VPORTCB_COLORCONTROL = System.IntPtr;
using PDD_VPORTCB_CREATEVIDEOPORT = System.IntPtr;
using PDD_VPORTCB_DESTROYVPORT = System.IntPtr;
using PDD_VPORTCB_FLIP = System.IntPtr;
using PDD_VPORTCB_GETBANDWIDTH = System.IntPtr;
using PDD_VPORTCB_GETFIELD = System.IntPtr;
using PDD_VPORTCB_GETFLIPSTATUS = System.IntPtr;
using PDD_VPORTCB_GETINPUTFORMATS = System.IntPtr;
using PDD_VPORTCB_GETLINE = System.IntPtr;
using PDD_VPORTCB_GETOUTPUTFORMATS = System.IntPtr;
using PDD_VPORTCB_GETSIGNALSTATUS = System.IntPtr;
using PDD_VPORTCB_GETVPORTCONNECT = System.IntPtr;
using PDD_VPORTCB_UPDATE = System.IntPtr;
using PDD_VPORTCB_WAITFORSYNC = System.IntPtr;
namespace DirectN
{
[StructLayout(LayoutKind.Sequential)]
public partial struct DD_VIDEOPORTCALLBACKS
{
public uint dwSize;
public uint dwFlags;
public IntPtr CanCreateVideoPort;
public IntPtr CreateVideoPort;
public IntPtr FlipVideoPort;
public IntPtr GetVideoPortBandwidth;
public IntPtr GetVideoPortInputFormats;
public IntPtr GetVideoPortOutputFormats;
public IntPtr lpReserved1;
public IntPtr GetVideoPortField;
public IntPtr GetVideoPortLine;
public IntPtr GetVideoPortConnectInfo;
public IntPtr DestroyVideoPort;
public IntPtr GetVideoPortFlipStatus;
public IntPtr UpdateVideoPort;
public IntPtr WaitForVideoPortSync;
public IntPtr GetVideoSignalStatus;
public IntPtr ColorControl;
}
}
| 38 | 84 | 0.771345 |
6b2527414eeaa01092c404438521c2e6baed881b | 1,501 | js | JavaScript | commands/utility/color.js | Naufal-DevVoder/Kaguya-Bot-Discord | a6790d801e2a3c332319036b0842d4bfa34c072b | [
"MIT"
] | 2 | 2021-02-19T01:53:18.000Z | 2021-02-24T08:22:03.000Z | commands/utility/color.js | Naufal-DevVoder/Kaguya-Bot-Discord | a6790d801e2a3c332319036b0842d4bfa34c072b | [
"MIT"
] | null | null | null | commands/utility/color.js | Naufal-DevVoder/Kaguya-Bot-Discord | a6790d801e2a3c332319036b0842d4bfa34c072b | [
"MIT"
] | null | null | null | const Discord = require("discord.js");
module.exports = {
name: "color",
category: "🛠 | Utility",
usage: "color [color tag]",
description: "Send your request color or random color",
run: async (bot, message, args) => {
var color = message.content
.split(/\s+/g)
.slice(1)
.join(" ");
if (!color) {
var genColour = "#" + Math.floor(Math.random() * 16777215).toString(16);
const embed = new Discord.MessageEmbed()
.setAuthor(
`${message.author.username}'s color request`,
message.author.displayAvatarURL({ format: "png", dynamic: true })
)
.setColor(genColour)
.setImage(`https://dummyimage.com/50/${genColour.slice(1)}/&text=%20`)
.setTimestamp()
.setTitle(genColour);
return message.channel.send("Here's your color!", { embed: embed });
}
if (
(color.indexOf("#") === 0 && color.length === 7) ||
(!isNaN(color) && color.length <= 8 && color < 16777215)
) {
const embed = await new Discord.MessageEmbed()
.setAuthor(
`${message.author.username}'s color request`,
message.author.displayAvatarURL({ format: "png", dynamic: true })
)
.setColor(color)
.setImage(`https://dummyimage.com/50/${color.slice(1)}/&text=%20`)
.setTimestamp()
.setTitle(color);
return message.channel.send({ embed });
} else {
return message.channel.send("Invalid Parameters!");
}
}
};
| 31.93617 | 78 | 0.572285 |
23c7b7e1609bbb7c90c60ef6f88f553645a5f9fe | 6,966 | js | JavaScript | src/views/AddModel/AddModel.js | atomauro/botweb | 40f70e665a1e602c020253b1ec747ceaf27e02ce | [
"MIT"
] | null | null | null | src/views/AddModel/AddModel.js | atomauro/botweb | 40f70e665a1e602c020253b1ec747ceaf27e02ce | [
"MIT"
] | 7 | 2020-11-26T18:03:52.000Z | 2020-11-26T18:06:56.000Z | src/views/AddModel/AddModel.js | atomauro/botweb | 40f70e665a1e602c020253b1ec747ceaf27e02ce | [
"MIT"
] | null | null | null | import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { makeStyles, withStyles } from '@material-ui/core/styles';
import CloseIcon from '@material-ui/icons/Close';
import GeneralIcon from '@material-ui/icons/Face';
import WebcamIcon from '@material-ui/icons/AddAPhoto';
import EnjoyElfoIcon from '@material-ui/icons/ImportantDevices';
import VpnIcon from '@material-ui/icons/VpnLock';
import Check from '@material-ui/icons/Check';
import clsx from 'clsx';
import {
AppBar,
Toolbar,
StepConnector,
StepLabel,
Step,
Stepper,
Button,
Typography,
Paper,
ListItem,
useScrollTrigger,
IconButton,
CssBaseline
} from '@material-ui/core';
import { GeneralProfile, RestrictCountries, WebcamSites } from './components';
QontoStepIcon.propTypes = {
/**
* Whether this step is active.
*/
active: PropTypes.bool,
/**
* Mark the step as completed. Is passed to child components.
*/
completed: PropTypes.bool
};
const useQontoStepIconStyles = makeStyles({
root: {
color: '#eaeaf0',
display: 'flex',
height: 22
},
active: {
color: '#784af4'
},
circle: {
width: 8,
height: 8,
borderRadius: '50%',
backgroundColor: 'currentColor'
},
completed: {
color: '#784af4',
zIndex: 1,
fontSize: 18
}
});
const ColorlibConnector = withStyles({
alternativeLabel: {
top: 22
},
active: {
'& $line': {
backgroundImage:
'linear-gradient( 95deg,rgb(242,113,33) 0%,rgb(233,64,87) 50%,rgb(138,35,135) 100%)'
}
},
completed: {
'& $line': {
backgroundImage:
'linear-gradient( 95deg,rgb(242,113,33) 0%,rgb(233,64,87) 50%,rgb(138,35,135) 100%)'
}
},
line: {
height: 3,
border: 0,
backgroundColor: '#eaeaf0',
borderRadius: 1
}
})(StepConnector);
const useColorlibStepIconStyles = makeStyles({
root: {
backgroundColor: '#ccc',
zIndex: 1,
color: '#fff',
width: 50,
height: 50,
display: 'flex',
borderRadius: '50%',
justifyContent: 'center',
alignItems: 'center'
},
active: {
backgroundImage:
'linear-gradient( 136deg, rgb(242,113,33) 0%, rgb(233,64,87) 50%, rgb(138,35,135) 100%)',
boxshadow: '0 4px 10px 0 rgba(0,0,0,.25)'
},
completed: {
backgroundImage:
'linear-gradient( 136deg, rgb(242,113,33) 0%, rgb(233,64,87) 50%, rgb(138,35,135) 100%)'
},
appBar: {
position: 'relative',
width: '100%'
},
title: {
marginLeft: 80,
flex: 1,
color: 'white',
align: 'center'
}
});
const useStyles = makeStyles(theme => ({
root: {
width: 'auto'
},
button: {
marginRight: theme.spacing(1),
marginTop: theme.spacing(2)
},
instructions: {
marginTop: theme.spacing(1),
marginBottom: theme.spacing(1)
},
appBar: {
position: 'relative',
width: '100%',
height: 'auto'
},
title: {
flex: 1,
color: 'white',
align: 'center'
},
contentStep: {
width: 600,
height: 'auto',
align: 'center'
},
containerStep: {
width: '100%',
height: '100%'
}
}));
function QontoStepIcon(props) {
const classes = useQontoStepIconStyles();
const { active, completed } = props;
return (
<div
className={clsx(classes.root, {
[classes.active]: active
})}>
{completed ? (
<Check className={classes.completed} />
) : (
<div className={classes.circle} />
)}
</div>
);
}
function ColorlibStepIcon(props) {
const classes = useColorlibStepIconStyles();
const { active, completed } = props;
const icons = {
1: <GeneralIcon />,
2: <WebcamIcon />,
3: <VpnIcon />,
4: <EnjoyElfoIcon />
};
return (
<div
className={clsx(classes.root, {
[classes.active]: active,
[classes.completed]: completed
})}>
{icons[String(props.icon)]}
</div>
);
}
function getSteps() {
return ['General', 'Webcam Sites', 'Restrict Countries', '¡Boost!'];
}
function getStepContent(step) {
switch (step) {
case 0:
return <GeneralProfile />;
case 1:
return <WebcamSites />;
case 2:
return <RestrictCountries />;
case 3:
return '¡Boost!';
default:
return 'Unknown step';
}
}
const AddModel = props => {
const classes = useStyles();
const [activeStep, setActiveStep] = React.useState(0);
const steps = getSteps();
const handleNext = () => {
setActiveStep(prevActiveStep => prevActiveStep + 1);
};
const handleBack = () => {
setActiveStep(prevActiveStep => prevActiveStep - 1);
};
const handleReset = () => {
setActiveStep(0);
};
return (
<React.Fragment>
<CssBaseline />
<div align="center">
<Button onClick={props.increment}>Add</Button>
<button onClick={props.addByOneAsync}>Add 1 Async</button>
</div>
<div align="center">
<Typography variant="h3">There are {props.count} models</Typography>
</div>
<Paper className={classes.root}>
<div align="center">
<Stepper
alternativeLabel
activeStep={activeStep}
connector={<ColorlibConnector />}>
{steps.map(label => (
<Step key={label}>
<StepLabel StepIconComponent={ColorlibStepIcon}>
{label}
</StepLabel>
</Step>
))}
</Stepper>
</div>
<ListItem>
<div>
{activeStep === steps.length ? (
<div>
<Typography className={classes.instructions}>
All steps completed - you're finished
</Typography>
<Button onClick={handleReset} className={classes.button}>
Reset
</Button>
</div>
) : (
<div className={classes.containerStep}>
<div className={classes.contentStep}>
{getStepContent(activeStep)}
</div>
<div align="center">
<Button
disabled={activeStep === 0}
onClick={handleBack}
className={classes.button}>
Back
</Button>
<Button
variant="contained"
color="primary"
onClick={handleNext}
className={classes.button}>
{activeStep === steps.length - 1 ? 'Finish' : 'Next'}
</Button>
</div>
</div>
)}
</div>
</ListItem>
</Paper>
</React.Fragment>
);
}
const mapState = state => ({
badge: state.badge,
});
const mapDispatch = ({ badge: { addBy, addByAsync }}) => ({
addByOne: () => addBy(1),
addByOneAsync: () => addByAsync(1)
});
export default AddModel;
| 22.690554 | 95 | 0.551105 |
833c11fbeba109b856c2940a0c0e0676542bac94 | 2,341 | ts | TypeScript | packages/svg/src/icons/SettingLaptop.ts | bennetfabian/IconPark | ee84059a44b53729b6437eaa42baf8aa1cba47a9 | [
"Apache-2.0"
] | 7 | 2020-08-27T14:47:46.000Z | 2020-08-28T09:48:06.000Z | packages/svg/src/icons/SettingLaptop.ts | bytedance/icons | ee84059a44b53729b6437eaa42baf8aa1cba47a9 | [
"Apache-2.0"
] | null | null | null | packages/svg/src/icons/SettingLaptop.ts | bytedance/icons | ee84059a44b53729b6437eaa42baf8aa1cba47a9 | [
"Apache-2.0"
] | null | null | null | /**
* @file SettingLaptop 笔记本电脑设置
* @author Auto Generated by IconPark
*/
/* tslint:disable: max-line-length */
/* eslint-disable max-len */
import {ISvgIconProps, IconWrapper} from '../runtime';
export default IconWrapper('setting-laptop', (props: ISvgIconProps) => (
'<?xml version="1.0" encoding="UTF-8"?>'
+ '<svg width="' + props.size + '" height="' + props.size + '" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">'
+ '<path d="M21 9H11C9.34315 9 8 10.3431 8 12V33H40V26" stroke="' + props.colors[0] + '" stroke-width="' + props.strokeWidth + '" stroke-linecap="' + props.strokeLinecap + '" stroke-linejoin="' + props.strokeLinejoin + '"/>'
+ '<path d="M4 33H44V35C44 38.3137 41.3137 41 38 41H10C6.68629 41 4 38.3137 4 35V33Z" fill="' + props.colors[1] + '" stroke="' + props.colors[0] + '" stroke-width="' + props.strokeWidth + '" stroke-linejoin="' + props.strokeLinejoin + '"/>'
+ '<circle cx="35" cy="14" r="3" stroke="' + props.colors[0] + '" stroke-width="' + props.strokeWidth + '"/>'
+ '<path d="M35 21V17" stroke="' + props.colors[0] + '" stroke-width="' + props.strokeWidth + '" stroke-linecap="' + props.strokeLinecap + '" stroke-linejoin="' + props.strokeLinejoin + '"/>'
+ '<path d="M35 11V7" stroke="' + props.colors[0] + '" stroke-width="' + props.strokeWidth + '" stroke-linecap="' + props.strokeLinecap + '" stroke-linejoin="' + props.strokeLinejoin + '"/>'
+ '<path d="M28.9378 17.5L32.4019 15.5" stroke="' + props.colors[0] + '" stroke-width="' + props.strokeWidth + '" stroke-linecap="' + props.strokeLinecap + '" stroke-linejoin="' + props.strokeLinejoin + '"/>'
+ '<path d="M37.5982 12.5L41.0623 10.5" stroke="' + props.colors[0] + '" stroke-width="' + props.strokeWidth + '" stroke-linecap="' + props.strokeLinecap + '" stroke-linejoin="' + props.strokeLinejoin + '"/>'
+ '<path d="M28.9375 10.5L32.4016 12.5" stroke="' + props.colors[0] + '" stroke-width="' + props.strokeWidth + '" stroke-linecap="' + props.strokeLinecap + '" stroke-linejoin="' + props.strokeLinejoin + '"/>'
+ '<path d="M37.5982 15.5L41.0623 17.5" stroke="' + props.colors[0] + '" stroke-width="' + props.strokeWidth + '" stroke-linecap="' + props.strokeLinecap + '" stroke-linejoin="' + props.strokeLinejoin + '"/>'
+ '</svg>'
));
| 97.541667 | 248 | 0.615976 |
cd48ff49e57d80b9818b5c4e58a363a54663de99 | 6,189 | cs | C# | BNA/src/Import.cs | spaceflint7/bna | f9a8376b939dc7267cc6af50173423653093eb0b | [
"MIT"
] | 3 | 2021-04-02T12:39:20.000Z | 2021-05-21T18:26:52.000Z | BNA/src/Import.cs | spaceflint7/bna | f9a8376b939dc7267cc6af50173423653093eb0b | [
"MIT"
] | null | null | null | BNA/src/Import.cs | spaceflint7/bna | f9a8376b939dc7267cc6af50173423653093eb0b | [
"MIT"
] | null | null | null |
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Microsoft.Xna.Framework.Graphics;
#pragma warning disable 0436
namespace Microsoft.Xna.Framework
{
//
// GameWindow
//
[java.attr.Discard] // discard in output
public abstract class GameWindow
{
public abstract IntPtr Handle { get; }
public abstract bool AllowUserResizing { get; set; }
public abstract Rectangle ClientBounds { get; }
public abstract string ScreenDeviceName { get; }
public abstract void SetSupportedOrientations(DisplayOrientation orientations);
public abstract DisplayOrientation CurrentOrientation { get; set; }
public abstract void BeginScreenDeviceChange(bool willBeFullScreen);
public abstract void EndScreenDeviceChange(string screenDeviceName, int clientWidth, int clientHeight);
public abstract void SetTitle(string title);
protected void OnActivated() { }
protected void OnDeactivated() { }
protected void OnPaint() { }
protected void OnScreenDeviceNameChanged() { }
protected void OnClientSizeChanged() { }
protected void OnOrientationChanged() { }
public static readonly int DefaultClientWidth = 800;
public static readonly int DefaultClientHeight = 600;
}
//
// Game
//
[java.attr.Discard] // discard in output
public abstract class Game
{
public bool IsActive { get; set; }
public bool RunApplication;
public abstract void Tick();
}
}
namespace Microsoft.Xna.Framework.Graphics
{
//
// GraphicsDevice
//
[java.attr.Discard] // discard in output
public class GraphicsDevice
{
public readonly IntPtr GLDevice;
public TextureCollection Textures { get; }
}
//
// DisplayMode
//
[java.attr.Discard] // discard in output
public class DisplayMode
{
public DisplayMode(int width, int height, SurfaceFormat format) { }
}
//
// DisplayModeCollection
//
[java.attr.Discard] // discard in output
public class DisplayModeCollection
{
public DisplayModeCollection(List<DisplayMode> setmodes) { }
}
//
// GraphicsAdapter
//
[java.attr.Discard] // discard in output
public sealed class GraphicsAdapter
{
public GraphicsAdapter(DisplayModeCollection modes, string name, string description) { }
public static ReadOnlyCollection<GraphicsAdapter> Adapters => null;
}
//
// GraphicsResource
//
[java.attr.Discard] // discard in output
public abstract class GraphicsResource
{
public GraphicsDevice GraphicsDevice { get; set; }
protected virtual void Dispose(bool disposing) { }
public virtual bool IsDisposed => false;
}
//
// SpriteBatch
//
[java.attr.Discard] // discard in output
public class SpriteBatch
{
public struct VertexPositionColorTexture4
{
public Vector3 Position0;
public Color Color0;
public Vector2 TextureCoordinate0;
public Vector3 Position1;
public Color Color1;
public Vector2 TextureCoordinate1;
public Vector3 Position2;
public Color Color2;
public Vector2 TextureCoordinate2;
public Vector3 Position3;
public Color Color3;
public Vector2 TextureCoordinate3;
}
}
//
// EffectParameterCollection
//
[java.attr.Discard] // discard in output
public class EffectParameterCollection
{
public EffectParameterCollection(List<EffectParameter> value) { }
public EffectParameter this[int index] => null;
public int Count { get; }
}
//
// EffectPass
//
[java.attr.Discard] // discard in output
public sealed class EffectPass
{
public EffectPass(string name, EffectAnnotationCollection annotations,
Effect parent, IntPtr technique, uint passIndex) { }
}
//
// EffectPassCollection
//
[java.attr.Discard] // discard in output
public class EffectPassCollection
{
public EffectPassCollection(List<EffectPass> value) { }
}
//
// EffectTechnique
//
[java.attr.Discard] // discard in output
public sealed class EffectTechnique
{
public EffectTechnique(string name, IntPtr pointer, EffectPassCollection passes,
EffectAnnotationCollection annotations) { }
public string Name { get; }
}
//
// EffectTechniqueCollection
//
[java.attr.Discard] // discard in output
public class EffectTechniqueCollection
{
public EffectTechniqueCollection(List<EffectTechnique> value) { }
}
}
namespace Microsoft.Xna.Framework.Input
{
[java.attr.Discard] // discard in output
public struct MouseState
{
public int X { get; set; }
public int Y { get; set; }
public ButtonState LeftButton { get; set; }
}
[java.attr.Discard] // discard in output
public static class Keyboard
{
public static List<Keys> keys;
}
}
namespace Microsoft.Xna.Framework.Input.Touch
{
//
// TouchPanelCapabilities
//
[java.attr.Discard] // discard in output
public struct TouchPanelCapabilities
{
public TouchPanelCapabilities(bool isConnected, int maximumTouchCount) { }
}
[java.attr.Discard] // discard in output
public class TouchPanel
{
public static void INTERNAL_onTouchEvent(int fingerId, TouchLocationState state,
float x, float y, float dx, float dy) { }
}
}
namespace Microsoft.Xna.Framework.Media
{
//
// MediaQueue
//
[java.attr.Discard] // discard in output
public class MediaQueue
{
public MediaQueue() { }
public Song ActiveSong { get; }
public int ActiveSongIndex { get; set; }
public void Add(Song song) { }
public void Clear() { }
}
}
| 24.175781 | 111 | 0.629666 |
c302e4c1295d791d51e1fd2a25946aadbabd434f | 16,957 | sql | SQL | Banco/script.sql | saintalex93/notname | c6cb58a592146babb9c6d2f300e23064a99a98a3 | [
"Apache-2.0"
] | null | null | null | Banco/script.sql | saintalex93/notname | c6cb58a592146babb9c6d2f300e23064a99a98a3 | [
"Apache-2.0"
] | null | null | null | Banco/script.sql | saintalex93/notname | c6cb58a592146babb9c6d2f300e23064a99a98a3 | [
"Apache-2.0"
] | 6 | 2018-03-05T14:52:47.000Z | 2020-10-01T02:49:48.000Z | drop database if exists notnamec_db;
create database notnamec_db;
use notnamec_db;
--
-- set global sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
--
-- set session sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
--
-- CREATE USER 'notnamec_usr'@'localhost' IDENTIFIED BY 'hds24@carol';
--
-- GRANT ALL PRIVILEGES ON * . * TO 'notnamec_usr'@'localhost';
--
-- SELECT * FROM mysql.user;
--
-- select * from INFORMATION_SCHEMA.PROCESSLIST;
--
CREATE TABLE CLIENTE (
CLI_nCOD BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT ,
CLI_cNOME VARCHAR(70),
CLI_cRG VARCHAR(18),
CLI_cCPF VARCHAR(15) UNIQUE,
CLI_dDTNASC DATE,
CLI_cGENERO CHAR(1),
CLI_nTRESIDENCIAL VARCHAR(15),
CLI_nTCELULAR VARCHAR(15),
CLI_nTCOMERCIAL VARCHAR(15),
CLI_cEMAIL VARCHAR(150) UNIQUE,
CLI_cSENHA VARCHAR(20),
CLI_dDTULTIMO_ACESSO TIMESTAMP NULL DEFAULT NULL,
CLI_cSTATUS VARCHAR(10),
CLI_tPREFERENCIA TEXT DEFAULT NULL
)ENGINE = INNODB;
CREATE TABLE VENDA (
VENDA_nID BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
VENDA_nVLRTOTALVENDA DOUBLE(8,2) UNSIGNED,
VENDA_cFORMA_PAGAMENTO VARCHAR(20) NULL DEFAULT NULL,
VENDA_cFRETE VARCHAR(20) NULL DEFAULT NULL,
VENDA_nVLRFRETE DOUBLE(8,2) NULL DEFAULT NULL,
VENDA_dtDTCOMPRA TIMESTAMP NULL DEFAULT NULL ,
VENDA_cCODRASTREIO VARCHAR(80),
VENDA_cSTATUS ENUM ('REALIZADA', 'PENDENTE','DEVOLVIDA', 'EM DISPUTA' , 'CANCELADA', 'AGUARDANDO PAGAMENTO', 'PAGA', 'DISPONÍVEL' , 'EM ANÁLISE'),
CLI_nCOD BIGINT UNSIGNED,
FOREIGN KEY (CLI_nCOD) REFERENCES CLIENTE(CLI_nCOD)
)ENGINE = INNODB;
CREATE TABLE ENDERECO (
END_nID BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
END_nCEP varchar(10),
END_cLOGRADOURO VARCHAR(250),
END_cCIDADE VARCHAR(150),
END_cBAIRRO VARCHAR(150),
END_nNUMERO VARCHAR(7),
END_cCOMPLEMENTO VARCHAR(150),
END_cTIPO VARCHAR(30),
END_cUF VARCHAR(2),
CLI_nCOD BIGINT UNSIGNED,
FOREIGN KEY (CLI_nCOD) REFERENCES CLIENTE(CLI_nCOD)
)ENGINE = INNODB;
-- CREATE TABLE UF (
-- UF_nID INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
-- UF_cUF CHAR(2),
-- UF_cDESCRICAO VARCHAR(30)
-- )ENGINE = INNODB;
CREATE TABLE PRODUTO (
PRODUTO_nID INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
PRODUTO_cDESC VARCHAR(50),
PRODUTO_cDESCCOMPLETA TEXT,
PRODUTO_cSTATUS VARCHAR(10),
PRODUTO_tsCRIACAO TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRODUTO_tMATERIAL TEXT
)ENGINE = INNODB;
CREATE TABLE COR(
COR_nID INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
COR_cDESC VARCHAR(20),
COR_cHEX VARCHAR(20)
)ENGINE = INNODB;
CREATE TABLE TAMANHO(
TAMANHO_nID INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
TAMANHO_cTAMANHO VARCHAR(10),
TAMANHO_cDESC VARCHAR(255)
)ENGINE = INNODB;
CREATE TABLE MODELO (
MODELO_nID BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
MODELO_cNOME VARCHAR(150),
MODELO_nVLR_VENDA DOUBLE(8,2) UNSIGNED,
MODELO_nSTATUS VARCHAR(10),
MODELO_nDESCONTO DOUBLE(8,2) UNSIGNED,
MODELO_nQTD_ESTOQUE FLOAT UNSIGNED,
MODELO_tsCRIACAO TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
COR_nID INT UNSIGNED,
TAMANHO_nID INT UNSIGNED,
PRODUTO_nID INT UNSIGNED,
FOREIGN KEY (COR_nID) REFERENCES COR(COR_nID),
FOREIGN KEY (TAMANHO_nID) REFERENCES TAMANHO(TAMANHO_nID)
)ENGINE = INNODB;
CREATE TABLE COMPRA_ESTOQUE (
COMPRA_ESTOQUE_nID BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
COMPRA_ESTOQUE_nVALORTOTAL DOUBLE(8,2) UNSIGNED,
COMPRA_ESTOQUE_dDATA DATE
)ENGINE = INNODB;
CREATE TABLE MODELO_COMPRA_ESTOQUE (
MOD_COMP_ESTOQUE_nID BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
MODELO_COMPRA_ESTOQUE_nQTD FLOAT UNSIGNED,
MODELO_COMPRA_ESTOQUE_nVALOR DECIMAL(10,2) UNSIGNED,
MODELO_nID BIGINT UNSIGNED,
COMPRA_ESTOQUE_nID BIGINT UNSIGNED,
FOREIGN KEY(MODELO_nID) REFERENCES MODELO (MODELO_nID),
FOREIGN KEY(COMPRA_ESTOQUE_nID) REFERENCES COMPRA_ESTOQUE (COMPRA_ESTOQUE_nID)
)ENGINE = INNODB;
CREATE TABLE USUARIO (
USR_nCOD INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
USR_cSTATUS VARCHAR(10),
USR_cLOGIN VARCHAR(20) UNIQUE,
USR_cSENHA VARCHAR(20),
USR_cNOME VARCHAR(100),
USR_nPERMISSAO TINYINT UNSIGNED,
USR_EMAIL VARCHAR(100)
)ENGINE = INNODB;
-- CREATE TABLE PREFERENCIAS_SISTEMA (
-- ID_PREF_SISTEMA INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
-- NUM_CLIQUES BIGINT UNSIGNED,
-- PADRAO_SISTEMA TEXT
-- )ENGINE = INNODB;
CREATE TABLE VENDA_MODELO (
VENDA_MODELO_nID BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
VENDA_MODELO_tsDT_SEPARACAO TIMESTAMP NULL DEFAULT NULL ,
VENDA_MODELO_QDTE FLOAT UNSIGNED,
VENDA_MODELO_dVLR_MODELO DECIMAL(10,2),
VENDA_nID BIGINT UNSIGNED,
MODELO_nID BIGINT UNSIGNED,
FOREIGN KEY(VENDA_nID) REFERENCES VENDA (VENDA_nID),
FOREIGN KEY(MODELO_nID) REFERENCES MODELO (MODELO_nID)
)ENGINE = INNODB;
CREATE TABLE CATEGORIA (
CATEGORIA_nID INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
CATEGORIA_cDESC VARCHAR(99),
CATEGORIA_cSTATUS VARCHAR(10),
CATEGORIA_nCODPAI INT UNSIGNED NULL DEFAULT NULL
)ENGINE = INNODB;
CREATE TABLE PRODUTO_CATEGORIA (
PRODUTO_CATEGORIA_nID INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
CATEGORIA_nID INT UNSIGNED,
PRODUTO_nID INT UNSIGNED,
FOREIGN KEY(CATEGORIA_nID) REFERENCES CATEGORIA (CATEGORIA_nID),
FOREIGN KEY(PRODUTO_nID) REFERENCES PRODUTO (PRODUTO_nID)
)ENGINE = INNODB;
CREATE TABLE MAILMARKETING(
ID INT PRIMARY KEY AUTO_INCREMENT,
EMAIL VARCHAR(150)
);
-- CREATE TABLE CLIENTE_ENDERECO (
-- CLI_END_nID BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
-- END_nID BIGINT UNSIGNED,
-- CLI_nCOD BIGINT UNSIGNED,
-- FOREIGN KEY(END_nID) REFERENCES ENDERECO (END_nID),
-- FOREIGN KEY(CLI_nCOD) REFERENCES CLIENTE (CLI_nCOD)
-- )ENGINE = INNODB;
-- CREATE TABLE VENDA_STATUS (
-- VENDA_STA_nID BIGINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
-- STATUS_nID INT UNSIGNED,
-- VENDA_nID BIGINT UNSIGNED,
-- VENDA_STATUS_dDT_ATUALIZACAO TIMESTAMP NULL DEFAULT NULL,
-- FOREIGN KEY(VENDA_nID) REFERENCES VENDA (VENDA_nID)
-- )ENGINE = INNODB;
--
-- CREATE TABLE STATUS_VENDA (
-- STATUS_nID INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
-- STATUS_cDESC VARCHAR(250)
-- )ENGINE = INNODB;
--
-- ALTER TABLE ENDERECO ADD FOREIGN KEY(UF_nID) REFERENCES UF (UF_nID);--
ALTER TABLE MODELO ADD FOREIGN KEY(PRODUTO_nID) REFERENCES PRODUTO (PRODUTO_nID);
-- ALTER TABLE VENDA_STATUS ADD FOREIGN KEY(STATUS_nID) REFERENCES STATUS_VENDA (STATUS_nID);--
INSERT INTO USUARIO VALUES (0, 'Ativo', 'gabriela', '123', 'Gabriela Bransford', 1, '[email protected]');
-- UPDATE USUARIO SET USR_cSTATUS = 'Inativo' WHERE USR_nCOD = 1;
INSERT INTO CLIENTE (CLI_cNOME,CLI_cEMAIL,CLI_cSENHA,CLI_cSTATUS)
VALUES ('Sistema Notname','[email protected]','123','Ativo');
-- INSERT INTO CATEGORIA VALUES (0, 'Peita Periculosa', 'Ativo', 1), (0, 'Raba Devastadora', 'Ativo',2);
-- INSERT INTO PRODUTO (PRODUTO_cDESC, PRODUTO_cDESCCOMPLETA, PRODUTO_cSTATUS) VALUES ('Produto Piloto','Essa é uma descrição do produto que vai aparecer no contexto do index. Agora vamos testar um bold
-- <b>Isso é um negretto</b> <h1>Isso é um H1 gambiarrístico.</h1>','Ativo');
INSERT INTO TAMANHO VALUES (0, 'PP', 'Medidas: 50cm X 120cm'),(0, 'P', 'Medidas: 55cm X 125cm'),(0, 'M', 'Medidas: 60cm X 130cm'),
(0, 'G', 'Medidas: 70cm X 140cm'), (0, 'GG', 'Medidas: 80cm X 190cm');
INSERT INTO COR VALUES (0, 'Azul', '#0000CD'), (0, 'Azul Claro', '#6495ED'), (0, 'Laranja', '#FF4500'),
(0, 'Preto', '#000'), (0, 'Branco', '#fff'), (0, 'Vermelho', '#8B0000'),(0, 'Laranja Claro', '#FF8C00'),
(0, 'Amarelo', '#FFFF00'), (0, 'Verde', '#008000'), (0, 'Marrom', '#A0522D'), (0, 'Rosa', '#FF69B4'),
(0, 'Violeta', '#EE82EE');
-- INSERT INTO UF VALUES
-- (0, 'SP', 'São Paulo'),
-- (0, 'RJ', 'Rio de Janeiro'),
-- (0, 'MG', 'Minas Gerais'),
-- (0, 'SC', 'Santa Catarina'),
-- (0, 'AC', 'Acre'),
-- (0, 'AL', 'Alagoas'),
-- (0, 'AP', 'Amapá'),
-- (0, 'AM', 'Amazonas'),
-- (0, 'BA', 'Bahia'),
-- (0, 'CE', 'Ceará'),
-- (0, 'DF', 'Distrito Federal'),
-- (0, 'ES', 'Espírito Santo'),
-- (0, 'GO', 'Goiás'),
-- (0, 'MA', 'Maranhão'),
-- (0, 'MT', 'Mato Grosso'),
-- (0, 'MS', 'Mato Grosso do Sul'),
-- (0, 'PA', 'Pará'),
-- (0, 'PB', 'Paraíba'),
-- (0, 'PR', 'Paraná'),
-- (0, 'PE', 'Pernambuco'),
-- (0, 'PI', 'Piauí'),
-- (0, 'RN', 'Rio Grande do Norte'),
-- (0, 'RS', 'Rio Grande do Sul'),
-- (0, 'RO', 'Rondônia'),
-- (0, 'RR', 'Roraima'),
-- (0, 'SE', 'Sergipe'),
-- (0, 'TO', 'Tocantins');
--
INSERT INTO CATEGORIA(CATEGORIA_nID,CATEGORIA_cDESC,CATEGORIA_cSTATUS,CATEGORIA_nCODPAI) VALUES
(1,'Amarola','Ativo',NULL),
(2,'Bela recatada e do lar','Ativo',NULL),
(3,'Series','Ativo',NULL),
(4,'Nerd','Ativo',NULL),
(5,'Believe','Ativo',NULL),
(6,'Favoritas','Ativo',NULL),
(7,'LA CASA DE PAPEL','ATIVO',3),
(8,'MR ROBOT','ATIVO',3),
(9,'FLASH','ATIVO',3),
(10,'ARROW','ATIVO',3),
(11,'Chá','ATIVO',1),
(12,'Bela recata e do lar','ATIVO',2);
INSERT INTO PRODUTO(PRODUTO_nID,PRODUTO_cDESC,PRODUTO_cDESCCOMPLETA,PRODUTO_cSTATUS,PRODUTO_tsCRIACAO,PRODUTO_tMATERIAL) VALUES
(1,'Camisetas Temáticas','Produto exclusivo da nossa loja, com estampas temáticas. ','ATIVO','2018-06-28 15:21:46','Poliester com sublimação aplicada em prensa térmica retrocolátil a 100º'),
(2,'Camiseta Chá - Branca','Camiseta em malha 100% algodão fio penteado 30/1 muito confortável e resistente.
Estampa em vinil, que garante maior nitidez e durabilidade. O acabamento e a estamparia passam por um minucioso controle de qualidade. ','ATIVO','2018-06-28 15:54:41','Algodão'),
(3,'Camiseta Sea Smoke','Camiseta em malha 100% algodão fio penteado 30/1 muito confortável e resistente.
Estampa em vinil, que garante maior nitidez e durabilidade. O acabamento e a estamparia passam por um minucioso controle de qualidade. ','ATIVO','2018-06-28 15:48:17','Algodão'),
(4,'Camiseta Chá - Preto','Camiseta em malha 100% algodão fio penteado 30/1 muito confortável e resistente.
Estampa em vinil, que garante maior nitidez e durabilidade. O acabamento e a estamparia passam por um minucioso controle de qualidade. ','ATIVO','2018-06-28 15:55:24','Algodão'),
(5,'Camiseta Bitch - Preta','Camiseta em malha 100% algodão fio penteado 30/1 muito confortável e resistente.
Estampa em vinil, que garante maior nitidez e durabilidade. O acabamento e a estamparia passam por um minucioso controle de qualidade. ','ATIVO','2018-06-28 16:00:37','Algodão'),
(6,'Camiseta Compare - Branca','Camiseta em malha 100% algodão fio penteado 30/1 muito confortável e resistente.
Estampa em vinil, que garante maior nitidez e durabilidade. O acabamento e a estamparia passam por um minucioso controle de qualidade. ','ATIVO','2018-06-28 16:02:35','Algodão'),
(7,'Camiseta Fight - Preta','Camiseta em malha 100% algodão fio penteado 30/1 muito confortável e resistente.
Estampa em vinil, que garante maior nitidez e durabilidade. O acabamento e a estamparia passam por um minucioso controle de qualidade. ','ATIVO','2018-06-28 16:03:08','Algodão'),
(8,'Camiseta Mybody - Branca','Camiseta em malha 100% algodão fio penteado 30/1 muito confortável e resistente.
Estampa em vinil, que garante maior nitidez e durabilidade. O acabamento e a estamparia passam por um minucioso controle de qualidade. ','ATIVO','2018-06-28 16:03:49','Algodão'),
(9,'Camiseta Power Girl - Branca','Camiseta em malha 100% algodão fio penteado 30/1 muito confortável e resistente.
Estampa em vinil, que garante maior nitidez e durabilidade. O acabamento e a estamparia passam por um minucioso controle de qualidade. ','ATIVO','2018-06-28 16:04:54','Algodão'),
(10,'Camista Satan - Preta','Camiseta em malha 100% algodão fio penteado 30/1 muito confortável e resistente.
Estampa em vinil, que garante maior nitidez e durabilidade. O acabamento e a estamparia passam por um minucioso controle de qualidade. ','ATIVO','2018-06-28 16:06:51','Algodão'),
(11,'Camiseta Fight - Branca','Camiseta em malha 100% algodão fio penteado 30/1 muito confortável e resistente.
Estampa em vinil, que garante maior nitidez e durabilidade. O acabamento e a estamparia passam por um minucioso controle de qualidade. ','ATIVO','2018-06-28 16:07:27','Algodão');
INSERT INTO PRODUTO_CATEGORIA(PRODUTO_CATEGORIA_nID,CATEGORIA_nID,PRODUTO_nID) VALUES
(1,1,1),
(2,2,1),
(8,1,3),
(9,11,3),
(10,1,2),
(11,11,2),
(12,1,4),
(13,11,4),
(15,2,5),
(16,12,5),
(17,2,6),
(18,12,6),
(19,2,7),
(20,12,7),
(21,2,8),
(22,12,8),
(25,2,9),
(26,12,9),
(27,2,10),
(28,12,10),
(29,2,11),
(30,12,11);
INSERT INTO MODELO (MODELO_nID,MODELO_cNOME,MODELO_nVLR_VENDA,MODELO_nSTATUS,MODELO_nDESCONTO,MODELO_nQTD_ESTOQUE,MODELO_tsCRIACAO,COR_nID,TAMANHO_nID,PRODUTO_nID) VALUES
(1,'Camiseta Unicórnio',45.00,'Ativo',10.00,10,'2018-06-28 15:21:46',3,1,1),
(2,'Camiseta Mermaids',45.00,'Ativo',10.00,10,'2018-06-28 15:21:46',2,2,1),
(3,'Camiseta Chá',45.00,'Ativo',0.00,10,'2018-06-28 15:38:01',5,2,2),
(4,'Camiseta Chá',45.00,'Ativo',0.00,10,'2018-06-28 15:55:54',5,3,2),
(5,'Camiseta Chá',45.00,'Ativo',0.00,10,'2018-06-28 15:56:02',5,4,2),
(6,'Camiseta Chá',45.00,'Ativo',0.00,10,'2018-06-28 15:56:28',4,2,4),
(7,'Camiseta Chá',45.00,'Ativo',0.00,10,'2018-06-28 15:56:09',4,3,4),
(8,'Camiseta Chá',45.00,'Ativo',0.00,10,'2018-06-28 15:56:17',4,4,4),
(9,'Camiseta Sea Smoke',45.00,'Ativo',0.00,10,'2018-06-28 15:49:00',4,2,3),
(10,'Camiseta Bitch - Preta',45.00,'Ativo',0.00,10,'2018-06-28 16:09:59',4,2,5),
(11,'Camiseta Compare - Branca',45.00,'Ativo',0.00,10,'2018-06-28 16:15:05',5,2,6),
(12,'Camiseta Fight - Preta',45.00,'Ativo',0.00,10,'2018-06-28 16:15:59',4,3,7),
(13,'Camiseta Mybody - Branca',45.00,'Ativo',0.00,10,'2018-06-28 16:19:06',5,3,8),
(14,'Camiseta Power Girl - Branca',45.00,'Ativo',0.00,10,'2018-06-28 16:23:49',5,3,9),
(15,'Camiseta Satan - Preta',45.00,'Ativo',0.00,10,'2018-06-28 16:36:11',4,3,10),
(16,'Camiseta Fight - Branca ',45.00,'Ativo',0.00,10,'2018-06-28 16:38:07',5,3,11);
DELIMITER $$
CREATE PROCEDURE USP_LOGIN(IN LOGIN VARCHAR(20), IN SENHA VARCHAR(20))
BEGIN
IF EXISTS(SELECT * FROM USUARIO WHERE USR_cLOGIN = LOGIN && USR_cSENHA = SENHA)
THEN
IF EXISTS(SELECT USR_nCOD FROM USUARIO WHERE USR_cLOGIN = LOGIN AND USR_cSENHA = SENHA AND USR_cSTATUS = 'Ativo')
THEN
SELECT USR_nCOD FROM USUARIO WHERE USR_cLOGIN = LOGIN AND USR_cSENHA = SENHA INTO @HANDSHAKE;
ELSE
SELECT 'Usuário Inativo' INTO @HANDSHAKE;
END IF;
SELECT @HANDSHAKE AS HANDSHAKE;
ELSE
SELECT 'Login ou Senha Inválidos' AS HANDSHAKE;
END IF;
END $$
DELIMITER ;
DELIMITER $$
create function fn_buscaDescCategoriaPai(idCatPai int)
returns varchar(50)
begin
declare nomeCategoria varchar(50);
select CATEGORIA_cDESC into nomeCategoria
from CATEGORIA
where CATEGORIA_nID = idCatPai;
return nomeCategoria;
end $$
DELIMITER ;
DELIMITER $$
create function fn_buscaHexCor(idCor int)
returns varchar(10)
begin
declare hexCor varchar(10);
select COR_cHEX into hexCor
from COR
where COR_nID = idCor;
return hexCor;
end $$
DELIMITER ;
DELIMITER $$
create function fn_buscaDescCor(idCor int)
returns varchar(10)
begin
declare descCor varchar(10);
select COR_cDESC into descCor
from COR
where COR_nID = idCor;
return descCor;
end $$
DELIMITER ;
DELIMITER $$
create function fn_buscaDescProduto(idProduto int)
returns varchar(80)
begin
declare descProduto varchar(80);
select PRODUTO_cDESC into descProduto
from PRODUTO
where PRODUTO_nID = idProduto;
return descProduto;
end $$
DELIMITER ;
DELIMITER $$
create function fn_buscaDescTamanho(idTamanho int)
returns varchar(20)
begin
declare descTamanho varchar(20);
select TAMANHO_cTAMANHO into descTamanho
from TAMANHO
where TAMANHO_nID = idTamanho;
return descTamanho;
end $$
DELIMITER ;
DELIMITER $$
CREATE PROCEDURE USP_VENDA_MODELO(IN ID_MODELO BIGINT, IN ID_VENDA BIGINT, IN QUANTIDADE INT, IN VALOR_MODELO DOUBLE)
BEGIN
IF EXISTS(SELECT * FROM MODELO WHERE MODELO_nID = ID_MODELO AND MODELO_nQTD_ESTOQUE > 0 )
THEN
INSERT INTO VENDA_MODELO (VENDA_MODELO_tsDT_SEPARACAO, VENDA_MODELO_QDTE, VENDA_MODELO_dVLR_MODELO,
VENDA_nID, MODELO_nID)
VALUES(NOW(), QUANTIDADE, VALOR_MODELO, ID_VENDA, ID_MODELO);
UPDATE VENDA SET VENDA_nVLRTOTALVENDA = VENDA_nVLRTOTALVENDA + VALOR_MODELO WHERE VENDA_nID = ID_VENDA;
UPDATE MODELO SET MODELO_nQTD_ESTOQUE = MODELO_nQTD_ESTOQUE - QUANTIDADE WHERE MODELO_nID = ID_MODELO;
SELECT COUNT(VENDA_nID) as COUNT_MODELOS FROM VENDA_MODELO WHERE VENDA_nID = ID_VENDA;
ELSE
SELECT 'SEM ESTOQUE' as COUNT_MODELOS;
END IF;
END $$
DELIMITER ;
DELIMITER $$
CREATE PROCEDURE USP_DELETA_MODELO(IN ID_MODELO BIGINT, IN ID_VENDA BIGINT, IN ID_VENDA_MODELO BIGINT)
BEGIN
IF EXISTS(SELECT * FROM VENDA_MODELO WHERE (SELECT COUNT(MODELO_nID) FROM VENDA_MODELO WHERE VENDA_nID = ID_VENDA)>1)
THEN
UPDATE MODELO SET MODELO_nQTD_ESTOQUE = MODELO_nQTD_ESTOQUE + 1 WHERE MODELO_nID = ID_MODELO;
DELETE FROM VENDA_MODELO WHERE VENDA_MODELO_nID = ID_VENDA_MODELO;
SELECT 'OK' AS RESULT;
ELSE
SELECT 'APENAS UM MODELO' AS RESULT;
END IF;
END $$
DELIMITER ;
| 36.703463 | 202 | 0.739223 |
da58d73bbd66dc52fa0f291c164b267f6af1c098 | 62 | php | PHP | resources/views/components/alert.blade.php | Ivankali2020/learnig_platform_laravel | d956039b74c86182d21f65f5a91cfb35fe105f2e | [
"MIT"
] | null | null | null | resources/views/components/alert.blade.php | Ivankali2020/learnig_platform_laravel | d956039b74c86182d21f65f5a91cfb35fe105f2e | [
"MIT"
] | null | null | null | resources/views/components/alert.blade.php | Ivankali2020/learnig_platform_laravel | d956039b74c86182d21f65f5a91cfb35fe105f2e | [
"MIT"
] | null | null | null |
<div class="alert alert-{{ $css }}" > {{ $error }}</div>
| 10.333333 | 57 | 0.467742 |
a3702b6e856839ef1244adaa3ea3ac550feb126d | 1,847 | ts | TypeScript | server/ImageStore.ts | ivar/epyc | aff916f429edce6e4eaf34b436a25146eafb2cdb | [
"MIT"
] | null | null | null | server/ImageStore.ts | ivar/epyc | aff916f429edce6e4eaf34b436a25146eafb2cdb | [
"MIT"
] | 15 | 2021-02-12T16:50:25.000Z | 2021-09-16T03:10:13.000Z | server/ImageStore.ts | ivar/epyc | aff916f429edce6e4eaf34b436a25146eafb2cdb | [
"MIT"
] | 1 | 2021-04-06T16:27:47.000Z | 2021-04-06T16:27:47.000Z | import AWS from 'aws-sdk';
import { Readable } from 'stream';
import Cfg from './Cfg';
export default class ImageStore {
static getFileUrl(gameName: string, frameId: string) {
const fileName = this.getFileName(gameName, frameId);
return `https://${Cfg.imageStoreAwsBucket}.s3-us-west-2.amazonaws.com/${fileName}`;
}
static getFileName(gameName: string, frameId: string) {
return `${gameName}/${frameId}.png`;
}
static getAvatarFileUrl(id: string) {
const fileName = this.getAvatarFileName(id);
return `https://${Cfg.imageStoreAwsBucket}.s3-us-west-2.amazonaws.com/${fileName}`;
}
static getAvatarFileName(id: string) {
return `avatars/${id}.png`;
}
static async uploadAvatar(id: string, data: Readable): Promise<{ fileName: string; fileUrl: string }> {
const s3 = new AWS.S3();
const fileName = this.getAvatarFileName(id);
const fileUrl = this.getAvatarFileUrl(id);
await s3
.upload({
Bucket: Cfg.imageStoreAwsBucket,
Key: fileName,
Body: data,
ContentType: 'image/png',
})
.promise();
return { fileName, fileUrl };
}
static async uploadImage(
gameName: string,
frameId: string,
data: Readable
): Promise<{ fileName: string; fileUrl: string }> {
const s3 = new AWS.S3();
const fileName = this.getFileName(gameName, frameId);
const fileUrl = this.getFileUrl(gameName, frameId);
await s3
.upload({
Bucket: Cfg.imageStoreAwsBucket,
Key: fileName,
Body: data,
ContentType: 'image/png',
})
.promise();
return { fileName, fileUrl };
}
}
| 28.859375 | 107 | 0.568489 |
2f524c551cdf81075c3f5f47ecf4737b389e9e8a | 704 | js | JavaScript | gatsby-config.js | kenkoii/company-site | bd94024507758c3d6c7e2a9e84bfc29f29f8a3d9 | [
"MIT"
] | null | null | null | gatsby-config.js | kenkoii/company-site | bd94024507758c3d6c7e2a9e84bfc29f29f8a3d9 | [
"MIT"
] | null | null | null | gatsby-config.js | kenkoii/company-site | bd94024507758c3d6c7e2a9e84bfc29f29f8a3d9 | [
"MIT"
] | null | null | null | const languages = require('./src/data/languages');
module.exports = {
siteMetadata: {
title: `Gatsby Default Starter`,
languages
},
plugins: [
`gatsby-plugin-react-helmet`,
{
resolve: 'gatsby-plugin-i18n',
options: {
langKeyForNull: 'any',
langKeyDefault: languages.defaultLangKey,
useLangKeyLayout: true
}
},{
resolve: `gatsby-plugin-google-analytics`,
options: {
trackingId: "UA-119873390-1",
// Puts tracking script in the head instead of the body
head: true,
// Avoids sending pageview hits from custom paths
exclude: ["/preview/**", "/do-not-track/me/too/"],
},
}],
}
| 25.142857 | 63 | 0.586648 |
1a60d60a752ee290b523b06ce44597e67e4c0e33 | 1,681 | py | Python | src/pymloc/model/optimization/local_optimization.py | dbankmann/python-mloc | 2a29f9ddd96abd77044d091cee6e76fee6773090 | [
"BSD-3-Clause"
] | null | null | null | src/pymloc/model/optimization/local_optimization.py | dbankmann/python-mloc | 2a29f9ddd96abd77044d091cee6e76fee6773090 | [
"BSD-3-Clause"
] | null | null | null | src/pymloc/model/optimization/local_optimization.py | dbankmann/python-mloc | 2a29f9ddd96abd77044d091cee6e76fee6773090 | [
"BSD-3-Clause"
] | null | null | null | #
# Copyright (c) 2019-2020
#
# @author: Daniel Bankmann
# @company: Technische Universität Berlin
#
# This file is part of the python package pymloc
# (see https://gitlab.tubit.tu-berlin.de/bankmann91/python-mloc )
#
# License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
#
from abc import ABC
from ..solvable import VariableSolvable
from ..variables.container import VariablesContainer
from .constraints.local_constraint import LocalConstraint
from .objectives.local_objective import LocalObjective
class LocalOptimizationObject(VariableSolvable, ABC):
"""
Abstract class for defining local optimization problems.
"""
def __init__(self, loc_objective_obj: LocalObjective,
loc_constraint_obj: LocalConstraint,
variables_obj: VariablesContainer):
if not isinstance(loc_objective_obj, LocalObjective):
raise TypeError(loc_objective_obj)
if not isinstance(loc_constraint_obj, LocalConstraint):
raise TypeError(loc_constraint_obj)
self.objective = loc_objective_obj
self.constraint = loc_constraint_obj
super().__init__(variables_obj)
@property
def objective(self) -> LocalObjective:
return self._objective
@objective.setter
def objective(self, value):
self._objective = value
@property
def constraint(self) -> LocalConstraint:
return self._constraint
@constraint.setter
def constraint(self, value):
self._constraint = value
class LocalNullOptimization(LocalOptimizationObject):
"""Dummy implementation of a local optimization."""
def residual(self):
return 0.
| 29.491228 | 73 | 0.716835 |
0ad6d7d0905c4f0cb949f0256ee8dfe433c924cf | 924 | cs | C# | src/MahApps.Metro.IconPacks/PackIconIonicons.cs | JCBurnside/MahApps.Metro.IconPacks | b20d7ed55e3be8febad8ad4b80dc9ce00f7e2d79 | [
"MIT"
] | null | null | null | src/MahApps.Metro.IconPacks/PackIconIonicons.cs | JCBurnside/MahApps.Metro.IconPacks | b20d7ed55e3be8febad8ad4b80dc9ce00f7e2d79 | [
"MIT"
] | null | null | null | src/MahApps.Metro.IconPacks/PackIconIonicons.cs | JCBurnside/MahApps.Metro.IconPacks | b20d7ed55e3be8febad8ad4b80dc9ce00f7e2d79 | [
"MIT"
] | null | null | null |
#if !(NETFX_CORE || WINDOWS_UWP)
using System.Windows;
#endif
namespace MahApps.Metro.IconPacks
{
/// <summary>
/// Ionicons is licensed under the [MIT license](<see><cref>https://github.com/ionic-team/ionicons/blob/master/LICENSE</cref></see>).
/// Contributions, corrections and requests can be made on GitHub <see><cref>https://github.com/ionic-team/ionicons</cref></see>.
/// </summary>
public class PackIconIonicons : PackIconControl<PackIconIoniconsKind>
{
#if !(NETFX_CORE || WINDOWS_UWP)
static PackIconIonicons()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(PackIconIonicons), new FrameworkPropertyMetadata(typeof(PackIconIonicons)));
}
#endif
public PackIconIonicons() : base(PackIconIoniconsDataFactory.Create)
{
#if NETFX_CORE || WINDOWS_UWP
this.DefaultStyleKey = typeof(PackIconIonicons);
#endif
}
}
} | 33 | 137 | 0.688312 |
2189ee18602e47335dd75470b68db3ea07a59a18 | 1,358 | js | JavaScript | nthNumber.js | mhans003/algorithm-solutions-cs | e92e8b04febb8da328439ff47eef6f5feeaa9942 | [
"MIT"
] | 1 | 2021-09-08T17:44:44.000Z | 2021-09-08T17:44:44.000Z | nthNumber.js | mhans003/algorithm-solutions-cs | e92e8b04febb8da328439ff47eef6f5feeaa9942 | [
"MIT"
] | null | null | null | nthNumber.js | mhans003/algorithm-solutions-cs | e92e8b04febb8da328439ff47eef6f5feeaa9942 | [
"MIT"
] | null | null | null | /*
You are given a string s of characters that contains at least n numbers (here, a number is defined as a consecutive series of digits, where any character immediately to the left and right of the series are not digits). The numbers may contain leading zeros, but it is guaranteed that each number has at least one non-zero digit in it.
Your task is to find the nth number and return it as a string without leading zeros.
*/
function nthNumber(s, n) {
/*
Using the RegExp constructor, create a regular expression that matches numbers in the input string (using the global flag).
For the inner group:
[1-9]+ Matches one or more non-zero digits. This means only numbers beginning in non-zero numbers will be captured.
[0-9]* Matches any digit following the first (there can be zero or more).
Those two categories are grouped together () into a number.
For the outer group:
. matches any character except line break.s
* matches zero or more.
? matches as few characters as possible.
{n} will make the first result of the exec() call the target nth element we are looking for.
Finally, when re.exec(s)[1] is called, element 1 of the returned array will contain the number string in the format that is wanted.
*/
var re = new RegExp(`(([1-9]+[0-9]*).*?){${n}}`, 'g');
return re.exec(s)[1];
}
| 46.827586 | 334 | 0.71134 |
0744f5a61f93613c3213093c3b4585e8a27ebd2a | 426 | css | CSS | data/usercss/20101.user.css | 33kk/uso-archive | 2c4962d1d507ff0eaec6dcca555efc531b37a9b4 | [
"MIT"
] | 118 | 2020-08-28T19:59:28.000Z | 2022-03-26T16:28:40.000Z | data/usercss/20101.user.css | 33kk/uso-archive | 2c4962d1d507ff0eaec6dcca555efc531b37a9b4 | [
"MIT"
] | 38 | 2020-09-02T01:08:45.000Z | 2022-01-23T02:47:24.000Z | data/usercss/20101.user.css | 33kk/uso-archive | 2c4962d1d507ff0eaec6dcca555efc531b37a9b4 | [
"MIT"
] | 21 | 2020-08-19T01:12:43.000Z | 2022-03-15T21:55:17.000Z | /* ==UserStyle==
@name non-padding for ESV
@namespace USO Archive
@author joe jiang
@description `turn off ESV.org bible site's padding for narrow screens`
@version 20090810.8.9
@license NO-REDISTRIBUTION
@preprocessor uso
==/UserStyle== */
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("www.gnpcb.org") {
body {
padding: 0 0px !important; ;
}
} | 26.625 | 74 | 0.629108 |
b6867984976accb0ccd4106a9559fd037f29de31 | 1,977 | rs | Rust | src/replace.rs | lucab/cargo-release | e2caea8c1c4f7f8740f7c42c48c5c087f04a823e | [
"Apache-2.0",
"MIT"
] | null | null | null | src/replace.rs | lucab/cargo-release | e2caea8c1c4f7f8740f7c42c48c5c087f04a823e | [
"Apache-2.0",
"MIT"
] | null | null | null | src/replace.rs | lucab/cargo-release | e2caea8c1c4f7f8740f7c42c48c5c087f04a823e | [
"Apache-2.0",
"MIT"
] | null | null | null | use std::io::prelude::*;
use std::io;
use std::fs::File;
use std::path::Path;
use regex::Regex;
use error::FatalError;
use toml::Value;
use chrono::prelude::Local;
fn load_from_file(path: &Path) -> io::Result<String> {
let mut file = try!(File::open(path));
let mut s = String::new();
try!(file.read_to_string(&mut s));
Ok(s)
}
fn save_to_file(path: &Path, content: &str) -> io::Result<()> {
let mut file = try!(File::create(path));
try!(file.write_all(&content.as_bytes()));
Ok(())
}
pub fn do_replace_versions(
replace_config: &Value,
prev_version: &str,
version: &str,
dry_run: bool,
) -> Result<bool, FatalError> {
if let &Value::Array(ref v) = replace_config {
for tbl in v {
if let &Value::Table(ref t) = tbl {
let file = try!(t.get("file").and_then(|v| v.as_str()).ok_or(
FatalError::ReplacerConfigError,
));
let pattern = try!(t.get("search").and_then(|v| v.as_str()).ok_or(
FatalError::ReplacerConfigError,
));
let replace = try!(t.get("replace").and_then(|v| v.as_str()).ok_or(
FatalError::ReplacerConfigError,
));
let replace_string = replace
.replace("{{version}}", version)
.replace("{{prev_version}}", prev_version)
.replace("{{date}}", &Local::now()
.format("%Y-%m-%d")
.to_string());
let replacer = replace_string.as_str();
let data = try!(load_from_file(&Path::new(file)));
let r = try!(Regex::new(pattern).map_err(FatalError::from));
let result = r.replace_all(&data, replacer);
if !dry_run {
try!(save_to_file(&Path::new(file), &result));
}
}
}
}
Ok(true)
}
| 30.890625 | 83 | 0.505817 |
c9c3f068965fb1fd33b27d05a2c28bb119cbe3f2 | 533 | ts | TypeScript | BackEnd/API/Routes/oferta.ts | Guldanist/Ecollect-Final | bb68d693577d33ad45bbeae289ebdf9fc506dece | [
"MIT"
] | null | null | null | BackEnd/API/Routes/oferta.ts | Guldanist/Ecollect-Final | bb68d693577d33ad45bbeae289ebdf9fc506dece | [
"MIT"
] | 1 | 2021-05-09T21:52:24.000Z | 2021-05-09T21:52:24.000Z | BackEnd/API/Routes/oferta.ts | Guldanist/Ecollect-Final | bb68d693577d33ad45bbeae289ebdf9fc506dece | [
"MIT"
] | null | null | null | // OFERTA ROUTER
import {OfertaController} from'./../Controllers/oferta';
import {Router} from 'express';
export var OfertaRouter=Router();
/**
* Implementamos las consultas mediante GET
*/
OfertaRouter.get('/oferta/:publi_id',OfertaController.getOfertasByIdPublicacion);
OfertaRouter.get('/oferta/misofertas/:usu_id',OfertaController.getOfertasByIdUsuario);
OfertaRouter.post('/oferta',OfertaController.createOferta);
OfertaRouter.get('/oferta/cambiarestado/:ofer_id/:ofer_estado',OfertaController.setEstadoOfertasByIdOferta);
| 38.071429 | 108 | 0.804878 |
1ab6b096defc0c59723c7efad322fab83e7c78f4 | 171 | py | Python | task05/task5.py | SimeonHristov99/CodeEveryDay | ffeed48d7d55910be87b40b4113e8073f29a265d | [
"MIT"
] | null | null | null | task05/task5.py | SimeonHristov99/CodeEveryDay | ffeed48d7d55910be87b40b4113e8073f29a265d | [
"MIT"
] | null | null | null | task05/task5.py | SimeonHristov99/CodeEveryDay | ffeed48d7d55910be87b40b4113e8073f29a265d | [
"MIT"
] | null | null | null | def multiplication_table(size):
return [[ x * y for y in range(1, size + 1)] for x in range(1, size + 1)]
print(multiplication_table(3)) # [[1,2,3],[2,4,6],[3,6,9]] | 34.2 | 77 | 0.608187 |
da5ba7644cceabe6282e9f740c600595db49c587 | 479 | php | PHP | lib/HTML/Attr/StartAttr/StartTrait.php | dom-arch/dom-assembly | e9138d823f282679534859f6ee02a97a0ccb8e83 | [
"MIT"
] | null | null | null | lib/HTML/Attr/StartAttr/StartTrait.php | dom-arch/dom-assembly | e9138d823f282679534859f6ee02a97a0ccb8e83 | [
"MIT"
] | null | null | null | lib/HTML/Attr/StartAttr/StartTrait.php | dom-arch/dom-assembly | e9138d823f282679534859f6ee02a97a0ccb8e83 | [
"MIT"
] | null | null | null | <?php
namespace DOMAssembly\HTML\Attr\StartAttr {
use DOMAssembly\HTML\Attr\StartAttr;
trait StartTrait
{
/**
* @param int $value
* @return $this
*/
public function setStart(
int $value
)
{
$value = var_export($value, true);
$document = $this->getDocument();
$attr = StartAttr::of($document, $value);
return $this->set($attr);
}
}
} | 19.958333 | 53 | 0.482255 |
d8bda3916a6e51b7e78f54596a5c15c9826dadd5 | 672 | swift | Swift | Pod-Chat-iOS-SDK/Chat/Main/NewChat/Message/DTO/REQ/UnreadMessageCountRequest.swift | FanapSoft/pod-chat-ios-sdk | 3d80685d7b6ecbb2bbba4f186554ca883d3fac9b | [
"MIT"
] | null | null | null | Pod-Chat-iOS-SDK/Chat/Main/NewChat/Message/DTO/REQ/UnreadMessageCountRequest.swift | FanapSoft/pod-chat-ios-sdk | 3d80685d7b6ecbb2bbba4f186554ca883d3fac9b | [
"MIT"
] | null | null | null | Pod-Chat-iOS-SDK/Chat/Main/NewChat/Message/DTO/REQ/UnreadMessageCountRequest.swift | FanapSoft/pod-chat-ios-sdk | 3d80685d7b6ecbb2bbba4f186554ca883d3fac9b | [
"MIT"
] | null | null | null | //
// UnreadMessageCountRequest.swift
// FanapPodChatSDK
//
// Created by Hamed Hosseini on 2/27/21.
//
import Foundation
public class UnreadMessageCountRequest: BaseRequest{
let countMutedThreads:Bool
public init (countMutedThreads:Bool = false,uniqueId:String? = nil , typeCode:String? = nil){
self.countMutedThreads = countMutedThreads
super.init(uniqueId: uniqueId, typeCode: typeCode)
}
private enum CodingKeys : String , CodingKey {
case mute = "mute"
}
public override func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(countMutedThreads, forKey: .mute)
}
}
| 24.888889 | 94 | 0.741071 |
c96efc7c4353fddf8723386eecce4f8c849df2ba | 840 | ts | TypeScript | resources/frontend/angular/src/app/services/modal.service.ts | glassShard/lvhang | af87d363b367fc354fe0df3166e7a5e178595a3a | [
"MIT"
] | null | null | null | resources/frontend/angular/src/app/services/modal.service.ts | glassShard/lvhang | af87d363b367fc354fe0df3166e7a5e178595a3a | [
"MIT"
] | 9 | 2021-02-02T19:26:49.000Z | 2022-03-02T10:39:45.000Z | resources/frontend/angular/src/app/services/modal.service.ts | glassShard/lvhang | af87d363b367fc354fe0df3166e7a5e178595a3a | [
"MIT"
] | null | null | null | import {Injectable} from '@angular/core';
import {Subject} from 'rxjs';
@Injectable({
providedIn: 'root'
})
export class ModalService {
private modals: any[] = [];
quillNotifyer = new Subject<{open: boolean, id: number, text: string | null | undefined}>();
modalReadyNotifyer = new Subject<number>();
quillResult = new Subject<string>();
constructor() {
}
add(modal: any): void {
this.modals.push(modal);
}
remove(id: number): void {
if (id >= -1) {
this.quillNotifyer.next({open: false, id, text: null});
}
this.modals = this.modals.filter(x => x.id !== id);
}
open(id: number): Subject<string> {
const modal = this.modals.find(x => x.id === id);
return modal.open();
}
close(id: number): void {
const modal = this.modals.find(x => x.id === id);
modal.close();
}
}
| 22.702703 | 94 | 0.604762 |
fe960b73da55174c941ced49110568c667e355ee | 1,343 | dart | Dart | lib/bloc/recipe_details/recipe_details_state.dart | fiery-flutter/mobile-app | 70f6427105f741775b5ff641840e3f05048a84ab | [
"MIT"
] | 1 | 2021-05-13T23:05:20.000Z | 2021-05-13T23:05:20.000Z | lib/bloc/recipe_details/recipe_details_state.dart | fiery-flutter/mobile-app | 70f6427105f741775b5ff641840e3f05048a84ab | [
"MIT"
] | null | null | null | lib/bloc/recipe_details/recipe_details_state.dart | fiery-flutter/mobile-app | 70f6427105f741775b5ff641840e3f05048a84ab | [
"MIT"
] | null | null | null | import 'package:equatable/equatable.dart';
import 'package:flutter/foundation.dart';
import '../../data/http_client/responses/responses.dart';
import '../../ui/screens/recipe_details/recipe_header/recipe_header_view_model.dart';
class RecipeDetailsState extends Equatable {
final RecipeResponse recipe;
final bool loading;
final RecipeHeaderViewModel headerViewModel;
const RecipeDetailsState({
this.recipe,
this.loading = false,
this.headerViewModel,
});
factory RecipeDetailsState.initial({
@required RecipeResponse recipe,
@required bool isInBookmarks,
}) =>
RecipeDetailsState(
recipe: recipe,
headerViewModel: RecipeHeaderViewModel(
title: recipe.title,
complexity: recipe.complexity,
authorAvatarUrl: recipe.userAvaratUrl,
authorName: recipe.userName ?? '',
isInBookmarks: isInBookmarks,
),
);
RecipeDetailsState copy({
RecipeResponse recipe,
bool loading,
RecipeHeaderViewModel headerViewModel,
}) =>
RecipeDetailsState(
recipe: recipe ?? this.recipe,
loading: loading ?? this.loading,
headerViewModel: headerViewModel ?? this.headerViewModel,
);
@override
List<Object> get props => [
recipe,
loading,
headerViewModel,
];
}
| 26.333333 | 85 | 0.673864 |
f590b76b235a202847381fc918657b0462491d88 | 117 | sql | SQL | src/test/resources/sql/create_table/0ad0746b.sql | Shuttl-Tech/antlr_psql | fcf83192300abe723f3fd3709aff5b0c8118ad12 | [
"MIT"
] | 66 | 2018-06-15T11:34:03.000Z | 2022-03-16T09:24:49.000Z | src/test/resources/sql/create_table/0ad0746b.sql | Shuttl-Tech/antlr_psql | fcf83192300abe723f3fd3709aff5b0c8118ad12 | [
"MIT"
] | 13 | 2019-03-19T11:56:28.000Z | 2020-08-05T04:20:50.000Z | src/test/resources/sql/create_table/0ad0746b.sql | Shuttl-Tech/antlr_psql | fcf83192300abe723f3fd3709aff5b0c8118ad12 | [
"MIT"
] | 28 | 2019-01-05T19:59:02.000Z | 2022-03-24T11:55:50.000Z | -- file:tablesample.sql ln:106 expect:true
create table parted_sample_1 partition of parted_sample for values in (1)
| 39 | 73 | 0.811966 |
f77b86b052b422b6d801c52b465a05d004175560 | 85 | sql | SQL | api/src/main/resources/db/migration/mysql/common/V1_0_10__DDL_drop_unique_index_on_variant_id_on_wishlist_items.sql | stsiwo/e-commerce-starter-kits | bd36d5b97eb5f3b844fc1cefaf2e14bf71667d76 | [
"MIT"
] | null | null | null | api/src/main/resources/db/migration/mysql/common/V1_0_10__DDL_drop_unique_index_on_variant_id_on_wishlist_items.sql | stsiwo/e-commerce-starter-kits | bd36d5b97eb5f3b844fc1cefaf2e14bf71667d76 | [
"MIT"
] | null | null | null | api/src/main/resources/db/migration/mysql/common/V1_0_10__DDL_drop_unique_index_on_variant_id_on_wishlist_items.sql | stsiwo/e-commerce-starter-kits | bd36d5b97eb5f3b844fc1cefaf2e14bf71667d76 | [
"MIT"
] | null | null | null | -- drop this index. this is mistake.
DROP INDEX variant_id_UNIQUE ON wishlist_items;
| 28.333333 | 47 | 0.8 |
da995ee5ba15c9dd3c5d01f782d4b67d015cc49d | 2,941 | php | PHP | application/views/quiz/lembar_kerja.php | fitrahizulfalaq/miniquiz | 431662d670af63d26d38e6388ad099afc1460d8d | [
"MIT"
] | null | null | null | application/views/quiz/lembar_kerja.php | fitrahizulfalaq/miniquiz | 431662d670af63d26d38e6388ad099afc1460d8d | [
"MIT"
] | null | null | null | application/views/quiz/lembar_kerja.php | fitrahizulfalaq/miniquiz | 431662d670af63d26d38e6388ad099afc1460d8d | [
"MIT"
] | null | null | null | <section class="content">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<div class="card-header">
<a href="<?= base_url('quiz/menu')?>" class="btn btn-warning float-right btn-sm"><i class="fas fa-backward"></i> Kembali</a>
</div>
<div class="card card-success">
<div class="card-header">
<h3 class="card-title">Latihan Soal</h3>
<div class="card-tools">
<button type="button" class="btn btn-tool" data-card-widget="collapse" data-toggle="tooltip" title="Collapse">
<i class="fas fa-minus"></i></button>
<button type="button" class="btn btn-tool" data-card-widget="remove" data-toggle="tooltip" title="Remove">
<i class="fas fa-times"></i></button>
</div>
</div>
<div class="card-body">
<h5><strong>PETUNJUK PENGERJAAN:</strong></h5>
<ol start="1" type="1">
<li>Berdoalah sebelum mengerjakan soal.</li>
<li>Teliti soal terlebih dahulu, perangkat soal terdiri dari 25 soal pilihan ganda.</li>
<li>Untuk soal pilihan ganda, klik pada pilihan a, b, c, dan d pada jawaban yang Anda anggap benar.</li>
<li>Setelah semua pertanyaan selesai dijawab, nilai skor soal Pilihan Ganda secara otomatis akan langsung keluar </li>
</ol>
<hr>
<h5>Soal Pilihan Ganda</h5>
<?= form_open_multipart('quiz/quizResult')?>
<?php
$no = null;
foreach ($row->result() as $key => $dataso) {;
?>
<p class="text-black"><?= ++$no ?>. <?=$dataso->soal?></p>
<input type="hidden" name="id[]" value="<?=$dataso->id?>">
<input type="radio" name="pilihan[<?=$dataso->id?>]" value="A<?= $dataso->pil_a?>" required> A. <?= $dataso->pil_a?> <br>
<input type="radio" name="pilihan[<?=$dataso->id?>]" value="B<?= $dataso->pil_b?>"> B. <?= $dataso->pil_b?> <br>
<input type="radio" name="pilihan[<?=$dataso->id?>]" value="C<?= $dataso->pil_c?>"> C. <?= $dataso->pil_c?> <br>
<input type="radio" name="pilihan[<?=$dataso->id?>]" value="D<?= $dataso->pil_d?>"> D. <?= $dataso->pil_d?> <br>
<!-- <input type="radio" name="pilihan[<?=$dataso->id?>]" value="E<?= $dataso->pil_e?>"> E. <?= $dataso->pil_e?> <br> -->
<hr>
<?php }?>
<input type="hidden" name="jumlah" value="<?=$row->num_rows()?>">
<div class="text-center">
<button type="submit" class="btn btn-lg btn-flat btn-warning"><i class="fas fa-poll"></i><b> Nilai </b></button>
</div>
<?= form_close() ?>
</div>
<!-- /.card-body -->
</div>
</div>
</div>
</div><!-- /.container-fluid -->
</section>
<!-- /.content --> | 51.596491 | 144 | 0.509011 |
581d73c4c04208143c46215cc7dac21758ca658e | 792 | css | CSS | blog/style.css | bunsenmcdubbs/bunsenmcdubbs.github.io | 45ebb3563c25a13d4a03a22ffb536a615866c8c5 | [
"MIT"
] | 1 | 2017-12-19T08:43:35.000Z | 2017-12-19T08:43:35.000Z | blog/style.css | bunsenmcdubbs/bunsenmcdubbs.github.io | 45ebb3563c25a13d4a03a22ffb536a615866c8c5 | [
"MIT"
] | 8 | 2017-12-19T08:48:09.000Z | 2022-02-26T03:35:53.000Z | blog/style.css | bunsenmcdubbs/bunsenmcdubbs.github.io | 45ebb3563c25a13d4a03a22ffb536a615866c8c5 | [
"MIT"
] | null | null | null | /*.posts-1 > div:nth-of-type(1) > :first-child:before {
content: '[Latest Post]';
display: block;
font-family: Courier, monospace;
margin-bottom: .4em;
}*/
.entry {
margin-top: 1em;
box-sizing: border-box;
}
.quote blockquote:hover {
border-left-color: #357efc;
}
.quote blockquote p {
margin-top: 0;
}
.listing {
margin: 0;
font-size: 1.1em;
}
.excerpt {
display: block;
margin: .3em 0;
max-height: 6.5em;
overflow: hidden;
}
.excerpt p {
font-style: normal;
font-size: 100%;
margin: 0;
}
.excerpt img {
display: none;
}
/* paginator links */
.pagination {
text-align: center;
display: block;
margin: 1em auto 0 auto;
font-size: 20px;
}
.pagination a {
text-decoration: none;
}
.pagination .curr-page {
text-decoration: underline;
}
| 13.655172 | 55 | 0.633838 |
0dddbcc6eb91b47b923ac75dc61c08db9e1a094c | 1,004 | cs | C# | ICQ.Bot/Types/InputFiles/InputFileStream.cs | idan-rubin/icq.bot | 1b519a51bfb5c528a35aa60f4cbc739ed8c52567 | [
"MIT"
] | null | null | null | ICQ.Bot/Types/InputFiles/InputFileStream.cs | idan-rubin/icq.bot | 1b519a51bfb5c528a35aa60f4cbc739ed8c52567 | [
"MIT"
] | null | null | null | ICQ.Bot/Types/InputFiles/InputFileStream.cs | idan-rubin/icq.bot | 1b519a51bfb5c528a35aa60f4cbc739ed8c52567 | [
"MIT"
] | null | null | null | using System.IO;
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
using ICQ.Bot.Converters;
using ICQ.Bot.Types.Enums;
namespace ICQ.Bot.Types.InputFiles
{
[JsonObject(MemberSerialization.OptIn, NamingStrategyType = typeof(CamelCaseNamingStrategy))]
[JsonConverter(typeof(InputFileConverter))]
public class InputFileStream : IInputFile
{
public Stream Content { get; protected set; }
public string FileName { get; set; }
public virtual FileType FileType => FileType.Stream;
protected InputFileStream()
{ }
public InputFileStream(Stream content)
: this(content, default)
{ }
public InputFileStream(Stream content, string fileName)
{
Content = content;
FileName = fileName;
}
public static implicit operator InputFileStream(Stream stream) =>
stream == null
? default
: new InputFileStream(stream);
}
}
| 27.888889 | 97 | 0.640438 |
7f51864b58ad8578dc34d92f40aa9f419e1ed22b | 1,935 | rs | Rust | hexe_core/src/misc/extract.rs | nvzqz/Hexe | 632f16518d74c4981147c4726d717c905fa5051e | [
"Apache-2.0",
"MIT"
] | 29 | 2017-10-17T05:16:51.000Z | 2021-09-28T18:26:19.000Z | hexe_core/src/misc/extract.rs | nvzqz/Hexe | 632f16518d74c4981147c4726d717c905fa5051e | [
"Apache-2.0",
"MIT"
] | 6 | 2017-10-24T15:45:40.000Z | 2018-03-25T19:19:55.000Z | hexe_core/src/misc/extract.rs | nvzqz/Hexe | 632f16518d74c4981147c4726d717c905fa5051e | [
"Apache-2.0",
"MIT"
] | null | null | null | /// A type whose instances may be used to extract references from buffers.
///
/// All operations are non-panicking and cannot fail.
///
/// # Examples
///
/// Using tuples preserves the same order as normal indexing:
///
/// ```
/// use hexe_core::prelude::{Extract, Square};
///
/// let mut table: [[[u8; 64]; 64]; 64] = [
/// /* 256 KiB... */
/// # [[0; 64]; 64]; 64
/// ];
///
/// let s1 = Square::B5;
/// let s2 = Square::C8;
/// let s3 = Square::A4;
///
/// *(s1, s2, s3).extract_mut(&mut table) = 20;
///
/// let val = table[s1 as usize]
/// [s2 as usize]
/// [s3 as usize];
/// assert_eq!(val, 20);
/// ```
pub trait Extract<T: ?Sized> {
/// The output type.
type Output: ?Sized;
/// Extracts a reference to the value for `self` within `buf`.
fn extract(self, buf: &T) -> &Self::Output;
/// Extracts a mutable reference to the value for `self` within `buf`.
fn extract_mut(self, buf: &mut T) -> &mut Self::Output;
}
impl<T: ?Sized, A, B> Extract<T> for (A, B)
where
A: 'static + Extract<T>,
B: 'static + Extract<<A as Extract<T>>::Output>,
{
type Output = <B as Extract<<A as Extract<T>>::Output>>::Output;
#[inline]
fn extract(self, table: &T) -> &Self::Output {
self.1.extract(self.0.extract(table))
}
#[inline]
fn extract_mut(self, table: &mut T) -> &mut Self::Output {
self.1.extract_mut(self.0.extract_mut(table))
}
}
impl<T: ?Sized, A, B, C> Extract<T> for (A, B, C)
where
A: 'static,
B: 'static,
C: 'static,
((A, B), C): Extract<T>,
{
type Output = <((A, B), C) as Extract<T>>::Output;
#[inline]
fn extract(self, table: &T) -> &Self::Output {
((self.0, self.1), self.2).extract(table)
}
#[inline]
fn extract_mut(self, table: &mut T) -> &mut Self::Output {
((self.0, self.1), self.2).extract_mut(table)
}
}
| 25.460526 | 74 | 0.537984 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.