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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
52208d780563211c5b73ee784577490b8daa75b9 | 3,729 | swift | Swift | Sources/RomanNumerals/RomanNumeral.swift | danielctull-forks/RomanNumerals | 4cfdd8f5064431510045b8234c1144eeaf6a9cc4 | [
"BSD-3-Clause"
] | 1 | 2020-02-04T17:11:30.000Z | 2020-02-04T17:11:30.000Z | Sources/RomanNumerals/RomanNumeral.swift | danielctull-forks/RomanNumerals | 4cfdd8f5064431510045b8234c1144eeaf6a9cc4 | [
"BSD-3-Clause"
] | null | null | null | Sources/RomanNumerals/RomanNumeral.swift | danielctull-forks/RomanNumerals | 4cfdd8f5064431510045b8234c1144eeaf6a9cc4 | [
"BSD-3-Clause"
] | 1 | 2020-05-11T19:59:31.000Z | 2020-05-11T19:59:31.000Z |
public struct RomanNumeral: Equatable {
public let symbols: [Symbol]
}
extension RomanNumeral {
public init(_ symbols: Symbol...) {
self.symbols = symbols
}
}
extension RomanNumeral {
public init(_ string: String) throws {
symbols = try string.map(Symbol.init)
}
}
// MARK: - CustomStringConvertible
extension RomanNumeral: CustomStringConvertible {
public var description: String { String(self) }
}
// MARK: - Integer conversion
extension RomanNumeral {
public init(_ integer: Int) {
guard integer > 0 else {
symbols = []
return
}
var all = Symbol.allCases.sorted { Int($0) < Int($1) }
var symbols: [Symbol] = []
var previous: Symbol?
var remainder = 0
while let symbol = all.popLast() {
defer { previous = symbol }
remainder = integer % Int(symbol)
let amount = integer / Int(symbol)
guard amount > 0 else { continue }
// If symbol has 1, but the next has 4, then symbol == V, next == I,
// previous == X and this number is a 9. (Or equivalent for 900).
if amount == 1, let previous = previous, let next = all.last, remainder / Int(next) == 4 {
symbols.append(next)
symbols.append(previous)
remainder %= Int(next)
break
} else if amount <= 3 || symbol == .m {
symbols.append(contentsOf: Array(repeating: symbol, count: amount))
break
} else if let previous = previous {
symbols.append(symbol)
symbols.append(previous)
break
}
}
self.symbols = symbols + RomanNumeral(remainder).symbols
}
}
extension Int {
public init(_ numeral: RomanNumeral) {
struct Calculation {
var total: Int = 0
var value: Int = 0
var currentSymbol: Symbol = .i
}
let calculation = numeral
.symbols
.reduce(into: Calculation()) { caluclation, symbol in
defer { caluclation.currentSymbol = symbol }
let runningValue = caluclation.value
let previous = Int(caluclation.currentSymbol)
let current = Int(symbol)
if current > previous {
caluclation.value = current - runningValue
} else if current < previous {
caluclation.total += runningValue
caluclation.value = current
} else {
caluclation.value += current
}
}
self = calculation.total + calculation.value
}
}
extension String {
public init(_ numeral: RomanNumeral) {
self = numeral.symbols.reduce(into: "") { $0.append(String($1)) }
}
}
// MARK: - AdditiveArithmetic
extension RomanNumeral: AdditiveArithmetic {
public static let zero = RomanNumeral(symbols: [])
public static func += (lhs: inout RomanNumeral, rhs: RomanNumeral) {
// swiftlint:disable shorthand_operator
lhs = lhs + rhs
// swiftlint:enable shorthand_operator
}
public static func + (lhs: RomanNumeral, rhs: RomanNumeral) -> RomanNumeral {
RomanNumeral(Int(lhs) + Int(rhs))
}
public static func -= (lhs: inout RomanNumeral, rhs: RomanNumeral) {
// swiftlint:disable shorthand_operator
lhs = lhs - rhs
// swiftlint:enable shorthand_operator
}
public static func - (lhs: RomanNumeral, rhs: RomanNumeral) -> RomanNumeral {
RomanNumeral(Int(lhs) - Int(rhs))
}
}
| 26.446809 | 102 | 0.558058 |
7d5666b0b00b0c817a1a5830bb68b3a4b0ed6175 | 281 | dart | Dart | lib/models/time_table_item.dart | nowmozillaclub/eldersconnect-junior | 2de61aec58cadd253f7df6db6721b99f5ed776a5 | [
"MIT"
] | 5 | 2019-09-22T17:57:06.000Z | 2022-02-02T12:18:31.000Z | lib/models/time_table_item.dart | nowmozillaclub/eldersconnect-junior | 2de61aec58cadd253f7df6db6721b99f5ed776a5 | [
"MIT"
] | 10 | 2019-12-25T08:31:48.000Z | 2020-07-06T12:41:44.000Z | lib/models/time_table_item.dart | nowmozillaclub/eldersconnect-junior | 2de61aec58cadd253f7df6db6721b99f5ed776a5 | [
"MIT"
] | 1 | 2022-02-02T12:14:18.000Z | 2022-02-02T12:14:18.000Z | import 'package:flutter/material.dart';
enum Day {
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday,
Sunday,
}
class TimetableItem {
final String title;
final String time;
final List<dynamic> days;
TimetableItem({this.title, this.time, this.days});
} | 14.789474 | 52 | 0.697509 |
72bc5b83ba1cb13d6aa9a11c7ff9b273cf8ef777 | 580 | rs | Rust | crates/siro-web/src/subscription/map.rs | ubnt-intrepid/siro | dacb279159b5ecf9055c5ac15014e2db953bc70e | [
"Apache-2.0",
"MIT"
] | 2 | 2020-09-18T19:03:07.000Z | 2020-09-18T22:41:11.000Z | crates/siro-web/src/subscription/map.rs | ubnt-intrepid/siro | dacb279159b5ecf9055c5ac15014e2db953bc70e | [
"Apache-2.0",
"MIT"
] | 2 | 2020-10-12T09:00:44.000Z | 2020-10-23T09:06:07.000Z | crates/siro-web/src/subscription/map.rs | ubnt-intrepid/siro | dacb279159b5ecf9055c5ac15014e2db953bc70e | [
"Apache-2.0",
"MIT"
] | null | null | null | use super::Subscription;
use crate::env::Env;
use futures::prelude::*;
pub struct Map<S, F> {
subscription: S,
f: F,
}
impl<S, F> Map<S, F> {
pub(super) fn new(subscription: S, f: F) -> Self {
Self { subscription, f }
}
}
impl<S, F, TMsg> Subscription for Map<S, F>
where
S: Subscription,
F: FnMut(S::Msg) -> TMsg,
TMsg: 'static,
{
type Msg = TMsg;
type Stream = futures::stream::Map<S::Stream, F>;
fn subscribe(self, env: &Env) -> crate::Result<Self::Stream> {
Ok(self.subscription.subscribe(env)?.map(self.f))
}
}
| 20 | 66 | 0.581034 |
05ac3777b096a692b325c11cb7f0adfdcd240bc7 | 3,323 | rb | Ruby | lib/nrser/log/mixin.rb | nrser/nrser.rb | 7db9a729ec65894dfac13fd50851beae8b809738 | [
"MIT"
] | null | null | null | lib/nrser/log/mixin.rb | nrser/nrser.rb | 7db9a729ec65894dfac13fd50851beae8b809738 | [
"MIT"
] | 1 | 2018-03-20T06:04:29.000Z | 2018-03-20T06:04:29.000Z | lib/nrser/log/mixin.rb | nrser/nrser-ruby | 7db9a729ec65894dfac13fd50851beae8b809738 | [
"MIT"
] | null | null | null | # encoding: UTF-8
# frozen_string_literal: true
# Definitions
# =======================================================================
# Adaptation of {SemanticLogger::Loggable} mixin to use {NRSER::Log::Logger}
# instances from {NRSER::Log.[]}.
#
# Like {SemanticLogger::Loggable} adds class and instance `logger` and
# `logger=` methods that create loggers on demand and store them in the
# `@semantic_logger` instance variables.
#
module NRSER::Log::Mixin
# Methods to mix into the including class.
#
module ClassMethods
protected
# ========================================================================
def create_logger
NRSER::Log[self]
end
public # end protected ***************************************************
# Returns [SemanticLogger::Logger] class level logger
def logger
@semantic_logger ||= create_logger
end
# Replace instance class level logger
def logger= logger
@semantic_logger = logger
end
end
# Class Methods
# ========================================================================
def self.included base
base.extend ClassMethods
# Adds `.logger_measure_method`
base.extend SemanticLogger::Loggable::ClassMethods
end
# Instance Methods
# ========================================================================
# Gets the {NRSER::Log::Logger} for use in the instance. This will be the
# class logger from {ClassMethods#logger} unless the instance has a
# `#create_logger` method.
#
# The `#create_logger` method is expected to return a {NRSER::Log::Logger}
# instance, which will be saved in the `@semantic_logger` instance variable
# for future use.
#
# That method does not need to return a different logger for every instance
# - if you just want to have a different logger for *all* instance with a
# different level or formatter or whatever, you can save it somewhere else
# and always return that same instance.
#
# If you are dealing with frozen instances make sure to call `#logger` before
# you freeze (likely in the constructor). If you don't want to save the
# logger at all, just override this method itself.
#
# This is a departure from {SemanticLogger::Loggable} that started because
# if the instance is frozen then attempting to set `@semantic_logger` will
# raise an error.
#
# I also started ending up with classes that wanted to individually
# configure their loggers, so it seemed like we could take out two birds
# with this stone.
#
# @return [SemanticLogger::Logger]
# Instance level logger, if {ClassMethods.instance_logger?},
# otherwise the class level logger from {ClassMethods#logger}.
#
def logger
return @semantic_logger if @semantic_logger
if respond_to?( :create_logger, true )
@semantic_logger = begin
create_logger
rescue Exception => error
self.class.logger.warn \
"Error creating instance logger",
{ instance: self.inspect },
error
self.class.logger
end
else
self.class.logger
end
end
# Replace instance level logger
def logger= logger
@semantic_logger = logger
end
end # module NRSER::Log::Mixin
| 29.669643 | 79 | 0.605778 |
3f526cc39deca77e1f5cd9e4422f5b44c0ad0308 | 588 | php | PHP | Paylike_Payment/lib/Paylike/HttpClient/HttpClientInterface.php | k41l33n4/paylike-plugin-magento-1.9 | 6bc952280a7c9e213b1403a6b4d834131cd21693 | [
"MIT"
] | 1 | 2016-10-18T13:58:17.000Z | 2016-10-18T13:58:17.000Z | Paylike_Payment/lib/Paylike/HttpClient/HttpClientInterface.php | k41l33n4/paylike-plugin-magento-1.9 | 6bc952280a7c9e213b1403a6b4d834131cd21693 | [
"MIT"
] | 3 | 2016-10-19T11:31:38.000Z | 2020-09-16T12:49:33.000Z | Paylike_Payment/lib/Paylike/HttpClient/HttpClientInterface.php | k41l33n4/paylike-plugin-magento-1.9 | 6bc952280a7c9e213b1403a6b4d834131cd21693 | [
"MIT"
] | 8 | 2016-10-03T11:18:18.000Z | 2020-12-16T18:40:48.000Z | <?php
interface Paylike_HttpClient_HttpClientInterface
{
/**
* Performs the underlying HTTP request. It takes care of handling the
* connection errors, parsing the headers and the response body.
*
* @param string $http_verb The HTTP verb to use: get, post
* @param string $method The API method to be called
* @param array $args Assoc array of parameters to be passed
*
* @return Paylike_Response_ApiResponse
* @throws Paylike_Exception_ApiException
*/
public function request($http_verb, $method, $args = array());
} | 34.588235 | 74 | 0.680272 |
1a61964daeecbf75d58cc63a208867ad33339bd5 | 3,195 | cs | C# | Roguelike2/GameMechanics/EntityInteractionManager.cs | AnotherEpigone/rl2 | d67b4b761faa0fb4393325d28df4a31f8941a431 | [
"MIT"
] | null | null | null | Roguelike2/GameMechanics/EntityInteractionManager.cs | AnotherEpigone/rl2 | d67b4b761faa0fb4393325d28df4a31f8941a431 | [
"MIT"
] | null | null | null | Roguelike2/GameMechanics/EntityInteractionManager.cs | AnotherEpigone/rl2 | d67b4b761faa0fb4393325d28df4a31f8941a431 | [
"MIT"
] | null | null | null | using Roguelike2.Entities;
using Roguelike2.GameMechanics.Combat;
using Roguelike2.Maps;
using System.Linq;
namespace Roguelike2.GameMechanics
{
public class EntityInteractionManager
{
public EntityInteractionManager(IDungeonMaster dm, WorldMap map)
{
Dm = dm;
Map = map;
// TODO support registering new entities!
foreach (var actor in map.Entities.Items.OfType<Actor>().Append(Dm.Player))
{
actor.Bumped += Actor_Bumped;
actor.RemovedFromMap += Actor_RemovedFromMap;
}
}
private void Actor_RemovedFromMap(object sender, GoRogue.GameFramework.GameObjectCurrentMapChanged e)
{
var actor = (Actor)sender;
actor.Bumped -= Actor_Bumped;
actor.RemovedFromMap -= Actor_RemovedFromMap;
}
private void Actor_Bumped(object sender, EntityBumpedEventArgs e)
{
// TODO doors
//var bumpTriggeredComponent = Map.GetEntities<McEntity>(e.BumpedPosition)
// .SelectMany(e =>
// {
// if (!(e is McEntity entity))
// {
// return System.Array.Empty<IBumpTriggeredComponent>();
// }
//
// return entity.GetGoRogueComponents<IBumpTriggeredComponent>();
// })
// .FirstOrDefault();
//bumpTriggeredComponent?.Bump(e.BumpingEntity, _logManager, _dungeonMaster, _rng);
var attacker = e.BumpingEntity;
var defender = Map.GetEntityAt<Actor>(e.BumpedPosition);
if (attacker == null
|| defender == null
|| !Dm.FactMan.AreEnemies(attacker.FactionId, defender.FactionId))
{
return;
}
e.Outcome = BumpOutcome.Melee;
var hitResult = Dm.HitMan.GetAttackResult(attacker, defender);
var damage = Dm.HitMan.GetDamage(attacker, hitResult);
var defenderName = defender.Name;
switch (hitResult)
{
case AttackResult.Hit:
Dm.Logger.Gameplay($"{attacker.Name} hit {defenderName} for {damage:F0} damage.");
defender.ApplyDamage(damage, Dm.Logger);
break;
case AttackResult.Glance:
Dm.Logger.Gameplay($"{attacker.Name} hit {defenderName} with a glancing blow for {damage:F0} damage.");
defender.ApplyDamage(damage, Dm.Logger);
break;
case AttackResult.Miss:
Dm.Logger.Gameplay($"{attacker.Name} missed {defenderName}.");
break;
case AttackResult.Crit:
Dm.Logger.Gameplay($"{attacker.Name} hit {defenderName} with a critical hit for {damage:F0} damage.");
defender.ApplyDamage(damage, Dm.Logger);
break;
}
}
public IDungeonMaster Dm { get; }
public WorldMap Map { get; }
}
}
| 38.493976 | 123 | 0.535211 |
b31a1b920b7d2ae286d87e618add23ad0f9280c1 | 117 | py | Python | builder_engine/custom_components/__init__.py | DiablosWhisper/machine_learning_toolpack | 3f4b82b549a3d70b95fc7a2c01959cd99d2b88b9 | [
"Apache-2.0"
] | null | null | null | builder_engine/custom_components/__init__.py | DiablosWhisper/machine_learning_toolpack | 3f4b82b549a3d70b95fc7a2c01959cd99d2b88b9 | [
"Apache-2.0"
] | null | null | null | builder_engine/custom_components/__init__.py | DiablosWhisper/machine_learning_toolpack | 3f4b82b549a3d70b95fc7a2c01959cd99d2b88b9 | [
"Apache-2.0"
] | null | null | null | from .optimizers import *
from .callbacks import *
from .metrics import *
from .losses import *
from .layers import * | 23.4 | 25 | 0.752137 |
5b673569120cfa2378f24febe484a7771daf9b61 | 277 | sql | SQL | django_aggtrigg/databases/templates/pg_function_delete.sql | novafloss/django-aggtrigg | 3f3ca9fad9113ea1a2b23ecb655924ab16e7eebf | [
"BSD-3-Clause"
] | 16 | 2015-03-18T16:53:23.000Z | 2017-03-08T17:23:08.000Z | django_aggtrigg/databases/templates/pg_function_delete.sql | peopledoc/django-aggtrigg | 3f3ca9fad9113ea1a2b23ecb655924ab16e7eebf | [
"BSD-3-Clause"
] | 28 | 2015-03-13T15:01:56.000Z | 2017-03-24T09:27:40.000Z | django_aggtrigg/databases/templates/pg_function_delete.sql | peopledoc/django-aggtrigg | 3f3ca9fad9113ea1a2b23ecb655924ab16e7eebf | [
"BSD-3-Clause"
] | 1 | 2015-10-26T14:07:06.000Z | 2015-10-26T14:07:06.000Z | CREATE OR REPLACE FUNCTION {{name}} RETURNS TRIGGER AS $BODY$
BEGIN
{% if where_clause %}
IF {{where_clause}} THEN
{% endif %}
UPDATE {{table}} SET {{actions}} WHERE {{column}}=OLD.{{column}};
{% if where_clause %}
END IF;
{% endif %}
RETURN NEW;
END;
$BODY$ LANGUAGE plpgsql;
| 21.307692 | 65 | 0.66787 |
c091e72298f2711c0b840d8b420ab31c5e114d53 | 5,029 | cs | C# | PSP_EMU/memory/MemoryReaderWriter.cs | xXxTheDarkprogramerxXx/PSPSHARP | 844cc2f8efbf2c173e8a2884e892d73392ead437 | [
"MIT"
] | 4 | 2018-09-17T14:50:15.000Z | 2021-12-27T16:39:11.000Z | PSP_EMU/memory/MemoryReaderWriter.cs | xXxTheDarkprogramerxXx/PSPSHARP | 844cc2f8efbf2c173e8a2884e892d73392ead437 | [
"MIT"
] | null | null | null | PSP_EMU/memory/MemoryReaderWriter.cs | xXxTheDarkprogramerxXx/PSPSHARP | 844cc2f8efbf2c173e8a2884e892d73392ead437 | [
"MIT"
] | 5 | 2019-07-03T13:59:07.000Z | 2020-07-15T12:27:07.000Z | /*
pspsharp is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
pspsharp is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with pspsharp. If not, see <http://www.gnu.org/licenses/>.
*/
namespace pspsharp.memory
{
using RuntimeContext = pspsharp.Allegrex.compiler.RuntimeContext;
/// <summary>
/// @author gid15
///
/// </summary>
public class MemoryReaderWriter
{
private static IMemoryReaderWriter getFastMemoryReaderWriter(int address, int step)
{
int[] memoryInt = RuntimeContext.MemoryInt;
// Implement the most common cases with dedicated classes.
switch (step)
{
case 2:
return new MemoryReaderWriterIntArray16(memoryInt, address);
case 4:
return new MemoryReaderWriterIntArray32(memoryInt, address);
}
// No dedicated class available, use the generic one.
return new MemoryReaderWriterGeneric(address, step);
}
public static IMemoryReaderWriter getMemoryReaderWriter(int address, int Length, int step)
{
address &= Memory.addressMask;
if (RuntimeContext.hasMemoryInt())
{
return getFastMemoryReaderWriter(address, step);
}
// No dedicated class available, use the generic one.
return new MemoryReaderWriterGeneric(address, Length, step);
}
public static IMemoryReaderWriter getMemoryReaderWriter(int address, int step)
{
address &= Memory.addressMask;
if (RuntimeContext.hasMemoryInt())
{
return getFastMemoryReaderWriter(address, step);
}
// No dedicated class available, use the generic one.
return new MemoryReaderWriterGeneric(address, step);
}
private sealed class MemoryReaderWriterGeneric : IMemoryReaderWriter
{
internal IMemoryReader memoryReader;
internal IMemoryWriter memoryWriter;
internal int currentValue;
public MemoryReaderWriterGeneric(int address, int Length, int step)
{
memoryReader = MemoryReader.getMemoryReader(address, Length, step);
memoryWriter = MemoryWriter.getMemoryWriter(address, Length, step);
currentValue = memoryReader.readNext();
}
public MemoryReaderWriterGeneric(int address, int step)
{
memoryReader = MemoryReader.getMemoryReader(address, step);
memoryWriter = MemoryWriter.getMemoryWriter(address, step);
currentValue = memoryReader.readNext();
}
public void writeNext(int value)
{
memoryWriter.writeNext(value);
currentValue = memoryReader.readNext();
}
public void skip(int n)
{
if (n > 0)
{
memoryWriter.skip(n);
memoryReader.skip(n - 1);
currentValue = memoryReader.readNext();
}
}
public void flush()
{
memoryWriter.flush();
}
public int CurrentAddress
{
get
{
return memoryWriter.CurrentAddress;
}
}
public int readCurrent()
{
return currentValue;
}
}
private sealed class MemoryReaderWriterIntArray32 : IMemoryReaderWriter
{
internal int offset;
internal readonly int[] buffer;
public MemoryReaderWriterIntArray32(int[] buffer, int addr)
{
offset = addr >> 2;
this.buffer = buffer;
}
public void writeNext(int value)
{
buffer[offset++] = value;
}
public void skip(int n)
{
offset += n;
}
public void flush()
{
}
public int CurrentAddress
{
get
{
return offset << 2;
}
}
public int readCurrent()
{
return buffer[offset];
}
}
private sealed class MemoryReaderWriterIntArray16 : IMemoryReaderWriter
{
internal int index;
internal int offset;
internal int value;
internal readonly int[] buffer;
public MemoryReaderWriterIntArray16(int[] buffer, int addr)
{
this.buffer = buffer;
offset = addr >> 2;
index = (addr >> 1) & 1;
if (index != 0)
{
value = buffer[offset] & 0x0000FFFF;
}
}
public void writeNext(int n)
{
if (index == 0)
{
value = n & 0xFFFF;
index = 1;
}
else
{
buffer[offset++] = (n << 16) | value;
index = 0;
}
}
public void skip(int n)
{
if (n > 0)
{
flush();
index += n;
offset += index >> 1;
index &= 1;
if (index != 0)
{
value = buffer[offset] & 0x0000FFFF;
}
}
}
public void flush()
{
if (index != 0)
{
buffer[offset] = (buffer[offset] & unchecked((int)0xFFFF0000)) | value;
}
}
public int CurrentAddress
{
get
{
return (offset << 2) + (index << 1);
}
}
public int readCurrent()
{
if (index == 0)
{
return buffer[offset] & 0xFFFF;
}
return (int)((uint)buffer[offset] >> 16);
}
}
}
} | 21.4 | 92 | 0.655399 |
6da8e234e29386a027f34e42d8677a09bbbf02b8 | 1,633 | h | C | tcpp/minion2/minion/constraints/constraint_gacalldiff.h | Behrouz-Babaki/TCPP-chuffed | d832b44690914ef4b73d71bc7e565efb98e42937 | [
"MIT"
] | 1 | 2021-09-09T13:03:02.000Z | 2021-09-09T13:03:02.000Z | tcpp/minion2/minion/constraints/constraint_gacalldiff.h | Behrouz-Babaki/TCPP-chuffed | d832b44690914ef4b73d71bc7e565efb98e42937 | [
"MIT"
] | null | null | null | tcpp/minion2/minion/constraints/constraint_gacalldiff.h | Behrouz-Babaki/TCPP-chuffed | d832b44690914ef4b73d71bc7e565efb98e42937 | [
"MIT"
] | null | null | null | /*
* Minion http://minion.sourceforge.net
* Copyright (C) 2006-09
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*/
/** @help constraints;gacalldiff Description
Forces the input vector of variables to take distinct values.
*/
/** @help constraints;gacalldiff Example
Suppose the input file had the following vector of variables defined:
DISCRETE myVec[9] {1..9}
To ensure that each variable takes a different value include the
following constraint:
gacalldiff(myVec)
*/
/** @help constraints;gacalldiff Notes
This constraint enforces generalized arc consistency.
*/
#ifndef CONSTRAINT_GACALLDIFF_H
#define CONSTRAINT_GACALLDIFF_H
#include "alldiff_common.h"
template <typename VarArray>
AbstractConstraint* BuildCT_GACALLDIFF(const VarArray& var_array, ConstraintBlob&) {
return new GacAlldiffConstraint<VarArray>(var_array);
}
/* JSON
{ "type": "constraint",
"name": "gacalldiff",
"internal_name": "CT_GACALLDIFF",
"args": [ "read_list" ]
}
*/
#endif
| 28.155172 | 84 | 0.7624 |
d91fcff956bea76504033a73e248358a64b6b2d0 | 1,497 | dart | Dart | lib/src/widgets/src/packages/flutter/src/scheduler/binding.dart | xsoap/MXFlutter | 4ef8373a19ad1b4113af42d6eebd34d092026c68 | [
"MIT"
] | null | null | null | lib/src/widgets/src/packages/flutter/src/scheduler/binding.dart | xsoap/MXFlutter | 4ef8373a19ad1b4113af42d6eebd34d092026c68 | [
"MIT"
] | null | null | null | lib/src/widgets/src/packages/flutter/src/scheduler/binding.dart | xsoap/MXFlutter | 4ef8373a19ad1b4113af42d6eebd34d092026c68 | [
"MIT"
] | null | null | null | // Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:mxflutter/src/mirror/mx_mirror.dart';
import 'package:flutter/src/scheduler/binding.dart';
import 'dart:async';
import 'dart:collection';
import 'dart:developer';
import 'dart:ui';
import 'package:collection/collection.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/src/scheduler/debug.dart';
import 'package:flutter/src/scheduler/priority.dart';
///把自己能处理的类注册到分发器中
Map<String, MXFunctionInvoke> registerBindingSeries() {
var m = <String, MXFunctionInvoke>{};
m[_schedulerPhase.funName] = _schedulerPhase;
return m;
}
var _schedulerPhase = MXFunctionInvoke(
"SchedulerPhase",
({String name, int index}) => MXSchedulerPhase.parse(name, index),
["name", "index"]
);class MXSchedulerPhase {
static SchedulerPhase parse(String name, int index) {
switch(name) {
case 'SchedulerPhase.idle':
return SchedulerPhase.idle;
case 'SchedulerPhase.transientCallbacks':
return SchedulerPhase.transientCallbacks;
case 'SchedulerPhase.midFrameMicrotasks':
return SchedulerPhase.midFrameMicrotasks;
case 'SchedulerPhase.persistentCallbacks':
return SchedulerPhase.persistentCallbacks;
case 'SchedulerPhase.postFrameCallbacks':
return SchedulerPhase.postFrameCallbacks;
}
return null;
}
}
| 34.813953 | 79 | 0.741483 |
f182aea5c67b1eca767315faed9a4888a5a13ba1 | 1,925 | rb | Ruby | lib/qcloud_cos/http.rb | zlx/qcloud-cos-sdk | e3e1035f7e02df38868f443a9f9864e88a54359c | [
"Apache-2.0"
] | 10 | 2016-03-17T12:38:44.000Z | 2020-03-06T09:39:44.000Z | lib/qcloud_cos/http.rb | zlx/qcloud-cos-sdk | e3e1035f7e02df38868f443a9f9864e88a54359c | [
"Apache-2.0"
] | 1 | 2018-08-17T07:14:11.000Z | 2018-08-17T07:14:11.000Z | lib/qcloud_cos/http.rb | zlx/qcloud-cos-sdk | e3e1035f7e02df38868f443a9f9864e88a54359c | [
"Apache-2.0"
] | 10 | 2016-08-30T23:38:08.000Z | 2020-09-13T03:23:14.000Z | require 'httparty'
require 'httmultiparty'
require 'addressable/uri'
require 'qcloud_cos/error'
module QcloudCos
class Http
include HTTParty
include HTTMultiParty
attr_reader :config
def initialize(config)
@config = config
end
def get(url, options = {})
request('GET', url, options)
end
def post(url, options = {})
request('POST', url, options)
end
private
def request(verb, url, options = {})
query = options.fetch(:query, {})
headers = options.fetch(:headers, {})
body = options.delete(:body)
append_headers!(headers, verb, body, options)
options = { headers: headers, query: query, body: body }
append_options!(options, url)
wrap(self.class.__send__(verb.downcase, url, options))
end
def wrap(response)
if response.code == 200 && response.parsed_response['code'] == 0
response
else
fail RequestError, response
end
end
def append_headers!(headers, _verb, body, _options)
append_default_headers!(headers)
append_body_headers!(headers, body)
end
def append_options!(options, url)
options.merge!(uri_adapter: Addressable::URI)
if config.ssl_ca_file
options.merge!(ssl_ca_file: config.ssl_ca_file)
elsif url.start_with?('https://')
options.merge!(verify_peer: true)
end
end
def append_default_headers!(headers)
headers.merge!(default_headers)
end
def append_body_headers!(headers, body)
headers.merge!('Content-Length' => Utils.content_size(body).to_s) if body
end
def default_headers
{
'User-Agent' => user_agent,
'Host' => 'web.file.myqcloud.com'
}
end
def user_agent
"qcloud-cos-sdk-ruby/#{QcloudCos::VERSION} " \
"(#{RbConfig::CONFIG['host_os']} ruby-#{RbConfig::CONFIG['ruby_version']})"
end
end
end
| 23.47561 | 81 | 0.632727 |
f5d52f339c55c05332a18cf6fc191fca4b4f71be | 7,947 | css | CSS | Homework11/build/css/styles.min.css | Alexandr0207/Bootcamp8 | 4c1da03e60acb5a7714728b52e3ec6b5a2d5be14 | [
"MIT"
] | null | null | null | Homework11/build/css/styles.min.css | Alexandr0207/Bootcamp8 | 4c1da03e60acb5a7714728b52e3ec6b5a2d5be14 | [
"MIT"
] | null | null | null | Homework11/build/css/styles.min.css | Alexandr0207/Bootcamp8 | 4c1da03e60acb5a7714728b52e3ec6b5a2d5be14 | [
"MIT"
] | null | null | null | /*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */@import url("https://fonts.googleapis.com/css?family=Montserrat:400,700");@import url("https://fonts.googleapis.com/css?family=Roboto:300,400");@import url("https://fonts.googleapis.com/css?family=Kaushan+Script");*{margin:0;padding:0}html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}.bg{background:url(../img/bg.png),linear-gradient(0deg,hsla(47,95%,76%,.9) 0,hsla(0,83%,73%,.9));background-repeat:no-repeat;background-size:cover;background-blend-mode:lighten;height:1000px}.header-navigation{width:1200px;margin:0 auto;display:flex;justify-content:space-between;padding-top:24px;margin-bottom:150px}.header-navigation__link{text-decoration:none;display:flex}.header-navigation__title{font-family:Montserrat,sans-serif;font-size:30px;font-weight:700;align-self:center;text-transform:capitalize;color:#fff;margin-left:15px}.header-navigation__img{padding:25px 0 0 10px}.header-menu{display:flex;justify-content:space-between;list-style:none;align-items:center}.header-menu__item{position:relative;margin-left:55px}.header-menu__link{text-decoration:none;font-size:20px;text-transform:uppercase;font-family:Roboto,sans-serif;font-size:14px;font-weight:400;color:#fff}.header-menu__link:after{content:"";width:100%;height:3px;background-color:#fce38a;display:none;position:absolute;margin-top:12px}.header-menu__link:hover:after{display:block}.header-menu__link:hover{color:#fce38a}.header-menu .cls-1{display:block;margin:0 auto;width:1.125rem;fill:#fff;height:.9375rem;fill-rule:evenodd}.header-menu .cls-1:hover{fill:#fce38a}.header .template__title{font-size:72px;font-style:normal;text-align:center;font-weight:400;color:#fff;font-family:Kaushan Script,cursive;margin-bottom:50px}.header .template__list{margin:0 auto;width:820px;line-height:1;font-size:150px;text-align:right;margin-bottom:124px}.header .template__list,.header .template__submit{text-transform:uppercase;font-weight:700;color:#fff;font-family:Montserrat,sans-serif}.header .template__submit{padding:14px 32px;display:block;margin:auto;background-color:transparent;border:4px solid #fff;font-size:14px;outline:none;margin-bottom:205px}.main{width:1200px;margin:0 auto}.main-karta{display:flex;justify-content:space-around;flex-wrap:wrap}.main-nav{padding-top:50px;display:block;margin:auto;text-align:center}.main-nav__work{font-size:24px;font-family:Kaushan Script,cursive;padding-bottom:22px;font-weight:400;color:#333}.main-nav__list{font-size:30px;font-family:Montserrat,sans-serif;text-transform:uppercase;color:#333;margin-bottom:111px;position:relative}.main-nav__list:after{content:"";width:60px;height:3px;background-color:#f38181;display:block;margin:auto;top:45px;position:relative;margin-bottom:66px}.main-item{display:flex}.main-item__icon{padding-top:12px;width:32px;fill:#95e1d3;height:32px}.main-caption{width:252px;padding-left:28px}.main-caption__block{font-size:14px;padding-bottom:8px;color:#333;text-transform:uppercase;font-family:Montserrat,sans-serif;font-weight:700}.main-caption__title{font-size:15px;color:#b6b6b6;width:284px;line-height:1.7;font-family:Roboto,sans-serif;margin-bottom:101px}.main-foot{display:block;margin:auto;text-align:center}.main-foot__work{font-size:24px;font-family:Kaushan Script,cursive;padding-bottom:22px;font-weight:400;color:#333}.main-foot__list{font-size:30px;font-family:Montserrat,sans-serif;text-transform:uppercase;color:#333;margin-bottom:91px;position:relative}.main-foot__list:after{content:"";width:60px;height:3px;background-color:#f38181;display:block;margin:auto;top:45px;position:relative;margin-bottom:66px}.main-foot__text{width:955px;display:block;line-height:1.4;margin:0 auto;font-size:15px;color:#b6b6b6;font-family:Roboto,sans-serif;margin-bottom:90px}.main .pen-title{list-style:none;justify-content:space-between;display:flex}.main .pen-title,.main .pen-title__foot--glav{position:relative}.main .pen-title__foot--glav:hover{transition:transform 5.02s linear;transform:translate(-10px,-10px)}.main .pen-title__foot--glav:hover>.pen-title__foot--pen{display:flex}.main .pen-title__foot--name{display:block;margin:0 auto;font-size:14px;margin-top:30px;color:#333;font-family:Montserrat,sans-serif;font-weight:700;text-transform:uppercase;text-align:center;margin-bottom:15px}.main .pen-title__foot--lads{list-style:none}.main .pen-title__foot--info{display:block;margin:0 auto;font-weight:400;color:#b3b3b3;font-style:italic;font-family:Roboto,sans-serif;font-size:15px;margin-bottom:95px;text-align:center}.main .pen-title__foot--pen{position:absolute;display:none;top:0;padding:209px 78px;left:0;background:linear-gradient(90deg,hsla(47,95%,76%,.9),hsla(0,83%,73%,.9));box-shadow:10px 10px 0 0 #95e1d3}.main .pen-title__foot--icon:hover{background:#f38181}.main .pen-title__foot--icon:hover .pen-title__foot--icon__icons-fb,.main .pen-title__foot--icon:hover .pen-title__foot--icon__icons-inst,.main .pen-title__foot--icon:hover .pen-title__foot--icon__icons-pt,.main .pen-title__foot--icon:hover .pen-title__foot--icon__icons-tw{fill:#fff}.main .pen-title__foot--icon{width:56px;height:56px;list-style:none;position:relative;margin-left:1px;background:#fce38a}.main .pen-title__foot--icon__icons-fb{width:13px;height:26px;fill:#f38181;position:absolute;top:25%;left:40%}.main .pen-title__foot--icon__icons-tw{width:26px;height:22px;fill:#f38181;position:absolute;top:30%;left:30%}.main .pen-title__foot--icon__icons-pt{width:21px;height:26px;fill:#f38181;position:absolute;top:25%;left:30%}.main .pen-title__foot--icon__icons-inst{width:26px;height:26px;fill:#f38181;position:absolute;top:25%;left:30%}.nav-footer{width:1200px;margin:0 auto;border-top:1px solid #e5e5e5;display:flex;justify-content:space-between}.nav-footer__title{padding-top:23px;padding-bottom:24px;font-size:15px;font-family:Roboto,sans-serif;font-style:normal;font-weight:400}.nav-footer .smena{color:#f38181}.nav-footer .comment{display:flex;align-items:flex-end;padding:2px;font-family:Roboto,sans-serif;font-size:16px;line-height:2}.nav-footer .com{display:flex;align-items:center}.nav-footer .submit{width:150px;height:40px;font-size:14px;background:#95e1d3;font-family:Montserrat,sans-serif;font-weight:700;color:#fff;border:1px solid #95e1d3} | 7,947 | 7,947 | 0.808607 |
b134e28841664d7678929ab935050a6724f1a42e | 6,227 | lua | Lua | resources_custom/[FAROESTE]/[SYSTEM]/frp_identity/client.lua | BlockHander/frp-lua-rdr3-legacy | 42dcf1139fb955512fe57af38ff7eb13f359ba56 | [
"MIT"
] | null | null | null | resources_custom/[FAROESTE]/[SYSTEM]/frp_identity/client.lua | BlockHander/frp-lua-rdr3-legacy | 42dcf1139fb955512fe57af38ff7eb13f359ba56 | [
"MIT"
] | null | null | null | resources_custom/[FAROESTE]/[SYSTEM]/frp_identity/client.lua | BlockHander/frp-lua-rdr3-legacy | 42dcf1139fb955512fe57af38ff7eb13f359ba56 | [
"MIT"
] | null | null | null | local Tunnel = module("_core", "lib/Tunnel")
local Proxy = module("_core", "lib/Proxy")
cAPI = Proxy.getInterface("API")
API = Tunnel.getInterface("API")
local fakePeds = {}
RegisterCommand("selectcid", function(source, args)
print(args, args[1])
SetNuiFocus(false, false)
DisplayHud(true)
TriggerServerEvent("FRP:IDENTITY:selectCharacter", args[1])
cAPI.StartFade(500)
Citizen.Wait(500)
SendNUIMessage({type = 3})
Destroy()
NetworkSetEntityInvisibleToNetwork(PlayerPedId(), false)
SetEntityInvincible(PlayerPedId(), false)
Wait(1800)
cAPI.EndFade(500)
end, false)
RegisterCommand("createchar", function(source, args)
SetNuiFocus(false, false)
TriggerEvent("FRP:CHARCREATION:starting")
SendNUIMessage({type = 3})
Destroy()
end, false)
RegisterNetEvent("FRP:IDENTITY:DisplayCharSelection")
AddEventHandler(
"FRP:IDENTITY:DisplayCharSelection",
function(characterArray, charAppearence)
Destroy()
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
-- O characterARRAY tá enviando TODA INFORMAÇÃO DO CHARACTER
cAPI.PlayerAsInitialized(false)
ShutdownLoadingScreen()
createCamera()
SendNUIMessage({type = 2}) -- clear UI
Wait(2500)
SetNuiFocus(true, true)
SendNUIMessage(
{
type = 1,
list = characterArray
}
)
local fakePedCoords = {
vec3(1062.20, 1591.10, 369.42 - 0.98),
vec3(1061.10, 1591.20, 369.36 - 0.98)
}
if charAppearence ~= nil then
for i = 1, #charAppearence do
if not HasModelLoaded(charAppearence[i][1].model) then
RequestModel(charAppearence[i][1].model)
while not HasModelLoaded(charAppearence[i][1].model) do
Citizen.Wait(10)
end
end
local ped = CreatePed(charAppearence[i][1].model, fakePedCoords[i], 350.77, 0, 0)
Citizen.Wait(300)
cAPI.SetSkin(ped, charAppearence[i][1].enabledComponents)
cAPI.SetPedFaceFeature(ped, charAppearence[i][1].faceFeatures)
cAPI.SetPedScale(ped, charAppearence[i][1].pedHeight)
if charAppearence[i][1].clothes ~= nil then
cAPI.SetSkin(ped, charAppearence[i][1].clothes)
end
table.insert(fakePeds, ped)
end
end
end
)
function Destroy()
for _, ped in pairs(fakePeds) do
DeleteEntity(ped)
end
if cam ~= nil then
if DoesCamExist(cam) then
DestroyCam(cam, true)
end
end
FreezeEntityPosition(PlayerPedId(), false)
fakePeds = {}
end
RegisterNUICallback(
"createCharacter",
function()
SetNuiFocus(false, false)
TriggerEvent("FRP:CHARCREATION:starting")
Destroy()
end
)
RegisterNUICallback(
"selectCharacter",
function(id)
SetNuiFocus(false, false)
DisplayHud(true)
TriggerServerEvent("FRP:IDENTITY:selectCharacter", id)
cAPI.StartFade(500)
Citizen.Wait(500)
Destroy()
NetworkSetEntityInvisibleToNetwork(PlayerPedId(), false)
SetEntityInvincible(PlayerPedId(), false)
Wait(1800)
cAPI.EndFade(500)
end
)
RegisterNUICallback(
"deleteCharacter",
function(id)
TriggerServerEvent("FRP:IDENTITY:deleteCharacter", id)
TriggerEvent("FRP:NOTIFY:Simple", "Personagem deletado.")
end
)
RegisterCommand(
"Deletarenti",
function()
print("deletou")
Destroy()
end
)
RegisterCommand("charselect", function(source)
TriggerServerEvent('FRP:IDENTITY:loadCharacterSelection', source)
end)
function createCamera()
DisplayHud(false)
NetworkSetEntityInvisibleToNetwork(PlayerPedId(), true)
SetEntityInvincible(PlayerPedId(), true)
SetEntityCoords(PlayerPedId(), 1060.94, 1597.82, 373.00)
FreezeEntityPosition(PlayerPedId(), true)
cam = CreateCamWithParams("DEFAULT_SCRIPTED_CAMERA", 1062.48, 1592.20, 369.79, -10.00, 0.00, 168.00, 95.00, false, 0) -- CAMERA COORDS
PointCamAtCoord(cam, 1062.48, 1592.20, 369.79)
SetCamActive(cam, true)
RenderScriptCams(true, false, 1, true, true)
end
AddEventHandler(
"onResourceStop",
function(resourceName)
if resourceName == GetCurrentResourceName() or resourceName == "_core" then
Destroy()
end
end
)
| 30.52451 | 138 | 0.643649 |
f4accf73ded82a4ea5e7e1c6dbd695b046bf3ea7 | 2,111 | tsx | TypeScript | src/components/match/VerifyCompleteInnings.tsx | ChrisDobby/cricket-scorer | 7c0d8e99211010135fd295810335dffd72d99854 | [
"Apache-2.0"
] | 2 | 2020-04-03T17:15:49.000Z | 2021-01-22T14:25:59.000Z | src/components/match/VerifyCompleteInnings.tsx | ChrisDobby/cricket-scorer | 7c0d8e99211010135fd295810335dffd72d99854 | [
"Apache-2.0"
] | 20 | 2019-03-05T10:56:49.000Z | 2022-03-08T22:47:42.000Z | src/components/match/VerifyCompleteInnings.tsx | ChrisDobby/cricket-scorer | 7c0d8e99211010135fd295810335dffd72d99854 | [
"Apache-2.0"
] | null | null | null | import * as React from 'react';
import Dialog from '@material-ui/core/Dialog';
import DialogTitle from '@material-ui/core/DialogTitle';
import DialogContent from '@material-ui/core/DialogContent';
import DialogContentText from '@material-ui/core/DialogContentText';
import DialogActions from '@material-ui/core/DialogActions';
import Button from '@material-ui/core/Button';
import Select from '@material-ui/core/Select';
import MenuItem from '@material-ui/core/MenuItem';
import { InningsStatus } from '../../domain';
interface VerifyCompleteInningsProps {
complete: (status: InningsStatus) => void;
cancel: () => void;
}
export default (props: VerifyCompleteInningsProps) => {
const [status, setStatus] = React.useState(InningsStatus.Declared);
return (
<div>
<Dialog open={true} aria-labelledby="complete-innings-title">
<DialogTitle id="complete-innings-title">Complete innings</DialogTitle>
<DialogContent>
<DialogContentText>
{'Select the reason for completing the innings followed by ' +
'OK or Cancel to not complete the innings'}
</DialogContentText>
</DialogContent>
<DialogContent>
<Select value={status} onChange={ev => setStatus(Number(ev.target.value))} fullWidth>
<MenuItem value={InningsStatus.Declared}>Declared</MenuItem>
<MenuItem value={InningsStatus.AllOut}>All out</MenuItem>
<MenuItem value={InningsStatus.OversComplete}>Overs complete</MenuItem>
</Select>
</DialogContent>
<DialogActions>
<Button onClick={() => props.complete(status)} color="primary" autoFocus>
OK
</Button>
<Button onClick={props.cancel} color="primary">
Cancel
</Button>
</DialogActions>
</Dialog>
</div>
);
};
| 43.081633 | 105 | 0.582662 |
efafec768ec199cd0b2f6f5611c70b8f7331b708 | 112 | rs | Rust | arch/x86_64/src/kernel/video/vga/vga_80x25.rs | rdmcmillan/novusk | 34c3b6c9fda0fc1c6328ad9df81ecd380b2b9543 | [
"MIT"
] | 65 | 2021-01-01T06:28:41.000Z | 2022-02-09T02:56:11.000Z | arch/x86_64/src/kernel/video/vga/vga_80x25.rs | nerdyguy87/novusk | 42558bad8a900cd9ce149aa63fc0eb0035d827a7 | [
"MIT"
] | 19 | 2021-03-05T17:53:49.000Z | 2022-01-13T13:30:41.000Z | arch/x86_64/src/kernel/video/vga/vga_80x25.rs | nerdyguy87/novusk | 42558bad8a900cd9ce149aa63fc0eb0035d827a7 | [
"MIT"
] | 8 | 2021-02-21T23:34:31.000Z | 2022-01-27T04:27:21.000Z | pub const BUFFER_WIDTH: usize = 80;
pub const BUFFER_HEIGHT: usize = 25;
pub const VGA_ADDRESS: usize = 0xb8000; | 37.333333 | 39 | 0.767857 |
ef0018ccb94939782bb8dd87dd76ca13f9b12043 | 431 | h | C | include/Ess3D/3d/model/Model.h | essar05/Ess3D | 0c3c648bf4d6b92d47c1acf1d51eca592ffe7e95 | [
"MIT"
] | 2 | 2019-05-28T12:00:00.000Z | 2020-09-03T11:51:50.000Z | include/Ess3D/3d/model/Model.h | essar05/Ess3D | 0c3c648bf4d6b92d47c1acf1d51eca592ffe7e95 | [
"MIT"
] | null | null | null | include/Ess3D/3d/model/Model.h | essar05/Ess3D | 0c3c648bf4d6b92d47c1acf1d51eca592ffe7e95 | [
"MIT"
] | 1 | 2019-05-28T12:00:08.000Z | 2019-05-28T12:00:08.000Z | #pragma once
#include <Ess3D/definitions.h>
#include <Ess3D/gl/Shader.h>
#include <Ess3D/3d/model/Mesh.h>
#include <utility>
#include <vector>
namespace Ess3D {
class API Model {
public:
explicit Model(std::string id) : _id(std::move(id)) {}
void render(Shader* shader);
void initialize();
void addMesh(Mesh* mesh);
private:
std::string _id;
std::vector<Mesh*> _meshes;
};
}
| 16.576923 | 61 | 0.62413 |
5be7d91b03ef0ac3e86ae4afd310fb0a19fa1d86 | 1,566 | css | CSS | rvsscan2.0/WebContent/css/lte-style.css | fangke-ray/RVS-OGZ | 733365cb6af455c7bc977eb6867b21c41d25fc42 | [
"Apache-2.0"
] | null | null | null | rvsscan2.0/WebContent/css/lte-style.css | fangke-ray/RVS-OGZ | 733365cb6af455c7bc977eb6867b21c41d25fc42 | [
"Apache-2.0"
] | null | null | null | rvsscan2.0/WebContent/css/lte-style.css | fangke-ray/RVS-OGZ | 733365cb6af455c7bc977eb6867b21c41d25fc42 | [
"Apache-2.0"
] | 2 | 2019-03-01T02:27:57.000Z | 2019-06-13T12:32:34.000Z | @font-face {
font-family: 'icomoon';
src:url('fonts/icomoon.eot');
src:url('fonts/icomoon.eot?#iefix') format('embedded-opentype'),
url('fonts/icomoon.woff') format('woff'),
url('fonts/icomoon.ttf') format('truetype'),
url('fonts/icomoon.svg#icomoon') format('svg');
font-weight: normal;
font-style: normal;
}
/* Use the following CSS code if you want to use data attributes for inserting your icons */
[data-icon]:before {
font-family: 'icomoon';
content: attr(data-icon);
speak: none;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
}
/* Use the following CSS code if you want to have a class per icon */
/*
Instead of a list of all class selectors,
you can use the generic selector below, but it's slower:
[class*="icon-"] {
*/
.icon-film, .icon-map, .icon-office, .icon-earth, .icon-location, .icon-play, .icon-pause, .icon-stop, .icon-x-altx-alt, .icon-eject {
font-family: 'icomoon';
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
-webkit-font-smoothing: antialiased;
}
.icon-film:before {
content: "\e000";
}
.icon-map:before {
content: "\e001";
}
.icon-office:before {
content: "\e002";
}
.icon-earth:before {
content: "\e003";
}
.icon-location:before {
content: "\e004";
}
.icon-play:before {
content: "\e005";
}
.icon-pause:before {
content: "\e006";
}
.icon-stop:before {
content: "\e007";
}
.icon-x-altx-alt:before {
content: "\e008";
}
.icon-eject:before {
content: "\e009";
}
| 22.371429 | 134 | 0.678799 |
44703fdce6aac0f2688aaf5f9ec6e514f85d4eba | 394 | py | Python | seo/proxies.py | ceb10n/seo | 49737fdfc545aeafa918900a5defec11c1d6797c | [
"MIT"
] | 1 | 2021-06-19T09:26:03.000Z | 2021-06-19T09:26:03.000Z | seo/proxies.py | ceb10n/seo | 49737fdfc545aeafa918900a5defec11c1d6797c | [
"MIT"
] | null | null | null | seo/proxies.py | ceb10n/seo | 49737fdfc545aeafa918900a5defec11c1d6797c | [
"MIT"
] | 1 | 2020-04-13T17:37:29.000Z | 2020-04-13T17:37:29.000Z | import random
import itertools
class Proxy:
def __init__(self, proxies):
self.proxies = proxies
self.proxy_count = len(self.proxies)
self._rotating_proxy = itertools.cycle(proxies)
def get_random(self):
index = random.randint(0, self.proxy_count)
return self.proxies[index]
def get_next(self):
return next(self._rotating_proxy)
| 20.736842 | 55 | 0.667513 |
811f270410789bfbdf42bef2c63573ffdd995c4f | 17,102 | sql | SQL | t/pg-test-files/expected/fast_default.sql | vikrum/pgFormatter | 4d62fef587e062a131a7d87f164df115578a2d25 | [
"PostgreSQL"
] | null | null | null | t/pg-test-files/expected/fast_default.sql | vikrum/pgFormatter | 4d62fef587e062a131a7d87f164df115578a2d25 | [
"PostgreSQL"
] | null | null | null | t/pg-test-files/expected/fast_default.sql | vikrum/pgFormatter | 4d62fef587e062a131a7d87f164df115578a2d25 | [
"PostgreSQL"
] | null | null | null | --
-- ALTER TABLE ADD COLUMN DEFAULT test
--
SET search_path = fast_default;
CREATE SCHEMA fast_default;
CREATE TABLE m (
id oid
);
INSERT INTO m
VALUES (NULL::oid);
CREATE FUNCTION
SET (tabname name)
RETURNS VOID
AS $$
BEGIN
UPDATE
m
SET
id = (
SELECT
c.relfilenode
FROM
pg_class AS c,
pg_namespace AS s
WHERE
c.relname = tabname
AND c.relnamespace = s.oid
AND s.nspname = 'fast_default');
END;
$$
LANGUAGE 'plpgsql';
CREATE FUNCTION comp ()
RETURNS text
AS $$
BEGIN
RETURN (
SELECT
CASE WHEN m.id = c.relfilenode THEN
'Unchanged'
ELSE
'Rewritten'
END
FROM
m,
pg_class AS c,
pg_namespace AS s
WHERE
c.relname = 't'
AND c.relnamespace = s.oid
AND s.nspname = 'fast_default');
END;
$$
LANGUAGE 'plpgsql';
CREATE FUNCTION log_rewrite ()
RETURNS event_trigger
LANGUAGE plpgsql
AS $func$
DECLARE
this_schema text;
BEGIN
SELECT
INTO this_schema relnamespace::regnamespace::text
FROM
pg_class
WHERE
oid = pg_event_trigger_table_rewrite_oid ();
IF this_schema = 'fast_default' THEN
RAISE NOTICE 'rewriting table % for reason %', pg_event_trigger_table_rewrite_oid ()::regclass, pg_event_trigger_table_rewrite_reason ();
END IF;
END;
$func$;
CREATE TABLE has_volatile AS
SELECT
*
FROM
generate_series(1, 10) id;
CREATE EVENT TRIGGER has_volatile_rewrite ON table_rewrite
EXECUTE PROCEDURE log_rewrite ();
-- only the last of these should trigger a rewrite
ALTER TABLE has_volatile
ADD col1 int;
ALTER TABLE has_volatile
ADD col2 int DEFAULT 1;
ALTER TABLE has_volatile
ADD col3 timestamptz DEFAULT CURRENT_TIMESTAMP;
ALTER TABLE has_volatile
ADD col4 int DEFAULT (random() * 10000)::int;
-- Test a large sample of different datatypes
CREATE TABLE T (
pk int NOT NULL PRIMARY KEY,
c_int int DEFAULT 1
);
SELECT
SET ('t');
INSERT INTO T
VALUES (1), (2);
ALTER TABLE T
ADD COLUMN c_bpchar BPCHAR(5) DEFAULT 'hello',
ALTER COLUMN c_int SET DEFAULT 2;
INSERT INTO T
VALUES (3), (4);
ALTER TABLE T
ADD COLUMN c_text TEXT DEFAULT 'world',
ALTER COLUMN c_bpchar SET DEFAULT 'dog';
INSERT INTO T
VALUES (5), (6);
ALTER TABLE T
ADD COLUMN c_date DATE DEFAULT '2016-06-02',
ALTER COLUMN c_text SET DEFAULT 'cat';
INSERT INTO T
VALUES (7), (8);
ALTER TABLE T
ADD COLUMN c_timestamp TIMESTAMP DEFAULT '2016-09-01 12:00:00',
ADD COLUMN c_timestamp_null TIMESTAMP,
ALTER COLUMN c_date SET DEFAULT '2010-01-01';
INSERT INTO T
VALUES (9), (10);
ALTER TABLE T
ADD COLUMN c_array TEXT[] DEFAULT '{"This", "is", "the", "real", "world"}',
ALTER COLUMN c_timestamp SET DEFAULT '1970-12-31 11:12:13',
ALTER COLUMN c_timestamp_null SET DEFAULT '2016-09-29 12:00:00';
INSERT INTO T
VALUES (11), (12);
ALTER TABLE T
ADD COLUMN c_small SMALLINT DEFAULT - 5,
ADD COLUMN c_small_null SMALLINT,
ALTER COLUMN c_array SET DEFAULT '{"This", "is", "no", "fantasy"}';
INSERT INTO T
VALUES (13), (14);
ALTER TABLE T
ADD COLUMN c_big BIGINT DEFAULT 180000000000018,
ALTER COLUMN c_small SET DEFAULT 9,
ALTER COLUMN c_small_null SET DEFAULT 13;
INSERT INTO T
VALUES (15), (16);
ALTER TABLE T
ADD COLUMN c_num NUMERIC DEFAULT 1.00000000001,
ALTER COLUMN c_big SET DEFAULT - 9999999999999999;
INSERT INTO T
VALUES (17), (18);
ALTER TABLE T
ADD COLUMN c_time TIME DEFAULT '12:00:00',
ALTER COLUMN c_num SET DEFAULT 2.000000000000002;
INSERT INTO T
VALUES (19), (20);
ALTER TABLE T
ADD COLUMN c_interval INTERVAL DEFAULT '1 day',
ALTER COLUMN c_time SET DEFAULT '23:59:59';
INSERT INTO T
VALUES (21), (22);
ALTER TABLE T
ADD COLUMN c_hugetext TEXT DEFAULT repeat('abcdefg', 1000),
ALTER COLUMN c_interval SET DEFAULT '3 hours';
INSERT INTO T
VALUES (23), (24);
ALTER TABLE T
ALTER COLUMN c_interval DROP DEFAULT,
ALTER COLUMN c_hugetext SET DEFAULT repeat('poiuyt', 1000);
INSERT INTO T
VALUES (25), (26);
ALTER TABLE T
ALTER COLUMN c_bpchar DROP DEFAULT,
ALTER COLUMN c_date DROP DEFAULT,
ALTER COLUMN c_text DROP DEFAULT,
ALTER COLUMN c_timestamp DROP DEFAULT,
ALTER COLUMN c_array DROP DEFAULT,
ALTER COLUMN c_small DROP DEFAULT,
ALTER COLUMN c_big DROP DEFAULT,
ALTER COLUMN c_num DROP DEFAULT,
ALTER COLUMN c_time DROP DEFAULT,
ALTER COLUMN c_hugetext DROP DEFAULT;
INSERT INTO T
VALUES (27), (28);
SELECT
pk,
c_int,
c_bpchar,
c_text,
c_date,
c_timestamp,
c_timestamp_null,
c_array,
c_small,
c_small_null,
c_big,
c_num,
c_time,
c_interval,
c_hugetext = repeat('abcdefg', 1000) AS c_hugetext_origdef,
c_hugetext = repeat('poiuyt', 1000) AS c_hugetext_newdef
FROM
T
ORDER BY
pk;
SELECT
comp ();
DROP TABLE T;
-- Test expressions in the defaults
CREATE OR REPLACE FUNCTION foo (a int)
RETURNS text
AS $$
DECLARE
res text := '';
i int;
BEGIN
i := 0;
WHILE (i < a)
LOOP
res := res || chr(ascii('a') + i);
i := i + 1;
END LOOP;
RETURN res;
END;
$$
LANGUAGE PLPGSQL
STABLE;
CREATE TABLE T (
pk int NOT NULL PRIMARY KEY,
c_int int DEFAULT LENGTH(foo (6))
);
SELECT
SET ('t');
INSERT INTO T
VALUES (1), (2);
ALTER TABLE T
ADD COLUMN c_bpchar BPCHAR(5) DEFAULT foo (4),
ALTER COLUMN c_int SET DEFAULT LENGTH(foo (8));
INSERT INTO T
VALUES (3), (4);
ALTER TABLE T
ADD COLUMN c_text TEXT DEFAULT foo (6),
ALTER COLUMN c_bpchar SET DEFAULT foo (3);
INSERT INTO T
VALUES (5), (6);
ALTER TABLE T
ADD COLUMN c_date DATE DEFAULT '2016-06-02'::date + LENGTH(foo (10)),
ALTER COLUMN c_text SET DEFAULT foo (12);
INSERT INTO T
VALUES (7), (8);
ALTER TABLE T
ADD COLUMN c_timestamp TIMESTAMP DEFAULT '2016-09-01'::date + LENGTH(foo (10)),
ALTER COLUMN c_date SET DEFAULT '2010-01-01'::date - LENGTH(foo (4));
INSERT INTO T
VALUES (9), (10);
ALTER TABLE T
ADD COLUMN c_array TEXT[] DEFAULT ('{"This", "is", "' || foo (4) || '","the", "real", "world"}')::text[],
ALTER COLUMN c_timestamp SET DEFAULT '1970-12-31'::date + LENGTH(foo (30));
INSERT INTO T
VALUES (11), (12);
ALTER TABLE T
ALTER COLUMN c_int DROP DEFAULT,
ALTER COLUMN c_array SET DEFAULT ('{"This", "is", "' || foo (1) || '", "fantasy"}')::text[];
INSERT INTO T
VALUES (13), (14);
ALTER TABLE T
ALTER COLUMN c_bpchar DROP DEFAULT,
ALTER COLUMN c_date DROP DEFAULT,
ALTER COLUMN c_text DROP DEFAULT,
ALTER COLUMN c_timestamp DROP DEFAULT,
ALTER COLUMN c_array DROP DEFAULT;
INSERT INTO T
VALUES (15), (16);
SELECT
*
FROM
T;
SELECT
comp ();
DROP TABLE T;
DROP FUNCTION foo (INT);
-- Fall back to full rewrite for volatile expressions
CREATE TABLE T (
pk int NOT NULL PRIMARY KEY
);
INSERT INTO T
VALUES (1);
SELECT
SET ('t');
-- now() is stable, because it returns the transaction timestamp
ALTER TABLE T
ADD COLUMN c1 TIMESTAMP DEFAULT now();
SELECT
comp ();
-- clock_timestamp() is volatile
ALTER TABLE T
ADD COLUMN c2 TIMESTAMP DEFAULT clock_timestamp();
SELECT
comp ();
DROP TABLE T;
-- Simple querie
CREATE TABLE T (
pk int NOT NULL PRIMARY KEY
);
SELECT
SET ('t');
INSERT INTO T
SELECT
*
FROM
generate_series(1, 10) a;
ALTER TABLE T
ADD COLUMN c_bigint BIGINT NOT NULL DEFAULT - 1;
INSERT INTO T
SELECT
b,
b - 10
FROM
generate_series(11, 20) a (b);
ALTER TABLE T
ADD COLUMN c_text TEXT DEFAULT 'hello';
INSERT INTO T
SELECT
b,
b - 10, (b + 10)::text
FROM
generate_series(21, 30) a (b);
-- WHERE clause
SELECT
c_bigint,
c_text
FROM
T
WHERE
c_bigint = - 1
LIMIT 1;
EXPLAIN (
VERBOSE TRUE,
COSTS FALSE
)
SELECT
c_bigint,
c_text
FROM
T
WHERE
c_bigint = - 1
LIMIT 1;
SELECT
c_bigint,
c_text
FROM
T
WHERE
c_text = 'hello'
LIMIT 1;
EXPLAIN (
VERBOSE TRUE,
COSTS FALSE
)
SELECT
c_bigint,
c_text
FROM
T
WHERE
c_text = 'hello'
LIMIT 1;
-- COALESCE
SELECT
COALESCE(c_bigint, pk),
COALESCE(c_text, pk::text)
FROM
T
ORDER BY
pk
LIMIT 10;
-- Aggregate function
SELECT
SUM(c_bigint),
MAX(c_text COLLATE "C"),
MIN(c_text COLLATE "C")
FROM
T;
-- ORDER BY
SELECT
*
FROM
T
ORDER BY
c_bigint,
c_text,
pk
LIMIT 10;
EXPLAIN (
VERBOSE TRUE,
COSTS FALSE
)
SELECT
*
FROM
T
ORDER BY
c_bigint,
c_text,
pk
LIMIT 10;
-- LIMIT
SELECT
*
FROM
T
WHERE
c_bigint > - 1
ORDER BY
c_bigint,
c_text,
pk
LIMIT 10;
EXPLAIN (
VERBOSE TRUE,
COSTS FALSE
)
SELECT
*
FROM
T
WHERE
c_bigint > - 1
ORDER BY
c_bigint,
c_text,
pk
LIMIT 10;
-- DELETE with RETURNING
DELETE FROM T
WHERE pk BETWEEN 10 AND 20
RETURNING
*;
EXPLAIN (
VERBOSE TRUE,
COSTS FALSE
) DELETE FROM T
WHERE pk BETWEEN 10 AND 20
RETURNING
*;
-- UPDATE
UPDATE
T
SET
c_text = '"' || c_text || '"'
WHERE
pk < 10;
SELECT
*
FROM
T
WHERE
c_text LIKE '"%"'
ORDER BY
PK;
SELECT
comp ();
DROP TABLE T;
-- Combine with other DDL
CREATE TABLE T (
pk int NOT NULL PRIMARY KEY
);
SELECT
SET ('t');
INSERT INTO T
VALUES (1), (2);
ALTER TABLE T
ADD COLUMN c_int INT NOT NULL DEFAULT - 1;
INSERT INTO T
VALUES (3), (4);
ALTER TABLE T
ADD COLUMN c_text TEXT DEFAULT 'Hello';
INSERT INTO T
VALUES (5), (6);
ALTER TABLE T
ALTER COLUMN c_text SET DEFAULT 'world',
ALTER COLUMN c_int SET DEFAULT 1;
INSERT INTO T
VALUES (7), (8);
SELECT
*
FROM
T
ORDER BY
pk;
-- Add an index
CREATE INDEX i ON T (c_int, c_text);
SELECT
c_text
FROM
T
WHERE
c_int = - 1;
SELECT
comp ();
-- query to exercise expand_tuple function
CREATE TABLE t1 AS
SELECT
1::int AS a,
2::int AS b
FROM
generate_series(1, 20) q;
ALTER TABLE t1
ADD COLUMN c text;
SELECT
a,
stddev(cast((
SELECT
sum(1)
FROM generate_series(1, 20) x) AS float4)) OVER (PARTITION BY a, b, c ORDER BY b) AS z
FROM
t1;
DROP TABLE T;
-- test that we account for missing columns without defaults correctly
-- in expand_tuple, and that rows are correctly expanded for triggers
CREATE FUNCTION test_trigger ()
RETURNS TRIGGER
LANGUAGE plpgsql
AS $$
BEGIN
RAISE notice 'old tuple: %', to_json(OLD)::text;
IF TG_OP = 'DELETE' THEN
RETURN OLD;
ELSE
RETURN NEW;
END IF;
END;
$$;
-- 2 new columns, both have defaults
CREATE TABLE t (
id serial PRIMARY KEY,
a int,
b int,
c int
);
INSERT INTO t (a, b, c)
VALUES (1, 2, 3);
ALTER TABLE t
ADD COLUMN x int NOT NULL DEFAULT 4;
ALTER TABLE t
ADD COLUMN y int NOT NULL DEFAULT 5;
CREATE TRIGGER a
BEFORE UPDATE ON t
FOR EACH ROW
EXECUTE PROCEDURE test_trigger ();
SELECT
*
FROM
t;
UPDATE
t
SET
y = 2;
SELECT
*
FROM
t;
DROP TABLE t;
-- 2 new columns, first has default
CREATE TABLE t (
id serial PRIMARY KEY,
a int,
b int,
c int
);
INSERT INTO t (a, b, c)
VALUES (1, 2, 3);
ALTER TABLE t
ADD COLUMN x int NOT NULL DEFAULT 4;
ALTER TABLE t
ADD COLUMN y int;
CREATE TRIGGER a
BEFORE UPDATE ON t
FOR EACH ROW
EXECUTE PROCEDURE test_trigger ();
SELECT
*
FROM
t;
UPDATE
t
SET
y = 2;
SELECT
*
FROM
t;
DROP TABLE t;
-- 2 new columns, second has default
CREATE TABLE t (
id serial PRIMARY KEY,
a int,
b int,
c int
);
INSERT INTO t (a, b, c)
VALUES (1, 2, 3);
ALTER TABLE t
ADD COLUMN x int;
ALTER TABLE t
ADD COLUMN y int NOT NULL DEFAULT 5;
CREATE TRIGGER a
BEFORE UPDATE ON t
FOR EACH ROW
EXECUTE PROCEDURE test_trigger ();
SELECT
*
FROM
t;
UPDATE
t
SET
y = 2;
SELECT
*
FROM
t;
DROP TABLE t;
-- 2 new columns, neither has default
CREATE TABLE t (
id serial PRIMARY KEY,
a int,
b int,
c int
);
INSERT INTO t (a, b, c)
VALUES (1, 2, 3);
ALTER TABLE t
ADD COLUMN x int;
ALTER TABLE t
ADD COLUMN y int;
CREATE TRIGGER a
BEFORE UPDATE ON t
FOR EACH ROW
EXECUTE PROCEDURE test_trigger ();
SELECT
*
FROM
t;
UPDATE
t
SET
y = 2;
SELECT
*
FROM
t;
DROP TABLE t;
-- same as last 4 tests but here the last original column has a NULL value
-- 2 new columns, both have defaults
CREATE TABLE t (
id serial PRIMARY KEY,
a int,
b int,
c int
);
INSERT INTO t (a, b, c)
VALUES (1, 2, NULL);
ALTER TABLE t
ADD COLUMN x int NOT NULL DEFAULT 4;
ALTER TABLE t
ADD COLUMN y int NOT NULL DEFAULT 5;
CREATE TRIGGER a
BEFORE UPDATE ON t
FOR EACH ROW
EXECUTE PROCEDURE test_trigger ();
SELECT
*
FROM
t;
UPDATE
t
SET
y = 2;
SELECT
*
FROM
t;
DROP TABLE t;
-- 2 new columns, first has default
CREATE TABLE t (
id serial PRIMARY KEY,
a int,
b int,
c int
);
INSERT INTO t (a, b, c)
VALUES (1, 2, NULL);
ALTER TABLE t
ADD COLUMN x int NOT NULL DEFAULT 4;
ALTER TABLE t
ADD COLUMN y int;
CREATE TRIGGER a
BEFORE UPDATE ON t
FOR EACH ROW
EXECUTE PROCEDURE test_trigger ();
SELECT
*
FROM
t;
UPDATE
t
SET
y = 2;
SELECT
*
FROM
t;
DROP TABLE t;
-- 2 new columns, second has default
CREATE TABLE t (
id serial PRIMARY KEY,
a int,
b int,
c int
);
INSERT INTO t (a, b, c)
VALUES (1, 2, NULL);
ALTER TABLE t
ADD COLUMN x int;
ALTER TABLE t
ADD COLUMN y int NOT NULL DEFAULT 5;
CREATE TRIGGER a
BEFORE UPDATE ON t
FOR EACH ROW
EXECUTE PROCEDURE test_trigger ();
SELECT
*
FROM
t;
UPDATE
t
SET
y = 2;
SELECT
*
FROM
t;
DROP TABLE t;
-- 2 new columns, neither has default
CREATE TABLE t (
id serial PRIMARY KEY,
a int,
b int,
c int
);
INSERT INTO t (a, b, c)
VALUES (1, 2, NULL);
ALTER TABLE t
ADD COLUMN x int;
ALTER TABLE t
ADD COLUMN y int;
CREATE TRIGGER a
BEFORE UPDATE ON t
FOR EACH ROW
EXECUTE PROCEDURE test_trigger ();
SELECT
*
FROM
t;
UPDATE
t
SET
y = 2;
SELECT
*
FROM
t;
DROP TABLE t;
-- make sure expanded tuple has correct self pointer
-- it will be required by the RI trigger doing the cascading delete
CREATE TABLE leader (
a int PRIMARY KEY,
b int
);
CREATE TABLE follower (
a int REFERENCES leader ON DELETE CASCADE,
b int
);
INSERT INTO leader
VALUES (1, 1), (2, 2);
ALTER TABLE leader
ADD c int;
ALTER TABLE leader
DROP c;
DELETE FROM leader;
-- check that ALTER TABLE ... ALTER TYPE does the right thing
CREATE TABLE vtype (
a integer
);
INSERT INTO vtype
VALUES (1);
ALTER TABLE vtype
ADD COLUMN b DOUBLE PRECISION DEFAULT 0.2;
ALTER TABLE vtype
ADD COLUMN c BOOLEAN DEFAULT TRUE;
SELECT
*
FROM
vtype;
ALTER TABLE vtype
ALTER b TYPE text
USING b::text,
ALTER c TYPE text
USING c::text;
SELECT
*
FROM
vtype;
-- also check the case that doesn't rewrite the table
CREATE TABLE vtype2 (
a int
);
INSERT INTO vtype2
VALUES (1);
ALTER TABLE vtype2
ADD COLUMN b varchar(10) DEFAULT 'xxx';
ALTER TABLE vtype2
ALTER COLUMN b SET DEFAULT 'yyy';
INSERT INTO vtype2
VALUES (2);
ALTER TABLE vtype2
ALTER COLUMN b TYPE varchar(20)
USING b::varchar(20);
SELECT
*
FROM
vtype2;
-- Ensure that defaults are checked when evaluating whether HOT update
-- is possible, this was broken for a while:
-- https://postgr.es/m/20190202133521.ylauh3ckqa7colzj%40alap3.anarazel.de
BEGIN;
CREATE TABLE t ();
INSERT INTO t DEFAULT VALUES; ALTER TABLE t
ADD COLUMN a int DEFAULT 1;
CREATE INDEX ON t (a);
-- set column with a default 1 to NULL, due to a bug that wasn't
-- noticed has heap_getattr buggily returned NULL for default columns
UPDATE
t
SET
a = NULL;
-- verify that index and non-index scans show the same result
SET LOCAL enable_seqscan = TRUE;
SELECT
*
FROM
t
WHERE
a IS NULL;
SET LOCAL enable_seqscan = FALSE;
SELECT
*
FROM
t
WHERE
a IS NULL;
ROLLBACK;
-- cleanup
DROP TABLE vtype;
DROP TABLE vtype2;
DROP TABLE follower;
DROP TABLE leader;
DROP FUNCTION test_trigger ();
DROP TABLE t1;
DROP FUNCTION SET (name);
DROP FUNCTION comp ();
DROP TABLE m;
DROP TABLE has_volatile;
DROP EVENT TRIGGER has_volatile_rewrite;
DROP FUNCTION log_rewrite;
DROP SCHEMA fast_default;
-- Leave a table with an active fast default in place, for pg_upgrade testing
SET search_path = public;
CREATE TABLE has_fast_default (
f1 int
);
INSERT INTO has_fast_default
VALUES (1);
ALTER TABLE has_fast_default
ADD COLUMN f2 int DEFAULT 42;
TABLE has_fast_default;
| 15.393339 | 145 | 0.633376 |
5375b08fa4c8c342b5f0b7884d554e4196e206e5 | 2,351 | rb | Ruby | lib/mittsu/extras/geometries/parametric_geometry.rb | marcinruszkiewicz/mittsu | 3e3b156e0c713b4d299bff4b92c4375517638f71 | [
"MIT"
] | 1 | 2020-08-29T00:44:27.000Z | 2020-08-29T00:44:27.000Z | lib/mittsu/extras/geometries/parametric_geometry.rb | marcinruszkiewicz/mittsu | 3e3b156e0c713b4d299bff4b92c4375517638f71 | [
"MIT"
] | null | null | null | lib/mittsu/extras/geometries/parametric_geometry.rb | marcinruszkiewicz/mittsu | 3e3b156e0c713b4d299bff4b92c4375517638f71 | [
"MIT"
] | null | null | null | require 'mittsu/extras/geometries/parametric_buffer_geometry'
module Mittsu
class ParametricGeometry < Geometry
def initialize(func, slices, stacks)
super()
@type = 'ParametricGeometry'
@parameters = {
func: func,
slices: slices,
stacks: stacks
}
from_buffer_geometry(ParametricBufferGeometry.new(func, slices, stacks))
merge_vertices
end
def self.klein
-> (v, u, target = Vector3.new) {
u *= Math::PI
v *= 2.0 * Math::PI
u = u * 2.0
x = nil
y = nil
z = nil
if u < Math::PI
x = 3.0 * Math.cos(u) * (1.0 + Math.sin(u)) + (2.0 * (1.0 - Math.cos(u) / 2.0)) * Math.cos(u) * Math.cos(v)
z = -8.0 * Math.sin(u) - 2.0 * (1.0 - Math.cos(u) / 2.0) * Math.sin(u) * Math.cos(v)
else
x = 3.0 * Math.cos(u) * (1.0 + Math.sin(u)) + (2.0 * (1.0 - Math.cos(u) / 2.0)) * Math.cos(v + Math::PI)
z = -8.0 * Math.sin(u)
end
y = -2.0 * (1.0 - Math.cos(u) / 2.0) * Math.sin(v)
target.set(x, y, z)
}
end
def self.plane(width, height)
-> (u, v, target = Vector3.new) {
x = u.to_f * width.to_f
y = 0.0
z = v.to_f * height.to_f
target.set(x, y, z)
}
end
def self.mobius
-> (u, t, target = Vector3.new) {
# flat mobius strip
# http://www.wolframalpha.com/input/?i=M%C3%B6bius+strip+parametric+equations&lk=1&a=ClashPrefs_*Surface.MoebiusStrip.SurfaceProperty.ParametricEquations-
u = u - 0.5
v = 2.0 * Math::PI * t
a = 2.0
x = Math.cos(v) * (a + u * Math.cos(v / 2.0))
y = Math.sin(v) * (a + u * Math.cos(v / 2.0))
z = u * Math.sin(v / 2)
target.set(x, y, z)
}
end
def self.mobius3d
-> (u, t, target = Vector3.new) {
# volumetric mobius strip
u *= Math::PI
t *= 2.0 * Math::PI
u = u * 2.0
phi = u / 2.0
major = 2.25
a = 0.125
b = 0.65
x = a * Math.cos(t) * Math.cos(phi) - b * Math.sin(t) * Math.sin(phi)
z = a * Math.cos(t) * Math.sin(phi) + b * Math.sin(t) * Math.cos(phi)
y = (major + x) * Math.sin(u)
x = (major + x) * Math.cos(u)
target.set(x, y, z)
}
end
end
end | 25.27957 | 162 | 0.476393 |
0e8821619b30e957b447eef847dc9ef364515922 | 399 | swift | Swift | Syte/Classes/Core/API/Parameters/GetOffersParameters.swift | syte-ai/iOS-SDK | 63263ecd12fea8fbb986175fc1deae3b02ca121c | [
"MIT"
] | 1 | 2019-06-10T14:22:43.000Z | 2019-06-10T14:22:43.000Z | Syte/Classes/Core/API/Parameters/GetOffersParameters.swift | syte-ai/iOS-SDK | 63263ecd12fea8fbb986175fc1deae3b02ca121c | [
"MIT"
] | 2 | 2020-01-23T11:12:22.000Z | 2022-03-31T12:29:18.000Z | Syte/Classes/Core/API/Parameters/GetOffersParameters.swift | syte-ai/iOS-SDK | 63263ecd12fea8fbb986175fc1deae3b02ca121c | [
"MIT"
] | 3 | 2019-11-15T08:55:45.000Z | 2020-02-03T06:01:58.000Z | //
// GetOffersswift
// Syte
//
// Created by Artur Tarasenko on 17.09.2021.
//
import Foundation
struct GetOffersParameters {
let offersUrl: String
let crop: String?
let forceCats: String?
func dictionaryRepresentation() -> [String: Any] {
let parameters = ["crop": crop, "force_cats": forceCats].compactMapValues({$0})
return parameters
}
}
| 18.136364 | 87 | 0.629073 |
c7c82bc0fe37f810820904cecc247f294ddbd87b | 2,135 | sql | SQL | 05-SQL/39-Homework2.sql | ericson14/Small_project | dd88b9a5619d38fb8d236c932ffa8429d24b28ae | [
"MIT"
] | null | null | null | 05-SQL/39-Homework2.sql | ericson14/Small_project | dd88b9a5619d38fb8d236c932ffa8429d24b28ae | [
"MIT"
] | null | null | null | 05-SQL/39-Homework2.sql | ericson14/Small_project | dd88b9a5619d38fb8d236c932ffa8429d24b28ae | [
"MIT"
] | null | null | null | 1.
create table student(
id int(10) not null unique primary key,
name varchar(20) not null,
gender varchar(4),
birth year,
department varchar(20),
address varchar(50)
);
create table score(
id int(10) not null unique primary key auto_increment,
stu_id int(10) not null,
c_name varchar(20),
grade int(10)
);
insert into student values
( 901,'张老大','男',1985,'计算机系','北京市海淀区'),
( 902,'张老二', '男',1986,'中文系', '北京市昌平区'),
( 903,'张三', '女',1990,'中文系', '湖南省永州市'),
( 904,'李四', '男',1990,'英语系', '辽宁省阜新市'),
( 905,'王五', '女',1991,'英语系', '福建省厦门市'),
( 906,'王六', '男',1988,'计算机系', '湖南省衡阳市');
insert into score values
(NULL,901, '计算机',98),
(NULL,901, '英语', 80),
(NULL,902, '计算机',65),
(NULL,902, '中文',88),
(NULL,903, '中文',95),
(NULL,904, '计算机',70),
(NULL,904, '英语',92),
(NULL,905, '英语',94),
(NULL,906, '计算机',90),
(NULL,906, '英语',85);
select * from student;
select * from student limit 1,3;
select id,name,department from student;
select * from student where department="英语系" or department="计算机系";
select * from student where year(now())-birth between 22 and 28;
select department,count(*) from student group by department;
select max(grade), c_name from score group by c_name;
select c_name, grade from score where stu_id=(select s.id from student as s where name="李四");
select * from student as s inner join score as t on s.id=t.stu_id;
select b.name, sum(grade) from score as a inner join student as b on a.stu_id=b.id group by a.stu_id;
select c_name, avg(grade) from score group by c_name;
select * from student where id in (select stu_id from score where grade<95 and c_name='计算机');
select grade from score where c_name='计算机' and stu_id = (select s.id from student as s) order by grade desc;
select name, department, b.grade, b.c_name from student as s left join score as b on s.id=b.stu_id where name rlike '^(张|王).*';
select name, department, (year(now())-s.year) as age, b.grade, b.c_name from student as s left join score as b on s.id=b.stu_id where s.address like '湖南%';
create table temp (p int)select id from test where id not in (select min(id) from test group by code);
delete from test where id in temp.id;
| 36.186441 | 155 | 0.688056 |
46ec4973a5c5a34e61af2c23e7936890d09d8982 | 3,409 | py | Python | app.py | ccraven04/sqlalchemy-challenge | 64d991394274745990c471a2bdff3959d5a48336 | [
"ADSL"
] | null | null | null | app.py | ccraven04/sqlalchemy-challenge | 64d991394274745990c471a2bdff3959d5a48336 | [
"ADSL"
] | null | null | null | app.py | ccraven04/sqlalchemy-challenge | 64d991394274745990c471a2bdff3959d5a48336 | [
"ADSL"
] | null | null | null | import numpy as np
import pandas as pd
import datetime as dt
from datetime import timedelta
# Python SQL toolkit and Object Relational Mapper
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_engine, func, inspect
from flask import Flask, jsonify
#################################################
# Flask Setup
#################################################
app = Flask(__name__)
engine = create_engine("sqlite:///Resources/hawaii.sqlite")
# reflect an existing database into a new model
Base = automap_base()
# reflect the tables
Base.prepare(engine, reflect=True)
Base.classes.keys()
Measurement = Base.classes.measurement
Station = Base.classes.station
Measurement = Base.classes.measurement
Station = Base.classes.station
session = Session(engine
)
@app.route("/")
def welcome():
return (
f"Aloha! Welcome to the Hawaii Climate Analysis API!<br/>"
f"Available Routes:<br/>"
f"/api/v1.0/precipitation<br/>"
f"/api/v1.0/stations<br/>"
f"/api/v1.0/tobs<br/>"
f"/api/v1.0/temp/start<br/>"
f"/api/v1.0/temp/start/end"
)
@app.route("/api/v1.0/precipitation")
def precipitation():
# return precipitation data for the last year:
Measurement = Base.classes.measurement
Station = Base.classes.station
session = Session(engine)
one_year=dt.date(2017, 8, 23) - dt.timedelta(days=365)
precip=session.query(Measurement.date, Measurement.prcp).filter(Measurement.date >= one_year).all()
precipitation={date: prcp for date, prcp in precip}
return jsonify(precipitation)
@app.route("/api/v1.0/stations")
def stations():
# return a list of stations:
Measurement=Base.classes.measurement
Station=Base.classes.station
session=Session(engine)
stations=session.query(Station.station).all()
all_stations=list(np.ravel(stations))
return jsonify(all_stations)
@app.route("/api/v1.0/tobs")
def tobs():
# return temperature observations for the last year
Measurement=Base.classes.measurement
Station=Base.classes.station
session=Session(engine)
one_year=dt.date(2017, 8, 23) - dt.timedelta(days=365)
temp=session.query(Measurement.date, Measurement.tobs).filter(
Measurement.date >= one_year).all()
temps=list(np.ravel(temp))
return jsonify(temps)
@app.route("/api/v1.0/temp/<start>")
def stats(start):
# return TMIN, TAVG, TMAX
Measurement=Base.classes.measurement
Station=Base.classes.station
session=Session(engine)
result=session.query(func.min(Measurement.tobs), func.avg(Measurement.tobs), func.max(Measurement.tobs)).\
filter(Measurement.date >= start).all()
results=list(np.ravel(result))
return jsonify(results)
@app.route("/api/v1.0/temp/<start>/<end>")
def stats1(start=None, end=None):
# return TMIN, TAVG, TMAX
#print(calc_temps('2012-02-28', '2012-03-05'))
Measurement=Base.classes.measurement
Station=Base.classes.station
session=Session(engine)
result1=session.query(func.min(Measurement.tobs), func.avg(Measurement.tobs), func.max(Measurement.tobs)).\
filter(Measurement.date >= start).filter(Measurement.date <= end).all()
results1=list(np.ravel(result1))
return jsonify(results1)
if __name__ == '__main__':
app.run(debug=True)
| 25.251852 | 111 | 0.682312 |
257e3b0e481c44bca357529f79b59bda4830ffa9 | 3,464 | cs | C# | src/Spool/FilePoolConfigurations.cs | cocosip/Spool | a7dc55f2a56b9fb6eca4f85eaec41c3767b0ded4 | [
"MIT"
] | null | null | null | src/Spool/FilePoolConfigurations.cs | cocosip/Spool | a7dc55f2a56b9fb6eca4f85eaec41c3767b0ded4 | [
"MIT"
] | 4 | 2020-04-24T13:42:16.000Z | 2020-08-20T06:44:59.000Z | src/Spool/FilePoolConfigurations.cs | cocosip/Spool | a7dc55f2a56b9fb6eca4f85eaec41c3767b0ded4 | [
"MIT"
] | null | null | null | using System;
using System.Collections.Generic;
namespace Spool
{
/// <summary>
/// File pool configurations
/// </summary>
public class FilePoolConfigurations
{
private FilePoolConfiguration Default => GetConfiguration<DefaultFilePool>();
private readonly Dictionary<string, FilePoolConfiguration> _filePools;
/// <summary>
/// ctor
/// </summary>
public FilePoolConfigurations()
{
_filePools = new Dictionary<string, FilePoolConfiguration>()
{
//Add default file pool
[FilePoolNameAttribute.GetFilePoolName<DefaultFilePool>()] = new FilePoolConfiguration()
};
}
/// <summary>
/// Configure file pool by generics type
/// </summary>
/// <typeparam name="TFilePool"></typeparam>
/// <param name="configureAction"></param>
/// <returns></returns>
public FilePoolConfigurations Configure<TFilePool>(
Action<FilePoolConfiguration> configureAction)
{
return Configure(
FilePoolNameAttribute.GetFilePoolName<TFilePool>(),
configureAction
);
}
/// <summary>
/// Configure file pool by name
/// </summary>
/// <param name="name"></param>
/// <param name="configureAction"></param>
/// <returns></returns>
public FilePoolConfigurations Configure(
string name,
Action<FilePoolConfiguration> configureAction)
{
if (!_filePools.TryGetValue(name, out FilePoolConfiguration configuration))
{
configuration = new FilePoolConfiguration();
_filePools.Add(name, configuration);
}
configureAction(configuration);
return this;
}
/// <summary>
/// Configure default file pool
/// </summary>
/// <param name="configureAction"></param>
/// <returns></returns>
public FilePoolConfigurations ConfigureDefault(Action<FilePoolConfiguration> configureAction)
{
configureAction(Default);
return this;
}
/// <summary>
/// Configure all file pool
/// </summary>
/// <param name="configureAction"></param>
/// <returns></returns>
public FilePoolConfigurations ConfigureAll(Action<string, FilePoolConfiguration> configureAction)
{
foreach (var filePool in _filePools)
{
configureAction(filePool.Key, filePool.Value);
}
return this;
}
/// <summary>
/// Get file pool configuration by generics type
/// </summary>
/// <typeparam name="TFilePool"></typeparam>
/// <returns></returns>
public FilePoolConfiguration GetConfiguration<TFilePool>()
{
return GetConfiguration(FilePoolNameAttribute.GetFilePoolName<TFilePool>());
}
/// <summary>
/// Get file pool configuration by name
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public FilePoolConfiguration GetConfiguration(string name)
{
_filePools.TryGetValue(name, out FilePoolConfiguration configuration);
return configuration ?? Default;
}
}
}
| 30.928571 | 105 | 0.564088 |
39269c3ee3fa037e9d901d77a405527a20aee235 | 3,969 | py | Python | sner/server/planner/core.py | bodik/sner4-web | cb054d79c587b2f8468c73a88754b7c0d5cd5a95 | [
"MIT"
] | 9 | 2019-05-15T11:33:43.000Z | 2022-02-17T04:05:28.000Z | sner/server/planner/core.py | bodik/sner4 | cb054d79c587b2f8468c73a88754b7c0d5cd5a95 | [
"MIT"
] | 1 | 2019-03-01T11:48:13.000Z | 2019-03-01T11:48:13.000Z | sner/server/planner/core.py | bodik/sner4-web | cb054d79c587b2f8468c73a88754b7c0d5cd5a95 | [
"MIT"
] | 3 | 2020-03-03T21:06:37.000Z | 2021-01-11T14:40:56.000Z | # This file is part of sner4 project governed by MIT license, see the LICENSE.txt file.
"""
planner core
"""
import logging
import signal
from contextlib import contextmanager
from datetime import datetime
from pathlib import Path
from time import sleep
from flask import current_app
from pytimeparse import parse as timeparse
from schema import Or, Schema
from sner.server.extensions import db
from sner.server.planner.steps import run_steps, StopPipeline
PIPELINE_CONFIG_SCHEMA = Schema(Or(
{'type': 'queue', 'steps': list},
{'type': 'interval', 'name': str, 'interval': str, 'steps': list},
{'type': 'generic', 'steps': list}
))
def run_pipeline(config):
"""
run pipeline, queue pipelines runs until stop is signaled
"""
if config['type'] == 'queue':
run_queue_pipeline(config)
elif config['type'] == 'interval':
run_interval_pipeline(config)
else:
run_steps(config['steps'])
def run_queue_pipeline(config):
"""run queue pipeline"""
try:
while True:
run_steps(config['steps'])
except StopPipeline:
return
def run_interval_pipeline(config):
"""run interval pipeline"""
name = config['name']
interval = config['interval']
lastrun_path = Path(current_app.config['SNER_VAR']) / f'lastrun.{name}'
if lastrun_path.exists():
lastrun = datetime.fromisoformat(lastrun_path.read_text())
if (datetime.utcnow().timestamp() - lastrun.timestamp()) < timeparse(interval):
return
try:
run_steps(config['steps'])
except StopPipeline:
# stop_pipeline is emited during tests to check backoff interval
pass
lastrun_path.write_text(datetime.utcnow().isoformat())
class Planner:
"""planner"""
LOOPSLEEP = 60
def __init__(self, oneshot=False):
self.log = current_app.logger
self.log.setLevel(logging.DEBUG if current_app.config['DEBUG'] else logging.INFO)
self.original_signal_handlers = {}
self.loop = None
self.oneshot = oneshot
@contextmanager
def terminate_context(self):
"""terminate context manager; should restore handlers despite of underlying code exceptions"""
# break pylint duplicate-code
self.original_signal_handlers[signal.SIGTERM] = signal.signal(signal.SIGTERM, self.terminate)
self.original_signal_handlers[signal.SIGINT] = signal.signal(signal.SIGINT, self.terminate)
try:
# break pylint duplicate-code
yield
finally:
signal.signal(signal.SIGINT, self.original_signal_handlers[signal.SIGINT])
signal.signal(signal.SIGTERM, self.original_signal_handlers[signal.SIGTERM])
def terminate(self, signum=None, frame=None): # pragma: no cover pylint: disable=unused-argument ; running over multiprocessing
"""terminate at once"""
self.log.info('terminate')
self.loop = False
def run(self):
"""run planner loop"""
self.loop = True
config = current_app.config['SNER_PLANNER']['pipelines']
with self.terminate_context():
while self.loop:
for pipeline in config:
try:
PIPELINE_CONFIG_SCHEMA.validate(pipeline)
run_pipeline(pipeline)
except Exception as e: # pylint: disable=broad-except ; any exception can be raised during pipeline processing
current_app.logger.error(f'pipeline failed, {pipeline}, {repr(e)}', exc_info=True)
db.session.close()
if self.oneshot:
self.loop = False
else: # pragma: no cover ; running over multiprocessing
# support for long loops, but allow fast shutdown
for _ in range(self.LOOPSLEEP):
if self.loop:
sleep(1)
| 31.007813 | 134 | 0.632149 |
d27954c042fc55baa0cd2a52926b285b6baa90fe | 644 | sql | SQL | openGaussBase/testcase/KEYWORDS/Explain/Opengauss_Function_Keyword_Explain_Case0029.sql | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/KEYWORDS/Explain/Opengauss_Function_Keyword_Explain_Case0029.sql | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/KEYWORDS/Explain/Opengauss_Function_Keyword_Explain_Case0029.sql | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | -- @testpoint:opengauss关键字explain(非保留),作为表空间名
--关键字不带引号,创建成功
drop tablespace if exists explain;
CREATE TABLESPACE explain RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1';
drop tablespace explain;
--关键字带双引号,创建成功
drop tablespace if exists "explain";
CREATE TABLESPACE "explain" RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1';
drop tablespace "explain";
--关键字带单引号,合理报错
drop tablespace if exists 'explain';
CREATE TABLESPACE 'explain' RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1';
--关键字带反引号,合理报错
drop tablespace if exists `explain`;
CREATE TABLESPACE `explain` RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1';
| 29.272727 | 83 | 0.812112 |
07b8caead934e18d6d8c5dca154992e62cd3b6d0 | 69 | hpp | C++ | src/sensor.hpp | Valmarelox/arvacuum | 6746b65e1c7278b230489e4a7e20d0e836ac5d70 | [
"MIT"
] | null | null | null | src/sensor.hpp | Valmarelox/arvacuum | 6746b65e1c7278b230489e4a7e20d0e836ac5d70 | [
"MIT"
] | null | null | null | src/sensor.hpp | Valmarelox/arvacuum | 6746b65e1c7278b230489e4a7e20d0e836ac5d70 | [
"MIT"
] | null | null | null |
class Sensor {
public:
virtual unsigned long measure() = 0;
};
| 9.857143 | 40 | 0.637681 |
464c222132317bd1b04d427037a0d3aeb9995b7b | 5,565 | php | PHP | application/views/data/data_form.php | ilhamdhiya01/hrisomni | 37ffa568da2fd2b9e7a8faadd1731d8df125c71d | [
"MIT"
] | null | null | null | application/views/data/data_form.php | ilhamdhiya01/hrisomni | 37ffa568da2fd2b9e7a8faadd1731d8df125c71d | [
"MIT"
] | null | null | null | application/views/data/data_form.php | ilhamdhiya01/hrisomni | 37ffa568da2fd2b9e7a8faadd1731d8df125c71d | [
"MIT"
] | null | null | null | <section class="content-header">
<h1>Karyawan
<small>Data Karyawan</small>
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-building"></i> </a></li>
<li><a href="#">Data Karyawan</a></li>
</ol>
</section>
<!-- Main content -->
<section class="content">
<div class="box">
<div class="box-header">
<h3 class="box-title"><?= ucfirst($page) ?> Karyawan</h3>
<div class="pull-right">
<a href="<?= site_url('data') ?>" class="btn btn-warning btn-flat">
<i class="fa fa-undo"></i> Back
</a>
</div>
</div>
<div class="box-body">
<div class="row">
<div class="col-md-4 col-md-offset-4">
<form action="<?= site_url('data/add') ?>" method="POST">
<div class="form-group">
<label for="username">Nama Pegawai <small class="text-danger">*</small></label>
<select class="js-example-basic-single" style="width: 338px;" name="nama_pegawai">
<option></option>
<?php foreach ($users as $user) : ?>
<option value="<?= $user['id']; ?>"><?= $user['nama_pegawai']; ?></option>
<?php endforeach; ?>
</select>
<small class="text-danger"><?= form_error('nama_pegawai'); ?></small>
</div>
<div class="form-group ">
<label for="username">Tanggal Masuk <small class="text-danger">*</small></label>
<input type="date" name="tgl_masuk" value="" class="form-control">
</div>
<div class="form-group ">
<label for="username">Tanggal Lahir <small class="text-danger">*</small></label>
<input type="date" name="tgl_lahir" value="" class="form-control">
</div>
<div class="form-group">
<label for="username">Kota Lahir <small class="text-danger">*</small></label>
<select class="js-example-basic-single" style="width: 338px;" name="kota">
<option></option>
<?php foreach ($cities as $city) : ?>
<option value="<?= $city['city_name']; ?>"><?= $city['city_name']; ?></option>
<?php endforeach; ?>
</select>
<small class="text-danger"><?= form_error('kota'); ?></small>
</div>
<div class="form-group">
<label>Jenis Kelamin <small class="text-danger">*</small></label>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="jenis_kelamin" value="L" name="jenis_kelamin" class="custom-control-input d-inline">
<label class="custom-control-label" for="jenis_kelamin"> Laki-laki</label>
</div>
<div class="custom-control custom-radio custom-control-inline">
<input type="radio" id="jenis_kelamin" value="P" name="jenis_kelamin" class="custom-control-input d-inline">
<label class="custom-control-label" for="jenis_kelamin"> Perempuan</label>
</div>
<small class="text-danger"><?= form_error('jenis_kelamin'); ?></small>
</div>
<div class="form-group ">
<label>Alamat <small class="text-danger">*</small></label>
<textarea name="alamat" value="" class="form-control"></textarea>
<small class="text-danger"><?= form_error('alamat'); ?></small>
</div>
<div class="form-group ">
<label>Nomor Hp <small class="text-danger">*</small></label>
<input type="text" name="nohp" value="" class="form-control">
<small class="text-danger"><?= form_error('nohp'); ?></small>
</div>
<div class="form-group ">
<label>Email</label>
<input type="text" name="email" value="" class="form-control">
<small class="text-danger"><?= form_error('email'); ?></small>
</div>
<div class="form-group">
<button type="submit" class="btn btn-success btn-flat">
<i class="fa fa-paper-plane"></i> Simpan
</button>
<button type="Reset" class="btn btn-flat">Reset</button>
</div>
</form>
</div>
</div>
</div>
</div>
</section>
<script>
$(document).ready(function() {
$('.js-example-basic-single').select2();
});
</script> | 56.212121 | 142 | 0.41743 |
43740a127c74f878aaef3b7de0ccaa25189af433 | 3,130 | tsx | TypeScript | src/components/Intro.tsx | pauloremoli/portfolio | ba8e13635591ee4803e1ef0550a1d1a7d6e1a9c2 | [
"MIT"
] | null | null | null | src/components/Intro.tsx | pauloremoli/portfolio | ba8e13635591ee4803e1ef0550a1d1a7d6e1a9c2 | [
"MIT"
] | null | null | null | src/components/Intro.tsx | pauloremoli/portfolio | ba8e13635591ee4803e1ef0550a1d1a7d6e1a9c2 | [
"MIT"
] | null | null | null | import { Text, TrackballControls, useProgress, Html, OrbitControls } from "@react-three/drei";
import { Canvas, useFrame } from "@react-three/fiber";
import React, { Suspense, useEffect, useMemo, useRef, useState } from "react";
import * as THREE from "three";
import Typewriter from "typewriter-effect";
function Word({ children, ...props }) {
const color = new THREE.Color();
const fontProps = {
fontSize: 2.5,
letterSpacing: -0.05,
lineHeight: 1,
"material-toneMapped": false,
};
const ref = useRef();
const [hovered, setHovered] = useState(false);
const over = (e) => (e.stopPropagation(), setHovered(true));
const out = () => setHovered(false);
// Change the mouse cursor on hover
useEffect(() => {
if (hovered) document.body.style.cursor = "pointer";
return () => (document.body.style.cursor = "auto");
}, [hovered]);
// Tie component to the render-loop
useFrame(({ camera }) => {
// Make text face the camera
ref.current.quaternion.copy(camera.quaternion);
// Animate font color
ref.current.material.color.lerp(
color.set(hovered ? "#fa2720" : "white"),
0.1
);
});
return (
<Text
ref={ref}
onPointerOver={over}
onPointerOut={out}
{...props}
{...fontProps}
children={children}
/>
);
}
function Cloud({ count = 8, radius = 20 }) {
const words = useMemo(() => {
const temp = [];
const spherical = new THREE.Spherical();
const phiSpan = Math.PI / (count + 1);
const thetaSpan = (Math.PI * 2) / count;
for (let i = 1; i < count + 1; i++)
for (let j = 0; j < count; j++)
temp.push([
new THREE.Vector3().setFromSpherical(
spherical.set(radius, phiSpan * i, thetaSpan * j)
),
"nodejs",
]);
return temp;
}, [count, radius]);
return words.map(([pos, word], index) => (
<Word key={index} position={pos} children={word} />
));
}
const Intro = () => {
return (
<section className="w-full h-full bg-black flex flex-col md:flex-row items-start md:items-center snap-start justify-center">
<div id="left" className="w-full md:w-1/3 h-full flex flex-col justify-around p-2 md:p-20">
<div className="p-4 flex flex-col">
<h1 className="text-2xl md:text-4xl text-gray-200 font-[Sora]">
Hi there, I'm
</h1>
<h1 className="text-3xl md:text-8xl text-red-400 font-bold font-[Sora]">
Paulo Remoli
</h1>
<h3 className="text-2xl uppercase text-white pt-8">Full-stack developer</h3>
</div>
</div>
<div id="right" className="w-full md:w-2/3 h-full relative ">
<Canvas dpr={[1, 2]} camera={{ position: [0, 0, 35], fov: 90 }}>
<Suspense fallback={null}>
<fog attach="fog" args={["#202025", 0, 80]} />
<Cloud count={8} radius={18} />
<TrackballControls noZoom={true} />
</Suspense>
<OrbitControls autoRotate={true} enableZoom={false} autoRotateSpeed={2}/>
</Canvas>
</div>
</section>
);
};
export default Intro;
| 31.938776 | 128 | 0.579553 |
d6127210340b851b644ca299e1a3619f5afe3250 | 177 | ps1 | PowerShell | src/functions/Format-ObjectName.ps1 | sabinio/Get-StaticDataProc | 40fa3c6457681ebf0f4fd6e65bee7268edcf2529 | [
"MIT"
] | null | null | null | src/functions/Format-ObjectName.ps1 | sabinio/Get-StaticDataProc | 40fa3c6457681ebf0f4fd6e65bee7268edcf2529 | [
"MIT"
] | null | null | null | src/functions/Format-ObjectName.ps1 | sabinio/Get-StaticDataProc | 40fa3c6457681ebf0f4fd6e65bee7268edcf2529 | [
"MIT"
] | null | null | null |
function Format-ObjectName
{
param([string]$Schema, [string]$Table)
$full = "[" + $Schema + "].[" + $Table + "]"
return $full.Replace("[[","[").Replace("]]","]")
}
| 22.125 | 52 | 0.514124 |
db22ca18a410da7d136d11029ab560f9cbfe24ff | 189 | sql | SQL | src/main/resources/org/support/project/knowledge/dao/sql/WebhooksDao/WebhooksDao_update.sql | kuro-channel/knowledge-1 | 6f74162ad54af961fb5069a27f49959b9e9a8048 | [
"Apache-2.0"
] | 742 | 2015-02-03T02:02:15.000Z | 2022-03-15T16:54:25.000Z | src/main/resources/org/support/project/knowledge/dao/sql/WebhooksDao/WebhooksDao_update.sql | kuro-channel/knowledge-1 | 6f74162ad54af961fb5069a27f49959b9e9a8048 | [
"Apache-2.0"
] | 760 | 2015-02-01T11:40:05.000Z | 2022-01-21T23:22:06.000Z | src/main/resources/org/support/project/knowledge/dao/sql/WebhooksDao/WebhooksDao_update.sql | kuro-channel/knowledge-1 | 6f74162ad54af961fb5069a27f49959b9e9a8048 | [
"Apache-2.0"
] | 285 | 2015-02-23T08:02:29.000Z | 2022-03-25T02:48:31.000Z | UPDATE WEBHOOKS
SET
STATUS = ?
, HOOK = ?
, CONTENT = ?
, INSERT_USER = ?
, INSERT_DATETIME = ?
, UPDATE_USER = ?
, UPDATE_DATETIME = ?
, DELETE_FLAG = ?
WHERE
WEBHOOK_ID = ?
;
| 13.5 | 22 | 0.592593 |
54976505e7e19fb08adc309ad1f43df235132362 | 10,179 | css | CSS | carreralasalamedas/css/stye.css | Navegayencuentra/navegayencuentra.github.io | 4f52fa33be39f8a32701bfb2bbba1e571f96e1dd | [
"Apache-2.0"
] | 1 | 2016-05-03T18:56:01.000Z | 2016-05-03T18:56:01.000Z | carreralasalamedas/css/stye.css | Navegayencuentra/navegayencuentra.github.io | 4f52fa33be39f8a32701bfb2bbba1e571f96e1dd | [
"Apache-2.0"
] | null | null | null | carreralasalamedas/css/stye.css | Navegayencuentra/navegayencuentra.github.io | 4f52fa33be39f8a32701bfb2bbba1e571f96e1dd | [
"Apache-2.0"
] | null | null | null | .pure-g {
letter-spacing: -0.31em;
/* Webkit: collapse white-space between units */
*letter-spacing: normal;
/* reset IE < 8 */
*word-spacing: -0.43em;
/* IE < 8: collapse white-space between units */
text-rendering: optimizespeed;
/* Webkit: fixes text-rendering: optimizeLegibility */ }
/* Opera as of 12 on Windows needs word-spacing.
The ".opera-only" selector is used to prevent actual prefocus styling
and is not required in markup.
*/
.opera-only :-o-prefocus,
.pure-g {
word-spacing: -0.43em; }
.pure-u {
display: inline-block;
zoom: 1;
*display: inline;
/* IE < 8: fake inline-block */
letter-spacing: normal;
word-spacing: normal;
vertical-align: top;
text-rendering: auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box; }
.pure-u-1,
.pure-u-1-2,
.pure-u-1-3,
.pure-u-2-3,
.pure-u-1-4,
.pure-u-3-4,
.pure-u-1-5,
.pure-u-2-5,
.pure-u-3-5,
.pure-u-4-5,
.pure-u-1-6,
.pure-u-5-6,
.pure-u-1-8,
.pure-u-3-8,
.pure-u-5-8,
.pure-u-7-8,
.pure-u-1-12,
.pure-u-5-12,
.pure-u-7-12,
.pure-u-11-12,
.pure-u-1-24,
.pure-u-5-24,
.pure-u-7-24,
.pure-u-11-24,
.pure-u-13-24,
.pure-u-17-24,
.pure-u-19-24,
.pure-u-23-24 {
display: inline-block;
zoom: 1;
*display: inline;
/* IE < 8: fake inline-block */
letter-spacing: normal;
word-spacing: normal;
vertical-align: top;
text-rendering: auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box; }
.pure-u-1 {
width: 100%; }
.pure-u-1-2 {
width: 50%; }
.pure-u-1-3 {
width: 33.33333%; }
.pure-u-2-3 {
width: 66.66666%; }
.pure-u-1-4 {
width: 25%; }
.pure-u-3-4 {
width: 75%; }
.pure-u-1-5 {
width: 20%; }
.pure-u-2-5 {
width: 40%; }
.pure-u-3-5 {
width: 60%; }
.pure-u-4-5 {
width: 80%; }
.pure-u-1-6 {
width: 16.656%; }
.pure-u-5-6 {
width: 83.33%; }
.pure-u-1-8 {
width: 12.5%; }
.pure-u-3-8 {
width: 37.5%; }
.pure-u-5-8 {
width: 62.5%; }
.pure-u-7-8 {
width: 87.5%; }
.pure-u-1-12 {
width: 8.3333%; }
.pure-u-5-12 {
width: 41.6666%; }
.pure-u-7-12 {
width: 58.3333%; }
.pure-u-11-12 {
width: 91.6666%; }
.pure-u-1-24 {
width: 4.1666%; }
.pure-u-5-24 {
width: 20.8333%; }
.pure-u-7-24 {
width: 29.1666%; }
.pure-u-11-24 {
width: 45.8333%; }
.pure-u-13-24 {
width: 54.1666%; }
.pure-u-17-24 {
width: 70.8333%; }
.pure-u-19-24 {
width: 79.1666%; }
.pure-u-23-24 {
width: 95.8333%; }
@media (max-width: 800px) {
.pure-u-1,
.pure-u-1-2,
.pure-u-1-3,
.pure-u-2-3,
.pure-u-1-4,
.pure-u-3-4,
.pure-u-1-5,
.pure-u-2-5,
.pure-u-3-5,
.pure-u-4-5,
.pure-u-1-6,
.pure-u-5-6 {
width: 100%; }
.pure-u-1-8 {
width: 30%; } }
body {
margin: 0;
font-family: "Lato";
font-weight: 400; }
h2 {
font-weight: 300;
font-size: 2.3em;
text-align: center; }
h3 {
text-align: center;
font-weight: 300; }
img {
width: auto;
max-width: 100%;
height: auto; }
header {
background: white;
padding: 0.5em; }
header .organizadores {
text-align: right;
display: inline-block; }
.logo-white, .logo-ajua {
margin: 0;
display: inline-block;
min-height: 78px;
background-repeat: no-repeat;
background-size: contain;
overflow: hidden;
text-indent: -3000px; }
.logo-white {
min-width: 300px;
background-image: url(../img/logo-carrerawhite.png); }
.logo-ajua {
background-image: url(../img/ajua.png);
min-width: 120px; }
.nav-on {
position: fixed;
top: 0;
left: 0;
z-index: 999; }
.nav-container {
height: 68px; }
nav {
padding: 1px 0;
border-bottom: 1px solid #333;
box-shadow: 0 0.2em 1em 0 rgba(0, 0, 0, 0.5);
background: white;
width: 100%; }
nav ul {
margin: 0;
word-spacing: -0.43em;
text-align: center; }
nav ul li {
display: inline-block;
zoom: 1;
*display: inline;
/* IE < 8: fake inline-block */
letter-spacing: normal;
word-spacing: normal;
vertical-align: top;
text-rendering: auto;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 1em;
text-transform: uppercase; }
nav ul li a {
text-decoration: none;
color: #333;
margin-bottom: 0.5em; }
nav ul li a:hover {
border-bottom: 1px solid #333; }
footer {
background: #333;
min-height: 50px;
padding: 1em;
color: white; }
.content {
width: 100%;
margin: auto; }
.carrera-hero {
padding: 4em 1em;
background: #E65100 no-repeat 0 0;
background-image: url(../img/sunrun.jpg);
background-size: cover;
background-position: 0 100%;
color: white;
text-align: center;
position: relative; }
.carrera-hero .logo, .carrera-hero .hero {
position: relative; }
.carrera-hero h2 {
font-family: "lato";
font-size: 6em;
line-height: 90px;
margin: 0;
text-transform: uppercase; }
.carrera-hero h2 span {
background: #E65100;
color: white;
display: inline block;
padding: 0 0.5em;
font-weight: 700;
font-size: 0.4em; }
.carrera-hero p {
font-weight: 300;
font-size: 2em;
margin: .3em; }
.carrera-datos {
padding: 1em 0.5em; }
.carrera-datos .info {
padding: .5em; }
.carrera-datos .jd {
text-align: center; }
.carrera-datos .jd h2 {
font-family: "Kaushan Script";
color: #000033; }
.carrera-datos .jd img {
max-height: 200px; }
.mapa {
display: block;
width: 100%;
border: 1px solid #333;
max-width: 900px;
margin: 0 auto;
margin-bottom: 1em; }
.inscripcion {
color: white;
padding: 1em 0;
background: #2E486D; }
.sedes {
background: #fff; }
.sedes .sbox {
padding: 1em; }
.sedes .sbox img {
display: block;
max-height: 100px;
max-width: 100%;
margin: 0 auto; }
.sedes .sbox h3 {
text-align: left;
font-weight: 700; }
.valores {
background: #E65100;
color: white;
padding: 1em;
text-align: center; }
.valores h2, .valores p {
max-width: 800px;
margin: 1em auto; }
.valores p {
font-size: 1.5em; }
.greatwall {
background: #333 no-repeat;
background-image: url(../img/greatwall.jpg);
background-size: cover;
border: 1px solid #333;
position: relative;
text-align: center;
margin: 0;
overflow: hidden; }
.greatwall div.gw-logo {
font-size: 1.5em;
font-family: "Kaushan Script";
position: relative;
background: white;
padding: 1em;
position: relative; }
.greatwall div.gw-logo:before {
content: " ";
top: 0;
left: 100%;
position: absolute;
border-width: 560px 5em 0px 0px;
border-color: white transparent;
border-style: solid;
width: 0;
height: 0;
-moz-transform: scale(0.9999); }
.greatwall div.gw-logo p {
margin: 0.3em; }
.greatwall div.gw-hero {
padding-left: 5m;
position: relative;
color: #fff; }
.greatwall div.gw-hero h2 {
font-size: 3em; }
.greatwall div.gw-hero h2 span {
color: #D2FF4D;
display: inline-block;
border-top: 5px #D2FF4D solid;
border-bottom: 5px #D2FF4D solid;
padding: 0.1em;
margin: 0.1em;
font-size: 2em; }
.contacto {
background: #333;
color: white;
padding: 2em 0; }
.contacto div {
padding: 1em; }
.contacto-form form {
max-width: 300px;
margin: 0 auto; }
.contacto-form label {
text-align: center;
display: block;
max-width: 300px; }
.contacto-form input, .contacto-form textarea {
display: block;
color: #333;
margin: 1em 0;
padding: 0.5em 0.2em;
width: 100%;
max-width: 300px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box; }
.contacto-form input[type="submit"] {
background: #333;
color: #fff;
width: 100%;
max-width: 300px; }
.contacto-form textarea {
min-height: 120px; }
.contacto-datos ul {
padding: 0;
list-style: none;
max-width: 600px;
margin: 0 auto; }
.contacto-datos ul li {
font-weight: 700; }
.contacto-datos ul li .icon-facebook:before {
content: ""; }
.contacto-datos ul li li {
display: inline-block;
height: 24px;
font-weight: 400;
line-height: 24px;
margin-left: 30px;
padding: 0.6em 0.8em 0.8em 0;
position: relative; }
.contacto-datos ul li li:before {
background: white;
border-radius: 50%;
color: #333;
left: -30px;
line-height: 24px;
text-align: center;
height: 24px;
width: 24px;
position: absolute;
top: .6em; }
.patrocinadores {
padding: 1px 0;
background: white;
text-align: center; }
.pantalla {
position: absolute;
background-color: rgba(0, 0, 0, 0.5);
width: 100%;
height: 100%;
top: 0;
left: 0; }
.imagenes-p li {
padding: 1em;
-webkit-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-moz-filter: grayscale(100%);
filter: grayscale(100%); }
.imagenes-p li:hover {
-webkit-filter: grayscale(0%);
-ms-filter: grayscale(0%);
-moz-filter: grayscale(0%);
filter: grayscale(0%); }
.button {
color: white;
background: #E65100;
border-radius: 0.3em;
text-align: center;
display: block;
margin: 0 auto;
padding: 1em;
width: 200px;
text-decoration: none;
-webkit-transition: background 0.4s ease-in-out;
-moz-transition: background 0.4s ease-in-out;
transition: background 0.4s ease-in-out;
-webkit-transition: color 0.4s ease-in-out;
-moz-transition: color 0.4s ease-in-out;
transition: color 0.4s ease-in-out; }
.button:hover {
background: #ff7b34; }
.button.btninscripcion {
background: #2E486D;
border: 1px solid white; }
.button.btninscripcion:hover {
background: white;
color: #2E486D; }
@media (max-width: 800px) {
.contacto-datos {
text-align: center; }
.carrera-hero h2 {
font-size: 4em; } }
@media (max-width: 480px) {
.logo-ajua, .logo-white {
display: block;
margin: 0 auto; }
nav {
display: none; }
.carrera-hero h2 {
font-size: 3em; } }
/*# sourceMappingURL=stye.css.map */
| 19.688588 | 72 | 0.592396 |
a9f12e1dc925afd3a16ae70244f630ee6bd0bf7a | 2,006 | php | PHP | modules/main/controllers/energy/OwnCounterController.php | ua4wne/newpoll | 7b53d252f944da48c9e12d10bb797f01427ee8d7 | [
"BSD-3-Clause"
] | null | null | null | modules/main/controllers/energy/OwnCounterController.php | ua4wne/newpoll | 7b53d252f944da48c9e12d10bb797f01427ee8d7 | [
"BSD-3-Clause"
] | null | null | null | modules/main/controllers/energy/OwnCounterController.php | ua4wne/newpoll | 7b53d252f944da48c9e12d10bb797f01427ee8d7 | [
"BSD-3-Clause"
] | null | null | null | <?php
namespace app\modules\main\controllers\energy;
use Yii;
use app\modules\main\models\EnergyForm;
use yii\web\Controller;
class OwnCounterController extends Controller
{
public function behaviors()
{
return [
'access' => [
'class' => \yii\filters\AccessControl::className(),
'rules' => [
[
'allow' => true,
'roles' => ['manager']
],
],
],
];
}
public function actionIndex()
{
$model = new EnergyForm();
if(\Yii::$app->request->isAjax){
$year = Yii::$app->request->post('year');
return EnergyForm::OwnCountReport($year);
}
else{
$model->start = date('Y-m').'-01';
$model->finish = date('Y-m-d');
$model->year = date('Y');
return $this->render('index',[
'model' => $model,
]);
}
}
public function actionDonut()
{
$model = new EnergyForm();
if(\Yii::$app->request->isAjax){
$year = Yii::$app->request->post('year');
return EnergyForm::OwnDonuteGraph($year);
}
else{
$model->start = date('Y-m').'-01';
$model->finish = date('Y-m-d');
$model->year = date('Y');
return $this->render('index',[
'model' => $model,
]);
}
}
public function actionTable()
{
$model = new EnergyForm();
if(\Yii::$app->request->isAjax){
$year = Yii::$app->request->post('year');
return EnergyForm::GetOwnTable($year);
}
else{
$model->start = date('Y-m').'-01';
$model->finish = date('Y-m-d');
$model->year = date('Y');
return $this->render('index',[
'model' => $model,
]);
}
}
}
| 25.717949 | 67 | 0.429711 |
05bb0d5d57c0636b145e7b7960340fb93eb1361e | 3,845 | py | Python | systemcheck/systems/ABAP/plugins/actions/action_abap_runtime_parameter.py | team-fasel/SystemCheck | cdc18ee0c8bab67f049228d28d03578babfafb3d | [
"MIT"
] | 2 | 2017-07-07T13:57:52.000Z | 2020-12-11T12:40:55.000Z | systemcheck/systems/ABAP/plugins/actions/action_abap_runtime_parameter.py | team-fasel/systemcheck | cdc18ee0c8bab67f049228d28d03578babfafb3d | [
"MIT"
] | 1 | 2017-02-23T19:30:12.000Z | 2017-02-28T19:15:44.000Z | systemcheck/systems/ABAP/plugins/actions/action_abap_runtime_parameter.py | team-fasel/systemcheck | cdc18ee0c8bab67f049228d28d03578babfafb3d | [
"MIT"
] | null | null | null | import systemcheck
from systemcheck.systems import ABAP
from systemcheck.checks.models import Check
from systemcheck.utils import Result, Fail
from systemcheck.checks.models.checks import Check
from systemcheck.models.meta import Base, ChoiceType, Column, ForeignKey, Integer, QtModelMixin, String, qtRelationship, relationship, RichString
from systemcheck.systems import ABAP
from pprint import pformat
print('importing module {}'.format(__name__))
class ActionAbapRuntimeParameter(systemcheck.plugins.ActionAbapCheck):
""" Validate Runtime Parameters
"""
def __init__(self):
super().__init__()
self.alchemyObjects = [ABAP.models.ActionAbapRuntimeParameter,
ABAP.models.ActionAbapRuntimeParameter__params,
ABAP.models.ActionAbapFolder]
self.initializeResult()
def initializeResult(self):
self.actionResult.addResultColumn('PARAMETERSET', 'Parameter Set Name')
self.actionResult.addResultColumn('RATING', 'Rating')
self.actionResult.addResultColumn('PARAMETER', 'Where Clause')
self.actionResult.addResultColumn('INSTANCE', 'Instance')
self.actionResult.addResultColumn('EXPECTED', 'Expected')
self.actionResult.addResultColumn('OPERATOR', 'Operator')
self.actionResult.addResultColumn('CONFIGURED', 'Configured')
def retrieveData(self, **parameters):
result=self.systemConnection.call_fm('TH_SERVER_LIST')
def _adaptLogonInfo(self, instanceData:dict)->dict:
""" Generate Logon Data to an individual instance"""
self.logger.debug('retrieved instance data: '+ pformat(instanceData))
logonInfo=self.systemObject.logon_info()
if 'mshost' in logonInfo:
logonInfo.pop('mshost', 0)
logonInfo.pop('msserv', 0)
logonInfo.pop('group', 0)
logonInfo['ashost']=instanceData['HOSTADDR_V4_STR']
logonInfo['sysnr']=instanceData['NAME'][-2:]
return logonInfo
def execute(self):
checkobj = self.checkObject
result = self.systemConnection.call_fm('TH_SERVER_LIST')
if not result.fail:
instances=result.data
else:
self.rateOverallResult(error=True, errormessage=result.fail)
return Result(data=self.actionResult)
for parameterSet in checkobj.params:
for instance in instances['LIST_IPV6']:
record = dict(RATING='pass',
PARAMETERSET=parameterSet.param_set_name,
PARAMETER=parameterSet.parameter,
EXPECTED=parameterSet.expected_value,
INSTANCE=instance['NAME'],
OPERATOR=self.operators.lookup(parameterSet.operator))
logonInfo=self._adaptLogonInfo(instance)
result=ABAP.utils.get_connection(logonInfo)
if result.fail:
record['RATING']='error'
record['CONFIGURED']=result.fail
self.actionResult.addResult(record)
else:
connection=result.data
result=connection.get_runtime_parameter(record['PARAMETER'])
if result.fail:
record['RATING'] = 'error'
record['CONFIGURED']=result.fail
self.actionResult.addResult(record)
else:
response=result.data
record['CONFIGURED']=response['value']
record = self.rateIndividualResult(record)
self.actionResult.addResult(record)
connection.close()
self.rateOverallResult()
| 38.838384 | 145 | 0.611183 |
c6adeae1cf95e85b9fc51739ac693b5576bd02b6 | 2,583 | py | Python | robustsp/DependentData/arma_est_bip_tau.py | ICASSP-2020-Robustness-Tutorial/Robust-Signal-Processing-Toolbox-Python | 967186d017c895182eb45ef7ae2eaade11904a1c | [
"MIT"
] | 4 | 2020-05-04T11:24:11.000Z | 2020-11-12T19:07:12.000Z | robustsp/DependentData/arma_est_bip_tau.py | RobustSP/robustsp | 293f4281fdbd475549aa42eae9fe615976af27a0 | [
"MIT"
] | 1 | 2019-07-06T08:57:15.000Z | 2019-07-06T08:57:15.000Z | robustsp/DependentData/arma_est_bip_tau.py | RobustSP/robustsp | 293f4281fdbd475549aa42eae9fe615976af27a0 | [
"MIT"
] | 2 | 2019-12-03T15:04:44.000Z | 2020-05-03T04:32:29.000Z | import numpy as np
import robustsp as rsp
from scipy.optimize import least_squares as lsq
from scipy.optimize import minimize
'''
The function arma_est_bip_tau(x,p,q) comuptes BIP tau-estimates of the
ARMA model parameters. It also computes an outlier cleaned signal using BIP-ARMA(p,q) predictions
%INPUTS
x: 1darray, dtype=float. data (observations/measurements/signal)
p: int. autoregressive order
q: int. moving-average order
%OUTPUTS
result.ar_coeffs: vector of BIP-AR(p) tau-estimates
result.ma_coeffs: vector of BIP-MA(q) tau-estimates
result.inno_scale: BIP s-estimate of the innovations scale
result.cleaned signal: outlier cleaned signal using BIP-ARMA(p,q) predictions
result.ar_coeffs_init: robust starting point for BIP-AR(p) tau-estimates
result.ma_coeffs_init: robust starting point for BIP-MA(q) tau-estimates
The function "robust_starting_point" calls "sarimax" from statsmodels to compute classical ARMA parameter estimate based on cleaned
data. Replace highlighted code by a different (nonrobust) ARMA parameter estimator if you
do not have the toolbox.
"Robust Statistics for Signal Processing"
Zoubir, A.M. and Koivunen, V. and Ollila, E. and Muma, M.
Cambridge University Press, 2018.
"Bounded Influence Propagation $\tau$-Estimation: A New Robust Method for ARMA Model Estimation."
Muma, M. and Zoubir, A.M.
IEEE Transactions on Signal Processing, 65(7), 1712-1727, 2017.
'''
def arma_est_bip_tau(x,p,q,meth='SLSQP'):
# Robust starting point by BIP AR-tau approximation
beta_initial = rsp.robust_starting_point(x,p,q)[0]
F = lambda beta: rsp.arma_tau_resid_sc(x,beta,p,q)
F_bip = lambda beta: rsp.bip_tau_resid_sc(x,beta,p,q)[0]
beta_arma = minimize(F, beta_initial, method=meth)['x']
beta_bip = minimize(F_bip, beta_initial, method=meth)['x']
a_sc = rsp.arma_tau_resid_sc(x,beta_arma,p,q) # innovations tau-scale for ARMA model
a_bip_sc, x_filt, _ = rsp.bip_tau_resid_sc(x, beta_bip, p, q) # innovations tau-scale for BIP-ARMA model
# final parameter estimate uses the model that provides smallest tau_scale
beta_hat = beta_arma if a_sc<a_bip_sc else beta_bip
# final tau scale
a_tau_sc = min(a_sc, a_bip_sc)
# Output the results
results = {'ar_coeffs': -beta_hat[:p],
'ma_coeffs': -beta_hat[p:],
'inno_scale': a_tau_sc,
'cleaned_signal': x_filt,
'ar_coeffs_init': -1*beta_initial[:p],
'ma_coeffs_init': -1*beta_initial[p:]}
return results | 38.552239 | 133 | 0.716221 |
0276fb5b3ecb4ca00285ab7a675d994b9156894b | 2,887 | cpp | C++ | Calculator/Main.cpp | a2937/calculator-c-plus | f87b9ba54beb0d1968c1702e12e185676b1ff8e6 | [
"MIT"
] | null | null | null | Calculator/Main.cpp | a2937/calculator-c-plus | f87b9ba54beb0d1968c1702e12e185676b1ff8e6 | [
"MIT"
] | null | null | null | Calculator/Main.cpp | a2937/calculator-c-plus | f87b9ba54beb0d1968c1702e12e185676b1ff8e6 | [
"MIT"
] | null | null | null | // Main.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
/**
* A calculator application that performs addition, multiplication, subtraction, and
* division.Input is given by typing a number and hitting enter on the console.
* After performing an operation, the user is given an option to quit. By entering 1,
* the program will exit. Otherwise it will prompt the user for another operation.
*/
#include "Calculator.h"
#include <iostream>
using std::cin;
using std::cout;
int main()
{
double firstNumber = 0;
double secondNumber = 0;
double result = 0;
int operation = -1;
bool correctOperation = false;
bool done = false;
Calculator* calc = new Calculator();
printf("Welcome to my calculator program!\n");
printf("Please type the first number. \n");
scanf_s("%lf", &firstNumber);
printf("Please type the second number. \n");
scanf_s("%lf", &secondNumber);
while (done == false)
{
while (correctOperation == false)
{
printf("Options: \n 1 : Add \n 2: Subtract \n 3: Multiply \n 4: Divide \n ");
scanf_s("%i", &operation);
if (operation < 1 || operation > 4)
{
printf("Choice not recognized. Please try again. \n");
printf("Options: \n 1 : Add \n 2: Subtract \n 3: Multiply \n 4: Divide \n >");
scanf_s("%i", &operation);
}
else
{
correctOperation = true;
}
}
if (operation == 1)
{
result = calc->Add(firstNumber, secondNumber);
printf("Result is %lf \n", result);
}
else if (operation == 2)
{
result = calc->Subtract(firstNumber, secondNumber);
printf("Result is %lf \n", result);
}
else if (operation == 3)
{
result = calc->Multiply(firstNumber, secondNumber);
printf("Result is %lf \n", result);
}
else if (operation == 4)
{
result = calc->Divide(firstNumber, secondNumber);
printf("Result is %lf \n", result);
}
int doneYet = 0;
printf("Type 1 and hit enter to quit. Otherwise type any other number to continue.\n");
scanf_s("%d", &doneYet);
if (doneYet == 1)
{
printf("Shutting down. \n");
done = true;
}
correctOperation = false;
}
return 0;
}
// Run program: Ctrl + F5 or Debug > Start Without Debugging menu
// Debug program: F5 or Debug > Start Debugging menu
// Tips for Getting Started:
// 1. Use the Solution Explorer window to add/manage files
// 2. Use the Team Explorer window to connect to source control
// 3. Use the Output window to see build output and other messages
// 4. Use the Error List window to view errors
// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project
// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file
| 32.077778 | 135 | 0.638379 |
a3e32f98715dda87a9eacf725c6c138a0e495894 | 11,009 | java | Java | test/005-annotations/src/android/test/anno/TestAnnotations.java | Paschalis/android-llvm | 317f7fd4b736a0511a2273a2487915c34cf8933e | [
"Apache-2.0"
] | 20 | 2021-06-24T16:38:42.000Z | 2022-01-20T16:15:57.000Z | test/005-annotations/src/android/test/anno/TestAnnotations.java | Paschalis/android-llvm | 317f7fd4b736a0511a2273a2487915c34cf8933e | [
"Apache-2.0"
] | null | null | null | test/005-annotations/src/android/test/anno/TestAnnotations.java | Paschalis/android-llvm | 317f7fd4b736a0511a2273a2487915c34cf8933e | [
"Apache-2.0"
] | 4 | 2021-11-03T06:01:12.000Z | 2022-02-24T02:57:31.000Z | /*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.test.anno;
import java.lang.annotation.Annotation;
import java.lang.annotation.AnnotationFormatError;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.TreeMap;
public class TestAnnotations {
/**
* Print the annotations in sorted order, so as to avoid
* any (legitimate) non-determinism with regard to the iteration order.
*/
static private void printAnnotationArray(String prefix, Annotation[] arr) {
TreeMap<String, Annotation> sorted =
new TreeMap<String, Annotation>();
for (Annotation a : arr) {
sorted.put(a.annotationType().getName(), a);
}
for (Annotation a : sorted.values()) {
System.out.println(prefix + " " + a);
System.out.println(prefix + " " + a.annotationType());
}
}
static void printAnnotations(Class<?> clazz) {
Annotation[] annos;
Annotation[][] parAnnos;
annos = clazz.getAnnotations();
System.out.println("annotations on TYPE " + clazz +
"(" + annos.length + "):");
printAnnotationArray("", annos);
System.out.println();
for (Constructor<?> c: clazz.getDeclaredConstructors()) {
annos = c.getDeclaredAnnotations();
System.out.println(" annotations on CTOR " + c + ":");
printAnnotationArray(" ", annos);
System.out.println(" constructor parameter annotations:");
for (Annotation[] pannos: c.getParameterAnnotations()) {
printAnnotationArray(" ", pannos);
}
}
for (Method m: clazz.getDeclaredMethods()) {
annos = m.getDeclaredAnnotations();
System.out.println(" annotations on METH " + m + ":");
printAnnotationArray(" ", annos);
System.out.println(" method parameter annotations:");
for (Annotation[] pannos: m.getParameterAnnotations()) {
printAnnotationArray(" ", pannos);
}
}
for (Field f: clazz.getDeclaredFields()) {
annos = f.getDeclaredAnnotations();
System.out.println(" annotations on FIELD " + f + ":");
printAnnotationArray(" ", annos);
AnnoFancyField aff;
aff = (AnnoFancyField) f.getAnnotation(AnnoFancyField.class);
if (aff != null) {
System.out.println(" aff: " + aff + " / " + Proxy.isProxyClass(aff.getClass()));
System.out.println(" --> nombre is '" + aff.nombre() + "'");
}
}
System.out.println();
}
@ExportedProperty(mapping = {
@IntToString(from = 0, to = "NORMAL_FOCUS"),
@IntToString(from = 2, to = "WEAK_FOCUS")
})
public int getFocusType() {
return 2;
}
@AnnoArrayField
String thing1;
@AnnoArrayField(
zz = {true,false,true},
bb = {-1,0,1},
cc = {'Q'},
ss = {12,13,14,15,16,17},
ii = {1,2,3,4},
ff = {1.1f,1.2f,1.3f},
jj = {-5,0,5},
dd = {0.3,0.6,0.9},
str = {"hickory","dickory","dock"}
)
String thing2;
public static void testArrays() {
TestAnnotations ta = new TestAnnotations();
Field field;
Annotation[] annotations;
try {
field = TestAnnotations.class.getDeclaredField("thing1");
annotations = field.getAnnotations();
System.out.println(field + ": " + annotations[0].toString());
field = TestAnnotations.class.getDeclaredField("thing2");
annotations = field.getAnnotations();
System.out.println(field + ": " + annotations[0].toString());
} catch (NoSuchFieldException nsfe) {
throw new RuntimeException(nsfe);
}
}
public static void testArrayProblem() {
Method meth;
ExportedProperty property;
final IntToString[] mapping;
try {
meth = TestAnnotations.class.getMethod("getFocusType");
} catch (NoSuchMethodException nsme) {
throw new RuntimeException(nsme);
}
property = meth.getAnnotation(ExportedProperty.class);
mapping = property.mapping();
System.out.println("mapping is " + mapping.getClass() +
"\n 0='" + mapping[0] + "'\n 1='" + mapping[1] + "'");
/* while we're here, check isAnnotationPresent on Method */
System.out.println("present(getFocusType, ExportedProperty): " +
meth.isAnnotationPresent(ExportedProperty.class));
System.out.println("present(getFocusType, AnnoSimpleType): " +
meth.isAnnotationPresent(AnnoSimpleType.class));
System.out.println("");
}
public static void testVisibilityCompatibility() throws Exception {
if (!VMRuntime.isAndroid()) {
return;
}
Object runtime = VMRuntime.getRuntime();
int currentSdkVersion = VMRuntime.getTargetSdkVersion(runtime);
// SDK version 23 is M.
int oldSdkVersion = 23;
VMRuntime.setTargetSdkVersion(runtime, oldSdkVersion);
// This annotation has CLASS retention, but is visible to the runtime in M and earlier.
Annotation anno = SimplyNoted.class.getAnnotation(AnnoSimpleTypeInvis.class);
if (anno == null) {
System.out.println("testVisibilityCompatibility failed: " +
"SimplyNoted.get(AnnoSimpleTypeInvis) should not be null");
}
VMRuntime.setTargetSdkVersion(runtime, currentSdkVersion);
}
public static void main(String[] args) {
System.out.println("TestAnnotations...");
testArrays();
testArrayProblem();
System.out.println(
"AnnoSimpleField " + AnnoSimpleField.class.isAnnotation() +
", SimplyNoted " + SimplyNoted.class.isAnnotation());
printAnnotations(SimplyNoted.class);
printAnnotations(INoted.class);
printAnnotations(SubNoted.class);
printAnnotations(FullyNoted.class);
try {
ClassWithInnerAnnotationClass.class.getDeclaredClasses();
throw new AssertionError();
} catch (NoClassDefFoundError expected) {
}
// this is expected to be non-null
Annotation anno = SimplyNoted.class.getAnnotation(AnnoSimpleType.class);
System.out.println("SimplyNoted.get(AnnoSimpleType) = " + anno);
// this is expected to be null
anno = SimplyNoted.class.getAnnotation(AnnoSimpleTypeInvis.class);
System.out.println("SimplyNoted.get(AnnoSimpleTypeInvis) = " + anno);
// this is non-null if the @Inherited tag is present
anno = SubNoted.class.getAnnotation(AnnoSimpleType.class);
System.out.println("SubNoted.get(AnnoSimpleType) = " + anno);
System.out.println();
// Package annotations aren't inherited, so getAnnotations and getDeclaredAnnotations are
// the same.
System.out.println("Package annotations:");
printAnnotationArray(" ", TestAnnotations.class.getPackage().getAnnotations());
System.out.println("Package declared annotations:");
printAnnotationArray(" ", TestAnnotations.class.getPackage().getDeclaredAnnotations());
System.out.println();
// Test inner classes.
System.out.println("Inner Classes:");
new ClassWithInnerClasses().print();
System.out.println();
// Test TypeNotPresentException.
try {
AnnoMissingClass missingAnno =
ClassWithMissingAnnotation.class.getAnnotation(AnnoMissingClass.class);
System.out.println("Get annotation with missing class should not throw");
System.out.println(missingAnno.value());
System.out.println("Getting value of missing annotaton should have thrown");
} catch (TypeNotPresentException expected) {
System.out.println("Got expected TypeNotPresentException");
}
// Test renamed enums.
try {
for (Method m: RenamedNoted.class.getDeclaredMethods()) {
Annotation[] annos = m.getDeclaredAnnotations();
System.out.println(" annotations on METH " + m + ":");
}
} catch (Error expected) {
System.out.println("Got expected Error for renamed enum");
}
// Test if annotations marked VISIBILITY_BUILD are visible to runtime in M and earlier.
try {
testVisibilityCompatibility();
} catch (Exception e) {
System.out.println("testVisibilityCompatibility failed: " + e);
}
}
private static class VMRuntime {
private static Class<?> vmRuntimeClass;
private static Method getRuntimeMethod;
private static Method getTargetSdkVersionMethod;
private static Method setTargetSdkVersionMethod;
static {
init();
}
private static void init() {
try {
vmRuntimeClass = Class.forName("dalvik.system.VMRuntime");
} catch (Exception e) {
return;
}
try {
getRuntimeMethod = vmRuntimeClass.getDeclaredMethod("getRuntime");
getTargetSdkVersionMethod =
vmRuntimeClass.getDeclaredMethod("getTargetSdkVersion");
setTargetSdkVersionMethod =
vmRuntimeClass.getDeclaredMethod("setTargetSdkVersion", Integer.TYPE);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public static boolean isAndroid() {
return vmRuntimeClass != null;
}
public static Object getRuntime() throws Exception {
return getRuntimeMethod.invoke(null);
}
public static int getTargetSdkVersion(Object runtime) throws Exception {
return (int) getTargetSdkVersionMethod.invoke(runtime);
}
public static void setTargetSdkVersion(Object runtime, int version) throws Exception {
setTargetSdkVersionMethod.invoke(runtime, version);
}
}
}
| 36.696667 | 99 | 0.602598 |
249f65b03151cccaf560f302d33f78cfe32a26e1 | 1,489 | php | PHP | src/Laravel/FullPlatformServiceProvider.php | DalunSelf/full-platform-sdk | 0816a7c91cbba22f4c82a3f47bd2d8e330ecca09 | [
"Apache-2.0"
] | null | null | null | src/Laravel/FullPlatformServiceProvider.php | DalunSelf/full-platform-sdk | 0816a7c91cbba22f4c82a3f47bd2d8e330ecca09 | [
"Apache-2.0"
] | null | null | null | src/Laravel/FullPlatformServiceProvider.php | DalunSelf/full-platform-sdk | 0816a7c91cbba22f4c82a3f47bd2d8e330ecca09 | [
"Apache-2.0"
] | null | null | null | <?php
/**
* Copyright 2020 Ryan Corporation
*
* Ryan Corporation licenses this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
namespace Ryan\Laravel;
use Ryan\FullPlatform;
use Ryan\FullPlatform\HTTPClient\CurlHTTPClient;
class FullPlatformServiceProvider extends \Illuminate\Support\ServiceProvider
{
/**
* Register bindings in the container.
*
* @return void
*/
public function register()
{
$this->mergeConfigFrom(
__DIR__ . '/config/full-platform.php',
'full-platform'
);
$this->app->bind('full-platform-http-client', function () {
return new CurlHTTPClient(config('full-platform.channel_access_token'));
});
$this->app->bind('full-platform', function ($app) {
$httpClient = $app->make('full-platform-http-client');
return new FullPlatform($httpClient, ['channelSecret' => config('full-platform.channel_secret')]);
});
}
}
| 32.369565 | 110 | 0.672263 |
daabf615dc448b33f7699459a924404eea66e42f | 68,678 | php | PHP | resources/views/app/login.blade.php | tuyandre/research | 598300e4e74bbe4191afc6c7bf9c74747aab56bc | [
"MIT"
] | null | null | null | resources/views/app/login.blade.php | tuyandre/research | 598300e4e74bbe4191afc6c7bf9c74747aab56bc | [
"MIT"
] | null | null | null | resources/views/app/login.blade.php | tuyandre/research | 598300e4e74bbe4191afc6c7bf9c74747aab56bc | [
"MIT"
] | null | null | null | <html dir="ltr" lang="en" xmlns="http://www.w3.org/1999/html" class="global-potloc-init">
<head>
<link rel="stylesheet" media="screen" href="{{asset('/assets/assets/potloc-init-2f54473f8ff16cec201d976c849ef24c04b94a1b01e3b03d8117a81c75f199a9.css')}}">
{{--<script src="{{asset('/assets/assets/potloc-init-43d2b616dbc7e97a18349e50b32994c8d2c9812744c336df856908989ab0a321.js')}}"></script>--}}
<script>
window.__POTLOC_INIT__.setCheckList("isCookieEnabled", true);
window.__POTLOC_INIT__.setCheckList("isBrowserSupported", false);
</script>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport">
<meta content="Meet Ethical Research Solutions" name="author">
<title>Ethical Research Solutions | Dashboard Consumer Research | Ethical Research Solutions</title>
<meta name="csrf-param" content="authenticity_token">
<meta name="csrf-token" content="ZlKr4hNm9HZ9W5XxXjVCVsGjpBr87PzKR+crYVn6LeZp9aTxEHIL+8yA2vYpIVEKq+UKKMQkcTVZt+a9+Oby5A==">
<link href="https://fonts.googleapis.com/css?family=DM+Sans:400,500,700&display=swap" rel="stylesheet">
<link rel="stylesheet" media="screen" href="{{asset('/assets/packs/css/authentication-0d05ad17.chunk.css')}}">
<style data-jss="" data-meta="MuiBox">
</style>
<style data-jss="" data-meta="MuiBox">
</style>
<style data-jss="" data-meta="MuiBox">
</style>
<style data-jss="" data-meta="MuiBox">
</style>
<style data-jss="" data-meta="MuiTypography">
.MuiTypography-root {
margin: 0;
}
.MuiTypography-body2 {
color: #0D1D3D;
font-size: 0.875rem;
font-family: DM Sans,"Helvetica Neue",Arial,-apple-system,BlinkMacSystemFont,sans-serif,"Apple Color Emoji";
font-weight: 400;
line-height: 1.43;
letter-spacing: 0;
}
.MuiTypography-body1 {
color: #0D1D3D;
font-size: 1rem;
font-family: DM Sans,"Helvetica Neue",Arial,-apple-system,BlinkMacSystemFont,sans-serif,"Apple Color Emoji";
font-weight: 400;
line-height: 1.5;
letter-spacing: 0;
}
.MuiTypography-caption {
color: #0D1D3D;
font-size: 0.75rem;
font-family: DM Sans,"Helvetica Neue",Arial,-apple-system,BlinkMacSystemFont,sans-serif,"Apple Color Emoji";
font-weight: 400;
line-height: 1.66;
letter-spacing: 0;
}
.MuiTypography-button {
color: #F8F9FA;
font-size: 1rem;
font-family: DM Sans,"Helvetica Neue",Arial,-apple-system,BlinkMacSystemFont,sans-serif,"Apple Color Emoji";
font-weight: 400;
line-height: 1.75;
letter-spacing: 0;
text-transform: none;
}
.MuiTypography-h1 {
color: #0D1D3D;
font-size: 6rem;
font-family: DM Sans,"Helvetica Neue",Arial,-apple-system,BlinkMacSystemFont,sans-serif,"Apple Color Emoji";
font-weight: 400;
line-height: 1;
letter-spacing: 0;
}
.MuiTypography-h2 {
color: #0D1D3D;
font-size: 3.75rem;
font-family: DM Sans,"Helvetica Neue",Arial,-apple-system,BlinkMacSystemFont,sans-serif,"Apple Color Emoji";
font-weight: 400;
line-height: 1;
letter-spacing: 0;
}
.MuiTypography-h3 {
color: #0D1D3D;
font-size: 3rem;
font-family: DM Sans,"Helvetica Neue",Arial,-apple-system,BlinkMacSystemFont,sans-serif,"Apple Color Emoji";
font-weight: 500;
line-height: 1.04;
letter-spacing: 0;
}
.MuiTypography-h4 {
color: #0D1D3D;
font-size: 2.125rem;
font-family: DM Sans,"Helvetica Neue",Arial,-apple-system,BlinkMacSystemFont,sans-serif,"Apple Color Emoji";
font-weight: 500;
line-height: 1.2;
letter-spacing: 0.00735em;
}
.MuiTypography-h5 {
color: #0D1D3D;
font-size: 1.5rem;
font-family: DM Sans,"Helvetica Neue",Arial,-apple-system,BlinkMacSystemFont,sans-serif,"Apple Color Emoji";
font-weight: 500;
line-height: 1.33;
letter-spacing: 0;
}
.MuiTypography-h6 {
color: #0D1D3D;
font-size: 1.25rem;
font-family: DM Sans,"Helvetica Neue",Arial,-apple-system,BlinkMacSystemFont,sans-serif,"Apple Color Emoji";
font-weight: 500;
line-height: 1.2;
letter-spacing: 0;
}
.MuiTypography-subtitle1 {
color: #5A7092;
font-size: 1rem;
font-family: DM Sans,"Helvetica Neue",Arial,-apple-system,BlinkMacSystemFont,sans-serif,"Apple Color Emoji";
font-weight: 400;
line-height: 1.5;
letter-spacing: 0;
}
.MuiTypography-subtitle2 {
color: #5A7092;
font-size: 0.875rem;
font-family: DM Sans,"Helvetica Neue",Arial,-apple-system,BlinkMacSystemFont,sans-serif,"Apple Color Emoji";
font-weight: 400;
line-height: 1.57;
letter-spacing: 0;
}
.MuiTypography-overline {
color: #5A7092;
font-size: 0.625rem;
font-family: DM Sans,"Helvetica Neue",Arial,-apple-system,BlinkMacSystemFont,sans-serif,"Apple Color Emoji";
font-weight: 500;
line-height: 2.66;
letter-spacing: 0;
text-transform: uppercase;
}
.MuiTypography-srOnly {
width: 1px;
height: 1px;
overflow: hidden;
position: absolute;
}
.MuiTypography-alignLeft {
text-align: left;
}
.MuiTypography-alignCenter {
text-align: center;
}
.MuiTypography-alignRight {
text-align: right;
}
.MuiTypography-alignJustify {
text-align: justify;
}
.MuiTypography-noWrap {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.MuiTypography-gutterBottom {
margin-bottom: 0.35em;
}
.MuiTypography-paragraph {
margin-bottom: 16px;
}
.MuiTypography-colorInherit {
color: inherit;
}
.MuiTypography-colorPrimary {
color: #E80D70;
}
.MuiTypography-colorSecondary {
color: #176AE6;
}
.MuiTypography-colorTextPrimary {
color: rgba(0, 0, 0, 0.87);
}
.MuiTypography-colorTextSecondary {
color: rgba(0, 0, 0, 0.54);
}
.MuiTypography-colorError {
color: #D02D25;
}
.MuiTypography-displayInline {
display: inline;
}
.MuiTypography-displayBlock {
display: block;
}
</style>
<style data-jss="" data-meta="MuiPaper">
.MuiPaper-root {
color: rgba(0, 0, 0, 0.87);
transition: box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
background-color: #fff;
}
.MuiPaper-rounded {
border-radius: 4px;
}
.MuiPaper-outlined {
border: 1px solid #E3E5ED;
}
.MuiPaper-elevation0 {
box-shadow: none;
}
.MuiPaper-elevation1 {
box-shadow: 0px 2px 1px -1px rgba(23,43,77,0.04),0px 1px 1px 0px rgba(23,43,77,0.06),0px 1px 3px 0px rgba(23,43,77,0.1);
}
.MuiPaper-elevation2 {
box-shadow: 0px 3px 1px -2px rgba(23,43,77,0.04),0px 2px 2px 0px rgba(23,43,77,0.06),0px 1px 5px 0px rgba(23,43,77,0.1);
}
.MuiPaper-elevation3 {
box-shadow: 0px 3px 3px -2px rgba(23,43,77,0.04),0px 3px 4px 0px rgba(23,43,77,0.06),0px 1px 8px 0px rgba(23,43,77,0.1);
}
.MuiPaper-elevation4 {
box-shadow: 0px 2px 4px -1px rgba(23,43,77,0.04),0px 4px 5px 0px rgba(23,43,77,0.06),0px 1px 10px 0px rgba(23,43,77,0.1);
}
.MuiPaper-elevation5 {
box-shadow: 0px 3px 5px -1px rgba(23,43,77,0.04),0px 5px 8px 0px rgba(23,43,77,0.06),0px 1px 14px 0px rgba(23,43,77,0.1);
}
.MuiPaper-elevation6 {
box-shadow: 0px 3px 5px -1px rgba(23,43,77,0.04),0px 6px 10px 0px rgba(23,43,77,0.06),0px 1px 18px 0px rgba(23,43,77,0.1);
}
.MuiPaper-elevation7 {
box-shadow: 0px 4px 5px -2px rgba(23,43,77,0.04),0px 7px 10px 1px rgba(23,43,77,0.06),0px 2px 16px 1px rgba(23,43,77,0.1);
}
.MuiPaper-elevation8 {
box-shadow: 0px 5px 5px -3px rgba(23,43,77,0.04),0px 8px 10px 1px rgba(23,43,77,0.06),0px 3px 14px 2px rgba(23,43,77,0.1);
}
.MuiPaper-elevation9 {
box-shadow: 0px 5px 6px -3px rgba(23,43,77,0.04),0px 9px 12px 1px rgba(23,43,77,0.06),0px 3px 16px 2px rgba(23,43,77,0.1);
}
.MuiPaper-elevation10 {
box-shadow: 0px 6px 6px -3px rgba(23,43,77,0.04),0px 10px 14px 1px rgba(23,43,77,0.06),0px 4px 18px 3px rgba(23,43,77,0.1);
}
.MuiPaper-elevation11 {
box-shadow: 0px 6px 7px -4px rgba(23,43,77,0.04),0px 11px 15px 1px rgba(23,43,77,0.06),0px 4px 20px 3px rgba(23,43,77,0.1);
}
.MuiPaper-elevation12 {
box-shadow: 0px 7px 8px -4px rgba(23,43,77,0.04),0px 12px 17px 2px rgba(23,43,77,0.06),0px 5px 22px 4px rgba(23,43,77,0.1);
}
.MuiPaper-elevation13 {
box-shadow: 0px 7px 8px -4px rgba(23,43,77,0.04),0px 13px 19px 2px rgba(23,43,77,0.06),0px 5px 24px 4px rgba(23,43,77,0.1);
}
.MuiPaper-elevation14 {
box-shadow: 0px 7px 9px -4px rgba(23,43,77,0.04),0px 14px 21px 2px rgba(23,43,77,0.06),0px 5px 26px 4px rgba(23,43,77,0.1);
}
.MuiPaper-elevation15 {
box-shadow: 0px 8px 9px -5px rgba(23,43,77,0.04),0px 15px 22px 2px rgba(23,43,77,0.06),0px 6px 28px 5px rgba(23,43,77,0.1);
}
.MuiPaper-elevation16 {
box-shadow: 0px 8px 10px -5px rgba(23,43,77,0.04),0px 16px 24px 2px rgba(23,43,77,0.06),0px 6px 30px 5px rgba(23,43,77,0.1);
}
.MuiPaper-elevation17 {
box-shadow: 0px 8px 11px -5px rgba(23,43,77,0.04),0px 17px 26px 2px rgba(23,43,77,0.06),0px 6px 32px 5px rgba(23,43,77,0.1);
}
.MuiPaper-elevation18 {
box-shadow: 0px 9px 11px -5px rgba(23,43,77,0.04),0px 18px 28px 2px rgba(23,43,77,0.06),0px 7px 34px 6px rgba(23,43,77,0.1);
}
.MuiPaper-elevation19 {
box-shadow: 0px 9px 12px -6px rgba(23,43,77,0.04),0px 19px 29px 2px rgba(23,43,77,0.06),0px 7px 36px 6px rgba(23,43,77,0.1);
}
.MuiPaper-elevation20 {
box-shadow: 0px 10px 13px -6px rgba(23,43,77,0.04),0px 20px 31px 3px rgba(23,43,77,0.06),0px 8px 38px 7px rgba(23,43,77,0.1);
}
.MuiPaper-elevation21 {
box-shadow: 0px 10px 13px -6px rgba(23,43,77,0.04),0px 21px 33px 3px rgba(23,43,77,0.06),0px 8px 40px 7px rgba(23,43,77,0.1);
}
.MuiPaper-elevation22 {
box-shadow: 0px 10px 14px -6px rgba(23,43,77,0.04),0px 22px 35px 3px rgba(23,43,77,0.06),0px 8px 42px 7px rgba(23,43,77,0.1);
}
.MuiPaper-elevation23 {
box-shadow: 0px 11px 14px -7px rgba(23,43,77,0.04),0px 23px 36px 3px rgba(23,43,77,0.06),0px 9px 44px 8px rgba(23,43,77,0.1);
}
.MuiPaper-elevation24 {
box-shadow: 0px 11px 15px -7px rgba(23,43,77,0.04),0px 24px 38px 3px rgba(23,43,77,0.06),0px 9px 46px 8px rgba(23,43,77,0.1);
}
</style>
<style data-jss="" data-meta="MuiDialog">
@media print {
.MuiDialog-root {
position: absolute !important;
}
}
.MuiDialog-scrollPaper {
display: flex;
align-items: center;
justify-content: center;
}
.MuiDialog-scrollBody {
overflow-x: hidden;
overflow-y: auto;
text-align: center;
}
.MuiDialog-scrollBody:after {
width: 0;
height: 100%;
content: "";
display: inline-block;
vertical-align: middle;
}
.MuiDialog-container {
height: 100%;
outline: 0;
}
@media print {
.MuiDialog-container {
height: auto;
}
}
.MuiDialog-paper {
margin: 32px;
position: relative;
overflow-y: auto;
}
@media print {
.MuiDialog-paper {
box-shadow: none;
overflow-y: visible;
}
}
.MuiDialog-paperScrollPaper {
display: flex;
max-height: calc(100% - 64px);
flex-direction: column;
}
.MuiDialog-paperScrollBody {
display: inline-block;
text-align: left;
vertical-align: middle;
}
.MuiDialog-paperWidthFalse {
max-width: calc(100% - 64px);
}
.MuiDialog-paperWidthXs {
max-width: 444px;
}
@media (max-width:507.95px) {
.MuiDialog-paperWidthXs.MuiDialog-paperScrollBody {
max-width: calc(100% - 64px);
}
}
.MuiDialog-paperWidthSm {
max-width: 769px;
}
@media (max-width:832.95px) {
.MuiDialog-paperWidthSm.MuiDialog-paperScrollBody {
max-width: calc(100% - 64px);
}
}
.MuiDialog-paperWidthMd {
max-width: 1025px;
}
@media (max-width:1088.95px) {
.MuiDialog-paperWidthMd.MuiDialog-paperScrollBody {
max-width: calc(100% - 64px);
}
}
.MuiDialog-paperWidthLg {
max-width: 1281px;
}
@media (max-width:1344.95px) {
.MuiDialog-paperWidthLg.MuiDialog-paperScrollBody {
max-width: calc(100% - 64px);
}
}
.MuiDialog-paperWidthXl {
max-width: 1921px;
}
@media (max-width:1984.95px) {
.MuiDialog-paperWidthXl.MuiDialog-paperScrollBody {
max-width: calc(100% - 64px);
}
}
.MuiDialog-paperFullWidth {
width: calc(100% - 64px);
}
.MuiDialog-paperFullScreen {
width: 100%;
height: 100%;
margin: 0;
max-width: 100%;
max-height: none;
border-radius: 0;
}
.MuiDialog-paperFullScreen.MuiDialog-paperScrollBody {
margin: 0;
max-width: 100%;
}
</style>
<style data-jss="" data-meta="MuiSvgIcon">
.MuiSvgIcon-root {
fill: currentColor;
width: 1em;
height: 1em;
display: inline-block;
font-size: 1.5rem;
transition: fill 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
flex-shrink: 0;
user-select: none;
}
.MuiSvgIcon-colorPrimary {
color: #E80D70;
}
.MuiSvgIcon-colorSecondary {
color: #176AE6;
}
.MuiSvgIcon-colorAction {
color: rgba(0, 0, 0, 0.54);
}
.MuiSvgIcon-colorError {
color: #D02D25;
}
.MuiSvgIcon-colorDisabled {
color: rgba(0, 0, 0, 0.26);
}
.MuiSvgIcon-fontSizeInherit {
font-size: inherit;
}
.MuiSvgIcon-fontSizeSmall {
font-size: 1.25rem;
}
.MuiSvgIcon-fontSizeLarge {
font-size: 2.1875rem;
}
</style>
<style data-jss="" data-meta="MuiTouchRipple">
.MuiTouchRipple-root {
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 0;
overflow: hidden;
position: absolute;
border-radius: inherit;
pointer-events: none;
}
.MuiTouchRipple-ripple {
opacity: 0;
position: absolute;
}
.MuiTouchRipple-rippleVisible {
opacity: 0.3;
animation: MuiTouchRipple-keyframes-enter 550ms cubic-bezier(0.4, 0, 0.2, 1);
transform: scale(1);
}
.MuiTouchRipple-ripplePulsate {
animation-duration: 200ms;
}
.MuiTouchRipple-child {
width: 100%;
height: 100%;
display: block;
opacity: 1;
border-radius: 50%;
background-color: currentColor;
}
.MuiTouchRipple-childLeaving {
opacity: 0;
animation: MuiTouchRipple-keyframes-exit 550ms cubic-bezier(0.4, 0, 0.2, 1);
}
.MuiTouchRipple-childPulsate {
top: 0;
left: 0;
position: absolute;
animation: MuiTouchRipple-keyframes-pulsate 2500ms cubic-bezier(0.4, 0, 0.2, 1) 200ms infinite;
}
@-webkit-keyframes MuiTouchRipple-keyframes-enter {
0% {
opacity: 0.1;
transform: scale(0);
}
100% {
opacity: 0.3;
transform: scale(1);
}
}
@-webkit-keyframes MuiTouchRipple-keyframes-exit {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@-webkit-keyframes MuiTouchRipple-keyframes-pulsate {
0% {
transform: scale(1);
}
50% {
transform: scale(0.92);
}
100% {
transform: scale(1);
}
}
</style>
<style data-jss="" data-meta="MuiButtonBase">
.MuiButtonBase-root {
color: inherit;
border: 0;
cursor: pointer;
margin: 0;
display: inline-flex;
outline: 0;
padding: 0;
position: relative;
align-items: center;
user-select: none;
border-radius: 0;
vertical-align: middle;
-moz-appearance: none;
justify-content: center;
text-decoration: none;
background-color: transparent;
-webkit-appearance: none;
-webkit-tap-highlight-color: transparent;
}
.MuiButtonBase-root::-moz-focus-inner {
border-style: none;
}
.MuiButtonBase-root.Mui-disabled {
cursor: default;
pointer-events: none;
}
@media print {
.MuiButtonBase-root {
-webkit-print-color-adjust: exact;
}
}
</style>
<style data-jss="" data-meta="MuiButton">
.MuiButton-root {
color: #0D1D3D;
height: 36px;
padding: 4px 16px;
font-size: 1rem;
min-width: 64px;
box-sizing: border-box;
transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
font-family: DM Sans,"Helvetica Neue",Arial,-apple-system,BlinkMacSystemFont,sans-serif,"Apple Color Emoji";
font-weight: 400;
line-height: 1.75;
white-space: nowrap;
border-radius: 4px;
letter-spacing: 0;
text-transform: none;
}
.MuiButton-root:hover {
text-decoration: none;
background-color: rgba(0, 0, 0, 0.04);
}
.MuiButton-root.Mui-disabled {
color: rgba(0, 0, 0, 0.26);
}
.MuiButton-root .MuiButton-endIcon {
margin-left: 4px;
margin-right: 0;
}
.MuiButton-root .MuiButton-startIcon {
margin-left: 0px;
margin-right: 4px;
}
.MuiButton-root .MuiSvgIcon-root {
font-size: 20px;
}
.MuiButton-root .MuiTouchRipple-root {
color: #E3E5ED;
}
.MuiButton-root.MuiButton-disabled {
color: #8192AC;
}
.MuiButton-root.MuiButton-outlined {
padding: 3px 15px;
}
.MuiButton-root.MuiButton-text {
padding: 4px 16px;
}
@media (hover: none) {
.MuiButton-root:hover {
background-color: transparent;
}
}
.MuiButton-root:hover.Mui-disabled {
background-color: transparent;
}
.MuiButton-label {
width: 100%;
display: inherit;
z-index: 1;
font-size: 16px;
align-items: inherit;
line-height: 22px;
justify-content: inherit;
}
.MuiButton-text {
color: #0D1D3D;
padding: 12px 16px;
font-weight: 400;
}
.MuiButton-text:active {
background-color: #EFF1F5;
}
.MuiButton-text:hover {
background-color: #EFF1F5;
}
.MuiButton-textPrimary {
color: #E80D70;
}
.MuiButton-textPrimary:hover {
background-color: rgba(232, 13, 112, 0.04);
}
@media (hover: none) {
.MuiButton-textPrimary:hover {
background-color: transparent;
}
}
.MuiButton-textSecondary {
color: #176AE6;
}
.MuiButton-textSecondary:hover {
background-color: rgba(23, 106, 230, 0.04);
}
@media (hover: none) {
.MuiButton-textSecondary:hover {
background-color: transparent;
}
}
.MuiButton-outlined {
color: #0D1D3D;
border: 1px solid rgba(0, 0, 0, 0.23);
padding: 5px 15px;
font-weight: 400;
border-color: #E3E5ED;
background-color: transparent;
}
.MuiButton-outlined.Mui-disabled {
border: 1px solid rgba(0, 0, 0, 0.12);
}
.MuiButton-outlined.Mui-disabled {
border-color: #EFF1F5;
}
.MuiButton-outlined:active {
border-color: #A8B5C7;
background-color: #EFF1F5;
}
.MuiButton-outlined:hover {
border-color: #A8B5C7;
background-color: #EFF1F5;
}
.MuiButton-outlinedPrimary {
color: #E80D70;
border: 1px solid rgba(232, 13, 112, 0.5);
}
.MuiButton-outlinedPrimary:hover {
border: 1px solid #E80D70;
background-color: rgba(232, 13, 112, 0.04);
}
@media (hover: none) {
.MuiButton-outlinedPrimary:hover {
background-color: transparent;
}
}
.MuiButton-outlinedSecondary {
color: #176AE6;
border: 1px solid rgba(23, 106, 230, 0.5);
}
.MuiButton-outlinedSecondary:hover {
border: 1px solid #176AE6;
background-color: rgba(23, 106, 230, 0.04);
}
.MuiButton-outlinedSecondary.Mui-disabled {
border: 1px solid rgba(0, 0, 0, 0.26);
}
@media (hover: none) {
.MuiButton-outlinedSecondary:hover {
background-color: transparent;
}
}
.MuiButton-contained {
color: #0D1D3D;
box-shadow: none;
font-weight: 400;
background-color: #EFF1F5;
}
.MuiButton-contained:hover {
box-shadow: none;
background-color: #E3E5ED;
}
.MuiButton-contained.Mui-focusVisible {
box-shadow: 0px 3px 5px -1px rgba(23,43,77,0.04),0px 6px 10px 0px rgba(23,43,77,0.06),0px 1px 18px 0px rgba(23,43,77,0.1);
}
.MuiButton-contained:active {
box-shadow: none;
background-color: #E3E5ED;
}
.MuiButton-contained.Mui-disabled {
color: rgba(0, 0, 0, 0.26);
box-shadow: none;
background-color: rgba(0, 0, 0, 0.12);
}
.MuiButton-contained .MuiTouchRipple-root {
color: #A8B5C7;
}
.MuiButton-contained.Mui-disabled {
background-color: #F8F9FA;
}
.MuiButton-contained.Mui-focusVisible {
box-shadow: none;
}
@media (hover: none) {
.MuiButton-contained:hover {
box-shadow: 0px 3px 1px -2px rgba(23,43,77,0.04),0px 2px 2px 0px rgba(23,43,77,0.06),0px 1px 5px 0px rgba(23,43,77,0.1);
background-color: #A8B5C7;
}
}
.MuiButton-contained:hover.Mui-disabled {
background-color: rgba(0, 0, 0, 0.12);
}
.MuiButton-containedPrimary {
color: #FFFFFF;
background-color: #E80D70;
}
.MuiButton-containedPrimary:hover {
background-color: #C00D66;
}
@media (hover: none) {
.MuiButton-containedPrimary:hover {
background-color: #E80D70;
}
}
.MuiButton-containedSecondary {
color: #FFFFFF;
font-weight: 500;
background-color: #176AE6;
}
.MuiButton-containedSecondary:hover {
background-color: #0B3CA5;
}
.MuiButton-containedSecondary .MuiTouchRipple-root {
color: #072A85;
}
.MuiButton-containedSecondary:active {
background-color: #0B3CA5;
}
@media (hover: none) {
.MuiButton-containedSecondary:hover {
background-color: #176AE6;
}
}
.MuiButton-disableElevation {
box-shadow: none;
}
.MuiButton-disableElevation:hover {
box-shadow: none;
}
.MuiButton-disableElevation.Mui-focusVisible {
box-shadow: none;
}
.MuiButton-disableElevation:active {
box-shadow: none;
}
.MuiButton-disableElevation.Mui-disabled {
box-shadow: none;
}
.MuiButton-colorInherit {
color: inherit;
border-color: currentColor;
}
.MuiButton-textSizeSmall {
padding: 4px 5px;
font-size: 0.8125rem;
}
.MuiButton-textSizeLarge {
padding: 8px 11px;
font-size: 0.9375rem;
}
.MuiButton-outlinedSizeSmall {
padding: 3px 9px;
font-size: 0.8125rem;
}
.MuiButton-outlinedSizeLarge {
padding: 7px 21px;
font-size: 0.9375rem;
}
.MuiButton-containedSizeSmall {
padding: 4px 10px;
font-size: 0.8125rem;
}
.MuiButton-containedSizeLarge {
padding: 8px 22px;
font-size: 0.9375rem;
}
.MuiButton-sizeSmall {
height: 24px;
padding: 2px 8px;
}
.MuiButton-sizeSmall .MuiButton-endIcon.MuiButton-iconSizeSmall {
margin-left: 2px;
margin-right: 0px;
}
.MuiButton-sizeSmall .MuiButton-label {
font-size: 14px;
line-height: 18px;
}
.MuiButton-sizeSmall .MuiButton-startIcon.MuiButton-iconSizeSmall {
margin-left: 0px;
margin-right: 2px;
}
.MuiButton-sizeSmall .MuiSvgIcon-root {
font-size: 16px;
}
.MuiButton-sizeSmall.MuiButton-outlined {
padding: 1px 7px;
}
.MuiButton-sizeSmall.MuiButton-text {
padding: 2px 4px;
}
.MuiButton-sizeLarge {
height: 48px;
padding: 8px 24px;
}
.MuiButton-sizeLarge .MuiButton-endIcon.MuiButton-iconSizeLarge {
margin-right: 0px;
}
.MuiButton-sizeLarge .MuiButton-startIcon.MuiButton-iconSizeLarge {
margin-left: 0px;
}
.MuiButton-sizeLarge .MuiSvgIcon-root {
font-size: 24px;
}
.MuiButton-sizeLarge.MuiButton-outlined {
padding: 7px 23px;
}
.MuiButton-sizeLarge.MuiButton-text {
padding: 8px 24px;
}
.MuiButton-sizeLarge .MuiButton-startIcon.MuiButton-iconSizeLarge .MuiSvgIcon-root {
font-size: 20px;
}
.MuiButton-sizeLarge .MuiButton-endIcon.MuiButton-iconSizeLarge .MuiSvgIcon-root {
font-size: 20px;
}
.MuiButton-fullWidth {
width: 100%;
}
.MuiButton-startIcon {
display: inherit;
margin-left: -4px;
margin-right: 8px;
}
.MuiButton-startIcon.MuiButton-iconSizeSmall {
margin-left: -2px;
}
.MuiButton-endIcon {
display: inherit;
margin-left: 8px;
margin-right: -4px;
}
.MuiButton-endIcon.MuiButton-iconSizeSmall {
margin-right: -2px;
}
.MuiButton-iconSizeSmall > *:first-child {
font-size: 18px;
}
.MuiButton-iconSizeMedium > *:first-child {
font-size: 20px;
}
.MuiButton-iconSizeLarge > *:first-child {
font-size: 22px;
}
</style>
<style data-jss="" data-meta="MuiTooltip">
.MuiTooltip-popper {
z-index: 1500;
pointer-events: none;
}
.MuiTooltip-popperInteractive {
pointer-events: auto;
}
.MuiTooltip-popperArrow[x-placement*="bottom"] .MuiTooltip-arrow {
top: 0;
left: 0;
margin-top: -0.71em;
margin-left: 4px;
margin-right: 4px;
}
.MuiTooltip-popperArrow[x-placement*="top"] .MuiTooltip-arrow {
left: 0;
bottom: 0;
margin-left: 4px;
margin-right: 4px;
margin-bottom: -0.71em;
}
.MuiTooltip-popperArrow[x-placement*="right"] .MuiTooltip-arrow {
left: 0;
width: 0.71em;
height: 1em;
margin-top: 4px;
margin-left: -0.71em;
margin-bottom: 4px;
}
.MuiTooltip-popperArrow[x-placement*="left"] .MuiTooltip-arrow {
right: 0;
width: 0.71em;
height: 1em;
margin-top: 4px;
margin-right: -0.71em;
margin-bottom: 4px;
}
.MuiTooltip-popperArrow[x-placement*="left"] .MuiTooltip-arrow::before {
transform-origin: 0 0;
}
.MuiTooltip-popperArrow[x-placement*="right"] .MuiTooltip-arrow::before {
transform-origin: 100% 100%;
}
.MuiTooltip-popperArrow[x-placement*="top"] .MuiTooltip-arrow::before {
transform-origin: 100% 0;
}
.MuiTooltip-popperArrow[x-placement*="bottom"] .MuiTooltip-arrow::before {
transform-origin: 0 100%;
}
.MuiTooltip-tooltip {
color: #F8F9FA;
padding: 4px 8px;
font-size: 12px;
max-width: 300px;
word-wrap: break-word;
font-family: DM Sans,"Helvetica Neue",Arial,-apple-system,BlinkMacSystemFont,sans-serif,"Apple Color Emoji";
font-weight: 500;
line-height: 16px;
border-radius: 4px;
background-color: rgba(13, 29, 61, 0.9);
}
.MuiTooltip-tooltipArrow {
margin: 0;
position: relative;
}
.MuiTooltip-arrow {
color: rgba(48, 65, 98, 0.9);
width: 1em;
height: 0.71em;
overflow: hidden;
position: absolute;
box-sizing: border-box;
}
.MuiTooltip-arrow::before {
width: 100%;
height: 100%;
margin: auto;
content: "";
display: block;
transform: rotate(45deg);
background-color: currentColor;
}
.MuiTooltip-touch {
padding: 8px 16px;
font-size: 0.875rem;
font-weight: 400;
line-height: 1.14286em;
}
.MuiTooltip-tooltipPlacementLeft {
margin: 0 8px;
transform-origin: right center;
}
@media (min-width:769px) {
.MuiTooltip-tooltipPlacementLeft {
margin: 0 14px;
}
}
@media (min-width: 769px) {
.MuiTooltip-tooltipPlacementLeft {
margin: 0 8px;
}
}
.MuiTooltip-tooltipPlacementRight {
margin: 0 8px;
transform-origin: left center;
}
@media (min-width:769px) {
.MuiTooltip-tooltipPlacementRight {
margin: 0 14px;
}
}
@media (min-width: 769px) {
.MuiTooltip-tooltipPlacementRight {
margin: 0 8px;
}
}
.MuiTooltip-tooltipPlacementTop {
margin: 8px 0;
transform-origin: center bottom;
}
@media (min-width:769px) {
.MuiTooltip-tooltipPlacementTop {
margin: 14px 0;
}
}
@media (min-width: 769px) {
.MuiTooltip-tooltipPlacementTop {
margin: 8px 0;
}
}
.MuiTooltip-tooltipPlacementBottom {
margin: 8px 0;
transform-origin: center top;
}
@media (min-width:769px) {
.MuiTooltip-tooltipPlacementBottom {
margin: 14px 0;
}
}
@media (min-width: 769px) {
.MuiTooltip-tooltipPlacementBottom {
margin: 8px 0;
}
}
</style>
<style data-jss="" data-meta="MuiLink">
.MuiLink-root {
cursor: pointer;
}
.MuiLink-underlineNone {
text-decoration: none;
}
.MuiLink-underlineHover {
text-decoration: underline;
}
.MuiLink-underlineHover:hover {
text-decoration: none;
}
.MuiLink-underlineAlways {
text-decoration: underline;
}
.MuiLink-button {
border: 0;
cursor: pointer;
margin: 0;
outline: 0;
padding: 0;
position: relative;
user-select: none;
border-radius: 0;
vertical-align: middle;
-moz-appearance: none;
background-color: transparent;
-webkit-appearance: none;
-webkit-tap-highlight-color: transparent;
}
.MuiLink-button::-moz-focus-inner {
border-style: none;
}
.MuiLink-button.Mui-focusVisible {
outline: auto;
}
</style>
<style data-jss="" data-meta="makeStyles">
.jss15 {
color: #0D1D3D;
}
.jss16 {
color: #5A7092;
}
</style>
<style data-jss="" data-meta="makeStyles">
@-webkit-keyframes jss28 {
0% {
opacity: 0.1;
transform: scale(0);
}
100% {
opacity: 1;
transform: scale(1);
}
}
.jss29 {
color: #FFFFFF;
background-color: #E2372B;
}
.jss29:active {
background-color: #FFEBED;
}
.jss29:hover {
background-color: #D02D25;
}
.jss30 {
color: #D02D25;
border-color: #D02D25;
}
.jss30:active {
border-color: #E2372B;
}
.jss30:hover {
border-color: #E2372B;
}
.jss31 {
color: #D02D25;
}
.jss32 {
color: #0D1D3D;
background-color: #EFF1F5;
}
.jss32 .MuiTouchRipple-root {
color: #8192AC;
}
.jss32:active {
background-color: #A8B5C7;
}
.jss32:hover {
background-color: #A8B5C7;
}
.jss33 {
color: #C3261E;
background-color: #FFEBED;
}
.jss33 .MuiTouchRipple-root {
color: #ED5148;
}
.jss33.jss42 {
color: #C3261E;
}
.jss33.jss44 {
color: #C3261E;
}
.jss33:active {
background-color: #EF9895;
}
.jss33:hover {
background-color: #EF9895;
}
.jss34 {
color: #1052C5;
background-color: #E3EDFC;
}
.jss34 .MuiTouchRipple-root {
color: #A1D1FC;
}
.jss34.jss43 {
color: #1052C5;
}
.jss34.jss44 {
color: #1052C5;
}
.jss34:active {
background-color: #D0E9FD;
}
.jss34:hover {
background-color: #D0E9FD;
}
.jss35 {
background-color: transparent;
}
.jss35:active {
background-color: transparent;
}
.jss35:hover {
background-color: transparent;
}
.jss36 {
display: inline-block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.jss37 {
padding-right: 8px !important;
}
.jss37.MuiButton-outlined {
padding-right: 7px !important;
}
.jss37.MuiButton-sizeSmall {
padding-right: 4px !important;
}
.jss37.MuiButton-sizeSmall.MuiButton-outlined {
padding-right: 3px !important;
}
.jss38 {
height: inherit;
min-height: 36px;
white-space: normal;
}
.jss38.MuiButton-sizeLarge {
min-height: 48px;
}
.jss38.MuiButton-sizeSmall {
min-height: 24px;
}
.jss39:hover {
color: #D02D25;
}
.jss40:hover {
color: #176AE6;
}
.jss41 {
width: 36px;
padding: 0;
min-width: 36px;
}
.jss41.MuiButton-sizeLarge {
width: 48px;
min-width: 48px;
}
.jss41.MuiButton-sizeSmall {
width: 24px;
min-width: 24px;
}
.jss42 {
color: #D02D25;
}
.jss42.jss32 {
color: #0D1D3D;
}
.jss42.jss32.jss33 {
color: #C3261E;
}
.jss43 {
color: #176AE6;
}
.jss43.jss32 {
color: #0D1D3D;
}
.jss43.jss32.jss34 {
color: #1052C5;
}
.jss44 {
color: #5A7092;
}
.jss44.jss32 {
color: #0D1D3D;
}
.jss44.jss32.jss34 {
color: #1052C5;
}
.jss46.jss32 {
border-color: #E3EDFC;
}
.jss46.jss32:active {
border-color: #D0E9FD;
}
.jss46.jss32:hover {
border-color: #D0E9FD;
}
.jss47 {
font-weight: 500;
}
.jss48 {
opacity: 1;
animation: jss28 550ms cubic-bezier(0.4, 0, 0.2, 1);
transform: scale(1);
}
.jss49 {
padding-left: 8px !important;
}
.jss49.MuiButton-outlined {
padding-left: 7px !important;
}
.jss49.MuiButton-sizeSmall {
padding-left: 4px !important;
}
.jss49.MuiButton-sizeSmall.MuiButton-outlined {
padding-left: 3px !important;
}
.jss50 {
display: flex;
position: absolute;
visibility: visible;
}
.jss51 {
left: 50%;
transform: translate(-50%);
}
.jss54 {
visibility: hidden;
}
</style>
<style data-jss="" data-meta="makeStyles">
</style>
<style data-jss="" data-meta="makeStyles">
</style>
<style data-jss="" data-meta="makeStyles">
.jss4 {
top: 50%;
left: 50%;
position: absolute;
transform: translateY(-50%);
margin-top: 0;
padding-top: 16px;
border-radius: 8px;
padding-bottom: 24px;
}
</style>
<style data-jss="" data-meta="makeStyles">
</style>
<style data-jss="" data-meta="MuiFormControl">
.MuiFormControl-root {
border: 0;
margin: 0;
display: inline-flex;
padding: 0;
position: relative;
min-width: 0;
flex-direction: column;
vertical-align: top;
}
.MuiFormControl-marginNormal {
margin-top: 16px;
margin-bottom: 8px;
}
.MuiFormControl-marginDense {
margin-top: 8px;
margin-bottom: 4px;
}
.MuiFormControl-fullWidth {
width: 100%;
}
</style>
<style data-jss="" data-meta="MuiFormLabel">
.MuiFormLabel-root {
color: #5A7092;
padding: 0;
font-size: 1rem;
font-family: DM Sans,"Helvetica Neue",Arial,-apple-system,BlinkMacSystemFont,sans-serif,"Apple Color Emoji";
font-weight: 400;
line-height: 1;
letter-spacing: 0;
}
.MuiFormLabel-root.Mui-focused {
color: #5A7092;
}
.MuiFormLabel-root.Mui-disabled {
color: rgba(0, 0, 0, 0.38);
}
.MuiFormLabel-root.Mui-error {
color: #5A7092;
}
.MuiFormLabel-root.Mui-disabled {
color: #8192AC;
}
.MuiFormLabel-colorSecondary.Mui-focused {
color: inherit;
}
.MuiFormLabel-asterisk.Mui-error {
color: #D02D25;
}
</style>
<style data-jss="" data-meta="makeStyles">
.jss17 {
width: 100%;
text-align: left;
}
.jss18 {
margin-left: 12px;
margin-bottom: 8px;
}
</style>
<style data-jss="" data-meta="makeStyles">
.jss20 + .jss20 {
margin-top: 16px;
}
</style>
<style data-jss="" data-meta="MuiInputAdornment">
.MuiInputAdornment-root {
height: 0.01em;
display: flex;
max-height: 2em;
align-items: center;
white-space: nowrap;
}
.MuiInputAdornment-filled.MuiInputAdornment-positionStart:not(.MuiInputAdornment-hiddenLabel) {
margin-top: 16px;
}
.MuiInputAdornment-positionStart {
margin-right: 8px;
}
.MuiInputAdornment-positionEnd {
margin-left: 8px;
}
.MuiInputAdornment-disablePointerEvents {
pointer-events: none;
}
</style>
<style data-jss="" data-meta="MuiInputBase">
@-webkit-keyframes mui-auto-fill {}
@-webkit-keyframes mui-auto-fill-cancel {}
.MuiInputBase-root {
color: rgba(0, 0, 0, 0.87);
cursor: text;
display: inline-flex;
position: relative;
font-size: 1rem;
box-sizing: border-box;
margin-top: 0 !important;
align-items: center;
font-family: DM Sans,"Helvetica Neue",Arial,-apple-system,BlinkMacSystemFont,sans-serif,"Apple Color Emoji";
font-weight: 400;
line-height: 1.1876em;
letter-spacing: 0;
}
.MuiInputBase-root.Mui-disabled {
color: rgba(0, 0, 0, 0.38);
cursor: default;
}
.MuiInputBase-root.Mui-error .MuiInputBase-input {
color: #C3261E;
}
.MuiInputBase-multiline {
padding: 6px 0 7px;
}
.MuiInputBase-multiline.MuiInputBase-marginDense {
padding-top: 3px;
}
.MuiInputBase-fullWidth {
width: 100%;
}
.MuiInputBase-input {
font: inherit;
color: #0D1D3D;
width: 100%;
border: 0;
height: 1.1876em;
margin: 0;
display: block;
padding: 27px 12px 10px;
min-width: 0;
background: none;
box-sizing: content-box;
animation-name: mui-auto-fill-cancel;
letter-spacing: inherit;
animation-duration: 10ms;
-webkit-tap-highlight-color: transparent;
}
.MuiInputBase-input::-webkit-input-placeholder {
color: currentColor;
opacity: 0.42;
transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
}
.MuiInputBase-input::-moz-placeholder {
color: currentColor;
opacity: 0.42;
transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
}
.MuiInputBase-input:-ms-input-placeholder {
color: currentColor;
opacity: 0.42;
transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
}
.MuiInputBase-input::-ms-input-placeholder {
color: currentColor;
opacity: 0.42;
transition: opacity 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
}
.MuiInputBase-input:focus {
outline: 0;
}
.MuiInputBase-input:invalid {
box-shadow: none;
}
.MuiInputBase-input::-webkit-search-decoration {
-webkit-appearance: none;
}
.MuiInputBase-input.Mui-disabled {
color: #8192AC;
opacity: 1;
}
.MuiInputBase-input:-webkit-autofill {
animation-name: mui-auto-fill;
transition-delay: 9999s;
animation-duration: 5000s;
transition-property: background-color, color;
}
.MuiInputBase-input.MuiSelect-root.MuiInputBase-inputHiddenLabel {
padding-top: 10px;
padding-bottom: 10px;
}
label[data-shrink=false] + .MuiInputBase-formControl .MuiInputBase-input::-webkit-input-placeholder {
opacity: 0 !important;
}
label[data-shrink=false] + .MuiInputBase-formControl .MuiInputBase-input::-moz-placeholder {
opacity: 0 !important;
}
label[data-shrink=false] + .MuiInputBase-formControl .MuiInputBase-input:-ms-input-placeholder {
opacity: 0 !important;
}
label[data-shrink=false] + .MuiInputBase-formControl .MuiInputBase-input::-ms-input-placeholder {
opacity: 0 !important;
}
label[data-shrink=false] + .MuiInputBase-formControl .MuiInputBase-input:focus::-webkit-input-placeholder {
opacity: 0.42;
}
label[data-shrink=false] + .MuiInputBase-formControl .MuiInputBase-input:focus::-moz-placeholder {
opacity: 0.42;
}
label[data-shrink=false] + .MuiInputBase-formControl .MuiInputBase-input:focus:-ms-input-placeholder {
opacity: 0.42;
}
label[data-shrink=false] + .MuiInputBase-formControl .MuiInputBase-input:focus::-ms-input-placeholder {
opacity: 0.42;
}
.MuiInputBase-inputMarginDense {
padding-top: 3px;
}
.MuiInputBase-inputMultiline {
height: auto;
resize: none;
padding: 0;
}
.MuiInputBase-inputTypeSearch {
-moz-appearance: textfield;
-webkit-appearance: textfield;
}
</style>
<style data-jss="" data-meta="MuiFilledInput">
.MuiFilledInput-root {
position: relative;
transition: background-color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;
border-radius: 4px;
background-color: #EFF1F5;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.MuiFilledInput-root:hover {
background-color: #EFF1F5;
}
.MuiFilledInput-root.Mui-focused {
box-shadow: 0 0 0 1px #E80D70;
background-color: #EFF1F5;
}
.MuiFilledInput-root.Mui-disabled {
background-color: #EFF1F5;
}
.MuiFilledInput-root.Mui-error {
background-color: #FFEBED;
}
@media (hover: none) {
.MuiFilledInput-root:hover {
background-color: rgba(0, 0, 0, 0.09);
}
}
.MuiFilledInput-colorSecondary.MuiFilledInput-underline:after {
border-bottom-color: #176AE6;
}
.MuiFilledInput-colorSecondary.Mui-focused {
box-shadow: 0 0 0 1px #176AE6;
}
.MuiFilledInput-underline:after {
left: 0;
right: 0;
bottom: 0;
content: "";
position: absolute;
transform: scaleX(0);
transition: transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;
border-bottom: 2px solid #E80D70;
pointer-events: none;
}
.MuiFilledInput-underline.Mui-focused:after {
transform: scaleX(1);
}
.MuiFilledInput-underline.Mui-error:after {
transform: scaleX(1);
border-bottom-color: #D02D25;
}
.MuiFilledInput-underline:before {
left: 0;
right: 0;
bottom: 0;
content: "\00a0";
position: absolute;
transition: border-bottom-color 200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
border-bottom: 1px solid rgba(0, 0, 0, 0.42);
pointer-events: none;
}
.MuiFilledInput-underline:hover:before {
border-bottom: 1px solid rgba(0, 0, 0, 0.87);
}
.MuiFilledInput-underline.Mui-disabled:before {
border-bottom-style: dotted;
}
.MuiFilledInput-adornedStart {
padding-left: 8px;
}
.MuiFilledInput-adornedEnd {
padding-right: 8px;
}
.MuiFilledInput-multiline {
padding: 27px 12px 10px;
padding-top: 0;
padding-bottom: 0;
}
.MuiFilledInput-multiline.MuiFilledInput-marginDense {
padding-top: 23px;
padding-bottom: 6px;
}
.MuiFilledInput-input {
padding: 27px 12px 10px;
}
.MuiFilledInput-input:-webkit-autofill {
border-top-left-radius: inherit;
border-top-right-radius: inherit;
}
.MuiFilledInput-input.MuiInputBase-inputHiddenLabel {
padding-top: 18px;
padding-bottom: 18px;
}
.MuiFilledInput-inputMarginDense {
padding-top: 23px;
padding-bottom: 6px;
}
.MuiFilledInput-inputHiddenLabel {
padding-top: 18px;
padding-bottom: 19px;
}
.MuiFilledInput-inputHiddenLabel.MuiFilledInput-inputMarginDense {
padding-top: 10px;
padding-bottom: 11px;
}
.MuiFilledInput-inputMultiline {
padding: 0;
}
.MuiFilledInput-inputAdornedStart {
padding-left: 0;
}
.MuiFilledInput-inputAdornedEnd {
padding-right: 0;
}
</style>
<style data-jss="" data-meta="MuiInputLabel">
.MuiInputLabel-root {
display: block;
transform-origin: top left;
}
.MuiInputLabel-formControl {
top: 0;
left: 0;
position: absolute;
transform: translate(0, 24px) scale(1);
}
.MuiInputLabel-marginDense {
transform: translate(0, 21px) scale(1);
}
.MuiInputLabel-shrink {
transform: translate(0, 1.5px) scale(0.75);
transform-origin: top left;
}
.MuiInputLabel-animated {
transition: color 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms,transform 200ms cubic-bezier(0.0, 0, 0.2, 1) 0ms;
}
.MuiInputLabel-filled {
z-index: 1;
transform: translate(12px, 20px) scale(1);
pointer-events: none;
}
.MuiInputLabel-filled.MuiInputLabel-marginDense {
transform: translate(12px, 17px) scale(1);
}
.MuiInputLabel-filled.MuiInputLabel-shrink {
transform: translate(12px, 10px) scale(0.75);
}
.MuiInputLabel-filled.MuiInputLabel-shrink.MuiInputLabel-marginDense {
transform: translate(12px, 7px) scale(0.75);
}
.MuiInputLabel-outlined {
z-index: 1;
transform: translate(14px, 20px) scale(1);
pointer-events: none;
}
.MuiInputLabel-outlined.MuiInputLabel-marginDense {
transform: translate(14px, 12px) scale(1);
}
.MuiInputLabel-outlined.MuiInputLabel-shrink {
transform: translate(14px, -6px) scale(0.75);
}
.MuiInputLabel-outlined.MuiInputLabel-shrink {
transform: translate(12px, 10px) scale(0.75);
}
</style>
<style data-jss="" data-meta="MuiTextField">
</style>
<style data-jss="" data-meta="makeStyles">
.jss22 {
visibility: hidden;
}
.jss23 {
visibility: visible;
}
.jss24 + .MuiFormControl-root {
margin-top: 16px;
}
.jss24 .MuiInputBase-input::placeholder {
color: #8192AC;
opacity: 1;
}
.jss25 .MuiInputBase-root {
height: 36px;
}
.jss25.MuiInputBase-inputHiddenLabel {
padding-top: 8px;
padding-bottom: 8px;
}
.jss26 {
height: 36px;
display: flex;
padding: 8px 16px;
align-items: center;
}
</style>
<style data-jss="" data-meta="makeStyles">
.jss27 .MuiInputAdornment-root {
color: #8192AC;
}
.jss27 .MuiInputAdornment-root .MuiButtonBase-root {
color: #8192AC;
}
</style>
<style data-jss="" data-meta="MuiCssBaseline">
html {
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
*, *::before, *::after {
box-sizing: inherit;
}
strong, b {
font-weight: 700;
}
body {
color: #0D1D3D;
margin: 0;
font-size: 0.875rem;
font-family: DM Sans,"Helvetica Neue",Arial,-apple-system,BlinkMacSystemFont,sans-serif,"Apple Color Emoji";
font-weight: 400;
line-height: 1.43;
letter-spacing: 0;
background-color: #F8F9FA;
}
@media print {
body {
background-color: #FFFFFF;
}
}
body::backdrop {
background-color: #F8F9FA;
}
</style>
<style data-jss="" data-meta="makeStyles">
.ReactVirtualized__Grid, .ReactVirtualized__List {
outline: none;
overflow: inherit !important;
}
.ReactVirtualized__Grid__innerScrollContainer, .ReactVirtualized__List__innerScrollContainer {
overflow: inherit !important;
}
body {
overflow-y: scroll;
}
</style>
<style data-jss="" data-meta="makeStyles">
.jss6 {
width: 480px;
text-align: center;
}
.jss7 {
color: #5A7092;
font-size: 0.875rem;
margin-top: 40px;
font-family: DM Sans,"Helvetica Neue",Arial,-apple-system,BlinkMacSystemFont,sans-serif,"Apple Color Emoji";
font-weight: 400;
line-height: 1.43;
padding-left: 64px;
padding-right: 64px;
letter-spacing: 0;
}
.jss8 {
display: flex;
min-height: 100vh;
align-items: center;
padding-top: 56px;
flex-direction: column;
padding-bottom: 56px;
background-color: #EFF1F5;
}
.jss9 {
width: 106px;
height: 24px;
margin-bottom: 24px;
}
.jss10 {
padding: 40px;
border-radius: 8px;
}
</style>
<style data-jss="" data-meta="makeStyles">
</style>
<style data-jss="" data-meta="makeStyles">
.jss12 {
color: #0D1D3D;
font-size: 2.125rem;
font-family: DM Sans,"Helvetica Neue",Arial,-apple-system,BlinkMacSystemFont,sans-serif,"Apple Color Emoji";
font-weight: 500;
line-height: 1.2;
margin-bottom: 16px;
letter-spacing: 0.00735em;
}
</style>
<style data-jss="" data-meta="makeStyles">
.jss1 {
margin-top: 16px;
}
.jss2 {
margin-left: 8px;
}
.jss3 {
margin-top: 16px;
margin-bottom: 16px;
}
</style>
</head>
<body class="global-ers-init">
<!--Facebook api-->
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '{1051901028552736}',
cookie : true,
xfbml : true,
version : '{v10.0}'
});
FB.AppEvents.logPageView();
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "https://connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<div id="fb-root"></div>
<script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v10.0&appId=1051901028552736&autoLogAppEvents=1" nonce="PDp8PfM7"></script>
<!--End Facebook api-->
<style type="text/css">
html.hs-messages-widget-open.hs-messages-mobile,html.hs-messages-widget-open.hs-messages-mobile body{overflow:hidden!important;position:relative!important}html.hs-messages-widget-open.hs-messages-mobile body{height:100%!important;margin:0!important}#hubspot-messages-iframe-container{display:initial!important;z-index:2147483647;position:fixed!important;bottom:0!important}#hubspot-messages-iframe-container.widget-align-left{left:0!important}#hubspot-messages-iframe-container.widget-align-right{right:0!important}#hubspot-messages-iframe-container.internal{z-index:1016}#hubspot-messages-iframe-container.internal iframe{min-width:108px}#hubspot-messages-iframe-container .shadow-container{display:initial!important;z-index:-1;position:absolute;width:0;height:0;bottom:0;content:""}#hubspot-messages-iframe-container .shadow-container.internal{display:none!important}#hubspot-messages-iframe-container .shadow-container.active{width:400px;height:400px}#hubspot-messages-iframe-container iframe{display:initial!important;width:100%!important;height:100%!important;border:none!important;position:absolute!important;bottom:0!important;right:0!important;background:transparent!important}
</style>
<noscript>
<div class="potloc-init noscript">
<div class="noscript__content">
<div class="noscript__row">
<div class="noscript__cell">
<div class="noscript__wrapper">
{{--<img class="noscript__logo" src="{{asset('/images/logo-wide.png')}}" />--}}
<h2 class="noscript__title">
JavaScript Required
</h2>
<p class="noscript__message">We're sorry, but Potloc doesn't work properly without JavaScript enabled.</p>
<p class="noscript__message">Please enable JavaScript and refresh your page.</p>
</div>
</div>
</div>
</div>
</div>
</noscript>
<form id="login_form" name="login_form" method="post" action="{{ route('login') }}">
@csrf
<div class="add-messages"></div>
<input type="hidden" name="authenticity_token" value="bJIS5lHCveUyMX4H1//sLDiQcicRYdCfk30m/b6OXQGZDVhazA+ZY2oQc4CRKDT8QGSRavuCSrzi/PVwzpFobQ==">
<div data-react-class="sign-in/pages/SignInPage" data-react-props="{"alerts":[],"links":{"demoAccessPath":null,"legalTermsPath":"https://potloc.com/en/legal-terms","newPasswordPath":"/en/users/password/new","privacyPolicyPath":"https://potloc.com/en/privacy-policy","termsOfUsePath":"https://potloc.com/en/terms-of-use"},"user":{"email":""}}" data-react-cache-id="sign-in/pages/SignInPage-0">
<div class="jss8">
<div class="jss6">
<div class="MuiPaper-root jss10 jss11 MuiPaper-elevation4 MuiPaper-rounded">
{{--<svg class="jss9" width="354px" height="80px" viewBox="0 0 354 80">
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="Logo-Color" transform="translate(-36.000000, -35.000000)">
<g transform="translate(36.000000, 35.000000)">
<path d="M259.993814,1 C258.343192,1.00677404 257.006779,2.34224604 257,3.99170509 L257,58.1885444 C257.101653,59.7696043 258.414563,61 260,61 C261.585437,61 262.898347,59.7696043 263,58.1885444 L263,3.99170509 C262.993187,2.33743428 261.649266,1 259.993814,1 L259.993814,1 Z" id="Shape" fill="#272930" fill-rule="nonzero"></path>
<path d="M196.374406,21 C185.062644,21.0696168 175.944882,30.288444 176,41.6003033 C176.055619,52.9121626 185.263189,62.0412919 196.575087,62 C207.886985,61.9584271 217.027434,52.7620939 217,41.4501325 C216.983347,36.0011098 214.799355,30.7826081 210.929853,26.9460706 C207.060351,23.1095331 201.823361,20.9702737 196.374406,21 L196.374406,21 Z M196.487388,55.9997592 C190.623053,56.0913629 185.284111,52.6319908 182.97149,47.2421201 C180.658868,41.8522494 181.830584,35.5993515 185.937769,31.4124776 C190.044954,27.2256038 196.274175,25.9339703 201.707471,28.1426182 C207.140768,30.3512662 210.702068,35.6227698 210.723429,41.4877933 C210.772118,49.4152391 204.414297,55.896417 196.487388,55.9997592 L196.487388,55.9997592 Z" id="Shape" fill="#272930" fill-rule="nonzero"></path>
<path d="M292.374406,21 C281.062644,21.0696168 271.944882,30.288444 272,41.6003033 C272.055619,52.9121626 281.263189,62.0412919 292.575087,62 C303.886985,61.9584271 313.027434,52.7620939 313,41.4501325 C312.983347,36.0011098 310.799355,30.7826081 306.929853,26.9460706 C303.060351,23.1095331 297.823361,20.9702737 292.374406,21 L292.374406,21 Z M292.487388,55.9997592 C286.623053,56.0913629 281.284111,52.6319908 278.97149,47.2421201 C276.658868,41.8522494 277.830584,35.5993515 281.937769,31.4124776 C286.044954,27.2256038 292.274175,25.9339703 297.707471,28.1426182 C303.140768,30.3512662 306.702068,35.6227698 306.723356,41.4877933 C306.76526,49.4124598 300.411386,55.8896133 292.487388,55.9997592 L292.487388,55.9997592 Z" id="Shape" fill="#272930" fill-rule="nonzero"></path>
<path d="M149.521814,21 C144.088305,20.9736776 138.86821,23.1106614 135.016722,26.9382871 C131.165234,30.7659127 129,35.9685663 129,41.3949137 L129,41.3949137 L129,41.3949137 L129,76.8796406 C129,78.6029675 130.398893,80 132.124515,80 C133.850137,80 135.24903,78.6029675 135.24903,76.8796406 L135.24903,56.0980471 C139.128484,59.7916836 144.299646,61.8251486 149.659292,61.7646198 C156.950844,61.7400943 163.675414,57.8326088 167.299922,51.5140753 C170.92443,45.1955417 170.898226,37.4258956 167.231183,31.1318876 C163.564139,24.8378796 156.813365,20.9757191 149.521814,21 L149.521814,21 Z M149.634296,55.7984926 C143.796941,55.8844916 138.485401,52.4417216 136.18696,47.0823606 C133.88852,41.7229996 135.058205,35.5080496 139.148276,31.347843 C143.238348,27.1876364 149.439087,25.9057765 154.846816,28.1025318 C160.254546,30.2992871 163.798687,35.5397621 163.8198,41.3699508 C163.861452,49.2538623 157.528148,55.6957684 149.634296,55.7984926 L149.634296,55.7984926 Z" id="Shape" fill="#272930" fill-rule="nonzero"></path>
<path d="M352.954123,52.1833182 C351.789742,51.0731416 349.962718,51.0731416 348.798337,52.1833182 C346.208786,54.5659266 342.823398,55.8880679 339.310126,55.8888783 C331.687479,55.4615103 325.717747,49.146133 325.694511,41.4849245 C325.671276,33.823716 331.60259,27.4719914 339.222504,26.9980707 C342.759941,26.9846598 346.1749,28.2971875 348.798337,30.6785084 C349.961787,31.8031259 351.80319,31.8031259 352.966641,30.6785084 L353.11685,30.5403349 C353.698809,29.9580063 354.016415,29.161077 353.995106,28.3366384 C353.973798,27.5121998 353.615451,26.7328638 353.004193,26.1815914 C344.805148,18.8643594 332.310299,19.3536532 324.704414,27.2898003 C317.098529,35.2259475 317.098529,47.7740525 324.704414,55.7101997 C332.310299,63.6463468 344.805148,64.1356406 353.004193,56.8184086 C353.615072,56.2756363 353.975042,55.5034935 353.998751,54.6850656 C354.022459,53.8666377 353.707795,53.0748149 353.129367,52.4973487 L352.954123,52.1833182 Z" id="Shape" fill="#272930" fill-rule="nonzero"></path>
<path d="M249.449926,52.8123412 C249.084148,52.810674 248.723168,52.8954993 248.39651,53.0598797 L248.39651,53.0598797 C246.712496,53.8441918 244.982568,54.5261654 243.216181,55.1020724 C237.11876,56.661565 233.078598,53.5425798 233.016633,47.2922324 C233.016633,42.3414622 233.016633,29.6798674 233.016633,28.1698825 L246.438395,28.1698825 C247.889437,28.1698825 249.065739,26.9951187 249.065739,25.5459743 C249.065739,24.0968298 247.889437,22.922066 246.438395,22.922066 L232.979453,22.922066 L232.979453,2.97046212 C232.979453,1.32992119 231.647791,0 230.005102,0 C228.362412,0 227.03075,1.32992119 227.03075,2.97046212 L227.03075,22.9715738 L221.614951,22.9715738 C220.170753,22.9715738 219,24.1407961 219,25.583105 C219,27.0254139 220.170753,28.1946363 221.614951,28.1946363 L227.080322,28.1946363 C227.080322,28.9496288 226.99357,42.1063006 227.142288,48.0967325 C227.266219,53.0475027 228.592285,57.5527036 233.549537,59.644404 C239.560207,62.1197891 245.285834,61.1048813 250.751205,57.4165574 C250.814363,57.3884313 250.872867,57.3508706 250.924709,57.3051651 L251.023854,57.3051651 L251.023854,57.3051651 C251.878109,56.6548233 252.215701,55.5289761 251.859974,54.5167622 C251.504247,53.5045484 250.536169,52.8363596 249.46232,52.8618489 L249.449926,52.8123412 Z" id="Shape" fill="#272930" fill-rule="nonzero"></path>
<g id="Group-2" transform="translate(0.000000, 7.000000)" fill="#E80D70">
<path d="M5.96707105,29.7241166 L5.99985843,29.7241166 C5.99985843,46.4064891 19.3765235,59.9302241 35.877476,59.9302241 C52.3784286,59.9302241 65.7550936,46.4064891 65.7550936,29.7241166 L65.7577852,29.7241166 C65.7577852,28.0669396 67.0935595,26.7235323 68.7413207,26.7235323 C70.3890819,26.7235323 71.7248562,28.0669396 71.7248562,29.7241166 L71.7264934,29.7241166 C71.7264934,49.7406611 55.6763416,65.9672765 35.877476,65.9672765 C16.2218937,65.9672765 0.260963032,49.9746734 0.0309757825,30.1580921 C0.0105653169,30.0163982 1.13686838e-12,29.8714983 1.13686838e-12,29.7241166 C1.13686838e-12,28.0669396 1.33577435,26.7235323 2.98353553,26.7235323 C4.6312967,26.7235323 5.96707105,28.0669396 5.96707105,29.7241166 Z" id="Path"></path>
<path d="M39.0334927,36.24316 C39.0334927,37.9003369 37.6977183,39.2437443 36.0499571,39.2437443 C34.402196,39.2437443 33.0664216,37.9003369 33.0664216,36.24316 C33.0664216,36.0957783 33.0769869,35.9508783 33.0973974,35.8091844 C33.3273846,15.9926031 49.2883153,-2.48689958e-13 68.9438976,-2.48689958e-13 C88.7427632,-2.48689958e-13 104.792915,16.2266154 104.792915,36.24316 L104.791278,36.24316 C104.791278,37.9003369 103.455503,39.2437443 101.807742,39.2437443 C100.159981,39.2437443 98.8242068,37.9003369 98.8242068,36.24316 L98.8215152,36.24316 C98.8215152,19.5607874 85.4448502,6.03705243 68.9438976,6.03705243 C52.4429451,6.03705243 39.06628,19.5607874 39.06628,36.24316 L39.0334927,36.24316 Z" id="Path"></path>
</g>
</g>
</g>
</g>
</svg>--}}
<div class="jss12">Sign in</div>
<div>
<div class="MuiBox-root jss13">
<p class="MuiTypography-root MuiTypography-body1">You don't have a Ethical Research Solutions account?</p><a class="MuiTypography-root MuiLink-root MuiLink-underlineNone jss14 jss2 MuiTypography-body1 MuiTypography-colorSecondary" rel="noopener noreferrer" href="{{url('/consumer/connect')}}">Create account</a>
</div>
<fieldset class="MuiFormControl-root jss17">
<div class="MuiBox-root jss19">
<div class="MuiBox-root jss21"></div>
</div>
<div class="MuiFormControl-root MuiTextField-root jss24">
<label for="email" class="MuiFormLabel-root MuiFormLabel-colorSecondary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-filled MuiFormLabel-filled" data-shrink="true">Email</label>
<div class="MuiInputBase-root MuiFilledInput-root MuiInputBase-colorSecondary MuiFilledInput-colorSecondary MuiInputBase-formControl">
<input aria-invalid="false" id="email" name="email" placeholder="[email protected]" required="" type="email" class="MuiInputBase-input MuiFilledInput-input @error('email') is-invalid @enderror" value="">
@error('email')
<span class="invalid-feedback" role="alert"><strong>{{ $message }}</strong></span>
@enderror
</div>
</div>
<div class="MuiFormControl-root MuiTextField-root jss24 jss27">
<label class="MuiFormLabel-root MuiFormLabel-colorSecondary MuiInputLabel-root MuiInputLabel-formControl MuiInputLabel-animated MuiInputLabel-shrink MuiInputLabel-filled MuiFormLabel-filled" data-shrink="true">Password</label>
<div class="MuiInputBase-root MuiFilledInput-root MuiInputBase-colorSecondary MuiFilledInput-colorSecondary MuiInputBase-formControl MuiInputBase-adornedEnd MuiFilledInput-adornedEnd">
<input type="password" id="password" name="password" class="MuiInputBase-input MuiFilledInput-input MuiInputBase-inputAdornedEnd MuiFilledInput-inputAdornedEnd @error('password') is-invalid @enderror" value="">
@error('password')
<span class="invalid-feedback" role="alert"> <strong>{{ $message }}</strong></span>
@enderror
<div class="MuiInputAdornment-root MuiInputAdornment-filled MuiInputAdornment-positionEnd">
<button class="MuiButtonBase-root MuiButton-root MuiButton-text jss41" tabindex="0" type="button" aria-label="Toggle Password Visibility" title="Show password"><span class="MuiButton-label"><svg class="MuiSvgIcon-root" focusable="false" viewBox="0 0 24 24" aria-hidden="true"><path d="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z"></path></svg></span><span class="MuiTouchRipple-root"></span>
</button>
</div>
</div>
</div><a class="MuiTypography-root MuiLink-root MuiLink-underlineNone jss14 jss1 MuiTypography-colorSecondary" href="/en/users/password/new" rel="noopener noreferrer">Forgot password?</a>
<input value="Login" type="submit" class="MuiButtonBase-root MuiButton-root MuiButton-contained jss3 MuiButton-containedSecondary MuiButton-containedSizeLarge MuiButton-sizeLarge MuiButton-fullWidth" id="btnSave" data-loading-text="Please wait..." style="float: right"/>
</button>
<div class="col-md-6">
<div class="fb-login-button" data-width="50" data-size="small" data-button-type="continue_with" data-layout="default" data-auto-logout-link="false" data-use-continue-as="false"></div>
<div class="fb-login-button" data-width="50" data-size="small" data-button-type="continue_with" data-layout="default" data-auto-logout-link="false" data-use-continue-as="false"></div>
</div>
</fieldset>
</div>
</div>
<div class="jss7">©2014–2021 All Rights Reserved Ethical Research Solutions®
<br><a class="MuiTypography-root MuiLink-root MuiLink-underlineAlways jss14 jss16 MuiTypography-body2 MuiTypography-colorInherit" href="https://ethicalresearchsolution.com/legal-terms" rel="noopener noreferrer" target="_blank">Legal Terms</a>, <a class="MuiTypography-root MuiLink-root MuiLink-underlineAlways jss14 jss16 MuiTypography-body2 MuiTypography-colorInherit" href="https://ethicalresearchsolution.com/privacy-policy" rel="noopener noreferrer" target="_blank">Privacy Policy</a>, and <a class="MuiTypography-root MuiLink-root MuiLink-underlineAlways jss14 jss16 MuiTypography-body2 MuiTypography-colorInherit" href="https://ethicalresearchsolution.com/terms-of-use" rel="noopener noreferrer" target="_blank">Terms of use</a>.</div>
</div>
</div>
</div>
@push('js')
<script>
$(document).ready(function () {
// Saving
$('#login_form').submit(function (e) {
e.preventDefault();
var form = $(this);
var btn = $('#btnSave');
btn.button('loading');
// console.log(form.serialize());
$.ajax({
url: form.attr('action'),
method: form.attr('method'),
data: form.serialize()
}).done(function (data) {
console.log(data);
if (data.message=="ok") {
btn.button('reset');
form[1].reset();
window.location = "/home";
$('.add-messages').html('<div class="alert alert-success flat">' +
'<button type="button" class="close" data-dismiss="alert">×</button>' +
'<strong><i class="glyphicon glyphicon-ok-sign"></i></strong>You are Logeg In </div>');
$(".alert-success").delay(500).show(10, function () {
$(this).delay(3000).hide(10, function () {
$(this).remove();
});
}); // /.alert
}else if (data.message=="unconfirmed"){
btn.button('reset');
$('.add-messages').html('<div class="alert alert-warning flat">' +
'<button type="button" class="close" data-dismiss="alert">×</button>' +
'<strong><i class="glyphicon glyphicon-ok-sign"></i></strong>You are not Confirmed. Please check Confirmation SMS </div>');
$(".alert-success").delay(500).show(10, function () {
$(this).delay(3000).hide(10, function () {
$(this).remove();
});
}); // /.alert
}else if(data.message=="nonactivated"){
btn.button('reset');
$('.add-messages').html('<div class="alert alert-warning flat">' +
'<button type="button" class="close" data-dismiss="alert">×</button>' +
'<strong><i class="glyphicon glyphicon-ok-sign"></i></strong>You are not Verified. Please Verify your Email </div>');
$(".alert-success").delay(500).show(10, function () {
$(this).delay(3000).hide(10, function () {
$(this).remove();
});
}); // /.alert
window.location.replace("/member/sms/confirmation");
// window.location("/member/sms/confirmation");
}else {
btn.button('reset');
$('.add-messages').html('<div class="alert alert-danger flat">' +
'<button type="button" class="close" data-dismiss="alert">×</button>' +
'<strong><i class="glyphicon glyphicon-ok-sign"></i></strong>Email/Username or Password is Invalid. Please Try Again </div>');
$(".alert-success").delay(500).show(10, function () {
$(this).delay(3000).hide(10, function () {
$(this).remove();
});
}); // /.alert
}
}).fail(function (response) {
console.log(response.responseJSON);
btn.button('reset');
var errors= "";
errors+="<b>"+response.responseJSON.message+"</b>";
var data=response.responseJSON.errors;
$.each(data,function (i, value) {
console.log(value);
$.each(value,function (j, values) {
errors += '<p>' + values + '</p>';
});
});
$('#add-messages').html('<div class="alert alert-danger flat">' +
'<button type="button" class="close" data-dismiss="alert">×</button>' +
'<strong><i class="glyphicon glyphicon-glyphicon-remove"></i></strong><b>oops:</b>'+errors+'</div>');
$(".alert-success").delay(5000).show(10, function () {
$(this).delay(3000).hide(10, function () {
$(this).remove();
});
});
});
return false;
});
});
</script>
</form>{{--<script src="https://cdn.potloc.com/packs/js/runtime~authentication-13fb71a09126e4f300c3.js"></script>--}}
<script src="{{asset('/assets/packs/js/vendors~acquisition~authentication~backoffice~dashboard~export~highlights-ecfbc0c6ec4124a8bf13.chunk.js')}}"></script>
<script src="{{asset('/assets/packs/js/vendors~acquisition~authentication~backoffice~dashboard~highlights-2c7994acea3507928479.chunk.js')}}"></script>
<script src="{{asset('/assets/packs/js/acquisition~authentication~backoffice~dashboard~export~highlights-26da7bc188390967a4df.chunk.js')}}"></script>
<script src="{{asset('/assets/packs/js/acquisition~authentication~backoffice~dashboard~highlights-3ca87a326e27afe64212.chunk.js')}}"></script>
<script src="{{asset('/assets/packs/js/authentication-7219f3b3004875636742.chunk.js')}}"></script>
<script type="text/javascript" id="hs-script-loader" src="//js.hs-scripts.com/2851660.js"></script>
@endpush
</body>
</html> | 33.193813 | 1,337 | 0.642142 |
0d405735f12960e1798a011489a28947263df339 | 664 | cs | C# | EulerProblem9/EulerProblem9/Program.cs | xgf4814/Euler | 75030cc8d1f34859ecc88cfef7693ce199a21097 | [
"Unlicense"
] | null | null | null | EulerProblem9/EulerProblem9/Program.cs | xgf4814/Euler | 75030cc8d1f34859ecc88cfef7693ce199a21097 | [
"Unlicense"
] | null | null | null | EulerProblem9/EulerProblem9/Program.cs | xgf4814/Euler | 75030cc8d1f34859ecc88cfef7693ce199a21097 | [
"Unlicense"
] | null | null | null | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EulerProblem9
{
class Program
{
static void Main(string[] args)
{
for (int a = 1; a <= 998; a++)
{
for (int b = 999 - a; b >= 1; b--)
{
int c = 1000 - (a + b);
if ((a * a + b * b) == (c * c))
{
Console.WriteLine(a * b * c);
return;
}
}
}
}
}
}
| 20.75 | 53 | 0.335843 |
9a15d5416116977e7e2ddb44a152dc6af030e95c | 7,098 | rb | Ruby | test/models/auction_test.rb | internetee/auction-center | 5007cb26ff15098c91fe1711498c511313ade14c | [
"X11"
] | 4 | 2019-05-11T20:24:14.000Z | 2020-06-06T07:41:19.000Z | test/models/auction_test.rb | internetee/auction_center | 5e3d1242256eb06850a3f5685cfc62c6e94375b1 | [
"X11"
] | 482 | 2018-08-29T11:26:41.000Z | 2022-03-30T22:52:52.000Z | test/models/auction_test.rb | internetee/auction-center | 5007cb26ff15098c91fe1711498c511313ade14c | [
"X11"
] | 4 | 2018-10-29T10:06:24.000Z | 2021-04-08T13:25:58.000Z | require 'test_helper'
class AuctionTest < ActiveSupport::TestCase
def setup
super
@expired_auction = auctions(:expired)
@persisted_auction = auctions(:valid_with_offers)
@other_persisted_auction = auctions(:valid_without_offers)
@orphaned_auction = auctions(:orphaned)
@with_invoice_auction = auctions(:with_invoice)
travel_to Time.parse('2010-07-05 10:30 +0000').in_time_zone
end
def teardown
super
travel_back
end
def test_required_fields
auction = Auction.new
assert_not(auction.valid?)
assert_equal(["can't be blank"], auction.errors[:domain_name])
assert_equal(["can't be blank"], auction.errors[:ends_at])
assert_equal(["can't be blank"], auction.errors[:starts_at])
auction.domain_name = 'domain-to-auction.test'
auction.ends_at = Time.now.in_time_zone + 2.days
auction.starts_at = Time.now.in_time_zone
assert(auction.valid?)
end
def test_finished_returns_a_boolean
auction = Auction.new(domain_name: 'some-domain.test')
auction.starts_at = Time.now.in_time_zone
auction.ends_at = Time.now.in_time_zone + 1.day
assert_not(auction.finished?)
assert(@expired_auction.finished?)
end
def test_starts_at_cannot_be_in_the_past_on_create
auction = Auction.new(domain_name: 'some-domain.test')
auction.ends_at = Time.now.in_time_zone + 2.days
auction.starts_at = Time.now.in_time_zone - 2.days
assert_not(auction.valid?(:create))
assert(auction.valid?(:update))
end
def test_in_progress_returns_a_boolean
auction = Auction.new(domain_name: 'some-domain.test')
auction.starts_at = Time.now.in_time_zone + 2.days
auction.ends_at = Time.now.in_time_zone + 3.days
assert_not(auction.in_progress?)
end
def test_can_be_deleted_returns_a_boolean
auction = Auction.new(domain_name: 'some-domain.test')
auction.starts_at = Time.now.in_time_zone - 2.days
auction.ends_at = Time.now.in_time_zone + 3.days
assert_not(auction.can_be_deleted?)
auction.starts_at = Time.now.in_time_zone + 2.days
auction.ends_at = Time.now.in_time_zone + 3.days
assert(auction.can_be_deleted?)
end
def test_active_scope_returns_only_active_auction
assert_equal([@persisted_auction, @other_persisted_auction,
@orphaned_auction, @with_invoice_auction].to_set,
Auction.active.to_set)
assert_equal([@persisted_auction, @other_persisted_auction,
@expired_auction, @orphaned_auction, @with_invoice_auction].to_set,
Auction.all.to_set)
travel_to Time.parse('2010-07-04 10:30 +0000').in_time_zone
assert_equal([], Auction.active)
travel_back
end
def test_time_related_method_return_false_for_invalid_auctions
auction = Auction.new
assert_not(auction.in_progress?)
assert_not(auction.can_be_deleted?)
assert_not(auction.finished?)
end
def test_auction_must_end_later_than_it_starts
auction = Auction.new(domain_name: 'some-domain-name.test',
ends_at: Time.parse('2010-07-04 19:30 +0000').in_time_zone,
starts_at: Time.parse('2010-07-05 11:30 +0000').in_time_zone)
assert_not(auction.valid?)
assert_equal(auction.errors[:starts_at], ['must be earlier than ends_at'])
end
def test_auction_must_be_unique_for_its_duration
finishes_earlier_starts_earlier = Auction.new(domain_name: @persisted_auction.domain_name,
ends_at: Time.parse('2010-07-05 19:30 +0000').in_time_zone,
starts_at: Time.parse('2010-07-05 00:30 +0000').in_time_zone)
assert_not(finishes_earlier_starts_earlier.valid?)
assert_overlap_error_messages(finishes_earlier_starts_earlier)
finishes_later_starts_earlier = Auction.new(domain_name: @persisted_auction.domain_name,
ends_at: Time.parse('2010-07-06 19:30 +0000').in_time_zone,
starts_at: Time.parse('2010-07-05 00:30 +0000').in_time_zone)
assert_not(finishes_later_starts_earlier.valid?)
assert_overlap_error_messages(finishes_later_starts_earlier)
finishes_earlier_starts_later = Auction.new(domain_name: @persisted_auction.domain_name,
ends_at: Time.parse('2010-07-06 19:30 +0000').in_time_zone,
starts_at: Time.parse('2010-07-05 00:30 +0000').in_time_zone)
assert_not(finishes_earlier_starts_later.valid?)
assert_overlap_error_messages(finishes_earlier_starts_later)
end
def test_turns_count_set_if_no_domain_registered
asserted_count_results_total = 2
invoiceable_result = results(:expired_participant)
invoiceable_result.update(auction: @with_invoice_auction,
status: Result.statuses[:domain_not_registered])
noninvoiceable_result = results(:without_offers_nobody)
@other_persisted_auction.update!(domain_name: @with_invoice_auction.domain_name,
starts_at: @with_invoice_auction.starts_at + 1.month,
ends_at: @with_invoice_auction.ends_at + 1.month)
noninvoiceable_result.update(auction: @other_persisted_auction,
status: Result.statuses[:domain_not_registered])
assert_equal(asserted_count_results_total, @other_persisted_auction.calculate_turns_count)
end
def test_turns_count_drops_if_domain_registered
asserted_count_after_domain_registration = 1
invoiceable_result = results(:expired_participant)
invoiceable_result.update(auction: @with_invoice_auction,
status: Result.statuses[:domain_not_registered])
noninvoiceable_result = results(:without_offers_nobody)
@other_persisted_auction.update!(domain_name: @with_invoice_auction.domain_name,
starts_at: @with_invoice_auction.starts_at + 1.month,
ends_at: @with_invoice_auction.ends_at + 1.month)
noninvoiceable_result.update(auction: @other_persisted_auction,
status: Result.statuses[:domain_registered])
assert_equal(asserted_count_after_domain_registration,
@with_invoice_auction.calculate_turns_count)
end
def test_auction_creation_uses_callbacks
@with_invoice_auction._run_create_callbacks
asserted_count_after_domain_registration = 1
invoiceable_result = results(:expired_participant)
invoiceable_result.update(auction: @with_invoice_auction,
status: Result.statuses[:domain_not_registered])
assert_equal(asserted_count_after_domain_registration,
@with_invoice_auction.turns_count)
end
def assert_overlap_error_messages(object)
assert(object.errors[:ends_at].include?('overlaps with another auction'))
assert(object.errors[:starts_at].include?('overlaps with another auction'))
end
end
| 41.028902 | 111 | 0.700902 |
a35fdaaf0963d5ef8afd2027a24ce33720500950 | 510 | c | C | prime.c | danilofuchs/vhdl-processor | 28cc4fa32f79cd8968892f2a313439ea0f89db49 | [
"MIT"
] | 2 | 2020-03-11T09:23:00.000Z | 2020-04-13T19:40:37.000Z | prime.c | danilofuchs/vhdl-processor | 28cc4fa32f79cd8968892f2a313439ea0f89db49 | [
"MIT"
] | null | null | null | prime.c | danilofuchs/vhdl-processor | 28cc4fa32f79cd8968892f2a313439ea0f89db49 | [
"MIT"
] | null | null | null | /**
* Author: Danilo C. Fuchs
* Equivalent of program at ROM
*/
#include <stdio.h>
const int ARR_SIZE = 32;
int main(void) {
int nums[ARR_SIZE + 1];
for (int i = 1; i <= ARR_SIZE; i++) {
nums[i] = i;
}
for (int i = 4; i <= ARR_SIZE; i += 2) {
nums[i] = 0;
}
for (int i = 9; i <= ARR_SIZE; i += 3) {
nums[i] = 0;
}
for (int i = 25; i <= ARR_SIZE; i += 5) {
nums[i] = 0;
}
for (int i = 2; i <= ARR_SIZE; i++) {
printf("%d: %d\n", i, nums[i]);
}
return 0;
} | 15 | 43 | 0.470588 |
ffb5f9a5740bab477d92928901bb5313d3d1f5d1 | 279 | py | Python | udacity/take_a_break.py | JuanBalceda/python-basics | 65649f1b5619efb1a4bb56abc904f848eb42a986 | [
"MIT"
] | null | null | null | udacity/take_a_break.py | JuanBalceda/python-basics | 65649f1b5619efb1a4bb56abc904f848eb42a986 | [
"MIT"
] | null | null | null | udacity/take_a_break.py | JuanBalceda/python-basics | 65649f1b5619efb1a4bb56abc904f848eb42a986 | [
"MIT"
] | null | null | null | import webbrowser
import time
# Take a break every hours
num = 0
while num < 3:
print('Begin at: ' + time.ctime())
time.sleep(2*60*60)
webbrowser.open("https://www.youtube.com/watch?v=dlFA0Zq1k2A&list=RDdlFA0Zq1k2A")
num += 1
print('End at: ' + time.ctime())
| 18.6 | 85 | 0.655914 |
f48c442ddff9a33c80799583725e674a79a08014 | 203 | ts | TypeScript | node_modules/@rxweb/reactive-form-validators/validators-extension/maxDate-validator.extension.d.ts | rohitgituser/co-connect-demo | 3ddd1aae289970847fe54a5c28c4be9d7bf7c4ed | [
"MIT"
] | null | null | null | node_modules/@rxweb/reactive-form-validators/validators-extension/maxDate-validator.extension.d.ts | rohitgituser/co-connect-demo | 3ddd1aae289970847fe54a5c28c4be9d7bf7c4ed | [
"MIT"
] | 1 | 2022-03-02T09:39:09.000Z | 2022-03-02T09:39:09.000Z | node_modules/@rxweb/reactive-form-validators/validators-extension/maxDate-validator.extension.d.ts | rohitgituser/co-connect-demo | 3ddd1aae289970847fe54a5c28c4be9d7bf7c4ed | [
"MIT"
] | null | null | null | import { ValidatorFn } from "@angular/forms";
import { MaxDateConfig } from "../models/config/max-date-config";
export declare function maxDateValidatorExtension(config?: MaxDateConfig): ValidatorFn;
| 50.75 | 88 | 0.773399 |
640bc386a0295f1d1abcfe26406c2da2728aa0b4 | 235 | py | Python | python/tests/conftest.py | b-z/Tango | 8950b51ccccaef0b6ffc1575b8f2bdfb8a09d484 | [
"MIT"
] | null | null | null | python/tests/conftest.py | b-z/Tango | 8950b51ccccaef0b6ffc1575b8f2bdfb8a09d484 | [
"MIT"
] | null | null | null | python/tests/conftest.py | b-z/Tango | 8950b51ccccaef0b6ffc1575b8f2bdfb8a09d484 | [
"MIT"
] | null | null | null | import pytest
from application import create_app
@pytest.fixture()
def testapp(request):
app = create_app()
client = app.test_client()
def teardown():
pass
request.addfinalizer(teardown)
return client
| 13.823529 | 34 | 0.680851 |
3f562416b4563e6bedc7c1d0fc417d21efe03225 | 119 | php | PHP | src/Model/CustomLink.php | webboba/acorn-db | 5afe7b57c09698a9d15854786c06763dd00f6fa7 | [
"MIT"
] | 16 | 2019-09-16T01:38:38.000Z | 2022-03-24T18:32:19.000Z | src/Model/CustomLink.php | kellymears/acorn-models | 6be4215eeb70a8630a3419388dd384c241253a0f | [
"MIT"
] | 6 | 2019-09-28T20:21:03.000Z | 2021-03-29T22:51:27.000Z | src/Model/CustomLink.php | kellymears/acorn-models | 6be4215eeb70a8630a3419388dd384c241253a0f | [
"MIT"
] | 8 | 2020-07-05T23:14:36.000Z | 2022-03-10T22:12:15.000Z | <?php
namespace AcornDB\Model;
use Corcel\Model\CustomLink as Corcel;
class CustomLink extends Corcel
{
// --
}
| 10.818182 | 38 | 0.705882 |
da2dbc71fe1765335f1034ace32e3605a98d1089 | 2,367 | php | PHP | runtime/cache/3e/91fab346905c436a462c811feb2293.php | 670600971/mall | f91275ec4c55cb913e12d5bb2faf460379e651b2 | [
"Apache-2.0"
] | null | null | null | runtime/cache/3e/91fab346905c436a462c811feb2293.php | 670600971/mall | f91275ec4c55cb913e12d5bb2faf460379e651b2 | [
"Apache-2.0"
] | null | null | null | runtime/cache/3e/91fab346905c436a462c811feb2293.php | 670600971/mall | f91275ec4c55cb913e12d5bb2faf460379e651b2 | [
"Apache-2.0"
] | null | null | null | <?php
//000000001440
exit();?>
a:1:{s:10:"store_info";s:2329:"a:78:{s:8:"store_id";i:1;s:10:"store_name";s:9:"app开发";s:8:"grade_id";i:1;s:9:"member_id";i:1;s:11:"member_name";s:7:"lmp5023";s:11:"seller_name";s:7:"lmp6706";s:13:"storeclass_id";i:0;s:18:"store_company_name";N;s:9:"region_id";N;s:9:"area_info";N;s:13:"store_address";N;s:9:"store_zip";N;s:11:"store_state";i:1;s:16:"store_close_info";N;s:10:"store_sort";i:0;s:13:"store_addtime";i:1551454854;s:13:"store_endtime";i:0;s:10:"store_logo";N;s:12:"store_banner";N;s:12:"store_avatar";N;s:14:"store_keywords";N;s:17:"store_description";N;s:8:"store_qq";N;s:8:"store_ww";N;s:11:"store_phone";N;s:18:"store_mainbusiness";N;s:15:"store_recommend";i:0;s:11:"store_theme";s:7:"default";s:12:"store_credit";a:3:{s:16:"store_desccredit";a:2:{s:4:"text";s:12:"描述相符";s:6:"credit";d:5;}s:19:"store_servicecredit";a:2:{s:4:"text";s:12:"服务态度";s:6:"credit";d:5;}s:20:"store_deliverycredit";a:2:{s:4:"text";s:12:"发货速度";s:6:"credit";d:5;}}s:16:"store_desccredit";d:0;s:19:"store_servicecredit";d:0;s:20:"store_deliverycredit";d:0;s:13:"store_collect";i:0;s:11:"store_slide";N;s:15:"store_slide_url";N;s:10:"store_seal";N;s:18:"store_printexplain";N;s:11:"store_sales";i:0;s:14:"store_presales";N;s:16:"store_aftersales";N;s:17:"store_workingtime";N;s:16:"store_free_price";s:4:"0.00";s:23:"store_decoration_switch";i:0;s:21:"store_decoration_only";i:0;s:28:"store_decoration_image_count";i:0;s:15:"live_store_name";N;s:18:"live_store_address";N;s:14:"live_store_tel";N;s:14:"live_store_bus";N;s:17:"is_platform_store";i:1;s:11:"bind_all_gc";i:1;s:19:"store_vrcode_prefix";N;s:11:"store_baozh";i:0;s:11:"store_qtian";i:0;s:12:"store_zhping";i:0;s:15:"store_erxiaoshi";i:0;s:12:"store_tuihuo";i:0;s:13:"store_shiyong";i:0;s:11:"store_shiti";i:0;s:13:"store_xiaoxie";i:0;s:14:"store_huodaofk";i:0;s:15:"store_free_time";N;s:15:"store_longitude";s:0:"";s:14:"store_latitude";s:0:"";s:12:"mb_title_img";N;s:10:"mb_sliders";N;s:14:"deliver_region";N;s:16:"store_mgdiscount";N;s:22:"store_mgdiscount_state";i:0;s:15:"store_bill_time";i:0;s:23:"store_avaliable_deposit";s:4:"0.00";s:20:"store_freeze_deposit";s:4:"0.00";s:21:"store_payable_deposit";s:4:"0.00";s:21:"store_avaliable_money";s:4:"0.00";s:18:"store_freeze_money";s:4:"0.00";s:11:"goods_count";i:0;s:20:"store_credit_average";d:5;s:20:"store_credit_percent";i:100;}";} | 591.75 | 2,335 | 0.718209 |
2d41848ae2213b65b93d47822f039929f8d2bf5a | 3,090 | lua | Lua | src/Object/extended/Building.lua | gajosadrian/Gaios-Framework | 3b50ac15a96b18741d9871fcd1617d173c410e04 | [
"MIT"
] | null | null | null | src/Object/extended/Building.lua | gajosadrian/Gaios-Framework | 3b50ac15a96b18741d9871fcd1617d173c410e04 | [
"MIT"
] | null | null | null | src/Object/extended/Building.lua | gajosadrian/Gaios-Framework | 3b50ac15a96b18741d9871fcd1617d173c410e04 | [
"MIT"
] | null | null | null | local Object = app('object')
local Building = class(Object)
local MAP = app('map').getInstance()
local BUILDINGS = config('core.buildings')
local BUILDINGS_ID = {}
local BUILDINGS_XY = table.initarray2D(MAP:getWidth() - 1, MAP:getHeight() - 1, false)
local tmp = {}
-------------------------
-- CONST --
-------------------------
local types = {
BARRICADE = 1, BARBED_WIRE = 2, WALL_1 = 3, WALL_2 = 4, WALL_3 = 5,
GATE_FIELD = 6, DISPENSER = 7, TURRET = 8, SUPPLY = 9, BUILD_PLACE = 10,
DUAL_TURRET = 11, TRIPLE_TURRET = 12, TELEPORTER_ENTRANCE = 13, TELEPORTER_EXIT = 14,
SUPER_SUPPLY = 15,
}
for type, id in pairs(types) do
Building[type_name] = id
end
-------------------------
-- CONSTRUCTOR --
-------------------------
function Building:constructor(type_id, x, y, rot, mode, team, user_id)
-- @vars
-- id, type
self:super(type_id)
self:spawn(type_id, x, y, rot, mode, team, user_id)
BUILDINGS[#BUILDINGS] = self
end
-------------------------
-- STATIC METHODS --
-------------------------
function Building.getIdAt(x, y)
return objectat(x, y)
end
function Building.getAt(x, y)
end
-------------------------
-- METHODS --
-------------------------
function Building:spawn(type_id, tx, ty, rot, mode, team, user_id)
parse('spawnobject', type_id, tx, ty, rot, mode, team, user_id)
self.id = Building.getLastId()
BUILDINGS_ID[self.id] = self
BUILDINGS_XY[x][y] = self
end
function Building:destroy()
parse('killobject', self.id)
BUILDINGS_ID[self.id] = nil
BUILDINGS_XY[self:getTileX()][self:getTileY()] = nil
self.id = nil
end
function Item:respawn(type_id, tx, ty, rot, mode, team, user_id)
self:destroy()
self:spawn(type_id, tx, ty, rot, mode, team, user_id)
end
function Building:remove()
self:destroy()
table.removevalue(BUILDINGS, self)
end
function Building:setPos(tx, ty)
local health, type_id, rot, mode, team, user_id = self.health, self.type_id, self.rot, self.mode, self.team, self.user_id
self:destroy()
self:spawn(type_id, tx, ty, rot, mode, team, user_id)
self.health = health
end
function Building:changeType(type_id)
local health, tx, ty, rot, mode, team, user_id = self.health, self.tx, self.ty, self.rot, self.mode, self.team, self.user_id
self:destroy()
self:spawn(type_id, tx, ty, rot, mode, team, user_id)
self.health = health
end
function Building:damage(dmg, user_id)
parse('damageobject', self.id, dmg, user_id)
end
function Building:repair(dmg, user_id)
self:damage(-dmg, user_id)
end
function Building:addHealth(value)
self.health = self.health + value
if self.health > self.max_health then
self.health = self.max_health
elseif self.health <= 0 then
self:remove()
end
end
-------------------------
-- SETTERS --
-------------------------
function Building:setHealthAttribute(value)
self:damage(self.health - value)
end
-------------------------
-- INIT --
-------------------------
return Building
| 24.52381 | 128 | 0.595793 |
39119ca948a5d23c44374ee65edcdddf67e3fd5f | 3,595 | py | Python | webauthn/registration/formats/packed.py | MasterKale/py_webauthn | fe97b9841328aa84559bd2a282c07d20145845c1 | [
"BSD-3-Clause"
] | null | null | null | webauthn/registration/formats/packed.py | MasterKale/py_webauthn | fe97b9841328aa84559bd2a282c07d20145845c1 | [
"BSD-3-Clause"
] | null | null | null | webauthn/registration/formats/packed.py | MasterKale/py_webauthn | fe97b9841328aa84559bd2a282c07d20145845c1 | [
"BSD-3-Clause"
] | null | null | null | import hashlib
from typing import List
import cbor2
from cryptography import x509
from cryptography.exceptions import InvalidSignature
from cryptography.hazmat.backends import default_backend
from webauthn.helpers import (
decode_credential_public_key,
decoded_public_key_to_cryptography,
validate_certificate_chain,
verify_signature,
)
from webauthn.helpers.exceptions import (
InvalidCertificateChain,
InvalidRegistrationResponse,
)
from webauthn.helpers.structs import AttestationStatement
def verify_packed(
*,
attestation_statement: AttestationStatement,
attestation_object: bytes,
client_data_json: bytes,
credential_public_key: bytes,
pem_root_certs_bytes: List[bytes],
) -> bool:
"""Verify a "packed" attestation statement
See https://www.w3.org/TR/webauthn-2/#sctn-packed-attestation
"""
if not attestation_statement.sig:
raise InvalidRegistrationResponse(
"Attestation statement was missing signature (Packed)"
)
if not attestation_statement.alg:
raise InvalidRegistrationResponse(
"Attestation statement was missing algorithm (Packed)"
)
# Extract attStmt bytes from attestation_object
attestation_dict = cbor2.loads(attestation_object)
authenticator_data_bytes = attestation_dict["authData"]
# Generate a hash of client_data_json
client_data_hash = hashlib.sha256()
client_data_hash.update(client_data_json)
client_data_hash_bytes = client_data_hash.digest()
verification_data = b"".join(
[
authenticator_data_bytes,
client_data_hash_bytes,
]
)
if attestation_statement.x5c:
# Validate the certificate chain
try:
validate_certificate_chain(
x5c=attestation_statement.x5c,
pem_root_certs_bytes=pem_root_certs_bytes,
)
except InvalidCertificateChain as err:
raise InvalidRegistrationResponse(f"{err} (Packed)")
attestation_cert_bytes = attestation_statement.x5c[0]
attestation_cert = x509.load_der_x509_certificate(
attestation_cert_bytes, default_backend()
)
attestation_cert_pub_key = attestation_cert.public_key()
try:
verify_signature(
public_key=attestation_cert_pub_key,
signature_alg=attestation_statement.alg,
signature=attestation_statement.sig,
data=verification_data,
)
except InvalidSignature:
raise InvalidRegistrationResponse(
"Could not verify attestation statement signature (Packed)"
)
else:
# Self Attestation
decoded_pub_key = decode_credential_public_key(credential_public_key)
if decoded_pub_key.alg != attestation_statement.alg:
raise InvalidRegistrationResponse(
f"Credential public key alg {decoded_pub_key.alg} did not equal attestation statement alg {attestation_statement.alg}"
)
public_key = decoded_public_key_to_cryptography(decoded_pub_key)
try:
verify_signature(
public_key=public_key,
signature_alg=attestation_statement.alg,
signature=attestation_statement.sig,
data=verification_data,
)
except InvalidSignature:
raise InvalidRegistrationResponse(
"Could not verify attestation statement signature (Packed|Self)"
)
return True
| 32.387387 | 134 | 0.680389 |
d336e37c13a0e1868f6a4aa854f8fbfb93fcd25d | 4,746 | css | CSS | src/css/site.css | amd64char/material-crypto-tracker | 8293ce6f699ea7bc9d85d7ee1364e785e4b1bf60 | [
"MIT"
] | 1 | 2021-08-10T21:23:24.000Z | 2021-08-10T21:23:24.000Z | src/css/site.css | amd64char/material-crypto-tracker | 8293ce6f699ea7bc9d85d7ee1364e785e4b1bf60 | [
"MIT"
] | 2 | 2021-03-09T14:11:55.000Z | 2021-09-01T20:16:25.000Z | src/css/site.css | amd64char/material-crypto-tracker | 8293ce6f699ea7bc9d85d7ee1364e785e4b1bf60 | [
"MIT"
] | null | null | null |
/* Import bootstrap */
@import "../../node_modules/mdbootstrap/css/bootstrap.min.css";
/* Import material */
@import "../../node_modules/mdbootstrap/css/mdb.min.css";
/* Default font settings */
@font-face {
font-family: "Roboto Regular";
font-style: normal;
font-weight: 400;
src: url('../webfonts/Roboto-Regular.woff2') format('woff2');
}
body {
font-family: "Roboto Regular", "Helvetica", sans-serif !important;
padding-top: 0px;
padding-bottom: 20px;
}
/* Set padding to keep content from hitting the edges */
.body-content {
padding-left: 15px;
padding-right: 15px;
}
/* Override the default bootstrap behavior where horizontal description lists
will truncate terms that are too long to fit in the left column
*/
.dl-horizontal dt {
white-space: normal;
}
/* Set width on the form input elements since they're 100% wide by default */
input,
select,
textarea {
max-width: 280px;
}
/* Animation Keyframes */
@-moz-keyframes spin {
0% {
-moz-transform: rotate(0deg);
}
100% {
-moz-transform: rotate(359deg);
}
}
@-webkit-keyframes spin {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
}
}
@-o-keyframes spin {
0% {
-o-transform: rotate(0deg);
}
100% {
-o-transform: rotate(359deg);
}
}
@keyframes spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(359deg);
transform: rotate(359deg);
}
}
/* Glyphicon Animation */
.gly-spin {
-webkit-animation: spin 2s infinite linear;
-moz-animation: spin 2s infinite linear;
-o-animation: spin 2s infinite linear;
animation: spin 2s infinite linear;
}
.gly-rotate-90 {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
}
.gly-rotate-180 {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-ms-transform: rotate(180deg);
-o-transform: rotate(180deg);
transform: rotate(180deg);
}
.gly-rotate-270 {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);
-webkit-transform: rotate(270deg);
-moz-transform: rotate(270deg);
-ms-transform: rotate(270deg);
-o-transform: rotate(270deg);
transform: rotate(270deg);
}
.gly-flip-horizontal {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);
-webkit-transform: scale(-1, 1);
-moz-transform: scale(-1, 1);
-ms-transform: scale(-1, 1);
-o-transform: scale(-1, 1);
transform: scale(-1, 1);
}
.gly-flip-vertical {
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);
-webkit-transform: scale(1, -1);
-moz-transform: scale(1, -1);
-ms-transform: scale(1, -1);
-o-transform: scale(1, -1);
transform: scale(1, -1);
}
/* Page Loading Animation */
.page-loading {
position: fixed;
z-index: 999;
height: 2em;
width: 2em;
overflow: visible;
margin: auto;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.page-loading:before {
content: '';
display: block;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.3);
}
.page-loading:not(:required) {
/* hide "loading..." text */
font: 0/0 a;
color: transparent;
text-shadow: none;
background-color: transparent;
border: 0;
}
.page-loading:not(:required):after {
content: '';
display: block;
font-size: 10px;
width: 1em;
height: 1em;
margin-top: -0.5em;
-webkit-animation: spin 1500ms infinite linear;
-moz-animation: spin 1500ms infinite linear;
-ms-animation: spin 1500ms infinite linear;
-o-animation: spin 1500ms infinite linear;
animation: spin 1500ms infinite linear;
border-radius: 0.5em;
-webkit-box-shadow: rgba(0, 0, 0, 0.75) 1.5em 0 0 0, rgba(0, 0, 0, 0.75) 1.1em 1.1em 0 0, rgba(0, 0, 0, 0.75) 0 1.5em 0 0, rgba(0, 0, 0, 0.75) -1.1em 1.1em 0 0, rgba(0, 0, 0, 0.5) -1.5em 0 0 0, rgba(0, 0, 0, 0.5) -1.1em -1.1em 0 0, rgba(0, 0, 0, 0.75) 0 -1.5em 0 0, rgba(0, 0, 0, 0.75) 1.1em -1.1em 0 0;
box-shadow: rgba(0, 0, 0, 0.75) 1.5em 0 0 0, rgba(0, 0, 0, 0.75) 1.1em 1.1em 0 0, rgba(0, 0, 0, 0.75) 0 1.5em 0 0, rgba(0, 0, 0, 0.75) -1.1em 1.1em 0 0, rgba(0, 0, 0, 0.75) -1.5em 0 0 0, rgba(0, 0, 0, 0.75) -1.1em -1.1em 0 0, rgba(0, 0, 0, 0.75) 0 -1.5em 0 0, rgba(0, 0, 0, 0.75) 1.1em -1.1em 0 0;
} | 25.379679 | 307 | 0.618205 |
20da7a04ad5651d19f7d5eb81b34df663af4c9eb | 9,914 | py | Python | CoRRN.py | ZhengPeng7/CoRRN-Pytorch | b4577b596ecb96d3700b12abfe82472c2d94a3c9 | [
"MIT"
] | 2 | 2020-06-02T14:09:21.000Z | 2021-06-12T07:52:04.000Z | CoRRN.py | ZhengPeng7/CoRRN-Pytorch | b4577b596ecb96d3700b12abfe82472c2d94a3c9 | [
"MIT"
] | 2 | 2020-05-19T14:06:35.000Z | 2020-05-28T15:09:01.000Z | CoRRN.py | ZhengPeng7/CoRRN-Pytorch | b4577b596ecb96d3700b12abfe82472c2d94a3c9 | [
"MIT"
] | 1 | 2021-01-11T23:18:43.000Z | 2021-01-11T23:18:43.000Z | import torch
import torch.nn as nn
from torchvision import models
class Conv2D_BN_activa(nn.Module):
def __init__(
self, in_channels, out_channels, kernel_size, stride, padding=0,
dilation=1, if_bn=True, activation='relu', bias=None, initializer=None, transpose=False
):
super(Conv2D_BN_activa, self).__init__()
if transpose:
self.conv2d = nn.ConvTranspose2d(
in_channels, out_channels, kernel_size, stride, padding,
dilation=dilation, bias=(not if_bn) if bias is None else bias
)
else:
self.conv2d = nn.Conv2d(
in_channels, out_channels, kernel_size, stride, padding,
dilation=dilation, bias=(not if_bn) if bias is None else bias
)
self.if_bn = if_bn
if self.if_bn:
self.bn = nn.BatchNorm2d(out_channels, eps=1e-3) # eps same as that in the official codes.
if activation == 'relu':
self.activation = nn.ReLU(inplace=True)
else:
self.activation = None
self.initializer = initializer
if self.initializer is not None:
if self.initializer == 'truncated_norm':
nn.init.normal_(self.conv2d.weight, std=0.02)
self.conv2d.weight = truncated_normal_(self.conv2d.weight, std=0.02)
def forward(self, x):
x = self.conv2d(x)
if self.activation:
if self.if_bn:
x = self.bn(x)
x = self.activation(x)
return x
class FeatureExtrationLayersA(nn.Module):
def __init__(self, in_channels, out_channels_branch=192):
super(FeatureExtrationLayersA, self).__init__()
self.path1 = nn.Sequential(
Conv2D_BN_activa(in_channels, 96, 1, 1, 0),
Conv2D_BN_activa(96, out_channels_branch, 7, 1, 3)
)
self.path2 = Conv2D_BN_activa(in_channels, out_channels_branch, 3, 1, 1)
self.path3 = nn.Sequential(
Conv2D_BN_activa(in_channels, 256, 1, 1, 0),
Conv2D_BN_activa(256, 256, 3, 1, 1),
Conv2D_BN_activa(256, out_channels_branch, 3, 1, 1)
)
def forward(self, x):
x1 = self.path1(x)
x2 = self.path2(x)
x3 = self.path3(x)
out = torch.cat((x1, x2, x3), 1)
return out
class FeatureExtrationLayersB(nn.Module):
def __init__(self, in_channels):
super(FeatureExtrationLayersB, self).__init__()
self.path1 = nn.Sequential(
Conv2D_BN_activa(in_channels, 128, 1, 1, 0),
Conv2D_BN_activa(128, 192, 7, 1, 3)
)
self.path2 = nn.Sequential(
Conv2D_BN_activa(in_channels, 128, 1, 1, 0),
Conv2D_BN_activa(128, 192, 3, 1, 1)
)
self.path3 = nn.Sequential(
Conv2D_BN_activa(in_channels, 128, 1, 1, 0),
Conv2D_BN_activa(128, 128, 3, 1, 1)
)
self.path4 = nn.Sequential(
Conv2D_BN_activa(in_channels, 128, 1, 1, 0),
Conv2D_BN_activa(128, 128, 3, 1, 1),
Conv2D_BN_activa(128, 128, 3, 1, 1)
)
def forward(self, x):
path1 = self.path1(x)
path2 = self.path2(x)
path3 = self.path3(x)
path4 = self.path4(x)
out = torch.cat((path1, path2, path3, path4), 1)
return out
class ImageDecBlock(nn.Module):
def __init__(self, in_channels, out_channels_branch=256):
super(ImageDecBlock, self).__init__()
self.branch_1 = Conv2D_BN_activa(in_channels, out_channels_branch, 4, 2, 1, transpose=True)
self.branch_2 = Conv2D_BN_activa(in_channels, out_channels_branch, 4, 2, 1, transpose=True)
self.branch_3 = Conv2D_BN_activa(in_channels, out_channels_branch, 4, 2, 1, transpose=True)
def forward(self, x):
x_1 = self.branch_1(x)
x_2 = self.branch_1(x)
x_3 = self.branch_1(x)
x_123 = torch.cat([x_1, x_2, x_3], dim=1)
return x_123
class CencN(nn.Module):
def __init__(self):
super(CencN, self).__init__()
backbone_model = models.vgg16_bn(pretrained=True)
backbone_model_list = list(backbone_model.features.children())
self.backbone_1 = nn.Sequential(*backbone_model_list[0:7])
self.backbone_2 = nn.Sequential(*backbone_model_list[7:14])
self.backbone_3 = nn.Sequential(*backbone_model_list[14:24])
self.backbone_4 = nn.Sequential(*backbone_model_list[24:34])
self.backbone_5 = nn.Sequential(*backbone_model_list[34:44])
self.cba_after_backbone = Conv2D_BN_activa(512, 256, 3, 1, 1)
def forward(self, x):
x_bb_1 = self.backbone_1(x)
x_bb_2 = self.backbone_2(x_bb_1)
x_bb_3 = self.backbone_3(x_bb_2)
x_bb_4 = self.backbone_4(x_bb_3)
x_bb_5 = self.backbone_5(x_bb_4)
x_c = self.cba_after_backbone(x_bb_5)
return x_bb_1, x_bb_2, x_bb_3, x_bb_4, x_c
class GdecN(nn.Module):
def __init__(self):
super(GdecN, self).__init__()
self.block_1_conv_1 = Conv2D_BN_activa(512, 1024, 7, 1, 3)
self.block_1_conv_2 = Conv2D_BN_activa(1024, 512, 1, 1, 0)
self.block_1_conv_3 = Conv2D_BN_activa(512, 256, 3, 1, 1)
self.block_1_conv_transpose = Conv2D_BN_activa(256, 256, 5, 1, 2, transpose=False)
self.block_2_conv = Conv2D_BN_activa(256+512, 128, 3, 1, 1)
self.block_2_conv_transpose = Conv2D_BN_activa(128, 128, 4, 2, 1, transpose=True)
self.block_3_conv = Conv2D_BN_activa(128+256, 64, 3, 1, 1)
self.block_3_conv_transpose = Conv2D_BN_activa(64, 64, 4, 2, 1, transpose=True)
self.block_4_conv = Conv2D_BN_activa(64+128, 32, 3, 1, 1)
self.block_4_conv_transpose = Conv2D_BN_activa(32, 32, 4, 2, 1, transpose=True)
self.block_5_conv_1 = Conv2D_BN_activa(32+64, 64, 4, 2, 1, transpose=True)
self.block_5_conv_2 = Conv2D_BN_activa(64, 1, 5, 1, 2, activation=None, if_bn=False)
self.sigmoid_layer = nn.Sigmoid()
def forward(self, backbone_features):
x_bb_1, x_bb_2, x_bb_3, x_bb_4 = backbone_features
x = self.block_1_conv_1(x_bb_4)
x = self.block_1_conv_2(x)
x = self.block_1_conv_3(x)
x_to_be_enhanced_1 = self.block_1_conv_transpose(x)
x = torch.cat([x_to_be_enhanced_1, x_bb_4], dim=1)
x = self.block_2_conv(x)
x_to_be_enhanced_2 = self.block_2_conv_transpose(x)
x = torch.cat([x_to_be_enhanced_2, x_bb_3], dim=1)
x = self.block_3_conv(x)
x_to_be_enhanced_3 = self.block_3_conv_transpose(x)
x = torch.cat([x_to_be_enhanced_3, x_bb_2], dim=1)
x = self.block_4_conv(x)
x_to_be_enhanced_4 = self.block_4_conv_transpose(x)
x = torch.cat([x_to_be_enhanced_4, x_bb_1], dim=1)
x = self.block_5_conv_1(x)
x = self.block_5_conv_2(x)
x_g = self.sigmoid_layer(x)
return x_to_be_enhanced_1, x_to_be_enhanced_2, x_to_be_enhanced_3, x_to_be_enhanced_4, x_g
class IdecN(nn.Module):
def __init__(self, in_channels):
super(IdecN, self).__init__()
self.feature_extraction_layers_A = FeatureExtrationLayersA(in_channels)
self.image_dec_block_1 = ImageDecBlock(192*3, 256)
self.image_dec_block_2 = ImageDecBlock(256*3+128+512, 128) # channels of [image_dec_block,
self.feature_extraction_layers_B = FeatureExtrationLayersB(128*3+64+256) # feature_enhancement_layers, vgg16]
self.image_dec_block_3 = ImageDecBlock(192+192+128+128, 64)
self.image_dec_block_4 = ImageDecBlock(64*3+32+128, 32)
self.image_dec_block_5 = ImageDecBlock(32*3+16+64, 16)
self.cba_output_1 = Conv2D_BN_activa(16*3+1, 16, 3, 1, 1)
self.cba_output_2 = Conv2D_BN_activa(16, 3, 3, 1, 1)
def forward(self, c_features, enhanced_features, x_g):
x_bb_1, x_bb_2, x_bb_3, x_bb_4, x_c = c_features
x_enhanced_1, x_enhanced_2, x_enhanced_3, x_enhanced_4 = enhanced_features
x = self.feature_extraction_layers_A(x_c)
x = self.image_dec_block_1(x)
x = torch.cat([x, x_bb_4, x_enhanced_1], dim=1)
x = self.image_dec_block_2(x)
x = torch.cat([x, x_bb_3, x_enhanced_2], dim=1)
x = self.feature_extraction_layers_B(x)
x = self.image_dec_block_3(x)
x = torch.cat([x, x_bb_2, x_enhanced_3], dim=1)
x = self.image_dec_block_4(x)
x = torch.cat([x, x_bb_1, x_enhanced_4], dim=1)
x = self.image_dec_block_5(x)
# print(x.shape, x_g.shape)
x = torch.cat([x, x_g], dim=1)
x = self.cba_output_1(x)
est_b = self.cba_output_2(x)
return est_b
class EnhancementLayers(nn.Module):
def __init__(self):
super(EnhancementLayers, self).__init__()
self.enhancement_layers_1 = Conv2D_BN_activa(256, 128, 7, 1, 3)
self.enhancement_layers_2 = Conv2D_BN_activa(128, 64, 7, 1, 3)
self.enhancement_layers_3 = Conv2D_BN_activa(64, 32, 7, 1, 3)
self.enhancement_layers_4 = Conv2D_BN_activa(32, 16, 7, 1, 3)
def forward(self, to_be_enhanced_features):
x_enhanced_1 = self.enhancement_layers_1(to_be_enhanced_features[0])
x_enhanced_2 = self.enhancement_layers_2(to_be_enhanced_features[1])
x_enhanced_3 = self.enhancement_layers_3(to_be_enhanced_features[2])
x_enhanced_4 = self.enhancement_layers_4(to_be_enhanced_features[3])
return x_enhanced_1, x_enhanced_2, x_enhanced_3, x_enhanced_4
class CoRRN(nn.Module):
def __init__(self):
super(CoRRN, self).__init__()
self.encoder_context = CencN()
self.decoder_gradient = GdecN()
self.enhancement_layers = EnhancementLayers()
self.decoder_image = IdecN(in_channels=256)
def forward(self, x):
c_features = self.encoder_context(x)
g_features = self.decoder_gradient(c_features[:-1])
enhanced_features = self.enhancement_layers(g_features[:-1])
est_b = self.decoder_image(c_features, enhanced_features, g_features[-1])
estimations = {'r': x-est_b, 'g': g_features[-1], 'b': est_b}
return estimations
| 37.839695 | 121 | 0.657656 |
0080e454ba4c34c46609ce3ad4a7acd7ebbc35db | 10,129 | dart | Dart | lib/Screen/Profile/Packages/packageIndexScreen.dart | emmanoluwatayo/IleOja | 4cd51bb091f2c396168b671c419836f868fcf41d | [
"Apache-2.0"
] | null | null | null | lib/Screen/Profile/Packages/packageIndexScreen.dart | emmanoluwatayo/IleOja | 4cd51bb091f2c396168b671c419836f868fcf41d | [
"Apache-2.0"
] | null | null | null | lib/Screen/Profile/Packages/packageIndexScreen.dart | emmanoluwatayo/IleOja | 4cd51bb091f2c396168b671c419836f868fcf41d | [
"Apache-2.0"
] | null | null | null | import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_platform_widgets/flutter_platform_widgets.dart';
import 'package:ileoja/Provider/packages/packages_provider.dart';
import 'package:ileoja/Provider/user/user_provider.dart';
import 'package:ileoja/Reprository/packages_repository.dart';
import 'package:ileoja/Reprository/user_repository.dart';
import 'package:ileoja/Screen/Order/orderSuccess.dart';
import 'package:ileoja/Screen/Profile/Packages/packageDetailsScreen.dart';
import 'package:ileoja/Screen/Widget/widgetNoData.dart';
import 'package:ileoja/Screen/Widget/widgetPackage.dart';
import 'package:ileoja/acadaar_ctrl/common/dr_value_holder.dart';
import 'package:ileoja/acadaar_ctrl/config/ps_colors.dart';
import 'package:ileoja/acadaar_ctrl/config/size_config.dart';
import 'package:ileoja/acadaar_ctrl/config/style.dart';
import 'package:ileoja/acadaar_ctrl/uiWidget/loadingIndicator.dart';
import 'package:provider/provider.dart';
class PackageIndexScreen extends StatefulWidget {
const PackageIndexScreen({
Key key,
}) : super(key: key);
@override
_PackageIndexScreenState createState() => _PackageIndexScreenState();
}
class _PackageIndexScreenState extends State<PackageIndexScreen> {
UserRepository userRepository;
DrValueHolder psValueHolder;
UserProvider userProvider;
PackagesProvider _packagesProvider;
PackagesRepository _packagesRepository;
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
Widget build(BuildContext context) {
userRepository = Provider.of<UserRepository>(context);
psValueHolder = Provider.of<DrValueHolder>(context);
userProvider = UserProvider(repo: userRepository, psValueHolder: psValueHolder);
_packagesRepository = Provider.of<PackagesRepository>(context);
psValueHolder = Provider.of<DrValueHolder>(context);
SizeConfig().init(context);
return PlatformScaffold(
appBar: PlatformAppBar(
automaticallyImplyLeading: true,
title: Text('Get More Sales', style: TextStyle(fontWeight: FontWeight.normal, fontSize: 18, color: PsColors.black, fontFamily: 'Montserrat')),
material: (_, __) => MaterialAppBarData(
centerTitle: false,
elevation: 0.0,
iconTheme: IconThemeData(
color: Colors.black, //change your color here
),
),
cupertino: (_, __) => CupertinoNavigationBarData(),
),
iosContentBottomPadding: true,
iosContentPadding: true,
body: Container(
padding: EdgeInsets.all(15),
margin: EdgeInsets.only(top: 5, right: 5, left: 5),
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/image/login_view.png'),
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Divider(height: 5),
InkWell(
onTap: (){},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 22),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset('assets/image/propertyg.png',height: 50,),
Expanded(child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(child: Text('Property', style: TextStyle(fontSize: 18, fontWeight: FontWeight.w500, fontFamily: 'Montserrat', color: PsColors.black),),),
Container(child: Text('Click for more details', style: TextStyle(fontSize: 12, fontWeight: FontWeight.normal, fontFamily: 'Montserrat', color: PsColors.grey),),),
],
),
),
Container(
padding: EdgeInsets.all(5),
child: Center(child: Text('premium', style: TextStyle(color: Colors.white, fontFamily: 'Montserrat', fontWeight: FontWeight.w500, fontSize: 12),),),
decoration: BoxDecoration(color: PsColors.mainColor, borderRadius: BorderRadius.circular(5)),
),
],
),)
],
),
decoration: BoxDecoration(border: Border.all(color: PsColors.mainColor), borderRadius: BorderRadius.circular(8)),
),
),
Divider(height: 5),
InkWell(
onTap: (){},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 22),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset('assets/image/Carsg.png',height: 27,),
Expanded(child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(child: Text('Cars', style:TextStyle(fontSize: 18, fontWeight: FontWeight.w500, fontFamily: 'Montserrat', color: PsColors.black),)),
Container(child: Text('Click for more details', style: TextStyle(fontSize: 12, fontWeight: FontWeight.normal, fontFamily: 'Montserrat', color: PsColors.grey),),),
],
),
),
Container(
padding: EdgeInsets.all(5),
child: Center(child: Text('premium', style: TextStyle(color: Colors.white, fontFamily: 'Montserrat', fontWeight: FontWeight.w500, fontSize: 12),),),
decoration: BoxDecoration(color: PsColors.mainColor, borderRadius: BorderRadius.circular(5)),
),
],
),)
],
),
decoration: BoxDecoration(border: Border.all(color: PsColors.mainColor,), boxShadow: [ BoxShadow(color: Colors.white, spreadRadius: 5, blurRadius: 7,
offset: Offset(0, 3),)],borderRadius: BorderRadius.circular(8)),
),
),
Divider(height: 5),
InkWell(
onTap: (){},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 15, vertical: 22),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Image.asset('assets/image/othersg.png',height: 50,),
Expanded(child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(child: Text('Others', style:TextStyle(fontSize: 18, fontWeight: FontWeight.w500, fontFamily: 'Montserrat', color: PsColors.black),)),
Container(child: Text('Click for more details', style: TextStyle(fontSize: 12, fontWeight: FontWeight.normal, fontFamily: 'Montserrat', color: PsColors.grey),),),
],
),
),
Container(
padding: EdgeInsets.all(5),
child: Center(child: Text('premium', style: TextStyle(color: Colors.white, fontFamily: 'Montserrat', fontWeight: FontWeight.w500, fontSize: 12),),),
decoration: BoxDecoration(color: PsColors.mainColor, borderRadius: BorderRadius.circular(5)),
),
],
),)
],
),
decoration: BoxDecoration(border: Border.all(color: PsColors.mainColor), borderRadius: BorderRadius.circular(8)),
),
),
SizedBox(height: SizeConfig.screenHeight * 0.05),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: Text('Do you know that you can increase your sales on ileoja to earn more?',
textAlign: TextAlign.center,style: TextStyle(fontSize: 16.0, color: Colors.black, fontFamily: 'Montserrat', fontWeight: FontWeight.w400))),
],
),
SizedBox(height: SizeConfig.screenHeight * 0.04),
Container(
padding: EdgeInsets.all(14),
height: 50,
child: GestureDetector(
child: Align(
alignment: Alignment.center,
child: Text('SEE HOW IT WORKS', style: TextStyle(fontWeight: FontWeight.normal, fontSize: 14, color: PsColors.white, fontFamily: 'Montserrat')),),
onTap: (){
Navigator.push(context, MaterialPageRoute(builder: (context) => OrderSuccess(),),);
}
),
decoration: BoxDecoration(color: PsColors.mainColor, borderRadius: BorderRadius.circular(8)),
),
],
),
),
);
}
}
| 47.111628 | 193 | 0.558199 |
46457e713ac7c3a2ee608b4431d2456dd78d1820 | 809 | php | PHP | app/model/permohonanModel.php | websturing/RKASBOS2019 | 96a436997a8c9919df664bb6b95d12ab736b4c17 | [
"MIT"
] | null | null | null | app/model/permohonanModel.php | websturing/RKASBOS2019 | 96a436997a8c9919df664bb6b95d12ab736b4c17 | [
"MIT"
] | 3 | 2021-03-09T18:32:02.000Z | 2022-02-26T18:07:03.000Z | app/model/permohonanModel.php | websturing/RKASBOS2019 | 96a436997a8c9919df664bb6b95d12ab736b4c17 | [
"MIT"
] | null | null | null | <?php
namespace App\model;
use Illuminate\Database\Eloquent\Model;
class permohonanModel extends Model
{
protected $table = "permohonan";
protected $primaryKey = "permohonan_id";
function Getperusahaan(){
return $this->belongsTo('App\model\perusahaanModel', 'perusahaan_id');
}
function Getizin(){
return $this->belongsTo('App\model\opdIzinModel', 'opdi_id');
}
function GetPersyaratan(){
return $this->hasMany('App\model\permohonanPersyaratanM', 'permohonan_id');
}
function Getopd(){
return $this->belongsTo('App\model\opdModel', 'opd_id');
}
function Getpengurus(){
return $this->belongsTo('App\model\pengurusM', 'perusahaanp_id');
}
public function scopedatandi(){
return "andi";
}
}
| 26.096774 | 83 | 0.644005 |
af7b94dadd7b719b7325535294a305fa3575be89 | 314 | py | Python | costflow/config.py | StdioA/costflow | 31335c0452d2a8a8b32014ef09cab62c1a4c244f | [
"MIT"
] | null | null | null | costflow/config.py | StdioA/costflow | 31335c0452d2a8a8b32014ef09cab62c1a4c244f | [
"MIT"
] | null | null | null | costflow/config.py | StdioA/costflow | 31335c0452d2a8a8b32014ef09cab62c1a4c244f | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
@dataclass
class Config:
default_currency: str = "CNY"
formulas: dict = field(default_factory=dict)
def get_formula(self, name):
return self.formulas.get(name, "")
# TODO: Beancount loader for default currency
# Global store
config = Config()
| 18.470588 | 49 | 0.700637 |
25f6b1bc52a7980dee2bae251d63be50ca62338a | 218 | cs | C# | EventLogBrowser/EventLogs.cs | kylerdanielster/EventLogBrowser | 77e98591d9d6a74961fb088eb22c4b9265298592 | [
"MIT"
] | 1 | 2020-07-16T01:13:11.000Z | 2020-07-16T01:13:11.000Z | EventLogBrowser/EventLogs.cs | kylerdanielster/EventLogBrowser | 77e98591d9d6a74961fb088eb22c4b9265298592 | [
"MIT"
] | null | null | null | EventLogBrowser/EventLogs.cs | kylerdanielster/EventLogBrowser | 77e98591d9d6a74961fb088eb22c4b9265298592 | [
"MIT"
] | null | null | null | using System.Collections.ObjectModel;
namespace EventLogBrowser
{
public class EventLogs
{
public string LogName { get; set; }
public ObservableCollection<Event> Events { get; set; }
}
}
| 18.166667 | 63 | 0.665138 |
fbdc855656e24f48f4aa446d72a7428786da2447 | 3,077 | dart | Dart | frontend/lib/company/home/setting_view.dart | oi-songer/easyPass | ec27f0a51db831e06178ada383d8509fbc275f6f | [
"MIT"
] | null | null | null | frontend/lib/company/home/setting_view.dart | oi-songer/easyPass | ec27f0a51db831e06178ada383d8509fbc275f6f | [
"MIT"
] | null | null | null | frontend/lib/company/home/setting_view.dart | oi-songer/easyPass | ec27f0a51db831e06178ada383d8509fbc275f6f | [
"MIT"
] | null | null | null | import 'package:easy_pass/utils/components.dart';
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
class CompanySettingView extends StatefulWidget {
const CompanySettingView({Key? key}) : super(key: key);
@override
_CompanySettingViewState createState() => _CompanySettingViewState();
}
class _CompanySettingViewState extends State<CompanySettingView> {
bool useFingerprint = false;
@override
Widget build(BuildContext context) {
return Container(
child: Padding(
padding: new EdgeInsets.all(20),
child: Column(
children: [
Text(
"Username",
style: TextStyle(
fontFamily: "Jiangcheng",
fontSize: 50,
),
),
Divider(),
MaterialButton(
height: 100,
child: Row(
children: [
Text(
"修改企业信息",
style: SettingTextStyle,
),
Expanded(
child: SizedBox(),
),
Icon(Icons.navigate_next),
],
),
onPressed: () {},
),
MaterialButton(
height: 100,
child: Row(
children: [
Text(
"修改密码",
style: SettingTextStyle,
),
Expanded(
child: SizedBox(),
),
Icon(Icons.navigate_next),
],
),
onPressed: () {},
),
MaterialButton(
height: 100,
child: Row(
children: [
Text(
"使用指纹登录",
style: SettingTextStyle,
),
Expanded(
child: SizedBox(),
),
Switch(
value: useFingerprint,
onChanged: (value) {
// TODO
setState(() {
useFingerprint = value;
});
}),
],
),
onPressed: () {},
),
MyAlertButton(
child: Padding(
padding: new EdgeInsets.only(left: 50, right: 50),
child: Text(
"退出登录",
style: TextStyle(color: Colors.white),
),
),
onTap: () {
_logout(context);
},
),
],
),
),
);
}
}
const SettingTextStyle = const TextStyle(
fontSize: 20,
);
void _logout(context) async {
var prefs = await SharedPreferences.getInstance();
prefs.remove('companyToken');
Navigator.of(context).pushNamedAndRemoveUntil('/welcome', (route) => false);
}
| 26.991228 | 78 | 0.408515 |
813c36b7cc8e3039ec2b7b1fa9dab2079ae7ff1d | 17,504 | php | PHP | resources/views/accountmodule/view_expenses.blade.php | vikash3292/ReactProject | b372958ac8efd9c24b52488445376898f3a5e365 | [
"MIT"
] | null | null | null | resources/views/accountmodule/view_expenses.blade.php | vikash3292/ReactProject | b372958ac8efd9c24b52488445376898f3a5e365 | [
"MIT"
] | null | null | null | resources/views/accountmodule/view_expenses.blade.php | vikash3292/ReactProject | b372958ac8efd9c24b52488445376898f3a5e365 | [
"MIT"
] | null | null | null | @extends('layouts.superadmin_layout')
@section('content')
<div class="content p-0">
<div class="container-fluid">
<div class="page-title-box">
<div class="row align-items-center bredcrum-style">
<div class="col-sm-6">
<h4 class="page-title">Expenses View</h4>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="index.html">GRC</a></li>
<li class="breadcrumb-item active"><a href="expenses_view.html.html">Expenses View</a></li>
</ol>
</div>
<div class="col-sm-6 text-right">
<a href="expenses.html" class="btn btn-primary">Back to List</a>
<button class="btn btn-primary"><i class="fa fa-download"></i> Download</button>
</div>
</div>
</div>
<!-- end row -->
<!-- end row -->
<div class="row">
<div class="col-12">
<div class="card m-t-20">
<div class="card-body">
<div class="row">
<div class="col-md-6">
<div class="form-group row m-0">
<label for="empcode" class="col-lg-4 col-form-label">Employee Name
<span class="text-danger"></span>
</label>
<div class="col-lg-8 col-form-label">
<label class="myprofile_label">{{$expense_view->userfullname??''}}</label>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row m-0">
<label for="empcode" class="col-lg-4 col-form-label">Expense Name
<span class="text-danger"></span>
</label>
<div class="col-lg-8 col-form-label">
<label class="myprofile_label">{{$expense_view->expense_name??''}}</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group row m-0">
<label for="empid" class="col-lg-4 col-form-label">Project</label>
<div class="col-lg-8 col-form-label">
<label class="myprofile_label">{{$expense_view->project_name??''}}</label>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row m-0">
<label for="empcode" class="col-lg-4 col-form-label">Category
<span class="text-danger"></span>
</label>
<div class="col-lg-8 col-form-label">
<label class="myprofile_label">{{$expense_view->cat_name??''}}</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group row m-0">
<label for="empid" class="col-lg-4 col-form-label">Expense Date</label>
<div class="col-lg-8 col-form-label">
<label class="myprofile_label">{{$expense_view->expeses_date??''}}</label>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row m-0">
<label for="empid" class="col-lg-4 col-form-label">Reimbursable
<span class="text-danger"></span>
</label>
<div class="col-lg-8 col-form-label">
<label class="myprofile_label">
@if($expense_view->Reimbursable_amt==1)
Yes
@else
No
@endif
</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group row m-0">
<label for="empid" class="col-lg-4 col-form-label">Reimbursable Amount
<span class="text-danger"></span>
</label>
<div class="col-lg-8 col-form-label">
<label class="myprofile_label">{{$expense_view->raimbs_amt??''}}</label>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row m-0">
<label for="empid" class="col-lg-4 col-form-label">Amount
<span class="text-danger">*</span>
</label>
<div class="col-lg-8 col-form-label">
<label class="myprofile_label">{{$expense_view-> expenses_amt??''}}</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group row m-0">
<label for="empid" class="col-lg-4 col-form-label">Select
Advance</label>
<div class="col-lg-8 col-form-label">
<label class="myprofile_label">
@if($expense_view->advanse==1)
No Advance
@else
Advance
@endif</label>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row m-0">
<label for="empid" class="col-lg-4 col-form-label">Add To Trip</label>
<div class="col-lg-8 col-form-label">
<label class="myprofile_label">{{$expense_view-> trip??''}}</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group row m-0">
<label for="empid" class="col-lg-4 col-form-label">Description
</label>
<div class="col-lg-8 col-form-label">
<label class="myprofile_label">{{$expense_view-> desc??''}}</label>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group row m-0">
<label for="empid" class="col-lg-4 col-form-label">Uploaded
Receipt</label>
<div class="col-lg-8 col-form-label">
<label class="myprofile_label">{{$expense_view->upload_reciept??''}}</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group row m-0">
<label for="empid" class="col-lg-4 col-form-label">Status
</label>
<div class="col-lg-8 col-form-label">
<label class="myprofile_label"> @if($expense_view->status==1)
Submited
@else
Reimburse
@endif</label>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<h4 class="p-lr-20">TimeLine</h4>
</div>
</div>
<div id="cd-timeline">
<ul class="timeline list-unstyled">
@foreach($expense_timeline as $k => $expense_timelines)
@if($k%2==0)
@php($class='timeline-list')
@else
@php($class='timeline-list right clearfix')
@endif
<li class="{{$class}}">
<div class="cd-timeline-content bg-light p-10">
<h5 class="mt-0 mb-2">{{ucwords($expense_timelines->userfullname)}}</h5>
<p class="mb-2">{{$expense_timelines->msg}}</p>
<p class="mb-0"></p>
<div class="date bg-primary">
<h5 class="mt-0 mb-0">{{date('d',strtotime($expense_timelines->created_at))}}</h5>
<p class="mb-0 text-white-50">{{date('M',strtotime($expense_timelines->created_at))}}</p>
</div>
</div>
</li>
@endforeach
<!-- <li class="timeline-list right clearfix">
<div class="cd-timeline-content bg-light p-10">
<h5 class="mt-0 mb-2">Himanshu Pawar</h5>
<p>Reimbursable</p>
<button type="button" class="btn btn-primary btn-rounded waves-effect waves-light m-t-5">See more detail</button>
<div class="date bg-primary">
<h5 class="mt-0 mb-0">23</h5>
<p class="mb-0 text-white-50">Jan</p>
</div>
</div>
</li>
<li class="timeline-list">
<div class="cd-timeline-content bg-light p-10">
<h5 class="mt-0 mb-2">Nisha Upreti</h5>
<p>Reimburse</p>
<img src="assets/images/small/img-1.jpg" alt="" class="rounded mr-1" width="120"> <img src="assets/images/small/img-2.jpg" alt="" class="rounded" width="120">
<div class="date bg-primary">
<h5 class="mt-0 mb-0">24</h5>
<p class="mb-0 text-white-50">Jan</p>
</div>
</div>
</li>
<li class="timeline-list right clearfix">
<div class="cd-timeline-content bg-light p-10">
<h5 class="mt-0 mb-2">Timeline Event Four</h5>
<p class="mb-2">It will be as simple as Occidental; in fact, it will be Occidental. To an English person, it will seem like simplified English, as a skeptical Cambridge friend of mine told me what Occidental</p>
<p class="mb-0">languages are members of the same family. Their separate existence is a myth... <a href="#" class="text-primary">Read More</a></p>
<div class="date bg-primary">
<h5 class="mt-0 mb-0">25</h5>
<p class="mb-0 text-white-50">Jan</p>
</div>
</div>
</li> -->
</ul>
</div>
</div>
</div>
</div>
<!-- end col -->
</div>
<!-- end row -->
</div>
<!-- container-fluid -->
</div>
@stop | 69.460317 | 260 | 0.264682 |
496f45a66e506d69131bbc01e1c6459db2147192 | 3,396 | py | Python | aiogram_dialog/widgets/utils.py | bkvalexey/aiogram_dialog | fb4a3a8c151d63f06b04e4b8641549cc7ae45c2c | [
"Apache-2.0"
] | 198 | 2020-06-06T14:24:04.000Z | 2022-03-29T16:01:30.000Z | aiogram_dialog/widgets/utils.py | bkvalexey/aiogram_dialog | fb4a3a8c151d63f06b04e4b8641549cc7ae45c2c | [
"Apache-2.0"
] | 65 | 2020-06-07T19:02:42.000Z | 2022-03-21T18:23:17.000Z | aiogram_dialog/widgets/utils.py | bkvalexey/aiogram_dialog | fb4a3a8c151d63f06b04e4b8641549cc7ae45c2c | [
"Apache-2.0"
] | 48 | 2020-06-13T09:57:58.000Z | 2022-03-11T17:59:21.000Z | from typing import Union, Sequence, Tuple, Callable, Dict, List
from .data.data_context import DataGetter, StaticGetter, CompositeGetter
from .input import MessageHandlerFunc, BaseInput, MessageInput
from .kbd import Keyboard, Group
from .media import Media
from .text import Multi, Format, Text
from .widget_event import WidgetEventProcessor
from ..exceptions import InvalidWidgetType, InvalidWidget
WidgetSrc = Union[str, Text, Keyboard, MessageHandlerFunc, Media, BaseInput]
SingleGetterBase = Union[DataGetter, Dict]
GetterVariant = Union[
None, SingleGetterBase,
List[SingleGetterBase], Tuple[SingleGetterBase, ...],
]
def ensure_text(widget: Union[str, Text, Sequence[Text]]) -> Text:
if isinstance(widget, str):
return Format(widget)
if isinstance(widget, Sequence):
if len(widget) == 1:
return widget[0]
return Multi(*widget)
return widget
def ensure_keyboard(widget: Union[Keyboard, Sequence[Keyboard]]) -> Keyboard:
if isinstance(widget, Sequence):
if len(widget) == 1:
return widget[0]
return Group(*widget)
return widget
def ensure_input(
widget: Union[
MessageHandlerFunc, WidgetEventProcessor, BaseInput,
Sequence[BaseInput]
]
) -> BaseInput:
if isinstance(widget, BaseInput):
return widget
elif isinstance(widget, Sequence):
if len(widget) == 0:
return MessageInput(None)
elif len(widget) == 1:
return widget[0]
else:
raise InvalidWidget(f"Only 1 input supported, got {len(widget)}")
else:
return MessageInput(widget)
def ensure_media(widget: Union[Media, Sequence[Media]]) -> Media:
if isinstance(widget, Media):
return widget
if len(widget) > 1: # TODO case selection of media
raise ValueError("Only one media widget is supported")
if len(widget) == 1:
return widget[0]
return Media()
def ensure_widgets(
widgets: Sequence[WidgetSrc]
) -> Tuple[Text, Keyboard, BaseInput, Media]:
texts = []
keyboards = []
inputs = []
media = []
for w in widgets:
if isinstance(w, (str, Text)):
texts.append(ensure_text(w))
elif isinstance(w, Keyboard):
keyboards.append(ensure_keyboard(w))
elif isinstance(w, (BaseInput, Callable)):
inputs.append(ensure_input(w))
elif isinstance(w, Media):
media.append(ensure_media(w))
else:
raise InvalidWidgetType(
f"Cannot add widget of type {type(w)}. "
f"Only str, Text, Keyboard, BaseInput and Callable are supported"
)
return (
ensure_text(texts),
ensure_keyboard(keyboards),
ensure_input(inputs),
ensure_media(media),
)
def ensure_data_getter(getter: GetterVariant) -> DataGetter:
if isinstance(getter, Callable):
return getter
elif isinstance(getter, dict):
return StaticGetter(getter)
elif isinstance(getter, (list, tuple)):
return CompositeGetter(*map(ensure_data_getter, getter))
elif getter is None:
return StaticGetter({})
else:
raise InvalidWidgetType(
f"Cannot add data getter of type {type(getter)}. "
f"Only Dict, Callable or List of Callables are supported"
)
| 30.594595 | 81 | 0.640459 |
7281c2db226087acd8e154bc2c5f5319e2526972 | 1,562 | cs | C# | dotnet-core-apps/NET_CORE_PROPOGATOR_APP/Controllers/Prop_NodeEntry.cs | kecven/service-discovery-demo-parent | ebb31df5759a9c769d7efa576c89d8a716d28845 | [
"MIT"
] | 8 | 2020-10-29T14:41:45.000Z | 2022-02-14T10:38:26.000Z | dotnet-core-apps/NET_CORE_PROPOGATOR_APP/Controllers/Prop_NodeEntry.cs | CxRustySides/service-discovery-demo-parent | a9f7b0782b336326800a52cef13b38f8f6c3210b | [
"MIT"
] | 1 | 2020-12-13T19:15:01.000Z | 2020-12-13T23:35:27.000Z | dotnet-core-apps/NET_CORE_PROPOGATOR_APP/Controllers/Prop_NodeEntry.cs | CxRustySides/service-discovery-demo-parent | a9f7b0782b336326800a52cef13b38f8f6c3210b | [
"MIT"
] | 43 | 2020-05-19T15:24:47.000Z | 2022-03-02T21:27:05.000Z | using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
namespace NET_CORE_PROPOGATOR_APP.Controllers
{
[Route("Prop/NodeEntry")]
[ApiController]
public class Prop_NodeEntryController : ControllerBase
{
private static bool debugMode = Environment.GetEnvironmentVariable("NET_CORE_MICRO_SERVICES_DEBUG") == "1";
private static readonly HttpClient client = new HttpClient();
private static string NodeEntryPointAddress = Environment.GetEnvironmentVariable("NODEJS_REST_ENTRY_POINT_EXAMPLE_URL");
private static string NodeEntryPointAPI = "/sendToService2?id=";
[HttpGet("{userInput}")]
public void Get(string userInput)
{
Console.WriteLine("Get(string userInput) got: " + userInput);
printCxHeaders();
string userInputAfterPropogator = userInput.Replace("--", "");
client.GetStringAsync(NodeEntryPointAddress + NodeEntryPointAPI + userInputAfterPropogator);
}
private void printCxHeaders()
{
if (debugMode){
var re = Request;
var headers = re.Headers;
string output = "checkmarx.uuid = " + headers["checkmarx.uuid"] + ", checkmarx.sequence = " + headers["checkmarx.sequence"];
Console.WriteLine(output);
Console.WriteLine();
}
}
}
}
| 34.711111 | 140 | 0.647247 |
af2abb7177d912e66aa33f0ad06e5f6aa2422c0b | 1,195 | rs | Rust | src/plot/database.rs | bannatech/MCHPRS | f5963e8145cf96ac4a499296ab206105f36887df | [
"MIT"
] | null | null | null | src/plot/database.rs | bannatech/MCHPRS | f5963e8145cf96ac4a499296ab206105f36887df | [
"MIT"
] | null | null | null | src/plot/database.rs | bannatech/MCHPRS | f5963e8145cf96ac4a499296ab206105f36887df | [
"MIT"
] | null | null | null | use rusqlite::{params, Connection, NO_PARAMS};
use std::sync::{Mutex, MutexGuard};
lazy_static! {
static ref CONN: Mutex<Connection> =
Mutex::new(Connection::open("./world/plots.db").expect("Error opening plot database!"));
}
fn lock<'a>() -> MutexGuard<'a, Connection> {
CONN.lock().unwrap()
}
pub fn get_plot_owner(plot_x: i32, plot_z: i32) -> Option<u128> {
lock()
.query_row(
"SELECT owner FROM plots WHERE plot_x=?1 AND plot_z=?2",
params![plot_x, plot_z],
|row| row.get::<_, String>(0),
)
.ok()
.map(|uuid| uuid.parse().unwrap())
}
pub fn claim_plot(plot_x: i32, plot_z: i32, owner: &str) {
lock()
.execute(
"INSERT INTO plots (plot_x, plot_z, owner) VALUES (?1, ?2, ?3)",
params![plot_x, plot_z, owner],
)
.unwrap();
}
pub fn init() {
let conn = lock();
conn.execute(
"create table if not exists plots (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
plot_x INTEGER NOT NULL,
plot_z int NOT NULL,
owner VARCHAR(40) NOT NULL
)",
NO_PARAMS,
)
.unwrap();
}
| 25.425532 | 96 | 0.550628 |
387fc59c2c265479a3bc6997fcbb31c8cebc97ff | 638 | php | PHP | resources/views/home.blade.php | ITPC-Khmer/itpc-erp | 698bf5c6d5cfeec4116a407c18c3b4c6933b2848 | [
"MIT"
] | null | null | null | resources/views/home.blade.php | ITPC-Khmer/itpc-erp | 698bf5c6d5cfeec4116a407c18c3b4c6933b2848 | [
"MIT"
] | null | null | null | resources/views/home.blade.php | ITPC-Khmer/itpc-erp | 698bf5c6d5cfeec4116a407c18c3b4c6933b2848 | [
"MIT"
] | null | null | null | @extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">{{ _t('Dashboard') }}</div>
<div class="panel-body">
{{ _t('You are logged in!') }}
</div>
</div>
</div>
</div>
</div>
<form action="" method="post" enctype="multipart/form-data">
{!! csrf_field() !!}
<input type="file" name="image_url">
</form>
@endsection
| 24.538462 | 74 | 0.448276 |
ff5bee2eb623ed1e17f5ab6ec1e90a1d1b2ecec1 | 454 | py | Python | core/management/commands/index_titles.py | johnscancella/open-oni | fe6eeee437b8701cf9d54a5f5dc62fc4bbeb3999 | [
"Apache-2.0"
] | null | null | null | core/management/commands/index_titles.py | johnscancella/open-oni | fe6eeee437b8701cf9d54a5f5dc62fc4bbeb3999 | [
"Apache-2.0"
] | null | null | null | core/management/commands/index_titles.py | johnscancella/open-oni | fe6eeee437b8701cf9d54a5f5dc62fc4bbeb3999 | [
"Apache-2.0"
] | null | null | null | import logging
from django.core.management.base import BaseCommand
from core.management.commands import configure_logging
from core.solr_index import index_titles
configure_logging("index_titles_logging.config", "index_titles.log")
_logger = logging.getLogger(__name__)
class Command(BaseCommand):
def handle(self, **options):
_logger.info("indexing titles")
index_titles()
_logger.info("finished indexing titles")
| 23.894737 | 68 | 0.759912 |
bb1eeecf5a1c95400d3b4faadc2ac926705c7a87 | 7,529 | cs | C# | src/BlazorWebFormsComponents/LoginControls/Login.razor.cs | hishamco/BlazorWebFormsComponents | 5d956d5dec96de0f7d2f3c7fb264481b2db9269a | [
"MIT"
] | 9 | 2020-02-24T02:42:27.000Z | 2021-06-25T17:19:49.000Z | src/BlazorWebFormsComponents/LoginControls/Login.razor.cs | hishamco/BlazorWebFormsComponents | 5d956d5dec96de0f7d2f3c7fb264481b2db9269a | [
"MIT"
] | 1 | 2020-02-04T23:33:27.000Z | 2020-02-04T23:33:27.000Z | src/BlazorWebFormsComponents/LoginControls/Login.razor.cs | hishamco/BlazorWebFormsComponents | 5d956d5dec96de0f7d2f3c7fb264481b2db9269a | [
"MIT"
] | 6 | 2020-02-04T17:56:17.000Z | 2020-06-05T16:18:45.000Z | using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using BlazorWebFormsComponents.Enums;
using BlazorWebFormsComponents.Validations;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Authorization;
namespace BlazorWebFormsComponents.LoginControls
{
public partial class Login : BaseWebFormsComponent
{
#region Obsolete Attributes / Properties
/// <summary>
/// 🚨🚨 Use OnAuthenticate event to implement an authentication system 🚨🚨
/// </summary>
[Parameter, Obsolete("MembershipProvider not supported in blazor")]
public string MembershipProvider { get; set; }
#endregion
#region Not implemented yet
//[Parameter] public Orientation Orientation { get; set; }
//[Parameter] public LoginTextLayout TextLayout { get; set; }
//[Parameter] public LoginFailureAction FailureAction { get; set; }
//[Parameter] public ITemplate LayoutTemplate { get; set; }
//[Parameter] public bool RenderOuterTable { get; set; } = true;
#endregion
[Parameter] public string LoginButtonImageUrl { get; set; }
[Parameter] public string LoginButtonText { get; set; } = "Log In";
[Parameter] public ButtonType LoginButtonType { get; set; } = ButtonType.Button;
[Parameter] public string PasswordLabelText { get; set; } = "Password:";
[Parameter] public string PasswordRecoveryText { get; set; }
[Parameter] public string PasswordRecoveryUrl { get; set; }
[Parameter] public string PasswordRecoveryIconUrl { get; set; }
[Parameter] public string PasswordRequiredErrorMessage { get; set; } = "Password is required.";
[Parameter] public bool RememberMeSet { get; set; }
[Parameter] public string RememberMeText { get; set; } = "Remember me next time.";
[Parameter] public string TitleText { get; set; } = "Log In";
[Parameter] public string UserName { get; set; }
[Parameter] public string UserNameLabelText { get; set; } = "User Name:";
[Parameter] public string UserNameRequiredErrorMessage { get; set; } = "User Name is required.";
[Parameter] public bool VisibleWhenLoggedIn { get; set; } = true;
[Parameter] public string FailureText { get; set; } = "Your login attempt was not successful. Please try again.";
[Parameter] public int BorderPadding { get; set; } = 1;
[Parameter] public string CreateUserText { get; set; }
[Parameter] public string CreateUserUrl { get; set; }
[Parameter] public string CreateUserIconUrl { get; set; }
[Parameter] public string DestinationPageUrl { get; set; }
[Parameter] public bool DisplayRememberMe { get; set; } = true;
[Parameter] public string HelpPageText { get; set; }
[Parameter] public string HelpPageUrl { get; set; }
[Parameter] public string HelpPageIconUrl { get; set; }
[Parameter] public string InstructionText { get; set; }
#region Events
[Parameter] public EventCallback<LoginCancelEventArgs> OnLoggingIn { get; set; }
[Parameter] public EventCallback<EventArgs> OnLoginError { get; set; }
[Parameter] public EventCallback<EventArgs> OnLoggedIn { get; set; }
[Parameter] public EventCallback<AuthenticateEventArgs> OnAuthenticate { get; set; }
#endregion
#region Style
[Parameter] public RenderFragment ChildContent { get; set; }
[CascadingParameter(Name = "FailureTextStyle")]
private TableItemStyle FailureTextStyle { get; set; } = new TableItemStyle();
[CascadingParameter(Name = "TitleTextStyle")]
private TableItemStyle TitleTextStyle { get; set; } = new TableItemStyle();
[CascadingParameter(Name = "LabelStyle")]
private TableItemStyle LabelStyle { get; set; } = new TableItemStyle();
[CascadingParameter(Name = "CheckBoxStyle")]
private TableItemStyle CheckBoxStyle { get; set; } = new TableItemStyle();
[CascadingParameter(Name = "HyperLinkStyle")]
private TableItemStyle HyperLinkStyle { get; set; } = new TableItemStyle();
[CascadingParameter(Name = "InstructionTextStyle")]
private TableItemStyle InstructionTextStyle { get; set; } = new TableItemStyle();
[CascadingParameter(Name = "TextBoxStyle")]
private Style TextBoxStyle { get; set; } = new Style();
[CascadingParameter(Name = "LoginButtonStyle")]
private Style LoginButtonStyle { get; set; } = new Style();
[CascadingParameter(Name = "ValidatorTextStyle")]
private Style ValidatorTextStyle { get; set; } = new Style();
#endregion
private bool HasHelp => !string.IsNullOrEmpty(HelpPageText) || !string.IsNullOrEmpty(HelpPageIconUrl);
private bool HasPasswordRevocery => !string.IsNullOrEmpty(PasswordRecoveryText) || !string.IsNullOrEmpty(PasswordRecoveryIconUrl);
private bool HasCreateUser => !string.IsNullOrEmpty(CreateUserText) || !string.IsNullOrEmpty(CreateUserIconUrl);
[Inject]
protected AuthenticationStateProvider AuthenticationStateProvider { get; set; }
[Inject]
protected NavigationManager NavigationManager { get; set; }
private LoginModel Model { get; set; }
private RequiredFieldValidator<string> UsernameValidator { get; set; }
private RequiredFieldValidator<string> PasswordValidator { get; set; }
private bool ShowFailureText { get; set; }
private bool UserAuthenticated { get; set; }
private async Task ValidSubmit()
{
var loginCancelEventArgs = new LoginCancelEventArgs();
await OnLoggingIn.InvokeAsync(loginCancelEventArgs);
if (loginCancelEventArgs.Cancel)
{
Model.Password = string.Empty;
}
else
{
var authenticateEventArgs = new AuthenticateEventArgs();
await OnAuthenticate.InvokeAsync(authenticateEventArgs);
if (authenticateEventArgs.Authenticated)
{
await OnLoggedIn.InvokeAsync(EventArgs.Empty);
if (!string.IsNullOrEmpty(DestinationPageUrl))
{
NavigationManager.NavigateTo(DestinationPageUrl);
}
ShowFailureText = false;
}
else
{
await OnLoginError.InvokeAsync(EventArgs.Empty);
Model.Password = string.Empty;
ShowFailureText = true;
}
}
}
protected override void HandleUnknownAttributes()
{
if (AdditionalAttributes?.Count > 0)
{
FailureTextStyle.FromUnknownAttributes(AdditionalAttributes, "FailureTextStyle-");
TitleTextStyle.FromUnknownAttributes(AdditionalAttributes, "TitleTextStyle-");
LabelStyle.FromUnknownAttributes(AdditionalAttributes, "LabelStyle-");
CheckBoxStyle.FromUnknownAttributes(AdditionalAttributes, "CheckBoxStyle-");
HyperLinkStyle.FromUnknownAttributes(AdditionalAttributes, "HyperLinkStyle-");
InstructionTextStyle.FromUnknownAttributes(AdditionalAttributes, "InstructionTextStyle-");
TextBoxStyle.FromUnknownAttributes(AdditionalAttributes, "TextBoxStyle-");
LoginButtonStyle.FromUnknownAttributes(AdditionalAttributes, "LoginButtonStyle-");
ValidatorTextStyle.FromUnknownAttributes(AdditionalAttributes, "ValidatorTextStyle-");
}
base.HandleUnknownAttributes();
}
protected override async Task OnInitializedAsync()
{
Model = new LoginModel
{
Username = UserName,
RememberMe = RememberMeSet
};
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
UserAuthenticated = authState.User?.Identity?.IsAuthenticated ?? false;
await base.OnInitializedAsync();
}
protected override Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
ValidatorTextStyle.CopyTo(UsernameValidator);
ValidatorTextStyle.CopyTo(PasswordValidator);
}
return base.OnAfterRenderAsync(firstRender);
}
}
}
| 33.02193 | 132 | 0.741267 |
c6781da7996aff02ab899382df4103d3ebad3697 | 2,288 | py | Python | src/foreign_if/python/examples/dt_demo.py | wmeddie/frovedis | c134e5e64114799cc7c265c72525ff98d06b49c1 | [
"BSD-2-Clause"
] | null | null | null | src/foreign_if/python/examples/dt_demo.py | wmeddie/frovedis | c134e5e64114799cc7c265c72525ff98d06b49c1 | [
"BSD-2-Clause"
] | null | null | null | src/foreign_if/python/examples/dt_demo.py | wmeddie/frovedis | c134e5e64114799cc7c265c72525ff98d06b49c1 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
from frovedis.exrpc.server import FrovedisServer
from frovedis.mllib.tree import DecisionTreeClassifier
from frovedis.mllib.tree import DecisionTreeRegressor
import sys
import numpy as np
import pandas as pd
#Objective: Run without error
# initializing the Frovedis server
argvs = sys.argv
argc = len(argvs)
if (argc < 2):
print ('Please give frovedis_server calling command as the first argument \n(e.g. "mpirun -np 2 -x /opt/nec/nosupport/frovedis/ve/bin/frovedis_server")')
quit()
FrovedisServer.initialize(argvs[1])
mat = pd.DataFrame([[10, 0, 1, 0, 0, 1, 0],
[0, 1, 0, 1, 0, 1, 0],
[0, 1, 0, 0, 1, 0, 1],
[1, 0, 0, 1, 0, 1, 0]],dtype=np.float64)
lbl = np.array([0, 1, 1.0, 0],dtype=np.float64)
# fitting input matrix and label on DecisionTree Classifier object
dtc1 = DecisionTreeClassifier(criterion='gini', splitter='best', max_depth=5,
min_samples_split=2, min_samples_leaf=1, min_weight_fraction_leaf=0.0,
max_features=None, random_state=None, max_leaf_nodes=1,
min_impurity_decrease=0.0,
class_weight=None, presort=False, verbose = 0)
dtc = dtc1.fit(mat,lbl)
dtc.debug_print()
# predicting on train model
print("predicting on DecisionTree classifier model: ")
dtcm = dtc.predict(mat)
print (dtcm)
print (dtc.predict_proba(mat))
print("Accuracy score for predicted DecisionTree Classifier model")
print (dtc.score(mat,lbl))
# fitting input matrix and label on DecisionTree Regressor object
dtr1 = DecisionTreeRegressor(criterion='mse', splitter='best',
max_depth=5, min_samples_split=2, min_samples_leaf=1,
min_weight_fraction_leaf=0.0, max_features=None, random_state=None,
max_leaf_nodes=1, min_impurity_decrease=0.0, min_impurity_split=None,
class_weight=None, presort=False, verbose = 0)
lbl1 = np.array([1.2,0.3,1.1,1.9])
dtr = dtr1.fit(mat,lbl1)
dtr.debug_print()
# predicting on train model
print("predicting on DecisionTree Regressor model: ")
dtrm = dtr.predict(mat)
print (dtrm)
print("Root mean square for predicted DecisionTree Regressor model")
print (dtr.score(mat,lbl1))
#clean-up
dtc.release()
dtr.release()
FrovedisServer.shut_down()
| 34.666667 | 157 | 0.696678 |
dbba6552f1dfa2af8524385f2b858d17e6fbaa35 | 474 | php | PHP | resources/views/articles/index.blade.php | codersharif/laravel6 | 99146089821c83ec7495a000d9903da101f985db | [
"MIT"
] | null | null | null | resources/views/articles/index.blade.php | codersharif/laravel6 | 99146089821c83ec7495a000d9903da101f985db | [
"MIT"
] | null | null | null | resources/views/articles/index.blade.php | codersharif/laravel6 | 99146089821c83ec7495a000d9903da101f985db | [
"MIT"
] | null | null | null | @extends('layouts.master')
@section('content')
@forelse($articles as $article)
<div id="content">
<div class="title">
<h2>{{$article->title}}</h2>
<span class="byline"><a href="{{URL::to('article/'.$article->id)}}">{{$article->excerpt}}</a></span>
</div>
<p><img src="{{asset('public/images/banner.jpg')}}" alt="" class="image image-full" /> </p>
<p>{{$article->body}}</p>
</div>
@empty
<p>not yet article</p>
@endforelse
@endsection | 27.882353 | 108 | 0.578059 |
a4252d60c08048c0af905964604e053cf6db7cf3 | 1,515 | php | PHP | www/site/snippets/icons/collectif-bam.php | arnaudjuracek/www-bam | 0f7b3d0174347cf499f4325b70daee10b8f1039b | [
"MIT"
] | null | null | null | www/site/snippets/icons/collectif-bam.php | arnaudjuracek/www-bam | 0f7b3d0174347cf499f4325b70daee10b8f1039b | [
"MIT"
] | 20 | 2017-12-14T15:05:10.000Z | 2018-02-05T16:49:00.000Z | www/site/snippets/icons/philosophie.php | arnaudjuracek/www-bam | 0f7b3d0174347cf499f4325b70daee10b8f1039b | [
"MIT"
] | null | null | null | <svg id="Layer_1" width="150" height="150" viewBox="0 0 150 150">
<path id="XMLID_24_" class="st0" d="M1 1h148v148H1z"/>
<path id="XMLID_23_" class="st0" d="M75 149V1"/>
<path id="XMLID_22_" class="st0" d="M119.4 110.7l-7.4-7.4-7.4 7.4V1h14.8z"/>
<path id="XMLID_21_" class="st0" d="M19.5 30.6h44.4"/>
<path id="XMLID_20_" class="st0" d="M19.5 119.4h44.4"/>
<path id="XMLID_19_" class="st0" d="M19.5 104.6h44.4"/>
<path id="XMLID_18_" class="st0" d="M19.5 89.8h44.4"/>
<path id="XMLID_17_" class="st0" d="M19.5 75h44.4"/>
<path id="XMLID_16_" class="st0" d="M19.5 60.2h44.4"/>
<path id="XMLID_15_" class="st0" d="M19.5 45.4h44.4"/>
<path id="XMLID_14_" class="st0" d="M131.7 30.6h-12.2"/>
<path id="XMLID_13_" class="st0" d="M104.6 30.6H87.3"/>
<path id="XMLID_12_" class="st0" d="M87.3 119.4h44.4"/>
<path id="XMLID_11_" class="st0" d="M113.3 104.6h-2.5"/>
<path id="XMLID_10_" class="st0" d="M131.7 104.6h-12.2"/>
<path id="XMLID_9_" class="st0" d="M104.6 104.6H87.3"/>
<path id="XMLID_8_" class="st0" d="M131.7 89.8h-12.2"/>
<path id="XMLID_7_" class="st0" d="M104.6 89.8H87.3"/>
<path id="XMLID_6_" class="st0" d="M131.7 75h-12.2"/>
<path id="XMLID_5_" class="st0" d="M104.6 75H87.3"/>
<path id="XMLID_4_" class="st0" d="M131.7 60.2h-12.2"/>
<path id="XMLID_3_" class="st0" d="M104.6 60.2H87.3"/>
<path id="XMLID_2_" class="st0" d="M131.7 45.4h-12.2"/>
<path id="XMLID_1_" class="st0" d="M104.6 45.4H87.3"/>
</svg>
| 56.111111 | 80 | 0.59868 |
c3803fde8831a6473239fbd533a188b7cd04eb15 | 2,267 | cs | C# | TaskBarAnalogClock/ViewModels/ArrowViewModel.cs | uieasier/TaskBarAnalogClock | 818d03bfb20c0bb52873b92bf701f3e55c899260 | [
"MIT"
] | 4 | 2019-02-03T02:53:58.000Z | 2021-06-10T03:23:47.000Z | TaskBarAnalogClock/ViewModels/ArrowViewModel.cs | uieasier/TaskBarAnalogClock | 818d03bfb20c0bb52873b92bf701f3e55c899260 | [
"MIT"
] | null | null | null | TaskBarAnalogClock/ViewModels/ArrowViewModel.cs | uieasier/TaskBarAnalogClock | 818d03bfb20c0bb52873b92bf701f3e55c899260 | [
"MIT"
] | 1 | 2019-10-02T16:15:53.000Z | 2019-10-02T16:15:53.000Z | using System;
using System.Windows.Media;
using System.Windows.Threading;
using Cafemoca.TaskBarAnalogClock.Models;
namespace Cafemoca.TaskBarAnalogClock.ViewModels
{
internal class ArrowViewModel : ViewModelBase
{
private readonly DispatcherTimer _timer = new DispatcherTimer();
private ArrowType _arrowType;
public ArrowType ArrowType
{
get => this._arrowType;
set
{
this._arrowType = value;
this.OnPropertyChanged();
}
}
private double _angle;
public double Angle
{
get => this._angle;
set
{
this._angle = value;
this.OnPropertyChanged();
}
}
private int _length;
public int Length
{
get => this._length;
set
{
this._length = value;
this.OnPropertyChanged();
}
}
private double _thickness;
public double Thickness
{
get => this._thickness;
set
{
this._thickness = value;
this.OnPropertyChanged();
}
}
private Brush _color;
public Brush Color
{
get => this._color;
set
{
this._color = value;
this.OnPropertyChanged();
}
}
public ArrowViewModel()
{
this._timer.Interval = TimeSpan.FromSeconds(1);
this._timer.Tick += this.Timer_Tick;
this._timer.Start();
}
private void Timer_Tick(object sender, EventArgs e)
{
var time = DateTime.Now;
switch (this._arrowType)
{
case ArrowType.Hour:
this.Angle = time.Hour * (360 / 12);
return;
case ArrowType.Minute:
this.Angle = time.Minute * (360 / 60);
return;
case ArrowType.Second:
this.Angle = time.Second * (360 / 60);
return;
}
}
}
}
| 24.641304 | 72 | 0.456992 |
eb1bc0e1c5387c13b7a50d1edb8025f0f86e5b03 | 10,164 | lua | Lua | 52-Manhunt/server/manhunt.lua | Hallkezz/KoastFreeroam-2021 | 96f26fb31d71408452333982a38212824d6870b2 | [
"MIT"
] | null | null | null | 52-Manhunt/server/manhunt.lua | Hallkezz/KoastFreeroam-2021 | 96f26fb31d71408452333982a38212824d6870b2 | [
"MIT"
] | null | null | null | 52-Manhunt/server/manhunt.lua | Hallkezz/KoastFreeroam-2021 | 96f26fb31d71408452333982a38212824d6870b2 | [
"MIT"
] | null | null | null | class "ManhuntPlayer"
function ManhuntPlayer:__init( player, Manhunt )
self.Manhunt = Manhunt
self.player = player
self.start_pos = player:GetPosition()
self.start_world = player:GetWorld()
self.inventory = player:GetInventory()
self.color = player:GetColor()
self.oob = false
self.pts = 0
self.dead = false
self.loaded = false
end
function ManhuntPlayer:Enter()
self.player:SetWorld( self.Manhunt.world )
self.player:SetNetworkValue( "GameMode", "Охота" )
self:Spawn()
Network:Send( self.player, "ManhuntEnter" )
end
function ManhuntPlayer:Spawn()
if self.player:GetHealth() <= 0.1 then return end
local spawn = self.Manhunt.spawns[ math.random(1, #self.Manhunt.spawns) ]
self.player:Teleport( spawn, Angle() )
self.player:ClearInventory()
if self.Manhunt.it == self.player then
self.player:SetColor( Color( 255, 170, 0 ) )
self.player:GiveWeapon( 0, Weapon(Weapon.Revolver) )
self.player:GiveWeapon( 1, Weapon(Weapon.SMG) )
self.player:GiveWeapon( 2, Weapon(Weapon.MachineGun) )
else
self.player:GiveWeapon( 0, Weapon(Weapon.Revolver) )
self.player:GiveWeapon( 1, Weapon(Weapon.Sniper) )
self.player:GiveWeapon( 2, Weapon(Weapon.MachineGun) )
self.player:SetColor( Color.White )
end
self.player:SetHealth( 1 )
self.dead = false
end
function ManhuntPlayer:Leave()
self.player:SetWorld( self.start_world )
self.player:Teleport( self.start_pos, Angle() )
self.player:SetHealth( 1 )
self.player:ClearInventory()
self.player:SetNetworkValue( "GameMode", "FREEROAM" )
for k,v in pairs(self.inventory) do
self.player:GiveWeapon( k, v )
end
self.player:SetColor( self.color )
Network:Send( self.player, "ManhuntExit" )
end
class "Manhunt"
function table.find(l, f)
for _, v in ipairs(l) do
if v == f then
return _
end
end
return nil
end
function Manhunt:CreateSpawns()
local dist = self.maxDist - 128
for j=0,8,1 do
for i=0,360,1 do
local x = self.center.x + (math.sin( 2 * i * math.pi/360 ) * dist * math.random())
local y = self.center.y
local z = self.center.z + (math.cos( 2 * i * math.pi/360 ) * dist * math.random())
local radians = math.rad(360 - i)
angle = Angle.AngleAxis(radians , Vector3(0 , -1 , 0))
table.insert(self.spawns, Vector3( x, y, z ))
end
end
end
function Manhunt:UpdateScores()
scores = {}
for k,v in pairs(self.players) do
table.insert(scores, { name=v.player:GetName(), pts=v.pts, it=(self.it == v.player)})
end
table.sort(scores, function(a, b) return a.pts > b.pts end)
for k,v in pairs(self.players) do
Network:Send( v.player, "ManhuntUpdateScores", scores )
end
end
function Manhunt:SetIt( v )
if self.it ~= nil then Network:Send( self.it, "ManhuntUpdateIt", false ) end
self.it = v.player
self.oldIt = v.player
self:MessagePlayers( "За голову " .. self.it:GetName() .. " назначена награда!" )
Network:Send( self.it, "ManhuntUpdateIt", true )
v:Spawn()
self:UpdateScores()
end
function Manhunt:__init( spawn, maxDist )
self.world = World.Create()
self.world:SetTimeStep( 2 )
self.world:SetTime( 0 )
self.spawns = {}
self.center = spawn
self.maxDist = maxDist
self:CreateSpawns()
self.players = {}
self.last_wp = 0
Network:Subscribe( "GoHunt", self, self.ToggleManhunt )
Events:Subscribe( "PlayerChat", self, self.ChatMessage )
Events:Subscribe( "ModuleUnload", self, self.ModuleUnload )
Events:Subscribe( "PlayerJoin", self, self.PlayerJoined )
Events:Subscribe( "PlayerQuit", self, self.PlayerQuit )
Events:Subscribe( "PlayerDeath", self, self.PlayerDeath )
Events:Subscribe( "PlayerSpawn", self, self.PlayerSpawn )
Events:Subscribe( "PostTick", self, self.PostTick )
Events:Subscribe( "JoinGamemode", self, self.JoinGamemode )
local vArgs = {}
vArgs.position = Vector3( -13814.696289063, 357.95449829102, -13214.424804688 )
vArgs.angle = Angle( -2, -0, 0 )
vArgs.enabled = true
vArgs.model_id = 46
vArgs.template = "CombiMG"
local v = Vehicle.Create( vArgs )
v:SetWorld( self.world )
v:SetUnoccupiedRespawnTime( 300 )
v:SetDeathRespawnTime( 30 )
end
function Manhunt:ModuleUnload()
for k,v in pairs(self.players) do
v:Leave()
self:MessagePlayer( v.player, "Вы были перенесены на FREEROAM." )
end
self.players = {}
end
function Manhunt:PostTick()
for k,v in pairs(self.players) do
local randIt = math.random() < 1 / table.count(self.players)
if self.it then
elseif (randIt and self.oldIt and self.oldIt ~= player) or #self.players > 1 then
self:SetIt( v )
end
local dist = Vector3.Distance(v.player:GetPosition(), self.center)
if v.loaded then
if v.oob and dist < self.maxDist - 32 then
Network:Send( v.player, "ManhuntExitBorder" )
v.oob = false
end
if not v.oob and dist > self.maxDist - 32 then
Network:Send( v.player, "ManhuntEnterBorder" )
v.oob = true
end
if not v.dead and dist > self.maxDist then
v.player:SetHealth(0)
v.dead = true
v.loaded = false
self:MessagePlayer ( v.player, "Вы покинули игровое поле!" )
end
else
if Vector3.Distance(v.player:GetPosition(), self.center) < self.maxDist then v.loaded = true end
end
end
end
function Manhunt:IsInManhunt( player )
return self.players[player:GetId()] ~= nil
end
function Manhunt:MessagePlayer( player, message )
player:SendChatMessage( "[Охота] ", Color.White, message, Color( 228, 142, 56 ) )
end
function Manhunt:MessagePlayers( message )
for k,v in pairs(self.players) do
self:MessagePlayer(v.player, message)
end
end
function Manhunt:ToggleManhunt( args, sender )
if ( not self:IsInManhunt(sender) ) then
self:EnterManhunt( args, sender )
else
self:LeaveManhunt( args, sender )
end
end
function Manhunt:EnterManhunt( args, sender )
if sender:GetWorld() ~= DefaultWorld then
self:MessagePlayer( sender, "Перед присоединением вы должны выйти из всех других игровых режимов." )
return
end
local args = {}
args.name = "Manhunt"
args.player = sender
Events:Fire( "JoinGamemode", args )
local p = ManhuntPlayer(sender, self)
p:Enter()
self:MessagePlayer( sender, "Вы вошли на Охоту. Приятной игры :)" )
self:MessagePlayer( sender, "Ваша задача выживать и убивать остальных игроков." )
if self.oldIt and self.it then
self:MessagePlayer( sender, "За голову " .. self.it:GetName() .. " сейчас назначена награда!" )
else
self:SetIt( p )
end
self.players[sender:GetId()] = p
Network:Send( sender, "ManhuntUpdateIt", self.it == sender )
self:UpdateScores()
end
function Manhunt:LeaveManhunt( args, sender )
local p = self.players[sender:GetId()]
if p == nil then return end
p:Leave()
self:MessagePlayer( sender, "Вы покинули Охоту. Возвращайтесь ещё :)" )
self.players[sender:GetId()] = nil
if self.it == sender then self.it = nil end
self:UpdateScores()
end
function Manhunt:ChatMessage( args )
local msg = args.text
local player = args.player
if ( msg:sub(1, 1) ~= "/" ) then
return true
end
local cmdargs = {}
for word in string.gmatch(msg, "[^%s]+") do
table.insert(cmdargs, word)
end
if (cmdargs[1] == "/pos" ) or (cmdargs[1] == "/coords" ) then
local pos = player:GetPosition()
Chat:Send(player, "Ваши координаты: ", Color.White, pos.x..", "..pos.y..", "..pos.z, Color.DarkGray)
print( "Coordinates: ("..pos.x..", "..pos.y..", "..pos.z..")" )
print( "Angle: (", player:GetAngle(), ")" )
end
return false
end
function Manhunt:PlayerJoined( args )
self.players[args.player:GetId()] = nil
if self.it == args.player then self.it = nil end
self:UpdateScores()
end
function Manhunt:PlayerQuit( args )
self.players[args.player:GetId()] = nil
if self.it == args.player then self.it = nil end
self:UpdateScores()
end
function Manhunt:PlayerDeath( args )
if ( not self:IsInManhunt(args.player) ) then
return true
end
if self.it == args.player then
if args.killer then
args.killer:SetColor( Color( 255, 170, 0 ) )
self.it = args.killer
self.oldIt = args.killer
self.players[self.it:GetId()].pts = self.players[self.it:GetId()].pts + 3
Network:Send( self.it, "ManhuntUpdatePoints", self.players[self.it:GetId()].pts )
self:MessagePlayers( args.killer:GetName().." убил "..args.player:GetName().." и теперь за его голову назначена награда!" )
args.killer:SetMoney( args.killer:GetMoney() + 60 )
else
self.it = nil
if args.reason == DamageEntity.None then
self:MessagePlayers( args.player:GetName().." погиб!" )
elseif args.reason == DamageEntity.Physics then
self:MessagePlayers( args.player:GetName().." был раздавлен!" )
elseif args.reason == DamageEntity.Bullet then
self:MessagePlayers( args.player:GetName().." помер!")
elseif args.reason == DamageEntity.Explosion then
self:MessagePlayers( args.player:GetName().." умер!" )
elseif args.reason == DamageEntity.Vehicle then
self:MessagePlayers( args.player:GetName().." был сбит!" )
end
end
self:UpdateScores()
elseif args.killer and args.killer:GetSteamId() ~= args.player:GetSteamId() then
self.players[args.killer:GetId()].pts = self.players[args.killer:GetId()].pts + 1
Network:Send( args.killer, "ManhuntUpdatePoints", self.players[args.killer:GetId()].pts )
self:UpdateScores()
args.player:SetColor( Color.White )
args.killer:SetMoney( args.killer:GetMoney() + 30 )
end
if args.killer then
if args.killer:GetValue( "HuntKills" ) then
args.killer:SetNetworkValue( "HuntKills", args.killer:GetValue( "HuntKills" ) + 1 )
end
end
end
function Manhunt:PlayerSpawn( args )
if ( not self:IsInManhunt(args.player) ) then
return true
end
self:MessagePlayer( args.player, "Вы появились на Охоте. Нажмите ~, чтобы выйти." )
self.players[args.player:GetId()]:Spawn()
return false
end
function Manhunt:JoinGamemode( args )
if args.name ~= "Manhunt" then
self:LeaveManhunt( args.player )
end
end
Manhunt = Manhunt( Vector3(-13790, 1200, -13625), 2048 ) | 29.982301 | 127 | 0.678375 |
a47175ed079aa546da6b7df9bada63e64d10fa22 | 2,174 | php | PHP | app/Views/admin/dashboard_view.php | bimaalsandi19/test-pt-big | 28b3bd3cffadd6c2a5d48dedf3c3f111d41c372f | [
"MIT"
] | null | null | null | app/Views/admin/dashboard_view.php | bimaalsandi19/test-pt-big | 28b3bd3cffadd6c2a5d48dedf3c3f111d41c372f | [
"MIT"
] | null | null | null | app/Views/admin/dashboard_view.php | bimaalsandi19/test-pt-big | 28b3bd3cffadd6c2a5d48dedf3c3f111d41c372f | [
"MIT"
] | null | null | null | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/assets/bootstrap/css/bootstrap.min.css">
<title>Halaman Admin</title>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-md-3">
<p><b>Selamat Datang <?= $_SESSION['email']; ?></b></p>
<a href="/dashboard/menu">[+]Create New Menu</a><br>
<a href="/dashboard/submenu">[+]Create New Sub Menu</a>
<?php foreach ($submenu as $row) : ?>
<ul class="nav flex-column">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<?= $row['nama_menu']; ?>
</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" href="#"><?= $row['nama_submenu']; ?></a></li>
</ul>
</li>
</ul>
<?php endforeach ?>
<a href="/login/logout">Logout</a>
<!-- <ul class="nav flex-column">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">Active</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item">
<a class="nav-link disabled">Disabled</a>
</li>
</ul> -->
</div>
</div>
</div>
<script src="/assets/bootstrap/js/bootstrap.bundle.js"></script>
</body>
</html> | 38.821429 | 155 | 0.431463 |
3f204ab737a8571c06299546d309c207894614c7 | 2,466 | php | PHP | resources/views/catalogo/tumbas/sidebar.blade.php | rodnune/Pintia | 3b2d7634cbac8fb8bd50fa68717fa1ab6e57c53a | [
"MIT"
] | null | null | null | resources/views/catalogo/tumbas/sidebar.blade.php | rodnune/Pintia | 3b2d7634cbac8fb8bd50fa68717fa1ab6e57c53a | [
"MIT"
] | null | null | null | resources/views/catalogo/tumbas/sidebar.blade.php | rodnune/Pintia | 3b2d7634cbac8fb8bd50fa68717fa1ab6e57c53a | [
"MIT"
] | null | null | null | <div id="sidebar" style="float:left; margin:20px 35px 0 0;">
<a class="post" style="padding-right: 10px; padding-left: 0px;">
@php
$id = $tumba->IdTumba
@endphp
<h4 class="text-center" style="color: #000;">Secciones</h4>
<p>
</p>
<button onclick="window.location.href='/tumba/{{$id}}/datos_generales'" class="btn btn-default btn-block">Datos Generales</button>
<button onclick="window.location.href='/tumba/{{$id}}/tipos'" class="btn btn-default btn-block">Tipos de tumba</button>
<button onclick="window.location.href='/tumba/{{$id}}/cremaciones'" class="btn btn-default btn-block">Cremaciones</button>
<button onclick="window.location.href='/tumba/{{$id}}/inhumaciones'" class="btn btn-default btn-block">Inhumaciones</button>
<button onclick="window.location.href='/tumba/{{$id}}/localizacion'" class="btn btn-default btn-block">Localizacion</button>
<button onclick="window.location.href='/tumba/{{$id}}/ofrendas'" class="btn btn-default btn-block">Ofrendas fauna</button>
<button onclick="window.location.href='/tumba/{{$id}}/multimedias'" class="btn btn-default btn-block">Multimedia</button>
<button onclick="window.location.href='/tumba/{{$id}}/pendientes'" class="btn btn-default btn-block">Campos pendientes</button>
<br>
<div style="text-align:center">
<a href="/tumbas" class="btn btn-primary btn-block"><i class="fa fa-arrow-left"></i> Lista Tumbas / Salir</a>
</div>
<br>
<div style="text-align:center">
{{Form::open(array('action' => 'TumbasController@delete','method' => 'post'))}}
<input type="hidden" name="tumba" value="{{$id}}">
<button type="submit" name="subsec" class="btn btn-danger btn-block" value="Eliminar Tumba"><i class="fa fa-close"></i> Eliminar Tumba</button>
{{Form::close()}}
</div>
<br>
@if(($tumba->registro()!= null) && (Session::get('admin_level') > 2 ))
{{Form::open(array('action' => 'RegistrosController@validar','method' => 'post'))}}
<input type="hidden" name="num_control" value="{{$tumba->registro()->NumControl}}">
<button type="submit" name="submit" class="btn btn-success btn-block"><i class="fa fa-check"></i> Validar</button>
{{Form::close()}}
@endif
<br/><br/>
</p>
</div>
</div> | 54.8 | 151 | 0.601784 |
dbe1001f3d1737f5fdda63e0caa8d32581c1d188 | 598 | php | PHP | resources/views/layouts/app.blade.php | quangnd090592/haiquan | 13f73988f8475063adbeb16dbbdd2c9a4bb6f8d4 | [
"MIT"
] | null | null | null | resources/views/layouts/app.blade.php | quangnd090592/haiquan | 13f73988f8475063adbeb16dbbdd2c9a4bb6f8d4 | [
"MIT"
] | null | null | null | resources/views/layouts/app.blade.php | quangnd090592/haiquan | 13f73988f8475063adbeb16dbbdd2c9a4bb6f8d4 | [
"MIT"
] | null | null | null | <!DOCTYPE html>
<html lang="en" ng-app="haiquan">
@include('shared.head')
<body class="nav-md">
<div class="container body">
<div class="main_container">
@include('shared.sidebar')
@include('shared.topnav')
<!-- page content -->
<div class="right_col" role="main">
@yield('content')
</div>
<!-- /page content -->
@include('shared.footer')
</div>
</div>
@include('shared.scripts')
</body>
</html> | 31.473684 | 51 | 0.436455 |
af8dd63cac15caac5cf39739e40631d8dee750ab | 3,394 | py | Python | src/jflow/green.py | diseaz-joom/dsaflow | 3d5cc8caa5ff0b0db3b7590cd27d9421ade88f6c | [
"MIT"
] | null | null | null | src/jflow/green.py | diseaz-joom/dsaflow | 3d5cc8caa5ff0b0db3b7590cd27d9421ade88f6c | [
"MIT"
] | 6 | 2022-03-25T13:24:04.000Z | 2022-03-29T13:24:36.000Z | src/jflow/green.py | diseaz-joom/dsaflow | 3d5cc8caa5ff0b0db3b7590cd27d9421ade88f6c | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- mode: python; coding: utf-8 -*-
"""Update green-develop."""
import contextlib
import json
import logging
import pathlib
import pprint
import re
import sys
import urllib.parse as up
import requests
from dsapy import app
from jflow import config
from jflow import git
from jflow import run
_logger = logging.getLogger(__name__)
class Error(Exception):
'''Base class for errors in the module.'''
JENKINS_PREFIX = 'https://api-jenkins.joomdev.net/job/api/job/api-tests/job/'
JENKINS_API_SUFFIX = 'api/json/'
GREEN_DEVELOP="tested/develop"
GREEN_DEVELOP_UPSTREAM="origin/tested/develop"
def jenkins_api_url(u):
return up.urljoin(u, JENKINS_API_SUFFIX)
def jenkins_quote(bn):
bn = up.quote(bn, safe='')
return up.quote(bn, safe='')
def jenkins_branch_url(branch, api=False):
r = '{}{}/'.format(
JENKINS_PREFIX,
jenkins_quote(branch),
)
if api:
r = jenkins_api_url(r)
return r
class Mixin(git.Git, run.Cmd):
@classmethod
def add_arguments(cls, parser):
super().add_arguments(parser)
parser.add_argument(
'--jenkins-auth',
default='~/.secret/jenkins.cred',
help='Path to a file with Jenkins credentials in the form USER:PASSWORD',
)
def jenkins_auth(self):
user, password = pathlib.Path(self.flags.jenkins_auth).expanduser().read_text().strip().split(':')
return (user, password)
@contextlib.contextmanager
def jenkins_session(self):
with requests.Session() as ses:
ses.auth = self.jenkins_auth()
yield ses
def green(self):
with self.jenkins_session() as ses:
branch_status_r = ses.get(jenkins_branch_url('develop', True))
branch_status_r.raise_for_status()
branch_status = branch_status_r.json()
for n in ('lastCompletedBuild', 'lastSuccessfulBuild', 'lastStableBuild'): # , 'lastBuild', 'lastFailedBuild', 'lastUnstableBuild', 'lastUnsuccessfulBuild'):
_logger.info('%s: %r -> %r', n, branch_status[n]['number'], branch_status[n]['url'])
last_successful_build_url = jenkins_api_url(branch_status['lastSuccessfulBuild']['url'])
last_successful_build_r = ses.get(last_successful_build_url)
last_successful_build_r.raise_for_status()
last_successful_build = last_successful_build_r.json()
last_success_action = None
for action in last_successful_build['actions']:
builds = action.get('buildsByBranchName')
if not builds:
continue
develop_build = builds.get('develop')
if not develop_build:
continue
last_success_action = develop_build
break
if not last_success_action:
raise Error('Last successful build not found')
last_success_sha = last_success_action['revision']['SHA1']
_logger.info('lastSuccessfulBuildSHA = %r', last_success_sha)
self.cmd_action(['git', 'branch', '--no-track', '--force', 'tested/develop', last_success_sha])
self.cmd_action([
'git', 'branch',
'--set-upstream-to={}'.format(GREEN_DEVELOP_UPSTREAM),
GREEN_DEVELOP,
])
| 29.008547 | 170 | 0.627873 |
ca73b6d8896c24a39f6b46ed002c56c1af1a4491 | 425 | sql | SQL | sqlapp-core-oracle/src/main/resources/com/sqlapp/data/db/dialect/oracle/metadata/indexPartitions.sql | satotatsu/sqlapp | 2df2e0331b02c41afa1f588b6a43edcd81404cd3 | [
"MIT"
] | 1 | 2018-05-04T00:14:54.000Z | 2018-05-04T00:14:54.000Z | sqlapp-core-oracle/src/main/resources/com/sqlapp/data/db/dialect/oracle/metadata/indexPartitions.sql | satotatsu/sqlapp | 2df2e0331b02c41afa1f588b6a43edcd81404cd3 | [
"MIT"
] | null | null | null | sqlapp-core-oracle/src/main/resources/com/sqlapp/data/db/dialect/oracle/metadata/indexPartitions.sql | satotatsu/sqlapp | 2df2e0331b02c41afa1f588b6a43edcd81404cd3 | [
"MIT"
] | 1 | 2018-05-04T00:14:33.000Z | 2018-05-04T00:14:33.000Z | SELECT PI.*
, IP.*
FROM ALL_PART_INDEXES PI
INNER JOIN ALL_IND_PARTITIONS IP
ON (PI.OWNER=IP.INDEX_OWNER
-- AND PI.TABLE_NAME=IP.INDEX_NAME
AND PI.INDEX_NAME=IP.INDEX_NAME
)
WHERE 1=1
/*if isNotEmpty(schemaName)*/
AND PI.OWNER IN /*schemaName*/('%')
/*end*/
/*if isNotEmpty(indexName)*/
AND PI.INDEX_NAME IN /*indexName*/('%')
/*end*/
ORDER BY PI.OWNER, PI.TABLE_NAME, PI.INDEX_NAME, IP.PARTITION_POSITION | 26.5625 | 70 | 0.703529 |
0959acbe1fe824d6eab95089a11e9808e4412807 | 548 | cc | C++ | device/bluetooth/floss/fake_floss_manager_client.cc | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 76 | 2020-09-02T03:05:41.000Z | 2022-03-30T04:40:55.000Z | device/bluetooth/floss/fake_floss_manager_client.cc | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 45 | 2020-09-02T03:21:37.000Z | 2022-03-31T22:19:45.000Z | device/bluetooth/floss/fake_floss_manager_client.cc | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 8 | 2020-07-22T18:49:18.000Z | 2022-02-08T10:27:16.000Z | // Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "device/bluetooth/floss/fake_floss_manager_client.h"
#include "base/logging.h"
namespace floss {
FakeFlossManagerClient::FakeFlossManagerClient() = default;
FakeFlossManagerClient::~FakeFlossManagerClient() = default;
void FakeFlossManagerClient::SetAdapterPowered(int adapter, bool powered) {
adapter_to_powered_.emplace(adapter, powered);
}
} // namespace floss
| 27.4 | 75 | 0.786496 |
618e9e60a239510fbb161ac224c457632ca282ce | 142 | lua | Lua | yatm_mesecon_card_readers/nodes.lua | IceDragon200/mt-yatm | 7452f2905e1f4121dc9d244d18a23e76b11ebe5d | [
"Apache-2.0"
] | 3 | 2019-03-15T03:17:36.000Z | 2020-02-19T19:50:49.000Z | yatm_mesecon_card_readers/nodes.lua | IceDragon200/mt-yatm | 7452f2905e1f4121dc9d244d18a23e76b11ebe5d | [
"Apache-2.0"
] | 24 | 2019-12-02T06:01:04.000Z | 2021-04-08T04:09:27.000Z | yatm_mesecon_card_readers/nodes.lua | IceDragon200/mt-yatm | 7452f2905e1f4121dc9d244d18a23e76b11ebe5d | [
"Apache-2.0"
] | null | null | null | dofile(yatm_mesecon_card_readers.modpath .. "/nodes/card_readers.lua")
dofile(yatm_mesecon_card_readers.modpath .. "/nodes/card_swipers.lua")
| 47.333333 | 70 | 0.816901 |
a191aa76cc10bb6e2dc15638b9b3bf496a8facb1 | 286 | ts | TypeScript | src/app/shared/states/pokemon/pokemon.adapter.ts | sunsreng/ngrx-pokedex | ef1b49084deed53a1649ec270c341127b974228c | [
"MIT"
] | null | null | null | src/app/shared/states/pokemon/pokemon.adapter.ts | sunsreng/ngrx-pokedex | ef1b49084deed53a1649ec270c341127b974228c | [
"MIT"
] | 9 | 2020-07-18T02:11:13.000Z | 2022-02-26T16:56:36.000Z | src/app/shared/states/pokemon/pokemon.adapter.ts | sunsreng/ngrx-pokedex | ef1b49084deed53a1649ec270c341127b974228c | [
"MIT"
] | null | null | null | import { EntityState } from '@ngrx/entity';
import { Pokemon } from '@shared/interfaces/pokemon.interface';
import { createEntityAdapter } from '@ngrx/entity';
export const pokemonAdapter = createEntityAdapter<Pokemon>();
export interface PokemonState extends EntityState<Pokemon> {}
| 35.75 | 63 | 0.776224 |
14ec413843adc53e6816a9d6607135f8e98ff11b | 810 | hpp | C++ | gridworld/headers/Environment.hpp | LARG/regression-importance-sampling | 8cf2acf9313ab270c192fda29e1d5c1db68c2acc | [
"MIT"
] | 8 | 2019-06-06T17:56:08.000Z | 2021-11-27T05:42:40.000Z | gridworld/headers/Environment.hpp | LARG/regression-importance-sampling | 8cf2acf9313ab270c192fda29e1d5c1db68c2acc | [
"MIT"
] | 1 | 2020-12-21T16:08:01.000Z | 2021-01-04T13:53:48.000Z | gridworld/headers/Environment.hpp | LARG/regression-importance-sampling | 8cf2acf9313ab270c192fda29e1d5c1db68c2acc | [
"MIT"
] | 6 | 2019-06-14T00:18:31.000Z | 2022-02-05T21:50:27.000Z | #ifndef _ENVIRONMENT_HPP_
#define _ENVIRONMENT_HPP_
#include <Includes.hpp>
#include "Policy.h"
#include "Trajectory.h"
#include "Model.hpp"
class Environment {
public:
virtual int getNumActions() const = 0;
virtual int getNumStates() const = 0;
virtual int getMaxTrajLen() const = 0;
virtual void generateTrajectories(vector<Trajectory> & buff, const Policy & pi, int numTraj, mt19937_64 & generator) = 0;
virtual double evaluatePolicy(const Policy & pi, mt19937_64 & generator) = 0;
virtual Policy getPolicy(int index) = 0;
virtual int getNumEvalTrajectories() = 0;
virtual double getMinReturn() = 0;
virtual double getMaxReturn() = 0;
virtual Model getTrueModel() = 0;
virtual double getTrueValue(int policy_number) = 0;
virtual double getTrueValue(const Policy & pi) = 0;
};
#endif
| 31.153846 | 122 | 0.740741 |
b74e589a9ca353c60544a57c4d8dda86a97cf017 | 6,136 | cc | C++ | cyber/class_loader/class_loader_test.cc | efc-robot/cyberRT | c0e63539cf97030c64545d87c203d4e457d481ca | [
"Apache-2.0"
] | 41 | 2020-12-07T07:32:02.000Z | 2022-01-18T09:14:59.000Z | cyber/class_loader/class_loader_test.cc | efc-robot/cyberRT | c0e63539cf97030c64545d87c203d4e457d481ca | [
"Apache-2.0"
] | 4 | 2021-01-05T02:53:46.000Z | 2021-11-05T08:35:46.000Z | cyber/class_loader/class_loader_test.cc | efc-robot/cyberRT | c0e63539cf97030c64545d87c203d4e457d481ca | [
"Apache-2.0"
] | 28 | 2020-12-06T08:01:38.000Z | 2022-03-10T08:14:01.000Z | /******************************************************************************
* Copyright 2018 The Apollo Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*****************************************************************************/
#include "cyber/class_loader/class_loader.h"
#include <iostream>
#include <string>
#include <thread>
#include <vector>
#include "gtest/gtest.h"
#include "cyber/class_loader/class_loader_manager.h"
#include "cyber/class_loader/test/base.h"
#include "cyber/cyber.h"
const char LIBRARY_1[] = "cyber/class_loader/test/libplugin1.so";
const char LIBRARY_2[] = "cyber/class_loader/test/libplugin2.so";
using apollo::cyber::class_loader::ClassLoader;
using apollo::cyber::class_loader::ClassLoaderManager;
using apollo::cyber::class_loader::utility::IsLibraryLoaded;
TEST(ClassLoaderTest, createClassObj) {
ClassLoader loader1(LIBRARY_1);
EXPECT_EQ(LIBRARY_1, loader1.GetLibraryPath());
auto rect_obj = loader1.CreateClassObj<Base>("Rect");
EXPECT_NE(nullptr, rect_obj);
rect_obj->DoSomething();
EXPECT_EQ(nullptr, loader1.CreateClassObj<Base>("Xeee"));
SUCCEED();
}
TEST(ClassLoaderTest, loadLibCounts) {
ClassLoader loader1(LIBRARY_1);
ASSERT_TRUE(loader1.IsLibraryLoaded());
loader1.LoadLibrary();
loader1.LoadLibrary();
ASSERT_TRUE(loader1.IsLibraryLoaded());
loader1.UnloadLibrary();
ASSERT_TRUE(loader1.IsLibraryLoaded());
loader1.UnloadLibrary();
ASSERT_TRUE(loader1.IsLibraryLoaded());
loader1.UnloadLibrary();
ASSERT_FALSE(loader1.IsLibraryLoaded());
loader1.UnloadLibrary();
ASSERT_FALSE(loader1.IsLibraryLoaded());
loader1.LoadLibrary();
ASSERT_TRUE(loader1.IsLibraryLoaded());
SUCCEED();
}
TEST(ClassLoaderTest, multiTimesLoadunload) {
ClassLoader loader1(LIBRARY_1);
ASSERT_TRUE(loader1.LoadLibrary());
loader1.LoadLibrary();
ASSERT_TRUE(IsLibraryLoaded(LIBRARY_1));
loader1.UnloadLibrary();
ASSERT_TRUE(IsLibraryLoaded(LIBRARY_1));
loader1.UnloadLibrary();
ASSERT_TRUE(IsLibraryLoaded(LIBRARY_1));
loader1.UnloadLibrary();
ASSERT_FALSE(IsLibraryLoaded(LIBRARY_1));
}
TEST(ClassLoaderManagerTest, testClassLoaderManager) {
ClassLoaderManager loader_mgr;
ASSERT_TRUE(loader_mgr.LoadLibrary(LIBRARY_1));
ASSERT_TRUE(loader_mgr.LoadLibrary(LIBRARY_2));
for (int i = 0; i < 2; ++i) {
loader_mgr.CreateClassObj<Base>("Rect")->DoSomething();
loader_mgr.CreateClassObj<Base>("Circle")->DoSomething();
loader_mgr.CreateClassObj<Base>("Apple")->DoSomething();
}
auto pear_obj = loader_mgr.CreateClassObj<Base>("Pear", LIBRARY_2);
EXPECT_NE(nullptr, pear_obj);
pear_obj->DoSomething();
auto null_obj = loader_mgr.CreateClassObj<Base>("Pear", LIBRARY_1);
EXPECT_EQ(nullptr, null_obj);
auto null_obj1 = loader_mgr.CreateClassObj<Base>("ClassNull", "libNull.so");
EXPECT_EQ(nullptr, null_obj1);
EXPECT_TRUE(loader_mgr.IsClassValid<Base>("Rect"));
EXPECT_TRUE(loader_mgr.IsClassValid<Base>("Circle"));
EXPECT_TRUE(loader_mgr.IsClassValid<Base>("Triangle"));
EXPECT_TRUE(loader_mgr.IsClassValid<Base>("Star"));
EXPECT_TRUE(loader_mgr.IsClassValid<Base>("Apple"));
EXPECT_TRUE(loader_mgr.IsClassValid<Base>("Pear"));
EXPECT_TRUE(loader_mgr.IsClassValid<Base>("Banana"));
EXPECT_TRUE(loader_mgr.IsClassValid<Base>("Peach"));
EXPECT_FALSE(loader_mgr.IsClassValid<Base>("Hamburger"));
EXPECT_FALSE(loader_mgr.IsClassValid<Base>("Cake"));
EXPECT_TRUE(loader_mgr.LoadLibrary(LIBRARY_1));
SUCCEED();
}
void CreateObj(ClassLoaderManager* loader) {
std::vector<std::string> classes = loader->GetValidClassNames<Base>();
for (unsigned int i = 0; i < classes.size(); i++) {
loader->CreateClassObj<Base>(classes[i])->DoSomething();
}
}
TEST(ClassLoaderTest, createObjThreadSafety) {
ClassLoaderManager loader_mgr;
ASSERT_TRUE(loader_mgr.LoadLibrary(LIBRARY_1));
ASSERT_TRUE(loader_mgr.IsLibraryValid(LIBRARY_1));
std::vector<std::thread*> client_threads;
for (unsigned int i = 0; i < 100; i++) {
client_threads.emplace_back(
new std::thread(std::bind(&CreateObj, &loader_mgr)));
}
for (unsigned int i = 0; i < client_threads.size(); i++) {
client_threads[i]->join();
}
for (unsigned int i = 0; i < client_threads.size(); i++) {
delete (client_threads[i]);
}
}
void LoadLib(ClassLoaderManager* loaderMgr) {
loaderMgr->LoadLibrary(LIBRARY_1);
ASSERT_TRUE(loaderMgr->IsLibraryValid(LIBRARY_1));
}
TEST(ClassLoaderTest, loadLibThreadSafety) {
ClassLoaderManager loaderMgr;
std::vector<std::thread*> client_threads;
for (unsigned int i = 0; i < 100; i++) {
client_threads.emplace_back(
new std::thread(std::bind(&LoadLib, &loaderMgr)));
}
for (unsigned int i = 0; i < client_threads.size(); i++) {
client_threads[i]->join();
}
ASSERT_TRUE(loaderMgr.IsLibraryValid(LIBRARY_1));
for (unsigned int i = 0; i < client_threads.size(); i++) {
delete (client_threads[i]);
}
loaderMgr.UnloadAllLibraries();
ASSERT_FALSE(loaderMgr.IsLibraryValid(LIBRARY_1));
}
class InvalidBaseClass {};
TEST(ClassLoaderTest, util_test) {
ClassLoader loader1(LIBRARY_1);
apollo::cyber::class_loader::utility::LoadLibrary("1", &loader1);
apollo::cyber::class_loader::utility::UnloadLibrary("1", nullptr);
apollo::cyber::class_loader::utility::IsLibraryLoaded(LIBRARY_1);
apollo::cyber::class_loader::utility::IsLibraryLoaded(LIBRARY_2);
}
int main(int argc, char** argv) {
apollo::cyber::Init(argv[0]);
testing::InitGoogleTest(&argc, argv);
const int output = RUN_ALL_TESTS();
google::protobuf::ShutdownProtobufLibrary();
return output;
}
| 32.125654 | 79 | 0.718546 |
4b978a1ff39635a620417cd5866024fc1900aea0 | 2,563 | cc | C++ | metrics/src/Meter.cc | benjamin-bader/cppmetrics | a5ab3295ad3a9774522f3bffa67732a0048a140e | [
"Apache-2.0"
] | 7 | 2018-07-09T20:41:10.000Z | 2022-01-04T07:41:11.000Z | metrics/src/Meter.cc | benjamin-bader/cppmetrics | a5ab3295ad3a9774522f3bffa67732a0048a140e | [
"Apache-2.0"
] | 6 | 2018-07-09T20:54:51.000Z | 2022-01-11T17:50:37.000Z | metrics/src/Meter.cc | benjamin-bader/cppmetrics | a5ab3295ad3a9774522f3bffa67732a0048a140e | [
"Apache-2.0"
] | 2 | 2018-07-09T20:22:16.000Z | 2019-02-07T20:44:56.000Z | // Copyright 2018 Benjamin Bader
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <metrics/Meter.h>
#include <metrics/Clock.h>
#include <metrics/EWMA.h>
namespace cppmetrics {
namespace {
using namespace std::chrono;
using namespace std::chrono_literals;
const long long kTickInterval = duration_cast<nanoseconds>(5s).count();
}
Meter::Meter(Clock* clock)
: m_clock(clock != nullptr ? clock : GetDefaultClock())
, m_count(0)
, m_start_time(m_clock->tick())
, m_last_tick(m_start_time.count())
, m_m1( EWMA::one_minute() )
, m_m5( EWMA::five_minutes() )
, m_m15( EWMA::fifteen_minutes() )
{}
void Meter::mark(long n)
{
tick_if_necessary();
m_count += n;
m_m1->update(n);
m_m5->update(n);
m_m15->update(n);
}
void Meter::tick_if_necessary()
{
auto old_tick = m_last_tick.load();
auto new_tick = m_clock->tick().count();
auto age = new_tick - old_tick;
if (age > kTickInterval)
{
auto new_interval_start_tick = new_tick - age % kTickInterval;
if (std::atomic_compare_exchange_strong(&m_last_tick, &old_tick, new_interval_start_tick))
{
auto required_ticks = age / kTickInterval;
for (int i = 0; i < required_ticks; ++i)
{
m_m1->tick();
m_m5->tick();
m_m15->tick();
}
}
}
}
long Meter::get_count() const noexcept
{
return m_count.load();
}
double Meter::get_m1_rate()
{
tick_if_necessary();
return m_m1->get_rate(std::chrono::seconds(1));
}
double Meter::get_m5_rate()
{
tick_if_necessary();
return m_m5->get_rate(std::chrono::seconds(1));
}
double Meter::get_m15_rate()
{
tick_if_necessary();
return m_m15->get_rate(std::chrono::seconds(1));
}
double Meter::get_mean_rate()
{
auto count = get_count();
if (count == 0)
{
return 0.0;
}
constexpr auto kNanosPerSecond = std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::seconds(1)).count();
auto elapsed = m_clock->tick() - m_start_time;
return static_cast<double>(count) / elapsed.count() * kNanosPerSecond;
}
}
| 23.731481 | 121 | 0.679672 |
79db25e160cf312d4ee4299f2a97fdce5ac51b7c | 3,586 | php | PHP | app/Http/Controllers/Admin/TourController.php | vjetfpt/ass_php3 | 1c7986d7992189bb627b15b2d6d2ba2250f61a20 | [
"MIT"
] | null | null | null | app/Http/Controllers/Admin/TourController.php | vjetfpt/ass_php3 | 1c7986d7992189bb627b15b2d6d2ba2250f61a20 | [
"MIT"
] | null | null | null | app/Http/Controllers/Admin/TourController.php | vjetfpt/ass_php3 | 1c7986d7992189bb627b15b2d6d2ba2250f61a20 | [
"MIT"
] | null | null | null | <?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\Tour;
use App\Models\Category;
use App\Models\Gallery;
use App\Http\Requests\Admin\Tour\StoreRequest;
use App\Http\Requests\Admin\Tour\StoreEditRequest;
class TourController extends Controller
{
public function index()
{
$listTours = Tour::paginate(4);
$listPictures = Gallery::all();
foreach ($listTours as $tour) {
foreach ($listPictures as $pic) {
if ($tour['id'] == $pic['tour_id']) {
$tour['image'] = $pic['link_image'];
break;
}
}
}
return view('admin/tour/index', ['data' => $listTours]);
}
public function show()
{
}
public function create()
{
$listCate = Category::all();
return view('admin/tour/create',['listCate'=>$listCate]);
}
public function store(StoreRequest $request)
{
$tour = $request->except('_token', 'image');
// dd($tour);
$idTour = Tour::create($tour)->id;
$images = $_FILES['image'];
for ($i = 0; $i < count($images['name']); $i++) {
$url_img = config('global.APP_URL_IMG') . uniqid() . "-" . $images['name'][$i];
if (!move_uploaded_file($images['tmp_name'][$i], $url_img)) {
echo "Lỗi trong quá trình upload ảnh";
};
Gallery::create([
'link_image' => $url_img,
'tour_id' => $idTour
]);
}
return redirect()->route('admin.tour.index');
}
public function edit($id)
{
$data = Tour::find($id);
$listCate = Category::all();
$listImages = Gallery::where('tour_id', $id)->get();
return view('admin/tour/edit', ['data' => $data, 'dataImage' => $listImages, 'list_cate' => $listCate]);
}
public function update(StoreEditRequest $request, $id)
{
$data = $request->except('_token', 'img_delete', 'image');
$listDeleteImage = $request->input('img_delete');
$tour = Tour::find($id);
$tour->update($data);
if ($request->hasFile('image')) {
$listImage = $request->image;
for ($i = 0; $i < count($listImage); $i++) {
$newImageName = uniqid() . '-' . $request->name . '.' . $listImage[$i]->extension();
$listImage[$i]->move(public_path(config('global.APP_URL_IMG')), $newImageName);
Gallery::create([
'link_image' => config('global.APP_URL_IMG')."$newImageName",
'tour_id' => $id
]);
}
}
if (!empty($listDeleteImage)) {
$stringDeleteImage = trim($listDeleteImage, '-');
$listDeleteImage = explode('-', $stringDeleteImage);
foreach ($listDeleteImage as $item) {
$idImg = (int)$item;
$gallery = Gallery::find($idImg);
$gallery->delete();
}
}
return redirect()->route('admin.tour.index');
}
public function delete($id)
{
$tour = Tour::find($id);
if(!$tour){
return redirect()->route('admin.tour.index');
}
$tour->delete();
$galleries = Gallery::where('tour_id',$id)->get();
for($i=0;$i<count($galleries);$i++){
unlink($galleries[$i]->link_image);
}
Gallery::where('tour_id',$id)->delete();
return redirect()->route('admin.tour.index');
}
}
| 32.899083 | 112 | 0.509202 |
72c78b5b5d024735916857edf73ecb30ffa29ad0 | 546 | cs | C# | MPM/Net/Protocols/Minecraft/ProtocolTypes/Asset.cs | DSTech/MPM_CS | 9c47d6729d7692b4f1260b1e7003dbfd33c096d1 | [
"MIT"
] | null | null | null | MPM/Net/Protocols/Minecraft/ProtocolTypes/Asset.cs | DSTech/MPM_CS | 9c47d6729d7692b4f1260b1e7003dbfd33c096d1 | [
"MIT"
] | null | null | null | MPM/Net/Protocols/Minecraft/ProtocolTypes/Asset.cs | DSTech/MPM_CS | 9c47d6729d7692b4f1260b1e7003dbfd33c096d1 | [
"MIT"
] | null | null | null | using System;
using MPM.Types;
using MPM.Util.Json;
using Newtonsoft.Json;
namespace MPM.Net.Protocols.Minecraft.ProtocolTypes {
public class Asset {
[JsonProperty("path", Required = Required.Always, Order = 1)]
public Uri @Uri { get; set; }
[JsonProperty("hash", Required = Required.Always, Order = 2)]
[JsonConverter(typeof(Sha1HashHexConverter))]
public Hash @Hash { get; set; }
[JsonProperty("size", Required = Required.Always, Order = 3)]
public long Size { get; set; }
}
}
| 28.736842 | 69 | 0.641026 |
854dd31ea3388974fd6073fb409b1c8df71e28d9 | 3,106 | cs | C# | CommonLib/Extensions/DateTimeExtensions.cs | jakegough/jaytwo.CommonLib | 1ef307628300796ca5100f931236c4d00b4a3bf0 | [
"MIT"
] | 1 | 2016-06-25T03:17:44.000Z | 2016-06-25T03:17:44.000Z | CommonLib/Extensions/DateTimeExtensions.cs | jakegough/jaytwo.CommonLib | 1ef307628300796ca5100f931236c4d00b4a3bf0 | [
"MIT"
] | null | null | null | CommonLib/Extensions/DateTimeExtensions.cs | jakegough/jaytwo.CommonLib | 1ef307628300796ca5100f931236c4d00b4a3bf0 | [
"MIT"
] | null | null | null | using jaytwo.Common.Time;
using System;
using System.Globalization;
namespace jaytwo.Common.Extensions
{
public static class DateTimeExtensions
{
public static bool IsWeekend(this DateTime value)
{
return TimeUtility.IsWeekend(value);
}
public static bool IsWeekday(this DateTime value)
{
return TimeUtility.IsWeekday(value);
}
public static DateTime AddWeekdays(this DateTime value, int weekdaysToAdd)
{
return TimeUtility.AddWeekdays(value, weekdaysToAdd);
}
public static bool IsSameDayAs(this DateTime value, DateTime other)
{
return TimeUtility.IsSameDayAs(value, other);
}
public static bool IsSameDayOrAfter(this DateTime value, DateTime other)
{
return TimeUtility.IsSameDayOrAfter(value, other);
}
public static bool IsSameDayOrBefore(this DateTime value, DateTime other)
{
return TimeUtility.IsSameDayOrBefore(value, other);
}
public static bool IsAfter(this DateTime value, DateTime other)
{
return TimeUtility.IsAfter(value, other);
}
public static bool IsBefore(this DateTime value, DateTime other)
{
return TimeUtility.IsBefore(value, other);
}
public static bool IsOnOrAfter(this DateTime value, DateTime other)
{
return TimeUtility.IsOnOrAfter(value, other);
}
public static bool IsOnOrBefore(this DateTime value, DateTime other)
{
return TimeUtility.IsOnOrBefore(value, other);
}
public static string ToHttpTimeString(this DateTime value)
{
return TimeUtility.GetHttpTimeString(value);
}
public static string ToHttpTimeString(this DateTime? value)
{
return TimeUtility.GetHttpTimeString(value);
}
public static string ToIso8601TimeString(this DateTime value)
{
return TimeUtility.GetIso8601TimeString(value);
}
public static string ToIso8601TimeString(this DateTime? value)
{
return TimeUtility.GetIso8601TimeString(value);
}
public static string ToSortableTimeString(this DateTime value)
{
return TimeUtility.GetSortableTimeString(value);
}
public static string ToSortableTimeString(this DateTime? value)
{
return TimeUtility.GetSortableTimeString(value);
}
public static DateTime TruncateToSecondPrecision(this DateTime value)
{
return TimeUtility.TruncateToSecondPrecision(value);
}
public static DateTime? TruncateToSecondPrecision(this DateTime? value)
{
return TimeUtility.TruncateToSecondPrecision(value);
}
public static DateTime TruncateToMinutePrecision(this DateTime value)
{
return TimeUtility.TruncateToMinutePrecision(value);
}
public static DateTime? TruncateToMinutePrecision(this DateTime? value)
{
return TimeUtility.TruncateToMinutePrecision(value);
}
public static DateTime WithKind(this DateTime value, DateTimeKind kind)
{
return DateTime.SpecifyKind(value, kind);
}
public static DateTime? WithKind(this DateTime? value, DateTimeKind kind)
{
if (value.HasValue)
{
return WithKind(value.Value, kind);
}
else
{
return null;
}
}
}
} | 24.650794 | 76 | 0.730844 |
beab56be24a47358aac70f56500bdd1d624282ab | 744 | tsx | TypeScript | src/dashboard/src/contexts/Clusters.tsx | Anbang-Hu/DLWorkspace | 09d82aa5efd4dc9523fd956f913f73e53a85c3c2 | [
"MIT"
] | null | null | null | src/dashboard/src/contexts/Clusters.tsx | Anbang-Hu/DLWorkspace | 09d82aa5efd4dc9523fd956f913f73e53a85c3c2 | [
"MIT"
] | null | null | null | src/dashboard/src/contexts/Clusters.tsx | Anbang-Hu/DLWorkspace | 09d82aa5efd4dc9523fd956f913f73e53a85c3c2 | [
"MIT"
] | null | null | null | import * as React from 'react'
import {
FunctionComponent,
createContext,
useContext,
useMemo
} from 'react'
import { find } from 'lodash'
import TeamContext from './Team'
interface ClustersContext {
clusters: any[]
}
const ClustersContext = createContext<ClustersContext>({ clusters: [] })
export default ClustersContext
export const Provider: FunctionComponent = ({ children }) => {
const { teams, currentTeamId } = useContext(TeamContext)
const clusters = useMemo(() => {
const team = find(teams, ({ id }) => id === currentTeamId)
if (team === undefined) return []
return team['clusters']
}, [teams, currentTeamId])
return (
<ClustersContext.Provider value={{ clusters }} children={children}/>
)
}
| 22.545455 | 72 | 0.680108 |
b41a0fa3fbf3947ee5d478dbbe0510384a032e11 | 1,078 | lua | Lua | modules/gamelib/position.lua | Sposito/otclient | d3e12b5d44a3f801b0b24fcf25dfd811929e6ba4 | [
"MIT"
] | 518 | 2015-01-10T18:09:26.000Z | 2022-03-27T11:41:33.000Z | modules/gamelib/position.lua | Sposito/otclient | d3e12b5d44a3f801b0b24fcf25dfd811929e6ba4 | [
"MIT"
] | 504 | 2015-01-01T17:34:59.000Z | 2022-03-25T18:27:37.000Z | modules/gamelib/position.lua | Sposito/otclient | d3e12b5d44a3f801b0b24fcf25dfd811929e6ba4 | [
"MIT"
] | 545 | 2015-01-08T09:37:10.000Z | 2022-03-05T00:57:50.000Z | Position = {}
function Position.equals(pos1, pos2)
return pos1.x == pos2.x and pos1.y == pos2.y and pos1.z == pos2.z
end
function Position.greaterThan(pos1, pos2, orEqualTo)
if orEqualTo then
return pos1.x >= pos2.x or pos1.y >= pos2.y or pos1.z >= pos2.z
else
return pos1.x > pos2.x or pos1.y > pos2.y or pos1.z > pos2.z
end
end
function Position.lessThan(pos1, pos2, orEqualTo)
if orEqualTo then
return pos1.x <= pos2.x or pos1.y <= pos2.y or pos1.z <= pos2.z
else
return pos1.x < pos2.x or pos1.y < pos2.y or pos1.z < pos2.z
end
end
function Position.isInRange(pos1, pos2, xRange, yRange)
return math.abs(pos1.x-pos2.x) <= xRange and math.abs(pos1.y-pos2.y) <= yRange and pos1.z == pos2.z;
end
function Position.isValid(pos)
return not (pos.x == 65535 and pos.y == 65535 and pos.z == 255)
end
function Position.distance(pos1, pos2)
return math.sqrt(math.pow((pos2.x - pos1.x), 2) + math.pow((pos2.y - pos1.y), 2))
end
function Position.manhattanDistance(pos1, pos2)
return math.abs(pos2.x - pos1.x) + math.abs(pos2.y - pos1.y)
end | 29.135135 | 102 | 0.679035 |
e2c7e063572c79d4dcd177bfbe9b6b09d4bf5999 | 1,426 | py | Python | geni-lib/geni/aggregate/transit.py | AERPAW-Platform-Control/gateway | a80a25bb54a7cede82673f2385bb73d5aaa4963a | [
"MIT"
] | null | null | null | geni-lib/geni/aggregate/transit.py | AERPAW-Platform-Control/gateway | a80a25bb54a7cede82673f2385bb73d5aaa4963a | [
"MIT"
] | null | null | null | geni-lib/geni/aggregate/transit.py | AERPAW-Platform-Control/gateway | a80a25bb54a7cede82673f2385bb73d5aaa4963a | [
"MIT"
] | null | null | null | # Copyright (c) 2014-2015 Barnstormer Softworks, Ltd.
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import absolute_import
import inspect
import sys
from .core import AM
class Transit(AM):
def __init__ (self, name, amtype, cmid, url):
super(Transit, self).__init__(name, url, "amapiv2", amtype, cmid)
AL2S = Transit("i2-al2s", "oess", "urn:publicid:IDN+al2s.internet2.edu+authority+am",
"https://geni-al2s.net.internet2.edu:3626/foam/gapi/2")
ION = Transit("i2-ion", "pg", "urn:publicid:IDN+ion.internet2.edu+authority+am",
"http://geni-am.net.internet2.edu:12346")
MAX = Transit("dcn-max", "pg", "urn:publicid:IDN+dragon.maxgigapop.net+authority+am",
"http://max-myplc.dragon.maxgigapop.net:12346")
Utah = Transit("utah-stitch", "pg", "urn:publicid:IDN+stitch.geniracks.net+authority+cm",
"https://stitch.geniracks.net:12369/protogeni/xmlrpc/am")
def aggregates ():
module = sys.modules[__name__]
for _,obj in inspect.getmembers(module):
if isinstance(obj, AM):
yield obj
def name_to_aggregate ():
result = dict()
module = sys.modules[__name__]
for _,obj in inspect.getmembers(module):
if isinstance(obj, AM):
result[obj.name] = obj
return result
| 32.409091 | 89 | 0.685133 |
bb2a3af26ea4d0334be61d35b0b07fe5482ec2d1 | 5,180 | cs | C# | FactLayer.Import/TVNewsCheckImporter.cs | jacobb84/fact-layer | 16a70988782fbd3b4e012e6f1e087879982dcb1b | [
"MIT"
] | 2 | 2021-08-17T09:48:28.000Z | 2022-01-10T08:03:23.000Z | FactLayer.Import/TVNewsCheckImporter.cs | jacobb84/fact-layer | 16a70988782fbd3b4e012e6f1e087879982dcb1b | [
"MIT"
] | 1 | 2022-03-13T15:41:01.000Z | 2022-03-14T13:20:21.000Z | FactLayer.Import/TVNewsCheckImporter.cs | jacobb84/fact-layer | 16a70988782fbd3b4e012e6f1e087879982dcb1b | [
"MIT"
] | null | null | null | using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HtmlAgilityPack;
using System.Net;
using System.Configuration;
using System.IO;
using FactLayer.Import.Models;
using System.Web;
using Newtonsoft.Json.Linq;
namespace FactLayer.Import
{
public class TVNewsCheckImporter : BaseImporter
{
private static List<OrganizationSite> _sites;
public static void Import(string url)
{
var doc = new HtmlAgilityPack.HtmlDocument();
var request = (HttpWebRequest)WebRequest.Create(url);
request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0";
var response = (HttpWebResponse)request.GetResponse();
string retval;
using (var sr = new StreamReader(response.GetResponseStream()))
{
retval = sr.ReadToEnd().Trim();
}
var json = JObject.Parse(retval);
var stations = json.SelectToken("stations");
foreach (var station in stations)
{
var siteUrl = station.SelectToken("website").Value<string>();
if (!String.IsNullOrEmpty(siteUrl))
{
var domain = ExtractDomainNameFromURL(siteUrl);
if (!String.IsNullOrEmpty(domain) && !IgnoreUrl(domain))
{
if (_sites.Any(s => s.Domain.Equals(domain)))
{
var site = _sites.Where(s => s.Domain.Equals(domain)).Single();
if (!site.Sources.Any(s => s.Organization == SourceOrganization.TVNewsCheck))
{
var source = new Source();
source.Organization = SourceOrganization.TVNewsCheck;
source.URL = "https://tvnewscheck.com/tv-station-directory/#/station/" + station.SelectToken("id").Value<string>();
source.ClaimType = SourceClaimType.OrgType;
source.ClaimValue = (int)OrgType.NewsMedia;
site.Sources.Add(source);
Console.WriteLine("Added Source for " + site.Name);
}
else
{
var source = site.Sources.Where(s => s.Organization == SourceOrganization.TVNewsCheck).Single();
source.URL = "https://tvnewscheck.com/tv-station-directory/#/station/" + station.SelectToken("id").Value<string>();
Console.WriteLine("Updated Source for " + site.Name);
}
}
else
{
var site = new OrganizationSite();
site.Name = station.SelectToken("call_sign").Value<string>();
site.Domain = domain;
site.OrganizationType = OrgType.NewsMedia;
var source = new Source();
source.Organization = SourceOrganization.TVNewsCheck;
source.URL = "https://tvnewscheck.com/tv-station-directory/#/station/" + station.SelectToken("id").Value<string>();
source.ClaimType = SourceClaimType.OrgType;
source.ClaimValue = (int)OrgType.NewsMedia;
site.Sources.Add(source);
Console.WriteLine("Loaded " + site.Name);
_sites.Add(site);
}
}
}
}
}
public static List<OrganizationSite> StartImport(List<OrganizationSite> sites)
{
ServicePointManager.Expect100Continue = true;
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
_sites = sites;
//CBS
Import("https://tvnewscheck.com/wp-json/station-directory/v1/network?id=dc961110-8ac7-11e8-90a4-c9cad5d5b436");
//ABC
Import("https://tvnewscheck.com/wp-json/station-directory/v1/network?id=dcab8870-8ac7-11e8-bca3-f1d7a11c66fc");
//NBC
Import("https://tvnewscheck.com/wp-json/station-directory/v1/network?id=dc919190-8ac7-11e8-99f9-93f8e7c66221");
//FOX
Import("https://tvnewscheck.com/wp-json/station-directory/v1/network?id=dcd4ed00-8ac7-11e8-bfdb-d9c87d6dd64d");
//CW
Import("https://tvnewscheck.com/wp-json/station-directory/v1/network?id=dd1609c0-8ac7-11e8-b879-0fc7bac0703a");
//PBS
Import("https://tvnewscheck.com/wp-json/station-directory/v1/network?id=dc9ea0d0-8ac7-11e8-86bc-bb867d6214d3");
//F&M
Import("https://tvnewscheck.com/wp-json/station-directory/v1/network?id=304f8d60-8ac8-11e8-a0ff-750bcbee96b7");
return _sites;
}
}
}
| 49.333333 | 147 | 0.531467 |
93ef7924dc6c0d713a0dcce7952062ed6ff78f11 | 456 | cs | C# | Back end/Polaris/Database/Communication/IEntityHandler.cs | Parsa2820/Polaris-MSSQL | af897653f63faf12cc0f9bb53a6f31446eb4129c | [
"MIT"
] | null | null | null | Back end/Polaris/Database/Communication/IEntityHandler.cs | Parsa2820/Polaris-MSSQL | af897653f63faf12cc0f9bb53a6f31446eb4129c | [
"MIT"
] | null | null | null | Back end/Polaris/Database/Communication/IEntityHandler.cs | Parsa2820/Polaris-MSSQL | af897653f63faf12cc0f9bb53a6f31446eb4129c | [
"MIT"
] | null | null | null | using Models;
using System.Collections.Generic;
namespace Database.Communication
{
public interface IEntityHandler<TModel, TType> : IDatabaseHandler<TModel>
where TModel : Entity<TType>
{
TModel GetEntity(TType id, string sourceName);
IEnumerable<TModel> GetEntities(TType[] ids, string sourceName);
void UpdateEntity(TModel newEntity, string sourceName);
void DeleteEntity(TType id, string sourceName);
}
} | 32.571429 | 77 | 0.723684 |
b943f1dd8fc52d1931ff58cb3b67f6d98cf18abd | 1,392 | css | CSS | css/bootstrap.css | studiofluxx/studiofluxx | 79520bb2a40c8fa571af6a941d0359ce2f786963 | [
"MIT"
] | null | null | null | css/bootstrap.css | studiofluxx/studiofluxx | 79520bb2a40c8fa571af6a941d0359ce2f786963 | [
"MIT"
] | null | null | null | css/bootstrap.css | studiofluxx/studiofluxx | 79520bb2a40c8fa571af6a941d0359ce2f786963 | [
"MIT"
] | null | null | null | /* apply a natural box layout model to all elements, but allowing components to change */
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
body {
background-color: #F5F7FA;
line-height: 1.2;
}
/**
* For modern browsers
* 1. The space content is one way to avoid an Opera bug when the
* contenteditable attribute is included anywhere else in the document.
* Otherwise it causes space to appear at the top and bottom of elements
* that are clearfixed.
* 2. The use of `table` rather than `block` is only necessary if using
* `:before` to contain the top-margins of child elements.
*/
.cf:before,
.cf:after {
content: " "; /* 1 */
display: table; /* 2 */
}
.cf:after {
clear: both;
}
/**
* For IE 6/7 only
* Include this rule to trigger hasLayout and contain floats.
*/
.cf {
*zoom: 1;
}
.wrapper {
width: 100%;
max-width: 1000px;
margin-right: auto;
margin-left: auto;
margin-top: 60px;
margin-bottom: 200px;
}
.content {
padding: 0 15px;
width: 520px;
}
.content h1 {
margin-top: 0;
}
.content p,
.sidebar p{
font-family: "BLOKKNeue-Regular";
}
.sidebar {
padding: 20px;
width: 190px;
background-color: #434A54;
color: #fff;
}
.sidebar h3 {
margin: 0;
}
.content,
.sidebar {
float: left;
}
/* The sticky */
.sidebar {
position: -webkit-sticky;
position: sticky;
top: 15px;
} | 18.077922 | 89 | 0.644397 |
391107ba757cd29c56bf9af4ebcf4c9f8ffa5be2 | 1,387 | py | Python | bucketlist/restapi/serializers.py | gitgik/djangular-bucketlist-app | 4c88cf9d0c5c091e6e4d930f4999d913039e4c25 | [
"MIT"
] | 3 | 2017-01-02T15:17:32.000Z | 2019-03-04T13:38:13.000Z | bucketlist/restapi/serializers.py | gitgik/djangular-bucketlist-app | 4c88cf9d0c5c091e6e4d930f4999d913039e4c25 | [
"MIT"
] | 3 | 2017-01-03T19:16:15.000Z | 2018-03-23T19:43:12.000Z | bucketlist/restapi/serializers.py | gitgik/djangular-bucketlist-app | 4c88cf9d0c5c091e6e4d930f4999d913039e4c25 | [
"MIT"
] | 2 | 2019-01-21T20:16:07.000Z | 2019-06-23T14:32:44.000Z | from django.contrib.auth.models import User
from rest_framework import serializers
from .models import Bucketlist, BucketlistItem
class UserSerializer(serializers.ModelSerializer):
"""Define the user api representation."""
class Meta:
"""Meta class."""
model = User
fields = ('username', 'password')
def create(self, validated_data):
"""Create and returns a new user."""
user = User.objects.create_user(**validated_data)
return user
class BucketlistItemSerializer(serializers.ModelSerializer):
"""Define the bucketlist item api representation."""
class Meta:
"""Meta class."""
model = BucketlistItem
fields = (
'id', 'name', 'done',
'date_created', 'date_modified', 'bucketlist')
read_only_fields = ('date_modified', 'date_created')
class BucketlistSerializer(serializers.ModelSerializer):
"""Define an actionable bucketlist api representation with child items."""
items = BucketlistItemSerializer(many=True, read_only=True)
created_by = serializers.ReadOnlyField(source='created_by.username')
class Meta:
"""Meta class."""
model = Bucketlist
fields = (
'id', 'name', 'items',
'date_created', 'date_modified', 'created_by')
read_only_fields = ('date_created', 'date_modified')
| 28.895833 | 78 | 0.652487 |
eb2f97d2b1f6921fcfa7b716651318932fb6007e | 11,037 | css | CSS | resources/views/assets/plugins/ganttView/jquery.ganttView.css | samwelherman/agrihub | 5da6aef05feb7fc0cc3cea38d27cdaffb76d8256 | [
"MIT"
] | null | null | null | resources/views/assets/plugins/ganttView/jquery.ganttView.css | samwelherman/agrihub | 5da6aef05feb7fc0cc3cea38d27cdaffb76d8256 | [
"MIT"
] | null | null | null | resources/views/assets/plugins/ganttView/jquery.ganttView.css | samwelherman/agrihub | 5da6aef05feb7fc0cc3cea38d27cdaffb76d8256 | [
"MIT"
] | null | null | null | .gantt, .gantt2 {
width: 100%;
/*position: relative;*/
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.gantt:after {
content: ".";
visibility: hidden;
display: block;
height: 0;
clear: both;
}
.fn-gantt {
width: 100%;
}
.fn-gantt .fn-content {
overflow: hidden;
position: relative;
width: 100%;
}
/* === LEFT PANEL === */
.fn-gantt .leftPanel {
float: left;
width: 24%;
min-width: 200px;
overflow: hidden;
border-right: 1px solid #ECECEC;
position: relative;
z-index: 20;
box-shadow: 0px -3px 10px -1px rgba(89, 89, 89, 0.28);
}
.fn-gantt .row {
float: left;
height: 24px;
line-height: 24px;
margin-left: 0px;
margin-bottom: 0px;
}
.fn-gantt .row.header {
margin-left: -1px;
}
.fn-gantt .leftPanel .fn-label {
display: inline-block;
margin: 0 0 0 5px;
color: #484A4D;
width: 90%;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.fn-gantt .leftPanel .row0 {
border-top: 1px solid #ECECEC;
}
.fn-gantt .leftPanel .name, .fn-gantt .leftPanel .desc {
float: left;
height: 24px;
margin: 0;
border-bottom: 1px solid #ECECEC;
}
.fn-gantt .leftPanel .name {
width: 0%;
font-weight: bold;
}
.fn-gantt .leftPanel .desc {
width: 97%;
padding-left: 15px;
}
.fn-gantt .leftPanel .fn-wide, .fn-gantt .leftPanel .fn-wide .fn-label {
width: 97%;
border: 0;
color: #fff;
font-size: 12px;
font-family: "Open Sans";
font-weight: 500;
}
.fn-gantt .leftPanel .fn-wide {
box-shadow: 5px 0 0 0 #505458 inset;
padding-left: 8px;
background: rgba(64, 86, 109, 0.63);
}
.fn-gantt .spacer {
margin: -1px 0 1px 0;
border-bottom: none;
}
/* === RIGHT PANEL === */
.fn-gantt .rightPanel {
overflow: hidden;
}
.fn-gantt .dataPanel {
margin-left: 0px;
border-right: 1px solid #ECECEC;
background-image: url(img/grid.png);
background-repeat: repeat;
background-position: 24px 24px;
position: relative;
}
.fn-gantt .day, .fn-gantt .date {
overflow: visible;
width: 24px;
line-height: 24px;
text-align: center;
border-left: 1px solid #ECECEC;
border-bottom: 1px solid #ECECEC;
margin: -1px 0 0 -1px;
font-size: 11px;
color: #484a4d;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
text-align: center;
}
.fn-gantt .holiday {
background-color: #ffd263;
height: 23px;
margin: 0 0 -1px -1px;
}
.fn-gantt .today {
/*background-color: #5d9cec;*/
height: 23px;
margin: 0 0 -1px 0px;
font-weight: bold;
text-align: center;
color: #5d9cec;
}
.fn-gantt .sa, .fn-gantt .sn, .fn-gantt .wd {
height: 23px;
margin: 0 0 0 0px;
text-align: center;
}
.fn-gantt .sa, .fn-gantt .sn {
color: #939496;
background-color: #f5f5f5;
text-align: center;
}
.fn-gantt .wd {
background-color: #ffffff;
text-align: center;
}
.fn-gantt .rightPanel .month, .fn-gantt .rightPanel .year {
float: left;
overflow: hidden;
border-left: 1px solid #ECECEC;
border-bottom: 1px solid #ECECEC;
height: 23px;
margin: 0 0 0 0px;
background-color: #fff;
font-weight: bold;
font-size: 11px;
color: #484a4d;
text-align: center;
text-transform: uppercase;
font-family: "open sans";
}
.fn-gantt-hint {
border: 5px solid #edc332;
background-color: #fff5d4;
padding: 10px;
position: absolute;
display: none;
z-index: 11;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
.fn-gantt .bar {
background-color: #4babc7;
height: 18px;
margin: 0px 3px 3px 0px;
position: absolute;
z-index: 10;
text-align: center;
-moz-border-radius: 3px;
border-radius: 3px;
}
.fn-gantt .bar .fn-label {
line-height: 18px;
font-weight: 500;
white-space: nowrap;
width: 100%;
text-overflow: ellipsis;
overflow: hidden;
color: #ffffff !important;
text-align: center;
font-size: 11px;
letter-spacing: 0.5px;
}
.fn-gantt .ganttGrey {
background: #27c24c;
}
.fn-gantt .ganttin_progress {
background: #ff902b;
}
.fn-gantt .gantt_not_started {
background: #23b7e5;
}
.fn-gantt .gantt_deferred {
background: #f05050;
}
.fn-gantt .ganttGrey .fn-label:before {
content: "\f00c";
display: inline-block;
font-family: "FontAwesome";
speak: none;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
text-rendering: auto;
line-height: 1;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
margin-right: 5px;
margin-left: 5px;
}
.fn-gantt .ganttRed {
background-color: #F9C4E1;
}
.fn-gantt .ganttRed .fn-label {
color: #78436D !important;
}
.fn-gantt .ganttGreen {
background-color: #D8EDA3;
}
.fn-gantt .ganttGreen .fn-label {
color: #778461 !important;
}
.fn-gantt .ganttOrange {
background-color: #FCD29A;
}
.fn-gantt .ganttOrange .fn-label {
color: #714715 !important;
}
/* === BOTTOM NAVIGATION === */
.fn-gantt .bottom {
clear: both;
width: 100%;
}
.fn-gantt .navigate {
border-top: 1px solid #ECECEC;
padding: 10px 0 10px 26%;
}
.fn-gantt .navigate .nav-slider {
height: 20px;
display: inline-block;
}
.fn-gantt .navigate .nav-slider-left, .fn-gantt .navigate .nav-slider-right {
text-align: center;
height: 20px;
display: inline-block;
}
.fn-gantt .navigate .nav-slider-left {
float: left;
}
.fn-gantt .navigate .nav-slider-right {
float: right;
}
.fn-gantt .navigate .nav-slider-content {
text-align: left;
width: 160px;
height: 20px;
display: inline-block;
margin: 0 10px;
}
.fn-gantt .navigate .nav-slider-bar, .fn-gantt .navigate .nav-slider-button {
position: absolute;
display: block;
}
.fn-gantt .navigate .nav-slider-bar {
width: 155px;
height: 6px;
background-color: #838688;
margin: 8px 0 0 0;
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) inset;
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) inset;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) inset;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.fn-gantt .navigate .nav-slider-button {
width: 17px;
height: 60px;
background: url(img/slider_handle.png) center center no-repeat;
left: 0px;
top: 0px;
margin: -26px 0 0 0;
cursor: pointer;
}
.fn-gantt .navigate .page-number {
display: inline-block;
font-size: 10px;
height: 20px;
}
.fn-gantt .navigate .page-number span {
color: #666666;
margin: 0 6px;
height: 20px;
line-height: 20px;
display: inline-block;
}
.fn-gantt .navigate a:link, .fn-gantt .navigate a:visited, .fn-gantt .navigate a:active {
text-decoration: none;
}
.fn-gantt .nav-link {
margin: 0 3px 0 0;
display: inline-block;
width: 20px;
height: 20px;
font-size: 0px;
background: #595959 url(img/icon_sprite.png) !important;
border: 1px solid #454546;
cursor: pointer;
vertical-align: top;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
-webkit-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 1px 1px rgba(0, 0, 0, 0.2);
-moz-box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 1px 1px rgba(0, 0, 0, 0.2);
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset, 0 1px 1px rgba(0, 0, 0, 0.2);
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.fn-gantt .nav-link:active {
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25) inset, 0 1px 0 #FFF;
-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25) inset, 0 1px 0 #FFF;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25) inset, 0 1px 0 #FFF;
}
.fn-gantt .navigate .nav-page-back {
background-position: 1px 0 !important;
margin: 0;
}
.fn-gantt .navigate .nav-page-next {
background-position: 1px -16px !important;
margin-right: 15px;
}
.fn-gantt .navigate .nav-slider .nav-page-next {
margin-right: 5px;
}
.fn-gantt .navigate .nav-begin {
background-position: 1px -112px !important;
}
.fn-gantt .navigate .nav-prev-week {
background-position: 1px -128px !important;
}
.fn-gantt .navigate .nav-prev-day {
background-position: 1px -48px !important;
}
.fn-gantt .navigate .nav-next-day {
background-position: 1px -64px !important;
}
.fn-gantt .navigate .nav-next-week {
background-position: 1px -160px !important;
}
.fn-gantt .navigate .nav-end {
background-position: 1px -144px !important;
}
.fn-gantt .navigate .nav-zoomOut {
background-position: 1px -96px !important;
}
.fn-gantt .navigate .nav-zoomIn {
background-position: 1px -80px !important;
margin-left: 15px;
}
.fn-gantt .navigate .nav-now {
background-position: 1px -32px !important;
}
.fn-gantt .navigate .nav-slider .nav-now {
margin-right: 5px;
}
.fn-gantt-loader {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#bf000000', endColorstr='#bf000000', GradientType=0);
background: rgba(0, 0, 0, 0.75);
cursor: wait;
z-index: 30;
}
.fn-gantt-loader-spinner span {
position: absolute;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
width: 100%;
text-align: center;
height: 1em;
line-height: 1em;
color: #fff;
font-size: 1em;
font-weight: bold;
}
.row:after {
clear: both;
}
.fn-gantt .bar.gantt-timeline {
height: 17px;
background: transparent;
margin-top: 1px;
border-top: 2px solid #8067B7;
border-radius: 0px;
overflow: visible;
}
.fn-gantt .bar.gantt-headerline {
background-color: rgba(134, 148, 163, 0.14);
height: 23px;
margin: -2px 3px 3px 0px;
-moz-border-radius: 0px;
border-radius: 0px;
}
.fn-gantt .leftPanel .fn-wide.row0 {
background: rgba(134, 148, 163, 0.14);
box-shadow: none;
}
.fn-gantt .leftPanel .fn-wide.row0 .fn-label {
color: #484A4D;
}
.fn-gantt .bar.gantt-timeline .fn-label {
overflow: visible;
font-size: 21px;
color: #8067B7;
}
.fn-gantt .bar.gantt-timeline .fn-label:before {
color: #8067B7;
content: "\f175";
float: left;
margin-left: -3px;
margin-top: -1px;
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.fn-gantt .bar.gantt-timeline .fn-label:after {
content: "\f175";
color: #8067B7;
float: right;
margin-right: -4px;
margin-top: -1px;
display: inline-block;
font: normal normal normal 14px/1 FontAwesome;
font-size: inherit;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
| 20.51487 | 123 | 0.622633 |
b0c38d9f4d7f71a63ad44df7047e674036283fe5 | 3,442 | h | C | src/pairwise_aligners/SmithWatAffine.h | Amjadhpc/w2rap-contigger | 221f6cabedd19743046ee5dec18e6feb85130218 | [
"MIT"
] | 48 | 2016-04-26T16:52:59.000Z | 2022-01-15T09:18:17.000Z | src/pairwise_aligners/SmithWatAffine.h | Amjadhpc/w2rap-contigger | 221f6cabedd19743046ee5dec18e6feb85130218 | [
"MIT"
] | 45 | 2016-04-27T08:20:56.000Z | 2022-02-14T07:47:11.000Z | src/pairwise_aligners/SmithWatAffine.h | Amjadhpc/w2rap-contigger | 221f6cabedd19743046ee5dec18e6feb85130218 | [
"MIT"
] | 15 | 2016-05-11T14:35:25.000Z | 2022-01-15T09:18:45.000Z | ///////////////////////////////////////////////////////////////////////////////
// SOFTWARE COPYRIGHT NOTICE AGREEMENT //
// This software and its documentation are copyright (2010) by the //
// Broad Institute. All rights are reserved. This software is supplied //
// without any warranty or guaranteed support whatsoever. The Broad //
// Institute is not responsible for its use, misuse, or functionality. //
///////////////////////////////////////////////////////////////////////////////
#ifndef SMITHWATAFFINE
#define SMITHWATAFFINE
#include "Alignment.h"
#include "PackAlign.h"
#include "Basevector.h"
#include <functional>
// Perform affine Smith-Waterman alignment on S and T.
//
// Let S and T be basevectors. Return the best (lowest) score of
// an alignment of S with T, relative to the following rules:
//
// (a) a mismatch scores +3
// (b) a gap opening scores +12
// (c) a gap extension scores +1
//
// Does not yet handle free left/right gaps (i.e. penalize_left_gap
// and penalize_right_gap must be true.
unsigned int SmithWatAffine( const basevector& S, const basevector& T,
alignment& a,
bool penalize_left_gap = true,
bool penalize_right_gap = true,
const int mismatch_penalty = 3,
const int gap_open_penalty = 12,
const int gap_extend_penalty = 1 );
unsigned int SmithWatAffineParallel(
const basevector& S, const basevector& T,
alignment& a,
bool penalize_left_gap = true,
bool penalize_right_gap = true,
const int mismatch_penalty = 3,
const int gap_open_penalty = 12,
const int gap_extend_penalty = 1
);
// this is r48241's SmithWatAffineParallel, with a slightly different data/thread pattern
unsigned int SmithWatAffineParallel2(
const basevector& S, const basevector& T,
alignment& a,
bool penalize_left_gap = true,
bool penalize_right_gap = true,
const int mismatch_penalty = 3,
const int gap_open_penalty = 12,
const int gap_extend_penalty = 1
);
unsigned int SmithWatAffineBanded( const basevector& S, const basevector& T,
int offset, int bandwidth,
align& a, int& nerrors,
const int mismatch_penalty = 3,
const int gap_open_penalty = 12,
const int gap_extend_penalty = 1);
typedef unsigned int (*SubAlignFuncPtr)(const basevector&, const basevector&, alignment&, bool, bool, const int, const int, const int);
unsigned int SmithWatAffineSuper( const basevector& S, const basevector& T,
alignment& a,
int K = 501,
bool penalize_left_gap = true,
bool penalize_right_gap = true,
const int verbose = 0,
const int mismatch_penalty = 3,
const int gap_open_penalty = 12,
const int gap_extend_penalty = 1,
SubAlignFuncPtr subalign = SmithWatAffineParallel2 );
#endif
| 41.97561 | 135 | 0.543579 |
cd9325188a37e928fc27e9b9a09fa3f93b2a82f5 | 3,958 | cs | C# | src/Apps/WurmAssistant/WurmAssistant3/Areas/TrayPopups/PopupManager.cs | cts-randrid/WurmAssistant3 | 6387cf6f6235361e316658e5c28952d3839eeaaa | [
"MIT"
] | 2 | 2020-05-20T09:27:25.000Z | 2022-03-12T17:32:02.000Z | src/Apps/WurmAssistant/WurmAssistant3/Areas/TrayPopups/PopupManager.cs | cts-randrid/WurmAssistant3 | 6387cf6f6235361e316658e5c28952d3839eeaaa | [
"MIT"
] | 2 | 2020-12-16T07:13:24.000Z | 2021-01-09T17:31:12.000Z | src/Apps/WurmAssistant/WurmAssistant3/Areas/TrayPopups/PopupManager.cs | cts-randrid/WurmAssistant3 | 6387cf6f6235361e316658e5c28952d3839eeaaa | [
"MIT"
] | 7 | 2019-08-09T16:01:26.000Z | 2021-01-31T13:42:09.000Z | using System;
using System.Threading;
using System.Windows.Forms;
using AldursLab.WurmAssistant3.Areas.Config;
using AldursLab.WurmAssistant3.Areas.Logging;
using JetBrains.Annotations;
namespace AldursLab.WurmAssistant3.Areas.TrayPopups
{
class PopupManager
{
readonly ILogger logger;
readonly IWurmAssistantConfig config;
FormPopupContainer popupContainer;
Thread popupThread;
ManualResetEvent mre = new ManualResetEvent(false);
internal PopupManager([NotNull] ILogger logger, [NotNull] IWurmAssistantConfig config)
{
this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
this.config = config ?? throw new ArgumentNullException(nameof(config));
BuildPopupThread();
}
void BuildPopupThread()
{
popupThread = new Thread(PopupThreadStart);
popupThread.Priority = ThreadPriority.BelowNormal;
popupThread.IsBackground = true;
popupThread.Start();
if (!mre.WaitOne(TimeSpan.FromSeconds(5)))
{
logger.Error("Timeout at ManualResetEvent.WaitOne");
}
}
void PopupThreadStart()
{
popupContainer = new FormPopupContainer(config);
popupContainer.Load += (sender, args) => mre.Set();
Application.Run(popupContainer);
}
internal void ScheduleCustomPopupNotify(string content, string title, int timeToShowMillis = 3000)
{
try
{
popupContainer.BeginInvoke(new Action<string, string, int>(popupContainer.ScheduleCustomPopupNotify), title, content, timeToShowMillis);
}
catch (Exception exception)
{
if (exception is NullReferenceException || exception is InvalidOperationException)
{
logger.Error(exception, "! Invoke exception at ScheduleCustomPopupNotify:");
try
{
if (exception is InvalidOperationException)
{
try
{
popupContainer.BeginInvoke(new Action(popupContainer.CloseThisContainer));
}
catch (Exception)
{
logger.Error(exception, "! Invoke exception at ScheduleCustomPopupNotify:");
};
}
BuildPopupThread();
popupContainer.BeginInvoke(new Action<string, string, int>(popupContainer.ScheduleCustomPopupNotify), title, content, timeToShowMillis);
}
catch (Exception exception2)
{
logger.Error(exception2, "! Fix failed");
}
}
else
{
logger.Error(exception, "! Unknown Invoke exception at ScheduleCustomPopupNotify");
}
}
}
internal void SetDefaultTitle(string title)
{
try
{
popupContainer.BeginInvoke(
new Action<string>(popupContainer.SetDefaultTitle),
title);
}
catch (Exception exception)
{
logger.Error(exception, "! Invoke exception at ScheduleCustomPopupNotify:");
}
}
~PopupManager()
{
try
{
popupContainer.BeginInvoke(new Action(popupContainer.CloseThisContainer));
}
catch (Exception exception)
{
System.Diagnostics.Debug.WriteLine("PopupManager finalizer exception: " + exception);
}
}
}
}
| 35.657658 | 160 | 0.528297 |
a37f431ab7a42f7038d97ba10449ac21b989d137 | 312 | java | Java | guide/code/oopbasic/src/cn/edu/sdut/softlab/oopbasic/inherit/step4/DebitCard.java | subaochen/java-tutorial | aaa6d2dba507fbc5d8432ea0fef72b26e1f3dd96 | [
"Apache-2.0"
] | 23 | 2017-02-28T03:56:44.000Z | 2021-01-10T03:42:18.000Z | guide/code/oopbasic/src/cn/edu/sdut/softlab/oopbasic/inherit/step4/DebitCard.java | subaochen/java-tutorial | aaa6d2dba507fbc5d8432ea0fef72b26e1f3dd96 | [
"Apache-2.0"
] | 28 | 2017-02-28T10:18:56.000Z | 2018-08-18T00:37:56.000Z | guide/code/oopbasic/src/cn/edu/sdut/softlab/oopbasic/inherit/step4/DebitCard.java | subaochen/java-tutorial | aaa6d2dba507fbc5d8432ea0fef72b26e1f3dd96 | [
"Apache-2.0"
] | 15 | 2017-02-28T04:11:27.000Z | 2019-09-05T07:47:42.000Z | package cn.edu.sdut.softlab.oopbasic.inherit.step4;
public class DebitCard extends BankCard {
float balance;
DebitCard() {
System.out.println("DebitCard constuctor called");
}
public DebitCard(String cardNo) {
super(cardNo);
System.out.println("DebitCard constuctor called,cardNo=" + cardNo);
}
}
| 19.5 | 69 | 0.740385 |
dde7143dd73e6da847a1296b8ba99eac2abba569 | 1,771 | java | Java | src/main/java/com/jpa/core/services/ConfigurationLoaderService.java | tomasanchez/jpa-template | ceea1c0f0c27eb6a9ef20ffb7e6dcee7ec51411a | [
"MIT"
] | 1 | 2022-03-03T03:36:18.000Z | 2022-03-03T03:36:18.000Z | src/main/java/com/jpa/core/services/ConfigurationLoaderService.java | tomasanchez/jpa-template | ceea1c0f0c27eb6a9ef20ffb7e6dcee7ec51411a | [
"MIT"
] | null | null | null | src/main/java/com/jpa/core/services/ConfigurationLoaderService.java | tomasanchez/jpa-template | ceea1c0f0c27eb6a9ef20ffb7e6dcee7ec51411a | [
"MIT"
] | null | null | null | package com.jpa.core.services;
import java.util.Set;
import com.jpa.core.config.Configuration;
import com.jpa.core.config.SimpleConfiguration;
import org.reflections.Reflections;
/**
* @author Tomás Sánchez
*/
public class ConfigurationLoaderService {
private static ConfigurationLoaderService instance;
/* =========================================================== */
/* Getters & Setter ------------------------------------------ */
/* =========================================================== */
/**
* Gets the ConfigurationLoaderService instance.
*
* @return the singleton instance
*/
public static ConfigurationLoaderService getService() {
if (instance == null) {
instance = new ConfigurationLoaderService();
}
return instance;
}
/* =========================================================== */
/* Service Interface ----------------------------------------- */
/* =========================================================== */
/**
* Loads and sets all configurations.
*
* @param classPath the package where to find configurations.
*/
public void loadConfigurations(String classPath) {
Reflections reflections = new Reflections(classPath);
Set<Class<? extends SimpleConfiguration>> classes =
reflections.getSubTypesOf(SimpleConfiguration.class);
classes.stream().filter(c -> c.isAnnotationPresent(Configuration.class)).forEach(c -> {
try {
SimpleConfiguration config = c.getDeclaredConstructor().newInstance();
config.configure();
} catch (Exception e) {
e.printStackTrace();
}
});
}
}
| 29.516667 | 95 | 0.501976 |
e222d546ab3eb2379e36191a676f49da574da5c7 | 6,620 | py | Python | m2cgen/interpreters/code_generator.py | yarix/m2cgen | f1aa01e4c70a6d1a8893e27bfbe3c36fcb1e8546 | [
"MIT"
] | null | null | null | m2cgen/interpreters/code_generator.py | yarix/m2cgen | f1aa01e4c70a6d1a8893e27bfbe3c36fcb1e8546 | [
"MIT"
] | null | null | null | m2cgen/interpreters/code_generator.py | yarix/m2cgen | f1aa01e4c70a6d1a8893e27bfbe3c36fcb1e8546 | [
"MIT"
] | null | null | null | from io import StringIO
from weakref import finalize
class CodeTemplate:
def __init__(self, template):
self.str_template = template
def __str__(self):
return self.str_template
def __call__(self, *args, **kwargs):
# Force calling str() representation
# because without it numpy gives the same output
# for different float types
return self.str_template.format(
*[str(i) for i in args],
**{k: str(v) for k, v in kwargs.items()})
class BaseCodeGenerator:
"""
This class provides basic functionality to generate code. It is
language-agnostic, but exposes set of attributes which subclasses should
use to define syntax specific for certain language(s).
!!IMPORTANT!!: Code generators must know nothing about AST.
"""
tpl_num_value = NotImplemented
tpl_infix_expression = NotImplemented
tpl_array_index_access = NotImplemented
def __init__(self, indent=4):
self._indent = indent
self._code_buf = None
self.reset_state()
def reset_state(self):
self._current_indent = 0
self._finalize_buffer()
self._code_buf = StringIO()
self._code = None
self._finalizer = finalize(self, self._finalize_buffer)
def _finalize_buffer(self):
if self._code_buf is not None and not self._code_buf.closed:
self._code_buf.close()
def _write_to_code_buffer(self, text, prepend=False):
if self._code_buf.closed:
raise BufferError(
"Cannot modify code after getting generated code and "
"closing the underlying buffer!\n"
"Call reset_state() to allocate new buffer.")
if prepend:
self._code_buf.seek(0)
old_content = self._code_buf.read()
self._code_buf.seek(0)
text += old_content
self._code_buf.write(text)
def finalize_and_get_generated_code(self):
if not self._code_buf.closed:
self._code = self._code_buf.getvalue()
self._finalize_buffer()
return self._code if self._code is not None else ""
def increase_indent(self):
self._current_indent += self._indent
def decrease_indent(self):
self._current_indent -= self._indent
assert self._current_indent >= 0, (
f"Invalid indentation: {self._current_indent}")
# All code modifications should be implemented via following methods.
def add_code_line(self, line):
if not line:
return
self.add_code_lines([line.strip()])
def add_code_lines(self, lines):
if isinstance(lines, str):
lines = lines.strip().split("\n")
indent = " " * self._current_indent
self._write_to_code_buffer(
indent + f"\n{indent}".join(lines) + "\n")
def prepend_code_line(self, line):
if not line:
return
self.prepend_code_lines([line.strip()])
def prepend_code_lines(self, lines):
new_line = "\n"
if isinstance(lines, str):
lines = lines.strip().split(new_line)
self._write_to_code_buffer(
f"{new_line.join(lines)}{new_line}", prepend=True)
# Following methods simply compute expressions using templates without
# changing result.
def infix_expression(self, left, right, op):
return self.tpl_infix_expression(left=left, right=right, op=op)
def num_value(self, value):
return self.tpl_num_value(value=value)
def array_index_access(self, array_name, index):
return self.tpl_array_index_access(
array_name=array_name, index=index)
def function_invocation(self, function_name, *args):
return f"{function_name}({', '.join(map(str, args))})"
# Helpers
def _comp_op_overwrite(self, op):
return op.value
class ImperativeCodeGenerator(BaseCodeGenerator):
"""
This class provides basic functionality to generate code. It is
language-agnostic, but exposes set of attributes which subclasses should
use to define syntax specific for certain language(s).
!!IMPORTANT!!: Code generators must know nothing about AST.
"""
tpl_var_declaration = NotImplemented
tpl_return_statement = NotImplemented
tpl_if_statement = NotImplemented
tpl_else_statement = NotImplemented
tpl_block_termination = NotImplemented
tpl_var_assignment = NotImplemented
def reset_state(self):
super().reset_state()
self._var_idx = 0
def get_var_name(self):
var_name = f"var{self._var_idx}"
self._var_idx += 1
return var_name
# Following statements compute expressions using templates AND add
# it to the result.
def add_return_statement(self, value):
self.add_code_line(self.tpl_return_statement(value=value))
def add_var_declaration(self, size):
var_name = self.get_var_name()
is_vector = size > 1
var_type = self._get_var_declare_type(is_vector)
self.add_code_line(
self.tpl_var_declaration(
var_type=var_type, var_name=var_name))
return var_name
def add_if_statement(self, if_def):
self.add_code_line(self.tpl_if_statement(if_def=if_def))
self.increase_indent()
def add_else_statement(self):
self.decrease_indent()
self.add_code_line(self.tpl_else_statement())
self.increase_indent()
def add_block_termination(self):
self.decrease_indent()
self.add_code_line(self.tpl_block_termination())
def add_var_assignment(self, var_name, value, value_size):
self.add_code_line(
self.tpl_var_assignment(var_name=var_name, value=value))
# Helpers
def _get_var_declare_type(self, expr):
return NotImplemented
class CLikeCodeGenerator(ImperativeCodeGenerator):
"""
This code generator provides C-like syntax so that subclasses will only
have to provide logic for wrapping expressions into functions/classes/etc.
"""
tpl_num_value = CodeTemplate("{value}")
tpl_infix_expression = CodeTemplate("({left}) {op} ({right})")
tpl_var_declaration = CodeTemplate("{var_type} {var_name};")
tpl_return_statement = CodeTemplate("return {value};")
tpl_array_index_access = CodeTemplate("{array_name}[{index}]")
tpl_if_statement = CodeTemplate("if ({if_def}) {{")
tpl_else_statement = CodeTemplate("}} else {{")
tpl_block_termination = CodeTemplate("}}")
tpl_var_assignment = CodeTemplate("{var_name} = {value};")
| 32.45098 | 78 | 0.663293 |
249f2f4464b2d0451dd22992bb79cf7c055b030a | 2,421 | php | PHP | app/Http/Controllers/IndicatorsController.php | Dagitpam/attendance-cgwc | 0514bbdcd64cdca1c3036ead777c4f9ff3356975 | [
"MIT"
] | null | null | null | app/Http/Controllers/IndicatorsController.php | Dagitpam/attendance-cgwc | 0514bbdcd64cdca1c3036ead777c4f9ff3356975 | [
"MIT"
] | null | null | null | app/Http/Controllers/IndicatorsController.php | Dagitpam/attendance-cgwc | 0514bbdcd64cdca1c3036ead777c4f9ff3356975 | [
"MIT"
] | null | null | null | <?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Indicator;
use App\Welfare;
use Illuminate\Support\Str;
class IndicatorsController extends Controller
{
public function index()
{
$indicators = Indicator::all();
return view('indicators.dashboard', compact('indicators'));
}
public function store(Request $request)
{
$this->ValidateTracker();
try {
$indicator = new Indicator(request([
'name',
'target',
'upper_limit',
'borno',
'adamawa',
'yobe',
'comments',
]));
$indicator->save();
return back()->with('success', 'Indicator added successfully');
} catch (\Exception $e) {
$bug = $e->getMessage();
return redirect()->back()->with('error', $bug);
}
}
public function edit($id)
{
$indicator = Indicator::find($id);
return view('indicators.edit', compact(
'indicator',
));
}
public function update(Request $request)
{
$this->ValidateTracker();
try {
$indicator = Indicator::find($request->id);
// print_r($indicator);
$indicator->update([
'name' =>$request->name,
'target' =>$request->target,
'upper_limit' =>$request->upper_limit,
'borno' =>$request->borno,
'adamawa' =>$request->adamawa,
'yobe' =>$request->yobe,
'comments' =>$request->comments,
]);
return redirect(route('indicator.index'))->with('success', 'Indicator has been updated');
// exit("We got here...3");
} catch (\Exception $e) {
$bug = $e->getMessage();
return redirect()->back()->with('error', $bug);
}
}
protected function ValidateTracker()
{
return request()->validate(
[
'name' =>'required|string',
'target' =>'required|string',
'upper_limit' =>'required|numeric',
'borno'=>'required|numeric',
'adamawa' =>'required|numeric',
'yobe' =>'required|numeric',
'comments'=>'required|string',
]
);
}
}
| 26.604396 | 101 | 0.479967 |
93ffef55515bdb3736784929d83d35f8a37f61d0 | 3,673 | cs | C# | sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/DeletedAccountPropertiesModel.cs | brpanask/azure-sdk-for-net | 3c5d212a7fd370cf026ba30c87bd638e8831b1fd | [
"MIT"
] | 2 | 2020-07-15T18:46:25.000Z | 2021-07-07T12:37:53.000Z | sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/DeletedAccountPropertiesModel.cs | brpanask/azure-sdk-for-net | 3c5d212a7fd370cf026ba30c87bd638e8831b1fd | [
"MIT"
] | 5 | 2019-07-17T16:14:23.000Z | 2021-09-30T00:21:31.000Z | sdk/purview/Microsoft.Azure.Management.Purview/src/Generated/Models/DeletedAccountPropertiesModel.cs | brpanask/azure-sdk-for-net | 3c5d212a7fd370cf026ba30c87bd638e8831b1fd | [
"MIT"
] | 4 | 2020-11-23T10:36:33.000Z | 2021-08-10T21:53:45.000Z | // <auto-generated>
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// </auto-generated>
namespace Microsoft.Azure.Management.Purview.Models
{
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// The soft deleted account properties
/// </summary>
public partial class DeletedAccountPropertiesModel
{
/// <summary>
/// Initializes a new instance of the DeletedAccountPropertiesModel
/// class.
/// </summary>
public DeletedAccountPropertiesModel()
{
CustomInit();
}
/// <summary>
/// Initializes a new instance of the DeletedAccountPropertiesModel
/// class.
/// </summary>
/// <param name="accountId">Gets the account identifier associated with
/// resource.</param>
/// <param name="deletedBy">Gets the user identifier that deleted
/// resource.</param>
/// <param name="deletionDate">Gets the time at which the resource was
/// soft deleted.</param>
/// <param name="location">Gets the resource location.</param>
/// <param name="scheduledPurgeDate">Gets the scheduled purge
/// datetime.</param>
/// <param name="tags">Gets the account tags.</param>
public DeletedAccountPropertiesModel(string accountId = default(string), string deletedBy = default(string), System.DateTime? deletionDate = default(System.DateTime?), string location = default(string), System.DateTime? scheduledPurgeDate = default(System.DateTime?), IDictionary<string, string> tags = default(IDictionary<string, string>))
{
AccountId = accountId;
DeletedBy = deletedBy;
DeletionDate = deletionDate;
Location = location;
ScheduledPurgeDate = scheduledPurgeDate;
Tags = tags;
CustomInit();
}
/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();
/// <summary>
/// Gets the account identifier associated with resource.
/// </summary>
[JsonProperty(PropertyName = "accountId")]
public string AccountId { get; private set; }
/// <summary>
/// Gets the user identifier that deleted resource.
/// </summary>
[JsonProperty(PropertyName = "deletedBy")]
public string DeletedBy { get; private set; }
/// <summary>
/// Gets the time at which the resource was soft deleted.
/// </summary>
[JsonProperty(PropertyName = "deletionDate")]
public System.DateTime? DeletionDate { get; private set; }
/// <summary>
/// Gets the resource location.
/// </summary>
[JsonProperty(PropertyName = "location")]
public string Location { get; private set; }
/// <summary>
/// Gets the scheduled purge datetime.
/// </summary>
[JsonProperty(PropertyName = "scheduledPurgeDate")]
public System.DateTime? ScheduledPurgeDate { get; private set; }
/// <summary>
/// Gets the account tags.
/// </summary>
[JsonProperty(PropertyName = "tags")]
public IDictionary<string, string> Tags { get; private set; }
}
}
| 36.73 | 348 | 0.61639 |
c4558fbd859bb4fa149ffcb26e4d59bf1add6b84 | 12,961 | swift | Swift | Frameworks/TBAData/Tests/District/DistrictTests.swift | ZachOrr/the-blue-alliance-ios | 4aa18a37bf4357cf4c69ebe1910d9e3a87b73060 | [
"MIT"
] | 60 | 2015-02-27T16:34:00.000Z | 2022-03-30T18:51:51.000Z | Frameworks/TBAData/Tests/District/DistrictTests.swift | ZachOrr/the-blue-alliance-ios | 4aa18a37bf4357cf4c69ebe1910d9e3a87b73060 | [
"MIT"
] | 516 | 2015-05-01T07:11:17.000Z | 2022-03-29T06:24:06.000Z | Frameworks/TBAData/Tests/District/DistrictTests.swift | ZachOrr/the-blue-alliance-ios | 4aa18a37bf4357cf4c69ebe1910d9e3a87b73060 | [
"MIT"
] | 39 | 2015-11-10T22:32:37.000Z | 2020-12-19T20:30:53.000Z | import CoreData
import TBADataTesting
import TBAKit
import XCTest
@testable import TBAData
class DistrictTestCase: TBADataTestCase {
func test_abbreviation() {
let district = District.init(entity: District.entity(), insertInto: persistentContainer.viewContext)
district.abbreviationRaw = "zor"
XCTAssertEqual(district.abbreviation, "zor")
}
func test_key() {
let district = District.init(entity: District.entity(), insertInto: persistentContainer.viewContext)
district.keyRaw = "2019zor"
XCTAssertEqual(district.key, "2019zor")
}
func test_name() {
let district = District.init(entity: District.entity(), insertInto: persistentContainer.viewContext)
district.nameRaw = "Zor District"
XCTAssertEqual(district.name, "Zor District")
}
func test_year() {
let district = District.init(entity: District.entity(), insertInto: persistentContainer.viewContext)
district.yearRaw = NSNumber(value: 2019)
XCTAssertEqual(district.year, 2019)
}
func test_events() {
let district = District.init(entity: District.entity(), insertInto: persistentContainer.viewContext)
XCTAssertEqual(district.events, [])
let event = insertEvent()
district.eventsRaw = NSSet(array: [event])
XCTAssertEqual(district.events, [event])
}
func test_rankings() {
let district = District.init(entity: District.entity(), insertInto: persistentContainer.viewContext)
XCTAssertEqual(district.rankings, [])
let ranking = DistrictRanking.init(entity: DistrictRanking.entity(), insertInto: persistentContainer.viewContext)
district.rankingsRaw = NSSet(array: [ranking])
XCTAssertEqual(district.rankings, [ranking])
}
func test_teams() {
let district = District.init(entity: District.entity(), insertInto: persistentContainer.viewContext)
XCTAssertEqual(district.teams, [])
let team = insertTeam()
district.teamsRaw = NSSet(array: [team])
XCTAssertEqual(district.teams, [team])
}
func test_fetchRequest() {
let fr: NSFetchRequest<District> = District.fetchRequest()
XCTAssertEqual(fr.entityName, District.entityName)
}
func test_predicate() {
let predicate = District.predicate(key: "2019zor")
XCTAssertEqual(predicate.predicateFormat, "keyRaw == \"2019zor\"")
let district = District.init(entity: District.entity(), insertInto: persistentContainer.viewContext)
district.keyRaw = "2019zor"
let district2 = District.init(entity: District.entity(), insertInto: persistentContainer.viewContext)
district2.keyRaw = "2020zor"
let results = District.fetch(in: persistentContainer.viewContext) { (fr) in
fr.predicate = predicate
}
XCTAssertEqual(results, [district])
}
func test_yearPredicate() {
let predicate = District.yearPredicate(year: 2019)
XCTAssertEqual(predicate.predicateFormat, "yearRaw == 2019")
let district = District.init(entity: District.entity(), insertInto: persistentContainer.viewContext)
district.yearRaw = NSNumber(value: 2019)
let district2 = District.init(entity: District.entity(), insertInto: persistentContainer.viewContext)
district2.yearRaw = NSNumber(value: 2020)
let results = District.fetch(in: persistentContainer.viewContext) { (fr) in
fr.predicate = predicate
}
XCTAssertEqual(results, [district])
}
func test_nameSortDescriptor() {
let sd = District.nameSortDescriptor()
XCTAssertEqual(sd.key, #keyPath(District.nameRaw))
XCTAssert(sd.ascending)
}
func test_insert_year() {
let modelDistrictOne = TBADistrict(abbreviation: "fim", name: "FIRST In Michigan", key: "2018fim", year: 2018)
let modelDistrictTwo = TBADistrict(abbreviation: "zor", name: "FIRST In Zor", key: "2018zor", year: 2018)
District.insert([modelDistrictOne, modelDistrictTwo], year: 2018, in: persistentContainer.viewContext)
let districtsFirst = District.fetch(in: persistentContainer.viewContext) {
$0.predicate = District.yearPredicate(year: 2018)
}
let districtOne = districtsFirst.first(where: { $0.key == "2018fim" })!
let districtTwo = districtsFirst.first(where: { $0.key == "2018zor" })!
// Sanity check
XCTAssertNotEqual(districtOne, districtTwo)
District.insert([modelDistrictTwo], year: 2018, in: persistentContainer.viewContext)
let districtsSecond = District.fetch(in: persistentContainer.viewContext) {
$0.predicate = District.yearPredicate(year: 2018)
}
XCTAssertNoThrow(try persistentContainer.viewContext.save())
XCTAssertEqual(districtsSecond, [districtTwo])
// DistrictOne should be deleted
XCTAssertNil(districtOne.managedObjectContext)
// DistrictTwo should not be deleted
XCTAssertNotNil(districtTwo.managedObjectContext)
}
func test_insert() {
let modelDistrict = TBADistrict(abbreviation: "fim", name: "FIRST In Michigan", key: "2018fim", year: 2018)
let district = District.insert(modelDistrict, in: persistentContainer.viewContext)
XCTAssertEqual(district.abbreviation, "fim")
XCTAssertEqual(district.name, "FIRST In Michigan")
XCTAssertEqual(district.key, "2018fim")
XCTAssertEqual(district.year, 2018)
XCTAssertNoThrow(try persistentContainer.viewContext.save())
}
func test_insert_events() {
let modelDistrict = TBADistrict(abbreviation: "fim", name: "FIRST In Michigan", key: "2018fim", year: 2018)
let district = District.insert(modelDistrict, in: persistentContainer.viewContext)
let modelEventOne = TBAEvent(key: "2018miket", name: "Event 1", eventCode: "miket", eventType: 1, startDate: Event.dateFormatter.date(from: "2018-03-01")!, endDate: Event.dateFormatter.date(from: "2018-03-03")!, year: 2018, eventTypeString: "District", divisionKeys: [])
let modelEventTwo = TBAEvent(key: "2018mike2", name: "Event 2", eventCode: "mike2", eventType: 1, startDate: Event.dateFormatter.date(from: "2018-03-01")!, endDate: Event.dateFormatter.date(from: "2018-03-03")!, year: 2018, eventTypeString: "District", divisionKeys: [])
district.insert([modelEventOne, modelEventTwo])
let events = district.events
let eventOne = events.first(where: { $0.key == "2018miket" })!
let eventTwo = events.first(where: { $0.key == "2018mike2" })!
// Sanity check
XCTAssertEqual(district.events.count, 2)
XCTAssertNotEqual(eventOne, eventTwo)
district.insert([modelEventTwo])
// Sanity check
XCTAssert(district.events.onlyObject(eventTwo))
XCTAssertNoThrow(try persistentContainer.viewContext.save())
// No events, including orphans, should be deleted
XCTAssertNotNil(eventOne.managedObjectContext)
XCTAssertNotNil(eventTwo.managedObjectContext)
}
func test_insert_teams() {
let modelDistrict = TBADistrict(abbreviation: "fim", name: "FIRST In Michigan", key: "2018fim", year: 2018)
let district = District.insert(modelDistrict, in: persistentContainer.viewContext)
let modelTeamOne = TBATeam(key: "frc1", teamNumber: 1, name: "Team 1", rookieYear: 2001)
let modelTeamTwo = TBATeam(key: "frc2", teamNumber: 2, name: "Team 2", rookieYear: 2002)
district.insert([modelTeamOne, modelTeamTwo])
let teams = district.teams
let teamOne = teams.first(where: { $0.key == "frc1" })!
let teamTwo = teams.first(where: { $0.key == "frc2" })!
// Sanity check
XCTAssertEqual(district.teams.count, 2)
XCTAssertNotEqual(teamOne, teamTwo)
district.insert([modelTeamTwo])
// Sanity check
XCTAssert(district.teams.onlyObject(teamTwo))
XCTAssertNoThrow(try persistentContainer.viewContext.save())
// No teams, including orphans, should be deleted
XCTAssertNotNil(teamOne.managedObjectContext)
XCTAssertNotNil(teamTwo.managedObjectContext)
}
func test_insert_rankings() {
let modelDistrict = TBADistrict(abbreviation: "fim", name: "FIRST In Michigan", key: "2018fim", year: 2018)
let district = District.insert(modelDistrict, in: persistentContainer.viewContext)
let modelRankingOne = TBADistrictRanking(teamKey: "frc1", rank: 1, pointTotal: 70, eventPoints: [])
let modelRankingTwo = TBADistrictRanking(teamKey: "frc2", rank: 2, pointTotal: 66, eventPoints: [])
district.insert([modelRankingOne, modelRankingTwo])
let rankings = district.rankings
let rankingOne = rankings.first(where: { $0.team.key == "frc1" })!
let rankingTwo = rankings.first(where: { $0.team.key == "frc2" })!
// Sanity check
XCTAssertEqual(district.rankings.count, 2)
XCTAssertNotEqual(rankingOne, rankingTwo)
district.insert([modelRankingTwo])
// Sanity check
XCTAssert(district.rankings.onlyObject(rankingTwo))
XCTAssertNoThrow(try persistentContainer.viewContext.save())
// Ranking One is an orphan, and should be deleted. Ranking Two should still exist.
XCTAssertNil(rankingOne.managedObjectContext)
XCTAssertNotNil(rankingTwo.managedObjectContext)
}
func test_update() {
let modelDistrict = TBADistrict(abbreviation: "fim", name: "FIRST In Michigan", key: "2018fim", year: 2018)
let district = District.insert(modelDistrict, in: persistentContainer.viewContext)
let duplicateModelDistrict = TBADistrict(abbreviation: "fim", name: "Michigan FIRST", key: "2018fim", year: 2018)
let duplicateDistrict = District.insert(duplicateModelDistrict, in: persistentContainer.viewContext)
// Sanity check
XCTAssertEqual(district, duplicateDistrict)
// Check that our District updates its values properly
XCTAssertEqual(district.name, "Michigan FIRST")
XCTAssertNoThrow(try persistentContainer.viewContext.save())
}
func test_delete() {
let event = insertDistrictEvent()
let district = event.district!
let ranking = DistrictRanking(entity: DistrictRanking.entity(), insertInto: persistentContainer.viewContext)
ranking.districtRaw = event.district
persistentContainer.viewContext.delete(district)
try! persistentContainer.viewContext.save()
// Check that our District handles its relationships properly
XCTAssertNil(ranking.districtRaw)
XCTAssertNil(event.district)
// Event should not be deleted
XCTAssertNotNil(event.managedObjectContext)
// Ranking should be deleted
XCTAssertNil(ranking.managedObjectContext)
}
func test_abbreviationWithYear() {
let district = District.init(entity: District.entity(), insertInto: persistentContainer.viewContext)
district.yearRaw = 2009
district.abbreviationRaw = "fim"
XCTAssertEqual(district.abbreviationWithYear, "2009 FIM")
}
func test_isHappeningNow_notCurrentYear() {
let district = District.init(entity: District.entity(), insertInto: persistentContainer.viewContext)
district.yearRaw = 2011
let dcmp = Event.init(entity: Event.entity(), insertInto: persistentContainer.viewContext)
dcmp.eventTypeRaw = EventType.districtChampionship.rawValue as NSNumber
district.addToEventsRaw(dcmp)
XCTAssertFalse(district.isHappeningNow)
}
func test_isHappeningNow_noDCMP() {
let district = District.init(entity: District.entity(), insertInto: persistentContainer.viewContext)
district.yearRaw = Calendar.current.year as NSNumber
XCTAssertFalse(district.isHappeningNow)
}
func test_districtChampionship() {
let calendar = Calendar.current
let district = District.init(entity: District.entity(), insertInto: persistentContainer.viewContext)
district.yearRaw = calendar.year as NSNumber
let stopBuildDay = calendar.stopBuildDay()
let today = Date()
// To get our test to pass, we're going to set our districtChampionship.endDate to make sure it inclues today
let dcmp = Event.init(entity: Event.entity(), insertInto: persistentContainer.viewContext)
dcmp.eventTypeRaw = EventType.districtChampionship.rawValue as NSNumber
if stopBuildDay > today {
dcmp.endDateRaw = calendar.date(byAdding: DateComponents(day: -1), to: today)
} else {
dcmp.endDateRaw = calendar.date(byAdding: DateComponents(day: 1), to: today)
}
district.addToEventsRaw(dcmp)
XCTAssert(district.isHappeningNow)
}
}
| 41.146032 | 278 | 0.686135 |
099a2badb2e12950bbb314e2ae5c9f69ba5b060c | 2,382 | swift | Swift | Playgrounds/AudioKitPlaygrounds/Playgrounds/Effects.playground/Pages/Reverb.xcplaygroundpage/Contents.swift | GrandLarseny/AudioKit | f88c243c202736b25b383491332e38367b830187 | [
"MIT"
] | 2 | 2021-11-21T00:12:01.000Z | 2022-03-03T21:09:26.000Z | Playgrounds/AudioKitPlaygrounds/Playgrounds/Effects.playground/Pages/Reverb.xcplaygroundpage/Contents.swift | GrandLarseny/AudioKit | f88c243c202736b25b383491332e38367b830187 | [
"MIT"
] | null | null | null | Playgrounds/AudioKitPlaygrounds/Playgrounds/Effects.playground/Pages/Reverb.xcplaygroundpage/Contents.swift | GrandLarseny/AudioKit | f88c243c202736b25b383491332e38367b830187 | [
"MIT"
] | null | null | null | //: ## Simple Reverb
//: This is an implementation of Apple's simplest reverb which only allows you to set presets
import AudioKitPlaygrounds
import AudioKit
let file = try AKAudioFile(readFileName: playgroundAudioFiles[0])
let player = AKPlayer(audioFile: file)
player.isLooping = true
var reverb = AKReverb(player)
reverb.dryWetMix = 0.5
AudioKit.output = reverb
try AudioKit.start()
player.play()
//: User Interface Set up
import AudioKitUI
class LiveView: AKLiveViewController {
override func viewDidLoad() {
addTitle("Reverb")
addView(AKResourcesAudioFileLoaderView(player: player, filenames: playgroundAudioFiles))
addView(AKSlider(property: "Mix", value: reverb.dryWetMix) { sliderValue in
reverb.dryWetMix = sliderValue
})
let presets = ["Cathedral", "Large Hall", "Large Hall 2",
"Large Room", "Large Room 2", "Medium Chamber",
"Medium Hall", "Medium Hall 2", "Medium Hall 3",
"Medium Room", "Plate", "Small Room"]
addView(AKPresetLoaderView(presets: presets) { preset in
switch preset {
case "Cathedral":
reverb.loadFactoryPreset(.cathedral)
case "Large Hall":
reverb.loadFactoryPreset(.largeHall)
case "Large Hall 2":
reverb.loadFactoryPreset(.largeHall2)
case "Large Room":
reverb.loadFactoryPreset(.largeRoom)
case "Large Room 2":
reverb.loadFactoryPreset(.largeRoom2)
case "Medium Chamber":
reverb.loadFactoryPreset(.mediumChamber)
case "Medium Hall":
reverb.loadFactoryPreset(.mediumHall)
case "Medium Hall 2":
reverb.loadFactoryPreset(.mediumHall2)
case "Medium Hall 3":
reverb.loadFactoryPreset(.mediumHall3)
case "Medium Room":
reverb.loadFactoryPreset(.mediumRoom)
case "Plate":
reverb.loadFactoryPreset(.plate)
case "Small Room":
reverb.loadFactoryPreset(.smallRoom)
default:
break
}
})
}
}
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
PlaygroundPage.current.liveView = LiveView()
| 32.189189 | 96 | 0.605793 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.